diff --git a/go.sum b/go.sum index 0ead9d6..868be82 100644 --- a/go.sum +++ b/go.sum @@ -10,62 +10,45 @@ github.com/ScaleFT/sshkeys v0.0.0-20200327173127-6142f742bca5 h1:VauE2GcJNZFun2O github.com/ScaleFT/sshkeys v0.0.0-20200327173127-6142f742bca5/go.mod h1:gxOHeajFfvGQh/fxlC8oOKBe23xnnJTif00IFFbiT+o= github.com/alexedwards/argon2id v1.0.0 h1:wJzDx66hqWX7siL/SRUmgz3F8YMrd/nfX/xHHcQQP0w= github.com/alexedwards/argon2id v1.0.0/go.mod h1:tYKkqIjzXvZdzPvADMWOEZ+l6+BD6CtBXMj5fnJppiw= -github.com/aws/aws-sdk-go-v2 v1.39.6 h1:2JrPCVgWJm7bm83BDwY5z8ietmeJUbh3O2ACnn+Xsqk= -github.com/aws/aws-sdk-go-v2 v1.39.6/go.mod h1:c9pm7VwuW0UPxAEYGyTmyurVcNrbF6Rt/wixFqDhcjE= +github.com/aws/aws-sdk-go-v2 v1.40.1 h1:difXb4maDZkRH0x//Qkwcfpdg1XQVXEAEs2DdXldFFc= github.com/aws/aws-sdk-go-v2 v1.40.1/go.mod h1:MayyLB8y+buD9hZqkCW3kX1AKq07Y5pXxtgB+rRFhz0= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.3 h1:DHctwEM8P8iTXFxC/QK0MRjwEpWQeM9yzidCRjldUz0= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.3/go.mod h1:xdCzcZEtnSTKVDOmUZs4l/j3pSV6rpo1WXl5ugNsL8Y= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.4 h1:489krEF9xIGkOaaX3CE/Be2uWjiXrkCH6gUX+bZA/BU= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.4/go.mod h1:IOAPF6oT9KCsceNTvvYMNHy0+kMF8akOjeDvPENWxp4= -github.com/aws/aws-sdk-go-v2/config v1.31.20 h1:/jWF4Wu90EhKCgjTdy1DGxcbcbNrjfBHvksEL79tfQc= -github.com/aws/aws-sdk-go-v2/config v1.31.20/go.mod h1:95Hh1Tc5VYKL9NJ7tAkDcqeKt+MCXQB1hQZaRdJIZE0= +github.com/aws/aws-sdk-go-v2/config v1.32.3 h1:cpz7H2uMNTDa0h/5CYL5dLUEzPSLo2g0NkbxTRJtSSU= github.com/aws/aws-sdk-go-v2/config v1.32.3/go.mod h1:srtPKaJJe3McW6T/+GMBZyIPc+SeqJsNPJsd4mOYZ6s= -github.com/aws/aws-sdk-go-v2/credentials v1.18.24 h1:iJ2FmPT35EaIB0+kMa6TnQ+PwG5A1prEdAw+PsMzfHg= -github.com/aws/aws-sdk-go-v2/credentials v1.18.24/go.mod h1:U91+DrfjAiXPDEGYhh/x29o4p0qHX5HDqG7y5VViv64= +github.com/aws/aws-sdk-go-v2/credentials v1.19.3 h1:01Ym72hK43hjwDeJUfi1l2oYLXBAOR8gNSZNmXmvuas= github.com/aws/aws-sdk-go-v2/credentials v1.19.3/go.mod h1:55nWF/Sr9Zvls0bGnWkRxUdhzKqj9uRNlPvgV1vgxKc= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.13 h1:T1brd5dR3/fzNFAQch/iBKeX07/ffu/cLu+q+RuzEWk= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.13/go.mod h1:Peg/GBAQ6JDt+RoBf4meB1wylmAipb7Kg2ZFakZTlwk= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.15 h1:utxLraaifrSBkeyII9mIbVwXXWrZdlPO7FIKmyLCEcY= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.15/go.mod h1:hW6zjYUDQwfz3icf4g2O41PHi77u10oAzJ84iSzR/lo= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.13 h1:a+8/MLcWlIxo1lF9xaGt3J/u3yOZx+CdSveSNwjhD40= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.13/go.mod h1:oGnKwIYZ4XttyU2JWxFrwvhF6YKiK/9/wmE3v3Iu9K8= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.15 h1:Y5YXgygXwDI5P4RkteB5yF7v35neH7LfJKBG+hzIons= github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.15/go.mod h1:K+/1EpG42dFSY7CBj+Fruzm8PsCGWTXJ3jdeJ659oGQ= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.13 h1:HBSI2kDkMdWz4ZM7FjwE7e/pWDEZ+nR95x8Ztet1ooY= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.13/go.mod h1:YE94ZoDArI7awZqJzBAZ3PDD2zSfuP7w6P2knOzIn8M= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.15 h1:AvltKnW9ewxX2hFmQS0FyJH93aSvJVUEFvXfU+HWtSE= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.15/go.mod h1:3I4oCdZdmgrREhU74qS1dK9yZ62yumob+58AbFR4cQA= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4 h1:WKuaxf++XKWlHWu9ECbMlha8WOEGm0OUEZqm4K/Gcfk= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4/go.mod h1:ZWy7j6v1vWGmPReu0iSGvRiise4YI5SkR3OHKTZ6Wuc= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.13 h1:eg/WYAa12vqTphzIdWMzqYRVKKnCboVPRlvaybNCqPA= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.13/go.mod h1:/FDdxWhz1486obGrKKC1HONd7krpk38LBt+dutLcN9k= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.15 h1:NLYTEyZmVZo0Qh183sC8nC+ydJXOOeIL/qI/sS3PdLY= github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.15/go.mod h1:Z803iB3B0bc8oJV8zH2PERLRfQUJ2n2BXISpsA4+O1M= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.3 h1:x2Ibm/Af8Fi+BH+Hsn9TXGdT+hKbDd5XOTZxTMxDk7o= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.3/go.mod h1:IW1jwyrQgMdhisceG8fQLmQIydcT/jWY21rFhzgaKwo= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.4 h1:0ryTNEdJbzUCEWkVXEXoqlXV72J5keC1GvILMOuD00E= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.4/go.mod h1:HQ4qwNZh32C3CBeO6iJLQlgtMzqeG17ziAA/3KDJFow= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.4 h1:NvMjwvv8hpGUILarKw7Z4Q0w1H9anXKsesMxtw++MA4= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.4/go.mod h1:455WPHSwaGj2waRSpQp7TsnpOnBfw8iDfPfbwl7KPJE= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.6 h1:P1MU/SuhadGvg2jtviDXPEejU3jBNhoeeAlRadHzvHI= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.6/go.mod h1:5KYaMG6wmVKMFBSfWoyG/zH8pWwzQFnKgpoSRlXHKdQ= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.13 h1:kDqdFvMY4AtKoACfzIGD8A0+hbT41KTKF//gq7jITfM= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.13/go.mod h1:lmKuogqSU3HzQCwZ9ZtcqOc5XGMqtDK7OIc2+DxiUEg= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.15 h1:3/u/4yZOffg5jdNk1sDpOQ4Y+R6Xbh+GzpDrSZjuy3U= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.15/go.mod h1:4Zkjq0FKjE78NKjabuM4tRXKFzUJWXgP0ItEZK8l7JU= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.13 h1:zhBJXdhWIFZ1acfDYIhu4+LCzdUS2Vbcum7D01dXlHQ= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.13/go.mod h1:JaaOeCE368qn2Hzi3sEzY6FgAZVCIYcC2nwbro2QCh8= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.15 h1:wsSQ4SVz5YE1crz0Ap7VBZrV4nNqZt4CIBBT8mnwoNc= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.15/go.mod h1:I7sditnFGtYMIqPRU1QoHZAUrXkGp4SczmlLwrNPlD0= -github.com/aws/aws-sdk-go-v2/service/route53 v1.59.5 h1:4Uy8lhrh4E9jS/MtmzjuEuvX7zOZTbNuPe+zkvtvRRU= -github.com/aws/aws-sdk-go-v2/service/route53 v1.59.5/go.mod h1:TUbfYOisWZWyT2qjmlMh93ERw1Ry8G4q/yT2Q8TsDag= +github.com/aws/aws-sdk-go-v2/service/route53 v1.61.1 h1:ik9tMw+xWZqzffOtGH3PfV0Yy/V+QsCb1XYXXXjUskk= github.com/aws/aws-sdk-go-v2/service/route53 v1.61.1/go.mod h1:JRqmldxIPU6uck5bcFS8ExwwG2mUwfy+jiUmismOxJs= -github.com/aws/aws-sdk-go-v2/service/s3 v1.90.2 h1:DhdbtDl4FdNlj31+xiRXANxEE+eC7n8JQz+/ilwQ8Uc= -github.com/aws/aws-sdk-go-v2/service/s3 v1.90.2/go.mod h1:+wArOOrcHUevqdto9k1tKOF5++YTe9JEcPSc9Tx2ZSw= +github.com/aws/aws-sdk-go-v2/service/s3 v1.93.0 h1:IrbE3B8O9pm3lsg96AXIN5MXX4pECEuExh/A0Du3AuI= github.com/aws/aws-sdk-go-v2/service/s3 v1.93.0/go.mod h1:/sJLzHtiiZvs6C1RbxS/anSAFwZD6oC6M/kotQzOiLw= +github.com/aws/aws-sdk-go-v2/service/signin v1.0.3 h1:d/6xOGIllc/XW1lzG9a4AUBMmpLA9PXcQnVPTuHHcik= github.com/aws/aws-sdk-go-v2/service/signin v1.0.3/go.mod h1:fQ7E7Qj9GiW8y0ClD7cUJk3Bz5Iw8wZkWDHsTe8vDKs= -github.com/aws/aws-sdk-go-v2/service/sso v1.30.3 h1:NjShtS1t8r5LUfFVtFeI8xLAHQNTa7UI0VawXlrBMFQ= -github.com/aws/aws-sdk-go-v2/service/sso v1.30.3/go.mod h1:fKvyjJcz63iL/ftA6RaM8sRCtN4r4zl4tjL3qw5ec7k= +github.com/aws/aws-sdk-go-v2/service/sso v1.30.6 h1:8sTTiw+9yuNXcfWeqKF2x01GqCF49CpP4Z9nKrrk/ts= github.com/aws/aws-sdk-go-v2/service/sso v1.30.6/go.mod h1:8WYg+Y40Sn3X2hioaaWAAIngndR8n1XFdRPPX+7QBaM= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.7 h1:gTsnx0xXNQ6SBbymoDvcoRHL+q4l/dAFsQuKfDWSaGc= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.7/go.mod h1:klO+ejMvYsB4QATfEOIXk8WAEwN4N0aBfJpvC+5SZBo= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.11 h1:E+KqWoVsSrj1tJ6I/fjDIu5xoS2Zacuu1zT+H7KtiIk= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.11/go.mod h1:qyWHz+4lvkXcr3+PoGlGHEI+3DLLiU6/GdrFfMaAhB0= -github.com/aws/aws-sdk-go-v2/service/sts v1.40.2 h1:HK5ON3KmQV2HcAunnx4sKLB9aPf3gKGwVAf7xnx0QT0= -github.com/aws/aws-sdk-go-v2/service/sts v1.40.2/go.mod h1:E19xDjpzPZC7LS2knI9E6BaRFDK43Eul7vd6rSq2HWk= +github.com/aws/aws-sdk-go-v2/service/sts v1.41.3 h1:tzMkjh0yTChUqJDgGkcDdxvZDSrJ/WB6R6ymI5ehqJI= github.com/aws/aws-sdk-go-v2/service/sts v1.41.3/go.mod h1:T270C0R5sZNLbWUe8ueiAF42XSZxxPocTaGSgs5c/60= -github.com/aws/smithy-go v1.23.2 h1:Crv0eatJUQhaManss33hS5r40CG3ZFH+21XSkqMrIUM= -github.com/aws/smithy-go v1.23.2/go.mod h1:LEj2LM3rBRQJxPZTB4KuzZkaZYnZPnvgIhb4pu07mx0= +github.com/aws/smithy-go v1.24.0 h1:LpilSUItNPFr1eY85RYgTIg5eIEPtvFbskaFcmmIUnk= github.com/aws/smithy-go v1.24.0/go.mod h1:LEj2LM3rBRQJxPZTB4KuzZkaZYnZPnvgIhb4pu07mx0= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= @@ -77,8 +60,7 @@ github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UF github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M= github.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU= -github.com/coreos/go-oidc/v3 v3.16.0 h1:qRQUCFstKpXwmEjDQTIbyY/5jF00+asXzSkmkoa/mow= -github.com/coreos/go-oidc/v3 v3.16.0/go.mod h1:wqPbKFrVnE90vty060SB40FCJ8fTHTxSwyXJqZH+sI8= +github.com/coreos/go-oidc/v3 v3.17.0 h1:hWBGaQfbi0iVviX4ibC7bk8OKT5qNr4klBaCHVNvehc= github.com/coreos/go-oidc/v3 v3.17.0/go.mod h1:wqPbKFrVnE90vty060SB40FCJ8fTHTxSwyXJqZH+sI8= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= @@ -248,8 +230,7 @@ github.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDc github.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/sosedoff/pgweb v0.16.2 h1:1F1CWlCLSEgSctMva+nYuUibdhyiCUzlXyU5MQUJbFM= -github.com/sosedoff/pgweb v0.16.2/go.mod h1:ER7fsBddI3h7MQKO5RsUPi7Q/PWZYSKcI61kTp369Rw= +github.com/sosedoff/pgweb v0.17.0 h1:2WSPajNyqStS5oulvfdKIBaWQTy/qNBREBp51h4yiLU= github.com/sosedoff/pgweb v0.17.0/go.mod h1:fY82HStJ/n/JCvzHsJmVT6BDYiWxSQG6CvqH+biuUbM= github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw= github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8/go.mod h1:3n1Cwaq1E1/1lhQhtRK2ts/ZwZEhjcQeJQ1RuC6Q/8U= @@ -257,8 +238,7 @@ github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I= github.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg= github.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY= github.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo= -github.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s= -github.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0= +github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU= github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4= github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= @@ -310,8 +290,7 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= -golang.org/x/crypto v0.44.0 h1:A97SsFvM3AIwEEmTBiaxPPTYpDC47w720rdiiUvgoAU= -golang.org/x/crypto v0.44.0/go.mod h1:013i+Nw79BMiQiMsOPcVCB5ZIJbYkerPrGnOa00tvmc= +golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q= golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4= 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= @@ -323,8 +302,7 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.46.0 h1:giFlY12I07fugqwPuWJi68oOnpfqFnJIJzaIIm2JVV4= -golang.org/x/net v0.46.0/go.mod h1:Q9BGdFy1y4nkUwiLvT5qtyhAnEHgnQ/zd8PfU6nc210= +golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY= golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU= golang.org/x/oauth2 v0.33.0 h1:4Q+qn+E5z8gPRJfmRy7C2gGG3T4jIprK6aSYgTXGRpo= golang.org/x/oauth2 v0.33.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= diff --git a/internal/web/dist/assets/index-BRRMZeeQ.js.br b/internal/web/dist/assets/index-BRRMZeeQ.js.br deleted file mode 100644 index dcf9b44..0000000 Binary files a/internal/web/dist/assets/index-BRRMZeeQ.js.br and /dev/null differ diff --git a/internal/web/dist/assets/index-BRRMZeeQ.js.gz b/internal/web/dist/assets/index-BRRMZeeQ.js.gz deleted file mode 100644 index efd2895..0000000 Binary files a/internal/web/dist/assets/index-BRRMZeeQ.js.gz and /dev/null differ diff --git a/internal/web/dist/assets/index-BRRMZeeQ.js b/internal/web/dist/assets/index-BwyDjDcq.js similarity index 58% rename from internal/web/dist/assets/index-BRRMZeeQ.js rename to internal/web/dist/assets/index-BwyDjDcq.js index 6d4ca75..845ea8f 100644 --- a/internal/web/dist/assets/index-BRRMZeeQ.js +++ b/internal/web/dist/assets/index-BwyDjDcq.js @@ -1,13 +1,13 @@ -import{r as R,R as Je,a as B3,b as U3,c as hY,d as R_,e as mC,u as T_,L as OR,N as LE,O as K3,f as pY,g as Um,h as fY,i as mY,j as ps,B as gY}from"./react-B7S5QDrv.js";(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))o(d);new MutationObserver(d=>{for(const p of d)if(p.type==="childList")for(const m of p.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&o(m)}).observe(document,{childList:!0,subtree:!0});function s(d){const p={};return d.integrity&&(p.integrity=d.integrity),d.referrerPolicy&&(p.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?p.credentials="include":d.crossOrigin==="anonymous"?p.credentials="omit":p.credentials="same-origin",p}function o(d){if(d.ep)return;d.ep=!0;const p=s(d);fetch(d.href,p)}})();var kR={exports:{}},tb={};var pM;function yY(){if(pM)return tb;pM=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function s(o,d,p){var m=null;if(p!==void 0&&(m=""+p),d.key!==void 0&&(m=""+d.key),"key"in d){p={};for(var g in d)g!=="key"&&(p[g]=d[g])}else p=d;return d=p.ref,{$$typeof:e,type:o,key:m,ref:d!==void 0?d:null,props:p}}return tb.Fragment=r,tb.jsx=s,tb.jsxs=s,tb}var fM;function vY(){return fM||(fM=1,kR.exports=yY()),kR.exports}var u=vY(),xY=(e,r,s,o,d,p,m,g)=>{let b=document.documentElement,S=["light","dark"];function E(T){(Array.isArray(e)?e:[e]).forEach(M=>{let I=M==="class",q=I&&p?d.map(G=>p[G]||G):d;I?(b.classList.remove(...q),b.classList.add(p&&p[T]?p[T]:T)):b.setAttribute(M,T)}),A(T)}function A(T){g&&S.includes(T)&&(b.style.colorScheme=T)}function k(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(o)E(o);else try{let T=localStorage.getItem(r)||s,M=m&&T==="system"?k():T;E(M)}catch{}},mM=["light","dark"],V3="(prefers-color-scheme: dark)",bY=typeof window>"u",__=R.createContext(void 0),wY={setTheme:e=>{},themes:[]},$_=()=>{var e;return(e=R.useContext(__))!=null?e:wY},SY=e=>R.useContext(__)?R.createElement(R.Fragment,null,e.children):R.createElement(jY,{...e}),EY=["light","dark"],jY=({forcedTheme:e,disableTransitionOnChange:r=!1,enableSystem:s=!0,enableColorScheme:o=!0,storageKey:d="theme",themes:p=EY,defaultTheme:m=s?"system":"light",attribute:g="data-theme",value:b,children:S,nonce:E,scriptProps:A})=>{let[k,T]=R.useState(()=>AY(d,m)),[M,I]=R.useState(()=>k==="system"?RR():k),q=b?Object.values(b):p,G=R.useCallback(ee=>{let oe=ee;if(!oe)return;ee==="system"&&s&&(oe=RR());let Q=b?b[oe]:oe,ne=r?OY(E):null,de=document.documentElement,Ce=xe=>{xe==="class"?(de.classList.remove(...q),Q&&de.classList.add(Q)):xe.startsWith("data-")&&(Q?de.setAttribute(xe,Q):de.removeAttribute(xe))};if(Array.isArray(g)?g.forEach(Ce):Ce(g),o){let xe=mM.includes(m)?m:null,le=mM.includes(oe)?oe:xe;de.style.colorScheme=le}ne?.()},[E]),K=R.useCallback(ee=>{let oe=typeof ee=="function"?ee(k):ee;T(oe);try{localStorage.setItem(d,oe)}catch{}},[k]),X=R.useCallback(ee=>{let oe=RR(ee);I(oe),k==="system"&&s&&!e&&G("system")},[k,e]);R.useEffect(()=>{let ee=window.matchMedia(V3);return ee.addListener(X),X(ee),()=>ee.removeListener(X)},[X]),R.useEffect(()=>{let ee=oe=>{oe.key===d&&(oe.newValue?T(oe.newValue):K(m))};return window.addEventListener("storage",ee),()=>window.removeEventListener("storage",ee)},[K]),R.useEffect(()=>{G(e??k)},[e,k]);let z=R.useMemo(()=>({theme:k,setTheme:K,forcedTheme:e,resolvedTheme:k==="system"?M:k,themes:s?[...p,"system"]:p,systemTheme:s?M:void 0}),[k,K,e,M,s,p]);return R.createElement(__.Provider,{value:z},R.createElement(CY,{forcedTheme:e,storageKey:d,attribute:g,enableSystem:s,enableColorScheme:o,defaultTheme:m,value:b,themes:p,nonce:E,scriptProps:A}),S)},CY=R.memo(({forcedTheme:e,storageKey:r,attribute:s,enableSystem:o,enableColorScheme:d,defaultTheme:p,value:m,themes:g,nonce:b,scriptProps:S})=>{let E=JSON.stringify([s,r,p,e,g,m,o,d]).slice(1,-1);return R.createElement("script",{...S,suppressHydrationWarning:!0,nonce:typeof window>"u"?b:"",dangerouslySetInnerHTML:{__html:`(${xY.toString()})(${E})`}})}),AY=(e,r)=>{if(bY)return;let s;try{s=localStorage.getItem(e)||void 0}catch{}return s||r},OY=e=>{let r=document.createElement("style");return e&&r.setAttribute("nonce",e),r.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(r),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(r)},1)}},RR=e=>(e||(e=window.matchMedia(V3)),e.matches?"dark":"light");function kY({children:e,defaultTheme:r="system",storageKey:s="vite-ui-theme"}){return u.jsx(SY,{attribute:"class",defaultTheme:r,enableSystem:!0,storageKey:s,disableTransitionOnChange:!0,children:e})}var jg=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},RY={setTimeout:(e,r)=>setTimeout(e,r),clearTimeout:e=>clearTimeout(e),setInterval:(e,r)=>setInterval(e,r),clearInterval:e=>clearInterval(e)},TY=class{#e=RY;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,r){return this.#e.setTimeout(e,r)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,r){return this.#e.setInterval(e,r)}clearInterval(e){this.#e.clearInterval(e)}},vp=new TY;function _Y(e){setTimeout(e,0)}var Cp=typeof window>"u"||"Deno"in globalThis;function Pi(){}function $Y(e,r){return typeof e=="function"?e(r):e}function ST(e){return typeof e=="number"&&e>=0&&e!==1/0}function H3(e,r){return Math.max(e+(r||0)-Date.now(),0)}function zd(e,r){return typeof e=="function"?e(r):e}function ro(e,r){return typeof e=="function"?e(r):e}function gM(e,r){const{type:s="all",exact:o,fetchStatus:d,predicate:p,queryKey:m,stale:g}=e;if(m){if(o){if(r.queryHash!==N_(m,r.options))return!1}else if(!Ib(r.queryKey,m))return!1}if(s!=="all"){const b=r.isActive();if(s==="active"&&!b||s==="inactive"&&b)return!1}return!(typeof g=="boolean"&&r.isStale()!==g||d&&d!==r.state.fetchStatus||p&&!p(r))}function yM(e,r){const{exact:s,status:o,predicate:d,mutationKey:p}=e;if(p){if(!r.options.mutationKey)return!1;if(s){if(Ap(r.options.mutationKey)!==Ap(p))return!1}else if(!Ib(r.options.mutationKey,p))return!1}return!(o&&r.state.status!==o||d&&!d(r))}function N_(e,r){return(r?.queryKeyHashFn||Ap)(e)}function Ap(e){return JSON.stringify(e,(r,s)=>ET(s)?Object.keys(s).sort().reduce((o,d)=>(o[d]=s[d],o),{}):s)}function Ib(e,r){return e===r?!0:typeof e!=typeof r?!1:e&&r&&typeof e=="object"&&typeof r=="object"?Object.keys(r).every(s=>Ib(e[s],r[s])):!1}var NY=Object.prototype.hasOwnProperty;function G3(e,r){if(e===r)return e;const s=vM(e)&&vM(r);if(!s&&!(ET(e)&&ET(r)))return r;const d=(s?e:Object.keys(e)).length,p=s?r:Object.keys(r),m=p.length,g=s?new Array(m):{};let b=0;for(let S=0;S{vp.setTimeout(r,e)})}function jT(e,r,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,r):s.structuralSharing!==!1?G3(e,r):r}function PY(e,r,s=0){const o=[...e,r];return s&&o.length>s?o.slice(1):o}function MY(e,r,s=0){const o=[r,...e];return s&&o.length>s?o.slice(0,-1):o}var D_=Symbol();function X3(e,r){return!e.queryFn&&r?.initialPromise?()=>r.initialPromise:!e.queryFn||e.queryFn===D_?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Y3(e,r){return typeof e=="function"?e(...r):!!e}var IY=class extends jg{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Cp&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(r=>{r(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},P_=new IY;function CT(){let e,r;const s=new Promise((d,p)=>{e=d,r=p});s.status="pending",s.catch(()=>{});function o(d){Object.assign(s,d),delete s.resolve,delete s.reject}return s.resolve=d=>{o({status:"fulfilled",value:d}),e(d)},s.reject=d=>{o({status:"rejected",reason:d}),r(d)},s}var zY=_Y;function LY(){let e=[],r=0,s=g=>{g()},o=g=>{g()},d=zY;const p=g=>{r?e.push(g):d(()=>{s(g)})},m=()=>{const g=e;e=[],g.length&&d(()=>{o(()=>{g.forEach(b=>{s(b)})})})};return{batch:g=>{let b;r++;try{b=g()}finally{r--,r||m()}return b},batchCalls:g=>(...b)=>{p(()=>{g(...b)})},schedule:p,setNotifyFunction:g=>{s=g},setBatchNotifyFunction:g=>{o=g},setScheduler:g=>{d=g}}}var Cs=LY(),FY=class extends jg{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Cp&&window.addEventListener){const r=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(s=>{s(e)}))}isOnline(){return this.#e}},Rj=new FY;function qY(e){return Math.min(1e3*2**e,3e4)}function Z3(e){return(e??"online")==="online"?Rj.isOnline():!0}var AT=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function W3(e){let r=!1,s=0,o;const d=CT(),p=()=>d.status!=="pending",m=I=>{if(!p()){const q=new AT(I);k(q),e.onCancel?.(q)}},g=()=>{r=!0},b=()=>{r=!1},S=()=>P_.isFocused()&&(e.networkMode==="always"||Rj.isOnline())&&e.canRun(),E=()=>Z3(e.networkMode)&&e.canRun(),A=I=>{p()||(o?.(),d.resolve(I))},k=I=>{p()||(o?.(),d.reject(I))},T=()=>new Promise(I=>{o=q=>{(p()||S())&&I(q)},e.onPause?.()}).then(()=>{o=void 0,p()||e.onContinue?.()}),M=()=>{if(p())return;let I;const q=s===0?e.initialPromise:void 0;try{I=q??e.fn()}catch(G){I=Promise.reject(G)}Promise.resolve(I).then(A).catch(G=>{if(p())return;const K=e.retry??(Cp?0:3),X=e.retryDelay??qY,z=typeof X=="function"?X(s,G):X,ee=K===!0||typeof K=="number"&&sS()?void 0:T()).then(()=>{r?k(G):M()})})};return{promise:d,status:()=>d.status,cancel:m,continue:()=>(o?.(),d),cancelRetry:g,continueRetry:b,canStart:E,start:()=>(E()?M():T().then(M),d)}}var J3=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ST(this.gcTime)&&(this.#e=vp.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Cp?1/0:300*1e3))}clearGcTimeout(){this.#e&&(vp.clearTimeout(this.#e),this.#e=void 0)}},BY=class extends J3{#e;#t;#n;#s;#r;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#n=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=wM(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=wM(this.options);r.data!==void 0&&(this.setState(bM(r.data,r.dataUpdatedAt)),this.#e=r)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,r){const s=jT(this.state.data,e,this.options);return this.#i({data:s,type:"success",dataUpdatedAt:r?.updatedAt,manual:r?.manual}),s}setState(e,r){this.#i({type:"setState",state:e,setStateOptions:r})}cancel(e){const r=this.#r?.promise;return this.#r?.cancel(e),r?r.then(Pi).catch(Pi):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>ro(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===D_||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>zd(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!H3(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(r=>r.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(r=>r.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(r=>r!==e),this.observers.length||(this.#r&&(this.#o?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,r){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&r?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const g=this.observers.find(b=>b.options.queryFn);g&&this.setOptions(g.options)}const s=new AbortController,o=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(this.#o=!0,s.signal)})},d=()=>{const g=X3(this.options,r),S=(()=>{const E={client:this.#s,queryKey:this.queryKey,meta:this.meta};return o(E),E})();return this.#o=!1,this.options.persister?this.options.persister(g,S,this):g(S)},m=(()=>{const g={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:d};return o(g),g})();this.options.behavior?.onFetch(m,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==m.fetchOptions?.meta)&&this.#i({type:"fetch",meta:m.fetchOptions?.meta}),this.#r=W3({initialPromise:r?.initialPromise,fn:m.fetchFn,onCancel:g=>{g instanceof AT&&g.revert&&this.setState({...this.#t,fetchStatus:"idle"}),s.abort()},onFail:(g,b)=>{this.#i({type:"failed",failureCount:g,error:b})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:m.options.retry,retryDelay:m.options.retryDelay,networkMode:m.options.networkMode,canRun:()=>!0});try{const g=await this.#r.start();if(g===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(g),this.#n.config.onSuccess?.(g,this),this.#n.config.onSettled?.(g,this.state.error,this),g}catch(g){if(g instanceof AT){if(g.silent)return this.#r.promise;if(g.revert){if(this.state.data===void 0)throw g;return this.state.data}}throw this.#i({type:"error",error:g}),this.#n.config.onError?.(g,this),this.#n.config.onSettled?.(this.state.data,g,this),g}finally{this.scheduleGc()}}#i(e){const r=s=>{switch(e.type){case"failed":return{...s,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...Q3(s.data,this.options),fetchMeta:e.meta??null};case"success":const o={...s,...bM(e.data,e.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?o:void 0,o;case"error":const d=e.error;return{...s,error:d,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:d,fetchStatus:"idle",status:"error"};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...e.state}}};this.state=r(this.state),Cs.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function Q3(e,r){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Z3(r.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function bM(e,r){return{data:e,dataUpdatedAt:r??Date.now(),error:null,isInvalidated:!1,status:"success"}}function wM(e){const r=typeof e.initialData=="function"?e.initialData():e.initialData,s=r!==void 0,o=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:r,dataUpdateCount:0,dataUpdatedAt:s?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var UY=class extends jg{constructor(e,r){super(),this.options=r,this.#e=e,this.#i=null,this.#o=CT(),this.bindMethods(),this.setOptions(r)}#e;#t=void 0;#n=void 0;#s=void 0;#r;#a;#o;#i;#m;#h;#p;#c;#u;#l;#f=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),SM(this.#t,this.options)?this.#d():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return OT(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return OT(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const r=this.options,s=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ro(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#t.setOptions(this.options),r._defaulted&&!kj(this.options,r)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const o=this.hasListeners();o&&EM(this.#t,s,this.options,r)&&this.#d(),this.updateResult(),o&&(this.#t!==s||ro(this.options.enabled,this.#t)!==ro(r.enabled,this.#t)||zd(this.options.staleTime,this.#t)!==zd(r.staleTime,this.#t))&&this.#g();const d=this.#y();o&&(this.#t!==s||ro(this.options.enabled,this.#t)!==ro(r.enabled,this.#t)||d!==this.#l)&&this.#v(d)}getOptimisticResult(e){const r=this.#e.getQueryCache().build(this.#e,e),s=this.createResult(r,e);return VY(this,s)&&(this.#s=s,this.#a=this.options,this.#r=this.#t.state),s}getCurrentResult(){return this.#s}trackResult(e,r){return new Proxy(e,{get:(s,o)=>(this.trackProp(o),r?.(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,o))})}trackProp(e){this.#f.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const r=this.#e.defaultQueryOptions(e),s=this.#e.getQueryCache().build(this.#e,r);return s.fetch().then(()=>this.createResult(s,r))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#d(e){this.#S();let r=this.#t.fetch(this.options,e);return e?.throwOnError||(r=r.catch(Pi)),r}#g(){this.#b();const e=zd(this.options.staleTime,this.#t);if(Cp||this.#s.isStale||!ST(e))return;const s=H3(this.#s.dataUpdatedAt,e)+1;this.#c=vp.setTimeout(()=>{this.#s.isStale||this.updateResult()},s)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#w(),this.#l=e,!(Cp||ro(this.options.enabled,this.#t)===!1||!ST(this.#l)||this.#l===0)&&(this.#u=vp.setInterval(()=>{(this.options.refetchIntervalInBackground||P_.isFocused())&&this.#d()},this.#l))}#x(){this.#g(),this.#v(this.#y())}#b(){this.#c&&(vp.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(vp.clearInterval(this.#u),this.#u=void 0)}createResult(e,r){const s=this.#t,o=this.options,d=this.#s,p=this.#r,m=this.#a,b=e!==s?e.state:this.#n,{state:S}=e;let E={...S},A=!1,k;if(r._optimisticResults){const ne=this.hasListeners(),de=!ne&&SM(e,r),Ce=ne&&EM(e,s,r,o);(de||Ce)&&(E={...E,...Q3(S.data,e.options)}),r._optimisticResults==="isRestoring"&&(E.fetchStatus="idle")}let{error:T,errorUpdatedAt:M,status:I}=E;k=E.data;let q=!1;if(r.placeholderData!==void 0&&k===void 0&&I==="pending"){let ne;d?.isPlaceholderData&&r.placeholderData===m?.placeholderData?(ne=d.data,q=!0):ne=typeof r.placeholderData=="function"?r.placeholderData(this.#p?.state.data,this.#p):r.placeholderData,ne!==void 0&&(I="success",k=jT(d?.data,ne,r),A=!0)}if(r.select&&k!==void 0&&!q)if(d&&k===p?.data&&r.select===this.#m)k=this.#h;else try{this.#m=r.select,k=r.select(k),k=jT(d?.data,k,r),this.#h=k,this.#i=null}catch(ne){this.#i=ne}this.#i&&(T=this.#i,k=this.#h,M=Date.now(),I="error");const G=E.fetchStatus==="fetching",K=I==="pending",X=I==="error",z=K&&G,ee=k!==void 0,Q={status:I,fetchStatus:E.fetchStatus,isPending:K,isSuccess:I==="success",isError:X,isInitialLoading:z,isLoading:z,data:k,dataUpdatedAt:E.dataUpdatedAt,error:T,errorUpdatedAt:M,failureCount:E.fetchFailureCount,failureReason:E.fetchFailureReason,errorUpdateCount:E.errorUpdateCount,isFetched:E.dataUpdateCount>0||E.errorUpdateCount>0,isFetchedAfterMount:E.dataUpdateCount>b.dataUpdateCount||E.errorUpdateCount>b.errorUpdateCount,isFetching:G,isRefetching:G&&!K,isLoadingError:X&&!ee,isPaused:E.fetchStatus==="paused",isPlaceholderData:A,isRefetchError:X&&ee,isStale:M_(e,r),refetch:this.refetch,promise:this.#o,isEnabled:ro(r.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const ne=xe=>{Q.status==="error"?xe.reject(Q.error):Q.data!==void 0&&xe.resolve(Q.data)},de=()=>{const xe=this.#o=Q.promise=CT();ne(xe)},Ce=this.#o;switch(Ce.status){case"pending":e.queryHash===s.queryHash&&ne(Ce);break;case"fulfilled":(Q.status==="error"||Q.data!==Ce.value)&&de();break;case"rejected":(Q.status!=="error"||Q.error!==Ce.reason)&&de();break}}return Q}updateResult(){const e=this.#s,r=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#a=this.options,this.#r.data!==void 0&&(this.#p=this.#t),kj(r,e))return;this.#s=r;const s=()=>{if(!e)return!0;const{notifyOnChangeProps:o}=this.options,d=typeof o=="function"?o():o;if(d==="all"||!d&&!this.#f.size)return!0;const p=new Set(d??this.#f);return this.options.throwOnError&&p.add("error"),Object.keys(this.#s).some(m=>{const g=m;return this.#s[g]!==e[g]&&p.has(g)})};this.#E({listeners:s()})}#S(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const r=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(r?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#E(e){Cs.batch(()=>{e.listeners&&this.listeners.forEach(r=>{r(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function KY(e,r){return ro(r.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&r.retryOnMount===!1)}function SM(e,r){return KY(e,r)||e.state.data!==void 0&&OT(e,r,r.refetchOnMount)}function OT(e,r,s){if(ro(r.enabled,e)!==!1&&zd(r.staleTime,e)!=="static"){const o=typeof s=="function"?s(e):s;return o==="always"||o!==!1&&M_(e,r)}return!1}function EM(e,r,s,o){return(e!==r||ro(o.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&M_(e,s)}function M_(e,r){return ro(r.enabled,e)!==!1&&e.isStaleByTime(zd(r.staleTime,e))}function VY(e,r){return!kj(e.getCurrentResult(),r)}function jM(e){return{onFetch:(r,s)=>{const o=r.options,d=r.fetchOptions?.meta?.fetchMore?.direction,p=r.state.data?.pages||[],m=r.state.data?.pageParams||[];let g={pages:[],pageParams:[]},b=0;const S=async()=>{let E=!1;const A=M=>{Object.defineProperty(M,"signal",{enumerable:!0,get:()=>(r.signal.aborted?E=!0:r.signal.addEventListener("abort",()=>{E=!0}),r.signal)})},k=X3(r.options,r.fetchOptions),T=async(M,I,q)=>{if(E)return Promise.reject();if(I==null&&M.pages.length)return Promise.resolve(M);const K=(()=>{const oe={client:r.client,queryKey:r.queryKey,pageParam:I,direction:q?"backward":"forward",meta:r.options.meta};return A(oe),oe})(),X=await k(K),{maxPages:z}=r.options,ee=q?MY:PY;return{pages:ee(M.pages,X,z),pageParams:ee(M.pageParams,I,z)}};if(d&&p.length){const M=d==="backward",I=M?HY:CM,q={pages:p,pageParams:m},G=I(o,q);g=await T(q,G,M)}else{const M=e??p.length;do{const I=b===0?m[0]??o.initialPageParam:CM(o,g);if(b>0&&I==null)break;g=await T(g,I),b++}while(br.options.persister?.(S,{client:r.client,queryKey:r.queryKey,meta:r.options.meta,signal:r.signal},s):r.fetchFn=S}}}function CM(e,{pages:r,pageParams:s}){const o=r.length-1;return r.length>0?e.getNextPageParam(r[o],r,s[o],s):void 0}function HY(e,{pages:r,pageParams:s}){return r.length>0?e.getPreviousPageParam?.(r[0],r,s[0],s):void 0}var GY=class extends J3{#e;#t;#n;#s;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||ez(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(r=>r!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const r=()=>{this.#r({type:"continue"})},s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=W3({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(new Error("No mutationFn found")),onFail:(p,m)=>{this.#r({type:"failed",failureCount:p,error:m})},onPause:()=>{this.#r({type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const o=this.state.status==="pending",d=!this.#s.canStart();try{if(o)r();else{this.#r({type:"pending",variables:e,isPaused:d}),await this.#n.config.onMutate?.(e,this,s);const m=await this.options.onMutate?.(e,s);m!==this.state.context&&this.#r({type:"pending",context:m,variables:e,isPaused:d})}const p=await this.#s.start();return await this.#n.config.onSuccess?.(p,e,this.state.context,this,s),await this.options.onSuccess?.(p,e,this.state.context,s),await this.#n.config.onSettled?.(p,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(p,null,e,this.state.context,s),this.#r({type:"success",data:p}),p}catch(p){try{throw await this.#n.config.onError?.(p,e,this.state.context,this,s),await this.options.onError?.(p,e,this.state.context,s),await this.#n.config.onSettled?.(void 0,p,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(void 0,p,e,this.state.context,s),p}finally{this.#r({type:"error",error:p})}}finally{this.#n.runNext(this)}}#r(e){const r=s=>{switch(e.type){case"failed":return{...s,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...s,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:e.error,failureCount:s.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Cs.batch(()=>{this.#t.forEach(s=>{s.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function ez(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var XY=class extends jg{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,r,s){const o=new GY({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(r),state:s});return this.add(o),o}add(e){this.#e.add(e);const r=FE(e);if(typeof r=="string"){const s=this.#t.get(r);s?s.push(e):this.#t.set(r,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const r=FE(e);if(typeof r=="string"){const s=this.#t.get(r);if(s)if(s.length>1){const o=s.indexOf(e);o!==-1&&s.splice(o,1)}else s[0]===e&&this.#t.delete(r)}}this.notify({type:"removed",mutation:e})}canRun(e){const r=FE(e);if(typeof r=="string"){const o=this.#t.get(r)?.find(d=>d.state.status==="pending");return!o||o===e}else return!0}runNext(e){const r=FE(e);return typeof r=="string"?this.#t.get(r)?.find(o=>o!==e&&o.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Cs.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const r={exact:!0,...e};return this.getAll().find(s=>yM(r,s))}findAll(e={}){return this.getAll().filter(r=>yM(e,r))}notify(e){Cs.batch(()=>{this.listeners.forEach(r=>{r(e)})})}resumePausedMutations(){const e=this.getAll().filter(r=>r.state.isPaused);return Cs.batch(()=>Promise.all(e.map(r=>r.continue().catch(Pi))))}};function FE(e){return e.options.scope?.id}var YY=class extends jg{#e;#t=void 0;#n;#s;constructor(r,s){super(),this.#e=r,this.setOptions(s),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){const s=this.options;this.options=this.#e.defaultMutationOptions(r),kj(this.options,s)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),s?.mutationKey&&this.options.mutationKey&&Ap(s.mutationKey)!==Ap(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(r){this.#r(),this.#a(r)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#a()}mutate(r,s){return this.#s=s,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(r)}#r(){const r=this.#n?.state??ez();this.#t={...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset}}#a(r){Cs.batch(()=>{if(this.#s&&this.hasListeners()){const s=this.#t.variables,o=this.#t.context,d={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};r?.type==="success"?(this.#s.onSuccess?.(r.data,s,o,d),this.#s.onSettled?.(r.data,null,s,o,d)):r?.type==="error"&&(this.#s.onError?.(r.error,s,o,d),this.#s.onSettled?.(void 0,r.error,s,o,d))}this.listeners.forEach(s=>{s(this.#t)})})}},ZY=class extends jg{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,r,s){const o=r.queryKey,d=r.queryHash??N_(o,r);let p=this.get(d);return p||(p=new BY({client:e,queryKey:o,queryHash:d,options:e.defaultQueryOptions(r),state:s,defaultOptions:e.getQueryDefaults(o)}),this.add(p)),p}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const r=this.#e.get(e.queryHash);r&&(e.destroy(),r===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Cs.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const r={exact:!0,...e};return this.getAll().find(s=>gM(r,s))}findAll(e={}){const r=this.getAll();return Object.keys(e).length>0?r.filter(s=>gM(e,s)):r}notify(e){Cs.batch(()=>{this.listeners.forEach(r=>{r(e)})})}onFocus(){Cs.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Cs.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},WY=class{#e;#t;#n;#s;#r;#a;#o;#i;constructor(e={}){this.#e=e.queryCache||new ZY,this.#t=e.mutationCache||new XY,this.#n=e.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=P_.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=Rj.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const r=this.defaultQueryOptions({queryKey:e});return this.#e.get(r.queryHash)?.state.data}ensureQueryData(e){const r=this.defaultQueryOptions(e),s=this.#e.build(this,r),o=s.state.data;return o===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(zd(r.staleTime,s))&&this.prefetchQuery(r),Promise.resolve(o))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:r,state:s})=>{const o=s.data;return[r,o]})}setQueryData(e,r,s){const o=this.defaultQueryOptions({queryKey:e}),p=this.#e.get(o.queryHash)?.state.data,m=$Y(r,p);if(m!==void 0)return this.#e.build(this,o).setData(m,{...s,manual:!0})}setQueriesData(e,r,s){return Cs.batch(()=>this.#e.findAll(e).map(({queryKey:o})=>[o,this.setQueryData(o,r,s)]))}getQueryState(e){const r=this.defaultQueryOptions({queryKey:e});return this.#e.get(r.queryHash)?.state}removeQueries(e){const r=this.#e;Cs.batch(()=>{r.findAll(e).forEach(s=>{r.remove(s)})})}resetQueries(e,r){const s=this.#e;return Cs.batch(()=>(s.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...e},r)))}cancelQueries(e,r={}){const s={revert:!0,...r},o=Cs.batch(()=>this.#e.findAll(e).map(d=>d.cancel(s)));return Promise.all(o).then(Pi).catch(Pi)}invalidateQueries(e,r={}){return Cs.batch(()=>(this.#e.findAll(e).forEach(s=>{s.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},r)))}refetchQueries(e,r={}){const s={...r,cancelRefetch:r.cancelRefetch??!0},o=Cs.batch(()=>this.#e.findAll(e).filter(d=>!d.isDisabled()&&!d.isStatic()).map(d=>{let p=d.fetch(void 0,s);return s.throwOnError||(p=p.catch(Pi)),d.state.fetchStatus==="paused"?Promise.resolve():p}));return Promise.all(o).then(Pi)}fetchQuery(e){const r=this.defaultQueryOptions(e);r.retry===void 0&&(r.retry=!1);const s=this.#e.build(this,r);return s.isStaleByTime(zd(r.staleTime,s))?s.fetch(r):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Pi).catch(Pi)}fetchInfiniteQuery(e){return e.behavior=jM(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Pi).catch(Pi)}ensureInfiniteQueryData(e){return e.behavior=jM(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Rj.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,r){this.#s.set(Ap(e),{queryKey:e,defaultOptions:r})}getQueryDefaults(e){const r=[...this.#s.values()],s={};return r.forEach(o=>{Ib(e,o.queryKey)&&Object.assign(s,o.defaultOptions)}),s}setMutationDefaults(e,r){this.#r.set(Ap(e),{mutationKey:e,defaultOptions:r})}getMutationDefaults(e){const r=[...this.#r.values()],s={};return r.forEach(o=>{Ib(e,o.mutationKey)&&Object.assign(s,o.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const r={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return r.queryHash||(r.queryHash=N_(r.queryKey,r)),r.refetchOnReconnect===void 0&&(r.refetchOnReconnect=r.networkMode!=="always"),r.throwOnError===void 0&&(r.throwOnError=!!r.suspense),!r.networkMode&&r.persister&&(r.networkMode="offlineFirst"),r.queryFn===D_&&(r.enabled=!1),r}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},tz=R.createContext(void 0),Hs=e=>{const r=R.useContext(tz);if(!r)throw new Error("No QueryClient set, use QueryClientProvider to set one");return r},JY=({client:e,children:r})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx(tz.Provider,{value:e,children:r})),nz=R.createContext(!1),QY=()=>R.useContext(nz);nz.Provider;function eZ(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var tZ=R.createContext(eZ()),nZ=()=>R.useContext(tZ),rZ=(e,r)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(r.isReset()||(e.retryOnMount=!1))},sZ=e=>{R.useEffect(()=>{e.clearReset()},[e])},iZ=({result:e,errorResetBoundary:r,throwOnError:s,query:o,suspense:d})=>e.isError&&!r.isReset()&&!e.isFetching&&o&&(d&&e.data===void 0||Y3(s,[e.error,o])),aZ=e=>{if(e.suspense){const s=d=>d==="static"?d:Math.max(d??1e3,1e3),o=e.staleTime;e.staleTime=typeof o=="function"?(...d)=>s(o(...d)):s(o),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},oZ=(e,r)=>e.isLoading&&e.isFetching&&!r,lZ=(e,r)=>e?.suspense&&r.isPending,AM=(e,r,s)=>r.fetchOptimistic(e).catch(()=>{s.clearReset()});function cZ(e,r,s){const o=QY(),d=nZ(),p=Hs(),m=p.defaultQueryOptions(e);p.getDefaultOptions().queries?._experimental_beforeQuery?.(m),m._optimisticResults=o?"isRestoring":"optimistic",aZ(m),rZ(m,d),sZ(d);const g=!p.getQueryCache().get(m.queryHash),[b]=R.useState(()=>new r(p,m)),S=b.getOptimisticResult(m),E=!o&&e.subscribed!==!1;if(R.useSyncExternalStore(R.useCallback(A=>{const k=E?b.subscribe(Cs.batchCalls(A)):Pi;return b.updateResult(),k},[b,E]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),R.useEffect(()=>{b.setOptions(m)},[m,b]),lZ(m,S))throw AM(m,b,d);if(iZ({result:S,errorResetBoundary:d,throwOnError:m.throwOnError,query:p.getQueryCache().get(m.queryHash),suspense:m.suspense}))throw S.error;return p.getDefaultOptions().queries?._experimental_afterQuery?.(m,S),m.experimental_prefetchInRender&&!Cp&&oZ(S,o)&&(g?AM(m,b,d):p.getQueryCache().get(m.queryHash)?.promise)?.catch(Pi).finally(()=>{b.updateResult()}),m.notifyOnChangeProps?S:b.trackResult(S)}function rr(e,r){return cZ(e,UY)}function nn(e,r){const s=Hs(),[o]=R.useState(()=>new YY(s,e));R.useEffect(()=>{o.setOptions(e)},[o,e]);const d=R.useSyncExternalStore(R.useCallback(m=>o.subscribe(Cs.batchCalls(m)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),p=R.useCallback((m,g)=>{o.mutate(m,g).catch(Pi)},[o]);if(d.error&&Y3(o.options.throwOnError,[d.error]))throw d.error;return{...d,mutate:p,mutateAsync:d.mutate}}const uZ=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),dZ=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(r,s,o)=>o?o.toUpperCase():s.toLowerCase()),OM=e=>{const r=dZ(e);return r.charAt(0).toUpperCase()+r.slice(1)},rz=(...e)=>e.filter((r,s,o)=>!!r&&r.trim()!==""&&o.indexOf(r)===s).join(" ").trim(),hZ=e=>{for(const r in e)if(r.startsWith("aria-")||r==="role"||r==="title")return!0};var pZ={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"};const fZ=R.forwardRef(({color:e="currentColor",size:r=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:d="",children:p,iconNode:m,...g},b)=>R.createElement("svg",{ref:b,...pZ,width:r,height:r,stroke:e,strokeWidth:o?Number(s)*24/Number(r):s,className:rz("lucide",d),...!p&&!hZ(g)&&{"aria-hidden":"true"},...g},[...m.map(([S,E])=>R.createElement(S,E)),...Array.isArray(p)?p:[p]]));const ln=(e,r)=>{const s=R.forwardRef(({className:o,...d},p)=>R.createElement(fZ,{ref:p,iconNode:r,className:rz(`lucide-${uZ(OM(e))}`,`lucide-${e}`,o),...d}));return s.displayName=OM(e),s};const mZ=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],gZ=ln("boxes",mZ);const yZ=[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]],sz=ln("building-2",yZ);const vZ=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],iz=ln("check",vZ);const xZ=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],az=ln("chevron-down",xZ);const bZ=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],wZ=ln("chevron-right",bZ);const SZ=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],EZ=ln("chevron-up",SZ);const jZ=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],CZ=ln("chevrons-up-down",jZ);const AZ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],kM=ln("circle-alert",AZ);const OZ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],I_=ln("circle-check",OZ);const kZ=[["path",{d:"M22 2 2 22",key:"y4kqgn"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ew=ln("circle-slash-2",kZ);const RZ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],TZ=ln("circle",RZ);const _Z=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]],$Z=ln("clipboard",_Z);const NZ=[["path",{d:"M15.536 11.293a1 1 0 0 0 0 1.414l2.376 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1uwlt4"}],["path",{d:"M2.297 11.293a1 1 0 0 0 0 1.414l2.377 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414L6.088 8.916a1 1 0 0 0-1.414 0z",key:"10291m"}],["path",{d:"M8.916 17.912a1 1 0 0 0 0 1.415l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.415l-2.377-2.376a1 1 0 0 0-1.414 0z",key:"1tqoq1"}],["path",{d:"M8.916 4.674a1 1 0 0 0 0 1.414l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1x6lto"}]],DZ=ln("component",NZ);const PZ=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],MZ=ln("download",PZ);const IZ=[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],zZ=ln("earth",IZ);const LZ=[["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"}]],z_=ln("ellipsis",LZ);const FZ=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],qZ=ln("external-link",FZ);const BZ=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],kT=ln("eye",BZ);const UZ=[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],KZ=ln("file-code-corner",UZ);const VZ=[["path",{d:"M10.65 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v10.1",key:"1a2hbp"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m10 15 1 1",key:"1h4vmv"}],["path",{d:"m11 14-4.586 4.586",key:"maylof"}],["circle",{cx:"5",cy:"20",r:"2",key:"860zyv"}]],HZ=ln("file-key",VZ);const GZ=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],XZ=ln("git-commit-horizontal",GZ);const YZ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],oz=ln("info",YZ);const ZZ=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],WZ=ln("key-round",ZZ);const JZ=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],qE=ln("link",JZ);const QZ=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ds=ln("loader-circle",QZ);const eW=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],tW=ln("lock-keyhole",eW);const nW=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],rW=ln("map-pin",nW);const sW=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],iW=ln("monitor",sW);const aW=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],oW=ln("moon",aW);const lW=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],cW=ln("network",lW);const uW=[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],dW=ln("octagon-x",uW);const hW=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],pW=ln("panel-left",hW);const fW=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],pu=ln("pencil",fW);const mW=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],lo=ln("plus",mW);const gW=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],yW=ln("refresh-cw",gW);const vW=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Pa=ln("search",vW);const xW=[["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"}]],L_=ln("server",xW);const bW=[["path",{d:"M3 3h.01",key:"159qn6"}],["path",{d:"M7 5h.01",key:"1hq22a"}],["path",{d:"M11 7h.01",key:"1osv80"}],["path",{d:"M3 7h.01",key:"1xzrh3"}],["path",{d:"M7 9h.01",key:"19b3jx"}],["path",{d:"M3 11h.01",key:"1eifu7"}],["rect",{width:"4",height:"4",x:"15",y:"5",key:"mri9e4"}],["path",{d:"m19 9 2 2v10c0 .6-.4 1-1 1h-6c-.6 0-1-.4-1-1V11l2-2",key:"aib6hk"}],["path",{d:"m13 14 8-2",key:"1d7bmk"}],["path",{d:"m13 19 8-2",key:"1y2vml"}]],wW=ln("spray-can",bW);const SW=[["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"}]],EW=ln("sun",SW);const jW=[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]],gC=ln("tags",jW);const CW=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],zb=ln("trash-2",CW);const AW=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Tj=ln("triangle-alert",AW);const OW=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],kW=ln("user-round",OW);const RW=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],lz=ln("users",RW);const TW=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],_W=ln("wrench",TW);const $W=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],F_=ln("x",$W);function NW(e){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",r.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}const DW=e=>{switch(e){case"success":return IW;case"info":return LW;case"warning":return zW;case"error":return FW;default:return null}},PW=Array(12).fill(0),MW=({visible:e,className:r})=>Je.createElement("div",{className:["sonner-loading-wrapper",r].filter(Boolean).join(" "),"data-visible":e},Je.createElement("div",{className:"sonner-spinner"},PW.map((s,o)=>Je.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),IW=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Je.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),zW=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Je.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),LW=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Je.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),FW=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Je.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),qW=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Je.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Je.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),BW=()=>{const[e,r]=Je.useState(document.hidden);return Je.useEffect(()=>{const s=()=>{r(document.hidden)};return document.addEventListener("visibilitychange",s),()=>window.removeEventListener("visibilitychange",s)},[]),e};let RT=1;class UW{constructor(){this.subscribe=r=>(this.subscribers.push(r),()=>{const s=this.subscribers.indexOf(r);this.subscribers.splice(s,1)}),this.publish=r=>{this.subscribers.forEach(s=>s(r))},this.addToast=r=>{this.publish(r),this.toasts=[...this.toasts,r]},this.create=r=>{var s;const{message:o,...d}=r,p=typeof r?.id=="number"||((s=r.id)==null?void 0:s.length)>0?r.id:RT++,m=this.toasts.find(b=>b.id===p),g=r.dismissible===void 0?!0:r.dismissible;return this.dismissedToasts.has(p)&&this.dismissedToasts.delete(p),m?this.toasts=this.toasts.map(b=>b.id===p?(this.publish({...b,...r,id:p,title:o}),{...b,...r,id:p,dismissible:g,title:o}):b):this.addToast({title:o,...d,dismissible:g,id:p}),p},this.dismiss=r=>(r?(this.dismissedToasts.add(r),requestAnimationFrame(()=>this.subscribers.forEach(s=>s({id:r,dismiss:!0})))):this.toasts.forEach(s=>{this.subscribers.forEach(o=>o({id:s.id,dismiss:!0}))}),r),this.message=(r,s)=>this.create({...s,message:r}),this.error=(r,s)=>this.create({...s,message:r,type:"error"}),this.success=(r,s)=>this.create({...s,type:"success",message:r}),this.info=(r,s)=>this.create({...s,type:"info",message:r}),this.warning=(r,s)=>this.create({...s,type:"warning",message:r}),this.loading=(r,s)=>this.create({...s,type:"loading",message:r}),this.promise=(r,s)=>{if(!s)return;let o;s.loading!==void 0&&(o=this.create({...s,promise:r,type:"loading",message:s.loading,description:typeof s.description!="function"?s.description:void 0}));const d=Promise.resolve(r instanceof Function?r():r);let p=o!==void 0,m;const g=d.then(async S=>{if(m=["resolve",S],Je.isValidElement(S))p=!1,this.create({id:o,type:"default",message:S});else if(VW(S)&&!S.ok){p=!1;const A=typeof s.error=="function"?await s.error(`HTTP error! status: ${S.status}`):s.error,k=typeof s.description=="function"?await s.description(`HTTP error! status: ${S.status}`):s.description,M=typeof A=="object"&&!Je.isValidElement(A)?A:{message:A};this.create({id:o,type:"error",description:k,...M})}else if(S instanceof Error){p=!1;const A=typeof s.error=="function"?await s.error(S):s.error,k=typeof s.description=="function"?await s.description(S):s.description,M=typeof A=="object"&&!Je.isValidElement(A)?A:{message:A};this.create({id:o,type:"error",description:k,...M})}else if(s.success!==void 0){p=!1;const A=typeof s.success=="function"?await s.success(S):s.success,k=typeof s.description=="function"?await s.description(S):s.description,M=typeof A=="object"&&!Je.isValidElement(A)?A:{message:A};this.create({id:o,type:"success",description:k,...M})}}).catch(async S=>{if(m=["reject",S],s.error!==void 0){p=!1;const E=typeof s.error=="function"?await s.error(S):s.error,A=typeof s.description=="function"?await s.description(S):s.description,T=typeof E=="object"&&!Je.isValidElement(E)?E:{message:E};this.create({id:o,type:"error",description:A,...T})}}).finally(()=>{p&&(this.dismiss(o),o=void 0),s.finally==null||s.finally.call(s)}),b=()=>new Promise((S,E)=>g.then(()=>m[0]==="reject"?E(m[1]):S(m[1])).catch(E));return typeof o!="string"&&typeof o!="number"?{unwrap:b}:Object.assign(o,{unwrap:b})},this.custom=(r,s)=>{const o=s?.id||RT++;return this.create({jsx:r(o),id:o,...s}),o},this.getActiveToasts=()=>this.toasts.filter(r=>!this.dismissedToasts.has(r.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const ca=new UW,KW=(e,r)=>{const s=r?.id||RT++;return ca.addToast({title:e,...r,id:s}),s},VW=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",HW=KW,GW=()=>ca.toasts,XW=()=>ca.getActiveToasts(),Ze=Object.assign(HW,{success:ca.success,info:ca.info,warning:ca.warning,error:ca.error,custom:ca.custom,message:ca.message,promise:ca.promise,dismiss:ca.dismiss,loading:ca.loading},{getHistory:GW,getToasts:XW});NW("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function BE(e){return e.label!==void 0}const YW=3,ZW="24px",WW="16px",RM=4e3,JW=356,QW=14,eJ=45,tJ=200;function Wl(...e){return e.filter(Boolean).join(" ")}function nJ(e){const[r,s]=e.split("-"),o=[];return r&&o.push(r),s&&o.push(s),o}const rJ=e=>{var r,s,o,d,p,m,g,b,S;const{invert:E,toast:A,unstyled:k,interacting:T,setHeights:M,visibleToasts:I,heights:q,index:G,toasts:K,expanded:X,removeToast:z,defaultRichColors:ee,closeButton:oe,style:Q,cancelButtonStyle:ne,actionButtonStyle:de,className:Ce="",descriptionClassName:xe="",duration:le,position:be,gap:je,expandByDefault:Ke,classNames:ce,icons:re,closeButtonAriaLabel:ue="Close toast"}=e,[_e,fe]=Je.useState(null),[He,Oe]=Je.useState(null),[ke,Ve]=Je.useState(!1),[ie,Ne]=Je.useState(!1),[ze,tt]=Je.useState(!1),[ft,Ot]=Je.useState(!1),[Ft,kt]=Je.useState(!1),[Jt,Le]=Je.useState(0),[Lt,Rt]=Je.useState(0),V=Je.useRef(A.duration||le||RM),Nn=Je.useRef(null),cn=Je.useRef(null),ve=G===0,De=G+1<=I,Ge=A.type,D=A.dismissible!==!1,L=A.className||"",H=A.descriptionClassName||"",W=Je.useMemo(()=>q.findIndex(zt=>zt.toastId===A.id)||0,[q,A.id]),we=Je.useMemo(()=>{var zt;return(zt=A.closeButton)!=null?zt:oe},[A.closeButton,oe]),Re=Je.useMemo(()=>A.duration||le||RM,[A.duration,le]),st=Je.useRef(0),Kt=Je.useRef(0),Qt=Je.useRef(0),Fn=Je.useRef(null),[dn,Ht]=be.split("-"),wi=Je.useMemo(()=>q.reduce((zt,vr,Yr)=>Yr>=W?zt:zt+vr.height,0),[q,W]),Xr=BW(),fa=A.invert||E,ho=Ge==="loading";Kt.current=Je.useMemo(()=>W*je+wi,[W,wi]),Je.useEffect(()=>{V.current=Re},[Re]),Je.useEffect(()=>{Ve(!0)},[]),Je.useEffect(()=>{const zt=cn.current;if(zt){const vr=zt.getBoundingClientRect().height;return Rt(vr),M(Yr=>[{toastId:A.id,height:vr,position:A.position},...Yr]),()=>M(Yr=>Yr.filter(Os=>Os.toastId!==A.id))}},[M,A.id]),Je.useLayoutEffect(()=>{if(!ke)return;const zt=cn.current,vr=zt.style.height;zt.style.height="auto";const Yr=zt.getBoundingClientRect().height;zt.style.height=vr,Rt(Yr),M(Os=>Os.find(Er=>Er.toastId===A.id)?Os.map(Er=>Er.toastId===A.id?{...Er,height:Yr}:Er):[{toastId:A.id,height:Yr,position:A.position},...Os])},[ke,A.title,A.description,M,A.id,A.jsx,A.action,A.cancel]);const Ma=Je.useCallback(()=>{Ne(!0),Le(Kt.current),M(zt=>zt.filter(vr=>vr.toastId!==A.id)),setTimeout(()=>{z(A)},tJ)},[A,z,M,Kt]);Je.useEffect(()=>{if(A.promise&&Ge==="loading"||A.duration===1/0||A.type==="loading")return;let zt;return X||T||Xr?(()=>{if(Qt.current{V.current!==1/0&&(st.current=new Date().getTime(),zt=setTimeout(()=>{A.onAutoClose==null||A.onAutoClose.call(A,A),Ma()},V.current))})(),()=>clearTimeout(zt)},[X,T,A,Ge,Xr,Ma]),Je.useEffect(()=>{A.delete&&(Ma(),A.onDismiss==null||A.onDismiss.call(A,A))},[Ma,A.delete]);function cc(){var zt;if(re?.loading){var vr;return Je.createElement("div",{className:Wl(ce?.loader,A==null||(vr=A.classNames)==null?void 0:vr.loader,"sonner-loader"),"data-visible":Ge==="loading"},re.loading)}return Je.createElement(MW,{className:Wl(ce?.loader,A==null||(zt=A.classNames)==null?void 0:zt.loader),visible:Ge==="loading"})}const xu=A.icon||re?.[Ge]||DW(Ge);var uc,ma;return Je.createElement("li",{tabIndex:0,ref:cn,className:Wl(Ce,L,ce?.toast,A==null||(r=A.classNames)==null?void 0:r.toast,ce?.default,ce?.[Ge],A==null||(s=A.classNames)==null?void 0:s[Ge]),"data-sonner-toast":"","data-rich-colors":(uc=A.richColors)!=null?uc:ee,"data-styled":!(A.jsx||A.unstyled||k),"data-mounted":ke,"data-promise":!!A.promise,"data-swiped":Ft,"data-removed":ie,"data-visible":De,"data-y-position":dn,"data-x-position":Ht,"data-index":G,"data-front":ve,"data-swiping":ze,"data-dismissible":D,"data-type":Ge,"data-invert":fa,"data-swipe-out":ft,"data-swipe-direction":He,"data-expanded":!!(X||Ke&&ke),"data-testid":A.testId,style:{"--index":G,"--toasts-before":G,"--z-index":K.length-G,"--offset":`${ie?Jt:Kt.current}px`,"--initial-height":Ke?"auto":`${Lt}px`,...Q,...A.style},onDragEnd:()=>{tt(!1),fe(null),Fn.current=null},onPointerDown:zt=>{zt.button!==2&&(ho||!D||(Nn.current=new Date,Le(Kt.current),zt.target.setPointerCapture(zt.pointerId),zt.target.tagName!=="BUTTON"&&(tt(!0),Fn.current={x:zt.clientX,y:zt.clientY})))},onPointerUp:()=>{var zt,vr,Yr;if(ft||!D)return;Fn.current=null;const Os=Number(((zt=cn.current)==null?void 0:zt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Dn=Number(((vr=cn.current)==null?void 0:vr.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Er=new Date().getTime()-((Yr=Nn.current)==null?void 0:Yr.getTime()),Ys=_e==="x"?Os:Dn,ll=Math.abs(Ys)/Er;if(Math.abs(Ys)>=eJ||ll>.11){Le(Kt.current),A.onDismiss==null||A.onDismiss.call(A,A),Oe(_e==="x"?Os>0?"right":"left":Dn>0?"down":"up"),Ma(),Ot(!0);return}else{var ys,Zs;(ys=cn.current)==null||ys.style.setProperty("--swipe-amount-x","0px"),(Zs=cn.current)==null||Zs.style.setProperty("--swipe-amount-y","0px")}kt(!1),tt(!1),fe(null)},onPointerMove:zt=>{var vr,Yr,Os;if(!Fn.current||!D||((vr=window.getSelection())==null?void 0:vr.toString().length)>0)return;const Er=zt.clientY-Fn.current.y,Ys=zt.clientX-Fn.current.x;var ll;const ys=(ll=e.swipeDirections)!=null?ll:nJ(be);!_e&&(Math.abs(Ys)>1||Math.abs(Er)>1)&&fe(Math.abs(Ys)>Math.abs(Er)?"x":"y");let Zs={x:0,y:0};const bu=ga=>1/(1.5+Math.abs(ga)/20);if(_e==="y"){if(ys.includes("top")||ys.includes("bottom"))if(ys.includes("top")&&Er<0||ys.includes("bottom")&&Er>0)Zs.y=Er;else{const ga=Er*bu(Er);Zs.y=Math.abs(ga)0)Zs.x=Ys;else{const ga=Ys*bu(Ys);Zs.x=Math.abs(ga)0||Math.abs(Zs.y)>0)&&kt(!0),(Yr=cn.current)==null||Yr.style.setProperty("--swipe-amount-x",`${Zs.x}px`),(Os=cn.current)==null||Os.style.setProperty("--swipe-amount-y",`${Zs.y}px`)}},we&&!A.jsx&&Ge!=="loading"?Je.createElement("button",{"aria-label":ue,"data-disabled":ho,"data-close-button":!0,onClick:ho||!D?()=>{}:()=>{Ma(),A.onDismiss==null||A.onDismiss.call(A,A)},className:Wl(ce?.closeButton,A==null||(o=A.classNames)==null?void 0:o.closeButton)},(ma=re?.close)!=null?ma:qW):null,(Ge||A.icon||A.promise)&&A.icon!==null&&(re?.[Ge]!==null||A.icon)?Je.createElement("div",{"data-icon":"",className:Wl(ce?.icon,A==null||(d=A.classNames)==null?void 0:d.icon)},A.promise||A.type==="loading"&&!A.icon?A.icon||cc():null,A.type!=="loading"?xu:null):null,Je.createElement("div",{"data-content":"",className:Wl(ce?.content,A==null||(p=A.classNames)==null?void 0:p.content)},Je.createElement("div",{"data-title":"",className:Wl(ce?.title,A==null||(m=A.classNames)==null?void 0:m.title)},A.jsx?A.jsx:typeof A.title=="function"?A.title():A.title),A.description?Je.createElement("div",{"data-description":"",className:Wl(xe,H,ce?.description,A==null||(g=A.classNames)==null?void 0:g.description)},typeof A.description=="function"?A.description():A.description):null),Je.isValidElement(A.cancel)?A.cancel:A.cancel&&BE(A.cancel)?Je.createElement("button",{"data-button":!0,"data-cancel":!0,style:A.cancelButtonStyle||ne,onClick:zt=>{BE(A.cancel)&&D&&(A.cancel.onClick==null||A.cancel.onClick.call(A.cancel,zt),Ma())},className:Wl(ce?.cancelButton,A==null||(b=A.classNames)==null?void 0:b.cancelButton)},A.cancel.label):null,Je.isValidElement(A.action)?A.action:A.action&&BE(A.action)?Je.createElement("button",{"data-button":!0,"data-action":!0,style:A.actionButtonStyle||de,onClick:zt=>{BE(A.action)&&(A.action.onClick==null||A.action.onClick.call(A.action,zt),!zt.defaultPrevented&&Ma())},className:Wl(ce?.actionButton,A==null||(S=A.classNames)==null?void 0:S.actionButton)},A.action.label):null)};function TM(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function sJ(e,r){const s={};return[e,r].forEach((o,d)=>{const p=d===1,m=p?"--mobile-offset":"--offset",g=p?WW:ZW;function b(S){["top","right","bottom","left"].forEach(E=>{s[`${m}-${E}`]=typeof S=="number"?`${S}px`:S})}typeof o=="number"||typeof o=="string"?b(o):typeof o=="object"?["top","right","bottom","left"].forEach(S=>{o[S]===void 0?s[`${m}-${S}`]=g:s[`${m}-${S}`]=typeof o[S]=="number"?`${o[S]}px`:o[S]}):b(g)}),s}const iJ=Je.forwardRef(function(r,s){const{id:o,invert:d,position:p="bottom-right",hotkey:m=["altKey","KeyT"],expand:g,closeButton:b,className:S,offset:E,mobileOffset:A,theme:k="light",richColors:T,duration:M,style:I,visibleToasts:q=YW,toastOptions:G,dir:K=TM(),gap:X=QW,icons:z,containerAriaLabel:ee="Notifications"}=r,[oe,Q]=Je.useState([]),ne=Je.useMemo(()=>o?oe.filter(ke=>ke.toasterId===o):oe.filter(ke=>!ke.toasterId),[oe,o]),de=Je.useMemo(()=>Array.from(new Set([p].concat(ne.filter(ke=>ke.position).map(ke=>ke.position)))),[ne,p]),[Ce,xe]=Je.useState([]),[le,be]=Je.useState(!1),[je,Ke]=Je.useState(!1),[ce,re]=Je.useState(k!=="system"?k:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),ue=Je.useRef(null),_e=m.join("+").replace(/Key/g,"").replace(/Digit/g,""),fe=Je.useRef(null),He=Je.useRef(!1),Oe=Je.useCallback(ke=>{Q(Ve=>{var ie;return(ie=Ve.find(Ne=>Ne.id===ke.id))!=null&&ie.delete||ca.dismiss(ke.id),Ve.filter(({id:Ne})=>Ne!==ke.id)})},[]);return Je.useEffect(()=>ca.subscribe(ke=>{if(ke.dismiss){requestAnimationFrame(()=>{Q(Ve=>Ve.map(ie=>ie.id===ke.id?{...ie,delete:!0}:ie))});return}setTimeout(()=>{B3.flushSync(()=>{Q(Ve=>{const ie=Ve.findIndex(Ne=>Ne.id===ke.id);return ie!==-1?[...Ve.slice(0,ie),{...Ve[ie],...ke},...Ve.slice(ie+1)]:[ke,...Ve]})})})}),[oe]),Je.useEffect(()=>{if(k!=="system"){re(k);return}if(k==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?re("dark"):re("light")),typeof window>"u")return;const ke=window.matchMedia("(prefers-color-scheme: dark)");try{ke.addEventListener("change",({matches:Ve})=>{re(Ve?"dark":"light")})}catch{ke.addListener(({matches:ie})=>{try{re(ie?"dark":"light")}catch(Ne){console.error(Ne)}})}},[k]),Je.useEffect(()=>{oe.length<=1&&be(!1)},[oe]),Je.useEffect(()=>{const ke=Ve=>{var ie;if(m.every(tt=>Ve[tt]||Ve.code===tt)){var ze;be(!0),(ze=ue.current)==null||ze.focus()}Ve.code==="Escape"&&(document.activeElement===ue.current||(ie=ue.current)!=null&&ie.contains(document.activeElement))&&be(!1)};return document.addEventListener("keydown",ke),()=>document.removeEventListener("keydown",ke)},[m]),Je.useEffect(()=>{if(ue.current)return()=>{fe.current&&(fe.current.focus({preventScroll:!0}),fe.current=null,He.current=!1)}},[ue.current]),Je.createElement("section",{ref:s,"aria-label":`${ee} ${_e}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},de.map((ke,Ve)=>{var ie;const[Ne,ze]=ke.split("-");return ne.length?Je.createElement("ol",{key:ke,dir:K==="auto"?TM():K,tabIndex:-1,ref:ue,className:S,"data-sonner-toaster":!0,"data-sonner-theme":ce,"data-y-position":Ne,"data-x-position":ze,style:{"--front-toast-height":`${((ie=Ce[0])==null?void 0:ie.height)||0}px`,"--width":`${JW}px`,"--gap":`${X}px`,...I,...sJ(E,A)},onBlur:tt=>{He.current&&!tt.currentTarget.contains(tt.relatedTarget)&&(He.current=!1,fe.current&&(fe.current.focus({preventScroll:!0}),fe.current=null))},onFocus:tt=>{tt.target instanceof HTMLElement&&tt.target.dataset.dismissible==="false"||He.current||(He.current=!0,fe.current=tt.relatedTarget)},onMouseEnter:()=>be(!0),onMouseMove:()=>be(!0),onMouseLeave:()=>{je||be(!1)},onDragEnd:()=>be(!1),onPointerDown:tt=>{tt.target instanceof HTMLElement&&tt.target.dataset.dismissible==="false"||Ke(!0)},onPointerUp:()=>Ke(!1)},ne.filter(tt=>!tt.position&&Ve===0||tt.position===ke).map((tt,ft)=>{var Ot,Ft;return Je.createElement(rJ,{key:tt.id,icons:z,index:ft,toast:tt,defaultRichColors:T,duration:(Ot=G?.duration)!=null?Ot:M,className:G?.className,descriptionClassName:G?.descriptionClassName,invert:d,visibleToasts:q,closeButton:(Ft=G?.closeButton)!=null?Ft:b,interacting:je,position:ke,style:G?.style,unstyled:G?.unstyled,classNames:G?.classNames,cancelButtonStyle:G?.cancelButtonStyle,actionButtonStyle:G?.actionButtonStyle,closeButtonAriaLabel:G?.closeButtonAriaLabel,removeToast:Oe,toasts:ne.filter(kt=>kt.position==tt.position),heights:Ce.filter(kt=>kt.position==tt.position),setHeights:xe,expandByDefault:g,gap:X,expanded:le,swipeDirections:r.swipeDirections})})):null}))}),aJ=({...e})=>{const{theme:r="system"}=$_();return u.jsx(iJ,{theme:r,className:"toaster group",icons:{success:u.jsx(I_,{className:"size-4"}),info:u.jsx(oz,{className:"size-4"}),warning:u.jsx(Tj,{className:"size-4"}),error:u.jsx(dW,{className:"size-4"}),loading:u.jsx(Ds,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...e})},oJ=new WY,lJ=({children:e})=>u.jsx(JY,{client:oJ,children:u.jsxs(kY,{defaultTheme:"system",storageKey:"dragon-theme",children:[e,u.jsx(aJ,{richColors:!0,expand:!0,position:"top-center"})]})});var TR={exports:{}},nb={},_R={exports:{}},$R={};var _M;function cJ(){return _M||(_M=1,(function(e){function r(ce,re){var ue=ce.length;ce.push(re);e:for(;0>>1,fe=ce[_e];if(0>>1;_ed(ke,ue))Ved(ie,ke)?(ce[_e]=ie,ce[Ve]=ue,_e=Ve):(ce[_e]=ke,ce[Oe]=ue,_e=Oe);else if(Ved(ie,ue))ce[_e]=ie,ce[Ve]=ue,_e=Ve;else break e}}return re}function d(ce,re){var ue=ce.sortIndex-re.sortIndex;return ue!==0?ue:ce.id-re.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var p=performance;e.unstable_now=function(){return p.now()}}else{var m=Date,g=m.now();e.unstable_now=function(){return m.now()-g}}var b=[],S=[],E=1,A=null,k=3,T=!1,M=!1,I=!1,q=!1,G=typeof setTimeout=="function"?setTimeout:null,K=typeof clearTimeout=="function"?clearTimeout:null,X=typeof setImmediate<"u"?setImmediate:null;function z(ce){for(var re=s(S);re!==null;){if(re.callback===null)o(S);else if(re.startTime<=ce)o(S),re.sortIndex=re.expirationTime,r(b,re);else break;re=s(S)}}function ee(ce){if(I=!1,z(ce),!M)if(s(b)!==null)M=!0,oe||(oe=!0,le());else{var re=s(S);re!==null&&Ke(ee,re.startTime-ce)}}var oe=!1,Q=-1,ne=5,de=-1;function Ce(){return q?!0:!(e.unstable_now()-dece&&Ce());){var _e=A.callback;if(typeof _e=="function"){A.callback=null,k=A.priorityLevel;var fe=_e(A.expirationTime<=ce);if(ce=e.unstable_now(),typeof fe=="function"){A.callback=fe,z(ce),re=!0;break t}A===s(b)&&o(b),z(ce)}else o(b);A=s(b)}if(A!==null)re=!0;else{var He=s(S);He!==null&&Ke(ee,He.startTime-ce),re=!1}}break e}finally{A=null,k=ue,T=!1}re=void 0}}finally{re?le():oe=!1}}}var le;if(typeof X=="function")le=function(){X(xe)};else if(typeof MessageChannel<"u"){var be=new MessageChannel,je=be.port2;be.port1.onmessage=xe,le=function(){je.postMessage(null)}}else le=function(){G(xe,0)};function Ke(ce,re){Q=G(function(){ce(e.unstable_now())},re)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(ce){ce.callback=null},e.unstable_forceFrameRate=function(ce){0>ce||125_e?(ce.sortIndex=ue,r(S,ce),s(b)===null&&ce===s(S)&&(I?(K(Q),Q=-1):I=!0,Ke(ee,ue-_e))):(ce.sortIndex=fe,r(b,ce),M||T||(M=!0,oe||(oe=!0,le()))),ce},e.unstable_shouldYield=Ce,e.unstable_wrapCallback=function(ce){var re=k;return function(){var ue=k;k=re;try{return ce.apply(this,arguments)}finally{k=ue}}}})($R)),$R}var $M;function uJ(){return $M||($M=1,_R.exports=cJ()),_R.exports}var NM;function dJ(){if(NM)return nb;NM=1;var e=uJ(),r=U3(),s=hY();function o(a){var c="https://react.dev/errors/"+a;if(1fe||(a.current=_e[fe],_e[fe]=null,fe--)}function ke(a,c){fe++,_e[fe]=a.current,a.current=c}var Ve=He(null),ie=He(null),Ne=He(null),ze=He(null);function tt(a,c){switch(ke(Ne,c),ke(ie,a),ke(Ve,null),c.nodeType){case 9:case 11:a=(a=c.documentElement)&&(a=a.namespaceURI)?gd(a):0;break;default:if(a=c.tagName,c=c.namespaceURI)c=gd(c),a=qh(c,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}Oe(Ve),ke(Ve,a)}function ft(){Oe(Ve),Oe(ie),Oe(Ne)}function Ot(a){a.memoizedState!==null&&ke(ze,a);var c=Ve.current,f=qh(c,a.type);c!==f&&(ke(ie,a),ke(Ve,f))}function Ft(a){ie.current===a&&(Oe(Ve),Oe(ie)),ze.current===a&&(Oe(ze),bd._currentValue=ue)}var kt,Jt;function Le(a){if(kt===void 0)try{throw Error()}catch(f){var c=f.stack.trim().match(/\n( *(at )?)/);kt=c&&c[1]||"",Jt=-1{for(const p of d)if(p.type==="childList")for(const m of p.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&o(m)}).observe(document,{childList:!0,subtree:!0});function s(d){const p={};return d.integrity&&(p.integrity=d.integrity),d.referrerPolicy&&(p.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?p.credentials="include":d.crossOrigin==="anonymous"?p.credentials="omit":p.credentials="same-origin",p}function o(d){if(d.ep)return;d.ep=!0;const p=s(d);fetch(d.href,p)}})();var kR={exports:{}},nb={};var fM;function vY(){if(fM)return nb;fM=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function s(o,d,p){var m=null;if(p!==void 0&&(m=""+p),d.key!==void 0&&(m=""+d.key),"key"in d){p={};for(var g in d)g!=="key"&&(p[g]=d[g])}else p=d;return d=p.ref,{$$typeof:e,type:o,key:m,ref:d!==void 0?d:null,props:p}}return nb.Fragment=r,nb.jsx=s,nb.jsxs=s,nb}var mM;function xY(){return mM||(mM=1,kR.exports=vY()),kR.exports}var u=xY(),bY=(e,r,s,o,d,p,m,g)=>{let b=document.documentElement,S=["light","dark"];function j(T){(Array.isArray(e)?e:[e]).forEach(M=>{let I=M==="class",q=I&&p?d.map(G=>p[G]||G):d;I?(b.classList.remove(...q),b.classList.add(p&&p[T]?p[T]:T)):b.setAttribute(M,T)}),A(T)}function A(T){g&&S.includes(T)&&(b.style.colorScheme=T)}function k(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(o)j(o);else try{let T=localStorage.getItem(r)||s,M=m&&T==="system"?k():T;j(M)}catch{}},gM=["light","dark"],H3="(prefers-color-scheme: dark)",wY=typeof window>"u",$_=R.createContext(void 0),SY={setTheme:e=>{},themes:[]},N_=()=>{var e;return(e=R.useContext($_))!=null?e:SY},EY=e=>R.useContext($_)?R.createElement(R.Fragment,null,e.children):R.createElement(CY,{...e}),jY=["light","dark"],CY=({forcedTheme:e,disableTransitionOnChange:r=!1,enableSystem:s=!0,enableColorScheme:o=!0,storageKey:d="theme",themes:p=jY,defaultTheme:m=s?"system":"light",attribute:g="data-theme",value:b,children:S,nonce:j,scriptProps:A})=>{let[k,T]=R.useState(()=>OY(d,m)),[M,I]=R.useState(()=>k==="system"?RR():k),q=b?Object.values(b):p,G=R.useCallback(ee=>{let oe=ee;if(!oe)return;ee==="system"&&s&&(oe=RR());let Q=b?b[oe]:oe,ne=r?kY(j):null,de=document.documentElement,je=ve=>{ve==="class"?(de.classList.remove(...q),Q&&de.classList.add(Q)):ve.startsWith("data-")&&(Q?de.setAttribute(ve,Q):de.removeAttribute(ve))};if(Array.isArray(g)?g.forEach(je):je(g),o){let ve=gM.includes(m)?m:null,le=gM.includes(oe)?oe:ve;de.style.colorScheme=le}ne?.()},[j]),K=R.useCallback(ee=>{let oe=typeof ee=="function"?ee(k):ee;T(oe);try{localStorage.setItem(d,oe)}catch{}},[k]),X=R.useCallback(ee=>{let oe=RR(ee);I(oe),k==="system"&&s&&!e&&G("system")},[k,e]);R.useEffect(()=>{let ee=window.matchMedia(H3);return ee.addListener(X),X(ee),()=>ee.removeListener(X)},[X]),R.useEffect(()=>{let ee=oe=>{oe.key===d&&(oe.newValue?T(oe.newValue):K(m))};return window.addEventListener("storage",ee),()=>window.removeEventListener("storage",ee)},[K]),R.useEffect(()=>{G(e??k)},[e,k]);let L=R.useMemo(()=>({theme:k,setTheme:K,forcedTheme:e,resolvedTheme:k==="system"?M:k,themes:s?[...p,"system"]:p,systemTheme:s?M:void 0}),[k,K,e,M,s,p]);return R.createElement($_.Provider,{value:L},R.createElement(AY,{forcedTheme:e,storageKey:d,attribute:g,enableSystem:s,enableColorScheme:o,defaultTheme:m,value:b,themes:p,nonce:j,scriptProps:A}),S)},AY=R.memo(({forcedTheme:e,storageKey:r,attribute:s,enableSystem:o,enableColorScheme:d,defaultTheme:p,value:m,themes:g,nonce:b,scriptProps:S})=>{let j=JSON.stringify([s,r,p,e,g,m,o,d]).slice(1,-1);return R.createElement("script",{...S,suppressHydrationWarning:!0,nonce:typeof window>"u"?b:"",dangerouslySetInnerHTML:{__html:`(${bY.toString()})(${j})`}})}),OY=(e,r)=>{if(wY)return;let s;try{s=localStorage.getItem(e)||void 0}catch{}return s||r},kY=e=>{let r=document.createElement("style");return e&&r.setAttribute("nonce",e),r.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(r),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(r)},1)}},RR=e=>(e||(e=window.matchMedia(H3)),e.matches?"dark":"light");function RY({children:e,defaultTheme:r="system",storageKey:s="vite-ui-theme"}){return u.jsx(EY,{attribute:"class",defaultTheme:r,enableSystem:!0,storageKey:s,disableTransitionOnChange:!0,children:e})}var jg=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},TY={setTimeout:(e,r)=>setTimeout(e,r),clearTimeout:e=>clearTimeout(e),setInterval:(e,r)=>setInterval(e,r),clearInterval:e=>clearInterval(e)},_Y=class{#e=TY;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,r){return this.#e.setTimeout(e,r)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,r){return this.#e.setInterval(e,r)}clearInterval(e){this.#e.clearInterval(e)}},vp=new _Y;function $Y(e){setTimeout(e,0)}var Cp=typeof window>"u"||"Deno"in globalThis;function Pi(){}function NY(e,r){return typeof e=="function"?e(r):e}function ET(e){return typeof e=="number"&&e>=0&&e!==1/0}function G3(e,r){return Math.max(e+(r||0)-Date.now(),0)}function Ld(e,r){return typeof e=="function"?e(r):e}function no(e,r){return typeof e=="function"?e(r):e}function yM(e,r){const{type:s="all",exact:o,fetchStatus:d,predicate:p,queryKey:m,stale:g}=e;if(m){if(o){if(r.queryHash!==D_(m,r.options))return!1}else if(!Mb(r.queryKey,m))return!1}if(s!=="all"){const b=r.isActive();if(s==="active"&&!b||s==="inactive"&&b)return!1}return!(typeof g=="boolean"&&r.isStale()!==g||d&&d!==r.state.fetchStatus||p&&!p(r))}function vM(e,r){const{exact:s,status:o,predicate:d,mutationKey:p}=e;if(p){if(!r.options.mutationKey)return!1;if(s){if(Ap(r.options.mutationKey)!==Ap(p))return!1}else if(!Mb(r.options.mutationKey,p))return!1}return!(o&&r.state.status!==o||d&&!d(r))}function D_(e,r){return(r?.queryKeyHashFn||Ap)(e)}function Ap(e){return JSON.stringify(e,(r,s)=>jT(s)?Object.keys(s).sort().reduce((o,d)=>(o[d]=s[d],o),{}):s)}function Mb(e,r){return e===r?!0:typeof e!=typeof r?!1:e&&r&&typeof e=="object"&&typeof r=="object"?Object.keys(r).every(s=>Mb(e[s],r[s])):!1}var DY=Object.prototype.hasOwnProperty;function X3(e,r){if(e===r)return e;const s=xM(e)&&xM(r);if(!s&&!(jT(e)&&jT(r)))return r;const d=(s?e:Object.keys(e)).length,p=s?r:Object.keys(r),m=p.length,g=s?new Array(m):{};let b=0;for(let S=0;S{vp.setTimeout(r,e)})}function CT(e,r,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,r):s.structuralSharing!==!1?X3(e,r):r}function MY(e,r,s=0){const o=[...e,r];return s&&o.length>s?o.slice(1):o}function IY(e,r,s=0){const o=[r,...e];return s&&o.length>s?o.slice(0,-1):o}var P_=Symbol();function Y3(e,r){return!e.queryFn&&r?.initialPromise?()=>r.initialPromise:!e.queryFn||e.queryFn===P_?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Z3(e,r){return typeof e=="function"?e(...r):!!e}var LY=class extends jg{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Cp&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(r=>{r(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},M_=new LY;function AT(){let e,r;const s=new Promise((d,p)=>{e=d,r=p});s.status="pending",s.catch(()=>{});function o(d){Object.assign(s,d),delete s.resolve,delete s.reject}return s.resolve=d=>{o({status:"fulfilled",value:d}),e(d)},s.reject=d=>{o({status:"rejected",reason:d}),r(d)},s}var zY=$Y;function FY(){let e=[],r=0,s=g=>{g()},o=g=>{g()},d=zY;const p=g=>{r?e.push(g):d(()=>{s(g)})},m=()=>{const g=e;e=[],g.length&&d(()=>{o(()=>{g.forEach(b=>{s(b)})})})};return{batch:g=>{let b;r++;try{b=g()}finally{r--,r||m()}return b},batchCalls:g=>(...b)=>{p(()=>{g(...b)})},schedule:p,setNotifyFunction:g=>{s=g},setBatchNotifyFunction:g=>{o=g},setScheduler:g=>{d=g}}}var Cs=FY(),qY=class extends jg{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Cp&&window.addEventListener){const r=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(s=>{s(e)}))}isOnline(){return this.#e}},kj=new qY;function BY(e){return Math.min(1e3*2**e,3e4)}function W3(e){return(e??"online")==="online"?kj.isOnline():!0}var OT=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function J3(e){let r=!1,s=0,o;const d=AT(),p=()=>d.status!=="pending",m=I=>{if(!p()){const q=new OT(I);k(q),e.onCancel?.(q)}},g=()=>{r=!0},b=()=>{r=!1},S=()=>M_.isFocused()&&(e.networkMode==="always"||kj.isOnline())&&e.canRun(),j=()=>W3(e.networkMode)&&e.canRun(),A=I=>{p()||(o?.(),d.resolve(I))},k=I=>{p()||(o?.(),d.reject(I))},T=()=>new Promise(I=>{o=q=>{(p()||S())&&I(q)},e.onPause?.()}).then(()=>{o=void 0,p()||e.onContinue?.()}),M=()=>{if(p())return;let I;const q=s===0?e.initialPromise:void 0;try{I=q??e.fn()}catch(G){I=Promise.reject(G)}Promise.resolve(I).then(A).catch(G=>{if(p())return;const K=e.retry??(Cp?0:3),X=e.retryDelay??BY,L=typeof X=="function"?X(s,G):X,ee=K===!0||typeof K=="number"&&sS()?void 0:T()).then(()=>{r?k(G):M()})})};return{promise:d,status:()=>d.status,cancel:m,continue:()=>(o?.(),d),cancelRetry:g,continueRetry:b,canStart:j,start:()=>(j()?M():T().then(M),d)}}var Q3=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ET(this.gcTime)&&(this.#e=vp.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Cp?1/0:300*1e3))}clearGcTimeout(){this.#e&&(vp.clearTimeout(this.#e),this.#e=void 0)}},UY=class extends Q3{#e;#t;#n;#s;#r;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#n=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=SM(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=SM(this.options);r.data!==void 0&&(this.setState(wM(r.data,r.dataUpdatedAt)),this.#e=r)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,r){const s=CT(this.state.data,e,this.options);return this.#i({data:s,type:"success",dataUpdatedAt:r?.updatedAt,manual:r?.manual}),s}setState(e,r){this.#i({type:"setState",state:e,setStateOptions:r})}cancel(e){const r=this.#r?.promise;return this.#r?.cancel(e),r?r.then(Pi).catch(Pi):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>no(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===P_||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ld(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!G3(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(r=>r.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(r=>r.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(r=>r!==e),this.observers.length||(this.#r&&(this.#o?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,r){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&r?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const g=this.observers.find(b=>b.options.queryFn);g&&this.setOptions(g.options)}const s=new AbortController,o=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(this.#o=!0,s.signal)})},d=()=>{const g=Y3(this.options,r),S=(()=>{const j={client:this.#s,queryKey:this.queryKey,meta:this.meta};return o(j),j})();return this.#o=!1,this.options.persister?this.options.persister(g,S,this):g(S)},m=(()=>{const g={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:d};return o(g),g})();this.options.behavior?.onFetch(m,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==m.fetchOptions?.meta)&&this.#i({type:"fetch",meta:m.fetchOptions?.meta}),this.#r=J3({initialPromise:r?.initialPromise,fn:m.fetchFn,onCancel:g=>{g instanceof OT&&g.revert&&this.setState({...this.#t,fetchStatus:"idle"}),s.abort()},onFail:(g,b)=>{this.#i({type:"failed",failureCount:g,error:b})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:m.options.retry,retryDelay:m.options.retryDelay,networkMode:m.options.networkMode,canRun:()=>!0});try{const g=await this.#r.start();if(g===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(g),this.#n.config.onSuccess?.(g,this),this.#n.config.onSettled?.(g,this.state.error,this),g}catch(g){if(g instanceof OT){if(g.silent)return this.#r.promise;if(g.revert){if(this.state.data===void 0)throw g;return this.state.data}}throw this.#i({type:"error",error:g}),this.#n.config.onError?.(g,this),this.#n.config.onSettled?.(this.state.data,g,this),g}finally{this.scheduleGc()}}#i(e){const r=s=>{switch(e.type){case"failed":return{...s,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...eL(s.data,this.options),fetchMeta:e.meta??null};case"success":const o={...s,...wM(e.data,e.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?o:void 0,o;case"error":const d=e.error;return{...s,error:d,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:d,fetchStatus:"idle",status:"error"};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...e.state}}};this.state=r(this.state),Cs.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function eL(e,r){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:W3(r.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function wM(e,r){return{data:e,dataUpdatedAt:r??Date.now(),error:null,isInvalidated:!1,status:"success"}}function SM(e){const r=typeof e.initialData=="function"?e.initialData():e.initialData,s=r!==void 0,o=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:r,dataUpdateCount:0,dataUpdatedAt:s?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var KY=class extends jg{constructor(e,r){super(),this.options=r,this.#e=e,this.#i=null,this.#o=AT(),this.bindMethods(),this.setOptions(r)}#e;#t=void 0;#n=void 0;#s=void 0;#r;#a;#o;#i;#m;#h;#p;#c;#u;#l;#f=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),EM(this.#t,this.options)?this.#d():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return kT(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return kT(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const r=this.options,s=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof no(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#t.setOptions(this.options),r._defaulted&&!Oj(this.options,r)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const o=this.hasListeners();o&&jM(this.#t,s,this.options,r)&&this.#d(),this.updateResult(),o&&(this.#t!==s||no(this.options.enabled,this.#t)!==no(r.enabled,this.#t)||Ld(this.options.staleTime,this.#t)!==Ld(r.staleTime,this.#t))&&this.#g();const d=this.#y();o&&(this.#t!==s||no(this.options.enabled,this.#t)!==no(r.enabled,this.#t)||d!==this.#l)&&this.#v(d)}getOptimisticResult(e){const r=this.#e.getQueryCache().build(this.#e,e),s=this.createResult(r,e);return HY(this,s)&&(this.#s=s,this.#a=this.options,this.#r=this.#t.state),s}getCurrentResult(){return this.#s}trackResult(e,r){return new Proxy(e,{get:(s,o)=>(this.trackProp(o),r?.(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,o))})}trackProp(e){this.#f.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const r=this.#e.defaultQueryOptions(e),s=this.#e.getQueryCache().build(this.#e,r);return s.fetch().then(()=>this.createResult(s,r))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#d(e){this.#S();let r=this.#t.fetch(this.options,e);return e?.throwOnError||(r=r.catch(Pi)),r}#g(){this.#b();const e=Ld(this.options.staleTime,this.#t);if(Cp||this.#s.isStale||!ET(e))return;const s=G3(this.#s.dataUpdatedAt,e)+1;this.#c=vp.setTimeout(()=>{this.#s.isStale||this.updateResult()},s)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#w(),this.#l=e,!(Cp||no(this.options.enabled,this.#t)===!1||!ET(this.#l)||this.#l===0)&&(this.#u=vp.setInterval(()=>{(this.options.refetchIntervalInBackground||M_.isFocused())&&this.#d()},this.#l))}#x(){this.#g(),this.#v(this.#y())}#b(){this.#c&&(vp.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(vp.clearInterval(this.#u),this.#u=void 0)}createResult(e,r){const s=this.#t,o=this.options,d=this.#s,p=this.#r,m=this.#a,b=e!==s?e.state:this.#n,{state:S}=e;let j={...S},A=!1,k;if(r._optimisticResults){const ne=this.hasListeners(),de=!ne&&EM(e,r),je=ne&&jM(e,s,r,o);(de||je)&&(j={...j,...eL(S.data,e.options)}),r._optimisticResults==="isRestoring"&&(j.fetchStatus="idle")}let{error:T,errorUpdatedAt:M,status:I}=j;k=j.data;let q=!1;if(r.placeholderData!==void 0&&k===void 0&&I==="pending"){let ne;d?.isPlaceholderData&&r.placeholderData===m?.placeholderData?(ne=d.data,q=!0):ne=typeof r.placeholderData=="function"?r.placeholderData(this.#p?.state.data,this.#p):r.placeholderData,ne!==void 0&&(I="success",k=CT(d?.data,ne,r),A=!0)}if(r.select&&k!==void 0&&!q)if(d&&k===p?.data&&r.select===this.#m)k=this.#h;else try{this.#m=r.select,k=r.select(k),k=CT(d?.data,k,r),this.#h=k,this.#i=null}catch(ne){this.#i=ne}this.#i&&(T=this.#i,k=this.#h,M=Date.now(),I="error");const G=j.fetchStatus==="fetching",K=I==="pending",X=I==="error",L=K&&G,ee=k!==void 0,Q={status:I,fetchStatus:j.fetchStatus,isPending:K,isSuccess:I==="success",isError:X,isInitialLoading:L,isLoading:L,data:k,dataUpdatedAt:j.dataUpdatedAt,error:T,errorUpdatedAt:M,failureCount:j.fetchFailureCount,failureReason:j.fetchFailureReason,errorUpdateCount:j.errorUpdateCount,isFetched:j.dataUpdateCount>0||j.errorUpdateCount>0,isFetchedAfterMount:j.dataUpdateCount>b.dataUpdateCount||j.errorUpdateCount>b.errorUpdateCount,isFetching:G,isRefetching:G&&!K,isLoadingError:X&&!ee,isPaused:j.fetchStatus==="paused",isPlaceholderData:A,isRefetchError:X&&ee,isStale:I_(e,r),refetch:this.refetch,promise:this.#o,isEnabled:no(r.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const ne=ve=>{Q.status==="error"?ve.reject(Q.error):Q.data!==void 0&&ve.resolve(Q.data)},de=()=>{const ve=this.#o=Q.promise=AT();ne(ve)},je=this.#o;switch(je.status){case"pending":e.queryHash===s.queryHash&&ne(je);break;case"fulfilled":(Q.status==="error"||Q.data!==je.value)&&de();break;case"rejected":(Q.status!=="error"||Q.error!==je.reason)&&de();break}}return Q}updateResult(){const e=this.#s,r=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#a=this.options,this.#r.data!==void 0&&(this.#p=this.#t),Oj(r,e))return;this.#s=r;const s=()=>{if(!e)return!0;const{notifyOnChangeProps:o}=this.options,d=typeof o=="function"?o():o;if(d==="all"||!d&&!this.#f.size)return!0;const p=new Set(d??this.#f);return this.options.throwOnError&&p.add("error"),Object.keys(this.#s).some(m=>{const g=m;return this.#s[g]!==e[g]&&p.has(g)})};this.#E({listeners:s()})}#S(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const r=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(r?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#E(e){Cs.batch(()=>{e.listeners&&this.listeners.forEach(r=>{r(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function VY(e,r){return no(r.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&r.retryOnMount===!1)}function EM(e,r){return VY(e,r)||e.state.data!==void 0&&kT(e,r,r.refetchOnMount)}function kT(e,r,s){if(no(r.enabled,e)!==!1&&Ld(r.staleTime,e)!=="static"){const o=typeof s=="function"?s(e):s;return o==="always"||o!==!1&&I_(e,r)}return!1}function jM(e,r,s,o){return(e!==r||no(o.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&I_(e,s)}function I_(e,r){return no(r.enabled,e)!==!1&&e.isStaleByTime(Ld(r.staleTime,e))}function HY(e,r){return!Oj(e.getCurrentResult(),r)}function CM(e){return{onFetch:(r,s)=>{const o=r.options,d=r.fetchOptions?.meta?.fetchMore?.direction,p=r.state.data?.pages||[],m=r.state.data?.pageParams||[];let g={pages:[],pageParams:[]},b=0;const S=async()=>{let j=!1;const A=M=>{Object.defineProperty(M,"signal",{enumerable:!0,get:()=>(r.signal.aborted?j=!0:r.signal.addEventListener("abort",()=>{j=!0}),r.signal)})},k=Y3(r.options,r.fetchOptions),T=async(M,I,q)=>{if(j)return Promise.reject();if(I==null&&M.pages.length)return Promise.resolve(M);const K=(()=>{const oe={client:r.client,queryKey:r.queryKey,pageParam:I,direction:q?"backward":"forward",meta:r.options.meta};return A(oe),oe})(),X=await k(K),{maxPages:L}=r.options,ee=q?IY:MY;return{pages:ee(M.pages,X,L),pageParams:ee(M.pageParams,I,L)}};if(d&&p.length){const M=d==="backward",I=M?GY:AM,q={pages:p,pageParams:m},G=I(o,q);g=await T(q,G,M)}else{const M=e??p.length;do{const I=b===0?m[0]??o.initialPageParam:AM(o,g);if(b>0&&I==null)break;g=await T(g,I),b++}while(br.options.persister?.(S,{client:r.client,queryKey:r.queryKey,meta:r.options.meta,signal:r.signal},s):r.fetchFn=S}}}function AM(e,{pages:r,pageParams:s}){const o=r.length-1;return r.length>0?e.getNextPageParam(r[o],r,s[o],s):void 0}function GY(e,{pages:r,pageParams:s}){return r.length>0?e.getPreviousPageParam?.(r[0],r,s[0],s):void 0}var XY=class extends Q3{#e;#t;#n;#s;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||tL(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(r=>r!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const r=()=>{this.#r({type:"continue"})},s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=J3({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(new Error("No mutationFn found")),onFail:(p,m)=>{this.#r({type:"failed",failureCount:p,error:m})},onPause:()=>{this.#r({type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const o=this.state.status==="pending",d=!this.#s.canStart();try{if(o)r();else{this.#r({type:"pending",variables:e,isPaused:d}),await this.#n.config.onMutate?.(e,this,s);const m=await this.options.onMutate?.(e,s);m!==this.state.context&&this.#r({type:"pending",context:m,variables:e,isPaused:d})}const p=await this.#s.start();return await this.#n.config.onSuccess?.(p,e,this.state.context,this,s),await this.options.onSuccess?.(p,e,this.state.context,s),await this.#n.config.onSettled?.(p,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(p,null,e,this.state.context,s),this.#r({type:"success",data:p}),p}catch(p){try{throw await this.#n.config.onError?.(p,e,this.state.context,this,s),await this.options.onError?.(p,e,this.state.context,s),await this.#n.config.onSettled?.(void 0,p,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(void 0,p,e,this.state.context,s),p}finally{this.#r({type:"error",error:p})}}finally{this.#n.runNext(this)}}#r(e){const r=s=>{switch(e.type){case"failed":return{...s,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...s,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:e.error,failureCount:s.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Cs.batch(()=>{this.#t.forEach(s=>{s.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function tL(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var YY=class extends jg{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,r,s){const o=new XY({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(r),state:s});return this.add(o),o}add(e){this.#e.add(e);const r=LE(e);if(typeof r=="string"){const s=this.#t.get(r);s?s.push(e):this.#t.set(r,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const r=LE(e);if(typeof r=="string"){const s=this.#t.get(r);if(s)if(s.length>1){const o=s.indexOf(e);o!==-1&&s.splice(o,1)}else s[0]===e&&this.#t.delete(r)}}this.notify({type:"removed",mutation:e})}canRun(e){const r=LE(e);if(typeof r=="string"){const o=this.#t.get(r)?.find(d=>d.state.status==="pending");return!o||o===e}else return!0}runNext(e){const r=LE(e);return typeof r=="string"?this.#t.get(r)?.find(o=>o!==e&&o.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Cs.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const r={exact:!0,...e};return this.getAll().find(s=>vM(r,s))}findAll(e={}){return this.getAll().filter(r=>vM(e,r))}notify(e){Cs.batch(()=>{this.listeners.forEach(r=>{r(e)})})}resumePausedMutations(){const e=this.getAll().filter(r=>r.state.isPaused);return Cs.batch(()=>Promise.all(e.map(r=>r.continue().catch(Pi))))}};function LE(e){return e.options.scope?.id}var ZY=class extends jg{#e;#t=void 0;#n;#s;constructor(r,s){super(),this.#e=r,this.setOptions(s),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){const s=this.options;this.options=this.#e.defaultMutationOptions(r),Oj(this.options,s)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),s?.mutationKey&&this.options.mutationKey&&Ap(s.mutationKey)!==Ap(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(r){this.#r(),this.#a(r)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#a()}mutate(r,s){return this.#s=s,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(r)}#r(){const r=this.#n?.state??tL();this.#t={...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset}}#a(r){Cs.batch(()=>{if(this.#s&&this.hasListeners()){const s=this.#t.variables,o=this.#t.context,d={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};r?.type==="success"?(this.#s.onSuccess?.(r.data,s,o,d),this.#s.onSettled?.(r.data,null,s,o,d)):r?.type==="error"&&(this.#s.onError?.(r.error,s,o,d),this.#s.onSettled?.(void 0,r.error,s,o,d))}this.listeners.forEach(s=>{s(this.#t)})})}},WY=class extends jg{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,r,s){const o=r.queryKey,d=r.queryHash??D_(o,r);let p=this.get(d);return p||(p=new UY({client:e,queryKey:o,queryHash:d,options:e.defaultQueryOptions(r),state:s,defaultOptions:e.getQueryDefaults(o)}),this.add(p)),p}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const r=this.#e.get(e.queryHash);r&&(e.destroy(),r===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Cs.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const r={exact:!0,...e};return this.getAll().find(s=>yM(r,s))}findAll(e={}){const r=this.getAll();return Object.keys(e).length>0?r.filter(s=>yM(e,s)):r}notify(e){Cs.batch(()=>{this.listeners.forEach(r=>{r(e)})})}onFocus(){Cs.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Cs.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},JY=class{#e;#t;#n;#s;#r;#a;#o;#i;constructor(e={}){this.#e=e.queryCache||new WY,this.#t=e.mutationCache||new YY,this.#n=e.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=M_.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=kj.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const r=this.defaultQueryOptions({queryKey:e});return this.#e.get(r.queryHash)?.state.data}ensureQueryData(e){const r=this.defaultQueryOptions(e),s=this.#e.build(this,r),o=s.state.data;return o===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(Ld(r.staleTime,s))&&this.prefetchQuery(r),Promise.resolve(o))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:r,state:s})=>{const o=s.data;return[r,o]})}setQueryData(e,r,s){const o=this.defaultQueryOptions({queryKey:e}),p=this.#e.get(o.queryHash)?.state.data,m=NY(r,p);if(m!==void 0)return this.#e.build(this,o).setData(m,{...s,manual:!0})}setQueriesData(e,r,s){return Cs.batch(()=>this.#e.findAll(e).map(({queryKey:o})=>[o,this.setQueryData(o,r,s)]))}getQueryState(e){const r=this.defaultQueryOptions({queryKey:e});return this.#e.get(r.queryHash)?.state}removeQueries(e){const r=this.#e;Cs.batch(()=>{r.findAll(e).forEach(s=>{r.remove(s)})})}resetQueries(e,r){const s=this.#e;return Cs.batch(()=>(s.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...e},r)))}cancelQueries(e,r={}){const s={revert:!0,...r},o=Cs.batch(()=>this.#e.findAll(e).map(d=>d.cancel(s)));return Promise.all(o).then(Pi).catch(Pi)}invalidateQueries(e,r={}){return Cs.batch(()=>(this.#e.findAll(e).forEach(s=>{s.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},r)))}refetchQueries(e,r={}){const s={...r,cancelRefetch:r.cancelRefetch??!0},o=Cs.batch(()=>this.#e.findAll(e).filter(d=>!d.isDisabled()&&!d.isStatic()).map(d=>{let p=d.fetch(void 0,s);return s.throwOnError||(p=p.catch(Pi)),d.state.fetchStatus==="paused"?Promise.resolve():p}));return Promise.all(o).then(Pi)}fetchQuery(e){const r=this.defaultQueryOptions(e);r.retry===void 0&&(r.retry=!1);const s=this.#e.build(this,r);return s.isStaleByTime(Ld(r.staleTime,s))?s.fetch(r):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Pi).catch(Pi)}fetchInfiniteQuery(e){return e.behavior=CM(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Pi).catch(Pi)}ensureInfiniteQueryData(e){return e.behavior=CM(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return kj.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,r){this.#s.set(Ap(e),{queryKey:e,defaultOptions:r})}getQueryDefaults(e){const r=[...this.#s.values()],s={};return r.forEach(o=>{Mb(e,o.queryKey)&&Object.assign(s,o.defaultOptions)}),s}setMutationDefaults(e,r){this.#r.set(Ap(e),{mutationKey:e,defaultOptions:r})}getMutationDefaults(e){const r=[...this.#r.values()],s={};return r.forEach(o=>{Mb(e,o.mutationKey)&&Object.assign(s,o.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const r={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return r.queryHash||(r.queryHash=D_(r.queryKey,r)),r.refetchOnReconnect===void 0&&(r.refetchOnReconnect=r.networkMode!=="always"),r.throwOnError===void 0&&(r.throwOnError=!!r.suspense),!r.networkMode&&r.persister&&(r.networkMode="offlineFirst"),r.queryFn===P_&&(r.enabled=!1),r}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},nL=R.createContext(void 0),Hs=e=>{const r=R.useContext(nL);if(!r)throw new Error("No QueryClient set, use QueryClientProvider to set one");return r},QY=({client:e,children:r})=>(R.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx(nL.Provider,{value:e,children:r})),rL=R.createContext(!1),eZ=()=>R.useContext(rL);rL.Provider;function tZ(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var nZ=R.createContext(tZ()),rZ=()=>R.useContext(nZ),sZ=(e,r)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(r.isReset()||(e.retryOnMount=!1))},iZ=e=>{R.useEffect(()=>{e.clearReset()},[e])},aZ=({result:e,errorResetBoundary:r,throwOnError:s,query:o,suspense:d})=>e.isError&&!r.isReset()&&!e.isFetching&&o&&(d&&e.data===void 0||Z3(s,[e.error,o])),oZ=e=>{if(e.suspense){const s=d=>d==="static"?d:Math.max(d??1e3,1e3),o=e.staleTime;e.staleTime=typeof o=="function"?(...d)=>s(o(...d)):s(o),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},lZ=(e,r)=>e.isLoading&&e.isFetching&&!r,cZ=(e,r)=>e?.suspense&&r.isPending,OM=(e,r,s)=>r.fetchOptimistic(e).catch(()=>{s.clearReset()});function uZ(e,r,s){const o=eZ(),d=rZ(),p=Hs(),m=p.defaultQueryOptions(e);p.getDefaultOptions().queries?._experimental_beforeQuery?.(m),m._optimisticResults=o?"isRestoring":"optimistic",oZ(m),sZ(m,d),iZ(d);const g=!p.getQueryCache().get(m.queryHash),[b]=R.useState(()=>new r(p,m)),S=b.getOptimisticResult(m),j=!o&&e.subscribed!==!1;if(R.useSyncExternalStore(R.useCallback(A=>{const k=j?b.subscribe(Cs.batchCalls(A)):Pi;return b.updateResult(),k},[b,j]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),R.useEffect(()=>{b.setOptions(m)},[m,b]),cZ(m,S))throw OM(m,b,d);if(aZ({result:S,errorResetBoundary:d,throwOnError:m.throwOnError,query:p.getQueryCache().get(m.queryHash),suspense:m.suspense}))throw S.error;return p.getDefaultOptions().queries?._experimental_afterQuery?.(m,S),m.experimental_prefetchInRender&&!Cp&&lZ(S,o)&&(g?OM(m,b,d):p.getQueryCache().get(m.queryHash)?.promise)?.catch(Pi).finally(()=>{b.updateResult()}),m.notifyOnChangeProps?S:b.trackResult(S)}function rr(e,r){return uZ(e,KY)}function nn(e,r){const s=Hs(),[o]=R.useState(()=>new ZY(s,e));R.useEffect(()=>{o.setOptions(e)},[o,e]);const d=R.useSyncExternalStore(R.useCallback(m=>o.subscribe(Cs.batchCalls(m)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),p=R.useCallback((m,g)=>{o.mutate(m,g).catch(Pi)},[o]);if(d.error&&Z3(o.options.throwOnError,[d.error]))throw d.error;return{...d,mutate:p,mutateAsync:d.mutate}}const dZ=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),hZ=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(r,s,o)=>o?o.toUpperCase():s.toLowerCase()),kM=e=>{const r=hZ(e);return r.charAt(0).toUpperCase()+r.slice(1)},sL=(...e)=>e.filter((r,s,o)=>!!r&&r.trim()!==""&&o.indexOf(r)===s).join(" ").trim(),pZ=e=>{for(const r in e)if(r.startsWith("aria-")||r==="role"||r==="title")return!0};var fZ={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"};const mZ=R.forwardRef(({color:e="currentColor",size:r=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:d="",children:p,iconNode:m,...g},b)=>R.createElement("svg",{ref:b,...fZ,width:r,height:r,stroke:e,strokeWidth:o?Number(s)*24/Number(r):s,className:sL("lucide",d),...!p&&!pZ(g)&&{"aria-hidden":"true"},...g},[...m.map(([S,j])=>R.createElement(S,j)),...Array.isArray(p)?p:[p]]));const ln=(e,r)=>{const s=R.forwardRef(({className:o,...d},p)=>R.createElement(mZ,{ref:p,iconNode:r,className:sL(`lucide-${dZ(kM(e))}`,`lucide-${e}`,o),...d}));return s.displayName=kM(e),s};const gZ=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],yZ=ln("boxes",gZ);const vZ=[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]],iL=ln("building-2",vZ);const xZ=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],aL=ln("check",xZ);const bZ=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],oL=ln("chevron-down",bZ);const wZ=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],SZ=ln("chevron-right",wZ);const EZ=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],jZ=ln("chevron-up",EZ);const CZ=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],AZ=ln("chevrons-up-down",CZ);const OZ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],RM=ln("circle-alert",OZ);const kZ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],L_=ln("circle-check",kZ);const RZ=[["path",{d:"M22 2 2 22",key:"y4kqgn"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Qb=ln("circle-slash-2",RZ);const TZ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],_Z=ln("circle",TZ);const $Z=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]],NZ=ln("clipboard",$Z);const DZ=[["path",{d:"M15.536 11.293a1 1 0 0 0 0 1.414l2.376 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1uwlt4"}],["path",{d:"M2.297 11.293a1 1 0 0 0 0 1.414l2.377 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414L6.088 8.916a1 1 0 0 0-1.414 0z",key:"10291m"}],["path",{d:"M8.916 17.912a1 1 0 0 0 0 1.415l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.415l-2.377-2.376a1 1 0 0 0-1.414 0z",key:"1tqoq1"}],["path",{d:"M8.916 4.674a1 1 0 0 0 0 1.414l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1x6lto"}]],PZ=ln("component",DZ);const MZ=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],IZ=ln("download",MZ);const LZ=[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],zZ=ln("earth",LZ);const FZ=[["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"}]],z_=ln("ellipsis",FZ);const qZ=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],BZ=ln("external-link",qZ);const UZ=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],RT=ln("eye",UZ);const KZ=[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],VZ=ln("file-code-corner",KZ);const HZ=[["path",{d:"M10.65 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v10.1",key:"1a2hbp"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m10 15 1 1",key:"1h4vmv"}],["path",{d:"m11 14-4.586 4.586",key:"maylof"}],["circle",{cx:"5",cy:"20",r:"2",key:"860zyv"}]],GZ=ln("file-key",HZ);const XZ=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],YZ=ln("git-commit-horizontal",XZ);const ZZ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],lL=ln("info",ZZ);const WZ=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],JZ=ln("key-round",WZ);const QZ=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],zE=ln("link",QZ);const eW=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ds=ln("loader-circle",eW);const tW=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],nW=ln("lock-keyhole",tW);const rW=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],sW=ln("map-pin",rW);const iW=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],aW=ln("monitor",iW);const oW=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],lW=ln("moon",oW);const cW=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],uW=ln("network",cW);const dW=[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],hW=ln("octagon-x",dW);const pW=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],fW=ln("panel-left",pW);const mW=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],pu=ln("pencil",mW);const gW=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],oo=ln("plus",gW);const yW=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],vW=ln("refresh-cw",yW);const xW=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Pa=ln("search",xW);const bW=[["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"}]],F_=ln("server",bW);const wW=[["path",{d:"M3 3h.01",key:"159qn6"}],["path",{d:"M7 5h.01",key:"1hq22a"}],["path",{d:"M11 7h.01",key:"1osv80"}],["path",{d:"M3 7h.01",key:"1xzrh3"}],["path",{d:"M7 9h.01",key:"19b3jx"}],["path",{d:"M3 11h.01",key:"1eifu7"}],["rect",{width:"4",height:"4",x:"15",y:"5",key:"mri9e4"}],["path",{d:"m19 9 2 2v10c0 .6-.4 1-1 1h-6c-.6 0-1-.4-1-1V11l2-2",key:"aib6hk"}],["path",{d:"m13 14 8-2",key:"1d7bmk"}],["path",{d:"m13 19 8-2",key:"1y2vml"}]],SW=ln("spray-can",wW);const EW=[["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"}]],jW=ln("sun",EW);const CW=[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]],gC=ln("tags",CW);const AW=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Ib=ln("trash-2",AW);const OW=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Rj=ln("triangle-alert",OW);const kW=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],RW=ln("user-round",kW);const TW=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],cL=ln("users",TW);const _W=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],$W=ln("wrench",_W);const NW=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],q_=ln("x",NW);function DW(e){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",r.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}const PW=e=>{switch(e){case"success":return LW;case"info":return FW;case"warning":return zW;case"error":return qW;default:return null}},MW=Array(12).fill(0),IW=({visible:e,className:r})=>Je.createElement("div",{className:["sonner-loading-wrapper",r].filter(Boolean).join(" "),"data-visible":e},Je.createElement("div",{className:"sonner-spinner"},MW.map((s,o)=>Je.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),LW=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Je.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),zW=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Je.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),FW=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Je.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),qW=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Je.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),BW=Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Je.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Je.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),UW=()=>{const[e,r]=Je.useState(document.hidden);return Je.useEffect(()=>{const s=()=>{r(document.hidden)};return document.addEventListener("visibilitychange",s),()=>window.removeEventListener("visibilitychange",s)},[]),e};let TT=1;class KW{constructor(){this.subscribe=r=>(this.subscribers.push(r),()=>{const s=this.subscribers.indexOf(r);this.subscribers.splice(s,1)}),this.publish=r=>{this.subscribers.forEach(s=>s(r))},this.addToast=r=>{this.publish(r),this.toasts=[...this.toasts,r]},this.create=r=>{var s;const{message:o,...d}=r,p=typeof r?.id=="number"||((s=r.id)==null?void 0:s.length)>0?r.id:TT++,m=this.toasts.find(b=>b.id===p),g=r.dismissible===void 0?!0:r.dismissible;return this.dismissedToasts.has(p)&&this.dismissedToasts.delete(p),m?this.toasts=this.toasts.map(b=>b.id===p?(this.publish({...b,...r,id:p,title:o}),{...b,...r,id:p,dismissible:g,title:o}):b):this.addToast({title:o,...d,dismissible:g,id:p}),p},this.dismiss=r=>(r?(this.dismissedToasts.add(r),requestAnimationFrame(()=>this.subscribers.forEach(s=>s({id:r,dismiss:!0})))):this.toasts.forEach(s=>{this.subscribers.forEach(o=>o({id:s.id,dismiss:!0}))}),r),this.message=(r,s)=>this.create({...s,message:r}),this.error=(r,s)=>this.create({...s,message:r,type:"error"}),this.success=(r,s)=>this.create({...s,type:"success",message:r}),this.info=(r,s)=>this.create({...s,type:"info",message:r}),this.warning=(r,s)=>this.create({...s,type:"warning",message:r}),this.loading=(r,s)=>this.create({...s,type:"loading",message:r}),this.promise=(r,s)=>{if(!s)return;let o;s.loading!==void 0&&(o=this.create({...s,promise:r,type:"loading",message:s.loading,description:typeof s.description!="function"?s.description:void 0}));const d=Promise.resolve(r instanceof Function?r():r);let p=o!==void 0,m;const g=d.then(async S=>{if(m=["resolve",S],Je.isValidElement(S))p=!1,this.create({id:o,type:"default",message:S});else if(HW(S)&&!S.ok){p=!1;const A=typeof s.error=="function"?await s.error(`HTTP error! status: ${S.status}`):s.error,k=typeof s.description=="function"?await s.description(`HTTP error! status: ${S.status}`):s.description,M=typeof A=="object"&&!Je.isValidElement(A)?A:{message:A};this.create({id:o,type:"error",description:k,...M})}else if(S instanceof Error){p=!1;const A=typeof s.error=="function"?await s.error(S):s.error,k=typeof s.description=="function"?await s.description(S):s.description,M=typeof A=="object"&&!Je.isValidElement(A)?A:{message:A};this.create({id:o,type:"error",description:k,...M})}else if(s.success!==void 0){p=!1;const A=typeof s.success=="function"?await s.success(S):s.success,k=typeof s.description=="function"?await s.description(S):s.description,M=typeof A=="object"&&!Je.isValidElement(A)?A:{message:A};this.create({id:o,type:"success",description:k,...M})}}).catch(async S=>{if(m=["reject",S],s.error!==void 0){p=!1;const j=typeof s.error=="function"?await s.error(S):s.error,A=typeof s.description=="function"?await s.description(S):s.description,T=typeof j=="object"&&!Je.isValidElement(j)?j:{message:j};this.create({id:o,type:"error",description:A,...T})}}).finally(()=>{p&&(this.dismiss(o),o=void 0),s.finally==null||s.finally.call(s)}),b=()=>new Promise((S,j)=>g.then(()=>m[0]==="reject"?j(m[1]):S(m[1])).catch(j));return typeof o!="string"&&typeof o!="number"?{unwrap:b}:Object.assign(o,{unwrap:b})},this.custom=(r,s)=>{const o=s?.id||TT++;return this.create({jsx:r(o),id:o,...s}),o},this.getActiveToasts=()=>this.toasts.filter(r=>!this.dismissedToasts.has(r.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const ca=new KW,VW=(e,r)=>{const s=r?.id||TT++;return ca.addToast({title:e,...r,id:s}),s},HW=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",GW=VW,XW=()=>ca.toasts,YW=()=>ca.getActiveToasts(),Ze=Object.assign(GW,{success:ca.success,info:ca.info,warning:ca.warning,error:ca.error,custom:ca.custom,message:ca.message,promise:ca.promise,dismiss:ca.dismiss,loading:ca.loading},{getHistory:XW,getToasts:YW});DW("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function FE(e){return e.label!==void 0}const ZW=3,WW="24px",JW="16px",TM=4e3,QW=356,eJ=14,tJ=45,nJ=200;function Wl(...e){return e.filter(Boolean).join(" ")}function rJ(e){const[r,s]=e.split("-"),o=[];return r&&o.push(r),s&&o.push(s),o}const sJ=e=>{var r,s,o,d,p,m,g,b,S;const{invert:j,toast:A,unstyled:k,interacting:T,setHeights:M,visibleToasts:I,heights:q,index:G,toasts:K,expanded:X,removeToast:L,defaultRichColors:ee,closeButton:oe,style:Q,cancelButtonStyle:ne,actionButtonStyle:de,className:je="",descriptionClassName:ve="",duration:le,position:be,gap:Ce,expandByDefault:Ke,classNames:ce,icons:re,closeButtonAriaLabel:ue="Close toast"}=e,[_e,fe]=Je.useState(null),[He,Oe]=Je.useState(null),[ke,Ve]=Je.useState(!1),[ie,De]=Je.useState(!1),[Le,tt]=Je.useState(!1),[ft,Ot]=Je.useState(!1),[Ft,kt]=Je.useState(!1),[Jt,ze]=Je.useState(0),[zt,Rt]=Je.useState(0),V=Je.useRef(A.duration||le||TM),Nn=Je.useRef(null),cn=Je.useRef(null),xe=G===0,Ne=G+1<=I,Ge=A.type,D=A.dismissible!==!1,z=A.className||"",H=A.descriptionClassName||"",W=Je.useMemo(()=>q.findIndex(Lt=>Lt.toastId===A.id)||0,[q,A.id]),we=Je.useMemo(()=>{var Lt;return(Lt=A.closeButton)!=null?Lt:oe},[A.closeButton,oe]),Re=Je.useMemo(()=>A.duration||le||TM,[A.duration,le]),st=Je.useRef(0),Kt=Je.useRef(0),Qt=Je.useRef(0),Fn=Je.useRef(null),[dn,Ht]=be.split("-"),wi=Je.useMemo(()=>q.reduce((Lt,vr,Yr)=>Yr>=W?Lt:Lt+vr.height,0),[q,W]),Xr=UW(),fa=A.invert||j,uo=Ge==="loading";Kt.current=Je.useMemo(()=>W*Ce+wi,[W,wi]),Je.useEffect(()=>{V.current=Re},[Re]),Je.useEffect(()=>{Ve(!0)},[]),Je.useEffect(()=>{const Lt=cn.current;if(Lt){const vr=Lt.getBoundingClientRect().height;return Rt(vr),M(Yr=>[{toastId:A.id,height:vr,position:A.position},...Yr]),()=>M(Yr=>Yr.filter(Os=>Os.toastId!==A.id))}},[M,A.id]),Je.useLayoutEffect(()=>{if(!ke)return;const Lt=cn.current,vr=Lt.style.height;Lt.style.height="auto";const Yr=Lt.getBoundingClientRect().height;Lt.style.height=vr,Rt(Yr),M(Os=>Os.find(Er=>Er.toastId===A.id)?Os.map(Er=>Er.toastId===A.id?{...Er,height:Yr}:Er):[{toastId:A.id,height:Yr,position:A.position},...Os])},[ke,A.title,A.description,M,A.id,A.jsx,A.action,A.cancel]);const Ma=Je.useCallback(()=>{De(!0),ze(Kt.current),M(Lt=>Lt.filter(vr=>vr.toastId!==A.id)),setTimeout(()=>{L(A)},nJ)},[A,L,M,Kt]);Je.useEffect(()=>{if(A.promise&&Ge==="loading"||A.duration===1/0||A.type==="loading")return;let Lt;return X||T||Xr?(()=>{if(Qt.current{V.current!==1/0&&(st.current=new Date().getTime(),Lt=setTimeout(()=>{A.onAutoClose==null||A.onAutoClose.call(A,A),Ma()},V.current))})(),()=>clearTimeout(Lt)},[X,T,A,Ge,Xr,Ma]),Je.useEffect(()=>{A.delete&&(Ma(),A.onDismiss==null||A.onDismiss.call(A,A))},[Ma,A.delete]);function cc(){var Lt;if(re?.loading){var vr;return Je.createElement("div",{className:Wl(ce?.loader,A==null||(vr=A.classNames)==null?void 0:vr.loader,"sonner-loader"),"data-visible":Ge==="loading"},re.loading)}return Je.createElement(IW,{className:Wl(ce?.loader,A==null||(Lt=A.classNames)==null?void 0:Lt.loader),visible:Ge==="loading"})}const xu=A.icon||re?.[Ge]||PW(Ge);var uc,ma;return Je.createElement("li",{tabIndex:0,ref:cn,className:Wl(je,z,ce?.toast,A==null||(r=A.classNames)==null?void 0:r.toast,ce?.default,ce?.[Ge],A==null||(s=A.classNames)==null?void 0:s[Ge]),"data-sonner-toast":"","data-rich-colors":(uc=A.richColors)!=null?uc:ee,"data-styled":!(A.jsx||A.unstyled||k),"data-mounted":ke,"data-promise":!!A.promise,"data-swiped":Ft,"data-removed":ie,"data-visible":Ne,"data-y-position":dn,"data-x-position":Ht,"data-index":G,"data-front":xe,"data-swiping":Le,"data-dismissible":D,"data-type":Ge,"data-invert":fa,"data-swipe-out":ft,"data-swipe-direction":He,"data-expanded":!!(X||Ke&&ke),"data-testid":A.testId,style:{"--index":G,"--toasts-before":G,"--z-index":K.length-G,"--offset":`${ie?Jt:Kt.current}px`,"--initial-height":Ke?"auto":`${zt}px`,...Q,...A.style},onDragEnd:()=>{tt(!1),fe(null),Fn.current=null},onPointerDown:Lt=>{Lt.button!==2&&(uo||!D||(Nn.current=new Date,ze(Kt.current),Lt.target.setPointerCapture(Lt.pointerId),Lt.target.tagName!=="BUTTON"&&(tt(!0),Fn.current={x:Lt.clientX,y:Lt.clientY})))},onPointerUp:()=>{var Lt,vr,Yr;if(ft||!D)return;Fn.current=null;const Os=Number(((Lt=cn.current)==null?void 0:Lt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Dn=Number(((vr=cn.current)==null?void 0:vr.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Er=new Date().getTime()-((Yr=Nn.current)==null?void 0:Yr.getTime()),Ys=_e==="x"?Os:Dn,ll=Math.abs(Ys)/Er;if(Math.abs(Ys)>=tJ||ll>.11){ze(Kt.current),A.onDismiss==null||A.onDismiss.call(A,A),Oe(_e==="x"?Os>0?"right":"left":Dn>0?"down":"up"),Ma(),Ot(!0);return}else{var gs,Zs;(gs=cn.current)==null||gs.style.setProperty("--swipe-amount-x","0px"),(Zs=cn.current)==null||Zs.style.setProperty("--swipe-amount-y","0px")}kt(!1),tt(!1),fe(null)},onPointerMove:Lt=>{var vr,Yr,Os;if(!Fn.current||!D||((vr=window.getSelection())==null?void 0:vr.toString().length)>0)return;const Er=Lt.clientY-Fn.current.y,Ys=Lt.clientX-Fn.current.x;var ll;const gs=(ll=e.swipeDirections)!=null?ll:rJ(be);!_e&&(Math.abs(Ys)>1||Math.abs(Er)>1)&&fe(Math.abs(Ys)>Math.abs(Er)?"x":"y");let Zs={x:0,y:0};const bu=ga=>1/(1.5+Math.abs(ga)/20);if(_e==="y"){if(gs.includes("top")||gs.includes("bottom"))if(gs.includes("top")&&Er<0||gs.includes("bottom")&&Er>0)Zs.y=Er;else{const ga=Er*bu(Er);Zs.y=Math.abs(ga)0)Zs.x=Ys;else{const ga=Ys*bu(Ys);Zs.x=Math.abs(ga)0||Math.abs(Zs.y)>0)&&kt(!0),(Yr=cn.current)==null||Yr.style.setProperty("--swipe-amount-x",`${Zs.x}px`),(Os=cn.current)==null||Os.style.setProperty("--swipe-amount-y",`${Zs.y}px`)}},we&&!A.jsx&&Ge!=="loading"?Je.createElement("button",{"aria-label":ue,"data-disabled":uo,"data-close-button":!0,onClick:uo||!D?()=>{}:()=>{Ma(),A.onDismiss==null||A.onDismiss.call(A,A)},className:Wl(ce?.closeButton,A==null||(o=A.classNames)==null?void 0:o.closeButton)},(ma=re?.close)!=null?ma:BW):null,(Ge||A.icon||A.promise)&&A.icon!==null&&(re?.[Ge]!==null||A.icon)?Je.createElement("div",{"data-icon":"",className:Wl(ce?.icon,A==null||(d=A.classNames)==null?void 0:d.icon)},A.promise||A.type==="loading"&&!A.icon?A.icon||cc():null,A.type!=="loading"?xu:null):null,Je.createElement("div",{"data-content":"",className:Wl(ce?.content,A==null||(p=A.classNames)==null?void 0:p.content)},Je.createElement("div",{"data-title":"",className:Wl(ce?.title,A==null||(m=A.classNames)==null?void 0:m.title)},A.jsx?A.jsx:typeof A.title=="function"?A.title():A.title),A.description?Je.createElement("div",{"data-description":"",className:Wl(ve,H,ce?.description,A==null||(g=A.classNames)==null?void 0:g.description)},typeof A.description=="function"?A.description():A.description):null),Je.isValidElement(A.cancel)?A.cancel:A.cancel&&FE(A.cancel)?Je.createElement("button",{"data-button":!0,"data-cancel":!0,style:A.cancelButtonStyle||ne,onClick:Lt=>{FE(A.cancel)&&D&&(A.cancel.onClick==null||A.cancel.onClick.call(A.cancel,Lt),Ma())},className:Wl(ce?.cancelButton,A==null||(b=A.classNames)==null?void 0:b.cancelButton)},A.cancel.label):null,Je.isValidElement(A.action)?A.action:A.action&&FE(A.action)?Je.createElement("button",{"data-button":!0,"data-action":!0,style:A.actionButtonStyle||de,onClick:Lt=>{FE(A.action)&&(A.action.onClick==null||A.action.onClick.call(A.action,Lt),!Lt.defaultPrevented&&Ma())},className:Wl(ce?.actionButton,A==null||(S=A.classNames)==null?void 0:S.actionButton)},A.action.label):null)};function _M(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function iJ(e,r){const s={};return[e,r].forEach((o,d)=>{const p=d===1,m=p?"--mobile-offset":"--offset",g=p?JW:WW;function b(S){["top","right","bottom","left"].forEach(j=>{s[`${m}-${j}`]=typeof S=="number"?`${S}px`:S})}typeof o=="number"||typeof o=="string"?b(o):typeof o=="object"?["top","right","bottom","left"].forEach(S=>{o[S]===void 0?s[`${m}-${S}`]=g:s[`${m}-${S}`]=typeof o[S]=="number"?`${o[S]}px`:o[S]}):b(g)}),s}const aJ=Je.forwardRef(function(r,s){const{id:o,invert:d,position:p="bottom-right",hotkey:m=["altKey","KeyT"],expand:g,closeButton:b,className:S,offset:j,mobileOffset:A,theme:k="light",richColors:T,duration:M,style:I,visibleToasts:q=ZW,toastOptions:G,dir:K=_M(),gap:X=eJ,icons:L,containerAriaLabel:ee="Notifications"}=r,[oe,Q]=Je.useState([]),ne=Je.useMemo(()=>o?oe.filter(ke=>ke.toasterId===o):oe.filter(ke=>!ke.toasterId),[oe,o]),de=Je.useMemo(()=>Array.from(new Set([p].concat(ne.filter(ke=>ke.position).map(ke=>ke.position)))),[ne,p]),[je,ve]=Je.useState([]),[le,be]=Je.useState(!1),[Ce,Ke]=Je.useState(!1),[ce,re]=Je.useState(k!=="system"?k:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),ue=Je.useRef(null),_e=m.join("+").replace(/Key/g,"").replace(/Digit/g,""),fe=Je.useRef(null),He=Je.useRef(!1),Oe=Je.useCallback(ke=>{Q(Ve=>{var ie;return(ie=Ve.find(De=>De.id===ke.id))!=null&&ie.delete||ca.dismiss(ke.id),Ve.filter(({id:De})=>De!==ke.id)})},[]);return Je.useEffect(()=>ca.subscribe(ke=>{if(ke.dismiss){requestAnimationFrame(()=>{Q(Ve=>Ve.map(ie=>ie.id===ke.id?{...ie,delete:!0}:ie))});return}setTimeout(()=>{U3.flushSync(()=>{Q(Ve=>{const ie=Ve.findIndex(De=>De.id===ke.id);return ie!==-1?[...Ve.slice(0,ie),{...Ve[ie],...ke},...Ve.slice(ie+1)]:[ke,...Ve]})})})}),[oe]),Je.useEffect(()=>{if(k!=="system"){re(k);return}if(k==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?re("dark"):re("light")),typeof window>"u")return;const ke=window.matchMedia("(prefers-color-scheme: dark)");try{ke.addEventListener("change",({matches:Ve})=>{re(Ve?"dark":"light")})}catch{ke.addListener(({matches:ie})=>{try{re(ie?"dark":"light")}catch(De){console.error(De)}})}},[k]),Je.useEffect(()=>{oe.length<=1&&be(!1)},[oe]),Je.useEffect(()=>{const ke=Ve=>{var ie;if(m.every(tt=>Ve[tt]||Ve.code===tt)){var Le;be(!0),(Le=ue.current)==null||Le.focus()}Ve.code==="Escape"&&(document.activeElement===ue.current||(ie=ue.current)!=null&&ie.contains(document.activeElement))&&be(!1)};return document.addEventListener("keydown",ke),()=>document.removeEventListener("keydown",ke)},[m]),Je.useEffect(()=>{if(ue.current)return()=>{fe.current&&(fe.current.focus({preventScroll:!0}),fe.current=null,He.current=!1)}},[ue.current]),Je.createElement("section",{ref:s,"aria-label":`${ee} ${_e}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},de.map((ke,Ve)=>{var ie;const[De,Le]=ke.split("-");return ne.length?Je.createElement("ol",{key:ke,dir:K==="auto"?_M():K,tabIndex:-1,ref:ue,className:S,"data-sonner-toaster":!0,"data-sonner-theme":ce,"data-y-position":De,"data-x-position":Le,style:{"--front-toast-height":`${((ie=je[0])==null?void 0:ie.height)||0}px`,"--width":`${QW}px`,"--gap":`${X}px`,...I,...iJ(j,A)},onBlur:tt=>{He.current&&!tt.currentTarget.contains(tt.relatedTarget)&&(He.current=!1,fe.current&&(fe.current.focus({preventScroll:!0}),fe.current=null))},onFocus:tt=>{tt.target instanceof HTMLElement&&tt.target.dataset.dismissible==="false"||He.current||(He.current=!0,fe.current=tt.relatedTarget)},onMouseEnter:()=>be(!0),onMouseMove:()=>be(!0),onMouseLeave:()=>{Ce||be(!1)},onDragEnd:()=>be(!1),onPointerDown:tt=>{tt.target instanceof HTMLElement&&tt.target.dataset.dismissible==="false"||Ke(!0)},onPointerUp:()=>Ke(!1)},ne.filter(tt=>!tt.position&&Ve===0||tt.position===ke).map((tt,ft)=>{var Ot,Ft;return Je.createElement(sJ,{key:tt.id,icons:L,index:ft,toast:tt,defaultRichColors:T,duration:(Ot=G?.duration)!=null?Ot:M,className:G?.className,descriptionClassName:G?.descriptionClassName,invert:d,visibleToasts:q,closeButton:(Ft=G?.closeButton)!=null?Ft:b,interacting:Ce,position:ke,style:G?.style,unstyled:G?.unstyled,classNames:G?.classNames,cancelButtonStyle:G?.cancelButtonStyle,actionButtonStyle:G?.actionButtonStyle,closeButtonAriaLabel:G?.closeButtonAriaLabel,removeToast:Oe,toasts:ne.filter(kt=>kt.position==tt.position),heights:je.filter(kt=>kt.position==tt.position),setHeights:ve,expandByDefault:g,gap:X,expanded:le,swipeDirections:r.swipeDirections})})):null}))}),oJ=({...e})=>{const{theme:r="system"}=N_();return u.jsx(aJ,{theme:r,className:"toaster group",icons:{success:u.jsx(L_,{className:"size-4"}),info:u.jsx(lL,{className:"size-4"}),warning:u.jsx(Rj,{className:"size-4"}),error:u.jsx(hW,{className:"size-4"}),loading:u.jsx(Ds,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...e})},lJ=new JY,cJ=({children:e})=>u.jsx(QY,{client:lJ,children:u.jsxs(RY,{defaultTheme:"system",storageKey:"dragon-theme",children:[e,u.jsx(oJ,{richColors:!0,expand:!0,position:"top-center"})]})});var TR={exports:{}},rb={},_R={exports:{}},$R={};var $M;function uJ(){return $M||($M=1,(function(e){function r(ce,re){var ue=ce.length;ce.push(re);e:for(;0>>1,fe=ce[_e];if(0>>1;_ed(ke,ue))Ved(ie,ke)?(ce[_e]=ie,ce[Ve]=ue,_e=Ve):(ce[_e]=ke,ce[Oe]=ue,_e=Oe);else if(Ved(ie,ue))ce[_e]=ie,ce[Ve]=ue,_e=Ve;else break e}}return re}function d(ce,re){var ue=ce.sortIndex-re.sortIndex;return ue!==0?ue:ce.id-re.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var p=performance;e.unstable_now=function(){return p.now()}}else{var m=Date,g=m.now();e.unstable_now=function(){return m.now()-g}}var b=[],S=[],j=1,A=null,k=3,T=!1,M=!1,I=!1,q=!1,G=typeof setTimeout=="function"?setTimeout:null,K=typeof clearTimeout=="function"?clearTimeout:null,X=typeof setImmediate<"u"?setImmediate:null;function L(ce){for(var re=s(S);re!==null;){if(re.callback===null)o(S);else if(re.startTime<=ce)o(S),re.sortIndex=re.expirationTime,r(b,re);else break;re=s(S)}}function ee(ce){if(I=!1,L(ce),!M)if(s(b)!==null)M=!0,oe||(oe=!0,le());else{var re=s(S);re!==null&&Ke(ee,re.startTime-ce)}}var oe=!1,Q=-1,ne=5,de=-1;function je(){return q?!0:!(e.unstable_now()-dece&&je());){var _e=A.callback;if(typeof _e=="function"){A.callback=null,k=A.priorityLevel;var fe=_e(A.expirationTime<=ce);if(ce=e.unstable_now(),typeof fe=="function"){A.callback=fe,L(ce),re=!0;break t}A===s(b)&&o(b),L(ce)}else o(b);A=s(b)}if(A!==null)re=!0;else{var He=s(S);He!==null&&Ke(ee,He.startTime-ce),re=!1}}break e}finally{A=null,k=ue,T=!1}re=void 0}}finally{re?le():oe=!1}}}var le;if(typeof X=="function")le=function(){X(ve)};else if(typeof MessageChannel<"u"){var be=new MessageChannel,Ce=be.port2;be.port1.onmessage=ve,le=function(){Ce.postMessage(null)}}else le=function(){G(ve,0)};function Ke(ce,re){Q=G(function(){ce(e.unstable_now())},re)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(ce){ce.callback=null},e.unstable_forceFrameRate=function(ce){0>ce||125_e?(ce.sortIndex=ue,r(S,ce),s(b)===null&&ce===s(S)&&(I?(K(Q),Q=-1):I=!0,Ke(ee,ue-_e))):(ce.sortIndex=fe,r(b,ce),M||T||(M=!0,oe||(oe=!0,le()))),ce},e.unstable_shouldYield=je,e.unstable_wrapCallback=function(ce){var re=k;return function(){var ue=k;k=re;try{return ce.apply(this,arguments)}finally{k=ue}}}})($R)),$R}var NM;function dJ(){return NM||(NM=1,_R.exports=uJ()),_R.exports}var DM;function hJ(){if(DM)return rb;DM=1;var e=dJ(),r=K3(),s=pY();function o(a){var c="https://react.dev/errors/"+a;if(1fe||(a.current=_e[fe],_e[fe]=null,fe--)}function ke(a,c){fe++,_e[fe]=a.current,a.current=c}var Ve=He(null),ie=He(null),De=He(null),Le=He(null);function tt(a,c){switch(ke(De,c),ke(ie,a),ke(Ve,null),c.nodeType){case 9:case 11:a=(a=c.documentElement)&&(a=a.namespaceURI)?gd(a):0;break;default:if(a=c.tagName,c=c.namespaceURI)c=gd(c),a=qh(c,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}Oe(Ve),ke(Ve,a)}function ft(){Oe(Ve),Oe(ie),Oe(De)}function Ot(a){a.memoizedState!==null&&ke(Le,a);var c=Ve.current,f=qh(c,a.type);c!==f&&(ke(ie,a),ke(Ve,f))}function Ft(a){ie.current===a&&(Oe(Ve),Oe(ie)),Le.current===a&&(Oe(Le),bd._currentValue=ue)}var kt,Jt;function ze(a){if(kt===void 0)try{throw Error()}catch(f){var c=f.stack.trim().match(/\n( *(at )?)/);kt=c&&c[1]||"",Jt=-1)":-1j||ye[y]!==Be[j]){var We=` -`+ye[y].replace(" at new "," at ");return a.displayName&&We.includes("")&&(We=We.replace("",a.displayName)),We}while(1<=y&&0<=j);break}}}finally{Lt=!1,Error.prepareStackTrace=f}return(f=a?a.displayName||a.name:"")?Le(f):""}function V(a,c){switch(a.tag){case 26:case 27:case 5:return Le(a.type);case 16:return Le("Lazy");case 13:return a.child!==c&&c!==null?Le("Suspense Fallback"):Le("Suspense");case 19:return Le("SuspenseList");case 0:case 15:return Rt(a.type,!1);case 11:return Rt(a.type.render,!1);case 1:return Rt(a.type,!0);case 31:return Le("Activity");default:return""}}function Nn(a){try{var c="",f=null;do c+=V(a,f),f=a,a=a.return;while(a);return c}catch(y){return` +`);for(E=y=0;yE||ye[y]!==Be[E]){var We=` +`+ye[y].replace(" at new "," at ");return a.displayName&&We.includes("")&&(We=We.replace("",a.displayName)),We}while(1<=y&&0<=E);break}}}finally{zt=!1,Error.prepareStackTrace=f}return(f=a?a.displayName||a.name:"")?ze(f):""}function V(a,c){switch(a.tag){case 26:case 27:case 5:return ze(a.type);case 16:return ze("Lazy");case 13:return a.child!==c&&c!==null?ze("Suspense Fallback"):ze("Suspense");case 19:return ze("SuspenseList");case 0:case 15:return Rt(a.type,!1);case 11:return Rt(a.type.render,!1);case 1:return Rt(a.type,!0);case 31:return ze("Activity");default:return""}}function Nn(a){try{var c="",f=null;do c+=V(a,f),f=a,a=a.return;while(a);return c}catch(y){return` Error generating stack: `+y.message+` -`+y.stack}}var cn=Object.prototype.hasOwnProperty,ve=e.unstable_scheduleCallback,De=e.unstable_cancelCallback,Ge=e.unstable_shouldYield,D=e.unstable_requestPaint,L=e.unstable_now,H=e.unstable_getCurrentPriorityLevel,W=e.unstable_ImmediatePriority,we=e.unstable_UserBlockingPriority,Re=e.unstable_NormalPriority,st=e.unstable_LowPriority,Kt=e.unstable_IdlePriority,Qt=e.log,Fn=e.unstable_setDisableYieldValue,dn=null,Ht=null;function wi(a){if(typeof Qt=="function"&&Fn(a),Ht&&typeof Ht.setStrictMode=="function")try{Ht.setStrictMode(dn,a)}catch{}}var Xr=Math.clz32?Math.clz32:Ma,fa=Math.log,ho=Math.LN2;function Ma(a){return a>>>=0,a===0?32:31-(fa(a)/ho|0)|0}var cc=256,xu=262144,uc=4194304;function ma(a){var c=a&42;if(c!==0)return c;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function zt(a,c,f){var y=a.pendingLanes;if(y===0)return 0;var j=0,O=a.suspendedLanes,B=a.pingedLanes;a=a.warmLanes;var te=y&134217727;return te!==0?(y=te&~O,y!==0?j=ma(y):(B&=te,B!==0?j=ma(B):f||(f=te&~a,f!==0&&(j=ma(f))))):(te=y&~O,te!==0?j=ma(te):B!==0?j=ma(B):f||(f=y&~a,f!==0&&(j=ma(f)))),j===0?0:c!==0&&c!==j&&(c&O)===0&&(O=j&-j,f=c&-c,O>=f||O===32&&(f&4194048)!==0)?c:j}function vr(a,c){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&c)===0}function Yr(a,c){switch(a){case 1:case 2:case 4:case 8:case 64:return c+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Os(){var a=uc;return uc<<=1,(uc&62914560)===0&&(uc=4194304),a}function Dn(a){for(var c=[],f=0;31>f;f++)c.push(a);return c}function Er(a,c){a.pendingLanes|=c,c!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Ys(a,c,f,y,j,O){var B=a.pendingLanes;a.pendingLanes=f,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=f,a.entangledLanes&=f,a.errorRecoveryDisabledLanes&=f,a.shellSuspendCounter=0;var te=a.entanglements,ye=a.expirationTimes,Be=a.hiddenUpdates;for(f=B&~f;0"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var th=/[\n"\\]/g;function Js(a){return a.replace(th,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function zp(a,c,f,y,j,O,B,te){a.name="",B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"?a.type=B:a.removeAttribute("type"),c!=null?B==="number"?(c===0&&a.value===""||a.value!=c)&&(a.value=""+Ws(c)):a.value!==""+Ws(c)&&(a.value=""+Ws(c)):B!=="submit"&&B!=="reset"||a.removeAttribute("value"),c!=null?Lp(a,B,Ws(c)):f!=null?Lp(a,B,Ws(f)):y!=null&&a.removeAttribute("value"),j==null&&O!=null&&(a.defaultChecked=!!O),j!=null&&(a.checked=j&&typeof j!="function"&&typeof j!="symbol"),te!=null&&typeof te!="function"&&typeof te!="symbol"&&typeof te!="boolean"?a.name=""+Ws(te):a.removeAttribute("name")}function Fg(a,c,f,y,j,O,B,te){if(O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(a.type=O),c!=null||f!=null){if(!(O!=="submit"&&O!=="reset"||c!=null)){po(a);return}f=f!=null?""+Ws(f):"",c=c!=null?""+Ws(c):f,te||c===a.value||(a.value=c),a.defaultValue=c}y=y??j,y=typeof y!="function"&&typeof y!="symbol"&&!!y,a.checked=te?a.checked:!!y,a.defaultChecked=!!y,B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"&&(a.name=B),po(a)}function Lp(a,c,f){c==="number"&&hl(a.ownerDocument)===a||a.defaultValue===""+f||(a.defaultValue=""+f)}function Au(a,c,f,y){if(a=a.options,c){c={};for(var j=0;j"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Bp=!1;if(ar)try{var fo={};Object.defineProperty(fo,"passive",{get:function(){Bp=!0}}),window.addEventListener("test",fo,fo),window.removeEventListener("test",fo,fo)}catch{Bp=!1}var Rr=null,sh=null,Tu=null;function Ow(){if(Tu)return Tu;var a,c=sh,f=c.length,y,j="value"in Rr?Rr.value:Rr.textContent,O=j.length;for(a=0;a=ba),Vw=" ",Yg=!1;function Hw(a,c){switch(a){case"keyup":return Kw.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zg(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var yc=!1;function Nu(a,c){switch(a){case"compositionend":return Zg(c);case"keypress":return c.which!==32?null:(Yg=!0,Vw);case"textInput":return a=c.data,a===Vw&&Yg?null:a;default:return null}}function uA(a,c){if(yc)return a==="compositionend"||!Gi&&Hw(a,c)?(a=Ow(),Tu=sh=Rr=null,yc=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1=c)return{node:f,offset:c-a};a=y}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=Jw(f)}}function e0(a,c){return a&&c?a===c?!0:a&&a.nodeType===3?!1:c&&c.nodeType===3?e0(a,c.parentNode):"contains"in a?a.contains(c):a.compareDocumentPosition?!!(a.compareDocumentPosition(c)&16):!1:!1}function t0(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var c=hl(a.document);c instanceof a.HTMLIFrameElement;){try{var f=typeof c.contentWindow.location.href=="string"}catch{f=!1}if(f)a=c.contentWindow;else break;c=hl(a.document)}return c}function Jg(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c&&(c==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||c==="textarea"||a.contentEditable==="true")}var n0=ar&&"documentMode"in document&&11>=document.documentMode,fl=null,zu=null,yo=null,Xp=!1;function Qg(a,c,f){var y=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;Xp||fl==null||fl!==hl(y)||(y=fl,"selectionStart"in y&&Jg(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),yo&&Iu(yo,y)||(yo=y,y=Yf(zu,"onSelect"),0>=B,j-=B,Kn=1<<32-Xr(c)+j|f<rn?(wn=Pt,Pt=null):wn=Pt.sibling;var On=Ue($e,Pt,Pe[rn],nt);if(On===null){Pt===null&&(Pt=wn);break}a&&Pt&&On.alternate===null&&c($e,Pt),Ee=O(On,Ee,rn),pn===null?Ut=On:pn.sibling=On,pn=On,Pt=wn}if(rn===Pe.length)return f($e,Pt),vn&&ii($e,rn),Ut;if(Pt===null){for(;rnrn?(wn=Pt,Pt=null):wn=Pt.sibling;var Bl=Ue($e,Pt,On.value,nt);if(Bl===null){Pt===null&&(Pt=wn);break}a&&Pt&&Bl.alternate===null&&c($e,Pt),Ee=O(Bl,Ee,rn),pn===null?Ut=Bl:pn.sibling=Bl,pn=Bl,Pt=wn}if(On.done)return f($e,Pt),vn&&ii($e,rn),Ut;if(Pt===null){for(;!On.done;rn++,On=Pe.next())On=rt($e,On.value,nt),On!==null&&(Ee=O(On,Ee,rn),pn===null?Ut=On:pn.sibling=On,pn=On);return vn&&ii($e,rn),Ut}for(Pt=y(Pt);!On.done;rn++,On=Pe.next())On=Xe(Pt,$e,rn,On.value,nt),On!==null&&(a&&On.alternate!==null&&Pt.delete(On.key===null?rn:On.key),Ee=O(On,Ee,rn),pn===null?Ut=On:pn.sibling=On,pn=On);return a&&Pt.forEach(function(YS){return c($e,YS)}),vn&&ii($e,rn),Ut}function Qn($e,Ee,Pe,nt){if(typeof Pe=="object"&&Pe!==null&&Pe.type===I&&Pe.key===null&&(Pe=Pe.props.children),typeof Pe=="object"&&Pe!==null){switch(Pe.$$typeof){case T:e:{for(var Ut=Pe.key;Ee!==null;){if(Ee.key===Ut){if(Ut=Pe.type,Ut===I){if(Ee.tag===7){f($e,Ee.sibling),nt=j(Ee,Pe.props.children),nt.return=$e,$e=nt;break e}}else if(Ee.elementType===Ut||typeof Ut=="object"&&Ut!==null&&Ut.$$typeof===ne&&kc(Ut)===Ee.type){f($e,Ee.sibling),nt=j(Ee,Pe.props),ks(nt,Pe),nt.return=$e,$e=nt;break e}f($e,Ee);break}else c($e,Ee);Ee=Ee.sibling}Pe.type===I?(nt=gl(Pe.props.children,$e.mode,nt,Pe.key),nt.return=$e,$e=nt):(nt=Bu(Pe.type,Pe.key,Pe.props,null,$e.mode,nt),ks(nt,Pe),nt.return=$e,$e=nt)}return B($e);case M:e:{for(Ut=Pe.key;Ee!==null;){if(Ee.key===Ut)if(Ee.tag===4&&Ee.stateNode.containerInfo===Pe.containerInfo&&Ee.stateNode.implementation===Pe.implementation){f($e,Ee.sibling),nt=j(Ee,Pe.children||[]),nt.return=$e,$e=nt;break e}else{f($e,Ee);break}else c($e,Ee);Ee=Ee.sibling}nt=uy(Pe,$e.mode,nt),nt.return=$e,$e=nt}return B($e);case ne:return Pe=kc(Pe),Qn($e,Ee,Pe,nt)}if(Ke(Pe))return Dt($e,Ee,Pe,nt);if(le(Pe)){if(Ut=le(Pe),typeof Ut!="function")throw Error(o(150));return Pe=Ut.call(Pe),Xt($e,Ee,Pe,nt)}if(typeof Pe.then=="function")return Qn($e,Ee,Wu(Pe),nt);if(Pe.$$typeof===X)return Qn($e,Ee,Hu($e,Pe),nt);Ju($e,Pe)}return typeof Pe=="string"&&Pe!==""||typeof Pe=="number"||typeof Pe=="bigint"?(Pe=""+Pe,Ee!==null&&Ee.tag===6?(f($e,Ee.sibling),nt=j(Ee,Pe),nt.return=$e,$e=nt):(f($e,Ee),nt=Uu(Pe,$e.mode,nt),nt.return=$e,$e=nt),B($e)):f($e,Ee)}return function($e,Ee,Pe,nt){try{Tc=0;var Ut=Qn($e,Ee,Pe,nt);return Zu=null,Ut}catch(Pt){if(Pt===Oc||Pt===Yu)throw Pt;var pn=ti(29,Pt,null,$e.mode);return pn.lanes=nt,pn.return=$e,pn}finally{}}}var _c=Eo(!0),hh=Eo(!1),li=!1;function df(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function hf(a,c){a=a.updateQueue,c.updateQueue===a&&(c.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function jo(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function jl(a,c,f){var y=a.updateQueue;if(y===null)return null;if(y=y.shared,(Hn&2)!==0){var j=y.pending;return j===null?c.next=c:(c.next=j.next,j.next=c),y.pending=c,c=Jp(a),s0(a,null,f),c}return Wp(a,y,c,f),Jp(a)}function Ji(a,c,f){if(c=c.updateQueue,c!==null&&(c=c.shared,(f&4194048)!==0)){var y=c.lanes;y&=a.pendingLanes,f|=y,c.lanes=f,ys(a,f)}}function Qu(a,c){var f=a.updateQueue,y=a.alternate;if(y!==null&&(y=y.updateQueue,f===y)){var j=null,O=null;if(f=f.firstBaseUpdate,f!==null){do{var B={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};O===null?j=O=B:O=O.next=B,f=f.next}while(f!==null);O===null?j=O=c:O=O.next=c}else j=O=c;f={baseState:y.baseState,firstBaseUpdate:j,lastBaseUpdate:O,shared:y.shared,callbacks:y.callbacks},a.updateQueue=f;return}a=f.lastBaseUpdate,a===null?f.firstBaseUpdate=c:a.next=c,f.lastBaseUpdate=c}var $c=!1;function ph(){if($c){var a=qa;if(a!==null)throw a}}function fh(a,c,f,y){$c=!1;var j=a.updateQueue;li=!1;var O=j.firstBaseUpdate,B=j.lastBaseUpdate,te=j.shared.pending;if(te!==null){j.shared.pending=null;var ye=te,Be=ye.next;ye.next=null,B===null?O=Be:B.next=Be,B=ye;var We=a.alternate;We!==null&&(We=We.updateQueue,te=We.lastBaseUpdate,te!==B&&(te===null?We.firstBaseUpdate=Be:te.next=Be,We.lastBaseUpdate=ye))}if(O!==null){var rt=j.baseState;B=0,We=Be=ye=null,te=O;do{var Ue=te.lane&-536870913,Xe=Ue!==te.lane;if(Xe?(An&Ue)===Ue:(y&Ue)===Ue){Ue!==0&&Ue===Sl&&($c=!0),We!==null&&(We=We.next={lane:0,tag:te.tag,payload:te.payload,callback:null,next:null});e:{var Dt=a,Xt=te;Ue=c;var Qn=f;switch(Xt.tag){case 1:if(Dt=Xt.payload,typeof Dt=="function"){rt=Dt.call(Qn,rt,Ue);break e}rt=Dt;break e;case 3:Dt.flags=Dt.flags&-65537|128;case 0:if(Dt=Xt.payload,Ue=typeof Dt=="function"?Dt.call(Qn,rt,Ue):Dt,Ue==null)break e;rt=A({},rt,Ue);break e;case 2:li=!0}}Ue=te.callback,Ue!==null&&(a.flags|=64,Xe&&(a.flags|=8192),Xe=j.callbacks,Xe===null?j.callbacks=[Ue]:Xe.push(Ue))}else Xe={lane:Ue,tag:te.tag,payload:te.payload,callback:te.callback,next:null},We===null?(Be=We=Xe,ye=rt):We=We.next=Xe,B|=Ue;if(te=te.next,te===null){if(te=j.shared.pending,te===null)break;Xe=te,te=Xe.next,Xe.next=null,j.lastBaseUpdate=Xe,j.shared.pending=null}}while(!0);We===null&&(ye=rt),j.baseState=ye,j.firstBaseUpdate=Be,j.lastBaseUpdate=We,O===null&&(j.shared.lanes=0),Ga|=B,a.lanes=B,a.memoizedState=rt}}function pf(a,c){if(typeof a!="function")throw Error(o(191,a));a.call(c)}function u0(a,c){var f=a.callbacks;if(f!==null)for(a.callbacks=null,a=0;aO?O:8;var B=ce.T,te={};ce.T=te,Xy(a,!1,c,f);try{var ye=j(),Be=ce.S;if(Be!==null&&Be(te,ye),ye!==null&&typeof ye=="object"&&typeof ye.then=="function"){var We=sf(ye,y);wh(a,c,We,ki(a))}else wh(a,c,y,ki(a))}catch(rt){wh(a,c,{then:function(){},status:"rejected",reason:rt},ki())}finally{re.p=O,B!==null&&te.types!==null&&(B.types=te.types),ce.T=B}}function vA(){}function Ky(a,c,f,y){if(a.tag!==5)throw Error(o(476));var j=Vy(a).queue;j0(a,j,c,ue,f===null?vA:function(){return Hy(a),f(y)})}function Vy(a){var c=a.memoizedState;if(c!==null)return c;c={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ta,lastRenderedState:ue},next:null};var f={};return c.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ta,lastRenderedState:f},next:null},a.memoizedState=c,a=a.alternate,a!==null&&(a.memoizedState=c),c}function Hy(a){var c=Vy(a);c.next===null&&(c=a.alternate.memoizedState),wh(a,c.next.queue,{},ki())}function bh(){return Wr(bd)}function C0(){return Mr().memoizedState}function Gy(){return Mr().memoizedState}function xA(a){for(var c=a.return;c!==null;){switch(c.tag){case 24:case 3:var f=ki();a=jo(f);var y=jl(c,a,f);y!==null&&(_s(y,c,f),Ji(y,c,f)),c={cache:rf()},a.payload=c;return}c=c.return}}function A0(a,c,f){var y=ki();f={lane:y,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},xf(a)?k0(c,f):(f=ly(a,c,f,y),f!==null&&(_s(f,a,y),R0(f,c,y)))}function O0(a,c,f){var y=ki();wh(a,c,f,y)}function wh(a,c,f,y){var j={lane:y,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if(xf(a))k0(c,j);else{var O=a.alternate;if(a.lanes===0&&(O===null||O.lanes===0)&&(O=c.lastRenderedReducer,O!==null))try{var B=c.lastRenderedState,te=O(B,f);if(j.hasEagerState=!0,j.eagerState=te,ei(te,B))return Wp(a,c,j,0),lr===null&&Zp(),!1}catch{}finally{}if(f=ly(a,c,j,y),f!==null)return _s(f,a,y),R0(f,c,y),!0}return!1}function Xy(a,c,f,y){if(y={lane:2,revertLane:$v(),gesture:null,action:y,hasEagerState:!1,eagerState:null,next:null},xf(a)){if(c)throw Error(o(479))}else c=ly(a,f,y,2),c!==null&&_s(c,a,2)}function xf(a){var c=a.alternate;return a===en||c!==null&&c===en}function k0(a,c){Nc=mh=!0;var f=a.pending;f===null?c.next=c:(c.next=f.next,f.next=c),a.pending=c}function R0(a,c,f){if((f&4194048)!==0){var y=c.lanes;y&=a.pendingLanes,f|=y,c.lanes=f,ys(a,f)}}var Sh={readContext:Wr,use:mf,useCallback:Cr,useContext:Cr,useEffect:Cr,useImperativeHandle:Cr,useLayoutEffect:Cr,useInsertionEffect:Cr,useMemo:Cr,useReducer:Cr,useRef:Cr,useState:Cr,useDebugValue:Cr,useDeferredValue:Cr,useTransition:Cr,useSyncExternalStore:Cr,useId:Cr,useHostTransitionStatus:Cr,useFormState:Cr,useActionState:Cr,useOptimistic:Cr,useMemoCache:Cr,useCacheRefresh:Cr};Sh.useEffectEvent=Cr;var T0={readContext:Wr,use:mf,useCallback:function(a,c){return Rs().memoizedState=[a,c===void 0?null:c],a},useContext:Wr,useEffect:zy,useImperativeHandle:function(a,c,f){f=f!=null?f.concat([a]):null,xh(4194308,4,S0.bind(null,c,a),f)},useLayoutEffect:function(a,c){return xh(4194308,4,a,c)},useInsertionEffect:function(a,c){xh(4,2,a,c)},useMemo:function(a,c){var f=Rs();c=c===void 0?null:c;var y=a();if(Co){wi(!0);try{a()}finally{wi(!1)}}return f.memoizedState=[y,c],y},useReducer:function(a,c,f){var y=Rs();if(f!==void 0){var j=f(c);if(Co){wi(!0);try{f(c)}finally{wi(!1)}}}else j=c;return y.memoizedState=y.baseState=j,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:j},y.queue=a,a=a.dispatch=A0.bind(null,en,a),[y.memoizedState,a]},useRef:function(a){var c=Rs();return a={current:a},c.memoizedState=a},useState:function(a){a=$y(a);var c=a.queue,f=O0.bind(null,en,c);return c.dispatch=f,[a.memoizedState,f]},useDebugValue:Fy,useDeferredValue:function(a,c){var f=Rs();return Uy(f,a,c)},useTransition:function(){var a=$y(!1);return a=j0.bind(null,en,a.queue,!0,!1),Rs().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,c,f){var y=en,j=Rs();if(vn){if(f===void 0)throw Error(o(407));f=f()}else{if(f=c(),lr===null)throw Error(o(349));(An&127)!==0||ky(y,c,f)}j.memoizedState=f;var O={value:f,getSnapshot:c};return j.queue=O,zy(p0.bind(null,y,O,a),[a]),y.flags|=2048,id(9,{destroy:void 0},Ry.bind(null,y,O,f,c),null),f},useId:function(){var a=Rs(),c=lr.identifierPrefix;if(vn){var f=za,y=Kn;f=(y&~(1<<32-Xr(y)-1)).toString(32)+f,c="_"+c+"R_"+f,f=gh++,0<\/script>",O=O.removeChild(O.firstChild);break;case"select":O=typeof y.is=="string"?B.createElement("select",{is:y.is}):B.createElement("select"),y.multiple?O.multiple=!0:y.size&&(O.size=y.size);break;default:O=typeof y.is=="string"?B.createElement(j,{is:y.is}):B.createElement(j)}}O[is]=c,O[Ps]=y;e:for(B=c.child;B!==null;){if(B.tag===5||B.tag===6)O.appendChild(B.stateNode);else if(B.tag!==4&&B.tag!==27&&B.child!==null){B.child.return=B,B=B.child;continue}if(B===c)break e;for(;B.sibling===null;){if(B.return===null||B.return===c)break e;B=B.return}B.sibling.return=B.return,B=B.sibling}c.stateNode=O;e:switch(xs(O,j,y),j){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}y&&ko(c)}}return or(c),lv(c,c.type,a===null?null:a.memoizedProps,c.pendingProps,f),null;case 6:if(a&&c.stateNode!=null)a.memoizedProps!==y&&ko(c);else{if(typeof y!="string"&&c.stateNode===null)throw Error(o(166));if(a=Ne.current,Vu(c)){if(a=c.stateNode,f=c.memoizedProps,y=null,j=Fr,j!==null)switch(j.tag){case 27:case 5:y=j.memoizedProps}a[is]=c,a=!!(a.nodeValue===f||y!==null&&y.suppressHydrationWarning===!0||Lh(a.nodeValue,f)),a||xl(c,!0)}else a=qc(a).createTextNode(y),a[is]=c,c.stateNode=a}return or(c),null;case 31:if(f=c.memoizedState,a===null||a.memoizedState!==null){if(y=Vu(c),f!==null){if(a===null){if(!y)throw Error(o(318));if(a=c.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(o(557));a[is]=c}else La(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;or(c),a=!1}else f=hy(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=f),a=!0;if(!a)return c.flags&256?(Is(c),c):(Is(c),null);if((c.flags&128)!==0)throw Error(o(558))}return or(c),null;case 13:if(y=c.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(j=Vu(c),y!==null&&y.dehydrated!==null){if(a===null){if(!j)throw Error(o(318));if(j=c.memoizedState,j=j!==null?j.dehydrated:null,!j)throw Error(o(317));j[is]=c}else La(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;or(c),j=!1}else j=hy(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=j),j=!0;if(!j)return c.flags&256?(Is(c),c):(Is(c),null)}return Is(c),(c.flags&128)!==0?(c.lanes=f,c):(f=y!==null,a=a!==null&&a.memoizedState!==null,f&&(y=c.child,j=null,y.alternate!==null&&y.alternate.memoizedState!==null&&y.alternate.memoizedState.cachePool!==null&&(j=y.alternate.memoizedState.cachePool.pool),O=null,y.memoizedState!==null&&y.memoizedState.cachePool!==null&&(O=y.memoizedState.cachePool.pool),O!==j&&(y.flags|=2048)),f!==a&&f&&(c.child.flags|=8192),Of(c,c.updateQueue),or(c),null);case 4:return ft(),a===null&&Xf(c.stateNode.containerInfo),or(c),null;case 10:return oi(c.type),or(c),null;case 19:if(Oe(jr),y=c.memoizedState,y===null)return or(c),null;if(j=(c.flags&128)!==0,O=y.rendering,O===null)if(j)ld(y,!1);else{if(Ar!==0||a!==null&&(a.flags&128)!==0)for(a=c.child;a!==null;){if(O=ff(a),O!==null){for(c.flags|=128,ld(y,!1),a=O.updateQueue,c.updateQueue=a,Of(c,a),c.subtreeFlags=0,a=f,f=c.child;f!==null;)cy(f,a),f=f.sibling;return ke(jr,jr.current&1|2),vn&&ii(c,y.treeForkCount),c.child}a=a.sibling}y.tail!==null&&L()>Df&&(c.flags|=128,j=!0,ld(y,!1),c.lanes=4194304)}else{if(!j)if(a=ff(O),a!==null){if(c.flags|=128,j=!0,a=a.updateQueue,c.updateQueue=a,Of(c,a),ld(y,!0),y.tail===null&&y.tailMode==="hidden"&&!O.alternate&&!vn)return or(c),null}else 2*L()-y.renderingStartTime>Df&&f!==536870912&&(c.flags|=128,j=!0,ld(y,!1),c.lanes=4194304);y.isBackwards?(O.sibling=c.child,c.child=O):(a=y.last,a!==null?a.sibling=O:c.child=O,y.last=O)}return y.tail!==null?(a=y.tail,y.rendering=a,y.tail=a.sibling,y.renderingStartTime=L(),a.sibling=null,f=jr.current,ke(jr,j?f&1|2:f&1),vn&&ii(c,y.treeForkCount),a):(or(c),null);case 22:case 23:return Is(c),nd(),y=c.memoizedState!==null,a!==null?a.memoizedState!==null!==y&&(c.flags|=8192):y&&(c.flags|=8192),y?(f&536870912)!==0&&(c.flags&128)===0&&(or(c),c.subtreeFlags&6&&(c.flags|=8192)):or(c),f=c.updateQueue,f!==null&&Of(c,f.retryQueue),f=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),y=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(y=c.memoizedState.cachePool.pool),y!==f&&(c.flags|=2048),a!==null&&Oe(El),null;case 24:return f=null,a!==null&&(f=a.memoizedState.cache),c.memoizedState.cache!==f&&(c.flags|=2048),oi(Dr),or(c),null;case 25:return null;case 30:return null}throw Error(o(156,c.tag))}function cv(a,c){switch(bo(c),c.tag){case 1:return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 3:return oi(Dr),ft(),a=c.flags,(a&65536)!==0&&(a&128)===0?(c.flags=a&-65537|128,c):null;case 26:case 27:case 5:return Ft(c),null;case 31:if(c.memoizedState!==null){if(Is(c),c.alternate===null)throw Error(o(340));La()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 13:if(Is(c),a=c.memoizedState,a!==null&&a.dehydrated!==null){if(c.alternate===null)throw Error(o(340));La()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 19:return Oe(jr),null;case 4:return ft(),null;case 10:return oi(c.type),null;case 22:case 23:return Is(c),nd(),a!==null&&Oe(El),a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 24:return oi(Dr),null;case 25:return null;default:return null}}function V0(a,c){switch(bo(c),c.tag){case 3:oi(Dr),ft();break;case 26:case 27:case 5:Ft(c);break;case 4:ft();break;case 31:c.memoizedState!==null&&Is(c);break;case 13:Is(c);break;case 19:Oe(jr);break;case 10:oi(c.type);break;case 22:case 23:Is(c),nd(),a!==null&&Oe(El);break;case 24:oi(Dr)}}function jh(a,c){try{var f=c.updateQueue,y=f!==null?f.lastEffect:null;if(y!==null){var j=y.next;f=j;do{if((f.tag&a)===a){y=void 0;var O=f.create,B=f.inst;y=O(),B.destroy=y}f=f.next}while(f!==j)}}catch(te){Xn(c,c.return,te)}}function Tl(a,c,f){try{var y=c.updateQueue,j=y!==null?y.lastEffect:null;if(j!==null){var O=j.next;y=O;do{if((y.tag&a)===a){var B=y.inst,te=B.destroy;if(te!==void 0){B.destroy=void 0,j=c;var ye=f,Be=te;try{Be()}catch(We){Xn(j,ye,We)}}}y=y.next}while(y!==O)}}catch(We){Xn(c,c.return,We)}}function H0(a){var c=a.updateQueue;if(c!==null){var f=a.stateNode;try{u0(c,f)}catch(y){Xn(a,a.return,y)}}}function G0(a,c,f){f.props=Mc(a.type,a.memoizedProps),f.state=a.memoizedState;try{f.componentWillUnmount()}catch(y){Xn(a,c,y)}}function Ch(a,c){try{var f=a.ref;if(f!==null){switch(a.tag){case 26:case 27:case 5:var y=a.stateNode;break;case 30:y=a.stateNode;break;default:y=a.stateNode}typeof f=="function"?a.refCleanup=f(y):f.current=y}}catch(j){Xn(a,c,j)}}function Ha(a,c){var f=a.ref,y=a.refCleanup;if(f!==null)if(typeof y=="function")try{y()}catch(j){Xn(a,c,j)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(j){Xn(a,c,j)}else f.current=null}function X0(a){var c=a.type,f=a.memoizedProps,y=a.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":f.autoFocus&&y.focus();break e;case"img":f.src?y.src=f.src:f.srcSet&&(y.srcset=f.srcSet)}}catch(j){Xn(a,a.return,j)}}function Ah(a,c,f){try{var y=a.stateNode;NA(y,a.type,f,c),y[Ps]=c}catch(j){Xn(a,a.return,j)}}function uv(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Il(a.type)||a.tag===4}function dv(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||uv(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&Il(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function hv(a,c,f){var y=a.tag;if(y===5||y===6)a=a.stateNode,c?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(a,c):(c=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,c.appendChild(a),f=f._reactRootContainer,f!=null||c.onclick!==null||(c.onclick=xa));else if(y!==4&&(y===27&&Il(a.type)&&(f=a.stateNode,c=null),a=a.child,a!==null))for(hv(a,c,f),a=a.sibling;a!==null;)hv(a,c,f),a=a.sibling}function kf(a,c,f){var y=a.tag;if(y===5||y===6)a=a.stateNode,c?f.insertBefore(a,c):f.appendChild(a);else if(y!==4&&(y===27&&Il(a.type)&&(f=a.stateNode),a=a.child,a!==null))for(kf(a,c,f),a=a.sibling;a!==null;)kf(a,c,f),a=a.sibling}function Rf(a){var c=a.stateNode,f=a.memoizedProps;try{for(var y=a.type,j=c.attributes;j.length;)c.removeAttributeNode(j[0]);xs(c,y,f),c[is]=a,c[Ps]=f}catch(O){Xn(a,a.return,O)}}var Ro=!1,Br=!1,pv=!1,Y0=typeof WeakSet=="function"?WeakSet:Set,cs=null;function Z0(a,c){if(a=a.containerInfo,Zf=lm,a=t0(a),Jg(a)){if("selectionStart"in a)var f={start:a.selectionStart,end:a.selectionEnd};else e:{f=(f=a.ownerDocument)&&f.defaultView||window;var y=f.getSelection&&f.getSelection();if(y&&y.rangeCount!==0){f=y.anchorNode;var j=y.anchorOffset,O=y.focusNode;y=y.focusOffset;try{f.nodeType,O.nodeType}catch{f=null;break e}var B=0,te=-1,ye=-1,Be=0,We=0,rt=a,Ue=null;t:for(;;){for(var Xe;rt!==f||j!==0&&rt.nodeType!==3||(te=B+j),rt!==O||y!==0&&rt.nodeType!==3||(ye=B+y),rt.nodeType===3&&(B+=rt.nodeValue.length),(Xe=rt.firstChild)!==null;)Ue=rt,rt=Xe;for(;;){if(rt===a)break t;if(Ue===f&&++Be===j&&(te=B),Ue===O&&++We===y&&(ye=B),(Xe=rt.nextSibling)!==null)break;rt=Ue,Ue=rt.parentNode}rt=Xe}f=te===-1||ye===-1?null:{start:te,end:ye}}else f=null}f=f||{start:0,end:0}}else f=null;for(Wf={focusedElem:a,selectionRange:f},lm=!1,cs=c;cs!==null;)if(c=cs,a=c.child,(c.subtreeFlags&1028)!==0&&a!==null)a.return=c,cs=a;else for(;cs!==null;){switch(c=cs,O=c.alternate,a=c.flags,c.tag){case 0:if((a&4)!==0&&(a=c.updateQueue,a=a!==null?a.events:null,a!==null))for(f=0;f title"))),xs(O,y,f),O[is]=a,Zr(O),y=O;break e;case"link":var B=LS("link","href",j).get(y+(f.href||""));if(B){for(var te=0;teQn&&(B=Qn,Qn=Xt,Xt=B);var $e=Qw(te,Xt),Ee=Qw(te,Qn);if($e&&Ee&&(Xe.rangeCount!==1||Xe.anchorNode!==$e.node||Xe.anchorOffset!==$e.offset||Xe.focusNode!==Ee.node||Xe.focusOffset!==Ee.offset)){var Pe=rt.createRange();Pe.setStart($e.node,$e.offset),Xe.removeAllRanges(),Xt>Qn?(Xe.addRange(Pe),Xe.extend(Ee.node,Ee.offset)):(Pe.setEnd(Ee.node,Ee.offset),Xe.addRange(Pe))}}}}for(rt=[],Xe=te;Xe=Xe.parentNode;)Xe.nodeType===1&&rt.push({element:Xe,left:Xe.scrollLeft,top:Xe.scrollTop});for(typeof te.focus=="function"&&te.focus(),te=0;tef?32:f,ce.T=null,f=Mf,Mf=null;var O=Dl,B=Do;if(Jr=0,dd=Dl=null,Do=0,(Hn&6)!==0)throw Error(o(331));var te=Hn;if(Hn|=4,rS(O.current),yv(O,O.current,B,f),Hn=te,pd(0,!1),Ht&&typeof Ht.onPostCommitFiberRoot=="function")try{Ht.onPostCommitFiberRoot(dn,O)}catch{}return!0}finally{re.p=j,ce.T=y,yS(a,c)}}function vS(a,c,f){c=ri(f,c),c=Wy(a.stateNode,c,2),a=jl(a,c,2),a!==null&&(Er(a,2),Xa(a))}function Xn(a,c,f){if(a.tag===3)vS(a,a,f);else for(;c!==null;){if(c.tag===3){vS(c,a,f);break}else if(c.tag===1){var y=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(Nl===null||!Nl.has(y))){a=ri(f,a),f=Jy(2),y=jl(c,f,2),y!==null&&(Cl(f,y,c,a),Er(y,2),Xa(y));break}}c=c.return}}function Av(a,c,f){var y=a.pingCache;if(y===null){y=a.pingCache=new jA;var j=new Set;y.set(c,j)}else j=y.get(c),j===void 0&&(j=new Set,y.set(c,j));j.has(f)||(xv=!0,j.add(f),a=Uf.bind(null,a,c,f),c.then(a,a))}function Uf(a,c,f){var y=a.pingCache;y!==null&&y.delete(c),a.pingedLanes|=a.suspendedLanes&f,a.warmLanes&=~f,lr===a&&(An&f)===f&&(Ar===4||Ar===3&&(An&62914560)===An&&300>L()-$h?(Hn&2)===0&&Ml(a,0):$f|=f,$l===An&&($l=0)),Xa(a)}function Ov(a,c){c===0&&(c=Os()),a=bc(a,c),a!==null&&(Er(a,c),Xa(a))}function kA(a){var c=a.memoizedState,f=0;c!==null&&(f=c.retryLane),Ov(a,f)}function RA(a,c){var f=0;switch(a.tag){case 31:case 13:var y=a.stateNode,j=a.memoizedState;j!==null&&(f=j.retryLane);break;case 19:y=a.stateNode;break;case 22:y=a.stateNode._retryCache;break;default:throw Error(o(314))}y!==null&&y.delete(c),Ov(a,f)}function kv(a,c){return ve(a,c)}var Kf=null,Fc=null,Rv=!1,Vf=!1,Tv=!1,Aa=0;function Xa(a){a!==Fc&&a.next===null&&(Fc===null?Kf=Fc=a:Fc=Fc.next=a),Vf=!0,Rv||(Rv=!0,TA())}function pd(a,c){if(!Tv&&Vf){Tv=!0;do for(var f=!1,y=Kf;y!==null;){if(a!==0){var j=y.pendingLanes;if(j===0)var O=0;else{var B=y.suspendedLanes,te=y.pingedLanes;O=(1<<31-Xr(42|a)+1)-1,O&=j&~(B&~te),O=O&201326741?O&201326741|1:O?O|2:0}O!==0&&(f=!0,wS(y,O))}else O=An,O=zt(y,y===lr?O:0,y.cancelPendingCommit!==null||y.timeoutHandle!==-1),(O&3)===0||vr(y,O)||(f=!0,wS(y,O));y=y.next}while(f);Tv=!1}}function _v(){Hf()}function Hf(){Vf=Rv=!1;var a=0;Aa!==0&&PA()&&(a=Aa);for(var c=L(),f=null,y=Kf;y!==null;){var j=y.next,O=xS(y,c);O===0?(y.next=null,f===null?Kf=j:f.next=j,j===null&&(Fc=f)):(f=y,(a!==0||(O&3)!==0)&&(Vf=!0)),y=j}Jr!==0&&Jr!==5||pd(a),Aa!==0&&(Aa=0)}function xS(a,c){for(var f=a.suspendedLanes,y=a.pingedLanes,j=a.expirationTimes,O=a.pendingLanes&-62914561;0te)break;var We=ye.transferSize,rt=ye.initiatorType;We&&Iv(rt)&&(ye=ye.responseEnd,B+=We*(ye"u"?null:document;function $S(a,c,f){var y=Bc;if(y&&typeof c=="string"&&c){var j=Js(c);j='link[rel="'+a+'"][href="'+j+'"]',typeof f=="string"&&(j+='[crossorigin="'+f+'"]'),Hv.has(j)||(Hv.add(j),a={rel:a,crossOrigin:f,href:c},y.querySelector(j)===null&&(c=y.createElement("link"),xs(c,"link",a),Zr(c),y.head.appendChild(c)))}}function Gv(a){Po.D(a),$S("dns-prefetch",a,null)}function NS(a,c){Po.C(a,c),$S("preconnect",a,c)}function LA(a,c,f){Po.L(a,c,f);var y=Bc;if(y&&a&&c){var j='link[rel="preload"][as="'+Js(c)+'"]';c==="image"&&f&&f.imageSrcSet?(j+='[imagesrcset="'+Js(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(j+='[imagesizes="'+Js(f.imageSizes)+'"]')):j+='[href="'+Js(a)+'"]';var O=j;switch(c){case"style":O=vd(a);break;case"script":O=Ll(a)}na.has(O)||(a=A({rel:"preload",href:c==="image"&&f&&f.imageSrcSet?void 0:a,as:c},f),na.set(O,a),y.querySelector(j)!==null||c==="style"&&y.querySelector(Uh(O))||c==="script"&&y.querySelector(Kh(O))||(c=y.createElement("link"),xs(c,"link",a),Zr(c),y.head.appendChild(c)))}}function DS(a,c){Po.m(a,c);var f=Bc;if(f&&a){var y=c&&typeof c.as=="string"?c.as:"script",j='link[rel="modulepreload"][as="'+Js(y)+'"][href="'+Js(a)+'"]',O=j;switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":O=Ll(a)}if(!na.has(O)&&(a=A({rel:"modulepreload",href:a},c),na.set(O,a),f.querySelector(j)===null)){switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(Kh(O)))return}y=f.createElement("link"),xs(y,"link",a),Zr(y),f.head.appendChild(y)}}}function FA(a,c,f){Po.S(a,c,f);var y=Bc;if(y&&a){var j=ul(y).hoistableStyles,O=vd(a);c=c||"default";var B=j.get(O);if(!B){var te={loading:0,preload:null};if(B=y.querySelector(Uh(O)))te.loading=5;else{a=A({rel:"stylesheet",href:a,"data-precedence":c},f),(f=na.get(O))&&Xv(a,f);var ye=B=y.createElement("link");Zr(ye),xs(ye,"link",a),ye._p=new Promise(function(Be,We){ye.onload=Be,ye.onerror=We}),ye.addEventListener("load",function(){te.loading|=1}),ye.addEventListener("error",function(){te.loading|=2}),te.loading|=4,rm(B,c,y)}B={type:"stylesheet",instance:B,count:1,state:te},j.set(O,B)}}}function qA(a,c){Po.X(a,c);var f=Bc;if(f&&a){var y=ul(f).hoistableScripts,j=Ll(a),O=y.get(j);O||(O=f.querySelector(Kh(j)),O||(a=A({src:a,async:!0},c),(c=na.get(j))&&Yv(a,c),O=f.createElement("script"),Zr(O),xs(O,"link",a),f.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},y.set(j,O))}}function BA(a,c){Po.M(a,c);var f=Bc;if(f&&a){var y=ul(f).hoistableScripts,j=Ll(a),O=y.get(j);O||(O=f.querySelector(Kh(j)),O||(a=A({src:a,async:!0,type:"module"},c),(c=na.get(j))&&Yv(a,c),O=f.createElement("script"),Zr(O),xs(O,"link",a),f.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},y.set(j,O))}}function PS(a,c,f,y){var j=(j=Ne.current)?nm(j):null;if(!j)throw Error(o(446));switch(a){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(c=vd(f.href),f=ul(j).hoistableStyles,y=f.get(c),y||(y={type:"style",instance:null,count:0,state:null},f.set(c,y)),y):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){a=vd(f.href);var O=ul(j).hoistableStyles,B=O.get(a);if(B||(j=j.ownerDocument||j,B={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},O.set(a,B),(O=j.querySelector(Uh(a)))&&!O._p&&(B.instance=O,B.state.loading=5),na.has(a)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},na.set(a,f),O||IS(j,a,f,B.state))),c&&y===null)throw Error(o(528,""));return B}if(c&&y!==null)throw Error(o(529,""));return null;case"script":return c=f.async,f=f.src,typeof f=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=Ll(f),f=ul(j).hoistableScripts,y=f.get(c),y||(y={type:"script",instance:null,count:0,state:null},f.set(c,y)),y):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,a))}}function vd(a){return'href="'+Js(a)+'"'}function Uh(a){return'link[rel="stylesheet"]['+a+"]"}function MS(a){return A({},a,{"data-precedence":a.precedence,precedence:null})}function IS(a,c,f,y){a.querySelector('link[rel="preload"][as="style"]['+c+"]")?y.loading=1:(c=a.createElement("link"),y.preload=c,c.addEventListener("load",function(){return y.loading|=1}),c.addEventListener("error",function(){return y.loading|=2}),xs(c,"link",f),Zr(c),a.head.appendChild(c))}function Ll(a){return'[src="'+Js(a)+'"]'}function Kh(a){return"script[async]"+a}function zS(a,c,f){if(c.count++,c.instance===null)switch(c.type){case"style":var y=a.querySelector('style[data-href~="'+Js(f.href)+'"]');if(y)return c.instance=y,Zr(y),y;var j=A({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return y=(a.ownerDocument||a).createElement("style"),Zr(y),xs(y,"style",j),rm(y,f.precedence,a),c.instance=y;case"stylesheet":j=vd(f.href);var O=a.querySelector(Uh(j));if(O)return c.state.loading|=4,c.instance=O,Zr(O),O;y=MS(f),(j=na.get(j))&&Xv(y,j),O=(a.ownerDocument||a).createElement("link"),Zr(O);var B=O;return B._p=new Promise(function(te,ye){B.onload=te,B.onerror=ye}),xs(O,"link",y),c.state.loading|=4,rm(O,f.precedence,a),c.instance=O;case"script":return O=Ll(f.src),(j=a.querySelector(Kh(O)))?(c.instance=j,Zr(j),j):(y=f,(j=na.get(O))&&(y=A({},f),Yv(y,j)),a=a.ownerDocument||a,j=a.createElement("script"),Zr(j),xs(j,"link",y),a.head.appendChild(j),c.instance=j);case"void":return null;default:throw Error(o(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(y=c.instance,c.state.loading|=4,rm(y,f.precedence,a));return c.instance}function rm(a,c,f){for(var y=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),j=y.length?y[y.length-1]:null,O=j,B=0;B title"):null)}function UA(a,c,f){if(f===1||c.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;switch(c.rel){case"stylesheet":return a=c.disabled,typeof c.precedence=="string"&&a==null;default:return!0}case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function qS(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function BS(a,c,f,y){if(f.type==="stylesheet"&&(typeof y.media!="string"||matchMedia(y.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var j=vd(y.href),O=c.querySelector(Uh(j));if(O){c=O._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(a.count++,a=Uc.bind(a),c.then(a,a)),f.state.loading|=4,f.instance=O,Zr(O);return}O=c.ownerDocument||c,y=MS(y),(j=na.get(j))&&Xv(y,j),O=O.createElement("link"),Zr(O);var B=O;B._p=new Promise(function(te,ye){B.onload=te,B.onerror=ye}),xs(O,"link",y),f.instance=O}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(f,c),(c=f.state.preload)&&(f.state.loading&3)===0&&(a.count++,f=Uc.bind(a),c.addEventListener("load",f),c.addEventListener("error",f))}}var im=0;function KA(a,c){return a.stylesheets&&a.count===0&&am(a,a.stylesheets),0im?50:800)+c);return a.unsuspend=f,function(){a.unsuspend=null,clearTimeout(y),clearTimeout(j)}}:null}function Uc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)am(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var xd=null;function am(a,c){a.stylesheets=null,a.unsuspend!==null&&(a.count++,xd=new Map,c.forEach(US,a),xd=null,Uc.call(a))}function US(a,c){if(!(c.state.loading&4)){var f=xd.get(a);if(f)var y=f.get(null);else{f=new Map,xd.set(a,f);for(var j=a.querySelectorAll("link[data-precedence],style[data-precedence]"),O=0;O"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}return e(),TR.exports=dJ(),TR.exports}var pJ=hJ();const _j="autoglue.tokens",TT="autoglue.auth-change";let Jl=_T();function _T(){try{const e=localStorage.getItem(_j);return e?JSON.parse(e):null}catch{return null}}function fJ(e){e?localStorage.setItem(_j,JSON.stringify(e)):localStorage.removeItem(_j)}function mJ(e){window.dispatchEvent(new CustomEvent(TT,{detail:e}))}const Ks={get(){return Jl},set(e){Jl=e,fJ(e),mJ(e)},reload(){return Jl=_T(),Jl},isAuthed(){return!!Jl?.access_token},getAccessToken(){return Jl?.access_token??null},isExpired(e=Math.floor(Date.now()/1e3)){const r=PM(Jl?.access_token);return r!==null?e>=r:!0},willExpireSoon(e=60,r=Math.floor(Date.now()/1e3)){const s=PM(Jl?.access_token);return s!==null?s-r<=e:!0},logout(){Ks.set(null)},subscribe(e){const r=o=>e(o.detail??null),s=o=>{o.key===_j&&(Jl=_T(),e(Jl))};return window.addEventListener(TT,r),window.addEventListener("storage",s),()=>{window.removeEventListener(TT,r),window.removeEventListener("storage",s)}}};function PM(e){if(!e)return null;const r=e.split(".");if(r.length<2)return null;try{const s=JSON.parse(atob(gJ(r[1])));return(typeof s?.exp=="number"?s.exp:null)??null}catch{return null}}function gJ(e){return e.replace(/-/g,"+").replace(/_/g,"/")+"==".slice((2-e.length*3%4)%4)}const $T="autoglue.org";let UE=localStorage.getItem($T);const Qo={get(){return UE},set(e){UE=e,localStorage.setItem($T,e),window.dispatchEvent(new CustomEvent("autoglue:org-change",{detail:e}))},subscribe(e){const r=o=>e(o.detail??null),s=o=>{o.key===$T&&(UE=o.newValue,e(UE))};return window.addEventListener("autoglue:org-change",r),window.addEventListener("storage",s),()=>{window.removeEventListener("autoglue:org-change",r),window.removeEventListener("storage",s)}}},yJ="https://autoglue.onglueops.rocks/api/v1".replace(/\/+$/,"");class cz{constructor(r={}){this.configuration=r}set config(r){this.configuration=r}get basePath(){return this.configuration.basePath!=null?this.configuration.basePath:yJ}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||uz}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){const r=this.configuration.apiKey;if(r)return typeof r=="function"?r:()=>r}get accessToken(){const r=this.configuration.accessToken;if(r)return typeof r=="function"?r:async()=>r}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}}const vJ=new cz;class Gs{constructor(r=vJ){this.configuration=r,this.middleware=r.middleware}static jsonRegex=new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$","i");middleware;withMiddleware(...r){const s=this.clone();return s.middleware=s.middleware.concat(...r),s}withPreMiddleware(...r){const s=r.map(o=>({pre:o}));return this.withMiddleware(...s)}withPostMiddleware(...r){const s=r.map(o=>({post:o}));return this.withMiddleware(...s)}isJsonMime(r){return r?Gs.jsonRegex.test(r):!1}async request(r,s){const{url:o,init:d}=await this.createFetchParams(r,s),p=await this.fetchApi(o,d);if(p&&p.status>=200&&p.status<300)return p;throw new wJ(p,"Response returned an error code")}async createFetchParams(r,s){let o=this.configuration.basePath+r.path;r.query!==void 0&&Object.keys(r.query).length!==0&&(o+="?"+this.configuration.queryParamsStringify(r.query));const d=Object.assign({},this.configuration.headers,r.headers);Object.keys(d).forEach(E=>d[E]===void 0?delete d[E]:{});const p=typeof s=="function"?s:async()=>s,m={method:r.method,headers:d,body:r.body,credentials:this.configuration.credentials},g={...m,...await p({init:m,context:r})};let b;bJ(g.body)||g.body instanceof URLSearchParams||xJ(g.body)?b=g.body:this.isJsonMime(d["Content-Type"])?b=JSON.stringify(g.body):b=g.body;const S={...g,body:b};return{url:o,init:S}}fetchApi=async(r,s)=>{let o={url:r,init:s};for(const p of this.middleware)p.pre&&(o=await p.pre({fetch:this.fetchApi,...o})||o);let d;try{d=await(this.configuration.fetchApi||fetch)(o.url,o.init)}catch(p){for(const m of this.middleware)m.onError&&(d=await m.onError({fetch:this.fetchApi,url:o.url,init:o.init,error:p,response:d?d.clone():void 0})||d);if(d===void 0)throw p instanceof Error?new SJ(p,"The request failed and the interceptors did not return an alternative response"):p}for(const p of this.middleware)p.post&&(d=await p.post({fetch:this.fetchApi,url:o.url,init:o.init,response:d.clone()})||d);return d};clone(){const r=this.constructor,s=new r(this.configuration);return s.middleware=this.middleware.slice(),s}}function xJ(e){return typeof Blob<"u"&&e instanceof Blob}function bJ(e){return typeof FormData<"u"&&e instanceof FormData}class wJ extends Error{constructor(r,s){super(s),this.response=r}name="ResponseError"}class SJ extends Error{constructor(r,s){super(s),this.cause=r}name="FetchError"}class et extends Error{constructor(r,s){super(s),this.field=r}name="RequiredError"}function uz(e,r=""){return Object.keys(e).map(s=>dz(s,e[s],r)).filter(s=>s.length>0).join("&")}function dz(e,r,s=""){const o=s+(s.length?`[${e}]`:e);if(r instanceof Array){const d=r.map(p=>encodeURIComponent(String(p))).join(`&${encodeURIComponent(o)}=`);return`${encodeURIComponent(o)}=${d}`}if(r instanceof Set){const d=Array.from(r);return dz(e,d,s)}return r instanceof Date?`${encodeURIComponent(o)}=${encodeURIComponent(r.toISOString())}`:r instanceof Object?uz(r,o):`${encodeURIComponent(o)}=${encodeURIComponent(String(r))}`}class pt{constructor(r,s=o=>o){this.raw=r,this.transformer=s}async value(){return this.transformer(await this.raw.json())}}class Ii{constructor(r){this.raw=r}async value(){}}class ec{constructor(r){this.raw=r}async value(){return await this.raw.text()}}function tg(e){return EJ(e)}function EJ(e,r){return e==null?e:{created_at:e.created_at==null?void 0:e.created_at,id:e.id==null?void 0:e.id,key:e.key==null?void 0:e.key,organization_id:e.organization_id==null?void 0:e.organization_id,updated_at:e.updated_at==null?void 0:e.updated_at,value:e.value==null?void 0:e.value}}function jJ(e){return CJ(e,!1)}function CJ(e,r=!1){return e==null?e:{annotation_ids:e.annotation_ids}}function AJ(e){return OJ(e,!1)}function OJ(e,r=!1){return e==null?e:{server_id:e.server_id}}function kJ(e){return RJ(e,!1)}function RJ(e,r=!1){return e==null?e:{domain_id:e.domain_id}}function TJ(e){return _J(e,!1)}function _J(e,r=!1){return e==null?e:{label_ids:e.label_ids}}function MM(e){return $J(e,!1)}function $J(e,r=!1){return e==null?e:{load_balancer_id:e.load_balancer_id}}function NJ(e){return DJ(e,!1)}function DJ(e,r=!1){return e==null?e:{node_pool_id:e.node_pool_id}}function PJ(e){return MJ(e,!1)}function MJ(e,r=!1){return e==null?e:{record_set_id:e.record_set_id}}function IJ(e){return zJ(e,!1)}function zJ(e,r=!1){return e==null?e:{server_ids:e.server_ids}}function LJ(e){return FJ(e,!1)}function FJ(e,r=!1){return e==null?e:{taint_ids:e.taint_ids}}function qJ(e){return BJ(e)}function BJ(e,r){return e==null?e:{auth_url:e.auth_url==null?void 0:e.auth_url}}function yb(e){return UJ(e)}function UJ(e,r){return e==null?e:{created_at:e.created_at==null?void 0:e.created_at,credential_id:e.credential_id==null?void 0:e.credential_id,domain_name:e.domain_name==null?void 0:e.domain_name,id:e.id==null?void 0:e.id,last_error:e.last_error==null?void 0:e.last_error,organization_id:e.organization_id==null?void 0:e.organization_id,status:e.status==null?void 0:e.status,updated_at:e.updated_at==null?void 0:e.updated_at,zone_id:e.zone_id==null?void 0:e.zone_id}}function ng(e){return KJ(e)}function KJ(e,r){return e==null?e:{created_at:e.created_at==null?void 0:e.created_at,id:e.id==null?void 0:e.id,kind:e.kind==null?void 0:e.kind,name:e.name==null?void 0:e.name,organization_id:e.organization_id==null?void 0:e.organization_id,private_ip_address:e.private_ip_address==null?void 0:e.private_ip_address,public_ip_address:e.public_ip_address==null?void 0:e.public_ip_address,updated_at:e.updated_at==null?void 0:e.updated_at}}function rg(e){return VJ(e)}function VJ(e,r){return e==null?e:{created_at:e.created_at==null?void 0:e.created_at,effect:e.effect==null?void 0:e.effect,id:e.id==null?void 0:e.id,key:e.key==null?void 0:e.key,organization_id:e.organization_id==null?void 0:e.organization_id,updated_at:e.updated_at==null?void 0:e.updated_at,value:e.value==null?void 0:e.value}}function sg(e){return HJ(e)}function HJ(e,r){return e==null?e:{created_at:e.created_at==null?void 0:e.created_at,id:e.id==null?void 0:e.id,key:e.key==null?void 0:e.key,organization_id:e.organization_id==null?void 0:e.organization_id,updated_at:e.updated_at==null?void 0:e.updated_at,value:e.value==null?void 0:e.value}}function Id(e){return GJ(e)}function GJ(e,r){return e==null?e:{created_at:e.created_at==null?void 0:e.created_at,hostname:e.hostname==null?void 0:e.hostname,id:e.id==null?void 0:e.id,organization_id:e.organization_id==null?void 0:e.organization_id,private_ip_address:e.private_ip_address==null?void 0:e.private_ip_address,public_ip_address:e.public_ip_address==null?void 0:e.public_ip_address,role:e.role==null?void 0:e.role,ssh_key_id:e.ssh_key_id==null?void 0:e.ssh_key_id,ssh_user:e.ssh_user==null?void 0:e.ssh_user,status:e.status==null?void 0:e.status,updated_at:e.updated_at==null?void 0:e.updated_at}}function vb(e){return XJ(e)}function XJ(e,r){return e==null?e:{annotations:e.annotations==null?void 0:e.annotations.map(tg),created_at:e.created_at==null?void 0:e.created_at,id:e.id==null?void 0:e.id,labels:e.labels==null?void 0:e.labels.map(sg),name:e.name==null?void 0:e.name,organization_id:e.organization_id==null?void 0:e.organization_id,role:e.role==null?void 0:e.role,servers:e.servers==null?void 0:e.servers.map(Id),taints:e.taints==null?void 0:e.taints.map(rg),updated_at:e.updated_at==null?void 0:e.updated_at}}function mj(e){return YJ(e)}function YJ(e,r){return e==null?e:{created_at:e.created_at==null?void 0:e.created_at,domain_id:e.domain_id==null?void 0:e.domain_id,fingerprint:e.fingerprint==null?void 0:e.fingerprint,id:e.id==null?void 0:e.id,last_error:e.last_error==null?void 0:e.last_error,name:e.name==null?void 0:e.name,owner:e.owner==null?void 0:e.owner,status:e.status==null?void 0:e.status,ttl:e.ttl==null?void 0:e.ttl,type:e.type==null?void 0:e.type,updated_at:e.updated_at==null?void 0:e.updated_at,values:e.values==null?void 0:e.values}}function Ns(e){return ZJ(e)}function ZJ(e,r){return e==null?e:{apps_load_balancer:e.apps_load_balancer==null?void 0:ng(e.apps_load_balancer),bastion_server:e.bastion_server==null?void 0:Id(e.bastion_server),captain_domain:e.captain_domain==null?void 0:yb(e.captain_domain),certificate_key:e.certificate_key==null?void 0:e.certificate_key,control_plane_record_set:e.control_plane_record_set==null?void 0:mj(e.control_plane_record_set),created_at:e.created_at==null?void 0:e.created_at,glueops_load_balancer:e.glueops_load_balancer==null?void 0:ng(e.glueops_load_balancer),id:e.id==null?void 0:e.id,last_error:e.last_error==null?void 0:e.last_error,name:e.name==null?void 0:e.name,node_pools:e.node_pools==null?void 0:e.node_pools.map(vb),provider:e.provider==null?void 0:e.provider,random_token:e.random_token==null?void 0:e.random_token,region:e.region==null?void 0:e.region,status:e.status==null?void 0:e.status,updated_at:e.updated_at==null?void 0:e.updated_at}}function WJ(e){return JJ(e,!1)}function JJ(e,r=!1){return e==null?e:{key:e.key,value:e.value}}function QJ(e){return eQ(e,!1)}function eQ(e,r=!1){return e==null?e:{name:e.name,provider:e.provider,region:e.region}}function tQ(e){return nQ(e,!1)}function nQ(e,r=!1){return e==null?e:{account_id:e.account_id,kind:e.kind,name:e.name,provider:e.provider,region:e.region,schema_version:e.schema_version,scope:e.scope,scope_kind:e.scope_kind,scope_version:e.scope_version,secret:e.secret}}function rQ(e){return sQ(e,!1)}function sQ(e,r=!1){return e==null?e:{credential_id:e.credential_id,domain_name:e.domain_name,zone_id:e.zone_id}}function iQ(e){return aQ(e,!1)}function aQ(e,r=!1){return e==null?e:{key:e.key,value:e.value}}function oQ(e){return lQ(e,!1)}function lQ(e,r=!1){return e==null?e:{kind:e.kind,name:e.name,private_ip_address:e.private_ip_address,public_ip_address:e.public_ip_address}}function cQ(e){return uQ(e,!1)}function uQ(e,r=!1){return e==null?e:{name:e.name,role:e.role}}function dQ(e){return hQ(e,!1)}function hQ(e,r=!1){return e==null?e:{name:e.name,ttl:e.ttl,type:e.type,values:e.values}}function pQ(e){return fQ(e,!1)}function fQ(e,r=!1){return e==null?e:{bits:e.bits,comment:e.comment,name:e.name,type:e.type}}function mQ(e){return gQ(e,!1)}function gQ(e,r=!1){return e==null?e:{hostname:e.hostname,private_ip_address:e.private_ip_address,public_ip_address:e.public_ip_address,role:e.role,ssh_key_id:e.ssh_key_id,ssh_user:e.ssh_user,status:e.status}}function yQ(e){return vQ(e,!1)}function vQ(e,r=!1){return e==null?e:{effect:e.effect,key:e.key,value:e.value}}function KE(e){return xQ(e)}function xQ(e,r){return e==null?e:{account_id:e.account_id==null?void 0:e.account_id,created_at:e.created_at==null?void 0:e.created_at,id:e.id==null?void 0:e.id,kind:e.kind==null?void 0:e.kind,name:e.name==null?void 0:e.name,provider:e.provider==null?void 0:e.provider,region:e.region==null?void 0:e.region,schema_version:e.schema_version==null?void 0:e.schema_version,scope:e.scope==null?void 0:e.scope,scope_kind:e.scope_kind==null?void 0:e.scope_kind,scope_version:e.scope_version==null?void 0:e.scope_version,updated_at:e.updated_at==null?void 0:e.updated_at}}function bQ(e){return wQ(e,!1)}function wQ(e,r=!1){return e==null?e:{payload:e.payload,queue:e.queue,run_at:e.run_at,type:e.type}}function SQ(e){return EQ(e)}function EQ(e,r){return e==null?e:{alg:e.alg==null?void 0:e.alg,e:e.e==null?void 0:e.e,kid:e.kid==null?void 0:e.kid,kty:e.kty==null?void 0:e.kty,n:e.n==null?void 0:e.n,use:e.use==null?void 0:e.use,x:e.x==null?void 0:e.x}}function jQ(e){return CQ(e)}function CQ(e,r){return e==null?e:{keys:e.keys==null?void 0:e.keys.map(SQ)}}function AQ(e){return OQ(e)}function OQ(e,r){return e}function gj(e){return kQ(e)}function kQ(e,r){return e==null?e:{attempts:e.attempts==null?void 0:e.attempts,created_at:e.created_at==null?void 0:e.created_at,id:e.id==null?void 0:e.id,last_error:e.last_error==null?void 0:e.last_error,max_attempts:e.max_attempts==null?void 0:e.max_attempts,payload:e.payload==null?void 0:e.payload,queue:e.queue==null?void 0:e.queue,run_at:e.run_at==null?void 0:e.run_at,status:e.status==null?void 0:AQ(e.status),type:e.type==null?void 0:e.type,updated_at:e.updated_at==null?void 0:e.updated_at}}function RQ(e){return TQ(e,!1)}function TQ(e,r=!1){return e==null?e:{refresh_token:e.refresh_token}}function _Q(e){return $Q(e)}function $Q(e,r){return e==null?e:{items:e.items==null?void 0:e.items.map(gj),page:e.page==null?void 0:e.page,page_size:e.page_size==null?void 0:e.page_size,total:e.total==null?void 0:e.total}}function NQ(e){return DQ(e)}function DQ(e,r){return e==null?e:{failed:e.failed==null?void 0:e.failed,name:e.name==null?void 0:e.name,pending:e.pending==null?void 0:e.pending,running:e.running==null?void 0:e.running,scheduled:e.scheduled==null?void 0:e.scheduled}}function PQ(e){return MQ(e,!1)}function MQ(e,r=!1){return e==null?e:{refresh_token:e.refresh_token}}function IQ(e){return zQ(e,!1)}function zQ(e,r=!1){return e==null?e:{kubeconfig:e.kubeconfig}}function IM(e){return hz(e)}function hz(e,r){return e==null?e:{created_at:e.created_at==null?void 0:e.created_at,fingerprint:e.fingerprint==null?void 0:e.fingerprint,id:e.id==null?void 0:e.id,name:e.name==null?void 0:e.name,organization_id:e.organization_id==null?void 0:e.organization_id,public_key:e.public_key==null?void 0:e.public_key,updated_at:e.updated_at==null?void 0:e.updated_at}}function zM(e){return LQ(e)}function LQ(e,r){return e==null?e:{access_token:e.access_token==null?void 0:e.access_token,expires_in:e.expires_in==null?void 0:e.expires_in,refresh_token:e.refresh_token==null?void 0:e.refresh_token,token_type:e.token_type==null?void 0:e.token_type}}function FQ(e){return qQ(e,!1)}function qQ(e,r=!1){return e==null?e:{key:e.key,value:e.value}}function BQ(e){return UQ(e,!1)}function UQ(e,r=!1){return e==null?e:{name:e.name,provider:e.provider,region:e.region}}function KQ(e){return VQ(e,!1)}function VQ(e,r=!1){return e==null?e:{account_id:e.account_id,name:e.name,region:e.region,scope:e.scope,scope_kind:e.scope_kind,scope_version:e.scope_version,secret:e.secret}}function HQ(e){return GQ(e,!1)}function GQ(e,r=!1){return e==null?e:{credential_id:e.credential_id,domain_name:e.domain_name,status:e.status,zone_id:e.zone_id}}function XQ(e){return YQ(e,!1)}function YQ(e,r=!1){return e==null?e:{key:e.key,value:e.value}}function ZQ(e){return WQ(e,!1)}function WQ(e,r=!1){return e==null?e:{kind:e.kind,name:e.name,private_ip_address:e.private_ip_address,public_ip_address:e.public_ip_address}}function JQ(e){return QQ(e,!1)}function QQ(e,r=!1){return e==null?e:{name:e.name,role:e.role}}function eee(e){return tee(e,!1)}function tee(e,r=!1){return e==null?e:{name:e.name,status:e.status,ttl:e.ttl,type:e.type,values:e.values}}function nee(e){return ree(e,!1)}function ree(e,r=!1){return e==null?e:{hostname:e.hostname,private_ip_address:e.private_ip_address,public_ip_address:e.public_ip_address,role:e.role,ssh_key_id:e.ssh_key_id,ssh_user:e.ssh_user,status:e.status}}function see(e){return iee(e,!1)}function iee(e,r=!1){return e==null?e:{effect:e.effect,key:e.key,value:e.value}}function aee(e){return oee(e)}function oee(e,r){return e==null||typeof e!="object"?e:hz(e)}function lee(e){return cee(e,!1)}function cee(e,r=!1){return e==null?e:{expires_in_hours:e.expires_in_hours,name:e.name}}function pz(e){return uee(e)}function uee(e,r){return e==null?e:{avatar_url:e.avatar_url==null?void 0:e.avatar_url,created_at:e.created_at==null?void 0:new Date(e.created_at),display_name:e.display_name==null?void 0:e.display_name,id:e.id==null?void 0:e.id,is_admin:e.is_admin==null?void 0:e.is_admin,is_disabled:e.is_disabled==null?void 0:e.is_disabled,primary_email:e.primary_email==null?void 0:e.primary_email,updated_at:e.updated_at==null?void 0:new Date(e.updated_at)}}function dee(e){return hee(e)}function hee(e,r){return e==null?e:{created_at:e.created_at==null?void 0:new Date(e.created_at),email:e.email==null?void 0:e.email,id:e.id==null?void 0:e.id,is_primary:e.is_primary==null?void 0:e.is_primary,is_verified:e.is_verified==null?void 0:e.is_verified,updated_at:e.updated_at==null?void 0:new Date(e.updated_at),user:e.user==null?void 0:pz(e.user),user_id:e.user_id==null?void 0:e.user_id}}function xb(e){return pee(e)}function pee(e,r){return e==null?e:{created_at:e.created_at==null?void 0:new Date(e.created_at),domain:e.domain==null?void 0:e.domain,id:e.id==null?void 0:e.id,name:e.name==null?void 0:e.name,updated_at:e.updated_at==null?void 0:new Date(e.updated_at)}}function fee(e){return mee(e)}function mee(e,r){return e==null?e:{avatar_url:e.avatar_url==null?void 0:e.avatar_url,created_at:e.created_at==null?void 0:new Date(e.created_at),display_name:e.display_name==null?void 0:e.display_name,emails:e.emails==null?void 0:e.emails.map(dee),id:e.id==null?void 0:e.id,is_admin:e.is_admin==null?void 0:e.is_admin,is_disabled:e.is_disabled==null?void 0:e.is_disabled,organizations:e.organizations==null?void 0:e.organizations.map(xb),primary_email:e.primary_email==null?void 0:e.primary_email,updated_at:e.updated_at==null?void 0:new Date(e.updated_at)}}function LM(e){return gee(e)}function gee(e,r){return e==null?e:{email:e.email==null?void 0:e.email,role:e.role==null?void 0:e.role,user_id:e.user_id==null?void 0:e.user_id}}function yee(e){return vee(e,!1)}function vee(e,r=!1){return e==null?e:{role:e.role,user_id:e.user_id}}function xee(e){return bee(e,!1)}function bee(e,r=!1){return e==null?e:{domain:e.domain,name:e.name}}function wee(e){return See(e,!1)}function See(e,r=!1){return e==null?e:{expires_in_hours:e.expires_in_hours,name:e.name}}function Eee(e){return jee(e)}function jee(e,r){return e==null?e:{created_at:e.created_at==null?void 0:e.created_at,expires_at:e.expires_at==null?void 0:e.expires_at,id:e.id==null?void 0:e.id,name:e.name==null?void 0:e.name,org_key:e.org_key==null?void 0:e.org_key,org_secret:e.org_secret==null?void 0:e.org_secret,scope:e.scope==null?void 0:e.scope}}function Cee(e){return Aee(e,!1)}function Aee(e,r=!1){return e==null?e:{domain:e.domain,name:e.name}}function Oee(e){return kee(e,!1)}function kee(e,r=!1){return e==null?e:{display_name:e.display_name}}function FM(e){return Ree(e)}function Ree(e,r){return e==null?e:{created_at:e.created_at==null?void 0:e.created_at,expires_at:e.expires_at==null?void 0:e.expires_at,id:e.id==null?void 0:e.id,last_used_at:e.last_used_at==null?void 0:e.last_used_at,name:e.name==null?void 0:e.name,plain:e.plain==null?void 0:e.plain,scope:e.scope==null?void 0:e.scope}}function Tee(e){return _ee(e)}function _ee(e,r){return e==null?e:{created_at:e.created_at==null?void 0:new Date(e.created_at),expires_at:e.expires_at==null?void 0:new Date(e.expires_at),id:e.id==null?void 0:e.id,last_used_at:e.last_used_at==null?void 0:new Date(e.last_used_at),name:e.name==null?void 0:e.name,org_id:e.org_id==null?void 0:e.org_id,prefix:e.prefix==null?void 0:e.prefix,revoked:e.revoked==null?void 0:e.revoked,scope:e.scope==null?void 0:e.scope,updated_at:e.updated_at==null?void 0:new Date(e.updated_at),user_id:e.user_id==null?void 0:e.user_id}}class $ee extends Gs{async createAnnotationRaw(r,s){if(r.dtoCreateAnnotationRequest==null)throw new et("dtoCreateAnnotationRequest",'Required parameter "dtoCreateAnnotationRequest" was null or undefined when calling createAnnotation().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/annotations",method:"POST",headers:d,query:o,body:WJ(r.dtoCreateAnnotationRequest)},s);return new pt(m,g=>tg(g))}async createAnnotation(r,s){return await(await this.createAnnotationRaw(r,s)).value()}async deleteAnnotationRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling deleteAnnotation().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/annotations/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new Ii(m)}async deleteAnnotation(r,s){await this.deleteAnnotationRaw(r,s)}async getAnnotationRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling getAnnotation().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/annotations/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>tg(g))}async getAnnotation(r,s){return await(await this.getAnnotationRaw(r,s)).value()}async listAnnotationsRaw(r,s){const o={};r.key!=null&&(o.key=r.key),r.value!=null&&(o.value=r.value),r.q!=null&&(o.q=r.q);const d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/annotations",method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(tg))}async listAnnotations(r={},s){return await(await this.listAnnotationsRaw(r,s)).value()}async updateAnnotationRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling updateAnnotation().');if(r.dtoUpdateAnnotationRequest==null)throw new et("dtoUpdateAnnotationRequest",'Required parameter "dtoUpdateAnnotationRequest" was null or undefined when calling updateAnnotation().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/annotations/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"PATCH",headers:d,query:o,body:FQ(r.dtoUpdateAnnotationRequest)},s);return new pt(m,g=>tg(g))}async updateAnnotation(r,s){return await(await this.updateAnnotationRaw(r,s)).value()}}class Nee extends Gs{async adminCancelArcherJobRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling adminCancelArcherJob().');const o={},d={};d["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/admin/archer/jobs/{id}/cancel";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:r.body},s);return new pt(m,g=>gj(g))}async adminCancelArcherJob(r,s){return await(await this.adminCancelArcherJobRaw(r,s)).value()}async adminEnqueueArcherJobRaw(r,s){if(r.dtoEnqueueRequest==null)throw new et("dtoEnqueueRequest",'Required parameter "dtoEnqueueRequest" was null or undefined when calling adminEnqueueArcherJob().');const o={},d={};d["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/admin/archer/jobs",method:"POST",headers:d,query:o,body:bQ(r.dtoEnqueueRequest)},s);return new pt(m,g=>gj(g))}async adminEnqueueArcherJob(r,s){return await(await this.adminEnqueueArcherJobRaw(r,s)).value()}async adminListArcherJobsRaw(r,s){const o={};r.status!=null&&(o.status=r.status),r.queue!=null&&(o.queue=r.queue),r.q!=null&&(o.q=r.q),r.page!=null&&(o.page=r.page),r.pageSize!=null&&(o.page_size=r.pageSize);const d={};this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/admin/archer/jobs",method:"GET",headers:d,query:o},s);return new pt(m,g=>_Q(g))}async adminListArcherJobs(r={},s){return await(await this.adminListArcherJobsRaw(r,s)).value()}async adminListArcherQueuesRaw(r){const s={},o={};this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));const p=await this.request({path:"/admin/archer/queues",method:"GET",headers:o,query:s},r);return new pt(p,m=>m.map(NQ))}async adminListArcherQueues(r){return await(await this.adminListArcherQueuesRaw(r)).value()}async adminRetryArcherJobRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling adminRetryArcherJob().');const o={},d={};d["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/admin/archer/jobs/{id}/retry";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:r.body},s);return new pt(m,g=>gj(g))}async adminRetryArcherJob(r,s){return await(await this.adminRetryArcherJobRaw(r,s)).value()}}const Ra={queued:"queued",running:"running",succeeded:"succeeded",failed:"failed",canceled:"canceled",retrying:"retrying",scheduled:"scheduled"};class Dee extends Gs{async authCallbackRaw(r,s){if(r.provider==null)throw new et("provider",'Required parameter "provider" was null or undefined when calling authCallback().');const o={},d={};let p="/auth/{provider}/callback";p=p.replace("{provider}",encodeURIComponent(String(r.provider)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>zM(g))}async authCallback(r,s){return await(await this.authCallbackRaw(r,s)).value()}async authStartRaw(r,s){if(r.provider==null)throw new et("provider",'Required parameter "provider" was null or undefined when calling authStart().');const o={},d={};let p="/auth/{provider}/start";p=p.replace("{provider}",encodeURIComponent(String(r.provider)));const m=await this.request({path:p,method:"POST",headers:d,query:o},s);return new pt(m,g=>qJ(g))}async authStart(r,s){return await(await this.authStartRaw(r,s)).value()}async getJWKSRaw(r){const s={},o={},p=await this.request({path:"/.well-known/jwks.json",method:"GET",headers:o,query:s},r);return new pt(p,m=>jQ(m))}async getJWKS(r){return await(await this.getJWKSRaw(r)).value()}async logoutRaw(r,s){if(r.dtoLogoutRequest==null)throw new et("dtoLogoutRequest",'Required parameter "dtoLogoutRequest" was null or undefined when calling logout().');const o={},d={};d["Content-Type"]="application/json";const m=await this.request({path:"/auth/logout",method:"POST",headers:d,query:o,body:RQ(r.dtoLogoutRequest)},s);return new Ii(m)}async logout(r,s){await this.logoutRaw(r,s)}async refreshRaw(r,s){if(r.dtoRefreshRequest==null)throw new et("dtoRefreshRequest",'Required parameter "dtoRefreshRequest" was null or undefined when calling refresh().');const o={},d={};d["Content-Type"]="application/json";const m=await this.request({path:"/auth/refresh",method:"POST",headers:d,query:o,body:PQ(r.dtoRefreshRequest)},s);return new pt(m,g=>zM(g))}async refresh(r,s){return await(await this.refreshRaw(r,s)).value()}}class Pee extends Gs{async attachAppsLoadBalancerRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling attachAppsLoadBalancer().');if(r.dtoAttachLoadBalancerRequest==null)throw new et("dtoAttachLoadBalancerRequest",'Required parameter "dtoAttachLoadBalancerRequest" was null or undefined when calling attachAppsLoadBalancer().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}/apps-load-balancer";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:MM(r.dtoAttachLoadBalancerRequest)},s);return new pt(m,g=>Ns(g))}async attachAppsLoadBalancer(r,s){return await(await this.attachAppsLoadBalancerRaw(r,s)).value()}async attachBastionServerRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling attachBastionServer().');if(r.dtoAttachBastionRequest==null)throw new et("dtoAttachBastionRequest",'Required parameter "dtoAttachBastionRequest" was null or undefined when calling attachBastionServer().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}/bastion";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:AJ(r.dtoAttachBastionRequest)},s);return new pt(m,g=>Ns(g))}async attachBastionServer(r,s){return await(await this.attachBastionServerRaw(r,s)).value()}async attachCaptainDomainRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling attachCaptainDomain().');if(r.dtoAttachCaptainDomainRequest==null)throw new et("dtoAttachCaptainDomainRequest",'Required parameter "dtoAttachCaptainDomainRequest" was null or undefined when calling attachCaptainDomain().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}/captain-domain";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:kJ(r.dtoAttachCaptainDomainRequest)},s);return new pt(m,g=>Ns(g))}async attachCaptainDomain(r,s){return await(await this.attachCaptainDomainRaw(r,s)).value()}async attachControlPlaneRecordSetRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling attachControlPlaneRecordSet().');if(r.dtoAttachRecordSetRequest==null)throw new et("dtoAttachRecordSetRequest",'Required parameter "dtoAttachRecordSetRequest" was null or undefined when calling attachControlPlaneRecordSet().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}/control-plane-record-set";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:PJ(r.dtoAttachRecordSetRequest)},s);return new pt(m,g=>Ns(g))}async attachControlPlaneRecordSet(r,s){return await(await this.attachControlPlaneRecordSetRaw(r,s)).value()}async attachGlueOpsLoadBalancerRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling attachGlueOpsLoadBalancer().');if(r.dtoAttachLoadBalancerRequest==null)throw new et("dtoAttachLoadBalancerRequest",'Required parameter "dtoAttachLoadBalancerRequest" was null or undefined when calling attachGlueOpsLoadBalancer().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}/glueops-load-balancer";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:MM(r.dtoAttachLoadBalancerRequest)},s);return new pt(m,g=>Ns(g))}async attachGlueOpsLoadBalancer(r,s){return await(await this.attachGlueOpsLoadBalancerRaw(r,s)).value()}async attachNodePoolRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling attachNodePool().');if(r.dtoAttachNodePoolRequest==null)throw new et("dtoAttachNodePoolRequest",'Required parameter "dtoAttachNodePoolRequest" was null or undefined when calling attachNodePool().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}/node-pools";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:NJ(r.dtoAttachNodePoolRequest)},s);return new pt(m,g=>Ns(g))}async attachNodePool(r,s){return await(await this.attachNodePoolRaw(r,s)).value()}async clearClusterKubeconfigRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling clearClusterKubeconfig().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}/kubeconfig";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new pt(m,g=>Ns(g))}async clearClusterKubeconfig(r,s){return await(await this.clearClusterKubeconfigRaw(r,s)).value()}async createClusterRaw(r,s){if(r.dtoCreateClusterRequest==null)throw new et("dtoCreateClusterRequest",'Required parameter "dtoCreateClusterRequest" was null or undefined when calling createCluster().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/clusters",method:"POST",headers:d,query:o,body:QJ(r.dtoCreateClusterRequest)},s);return new pt(m,g=>Ns(g))}async createCluster(r,s){return await(await this.createClusterRaw(r,s)).value()}async deleteClusterRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling deleteCluster().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return this.isJsonMime(m.headers.get("content-type"))?new pt(m):new ec(m)}async deleteCluster(r,s){return await(await this.deleteClusterRaw(r,s)).value()}async detachAppsLoadBalancerRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling detachAppsLoadBalancer().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}/apps-load-balancer";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new pt(m,g=>Ns(g))}async detachAppsLoadBalancer(r,s){return await(await this.detachAppsLoadBalancerRaw(r,s)).value()}async detachBastionServerRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling detachBastionServer().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}/bastion";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new pt(m,g=>Ns(g))}async detachBastionServer(r,s){return await(await this.detachBastionServerRaw(r,s)).value()}async detachCaptainDomainRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling detachCaptainDomain().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}/captain-domain";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new pt(m,g=>Ns(g))}async detachCaptainDomain(r,s){return await(await this.detachCaptainDomainRaw(r,s)).value()}async detachControlPlaneRecordSetRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling detachControlPlaneRecordSet().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}/control-plane-record-set";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new pt(m,g=>Ns(g))}async detachControlPlaneRecordSet(r,s){return await(await this.detachControlPlaneRecordSetRaw(r,s)).value()}async detachGlueOpsLoadBalancerRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling detachGlueOpsLoadBalancer().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}/glueops-load-balancer";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new pt(m,g=>Ns(g))}async detachGlueOpsLoadBalancer(r,s){return await(await this.detachGlueOpsLoadBalancerRaw(r,s)).value()}async detachNodePoolRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling detachNodePool().');if(r.nodePoolID==null)throw new et("nodePoolID",'Required parameter "nodePoolID" was null or undefined when calling detachNodePool().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}/node-pools/{nodePoolID}";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID))),p=p.replace("{nodePoolID}",encodeURIComponent(String(r.nodePoolID)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new pt(m,g=>Ns(g))}async detachNodePool(r,s){return await(await this.detachNodePoolRaw(r,s)).value()}async getClusterRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling getCluster().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>Ns(g))}async getCluster(r,s){return await(await this.getClusterRaw(r,s)).value()}async listClustersRaw(r,s){const o={};r.q!=null&&(o.q=r.q);const d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/clusters",method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(Ns))}async listClusters(r={},s){return await(await this.listClustersRaw(r,s)).value()}async setClusterKubeconfigRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling setClusterKubeconfig().');if(r.dtoSetKubeconfigRequest==null)throw new et("dtoSetKubeconfigRequest",'Required parameter "dtoSetKubeconfigRequest" was null or undefined when calling setClusterKubeconfig().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}/kubeconfig";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:IQ(r.dtoSetKubeconfigRequest)},s);return new pt(m,g=>Ns(g))}async setClusterKubeconfig(r,s){return await(await this.setClusterKubeconfigRaw(r,s)).value()}async updateClusterRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling updateCluster().');if(r.dtoUpdateClusterRequest==null)throw new et("dtoUpdateClusterRequest",'Required parameter "dtoUpdateClusterRequest" was null or undefined when calling updateCluster().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:p,method:"PATCH",headers:d,query:o,body:BQ(r.dtoUpdateClusterRequest)},s);return new pt(m,g=>Ns(g))}async updateCluster(r,s){return await(await this.updateClusterRaw(r,s)).value()}}class Mee extends Gs{async createCredentialRaw(r,s){if(r.dtoCreateCredentialRequest==null)throw new et("dtoCreateCredentialRequest",'Required parameter "dtoCreateCredentialRequest" was null or undefined when calling createCredential().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/credentials",method:"POST",headers:d,query:o,body:tQ(r.dtoCreateCredentialRequest)},s);return new pt(m,g=>KE(g))}async createCredential(r,s){return await(await this.createCredentialRaw(r,s)).value()}async deleteCredentialRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling deleteCredential().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/credentials/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new Ii(m)}async deleteCredential(r,s){await this.deleteCredentialRaw(r,s)}async getCredentialRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling getCredential().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/credentials/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>KE(g))}async getCredential(r,s){return await(await this.getCredentialRaw(r,s)).value()}async listCredentialsRaw(r,s){const o={};r.provider!=null&&(o.provider=r.provider),r.kind!=null&&(o.kind=r.kind),r.scopeKind!=null&&(o.scope_kind=r.scopeKind);const d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/credentials",method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(KE))}async listCredentials(r={},s){return await(await this.listCredentialsRaw(r,s)).value()}async revealCredentialRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling revealCredential().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/credentials/{id}/reveal";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:r.body},s);return new pt(m)}async revealCredential(r,s){return await(await this.revealCredentialRaw(r,s)).value()}async updateCredentialRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling updateCredential().');if(r.dtoUpdateCredentialRequest==null)throw new et("dtoUpdateCredentialRequest",'Required parameter "dtoUpdateCredentialRequest" was null or undefined when calling updateCredential().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/credentials/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"PATCH",headers:d,query:o,body:KQ(r.dtoUpdateCredentialRequest)},s);return new pt(m,g=>KE(g))}async updateCredential(r,s){return await(await this.updateCredentialRaw(r,s)).value()}}class Iee extends Gs{async createDomainRaw(r,s){if(r.dtoCreateDomainRequest==null)throw new et("dtoCreateDomainRequest",'Required parameter "dtoCreateDomainRequest" was null or undefined when calling createDomain().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/dns/domains",method:"POST",headers:d,query:o,body:rQ(r.dtoCreateDomainRequest)},s);return new pt(m,g=>yb(g))}async createDomain(r,s){return await(await this.createDomainRaw(r,s)).value()}async createRecordSetRaw(r,s){if(r.domainId==null)throw new et("domainId",'Required parameter "domainId" was null or undefined when calling createRecordSet().');if(r.dtoCreateRecordSetRequest==null)throw new et("dtoCreateRecordSetRequest",'Required parameter "dtoCreateRecordSetRequest" was null or undefined when calling createRecordSet().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/dns/domains/{domain_id}/records";p=p.replace("{domain_id}",encodeURIComponent(String(r.domainId)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:dQ(r.dtoCreateRecordSetRequest)},s);return new pt(m,g=>mj(g))}async createRecordSet(r,s){return await(await this.createRecordSetRaw(r,s)).value()}async deleteDomainRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling deleteDomain().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/dns/domains/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new Ii(m)}async deleteDomain(r,s){await this.deleteDomainRaw(r,s)}async deleteRecordSetRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling deleteRecordSet().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/dns/records/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new Ii(m)}async deleteRecordSet(r,s){await this.deleteRecordSetRaw(r,s)}async getDomainRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling getDomain().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/dns/domains/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>yb(g))}async getDomain(r,s){return await(await this.getDomainRaw(r,s)).value()}async listDomainsRaw(r,s){const o={};r.domainName!=null&&(o.domain_name=r.domainName),r.status!=null&&(o.status=r.status),r.q!=null&&(o.q=r.q);const d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/dns/domains",method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(yb))}async listDomains(r={},s){return await(await this.listDomainsRaw(r,s)).value()}async listRecordSetsRaw(r,s){if(r.domainId==null)throw new et("domainId",'Required parameter "domainId" was null or undefined when calling listRecordSets().');const o={};r.name!=null&&(o.name=r.name),r.type!=null&&(o.type=r.type),r.status!=null&&(o.status=r.status);const d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/dns/domains/{domain_id}/records";p=p.replace("{domain_id}",encodeURIComponent(String(r.domainId)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(mj))}async listRecordSets(r,s){return await(await this.listRecordSetsRaw(r,s)).value()}async updateDomainRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling updateDomain().');if(r.dtoUpdateDomainRequest==null)throw new et("dtoUpdateDomainRequest",'Required parameter "dtoUpdateDomainRequest" was null or undefined when calling updateDomain().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/dns/domains/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"PATCH",headers:d,query:o,body:HQ(r.dtoUpdateDomainRequest)},s);return new pt(m,g=>yb(g))}async updateDomain(r,s){return await(await this.updateDomainRaw(r,s)).value()}async updateRecordSetRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling updateRecordSet().');if(r.dtoUpdateRecordSetRequest==null)throw new et("dtoUpdateRecordSetRequest",'Required parameter "dtoUpdateRecordSetRequest" was null or undefined when calling updateRecordSet().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/dns/records/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"PATCH",headers:d,query:o,body:eee(r.dtoUpdateRecordSetRequest)},s);return new pt(m,g=>mj(g))}async updateRecordSet(r,s){return await(await this.updateRecordSetRaw(r,s)).value()}}class zee extends Gs{async createLabelRaw(r,s){if(r.dtoCreateLabelRequest==null)throw new et("dtoCreateLabelRequest",'Required parameter "dtoCreateLabelRequest" was null or undefined when calling createLabel().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/labels",method:"POST",headers:d,query:o,body:iQ(r.dtoCreateLabelRequest)},s);return new pt(m,g=>sg(g))}async createLabel(r,s){return await(await this.createLabelRaw(r,s)).value()}async deleteLabelRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling deleteLabel().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/labels/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new Ii(m)}async deleteLabel(r,s){await this.deleteLabelRaw(r,s)}async getLabelRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling getLabel().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/labels/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>sg(g))}async getLabel(r,s){return await(await this.getLabelRaw(r,s)).value()}async listLabelsRaw(r,s){const o={};r.key!=null&&(o.key=r.key),r.value!=null&&(o.value=r.value),r.q!=null&&(o.q=r.q);const d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/labels",method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(sg))}async listLabels(r={},s){return await(await this.listLabelsRaw(r,s)).value()}async updateLabelRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling updateLabel().');if(r.dtoUpdateLabelRequest==null)throw new et("dtoUpdateLabelRequest",'Required parameter "dtoUpdateLabelRequest" was null or undefined when calling updateLabel().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/labels/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"PATCH",headers:d,query:o,body:XQ(r.dtoUpdateLabelRequest)},s);return new pt(m,g=>sg(g))}async updateLabel(r,s){return await(await this.updateLabelRaw(r,s)).value()}}class Lee extends Gs{async createLoadBalancerRaw(r,s){if(r.dtoCreateLoadBalancerRequest==null)throw new et("dtoCreateLoadBalancerRequest",'Required parameter "dtoCreateLoadBalancerRequest" was null or undefined when calling createLoadBalancer().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/load-balancers",method:"POST",headers:d,query:o,body:oQ(r.dtoCreateLoadBalancerRequest)},s);return new pt(m,g=>ng(g))}async createLoadBalancer(r,s){return await(await this.createLoadBalancerRaw(r,s)).value()}async deleteLoadBalancerRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling deleteLoadBalancer().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/load-balancers/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new Ii(m)}async deleteLoadBalancer(r,s){await this.deleteLoadBalancerRaw(r,s)}async getLoadBalancersRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling getLoadBalancers().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/load-balancers/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(ng))}async getLoadBalancers(r,s){return await(await this.getLoadBalancersRaw(r,s)).value()}async listLoadBalancersRaw(r,s){const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/load-balancers",method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(ng))}async listLoadBalancers(r={},s){return await(await this.listLoadBalancersRaw(r,s)).value()}async updateLoadBalancerRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling updateLoadBalancer().');if(r.dtoUpdateLoadBalancerRequest==null)throw new et("dtoUpdateLoadBalancerRequest",'Required parameter "dtoUpdateLoadBalancerRequest" was null or undefined when calling updateLoadBalancer().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/load-balancers/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"PATCH",headers:d,query:o,body:ZQ(r.dtoUpdateLoadBalancerRequest)},s);return new pt(m,g=>ng(g))}async updateLoadBalancer(r,s){return await(await this.updateLoadBalancerRaw(r,s)).value()}}class Fee extends Gs{async getMeRaw(r){const s={},o={};this.configuration&&this.configuration.apiKey&&(o["X-API-KEY"]=await this.configuration.apiKey("X-API-KEY")),this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));const p=await this.request({path:"/me",method:"GET",headers:o,query:s},r);return new pt(p,m=>fee(m))}async getMe(r){return await(await this.getMeRaw(r)).value()}async updateMeRaw(r,s){if(r.handlersUpdateMeRequest==null)throw new et("handlersUpdateMeRequest",'Required parameter "handlersUpdateMeRequest" was null or undefined when calling updateMe().');const o={},d={};d["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(d["X-API-KEY"]=await this.configuration.apiKey("X-API-KEY")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/me",method:"PATCH",headers:d,query:o,body:Oee(r.handlersUpdateMeRequest)},s);return new pt(m,g=>pz(g))}async updateMe(r,s){return await(await this.updateMeRaw(r,s)).value()}}class qee extends Gs{async createUserAPIKeyRaw(r,s){if(r.handlersCreateUserKeyRequest==null)throw new et("handlersCreateUserKeyRequest",'Required parameter "handlersCreateUserKeyRequest" was null or undefined when calling createUserAPIKey().');const o={},d={};d["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(d["X-API-KEY"]=await this.configuration.apiKey("X-API-KEY")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/me/api-keys",method:"POST",headers:d,query:o,body:lee(r.handlersCreateUserKeyRequest)},s);return new pt(m,g=>FM(g))}async createUserAPIKey(r,s){return await(await this.createUserAPIKeyRaw(r,s)).value()}async deleteUserAPIKeyRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling deleteUserAPIKey().');const o={},d={};this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/me/api-keys/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new Ii(m)}async deleteUserAPIKey(r,s){await this.deleteUserAPIKeyRaw(r,s)}async listUserAPIKeysRaw(r){const s={},o={};this.configuration&&this.configuration.apiKey&&(o["X-API-KEY"]=await this.configuration.apiKey("X-API-KEY")),this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));const p=await this.request({path:"/me/api-keys",method:"GET",headers:o,query:s},r);return new pt(p,m=>m.map(FM))}async listUserAPIKeys(r){return await(await this.listUserAPIKeysRaw(r)).value()}}class Bee extends Gs{async attachNodePoolAnnotationsRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling attachNodePoolAnnotations().');if(r.dtoAttachAnnotationsRequest==null)throw new et("dtoAttachAnnotationsRequest",'Required parameter "dtoAttachAnnotationsRequest" was null or undefined when calling attachNodePoolAnnotations().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/node-pools/{id}/annotations";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:jJ(r.dtoAttachAnnotationsRequest)},s);return this.isJsonMime(m.headers.get("content-type"))?new pt(m):new ec(m)}async attachNodePoolAnnotations(r,s){return await(await this.attachNodePoolAnnotationsRaw(r,s)).value()}async attachNodePoolLabelsRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling attachNodePoolLabels().');if(r.dtoAttachLabelsRequest==null)throw new et("dtoAttachLabelsRequest",'Required parameter "dtoAttachLabelsRequest" was null or undefined when calling attachNodePoolLabels().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/node-pools/{id}/labels";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:TJ(r.dtoAttachLabelsRequest)},s);return this.isJsonMime(m.headers.get("content-type"))?new pt(m):new ec(m)}async attachNodePoolLabels(r,s){return await(await this.attachNodePoolLabelsRaw(r,s)).value()}async attachNodePoolServersRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling attachNodePoolServers().');if(r.dtoAttachServersRequest==null)throw new et("dtoAttachServersRequest",'Required parameter "dtoAttachServersRequest" was null or undefined when calling attachNodePoolServers().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/node-pools/{id}/servers";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:IJ(r.dtoAttachServersRequest)},s);return this.isJsonMime(m.headers.get("content-type"))?new pt(m):new ec(m)}async attachNodePoolServers(r,s){return await(await this.attachNodePoolServersRaw(r,s)).value()}async attachNodePoolTaintsRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling attachNodePoolTaints().');if(r.dtoAttachTaintsRequest==null)throw new et("dtoAttachTaintsRequest",'Required parameter "dtoAttachTaintsRequest" was null or undefined when calling attachNodePoolTaints().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/node-pools/{id}/taints";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:LJ(r.dtoAttachTaintsRequest)},s);return this.isJsonMime(m.headers.get("content-type"))?new pt(m):new ec(m)}async attachNodePoolTaints(r,s){return await(await this.attachNodePoolTaintsRaw(r,s)).value()}async createNodePoolRaw(r,s){if(r.dtoCreateNodePoolRequest==null)throw new et("dtoCreateNodePoolRequest",'Required parameter "dtoCreateNodePoolRequest" was null or undefined when calling createNodePool().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/node-pools",method:"POST",headers:d,query:o,body:cQ(r.dtoCreateNodePoolRequest)},s);return new pt(m,g=>vb(g))}async createNodePool(r,s){return await(await this.createNodePoolRaw(r,s)).value()}async deleteNodePoolRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling deleteNodePool().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/node-pools/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new Ii(m)}async deleteNodePool(r,s){await this.deleteNodePoolRaw(r,s)}async detachNodePoolAnnotationRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling detachNodePoolAnnotation().');if(r.annotationId==null)throw new et("annotationId",'Required parameter "annotationId" was null or undefined when calling detachNodePoolAnnotation().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/node-pools/{id}/annotations/{annotationId}";p=p.replace("{id}",encodeURIComponent(String(r.id))),p=p.replace("{annotationId}",encodeURIComponent(String(r.annotationId)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return this.isJsonMime(m.headers.get("content-type"))?new pt(m):new ec(m)}async detachNodePoolAnnotation(r,s){return await(await this.detachNodePoolAnnotationRaw(r,s)).value()}async detachNodePoolLabelRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling detachNodePoolLabel().');if(r.labelId==null)throw new et("labelId",'Required parameter "labelId" was null or undefined when calling detachNodePoolLabel().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/node-pools/{id}/labels/{labelId}";p=p.replace("{id}",encodeURIComponent(String(r.id))),p=p.replace("{labelId}",encodeURIComponent(String(r.labelId)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return this.isJsonMime(m.headers.get("content-type"))?new pt(m):new ec(m)}async detachNodePoolLabel(r,s){return await(await this.detachNodePoolLabelRaw(r,s)).value()}async detachNodePoolServerRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling detachNodePoolServer().');if(r.serverId==null)throw new et("serverId",'Required parameter "serverId" was null or undefined when calling detachNodePoolServer().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/node-pools/{id}/servers/{serverId}";p=p.replace("{id}",encodeURIComponent(String(r.id))),p=p.replace("{serverId}",encodeURIComponent(String(r.serverId)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return this.isJsonMime(m.headers.get("content-type"))?new pt(m):new ec(m)}async detachNodePoolServer(r,s){return await(await this.detachNodePoolServerRaw(r,s)).value()}async detachNodePoolTaintRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling detachNodePoolTaint().');if(r.taintId==null)throw new et("taintId",'Required parameter "taintId" was null or undefined when calling detachNodePoolTaint().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/node-pools/{id}/taints/{taintId}";p=p.replace("{id}",encodeURIComponent(String(r.id))),p=p.replace("{taintId}",encodeURIComponent(String(r.taintId)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return this.isJsonMime(m.headers.get("content-type"))?new pt(m):new ec(m)}async detachNodePoolTaint(r,s){return await(await this.detachNodePoolTaintRaw(r,s)).value()}async getNodePoolRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling getNodePool().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/node-pools/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>vb(g))}async getNodePool(r,s){return await(await this.getNodePoolRaw(r,s)).value()}async listNodePoolAnnotationsRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling listNodePoolAnnotations().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/node-pools/{id}/annotations";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(tg))}async listNodePoolAnnotations(r,s){return await(await this.listNodePoolAnnotationsRaw(r,s)).value()}async listNodePoolLabelsRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling listNodePoolLabels().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/node-pools/{id}/labels";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(sg))}async listNodePoolLabels(r,s){return await(await this.listNodePoolLabelsRaw(r,s)).value()}async listNodePoolServersRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling listNodePoolServers().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/node-pools/{id}/servers";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(Id))}async listNodePoolServers(r,s){return await(await this.listNodePoolServersRaw(r,s)).value()}async listNodePoolTaintsRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling listNodePoolTaints().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/node-pools/{id}/taints";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(rg))}async listNodePoolTaints(r,s){return await(await this.listNodePoolTaintsRaw(r,s)).value()}async listNodePoolsRaw(r,s){const o={};r.q!=null&&(o.q=r.q);const d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/node-pools",method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(vb))}async listNodePools(r={},s){return await(await this.listNodePoolsRaw(r,s)).value()}async updateNodePoolRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling updateNodePool().');if(r.dtoUpdateNodePoolRequest==null)throw new et("dtoUpdateNodePoolRequest",'Required parameter "dtoUpdateNodePoolRequest" was null or undefined when calling updateNodePool().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/node-pools/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"PATCH",headers:d,query:o,body:JQ(r.dtoUpdateNodePoolRequest)},s);return new pt(m,g=>vb(g))}async updateNodePool(r,s){return await(await this.updateNodePoolRaw(r,s)).value()}}class Uee extends Gs{async addOrUpdateMemberRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling addOrUpdateMember().');if(r.handlersMemberUpsertReq==null)throw new et("handlersMemberUpsertReq",'Required parameter "handlersMemberUpsertReq" was null or undefined when calling addOrUpdateMember().');const o={},d={};d["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/orgs/{id}/members";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:yee(r.handlersMemberUpsertReq)},s);return new pt(m,g=>LM(g))}async addOrUpdateMember(r,s){return await(await this.addOrUpdateMemberRaw(r,s)).value()}async createOrgRaw(r,s){if(r.handlersOrgCreateReq==null)throw new et("handlersOrgCreateReq",'Required parameter "handlersOrgCreateReq" was null or undefined when calling createOrg().');const o={},d={};d["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/orgs",method:"POST",headers:d,query:o,body:xee(r.handlersOrgCreateReq)},s);return new pt(m,g=>xb(g))}async createOrg(r,s){return await(await this.createOrgRaw(r,s)).value()}async createOrgKeyRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling createOrgKey().');if(r.handlersOrgKeyCreateReq==null)throw new et("handlersOrgKeyCreateReq",'Required parameter "handlersOrgKeyCreateReq" was null or undefined when calling createOrgKey().');const o={},d={};d["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/orgs/{id}/api-keys";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:wee(r.handlersOrgKeyCreateReq)},s);return new pt(m,g=>Eee(g))}async createOrgKey(r,s){return await(await this.createOrgKeyRaw(r,s)).value()}async deleteOrgRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling deleteOrg().');const o={},d={};this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/orgs/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new Ii(m)}async deleteOrg(r,s){await this.deleteOrgRaw(r,s)}async deleteOrgKeyRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling deleteOrgKey().');if(r.keyId==null)throw new et("keyId",'Required parameter "keyId" was null or undefined when calling deleteOrgKey().');const o={},d={};this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/orgs/{id}/api-keys/{key_id}";p=p.replace("{id}",encodeURIComponent(String(r.id))),p=p.replace("{key_id}",encodeURIComponent(String(r.keyId)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new Ii(m)}async deleteOrgKey(r,s){await this.deleteOrgKeyRaw(r,s)}async getOrgRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling getOrg().');const o={},d={};this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/orgs/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>xb(g))}async getOrg(r,s){return await(await this.getOrgRaw(r,s)).value()}async listMembersRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling listMembers().');const o={},d={};this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/orgs/{id}/members";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(LM))}async listMembers(r,s){return await(await this.listMembersRaw(r,s)).value()}async listMyOrgsRaw(r){const s={},o={};this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));const p=await this.request({path:"/orgs",method:"GET",headers:o,query:s},r);return new pt(p,m=>m.map(xb))}async listMyOrgs(r){return await(await this.listMyOrgsRaw(r)).value()}async listOrgKeysRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling listOrgKeys().');const o={},d={};this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/orgs/{id}/api-keys";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(Tee))}async listOrgKeys(r,s){return await(await this.listOrgKeysRaw(r,s)).value()}async removeMemberRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling removeMember().');if(r.userId==null)throw new et("userId",'Required parameter "userId" was null or undefined when calling removeMember().');const o={},d={};this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/orgs/{id}/members/{user_id}";p=p.replace("{id}",encodeURIComponent(String(r.id))),p=p.replace("{user_id}",encodeURIComponent(String(r.userId)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new Ii(m)}async removeMember(r,s){await this.removeMemberRaw(r,s)}async updateOrgRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling updateOrg().');if(r.handlersOrgUpdateReq==null)throw new et("handlersOrgUpdateReq",'Required parameter "handlersOrgUpdateReq" was null or undefined when calling updateOrg().');const o={},d={};d["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/orgs/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"PATCH",headers:d,query:o,body:Cee(r.handlersOrgUpdateReq)},s);return new pt(m,g=>xb(g))}async updateOrg(r,s){return await(await this.updateOrgRaw(r,s)).value()}}class Kee extends Gs{async createServerRaw(r,s){if(r.dtoCreateServerRequest==null)throw new et("dtoCreateServerRequest",'Required parameter "dtoCreateServerRequest" was null or undefined when calling createServer().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/servers",method:"POST",headers:d,query:o,body:mQ(r.dtoCreateServerRequest)},s);return new pt(m,g=>Id(g))}async createServer(r,s){return await(await this.createServerRaw(r,s)).value()}async deleteServerRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling deleteServer().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/servers/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new Ii(m)}async deleteServer(r,s){await this.deleteServerRaw(r,s)}async getServerRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling getServer().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/servers/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>Id(g))}async getServer(r,s){return await(await this.getServerRaw(r,s)).value()}async listServersRaw(r,s){const o={};r.status!=null&&(o.status=r.status),r.role!=null&&(o.role=r.role);const d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/servers",method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(Id))}async listServers(r={},s){return await(await this.listServersRaw(r,s)).value()}async resetServerHostKeyRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling resetServerHostKey().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/servers/{id}/reset-hostkey";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:r.body},s);return new pt(m,g=>Id(g))}async resetServerHostKey(r,s){return await(await this.resetServerHostKeyRaw(r,s)).value()}async updateServerRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling updateServer().');if(r.dtoUpdateServerRequest==null)throw new et("dtoUpdateServerRequest",'Required parameter "dtoUpdateServerRequest" was null or undefined when calling updateServer().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/servers/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"PATCH",headers:d,query:o,body:nee(r.dtoUpdateServerRequest)},s);return new pt(m,g=>Id(g))}async updateServer(r,s){return await(await this.updateServerRaw(r,s)).value()}}class Vee extends Gs{async createSSHKeyRaw(r,s){if(r.dtoCreateSSHRequest==null)throw new et("dtoCreateSSHRequest",'Required parameter "dtoCreateSSHRequest" was null or undefined when calling createSSHKey().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/ssh",method:"POST",headers:d,query:o,body:pQ(r.dtoCreateSSHRequest)},s);return new pt(m,g=>IM(g))}async createSSHKey(r,s){return await(await this.createSSHKeyRaw(r,s)).value()}async deleteSSHKeyRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling deleteSSHKey().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/ssh/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new Ii(m)}async deleteSSHKey(r,s){await this.deleteSSHKeyRaw(r,s)}async downloadSSHKeyRaw(r,s){if(r.xOrgID==null)throw new et("xOrgID",'Required parameter "xOrgID" was null or undefined when calling downloadSSHKey().');if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling downloadSSHKey().');if(r.part==null)throw new et("part",'Required parameter "part" was null or undefined when calling downloadSSHKey().');const o={};r.part!=null&&(o.part=r.part);const d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/ssh/{id}/download";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return this.isJsonMime(m.headers.get("content-type"))?new pt(m):new ec(m)}async downloadSSHKey(r,s){return await(await this.downloadSSHKeyRaw(r,s)).value()}async getSSHKeyRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling getSSHKey().');const o={};r.reveal!=null&&(o.reveal=r.reveal);const d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/ssh/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>aee(g))}async getSSHKey(r,s){return await(await this.getSSHKeyRaw(r,s)).value()}async listPublicSshKeysRaw(r,s){const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/ssh",method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(IM))}async listPublicSshKeys(r={},s){return await(await this.listPublicSshKeysRaw(r,s)).value()}}class Hee extends Gs{async createTaintRaw(r,s){if(r.dtoCreateTaintRequest==null)throw new et("dtoCreateTaintRequest",'Required parameter "dtoCreateTaintRequest" was null or undefined when calling createTaint().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/taints",method:"POST",headers:d,query:o,body:yQ(r.dtoCreateTaintRequest)},s);return new pt(m,g=>rg(g))}async createTaint(r,s){return await(await this.createTaintRaw(r,s)).value()}async deleteTaintRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling deleteTaint().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/taints/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new Ii(m)}async deleteTaint(r,s){await this.deleteTaintRaw(r,s)}async getTaintRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling getTaint().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/taints/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>rg(g))}async getTaint(r,s){return await(await this.getTaintRaw(r,s)).value()}async listTaintsRaw(r,s){const o={};r.key!=null&&(o.key=r.key),r.value!=null&&(o.value=r.value),r.q!=null&&(o.q=r.q);const d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/taints",method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(rg))}async listTaints(r={},s){return await(await this.listTaintsRaw(r,s)).value()}async updateTaintRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling updateTaint().');if(r.dtoUpdateTaintRequest==null)throw new et("dtoUpdateTaintRequest",'Required parameter "dtoUpdateTaintRequest" was null or undefined when calling updateTaint().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/taints/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"PATCH",headers:d,query:o,body:see(r.dtoUpdateTaintRequest)},s);return new pt(m,g=>rg(g))}async updateTaint(r,s){return await(await this.updateTaintRaw(r,s)).value()}}const q_="/api/v1";function Gee(){return new cz({basePath:q_,accessToken:async()=>Ks.getAccessToken()??"",middleware:[{async pre(e){const r=new Headers(e.init?.headers??{});e.init?.body!=null&&!(e.init.body instanceof FormData)&&!(e.init.body instanceof Blob)&&!r.has("Content-Type")&&r.set("Content-Type","application/json");const o=Ks.getAccessToken();o&&r.set("Authorization",`Bearer ${o}`);const d=Qo.get();return d&&r.set("X-Org-ID",d),{...e,init:{...e.init,headers:r}}},async post(e){return e.response}}]})}function Ui(e){return new e(Gee())}function Xee(){return Ui(Dee)}function Yee(){return Ui(Fee)}function Zee(){return Ui(qee)}function yC(){return Ui(Uee)}function Wee(){return Ui(Vee)}function Jee(){return Ui(Kee)}function Qee(){return Ui(Hee)}function ete(){return Ui(zee)}function tte(){return Ui($ee)}function nte(){return Ui(Nee)}function rte(){return Ui(Bee)}function ste(){return Ui(Mee)}function ite(){return Ui(Iee)}function ate(){return Ui(Lee)}function ote(){return Ui(Pee)}let VE=null;async function lte(){const e=Ks.get();if(!e?.refresh_token)return!1;try{const r=await fetch(`${q_}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refresh_token:e.refresh_token})});if(!r.ok)return!1;const s=await r.json();return Ks.set(s),!0}catch{return!1}}async function qM(){return VE||(VE=lte().finally(()=>{VE=null})),VE}function cte(e){return e?.status===401||e?.cause?.status===401||e?.response?.status===401||e instanceof Response&&e.status===401}async function ut(e){Ks.willExpireSoon?.(30)&&await qM();try{return await e()}catch(r){if(!cte(r)||!await qM())throw r;return await e()}}const BM=Yee(),NR=Zee(),yp={getMe:()=>ut(async()=>await BM.getMe()),updateMe:e=>ut(async()=>await BM.updateMe({handlersUpdateMeRequest:e})),listKeys:()=>ut(async()=>await NR.listUserAPIKeys()),createKey:e=>ut(async()=>await NR.createUserAPIKey({handlersCreateUserKeyRequest:e})),deleteKey:e=>ut(async()=>(await NR.deleteUserAPIKey({id:e}),!0))},ute={footer:async()=>{const e=await fetch("/api/v1/version",{cache:"no-store"});if(!e.ok)throw new Error("failed to fetch version");return await e.json()}};function UM(e,r){if(typeof e=="function")return e(r);e!=null&&(e.current=r)}function zi(...e){return r=>{let s=!1;const o=e.map(d=>{const p=UM(d,r);return!s&&typeof p=="function"&&(s=!0),p});if(s)return()=>{for(let d=0;d{let{children:p,...m}=o;fz(p)&&typeof $j=="function"&&(p=$j(p._payload));const g=R.Children.toArray(p),b=g.find(mte);if(b){const S=b.props.children,E=g.map(A=>A===b?R.Children.count(S)>1?R.Children.only(null):R.isValidElement(S)?S.props.children:null:A);return u.jsx(r,{...m,ref:d,children:R.isValidElement(S)?R.cloneElement(S,void 0,E):null})}return u.jsx(r,{...m,ref:d,children:p})});return s.displayName=`${e}.Slot`,s}var Cg=tw("Slot");function pte(e){const r=R.forwardRef((s,o)=>{let{children:d,...p}=s;if(fz(d)&&typeof $j=="function"&&(d=$j(d._payload)),R.isValidElement(d)){const m=yte(d),g=gte(p,d.props);return d.type!==R.Fragment&&(g.ref=o?zi(o,m):m),R.cloneElement(d,g)}return R.Children.count(d)>1?R.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var fte=Symbol("radix.slottable");function mte(e){return R.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fte}function gte(e,r){const s={...r};for(const o in r){const d=e[o],p=r[o];/^on[A-Z]/.test(o)?d&&p?s[o]=(...g)=>{const b=p(...g);return d(...g),b}:d&&(s[o]=d):o==="style"?s[o]={...d,...p}:o==="className"&&(s[o]=[d,p].filter(Boolean).join(" "))}return{...e,...s}}function yte(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning;return s?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}function mz(e){var r,s,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var d=e.length;for(r=0;rtypeof e=="boolean"?`${e}`:e===0?"0":e,VM=gz,B_=(e,r)=>s=>{var o;if(r?.variants==null)return VM(e,s?.class,s?.className);const{variants:d,defaultVariants:p}=r,m=Object.keys(d).map(S=>{const E=s?.[S],A=p?.[S];if(E===null)return null;const k=KM(E)||KM(A);return d[S][k]}),g=s&&Object.entries(s).reduce((S,E)=>{let[A,k]=E;return k===void 0||(S[A]=k),S},{}),b=r==null||(o=r.compoundVariants)===null||o===void 0?void 0:o.reduce((S,E)=>{let{class:A,className:k,...T}=E;return Object.entries(T).every(M=>{let[I,q]=M;return Array.isArray(q)?q.includes({...p,...g}[I]):{...p,...g}[I]===q})?[...S,A,k]:S},[]);return VM(e,m,b,s?.class,s?.className)},vte=(e,r)=>{const s=new Array(e.length+r.length);for(let o=0;o({classGroupId:e,validator:r}),yz=(e=new Map,r=null,s)=>({nextPart:e,validators:r,classGroupId:s}),Nj="-",HM=[],bte="arbitrary..",wte=e=>{const r=Ete(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:m=>{if(m.startsWith("[")&&m.endsWith("]"))return Ste(m);const g=m.split(Nj),b=g[0]===""&&g.length>1?1:0;return vz(g,b,r)},getConflictingClassGroupIds:(m,g)=>{if(g){const b=o[m],S=s[m];return b?S?vte(S,b):b:S||HM}return s[m]||HM}}},vz=(e,r,s)=>{if(e.length-r===0)return s.classGroupId;const d=e[r],p=s.nextPart.get(d);if(p){const S=vz(e,r+1,p);if(S)return S}const m=s.validators;if(m===null)return;const g=r===0?e.join(Nj):e.slice(r).join(Nj),b=m.length;for(let S=0;Se.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const r=e.slice(1,-1),s=r.indexOf(":"),o=r.slice(0,s);return o?bte+o:void 0})(),Ete=e=>{const{theme:r,classGroups:s}=e;return jte(s,r)},jte=(e,r)=>{const s=yz();for(const o in e){const d=e[o];U_(d,s,o,r)}return s},U_=(e,r,s,o)=>{const d=e.length;for(let p=0;p{if(typeof e=="string"){Ate(e,r,s);return}if(typeof e=="function"){Ote(e,r,s,o);return}kte(e,r,s,o)},Ate=(e,r,s)=>{const o=e===""?r:xz(r,e);o.classGroupId=s},Ote=(e,r,s,o)=>{if(Rte(e)){U_(e(o),r,s,o);return}r.validators===null&&(r.validators=[]),r.validators.push(xte(s,e))},kte=(e,r,s,o)=>{const d=Object.entries(e),p=d.length;for(let m=0;m{let s=e;const o=r.split(Nj),d=o.length;for(let p=0;p"isThemeGetter"in e&&e.isThemeGetter===!0,Tte=e=>{if(e<1)return{get:()=>{},set:()=>{}};let r=0,s=Object.create(null),o=Object.create(null);const d=(p,m)=>{s[p]=m,r++,r>e&&(r=0,o=s,s=Object.create(null))};return{get(p){let m=s[p];if(m!==void 0)return m;if((m=o[p])!==void 0)return d(p,m),m},set(p,m){p in s?s[p]=m:d(p,m)}}},NT="!",GM=":",_te=[],XM=(e,r,s,o,d)=>({modifiers:e,hasImportantModifier:r,baseClassName:s,maybePostfixModifierPosition:o,isExternal:d}),$te=e=>{const{prefix:r,experimentalParseClassName:s}=e;let o=d=>{const p=[];let m=0,g=0,b=0,S;const E=d.length;for(let I=0;Ib?S-b:void 0;return XM(p,T,k,M)};if(r){const d=r+GM,p=o;o=m=>m.startsWith(d)?p(m.slice(d.length)):XM(_te,!1,m,void 0,!0)}if(s){const d=o;o=p=>s({className:p,parseClassName:d})}return o},Nte=e=>{const r=new Map;return e.orderSensitiveModifiers.forEach((s,o)=>{r.set(s,1e6+o)}),s=>{const o=[];let d=[];for(let p=0;p0&&(d.sort(),o.push(...d),d=[]),o.push(m)):d.push(m)}return d.length>0&&(d.sort(),o.push(...d)),o}},Dte=e=>({cache:Tte(e.cacheSize),parseClassName:$te(e),sortModifiers:Nte(e),...wte(e)}),Pte=/\s+/,Mte=(e,r)=>{const{parseClassName:s,getClassGroupId:o,getConflictingClassGroupIds:d,sortModifiers:p}=r,m=[],g=e.trim().split(Pte);let b="";for(let S=g.length-1;S>=0;S-=1){const E=g[S],{isExternal:A,modifiers:k,hasImportantModifier:T,baseClassName:M,maybePostfixModifierPosition:I}=s(E);if(A){b=E+(b.length>0?" "+b:b);continue}let q=!!I,G=o(q?M.substring(0,I):M);if(!G){if(!q){b=E+(b.length>0?" "+b:b);continue}if(G=o(M),!G){b=E+(b.length>0?" "+b:b);continue}q=!1}const K=k.length===0?"":k.length===1?k[0]:p(k).join(":"),X=T?K+NT:K,z=X+G;if(m.indexOf(z)>-1)continue;m.push(z);const ee=d(G,q);for(let oe=0;oe0?" "+b:b)}return b},Ite=(...e)=>{let r=0,s,o,d="";for(;r{if(typeof e=="string")return e;let r,s="";for(let o=0;o{let s,o,d,p;const m=b=>{const S=r.reduce((E,A)=>A(E),e());return s=Dte(S),o=s.cache.get,d=s.cache.set,p=g,g(b)},g=b=>{const S=o(b);if(S)return S;const E=Mte(b,s);return d(b,E),E};return p=m,(...b)=>p(Ite(...b))},Lte=[],ws=e=>{const r=s=>s[e]||Lte;return r.isThemeGetter=!0,r},wz=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Sz=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Fte=/^\d+\/\d+$/,qte=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Bte=/\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$/,Ute=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Kte=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Vte=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Km=e=>Fte.test(e),jn=e=>!!e&&!Number.isNaN(Number(e)),Nd=e=>!!e&&Number.isInteger(Number(e)),DR=e=>e.endsWith("%")&&jn(e.slice(0,-1)),lu=e=>qte.test(e),Hte=()=>!0,Gte=e=>Bte.test(e)&&!Ute.test(e),Ez=()=>!1,Xte=e=>Kte.test(e),Yte=e=>Vte.test(e),Zte=e=>!Mt(e)&&!It(e),Wte=e=>Ag(e,Az,Ez),Mt=e=>wz.test(e),fp=e=>Ag(e,Oz,Gte),PR=e=>Ag(e,nne,jn),YM=e=>Ag(e,jz,Ez),Jte=e=>Ag(e,Cz,Yte),HE=e=>Ag(e,kz,Xte),It=e=>Sz.test(e),rb=e=>Og(e,Oz),Qte=e=>Og(e,rne),ZM=e=>Og(e,jz),ene=e=>Og(e,Az),tne=e=>Og(e,Cz),GE=e=>Og(e,kz,!0),Ag=(e,r,s)=>{const o=wz.exec(e);return o?o[1]?r(o[1]):s(o[2]):!1},Og=(e,r,s=!1)=>{const o=Sz.exec(e);return o?o[1]?r(o[1]):s:!1},jz=e=>e==="position"||e==="percentage",Cz=e=>e==="image"||e==="url",Az=e=>e==="length"||e==="size"||e==="bg-size",Oz=e=>e==="length",nne=e=>e==="number",rne=e=>e==="family-name",kz=e=>e==="shadow",sne=()=>{const e=ws("color"),r=ws("font"),s=ws("text"),o=ws("font-weight"),d=ws("tracking"),p=ws("leading"),m=ws("breakpoint"),g=ws("container"),b=ws("spacing"),S=ws("radius"),E=ws("shadow"),A=ws("inset-shadow"),k=ws("text-shadow"),T=ws("drop-shadow"),M=ws("blur"),I=ws("perspective"),q=ws("aspect"),G=ws("ease"),K=ws("animate"),X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],ee=()=>[...z(),It,Mt],oe=()=>["auto","hidden","clip","visible","scroll"],Q=()=>["auto","contain","none"],ne=()=>[It,Mt,b],de=()=>[Km,"full","auto",...ne()],Ce=()=>[Nd,"none","subgrid",It,Mt],xe=()=>["auto",{span:["full",Nd,It,Mt]},Nd,It,Mt],le=()=>[Nd,"auto",It,Mt],be=()=>["auto","min","max","fr",It,Mt],je=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Ke=()=>["start","end","center","stretch","center-safe","end-safe"],ce=()=>["auto",...ne()],re=()=>[Km,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...ne()],ue=()=>[e,It,Mt],_e=()=>[...z(),ZM,YM,{position:[It,Mt]}],fe=()=>["no-repeat",{repeat:["","x","y","space","round"]}],He=()=>["auto","cover","contain",ene,Wte,{size:[It,Mt]}],Oe=()=>[DR,rb,fp],ke=()=>["","none","full",S,It,Mt],Ve=()=>["",jn,rb,fp],ie=()=>["solid","dashed","dotted","double"],Ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ze=()=>[jn,DR,ZM,YM],tt=()=>["","none",M,It,Mt],ft=()=>["none",jn,It,Mt],Ot=()=>["none",jn,It,Mt],Ft=()=>[jn,It,Mt],kt=()=>[Km,"full",...ne()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[lu],breakpoint:[lu],color:[Hte],container:[lu],"drop-shadow":[lu],ease:["in","out","in-out"],font:[Zte],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[lu],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[lu],shadow:[lu],spacing:["px",jn],text:[lu],"text-shadow":[lu],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Km,Mt,It,q]}],container:["container"],columns:[{columns:[jn,Mt,It,g]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:ee()}],overflow:[{overflow:oe()}],"overflow-x":[{"overflow-x":oe()}],"overflow-y":[{"overflow-y":oe()}],overscroll:[{overscroll:Q()}],"overscroll-x":[{"overscroll-x":Q()}],"overscroll-y":[{"overscroll-y":Q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:de()}],"inset-x":[{"inset-x":de()}],"inset-y":[{"inset-y":de()}],start:[{start:de()}],end:[{end:de()}],top:[{top:de()}],right:[{right:de()}],bottom:[{bottom:de()}],left:[{left:de()}],visibility:["visible","invisible","collapse"],z:[{z:[Nd,"auto",It,Mt]}],basis:[{basis:[Km,"full","auto",g,...ne()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[jn,Km,"auto","initial","none",Mt]}],grow:[{grow:["",jn,It,Mt]}],shrink:[{shrink:["",jn,It,Mt]}],order:[{order:[Nd,"first","last","none",It,Mt]}],"grid-cols":[{"grid-cols":Ce()}],"col-start-end":[{col:xe()}],"col-start":[{"col-start":le()}],"col-end":[{"col-end":le()}],"grid-rows":[{"grid-rows":Ce()}],"row-start-end":[{row:xe()}],"row-start":[{"row-start":le()}],"row-end":[{"row-end":le()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":be()}],"auto-rows":[{"auto-rows":be()}],gap:[{gap:ne()}],"gap-x":[{"gap-x":ne()}],"gap-y":[{"gap-y":ne()}],"justify-content":[{justify:[...je(),"normal"]}],"justify-items":[{"justify-items":[...Ke(),"normal"]}],"justify-self":[{"justify-self":["auto",...Ke()]}],"align-content":[{content:["normal",...je()]}],"align-items":[{items:[...Ke(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Ke(),{baseline:["","last"]}]}],"place-content":[{"place-content":je()}],"place-items":[{"place-items":[...Ke(),"baseline"]}],"place-self":[{"place-self":["auto",...Ke()]}],p:[{p:ne()}],px:[{px:ne()}],py:[{py:ne()}],ps:[{ps:ne()}],pe:[{pe:ne()}],pt:[{pt:ne()}],pr:[{pr:ne()}],pb:[{pb:ne()}],pl:[{pl:ne()}],m:[{m:ce()}],mx:[{mx:ce()}],my:[{my:ce()}],ms:[{ms:ce()}],me:[{me:ce()}],mt:[{mt:ce()}],mr:[{mr:ce()}],mb:[{mb:ce()}],ml:[{ml:ce()}],"space-x":[{"space-x":ne()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":ne()}],"space-y-reverse":["space-y-reverse"],size:[{size:re()}],w:[{w:[g,"screen",...re()]}],"min-w":[{"min-w":[g,"screen","none",...re()]}],"max-w":[{"max-w":[g,"screen","none","prose",{screen:[m]},...re()]}],h:[{h:["screen","lh",...re()]}],"min-h":[{"min-h":["screen","lh","none",...re()]}],"max-h":[{"max-h":["screen","lh",...re()]}],"font-size":[{text:["base",s,rb,fp]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,It,PR]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",DR,Mt]}],"font-family":[{font:[Qte,Mt,r]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[d,It,Mt]}],"line-clamp":[{"line-clamp":[jn,"none",It,PR]}],leading:[{leading:[p,...ne()]}],"list-image":[{"list-image":["none",It,Mt]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",It,Mt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:ue()}],"text-color":[{text:ue()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ie(),"wavy"]}],"text-decoration-thickness":[{decoration:[jn,"from-font","auto",It,fp]}],"text-decoration-color":[{decoration:ue()}],"underline-offset":[{"underline-offset":[jn,"auto",It,Mt]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:ne()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",It,Mt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",It,Mt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:_e()}],"bg-repeat":[{bg:fe()}],"bg-size":[{bg:He()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Nd,It,Mt],radial:["",It,Mt],conic:[Nd,It,Mt]},tne,Jte]}],"bg-color":[{bg:ue()}],"gradient-from-pos":[{from:Oe()}],"gradient-via-pos":[{via:Oe()}],"gradient-to-pos":[{to:Oe()}],"gradient-from":[{from:ue()}],"gradient-via":[{via:ue()}],"gradient-to":[{to:ue()}],rounded:[{rounded:ke()}],"rounded-s":[{"rounded-s":ke()}],"rounded-e":[{"rounded-e":ke()}],"rounded-t":[{"rounded-t":ke()}],"rounded-r":[{"rounded-r":ke()}],"rounded-b":[{"rounded-b":ke()}],"rounded-l":[{"rounded-l":ke()}],"rounded-ss":[{"rounded-ss":ke()}],"rounded-se":[{"rounded-se":ke()}],"rounded-ee":[{"rounded-ee":ke()}],"rounded-es":[{"rounded-es":ke()}],"rounded-tl":[{"rounded-tl":ke()}],"rounded-tr":[{"rounded-tr":ke()}],"rounded-br":[{"rounded-br":ke()}],"rounded-bl":[{"rounded-bl":ke()}],"border-w":[{border:Ve()}],"border-w-x":[{"border-x":Ve()}],"border-w-y":[{"border-y":Ve()}],"border-w-s":[{"border-s":Ve()}],"border-w-e":[{"border-e":Ve()}],"border-w-t":[{"border-t":Ve()}],"border-w-r":[{"border-r":Ve()}],"border-w-b":[{"border-b":Ve()}],"border-w-l":[{"border-l":Ve()}],"divide-x":[{"divide-x":Ve()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Ve()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ie(),"hidden","none"]}],"divide-style":[{divide:[...ie(),"hidden","none"]}],"border-color":[{border:ue()}],"border-color-x":[{"border-x":ue()}],"border-color-y":[{"border-y":ue()}],"border-color-s":[{"border-s":ue()}],"border-color-e":[{"border-e":ue()}],"border-color-t":[{"border-t":ue()}],"border-color-r":[{"border-r":ue()}],"border-color-b":[{"border-b":ue()}],"border-color-l":[{"border-l":ue()}],"divide-color":[{divide:ue()}],"outline-style":[{outline:[...ie(),"none","hidden"]}],"outline-offset":[{"outline-offset":[jn,It,Mt]}],"outline-w":[{outline:["",jn,rb,fp]}],"outline-color":[{outline:ue()}],shadow:[{shadow:["","none",E,GE,HE]}],"shadow-color":[{shadow:ue()}],"inset-shadow":[{"inset-shadow":["none",A,GE,HE]}],"inset-shadow-color":[{"inset-shadow":ue()}],"ring-w":[{ring:Ve()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:ue()}],"ring-offset-w":[{"ring-offset":[jn,fp]}],"ring-offset-color":[{"ring-offset":ue()}],"inset-ring-w":[{"inset-ring":Ve()}],"inset-ring-color":[{"inset-ring":ue()}],"text-shadow":[{"text-shadow":["none",k,GE,HE]}],"text-shadow-color":[{"text-shadow":ue()}],opacity:[{opacity:[jn,It,Mt]}],"mix-blend":[{"mix-blend":[...Ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ne()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[jn]}],"mask-image-linear-from-pos":[{"mask-linear-from":ze()}],"mask-image-linear-to-pos":[{"mask-linear-to":ze()}],"mask-image-linear-from-color":[{"mask-linear-from":ue()}],"mask-image-linear-to-color":[{"mask-linear-to":ue()}],"mask-image-t-from-pos":[{"mask-t-from":ze()}],"mask-image-t-to-pos":[{"mask-t-to":ze()}],"mask-image-t-from-color":[{"mask-t-from":ue()}],"mask-image-t-to-color":[{"mask-t-to":ue()}],"mask-image-r-from-pos":[{"mask-r-from":ze()}],"mask-image-r-to-pos":[{"mask-r-to":ze()}],"mask-image-r-from-color":[{"mask-r-from":ue()}],"mask-image-r-to-color":[{"mask-r-to":ue()}],"mask-image-b-from-pos":[{"mask-b-from":ze()}],"mask-image-b-to-pos":[{"mask-b-to":ze()}],"mask-image-b-from-color":[{"mask-b-from":ue()}],"mask-image-b-to-color":[{"mask-b-to":ue()}],"mask-image-l-from-pos":[{"mask-l-from":ze()}],"mask-image-l-to-pos":[{"mask-l-to":ze()}],"mask-image-l-from-color":[{"mask-l-from":ue()}],"mask-image-l-to-color":[{"mask-l-to":ue()}],"mask-image-x-from-pos":[{"mask-x-from":ze()}],"mask-image-x-to-pos":[{"mask-x-to":ze()}],"mask-image-x-from-color":[{"mask-x-from":ue()}],"mask-image-x-to-color":[{"mask-x-to":ue()}],"mask-image-y-from-pos":[{"mask-y-from":ze()}],"mask-image-y-to-pos":[{"mask-y-to":ze()}],"mask-image-y-from-color":[{"mask-y-from":ue()}],"mask-image-y-to-color":[{"mask-y-to":ue()}],"mask-image-radial":[{"mask-radial":[It,Mt]}],"mask-image-radial-from-pos":[{"mask-radial-from":ze()}],"mask-image-radial-to-pos":[{"mask-radial-to":ze()}],"mask-image-radial-from-color":[{"mask-radial-from":ue()}],"mask-image-radial-to-color":[{"mask-radial-to":ue()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":z()}],"mask-image-conic-pos":[{"mask-conic":[jn]}],"mask-image-conic-from-pos":[{"mask-conic-from":ze()}],"mask-image-conic-to-pos":[{"mask-conic-to":ze()}],"mask-image-conic-from-color":[{"mask-conic-from":ue()}],"mask-image-conic-to-color":[{"mask-conic-to":ue()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:_e()}],"mask-repeat":[{mask:fe()}],"mask-size":[{mask:He()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",It,Mt]}],filter:[{filter:["","none",It,Mt]}],blur:[{blur:tt()}],brightness:[{brightness:[jn,It,Mt]}],contrast:[{contrast:[jn,It,Mt]}],"drop-shadow":[{"drop-shadow":["","none",T,GE,HE]}],"drop-shadow-color":[{"drop-shadow":ue()}],grayscale:[{grayscale:["",jn,It,Mt]}],"hue-rotate":[{"hue-rotate":[jn,It,Mt]}],invert:[{invert:["",jn,It,Mt]}],saturate:[{saturate:[jn,It,Mt]}],sepia:[{sepia:["",jn,It,Mt]}],"backdrop-filter":[{"backdrop-filter":["","none",It,Mt]}],"backdrop-blur":[{"backdrop-blur":tt()}],"backdrop-brightness":[{"backdrop-brightness":[jn,It,Mt]}],"backdrop-contrast":[{"backdrop-contrast":[jn,It,Mt]}],"backdrop-grayscale":[{"backdrop-grayscale":["",jn,It,Mt]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[jn,It,Mt]}],"backdrop-invert":[{"backdrop-invert":["",jn,It,Mt]}],"backdrop-opacity":[{"backdrop-opacity":[jn,It,Mt]}],"backdrop-saturate":[{"backdrop-saturate":[jn,It,Mt]}],"backdrop-sepia":[{"backdrop-sepia":["",jn,It,Mt]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":ne()}],"border-spacing-x":[{"border-spacing-x":ne()}],"border-spacing-y":[{"border-spacing-y":ne()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",It,Mt]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[jn,"initial",It,Mt]}],ease:[{ease:["linear","initial",G,It,Mt]}],delay:[{delay:[jn,It,Mt]}],animate:[{animate:["none",K,It,Mt]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[I,It,Mt]}],"perspective-origin":[{"perspective-origin":ee()}],rotate:[{rotate:ft()}],"rotate-x":[{"rotate-x":ft()}],"rotate-y":[{"rotate-y":ft()}],"rotate-z":[{"rotate-z":ft()}],scale:[{scale:Ot()}],"scale-x":[{"scale-x":Ot()}],"scale-y":[{"scale-y":Ot()}],"scale-z":[{"scale-z":Ot()}],"scale-3d":["scale-3d"],skew:[{skew:Ft()}],"skew-x":[{"skew-x":Ft()}],"skew-y":[{"skew-y":Ft()}],transform:[{transform:[It,Mt,"","none","gpu","cpu"]}],"transform-origin":[{origin:ee()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:kt()}],"translate-x":[{"translate-x":kt()}],"translate-y":[{"translate-y":kt()}],"translate-z":[{"translate-z":kt()}],"translate-none":["translate-none"],accent:[{accent:ue()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:ue()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",It,Mt]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ne()}],"scroll-mx":[{"scroll-mx":ne()}],"scroll-my":[{"scroll-my":ne()}],"scroll-ms":[{"scroll-ms":ne()}],"scroll-me":[{"scroll-me":ne()}],"scroll-mt":[{"scroll-mt":ne()}],"scroll-mr":[{"scroll-mr":ne()}],"scroll-mb":[{"scroll-mb":ne()}],"scroll-ml":[{"scroll-ml":ne()}],"scroll-p":[{"scroll-p":ne()}],"scroll-px":[{"scroll-px":ne()}],"scroll-py":[{"scroll-py":ne()}],"scroll-ps":[{"scroll-ps":ne()}],"scroll-pe":[{"scroll-pe":ne()}],"scroll-pt":[{"scroll-pt":ne()}],"scroll-pr":[{"scroll-pr":ne()}],"scroll-pb":[{"scroll-pb":ne()}],"scroll-pl":[{"scroll-pl":ne()}],"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",It,Mt]}],fill:[{fill:["none",...ue()]}],"stroke-w":[{stroke:[jn,rb,fp,PR]}],stroke:[{stroke:["none",...ue()]}],"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-x","border-w-y","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-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},ine=zte(sne);function ht(...e){return ine(gz(e))}function el(e,r=24){return!e||e.length<=r*2+3?e:`${e.slice(0,r)}…${e.slice(-r)}`}const ane=B_("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function rs({className:e,variant:r,asChild:s=!1,...o}){const d=s?Cg:"span";return u.jsx(d,{"data-slot":"badge",className:ht(ane({variant:r}),e),...o})}const K_=B_("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Fe({className:e,variant:r,size:s,asChild:o=!1,...d}){const p=o?Cg:"button";return u.jsx(p,{"data-slot":"button",className:ht(K_({variant:r,size:s,className:e})),...d})}var one=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],lne=one.reduce((e,r)=>{const s=tw(`Primitive.${r}`),o=R.forwardRef((d,p)=>{const{asChild:m,...g}=d,b=m?s:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(b,{...g,ref:p})});return o.displayName=`Primitive.${r}`,{...e,[r]:o}},{}),cne="Separator",WM="horizontal",une=["horizontal","vertical"],Rz=R.forwardRef((e,r)=>{const{decorative:s,orientation:o=WM,...d}=e,p=dne(o)?o:WM,g=s?{role:"none"}:{"aria-orientation":p==="vertical"?p:void 0,role:"separator"};return u.jsx(lne.div,{"data-orientation":p,...g,...d,ref:r})});Rz.displayName=cne;function dne(e){return une.includes(e)}var hne=Rz;function bb({className:e,orientation:r="horizontal",decorative:s=!0,...o}){return u.jsx(hne,{"data-slot":"separator",decorative:s,orientation:r,className:ht("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...o})}function $t(e,r,{checkForDefaultPrevented:s=!0}={}){return function(d){if(e?.(d),s===!1||!d.defaultPrevented)return r?.(d)}}function pne(e,r){const s=R.createContext(r),o=p=>{const{children:m,...g}=p,b=R.useMemo(()=>g,Object.values(g));return u.jsx(s.Provider,{value:b,children:m})};o.displayName=e+"Provider";function d(p){const m=R.useContext(s);if(m)return m;if(r!==void 0)return r;throw new Error(`\`${p}\` must be used within \`${e}\``)}return[o,d]}function al(e,r=[]){let s=[];function o(p,m){const g=R.createContext(m),b=s.length;s=[...s,m];const S=A=>{const{scope:k,children:T,...M}=A,I=k?.[e]?.[b]||g,q=R.useMemo(()=>M,Object.values(M));return u.jsx(I.Provider,{value:q,children:T})};S.displayName=p+"Provider";function E(A,k){const T=k?.[e]?.[b]||g,M=R.useContext(T);if(M)return M;if(m!==void 0)return m;throw new Error(`\`${A}\` must be used within \`${p}\``)}return[S,E]}const d=()=>{const p=s.map(m=>R.createContext(m));return function(g){const b=g?.[e]||p;return R.useMemo(()=>({[`__scope${e}`]:{...g,[e]:b}}),[g,b])}};return d.scopeName=e,[o,fne(d,...r)]}function fne(...e){const r=e[0];if(e.length===1)return r;const s=()=>{const o=e.map(d=>({useScope:d(),scopeName:d.scopeName}));return function(p){const m=o.reduce((g,{useScope:b,scopeName:S})=>{const A=b(p)[`__scope${S}`];return{...g,...A}},{});return R.useMemo(()=>({[`__scope${r.scopeName}`]:m}),[m])}};return s.scopeName=r.scopeName,s}function mne(e){const r=gne(e),s=R.forwardRef((o,d)=>{const{children:p,...m}=o,g=R.Children.toArray(p),b=g.find(vne);if(b){const S=b.props.children,E=g.map(A=>A===b?R.Children.count(S)>1?R.Children.only(null):R.isValidElement(S)?S.props.children:null:A);return u.jsx(r,{...m,ref:d,children:R.isValidElement(S)?R.cloneElement(S,void 0,E):null})}return u.jsx(r,{...m,ref:d,children:p})});return s.displayName=`${e}.Slot`,s}function gne(e){const r=R.forwardRef((s,o)=>{const{children:d,...p}=s;if(R.isValidElement(d)){const m=bne(d),g=xne(p,d.props);return d.type!==R.Fragment&&(g.ref=o?zi(o,m):m),R.cloneElement(d,g)}return R.Children.count(d)>1?R.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var yne=Symbol("radix.slottable");function vne(e){return R.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===yne}function xne(e,r){const s={...r};for(const o in r){const d=e[o],p=r[o];/^on[A-Z]/.test(o)?d&&p?s[o]=(...g)=>{const b=p(...g);return d(...g),b}:d&&(s[o]=d):o==="style"?s[o]={...d,...p}:o==="className"&&(s[o]=[d,p].filter(Boolean).join(" "))}return{...e,...s}}function bne(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning;return s?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var wne=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Cn=wne.reduce((e,r)=>{const s=mne(`Primitive.${r}`),o=R.forwardRef((d,p)=>{const{asChild:m,...g}=d,b=m?s:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(b,{...g,ref:p})});return o.displayName=`Primitive.${r}`,{...e,[r]:o}},{});function Tz(e,r){e&&mC.flushSync(()=>e.dispatchEvent(r))}function tl(e){const r=R.useRef(e);return R.useEffect(()=>{r.current=e}),R.useMemo(()=>(...s)=>r.current?.(...s),[])}function Sne(e,r=globalThis?.document){const s=tl(e);R.useEffect(()=>{const o=d=>{d.key==="Escape"&&s(d)};return r.addEventListener("keydown",o,{capture:!0}),()=>r.removeEventListener("keydown",o,{capture:!0})},[s,r])}var Ene="DismissableLayer",DT="dismissableLayer.update",jne="dismissableLayer.pointerDownOutside",Cne="dismissableLayer.focusOutside",JM,_z=R.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),kg=R.forwardRef((e,r)=>{const{disableOutsidePointerEvents:s=!1,onEscapeKeyDown:o,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:m,onDismiss:g,...b}=e,S=R.useContext(_z),[E,A]=R.useState(null),k=E?.ownerDocument??globalThis?.document,[,T]=R.useState({}),M=Ln(r,Q=>A(Q)),I=Array.from(S.layers),[q]=[...S.layersWithOutsidePointerEventsDisabled].slice(-1),G=I.indexOf(q),K=E?I.indexOf(E):-1,X=S.layersWithOutsidePointerEventsDisabled.size>0,z=K>=G,ee=kne(Q=>{const ne=Q.target,de=[...S.branches].some(Ce=>Ce.contains(ne));!z||de||(d?.(Q),m?.(Q),Q.defaultPrevented||g?.())},k),oe=Rne(Q=>{const ne=Q.target;[...S.branches].some(Ce=>Ce.contains(ne))||(p?.(Q),m?.(Q),Q.defaultPrevented||g?.())},k);return Sne(Q=>{K===S.layers.size-1&&(o?.(Q),!Q.defaultPrevented&&g&&(Q.preventDefault(),g()))},k),R.useEffect(()=>{if(E)return s&&(S.layersWithOutsidePointerEventsDisabled.size===0&&(JM=k.body.style.pointerEvents,k.body.style.pointerEvents="none"),S.layersWithOutsidePointerEventsDisabled.add(E)),S.layers.add(E),QM(),()=>{s&&S.layersWithOutsidePointerEventsDisabled.size===1&&(k.body.style.pointerEvents=JM)}},[E,k,s,S]),R.useEffect(()=>()=>{E&&(S.layers.delete(E),S.layersWithOutsidePointerEventsDisabled.delete(E),QM())},[E,S]),R.useEffect(()=>{const Q=()=>T({});return document.addEventListener(DT,Q),()=>document.removeEventListener(DT,Q)},[]),u.jsx(Cn.div,{...b,ref:M,style:{pointerEvents:X?z?"auto":"none":void 0,...e.style},onFocusCapture:$t(e.onFocusCapture,oe.onFocusCapture),onBlurCapture:$t(e.onBlurCapture,oe.onBlurCapture),onPointerDownCapture:$t(e.onPointerDownCapture,ee.onPointerDownCapture)})});kg.displayName=Ene;var Ane="DismissableLayerBranch",One=R.forwardRef((e,r)=>{const s=R.useContext(_z),o=R.useRef(null),d=Ln(r,o);return R.useEffect(()=>{const p=o.current;if(p)return s.branches.add(p),()=>{s.branches.delete(p)}},[s.branches]),u.jsx(Cn.div,{...e,ref:d})});One.displayName=Ane;function kne(e,r=globalThis?.document){const s=tl(e),o=R.useRef(!1),d=R.useRef(()=>{});return R.useEffect(()=>{const p=g=>{if(g.target&&!o.current){let b=function(){$z(jne,s,S,{discrete:!0})};const S={originalEvent:g};g.pointerType==="touch"?(r.removeEventListener("click",d.current),d.current=b,r.addEventListener("click",d.current,{once:!0})):b()}else r.removeEventListener("click",d.current);o.current=!1},m=window.setTimeout(()=>{r.addEventListener("pointerdown",p)},0);return()=>{window.clearTimeout(m),r.removeEventListener("pointerdown",p),r.removeEventListener("click",d.current)}},[r,s]),{onPointerDownCapture:()=>o.current=!0}}function Rne(e,r=globalThis?.document){const s=tl(e),o=R.useRef(!1);return R.useEffect(()=>{const d=p=>{p.target&&!o.current&&$z(Cne,s,{originalEvent:p},{discrete:!1})};return r.addEventListener("focusin",d),()=>r.removeEventListener("focusin",d)},[r,s]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function QM(){const e=new CustomEvent(DT);document.dispatchEvent(e)}function $z(e,r,s,{discrete:o}){const d=s.originalEvent.target,p=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:s});r&&d.addEventListener(e,r,{once:!0}),o?Tz(d,p):d.dispatchEvent(p)}var As=globalThis?.document?R.useLayoutEffect:()=>{},Tne=R_[" useId ".trim().toString()]||(()=>{}),_ne=0;function Vs(e){const[r,s]=R.useState(Tne());return As(()=>{s(o=>o??String(_ne++))},[e]),r?`radix-${r}`:""}const $ne=["top","right","bottom","left"],Ld=Math.min,_a=Math.max,Dj=Math.round,XE=Math.floor,sc=e=>({x:e,y:e}),Nne={left:"right",right:"left",bottom:"top",top:"bottom"},Dne={start:"end",end:"start"};function PT(e,r,s){return _a(e,Ld(r,s))}function fu(e,r){return typeof e=="function"?e(r):e}function mu(e){return e.split("-")[0]}function Rg(e){return e.split("-")[1]}function V_(e){return e==="x"?"y":"x"}function H_(e){return e==="y"?"height":"width"}const Pne=new Set(["top","bottom"]);function rc(e){return Pne.has(mu(e))?"y":"x"}function G_(e){return V_(rc(e))}function Mne(e,r,s){s===void 0&&(s=!1);const o=Rg(e),d=G_(e),p=H_(d);let m=d==="x"?o===(s?"end":"start")?"right":"left":o==="start"?"bottom":"top";return r.reference[p]>r.floating[p]&&(m=Pj(m)),[m,Pj(m)]}function Ine(e){const r=Pj(e);return[MT(e),r,MT(r)]}function MT(e){return e.replace(/start|end/g,r=>Dne[r])}const eI=["left","right"],tI=["right","left"],zne=["top","bottom"],Lne=["bottom","top"];function Fne(e,r,s){switch(e){case"top":case"bottom":return s?r?tI:eI:r?eI:tI;case"left":case"right":return r?zne:Lne;default:return[]}}function qne(e,r,s,o){const d=Rg(e);let p=Fne(mu(e),s==="start",o);return d&&(p=p.map(m=>m+"-"+d),r&&(p=p.concat(p.map(MT)))),p}function Pj(e){return e.replace(/left|right|bottom|top/g,r=>Nne[r])}function Bne(e){return{top:0,right:0,bottom:0,left:0,...e}}function Nz(e){return typeof e!="number"?Bne(e):{top:e,right:e,bottom:e,left:e}}function Mj(e){const{x:r,y:s,width:o,height:d}=e;return{width:o,height:d,top:s,left:r,right:r+o,bottom:s+d,x:r,y:s}}function nI(e,r,s){let{reference:o,floating:d}=e;const p=rc(r),m=G_(r),g=H_(m),b=mu(r),S=p==="y",E=o.x+o.width/2-d.width/2,A=o.y+o.height/2-d.height/2,k=o[g]/2-d[g]/2;let T;switch(b){case"top":T={x:E,y:o.y-d.height};break;case"bottom":T={x:E,y:o.y+o.height};break;case"right":T={x:o.x+o.width,y:A};break;case"left":T={x:o.x-d.width,y:A};break;default:T={x:o.x,y:o.y}}switch(Rg(r)){case"start":T[m]-=k*(s&&S?-1:1);break;case"end":T[m]+=k*(s&&S?-1:1);break}return T}const Une=async(e,r,s)=>{const{placement:o="bottom",strategy:d="absolute",middleware:p=[],platform:m}=s,g=p.filter(Boolean),b=await(m.isRTL==null?void 0:m.isRTL(r));let S=await m.getElementRects({reference:e,floating:r,strategy:d}),{x:E,y:A}=nI(S,o,b),k=o,T={},M=0;for(let I=0;I({name:"arrow",options:e,async fn(r){const{x:s,y:o,placement:d,rects:p,platform:m,elements:g,middlewareData:b}=r,{element:S,padding:E=0}=fu(e,r)||{};if(S==null)return{};const A=Nz(E),k={x:s,y:o},T=G_(d),M=H_(T),I=await m.getDimensions(S),q=T==="y",G=q?"top":"left",K=q?"bottom":"right",X=q?"clientHeight":"clientWidth",z=p.reference[M]+p.reference[T]-k[T]-p.floating[M],ee=k[T]-p.reference[T],oe=await(m.getOffsetParent==null?void 0:m.getOffsetParent(S));let Q=oe?oe[X]:0;(!Q||!await(m.isElement==null?void 0:m.isElement(oe)))&&(Q=g.floating[X]||p.floating[M]);const ne=z/2-ee/2,de=Q/2-I[M]/2-1,Ce=Ld(A[G],de),xe=Ld(A[K],de),le=Ce,be=Q-I[M]-xe,je=Q/2-I[M]/2+ne,Ke=PT(le,je,be),ce=!b.arrow&&Rg(d)!=null&&je!==Ke&&p.reference[M]/2-(jeje<=0)){var xe,le;const je=(((xe=p.flip)==null?void 0:xe.index)||0)+1,Ke=Q[je];if(Ke&&(!(A==="alignment"?K!==rc(Ke):!1)||Ce.every(ue=>rc(ue.placement)===K?ue.overflows[0]>0:!0)))return{data:{index:je,overflows:Ce},reset:{placement:Ke}};let ce=(le=Ce.filter(re=>re.overflows[0]<=0).sort((re,ue)=>re.overflows[1]-ue.overflows[1])[0])==null?void 0:le.placement;if(!ce)switch(T){case"bestFit":{var be;const re=(be=Ce.filter(ue=>{if(oe){const _e=rc(ue.placement);return _e===K||_e==="y"}return!0}).map(ue=>[ue.placement,ue.overflows.filter(_e=>_e>0).reduce((_e,fe)=>_e+fe,0)]).sort((ue,_e)=>ue[1]-_e[1])[0])==null?void 0:be[0];re&&(ce=re);break}case"initialPlacement":ce=g;break}if(d!==ce)return{reset:{placement:ce}}}return{}}}};function rI(e,r){return{top:e.top-r.height,right:e.right-r.width,bottom:e.bottom-r.height,left:e.left-r.width}}function sI(e){return $ne.some(r=>e[r]>=0)}const Hne=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(r){const{rects:s}=r,{strategy:o="referenceHidden",...d}=fu(e,r);switch(o){case"referenceHidden":{const p=await Lb(r,{...d,elementContext:"reference"}),m=rI(p,s.reference);return{data:{referenceHiddenOffsets:m,referenceHidden:sI(m)}}}case"escaped":{const p=await Lb(r,{...d,altBoundary:!0}),m=rI(p,s.floating);return{data:{escapedOffsets:m,escaped:sI(m)}}}default:return{}}}}},Dz=new Set(["left","top"]);async function Gne(e,r){const{placement:s,platform:o,elements:d}=e,p=await(o.isRTL==null?void 0:o.isRTL(d.floating)),m=mu(s),g=Rg(s),b=rc(s)==="y",S=Dz.has(m)?-1:1,E=p&&b?-1:1,A=fu(r,e);let{mainAxis:k,crossAxis:T,alignmentAxis:M}=typeof A=="number"?{mainAxis:A,crossAxis:0,alignmentAxis:null}:{mainAxis:A.mainAxis||0,crossAxis:A.crossAxis||0,alignmentAxis:A.alignmentAxis};return g&&typeof M=="number"&&(T=g==="end"?M*-1:M),b?{x:T*E,y:k*S}:{x:k*S,y:T*E}}const Xne=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(r){var s,o;const{x:d,y:p,placement:m,middlewareData:g}=r,b=await Gne(r,e);return m===((s=g.offset)==null?void 0:s.placement)&&(o=g.arrow)!=null&&o.alignmentOffset?{}:{x:d+b.x,y:p+b.y,data:{...b,placement:m}}}}},Yne=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(r){const{x:s,y:o,placement:d}=r,{mainAxis:p=!0,crossAxis:m=!1,limiter:g={fn:q=>{let{x:G,y:K}=q;return{x:G,y:K}}},...b}=fu(e,r),S={x:s,y:o},E=await Lb(r,b),A=rc(mu(d)),k=V_(A);let T=S[k],M=S[A];if(p){const q=k==="y"?"top":"left",G=k==="y"?"bottom":"right",K=T+E[q],X=T-E[G];T=PT(K,T,X)}if(m){const q=A==="y"?"top":"left",G=A==="y"?"bottom":"right",K=M+E[q],X=M-E[G];M=PT(K,M,X)}const I=g.fn({...r,[k]:T,[A]:M});return{...I,data:{x:I.x-s,y:I.y-o,enabled:{[k]:p,[A]:m}}}}}},Zne=function(e){return e===void 0&&(e={}),{options:e,fn(r){const{x:s,y:o,placement:d,rects:p,middlewareData:m}=r,{offset:g=0,mainAxis:b=!0,crossAxis:S=!0}=fu(e,r),E={x:s,y:o},A=rc(d),k=V_(A);let T=E[k],M=E[A];const I=fu(g,r),q=typeof I=="number"?{mainAxis:I,crossAxis:0}:{mainAxis:0,crossAxis:0,...I};if(b){const X=k==="y"?"height":"width",z=p.reference[k]-p.floating[X]+q.mainAxis,ee=p.reference[k]+p.reference[X]-q.mainAxis;Tee&&(T=ee)}if(S){var G,K;const X=k==="y"?"width":"height",z=Dz.has(mu(d)),ee=p.reference[A]-p.floating[X]+(z&&((G=m.offset)==null?void 0:G[A])||0)+(z?0:q.crossAxis),oe=p.reference[A]+p.reference[X]+(z?0:((K=m.offset)==null?void 0:K[A])||0)-(z?q.crossAxis:0);Moe&&(M=oe)}return{[k]:T,[A]:M}}}},Wne=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(r){var s,o;const{placement:d,rects:p,platform:m,elements:g}=r,{apply:b=()=>{},...S}=fu(e,r),E=await Lb(r,S),A=mu(d),k=Rg(d),T=rc(d)==="y",{width:M,height:I}=p.floating;let q,G;A==="top"||A==="bottom"?(q=A,G=k===(await(m.isRTL==null?void 0:m.isRTL(g.floating))?"start":"end")?"left":"right"):(G=A,q=k==="end"?"top":"bottom");const K=I-E.top-E.bottom,X=M-E.left-E.right,z=Ld(I-E[q],K),ee=Ld(M-E[G],X),oe=!r.middlewareData.shift;let Q=z,ne=ee;if((s=r.middlewareData.shift)!=null&&s.enabled.x&&(ne=X),(o=r.middlewareData.shift)!=null&&o.enabled.y&&(Q=K),oe&&!k){const Ce=_a(E.left,0),xe=_a(E.right,0),le=_a(E.top,0),be=_a(E.bottom,0);T?ne=M-2*(Ce!==0||xe!==0?Ce+xe:_a(E.left,E.right)):Q=I-2*(le!==0||be!==0?le+be:_a(E.top,E.bottom))}await b({...r,availableWidth:ne,availableHeight:Q});const de=await m.getDimensions(g.floating);return M!==de.width||I!==de.height?{reset:{rects:!0}}:{}}}};function vC(){return typeof window<"u"}function Tg(e){return Pz(e)?(e.nodeName||"").toLowerCase():"#document"}function Na(e){var r;return(e==null||(r=e.ownerDocument)==null?void 0:r.defaultView)||window}function lc(e){var r;return(r=(Pz(e)?e.ownerDocument:e.document)||window.document)==null?void 0:r.documentElement}function Pz(e){return vC()?e instanceof Node||e instanceof Na(e).Node:!1}function nl(e){return vC()?e instanceof Element||e instanceof Na(e).Element:!1}function oc(e){return vC()?e instanceof HTMLElement||e instanceof Na(e).HTMLElement:!1}function iI(e){return!vC()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Na(e).ShadowRoot}const Jne=new Set(["inline","contents"]);function nw(e){const{overflow:r,overflowX:s,overflowY:o,display:d}=rl(e);return/auto|scroll|overlay|hidden|clip/.test(r+o+s)&&!Jne.has(d)}const Qne=new Set(["table","td","th"]);function ere(e){return Qne.has(Tg(e))}const tre=[":popover-open",":modal"];function xC(e){return tre.some(r=>{try{return e.matches(r)}catch{return!1}})}const nre=["transform","translate","scale","rotate","perspective"],rre=["transform","translate","scale","rotate","perspective","filter"],sre=["paint","layout","strict","content"];function X_(e){const r=Y_(),s=nl(e)?rl(e):e;return nre.some(o=>s[o]?s[o]!=="none":!1)||(s.containerType?s.containerType!=="normal":!1)||!r&&(s.backdropFilter?s.backdropFilter!=="none":!1)||!r&&(s.filter?s.filter!=="none":!1)||rre.some(o=>(s.willChange||"").includes(o))||sre.some(o=>(s.contain||"").includes(o))}function ire(e){let r=Fd(e);for(;oc(r)&&!vg(r);){if(X_(r))return r;if(xC(r))return null;r=Fd(r)}return null}function Y_(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const are=new Set(["html","body","#document"]);function vg(e){return are.has(Tg(e))}function rl(e){return Na(e).getComputedStyle(e)}function bC(e){return nl(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Fd(e){if(Tg(e)==="html")return e;const r=e.assignedSlot||e.parentNode||iI(e)&&e.host||lc(e);return iI(r)?r.host:r}function Mz(e){const r=Fd(e);return vg(r)?e.ownerDocument?e.ownerDocument.body:e.body:oc(r)&&nw(r)?r:Mz(r)}function Fb(e,r,s){var o;r===void 0&&(r=[]),s===void 0&&(s=!0);const d=Mz(e),p=d===((o=e.ownerDocument)==null?void 0:o.body),m=Na(d);if(p){const g=IT(m);return r.concat(m,m.visualViewport||[],nw(d)?d:[],g&&s?Fb(g):[])}return r.concat(d,Fb(d,[],s))}function IT(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Iz(e){const r=rl(e);let s=parseFloat(r.width)||0,o=parseFloat(r.height)||0;const d=oc(e),p=d?e.offsetWidth:s,m=d?e.offsetHeight:o,g=Dj(s)!==p||Dj(o)!==m;return g&&(s=p,o=m),{width:s,height:o,$:g}}function Z_(e){return nl(e)?e:e.contextElement}function pg(e){const r=Z_(e);if(!oc(r))return sc(1);const s=r.getBoundingClientRect(),{width:o,height:d,$:p}=Iz(r);let m=(p?Dj(s.width):s.width)/o,g=(p?Dj(s.height):s.height)/d;return(!m||!Number.isFinite(m))&&(m=1),(!g||!Number.isFinite(g))&&(g=1),{x:m,y:g}}const ore=sc(0);function zz(e){const r=Na(e);return!Y_()||!r.visualViewport?ore:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function lre(e,r,s){return r===void 0&&(r=!1),!s||r&&s!==Na(e)?!1:r}function Op(e,r,s,o){r===void 0&&(r=!1),s===void 0&&(s=!1);const d=e.getBoundingClientRect(),p=Z_(e);let m=sc(1);r&&(o?nl(o)&&(m=pg(o)):m=pg(e));const g=lre(p,s,o)?zz(p):sc(0);let b=(d.left+g.x)/m.x,S=(d.top+g.y)/m.y,E=d.width/m.x,A=d.height/m.y;if(p){const k=Na(p),T=o&&nl(o)?Na(o):o;let M=k,I=IT(M);for(;I&&o&&T!==M;){const q=pg(I),G=I.getBoundingClientRect(),K=rl(I),X=G.left+(I.clientLeft+parseFloat(K.paddingLeft))*q.x,z=G.top+(I.clientTop+parseFloat(K.paddingTop))*q.y;b*=q.x,S*=q.y,E*=q.x,A*=q.y,b+=X,S+=z,M=Na(I),I=IT(M)}}return Mj({width:E,height:A,x:b,y:S})}function wC(e,r){const s=bC(e).scrollLeft;return r?r.left+s:Op(lc(e)).left+s}function Lz(e,r){const s=e.getBoundingClientRect(),o=s.left+r.scrollLeft-wC(e,s),d=s.top+r.scrollTop;return{x:o,y:d}}function cre(e){let{elements:r,rect:s,offsetParent:o,strategy:d}=e;const p=d==="fixed",m=lc(o),g=r?xC(r.floating):!1;if(o===m||g&&p)return s;let b={scrollLeft:0,scrollTop:0},S=sc(1);const E=sc(0),A=oc(o);if((A||!A&&!p)&&((Tg(o)!=="body"||nw(m))&&(b=bC(o)),oc(o))){const T=Op(o);S=pg(o),E.x=T.x+o.clientLeft,E.y=T.y+o.clientTop}const k=m&&!A&&!p?Lz(m,b):sc(0);return{width:s.width*S.x,height:s.height*S.y,x:s.x*S.x-b.scrollLeft*S.x+E.x+k.x,y:s.y*S.y-b.scrollTop*S.y+E.y+k.y}}function ure(e){return Array.from(e.getClientRects())}function dre(e){const r=lc(e),s=bC(e),o=e.ownerDocument.body,d=_a(r.scrollWidth,r.clientWidth,o.scrollWidth,o.clientWidth),p=_a(r.scrollHeight,r.clientHeight,o.scrollHeight,o.clientHeight);let m=-s.scrollLeft+wC(e);const g=-s.scrollTop;return rl(o).direction==="rtl"&&(m+=_a(r.clientWidth,o.clientWidth)-d),{width:d,height:p,x:m,y:g}}const aI=25;function hre(e,r){const s=Na(e),o=lc(e),d=s.visualViewport;let p=o.clientWidth,m=o.clientHeight,g=0,b=0;if(d){p=d.width,m=d.height;const E=Y_();(!E||E&&r==="fixed")&&(g=d.offsetLeft,b=d.offsetTop)}const S=wC(o);if(S<=0){const E=o.ownerDocument,A=E.body,k=getComputedStyle(A),T=E.compatMode==="CSS1Compat"&&parseFloat(k.marginLeft)+parseFloat(k.marginRight)||0,M=Math.abs(o.clientWidth-A.clientWidth-T);M<=aI&&(p-=M)}else S<=aI&&(p+=S);return{width:p,height:m,x:g,y:b}}const pre=new Set(["absolute","fixed"]);function fre(e,r){const s=Op(e,!0,r==="fixed"),o=s.top+e.clientTop,d=s.left+e.clientLeft,p=oc(e)?pg(e):sc(1),m=e.clientWidth*p.x,g=e.clientHeight*p.y,b=d*p.x,S=o*p.y;return{width:m,height:g,x:b,y:S}}function oI(e,r,s){let o;if(r==="viewport")o=hre(e,s);else if(r==="document")o=dre(lc(e));else if(nl(r))o=fre(r,s);else{const d=zz(e);o={x:r.x-d.x,y:r.y-d.y,width:r.width,height:r.height}}return Mj(o)}function Fz(e,r){const s=Fd(e);return s===r||!nl(s)||vg(s)?!1:rl(s).position==="fixed"||Fz(s,r)}function mre(e,r){const s=r.get(e);if(s)return s;let o=Fb(e,[],!1).filter(g=>nl(g)&&Tg(g)!=="body"),d=null;const p=rl(e).position==="fixed";let m=p?Fd(e):e;for(;nl(m)&&!vg(m);){const g=rl(m),b=X_(m);!b&&g.position==="fixed"&&(d=null),(p?!b&&!d:!b&&g.position==="static"&&!!d&&pre.has(d.position)||nw(m)&&!b&&Fz(e,m))?o=o.filter(E=>E!==m):d=g,m=Fd(m)}return r.set(e,o),o}function gre(e){let{element:r,boundary:s,rootBoundary:o,strategy:d}=e;const m=[...s==="clippingAncestors"?xC(r)?[]:mre(r,this._c):[].concat(s),o],g=m[0],b=m.reduce((S,E)=>{const A=oI(r,E,d);return S.top=_a(A.top,S.top),S.right=Ld(A.right,S.right),S.bottom=Ld(A.bottom,S.bottom),S.left=_a(A.left,S.left),S},oI(r,g,d));return{width:b.right-b.left,height:b.bottom-b.top,x:b.left,y:b.top}}function yre(e){const{width:r,height:s}=Iz(e);return{width:r,height:s}}function vre(e,r,s){const o=oc(r),d=lc(r),p=s==="fixed",m=Op(e,!0,p,r);let g={scrollLeft:0,scrollTop:0};const b=sc(0);function S(){b.x=wC(d)}if(o||!o&&!p)if((Tg(r)!=="body"||nw(d))&&(g=bC(r)),o){const T=Op(r,!0,p,r);b.x=T.x+r.clientLeft,b.y=T.y+r.clientTop}else d&&S();p&&!o&&d&&S();const E=d&&!o&&!p?Lz(d,g):sc(0),A=m.left+g.scrollLeft-b.x-E.x,k=m.top+g.scrollTop-b.y-E.y;return{x:A,y:k,width:m.width,height:m.height}}function MR(e){return rl(e).position==="static"}function lI(e,r){if(!oc(e)||rl(e).position==="fixed")return null;if(r)return r(e);let s=e.offsetParent;return lc(e)===s&&(s=s.ownerDocument.body),s}function qz(e,r){const s=Na(e);if(xC(e))return s;if(!oc(e)){let d=Fd(e);for(;d&&!vg(d);){if(nl(d)&&!MR(d))return d;d=Fd(d)}return s}let o=lI(e,r);for(;o&&ere(o)&&MR(o);)o=lI(o,r);return o&&vg(o)&&MR(o)&&!X_(o)?s:o||ire(e)||s}const xre=async function(e){const r=this.getOffsetParent||qz,s=this.getDimensions,o=await s(e.floating);return{reference:vre(e.reference,await r(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function bre(e){return rl(e).direction==="rtl"}const wre={convertOffsetParentRelativeRectToViewportRelativeRect:cre,getDocumentElement:lc,getClippingRect:gre,getOffsetParent:qz,getElementRects:xre,getClientRects:ure,getDimensions:yre,getScale:pg,isElement:nl,isRTL:bre};function Bz(e,r){return e.x===r.x&&e.y===r.y&&e.width===r.width&&e.height===r.height}function Sre(e,r){let s=null,o;const d=lc(e);function p(){var g;clearTimeout(o),(g=s)==null||g.disconnect(),s=null}function m(g,b){g===void 0&&(g=!1),b===void 0&&(b=1),p();const S=e.getBoundingClientRect(),{left:E,top:A,width:k,height:T}=S;if(g||r(),!k||!T)return;const M=XE(A),I=XE(d.clientWidth-(E+k)),q=XE(d.clientHeight-(A+T)),G=XE(E),X={rootMargin:-M+"px "+-I+"px "+-q+"px "+-G+"px",threshold:_a(0,Ld(1,b))||1};let z=!0;function ee(oe){const Q=oe[0].intersectionRatio;if(Q!==b){if(!z)return m();Q?m(!1,Q):o=setTimeout(()=>{m(!1,1e-7)},1e3)}Q===1&&!Bz(S,e.getBoundingClientRect())&&m(),z=!1}try{s=new IntersectionObserver(ee,{...X,root:d.ownerDocument})}catch{s=new IntersectionObserver(ee,X)}s.observe(e)}return m(!0),p}function Ere(e,r,s,o){o===void 0&&(o={});const{ancestorScroll:d=!0,ancestorResize:p=!0,elementResize:m=typeof ResizeObserver=="function",layoutShift:g=typeof IntersectionObserver=="function",animationFrame:b=!1}=o,S=Z_(e),E=d||p?[...S?Fb(S):[],...Fb(r)]:[];E.forEach(G=>{d&&G.addEventListener("scroll",s,{passive:!0}),p&&G.addEventListener("resize",s)});const A=S&&g?Sre(S,s):null;let k=-1,T=null;m&&(T=new ResizeObserver(G=>{let[K]=G;K&&K.target===S&&T&&(T.unobserve(r),cancelAnimationFrame(k),k=requestAnimationFrame(()=>{var X;(X=T)==null||X.observe(r)})),s()}),S&&!b&&T.observe(S),T.observe(r));let M,I=b?Op(e):null;b&&q();function q(){const G=Op(e);I&&!Bz(I,G)&&s(),I=G,M=requestAnimationFrame(q)}return s(),()=>{var G;E.forEach(K=>{d&&K.removeEventListener("scroll",s),p&&K.removeEventListener("resize",s)}),A?.(),(G=T)==null||G.disconnect(),T=null,b&&cancelAnimationFrame(M)}}const jre=Xne,Cre=Yne,Are=Vne,Ore=Wne,kre=Hne,cI=Kne,Rre=Zne,Tre=(e,r,s)=>{const o=new Map,d={platform:wre,...s},p={...d.platform,_c:o};return Une(e,r,{...d,platform:p})};var _re=typeof document<"u",$re=function(){},yj=_re?R.useLayoutEffect:$re;function Ij(e,r){if(e===r)return!0;if(typeof e!=typeof r)return!1;if(typeof e=="function"&&e.toString()===r.toString())return!0;let s,o,d;if(e&&r&&typeof e=="object"){if(Array.isArray(e)){if(s=e.length,s!==r.length)return!1;for(o=s;o--!==0;)if(!Ij(e[o],r[o]))return!1;return!0}if(d=Object.keys(e),s=d.length,s!==Object.keys(r).length)return!1;for(o=s;o--!==0;)if(!{}.hasOwnProperty.call(r,d[o]))return!1;for(o=s;o--!==0;){const p=d[o];if(!(p==="_owner"&&e.$$typeof)&&!Ij(e[p],r[p]))return!1}return!0}return e!==e&&r!==r}function Uz(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function uI(e,r){const s=Uz(e);return Math.round(r*s)/s}function IR(e){const r=R.useRef(e);return yj(()=>{r.current=e}),r}function Nre(e){e===void 0&&(e={});const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:d,elements:{reference:p,floating:m}={},transform:g=!0,whileElementsMounted:b,open:S}=e,[E,A]=R.useState({x:0,y:0,strategy:s,placement:r,middlewareData:{},isPositioned:!1}),[k,T]=R.useState(o);Ij(k,o)||T(o);const[M,I]=R.useState(null),[q,G]=R.useState(null),K=R.useCallback(ue=>{ue!==oe.current&&(oe.current=ue,I(ue))},[]),X=R.useCallback(ue=>{ue!==Q.current&&(Q.current=ue,G(ue))},[]),z=p||M,ee=m||q,oe=R.useRef(null),Q=R.useRef(null),ne=R.useRef(E),de=b!=null,Ce=IR(b),xe=IR(d),le=IR(S),be=R.useCallback(()=>{if(!oe.current||!Q.current)return;const ue={placement:r,strategy:s,middleware:k};xe.current&&(ue.platform=xe.current),Tre(oe.current,Q.current,ue).then(_e=>{const fe={..._e,isPositioned:le.current!==!1};je.current&&!Ij(ne.current,fe)&&(ne.current=fe,mC.flushSync(()=>{A(fe)}))})},[k,r,s,xe,le]);yj(()=>{S===!1&&ne.current.isPositioned&&(ne.current.isPositioned=!1,A(ue=>({...ue,isPositioned:!1})))},[S]);const je=R.useRef(!1);yj(()=>(je.current=!0,()=>{je.current=!1}),[]),yj(()=>{if(z&&(oe.current=z),ee&&(Q.current=ee),z&&ee){if(Ce.current)return Ce.current(z,ee,be);be()}},[z,ee,be,Ce,de]);const Ke=R.useMemo(()=>({reference:oe,floating:Q,setReference:K,setFloating:X}),[K,X]),ce=R.useMemo(()=>({reference:z,floating:ee}),[z,ee]),re=R.useMemo(()=>{const ue={position:s,left:0,top:0};if(!ce.floating)return ue;const _e=uI(ce.floating,E.x),fe=uI(ce.floating,E.y);return g?{...ue,transform:"translate("+_e+"px, "+fe+"px)",...Uz(ce.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:_e,top:fe}},[s,g,ce.floating,E.x,E.y]);return R.useMemo(()=>({...E,update:be,refs:Ke,elements:ce,floatingStyles:re}),[E,be,Ke,ce,re])}const Dre=e=>{function r(s){return{}.hasOwnProperty.call(s,"current")}return{name:"arrow",options:e,fn(s){const{element:o,padding:d}=typeof e=="function"?e(s):e;return o&&r(o)?o.current!=null?cI({element:o.current,padding:d}).fn(s):{}:o?cI({element:o,padding:d}).fn(s):{}}}},Pre=(e,r)=>({...jre(e),options:[e,r]}),Mre=(e,r)=>({...Cre(e),options:[e,r]}),Ire=(e,r)=>({...Rre(e),options:[e,r]}),zre=(e,r)=>({...Are(e),options:[e,r]}),Lre=(e,r)=>({...Ore(e),options:[e,r]}),Fre=(e,r)=>({...kre(e),options:[e,r]}),qre=(e,r)=>({...Dre(e),options:[e,r]});var Bre="Arrow",Kz=R.forwardRef((e,r)=>{const{children:s,width:o=10,height:d=5,...p}=e;return u.jsx(Cn.svg,{...p,ref:r,width:o,height:d,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?s:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});Kz.displayName=Bre;var Ure=Kz;function Vz(e){const[r,s]=R.useState(void 0);return As(()=>{if(e){s({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(d=>{if(!Array.isArray(d)||!d.length)return;const p=d[0];let m,g;if("borderBoxSize"in p){const b=p.borderBoxSize,S=Array.isArray(b)?b[0]:b;m=S.inlineSize,g=S.blockSize}else m=e.offsetWidth,g=e.offsetHeight;s({width:m,height:g})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else s(void 0)},[e]),r}var W_="Popper",[Hz,Hd]=al(W_),[Kre,Gz]=Hz(W_),Xz=e=>{const{__scopePopper:r,children:s}=e,[o,d]=R.useState(null);return u.jsx(Kre,{scope:r,anchor:o,onAnchorChange:d,children:s})};Xz.displayName=W_;var Yz="PopperAnchor",Zz=R.forwardRef((e,r)=>{const{__scopePopper:s,virtualRef:o,...d}=e,p=Gz(Yz,s),m=R.useRef(null),g=Ln(r,m),b=R.useRef(null);return R.useEffect(()=>{const S=b.current;b.current=o?.current||m.current,S!==b.current&&p.onAnchorChange(b.current)}),o?null:u.jsx(Cn.div,{...d,ref:g})});Zz.displayName=Yz;var J_="PopperContent",[Vre,Hre]=Hz(J_),Wz=R.forwardRef((e,r)=>{const{__scopePopper:s,side:o="bottom",sideOffset:d=0,align:p="center",alignOffset:m=0,arrowPadding:g=0,avoidCollisions:b=!0,collisionBoundary:S=[],collisionPadding:E=0,sticky:A="partial",hideWhenDetached:k=!1,updatePositionStrategy:T="optimized",onPlaced:M,...I}=e,q=Gz(J_,s),[G,K]=R.useState(null),X=Ln(r,ze=>K(ze)),[z,ee]=R.useState(null),oe=Vz(z),Q=oe?.width??0,ne=oe?.height??0,de=o+(p!=="center"?"-"+p:""),Ce=typeof E=="number"?E:{top:0,right:0,bottom:0,left:0,...E},xe=Array.isArray(S)?S:[S],le=xe.length>0,be={padding:Ce,boundary:xe.filter(Xre),altBoundary:le},{refs:je,floatingStyles:Ke,placement:ce,isPositioned:re,middlewareData:ue}=Nre({strategy:"fixed",placement:de,whileElementsMounted:(...ze)=>Ere(...ze,{animationFrame:T==="always"}),elements:{reference:q.anchor},middleware:[Pre({mainAxis:d+ne,alignmentAxis:m}),b&&Mre({mainAxis:!0,crossAxis:!1,limiter:A==="partial"?Ire():void 0,...be}),b&&zre({...be}),Lre({...be,apply:({elements:ze,rects:tt,availableWidth:ft,availableHeight:Ot})=>{const{width:Ft,height:kt}=tt.reference,Jt=ze.floating.style;Jt.setProperty("--radix-popper-available-width",`${ft}px`),Jt.setProperty("--radix-popper-available-height",`${Ot}px`),Jt.setProperty("--radix-popper-anchor-width",`${Ft}px`),Jt.setProperty("--radix-popper-anchor-height",`${kt}px`)}}),z&&qre({element:z,padding:g}),Yre({arrowWidth:Q,arrowHeight:ne}),k&&Fre({strategy:"referenceHidden",...be})]}),[_e,fe]=eL(ce),He=tl(M);As(()=>{re&&He?.()},[re,He]);const Oe=ue.arrow?.x,ke=ue.arrow?.y,Ve=ue.arrow?.centerOffset!==0,[ie,Ne]=R.useState();return As(()=>{G&&Ne(window.getComputedStyle(G).zIndex)},[G]),u.jsx("div",{ref:je.setFloating,"data-radix-popper-content-wrapper":"",style:{...Ke,transform:re?Ke.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ie,"--radix-popper-transform-origin":[ue.transformOrigin?.x,ue.transformOrigin?.y].join(" "),...ue.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(Vre,{scope:s,placedSide:_e,onArrowChange:ee,arrowX:Oe,arrowY:ke,shouldHideArrow:Ve,children:u.jsx(Cn.div,{"data-side":_e,"data-align":fe,...I,ref:X,style:{...I.style,animation:re?void 0:"none"}})})})});Wz.displayName=J_;var Jz="PopperArrow",Gre={top:"bottom",right:"left",bottom:"top",left:"right"},Qz=R.forwardRef(function(r,s){const{__scopePopper:o,...d}=r,p=Hre(Jz,o),m=Gre[p.placedSide];return u.jsx("span",{ref:p.onArrowChange,style:{position:"absolute",left:p.arrowX,top:p.arrowY,[m]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[p.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[p.placedSide],visibility:p.shouldHideArrow?"hidden":void 0},children:u.jsx(Ure,{...d,ref:s,style:{...d.style,display:"block"}})})});Qz.displayName=Jz;function Xre(e){return e!==null}var Yre=e=>({name:"transformOrigin",options:e,fn(r){const{placement:s,rects:o,middlewareData:d}=r,m=d.arrow?.centerOffset!==0,g=m?0:e.arrowWidth,b=m?0:e.arrowHeight,[S,E]=eL(s),A={start:"0%",center:"50%",end:"100%"}[E],k=(d.arrow?.x??0)+g/2,T=(d.arrow?.y??0)+b/2;let M="",I="";return S==="bottom"?(M=m?A:`${k}px`,I=`${-b}px`):S==="top"?(M=m?A:`${k}px`,I=`${o.floating.height+b}px`):S==="right"?(M=`${-b}px`,I=m?A:`${T}px`):S==="left"&&(M=`${o.floating.width+b}px`,I=m?A:`${T}px`),{data:{x:M,y:I}}}});function eL(e){const[r,s="center"]=e.split("-");return[r,s]}var SC=Xz,rw=Zz,EC=Wz,jC=Qz,Zre="Portal",_g=R.forwardRef((e,r)=>{const{container:s,...o}=e,[d,p]=R.useState(!1);As(()=>p(!0),[]);const m=s||d&&globalThis?.document?.body;return m?B3.createPortal(u.jsx(Cn.div,{...o,ref:r}),m):null});_g.displayName=Zre;function Wre(e,r){return R.useReducer((s,o)=>r[s][o]??s,e)}var co=e=>{const{present:r,children:s}=e,o=Jre(r),d=typeof s=="function"?s({present:o.isPresent}):R.Children.only(s),p=Ln(o.ref,Qre(d));return typeof s=="function"||o.isPresent?R.cloneElement(d,{ref:p}):null};co.displayName="Presence";function Jre(e){const[r,s]=R.useState(),o=R.useRef(null),d=R.useRef(e),p=R.useRef("none"),m=e?"mounted":"unmounted",[g,b]=Wre(m,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return R.useEffect(()=>{const S=YE(o.current);p.current=g==="mounted"?S:"none"},[g]),As(()=>{const S=o.current,E=d.current;if(E!==e){const k=p.current,T=YE(S);e?b("MOUNT"):T==="none"||S?.display==="none"?b("UNMOUNT"):b(E&&k!==T?"ANIMATION_OUT":"UNMOUNT"),d.current=e}},[e,b]),As(()=>{if(r){let S;const E=r.ownerDocument.defaultView??window,A=T=>{const I=YE(o.current).includes(CSS.escape(T.animationName));if(T.target===r&&I&&(b("ANIMATION_END"),!d.current)){const q=r.style.animationFillMode;r.style.animationFillMode="forwards",S=E.setTimeout(()=>{r.style.animationFillMode==="forwards"&&(r.style.animationFillMode=q)})}},k=T=>{T.target===r&&(p.current=YE(o.current))};return r.addEventListener("animationstart",k),r.addEventListener("animationcancel",A),r.addEventListener("animationend",A),()=>{E.clearTimeout(S),r.removeEventListener("animationstart",k),r.removeEventListener("animationcancel",A),r.removeEventListener("animationend",A)}}else b("ANIMATION_END")},[r,b]),{isPresent:["mounted","unmountSuspended"].includes(g),ref:R.useCallback(S=>{o.current=S?getComputedStyle(S):null,s(S)},[])}}function YE(e){return e?.animationName||"none"}function Qre(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning;return s?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var ese=Symbol("radix.slottable");function tse(e){const r=({children:s})=>u.jsx(u.Fragment,{children:s});return r.displayName=`${e}.Slottable`,r.__radixId=ese,r}var nse=R_[" useInsertionEffect ".trim().toString()]||As;function qd({prop:e,defaultProp:r,onChange:s=()=>{},caller:o}){const[d,p,m]=rse({defaultProp:r,onChange:s}),g=e!==void 0,b=g?e:d;{const E=R.useRef(e!==void 0);R.useEffect(()=>{const A=E.current;A!==g&&console.warn(`${o} is changing from ${A?"controlled":"uncontrolled"} to ${g?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),E.current=g},[g,o])}const S=R.useCallback(E=>{if(g){const A=sse(E)?E(e):E;A!==e&&m.current?.(A)}else p(E)},[g,e,p,m]);return[b,S]}function rse({defaultProp:e,onChange:r}){const[s,o]=R.useState(e),d=R.useRef(s),p=R.useRef(r);return nse(()=>{p.current=r},[r]),R.useEffect(()=>{d.current!==s&&(p.current?.(s),d.current=s)},[s,d]),[s,o,p]}function sse(e){return typeof e=="function"}var tL=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),ise="VisuallyHidden",nL=R.forwardRef((e,r)=>u.jsx(Cn.span,{...e,ref:r,style:{...tL,...e.style}}));nL.displayName=ise;var ase=nL,[CC]=al("Tooltip",[Hd]),AC=Hd(),rL="TooltipProvider",ose=700,zT="tooltip.open",[lse,Q_]=CC(rL),sL=e=>{const{__scopeTooltip:r,delayDuration:s=ose,skipDelayDuration:o=300,disableHoverableContent:d=!1,children:p}=e,m=R.useRef(!0),g=R.useRef(!1),b=R.useRef(0);return R.useEffect(()=>{const S=b.current;return()=>window.clearTimeout(S)},[]),u.jsx(lse,{scope:r,isOpenDelayedRef:m,delayDuration:s,onOpen:R.useCallback(()=>{window.clearTimeout(b.current),m.current=!1},[]),onClose:R.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>m.current=!0,o)},[o]),isPointerInTransitRef:g,onPointerInTransitChange:R.useCallback(S=>{g.current=S},[]),disableHoverableContent:d,children:p})};sL.displayName=rL;var qb="Tooltip",[cse,sw]=CC(qb),iL=e=>{const{__scopeTooltip:r,children:s,open:o,defaultOpen:d,onOpenChange:p,disableHoverableContent:m,delayDuration:g}=e,b=Q_(qb,e.__scopeTooltip),S=AC(r),[E,A]=R.useState(null),k=Vs(),T=R.useRef(0),M=m??b.disableHoverableContent,I=g??b.delayDuration,q=R.useRef(!1),[G,K]=qd({prop:o,defaultProp:d??!1,onChange:Q=>{Q?(b.onOpen(),document.dispatchEvent(new CustomEvent(zT))):b.onClose(),p?.(Q)},caller:qb}),X=R.useMemo(()=>G?q.current?"delayed-open":"instant-open":"closed",[G]),z=R.useCallback(()=>{window.clearTimeout(T.current),T.current=0,q.current=!1,K(!0)},[K]),ee=R.useCallback(()=>{window.clearTimeout(T.current),T.current=0,K(!1)},[K]),oe=R.useCallback(()=>{window.clearTimeout(T.current),T.current=window.setTimeout(()=>{q.current=!0,K(!0),T.current=0},I)},[I,K]);return R.useEffect(()=>()=>{T.current&&(window.clearTimeout(T.current),T.current=0)},[]),u.jsx(SC,{...S,children:u.jsx(cse,{scope:r,contentId:k,open:G,stateAttribute:X,trigger:E,onTriggerChange:A,onTriggerEnter:R.useCallback(()=>{b.isOpenDelayedRef.current?oe():z()},[b.isOpenDelayedRef,oe,z]),onTriggerLeave:R.useCallback(()=>{M?ee():(window.clearTimeout(T.current),T.current=0)},[ee,M]),onOpen:z,onClose:ee,disableHoverableContent:M,children:s})})};iL.displayName=qb;var LT="TooltipTrigger",aL=R.forwardRef((e,r)=>{const{__scopeTooltip:s,...o}=e,d=sw(LT,s),p=Q_(LT,s),m=AC(s),g=R.useRef(null),b=Ln(r,g,d.onTriggerChange),S=R.useRef(!1),E=R.useRef(!1),A=R.useCallback(()=>S.current=!1,[]);return R.useEffect(()=>()=>document.removeEventListener("pointerup",A),[A]),u.jsx(rw,{asChild:!0,...m,children:u.jsx(Cn.button,{"aria-describedby":d.open?d.contentId:void 0,"data-state":d.stateAttribute,...o,ref:b,onPointerMove:$t(e.onPointerMove,k=>{k.pointerType!=="touch"&&!E.current&&!p.isPointerInTransitRef.current&&(d.onTriggerEnter(),E.current=!0)}),onPointerLeave:$t(e.onPointerLeave,()=>{d.onTriggerLeave(),E.current=!1}),onPointerDown:$t(e.onPointerDown,()=>{d.open&&d.onClose(),S.current=!0,document.addEventListener("pointerup",A,{once:!0})}),onFocus:$t(e.onFocus,()=>{S.current||d.onOpen()}),onBlur:$t(e.onBlur,d.onClose),onClick:$t(e.onClick,d.onClose)})})});aL.displayName=LT;var e2="TooltipPortal",[use,dse]=CC(e2,{forceMount:void 0}),oL=e=>{const{__scopeTooltip:r,forceMount:s,children:o,container:d}=e,p=sw(e2,r);return u.jsx(use,{scope:r,forceMount:s,children:u.jsx(co,{present:s||p.open,children:u.jsx(_g,{asChild:!0,container:d,children:o})})})};oL.displayName=e2;var xg="TooltipContent",lL=R.forwardRef((e,r)=>{const s=dse(xg,e.__scopeTooltip),{forceMount:o=s.forceMount,side:d="top",...p}=e,m=sw(xg,e.__scopeTooltip);return u.jsx(co,{present:o||m.open,children:m.disableHoverableContent?u.jsx(cL,{side:d,...p,ref:r}):u.jsx(hse,{side:d,...p,ref:r})})}),hse=R.forwardRef((e,r)=>{const s=sw(xg,e.__scopeTooltip),o=Q_(xg,e.__scopeTooltip),d=R.useRef(null),p=Ln(r,d),[m,g]=R.useState(null),{trigger:b,onClose:S}=s,E=d.current,{onPointerInTransitChange:A}=o,k=R.useCallback(()=>{g(null),A(!1)},[A]),T=R.useCallback((M,I)=>{const q=M.currentTarget,G={x:M.clientX,y:M.clientY},K=gse(G,q.getBoundingClientRect()),X=yse(G,K),z=vse(I.getBoundingClientRect()),ee=bse([...X,...z]);g(ee),A(!0)},[A]);return R.useEffect(()=>()=>k(),[k]),R.useEffect(()=>{if(b&&E){const M=q=>T(q,E),I=q=>T(q,b);return b.addEventListener("pointerleave",M),E.addEventListener("pointerleave",I),()=>{b.removeEventListener("pointerleave",M),E.removeEventListener("pointerleave",I)}}},[b,E,T,k]),R.useEffect(()=>{if(m){const M=I=>{const q=I.target,G={x:I.clientX,y:I.clientY},K=b?.contains(q)||E?.contains(q),X=!xse(G,m);K?k():X&&(k(),S())};return document.addEventListener("pointermove",M),()=>document.removeEventListener("pointermove",M)}},[b,E,m,S,k]),u.jsx(cL,{...e,ref:p})}),[pse,fse]=CC(qb,{isInside:!1}),mse=tse("TooltipContent"),cL=R.forwardRef((e,r)=>{const{__scopeTooltip:s,children:o,"aria-label":d,onEscapeKeyDown:p,onPointerDownOutside:m,...g}=e,b=sw(xg,s),S=AC(s),{onClose:E}=b;return R.useEffect(()=>(document.addEventListener(zT,E),()=>document.removeEventListener(zT,E)),[E]),R.useEffect(()=>{if(b.trigger){const A=k=>{k.target?.contains(b.trigger)&&E()};return window.addEventListener("scroll",A,{capture:!0}),()=>window.removeEventListener("scroll",A,{capture:!0})}},[b.trigger,E]),u.jsx(kg,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:p,onPointerDownOutside:m,onFocusOutside:A=>A.preventDefault(),onDismiss:E,children:u.jsxs(EC,{"data-state":b.stateAttribute,...S,...g,ref:r,style:{...g.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(mse,{children:o}),u.jsx(pse,{scope:s,isInside:!0,children:u.jsx(ase,{id:b.contentId,role:"tooltip",children:d||o})})]})})});lL.displayName=xg;var uL="TooltipArrow",dL=R.forwardRef((e,r)=>{const{__scopeTooltip:s,...o}=e,d=AC(s);return fse(uL,s).isInside?null:u.jsx(jC,{...d,...o,ref:r})});dL.displayName=uL;function gse(e,r){const s=Math.abs(r.top-e.y),o=Math.abs(r.bottom-e.y),d=Math.abs(r.right-e.x),p=Math.abs(r.left-e.x);switch(Math.min(s,o,d,p)){case p:return"left";case d:return"right";case s:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function yse(e,r,s=5){const o=[];switch(r){case"top":o.push({x:e.x-s,y:e.y+s},{x:e.x+s,y:e.y+s});break;case"bottom":o.push({x:e.x-s,y:e.y-s},{x:e.x+s,y:e.y-s});break;case"left":o.push({x:e.x+s,y:e.y-s},{x:e.x+s,y:e.y+s});break;case"right":o.push({x:e.x-s,y:e.y-s},{x:e.x-s,y:e.y+s});break}return o}function vse(e){const{top:r,right:s,bottom:o,left:d}=e;return[{x:d,y:r},{x:s,y:r},{x:s,y:o},{x:d,y:o}]}function xse(e,r){const{x:s,y:o}=e;let d=!1;for(let p=0,m=r.length-1;po!=k>o&&s<(A-S)*(o-E)/(k-E)+S&&(d=!d)}return d}function bse(e){const r=e.slice();return r.sort((s,o)=>s.xo.x?1:s.yo.y?1:0),wse(r)}function wse(e){if(e.length<=1)return e.slice();const r=[];for(let o=0;o=2;){const p=r[r.length-1],m=r[r.length-2];if((p.x-m.x)*(d.y-m.y)>=(p.y-m.y)*(d.x-m.x))r.pop();else break}r.push(d)}r.pop();const s=[];for(let o=e.length-1;o>=0;o--){const d=e[o];for(;s.length>=2;){const p=s[s.length-1],m=s[s.length-2];if((p.x-m.x)*(d.y-m.y)>=(p.y-m.y)*(d.x-m.x))s.pop();else break}s.push(d)}return s.pop(),r.length===1&&s.length===1&&r[0].x===s[0].x&&r[0].y===s[0].y?r:r.concat(s)}var Sse=sL,Ese=iL,jse=aL,Cse=oL,Ase=lL,Ose=dL;function iw({delayDuration:e=0,...r}){return u.jsx(Sse,{"data-slot":"tooltip-provider",delayDuration:e,...r})}function zj({...e}){return u.jsx(iw,{children:u.jsx(Ese,{"data-slot":"tooltip",...e})})}function Lj({...e}){return u.jsx(jse,{"data-slot":"tooltip-trigger",...e})}function Fj({className:e,sideOffset:r=0,children:s,...o}){return u.jsx(Cse,{children:u.jsxs(Ase,{"data-slot":"tooltip-content",sideOffset:r,className:ht("bg-foreground text-background 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 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...o,children:[s,u.jsx(Ose,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function hL(e){return e&&e!=="none"?e.slice(0,7):"none"}function kse(e){if(!e||e==="unknown")return"unknown";const r=new Date(e);return isNaN(+r)?e:r.toLocaleString()}function Rse(e){return e?`v${e.version} (${hL(e.commit)}) • built ${e.built} • ${e.go} ${e.goOS}/${e.goArch}`:""}const Tse=R.memo(function(){const r=rr({queryKey:["footer"],queryFn:()=>ute.footer(),staleTime:6e4,refetchOnWindowFocus:!1}),s=r.data,o=R.useMemo(()=>Rse(s),[s]);return u.jsx("footer",{className:"bg-background text-muted-foreground w-full border-t px-3 py-2 text-xs sm:text-sm",children:u.jsxs("div",{className:"mx-auto flex max-w-screen-2xl items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-2 text-xs sm:text-sm",children:[u.jsxs("span",{children:["© ",new Date().getFullYear()," GlueOps"]}),u.jsx(bb,{orientation:"vertical",className:"hidden h-4 sm:block"}),u.jsx("span",{className:"hidden sm:block",children:"All systems nominal."})]}),u.jsx("div",{className:"flex flex-wrap items-center gap-2 text-xs sm:text-sm",children:r.isLoading?u.jsx("span",{className:"animate-pulse",children:"loading version…"}):r.isError?u.jsx("span",{className:"text-destructive",children:"version unavailable"}):s?u.jsx(iw,{children:u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(rs,{variant:"secondary",className:"font-mono",children:s.version}),u.jsxs(zj,{children:[u.jsx(Lj,{asChild:!0,children:u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(XZ,{className:"h-3.5 w-3.5"}),u.jsx("span",{className:"font-mono",children:hL(s.commit)})]})}),u.jsx(Fj,{side:"top",children:u.jsx("div",{className:"font-mono text-xs",children:s.commit})})]}),u.jsx(bb,{orientation:"vertical",className:"h-4"}),u.jsxs(zj,{children:[u.jsx(Lj,{asChild:!0,children:u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(oz,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:s.go})]})}),u.jsx(Fj,{side:"top",children:u.jsxs("div",{className:"font-mono text-xs",children:[s.goOS,"/",s.goArch]})})]}),u.jsx(bb,{orientation:"vertical",className:"hidden h-4 sm:block"}),u.jsxs("span",{className:"hidden sm:inline",children:["built ",u.jsx("span",{className:"font-mono",children:kse(s.built)})]}),u.jsx(bb,{orientation:"vertical",className:"hidden h-4 sm:block"}),u.jsx(Fe,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{navigator.clipboard?.writeText(o).catch(()=>{})},title:"Copy version details",children:u.jsx($Z,{className:"h-4 w-4"})}),u.jsxs("a",{href:"/api/v1/version",target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-xs underline-offset-4 hover:underline",title:"Open raw version JSON",children:["JSON ",u.jsx(qZ,{className:"h-3.5 w-3.5"})]})]})}):null})]})})});var pL={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},dI=Je.createContext&&Je.createContext(pL),_se=["attr","size","title"];function $se(e,r){if(e==null)return{};var s=Nse(e,r),o,d;if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(e);for(d=0;d=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(s[o]=e[o])}return s}function Nse(e,r){if(e==null)return{};var s={};for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){if(r.indexOf(o)>=0)continue;s[o]=e[o]}return s}function qj(){return qj=Object.assign?Object.assign.bind():function(e){for(var r=1;rJe.createElement(r.tag,Bj({key:s},r.attr),fL(r.child)))}function aw(e){return r=>Je.createElement(Ise,qj({attr:Bj({},e.attr)},r),fL(e.child))}function Ise(e){var r=s=>{var{attr:o,size:d,title:p}=e,m=$se(e,_se),g=d||s.size||"1em",b;return s.className&&(b=s.className),e.className&&(b=(b?b+" ":"")+e.className),Je.createElement("svg",qj({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},s.attr,o,m,{className:b,style:Bj(Bj({color:e.color||s.color},s.style),e.style),height:g,width:g,xmlns:"http://www.w3.org/2000/svg"}),p&&Je.createElement("title",null,p),e.children)};return dI!==void 0?Je.createElement(dI.Consumer,null,s=>r(s)):r(pL)}function zse(e){return aw({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M888 680h-54V540H546v-92h238c8.8 0 16-7.2 16-16V168c0-8.8-7.2-16-16-16H240c-8.8 0-16 7.2-16 16v264c0 8.8 7.2 16 16 16h238v92H190v140h-54c-4.4 0-8 3.6-8 8v176c0 4.4 3.6 8 8 8h176c4.4 0 8-3.6 8-8V688c0-4.4-3.6-8-8-8h-54v-72h220v72h-54c-4.4 0-8 3.6-8 8v176c0 4.4 3.6 8 8 8h176c4.4 0 8-3.6 8-8V688c0-4.4-3.6-8-8-8h-54v-72h220v72h-54c-4.4 0-8 3.6-8 8v176c0 4.4 3.6 8 8 8h176c4.4 0 8-3.6 8-8V688c0-4.4-3.6-8-8-8zM256 805.3c0 1.5-1.2 2.7-2.7 2.7h-58.7c-1.5 0-2.7-1.2-2.7-2.7v-58.7c0-1.5 1.2-2.7 2.7-2.7h58.7c1.5 0 2.7 1.2 2.7 2.7v58.7zm288 0c0 1.5-1.2 2.7-2.7 2.7h-58.7c-1.5 0-2.7-1.2-2.7-2.7v-58.7c0-1.5 1.2-2.7 2.7-2.7h58.7c1.5 0 2.7 1.2 2.7 2.7v58.7zM288 384V216h448v168H288zm544 421.3c0 1.5-1.2 2.7-2.7 2.7h-58.7c-1.5 0-2.7-1.2-2.7-2.7v-58.7c0-1.5 1.2-2.7 2.7-2.7h58.7c1.5 0 2.7 1.2 2.7 2.7v58.7zM360 300a40 40 0 1 0 80 0 40 40 0 1 0-80 0z"},child:[]}]})(e)}function Lse(e){return aw({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",strokeWidth:"2",d:"M3,6 L21,6 L3,6 Z M10,2 L10,4 M14,2 L14,4 M16,12 C18.3736719,13.1826446 20,15.6506255 20,19 L20,23 L4,23 L4,19 C4,15.6457258 5.6310898,13.1754259 8,12 M12,16.5 L12,23 M12,13 C15.3137085,13 18,10.3137085 18,7 C18,3.6862915 15.3137085,1 12,1 C8.6862915,1 6,3.6862915 6,7 C6,10.3137085 8.6862915,13 12,13 Z M8,12 C8,14.209139 9.790861,16 12,16 L12,16 C14.209139,16 16,14.209139 16,12"},child:[]}]})(e)}function Fse(e){return aw({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M19 15v4H5v-4h14m1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1v-6c0-.55-.45-1-1-1zM7 18.5c-.82 0-1.5-.67-1.5-1.5s.68-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zM19 5v4H5V5h14m1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1zM7 8.5c-.82 0-1.5-.67-1.5-1.5S6.18 5.5 7 5.5s1.5.68 1.5 1.5S7.83 8.5 7 8.5z"},child:[]}]})(e)}function qse(e){return aw({attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 0C5.383 0 0 5.383 0 12s5.383 12 12 12c6.616 0 12-5.383 12-12S18.616 0 12 0zm0 1.144c5.995 0 10.856 4.86 10.856 10.856 0 5.995-4.86 10.856-10.856 10.856-5.996 0-10.856-4.86-10.856-10.856C1.144 6.004 6.004 1.144 12 1.144zM8.37 5.868a6.707 6.707 0 0 0-.423.005c-.983.056-1.573.517-1.735 1.472-.115.665-.096 1.348-.143 2.017-.013.35-.05.697-.115 1.038-.134.609-.397.798-1.016.83a2.65 2.65 0 0 0-.244.042v1.463c1.126.055 1.278.452 1.37 1.629.033.429-.013.858.015 1.287.018.406.073.808.156 1.2.259 1.075 1.307 1.435 2.575 1.218v-1.283c-.203 0-.383.005-.558 0-.43-.013-.591-.12-.632-.535-.056-.535-.042-1.08-.075-1.62-.064-1.001-.175-1.988-1.153-2.625.503-.37.868-.812.983-1.398.083-.41.134-.821.166-1.237.028-.415-.023-.84.014-1.25.06-.665.102-.937.9-.91.12 0 .235-.017.369-.027v-1.31c-.16 0-.31-.004-.454-.006zm7.593.009a4.247 4.247 0 0 0-.813.06v1.274c.245 0 .434 0 .623.005.328.004.577.13.61.494.032.332.031.669.064 1.006.065.669.101 1.347.217 2.007.102.544.475.95.941 1.283-.817.549-1.057 1.333-1.098 2.215-.023.604-.037 1.213-.069 1.822-.028.554-.222.734-.78.748-.157.004-.31.018-.484.028v1.305c.327 0 .627.019.927 0 .932-.055 1.495-.507 1.68-1.412.078-.498.124-1 .138-1.504.032-.461.028-.927.074-1.384.069-.715.397-1.01 1.112-1.057a.972.972 0 0 0 .199-.046v-1.463c-.12-.014-.204-.027-.291-.032-.536-.023-.804-.203-.937-.71a5.146 5.146 0 0 1-.152-.993c-.037-.618-.033-1.241-.074-1.86-.08-1.192-.794-1.753-1.887-1.786zm-6.89 5.28a.844.844 0 0 0-.083 1.684h.055a.83.83 0 0 0 .877-.78v-.046a.845.845 0 0 0-.83-.858zm2.911 0a.808.808 0 0 0-.834.78c0 .027 0 .05.004.078 0 .503.342.826.859.826.507 0 .826-.332.826-.853-.005-.503-.342-.836-.855-.831zm2.963 0a.861.861 0 0 0-.876.835c0 .47.378.849.849.849h.009c.425.074.853-.337.881-.83.023-.457-.392-.854-.863-.854z"},child:[]}]})(e)}function Bse(e){return aw({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 13m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"},child:[]},{tag:"path",attr:{d:"M12 20m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},child:[]},{tag:"path",attr:{d:"M12 16v3"},child:[]},{tag:"path",attr:{d:"M12 10v-7"},child:[]},{tag:"path",attr:{d:"M9 6l3 -3l3 3"},child:[]},{tag:"path",attr:{d:"M12 10v-7"},child:[]},{tag:"path",attr:{d:"M9 6l3 -3l3 3"},child:[]},{tag:"path",attr:{d:"M14.894 12.227l6.11 -2.224"},child:[]},{tag:"path",attr:{d:"M17.159 8.21l3.845 1.793l-1.793 3.845"},child:[]},{tag:"path",attr:{d:"M9.101 12.214l-6.075 -2.211"},child:[]},{tag:"path",attr:{d:"M6.871 8.21l-3.845 1.793l1.793 3.845"},child:[]}]})(e)}const Use=[{to:"/clusters",label:"Clusters",icon:zse},{to:"/load-balancers",label:"Load Balancers",icon:Bse},{to:"/dns",label:"DNS",icon:Fse},{to:"/node-pools",label:"Node Pools",icon:gZ},{to:"/annotations",label:"Annotations",icon:DZ},{to:"/labels",label:"Labels",icon:gC},{to:"/taints",label:"Taints",icon:wW},{to:"/servers",label:"Servers",icon:L_},{to:"/ssh",label:"SSH Keys",icon:HZ},{to:"/credentials",label:"Credentials",icon:tW}],Kse=[{to:"/org/members",label:"Members",icon:lz},{to:"/org/api-keys",label:"Org API Keys",icon:WZ},{to:"/org/settings",label:"Org Settings",icon:sz}],Vse=[{to:"/me",label:"Profile",icon:kW}],Hse=[{to:"/admin/users",label:"Users Admin",icon:lz},{to:"/admin/jobs",label:"Jobs Admin",icon:Lse},{to:"/docs",label:"API Docs ",icon:qse,target:"_blank"}];var pI=1,Gse=.9,Xse=.8,Yse=.17,zR=.1,LR=.999,Zse=.9999,Wse=.99,Jse=/[\\\/_+.#"@\[\(\{&]/,Qse=/[\\\/_+.#"@\[\(\{&]/g,eie=/[\s-]/,mL=/[\s-]/g;function FT(e,r,s,o,d,p,m){if(p===r.length)return d===e.length?pI:Wse;var g=`${d},${p}`;if(m[g]!==void 0)return m[g];for(var b=o.charAt(p),S=s.indexOf(b,d),E=0,A,k,T,M;S>=0;)A=FT(e,r,s,o,S+1,p+1,m),A>E&&(S===d?A*=pI:Jse.test(e.charAt(S-1))?(A*=Xse,T=e.slice(d,S-1).match(Qse),T&&d>0&&(A*=Math.pow(LR,T.length))):eie.test(e.charAt(S-1))?(A*=Gse,M=e.slice(d,S-1).match(mL),M&&d>0&&(A*=Math.pow(LR,M.length))):(A*=Yse,d>0&&(A*=Math.pow(LR,S-d))),e.charAt(S)!==r.charAt(p)&&(A*=Zse)),(AA&&(A=k*zR)),A>E&&(E=A),S=s.indexOf(b,S+1);return m[g]=E,E}function fI(e){return e.toLowerCase().replace(mL," ")}function tie(e,r,s){return e=s&&s.length>0?`${e+" "+s.join(" ")}`:e,FT(e,r,fI(e),fI(r),0,0,{})}var FR="focusScope.autoFocusOnMount",qR="focusScope.autoFocusOnUnmount",mI={bubbles:!1,cancelable:!0},nie="FocusScope",ow=R.forwardRef((e,r)=>{const{loop:s=!1,trapped:o=!1,onMountAutoFocus:d,onUnmountAutoFocus:p,...m}=e,[g,b]=R.useState(null),S=tl(d),E=tl(p),A=R.useRef(null),k=Ln(r,I=>b(I)),T=R.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;R.useEffect(()=>{if(o){let I=function(X){if(T.paused||!g)return;const z=X.target;g.contains(z)?A.current=z:Pd(A.current,{select:!0})},q=function(X){if(T.paused||!g)return;const z=X.relatedTarget;z!==null&&(g.contains(z)||Pd(A.current,{select:!0}))},G=function(X){if(document.activeElement===document.body)for(const ee of X)ee.removedNodes.length>0&&Pd(g)};document.addEventListener("focusin",I),document.addEventListener("focusout",q);const K=new MutationObserver(G);return g&&K.observe(g,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",I),document.removeEventListener("focusout",q),K.disconnect()}}},[o,g,T.paused]),R.useEffect(()=>{if(g){yI.add(T);const I=document.activeElement;if(!g.contains(I)){const G=new CustomEvent(FR,mI);g.addEventListener(FR,S),g.dispatchEvent(G),G.defaultPrevented||(rie(lie(gL(g)),{select:!0}),document.activeElement===I&&Pd(g))}return()=>{g.removeEventListener(FR,S),setTimeout(()=>{const G=new CustomEvent(qR,mI);g.addEventListener(qR,E),g.dispatchEvent(G),G.defaultPrevented||Pd(I??document.body,{select:!0}),g.removeEventListener(qR,E),yI.remove(T)},0)}}},[g,S,E,T]);const M=R.useCallback(I=>{if(!s&&!o||T.paused)return;const q=I.key==="Tab"&&!I.altKey&&!I.ctrlKey&&!I.metaKey,G=document.activeElement;if(q&&G){const K=I.currentTarget,[X,z]=sie(K);X&&z?!I.shiftKey&&G===z?(I.preventDefault(),s&&Pd(X,{select:!0})):I.shiftKey&&G===X&&(I.preventDefault(),s&&Pd(z,{select:!0})):G===K&&I.preventDefault()}},[s,o,T.paused]);return u.jsx(Cn.div,{tabIndex:-1,...m,ref:k,onKeyDown:M})});ow.displayName=nie;function rie(e,{select:r=!1}={}){const s=document.activeElement;for(const o of e)if(Pd(o,{select:r}),document.activeElement!==s)return}function sie(e){const r=gL(e),s=gI(r,e),o=gI(r.reverse(),e);return[s,o]}function gL(e){const r=[],s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const d=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||d?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)r.push(s.currentNode);return r}function gI(e,r){for(const s of e)if(!iie(s,{upTo:r}))return s}function iie(e,{upTo:r}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(r!==void 0&&e===r)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function aie(e){return e instanceof HTMLInputElement&&"select"in e}function Pd(e,{select:r=!1}={}){if(e&&e.focus){const s=document.activeElement;e.focus({preventScroll:!0}),e!==s&&aie(e)&&r&&e.select()}}var yI=oie();function oie(){let e=[];return{add(r){const s=e[0];r!==s&&s?.pause(),e=vI(e,r),e.unshift(r)},remove(r){e=vI(e,r),e[0]?.resume()}}}function vI(e,r){const s=[...e],o=s.indexOf(r);return o!==-1&&s.splice(o,1),s}function lie(e){return e.filter(r=>r.tagName!=="A")}var BR=0;function OC(){R.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??xI()),document.body.insertAdjacentElement("beforeend",e[1]??xI()),BR++,()=>{BR===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),BR--}},[])}function xI(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var nc=function(){return nc=Object.assign||function(r){for(var s,o=1,d=arguments.length;o"u")return Cie;var r=Aie(e),s=document.documentElement.clientWidth,o=window.innerWidth;return{left:r[0],top:r[1],right:r[2],gap:Math.max(0,o-s+r[2]-r[0])}},kie=bL(),fg="data-scroll-locked",Rie=function(e,r,s,o){var d=e.left,p=e.top,m=e.right,g=e.gap;return s===void 0&&(s="margin"),` - .`.concat(uie,` { +`+y.stack}}var cn=Object.prototype.hasOwnProperty,xe=e.unstable_scheduleCallback,Ne=e.unstable_cancelCallback,Ge=e.unstable_shouldYield,D=e.unstable_requestPaint,z=e.unstable_now,H=e.unstable_getCurrentPriorityLevel,W=e.unstable_ImmediatePriority,we=e.unstable_UserBlockingPriority,Re=e.unstable_NormalPriority,st=e.unstable_LowPriority,Kt=e.unstable_IdlePriority,Qt=e.log,Fn=e.unstable_setDisableYieldValue,dn=null,Ht=null;function wi(a){if(typeof Qt=="function"&&Fn(a),Ht&&typeof Ht.setStrictMode=="function")try{Ht.setStrictMode(dn,a)}catch{}}var Xr=Math.clz32?Math.clz32:Ma,fa=Math.log,uo=Math.LN2;function Ma(a){return a>>>=0,a===0?32:31-(fa(a)/uo|0)|0}var cc=256,xu=262144,uc=4194304;function ma(a){var c=a&42;if(c!==0)return c;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function Lt(a,c,f){var y=a.pendingLanes;if(y===0)return 0;var E=0,O=a.suspendedLanes,B=a.pingedLanes;a=a.warmLanes;var te=y&134217727;return te!==0?(y=te&~O,y!==0?E=ma(y):(B&=te,B!==0?E=ma(B):f||(f=te&~a,f!==0&&(E=ma(f))))):(te=y&~O,te!==0?E=ma(te):B!==0?E=ma(B):f||(f=y&~a,f!==0&&(E=ma(f)))),E===0?0:c!==0&&c!==E&&(c&O)===0&&(O=E&-E,f=c&-c,O>=f||O===32&&(f&4194048)!==0)?c:E}function vr(a,c){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&c)===0}function Yr(a,c){switch(a){case 1:case 2:case 4:case 8:case 64:return c+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Os(){var a=uc;return uc<<=1,(uc&62914560)===0&&(uc=4194304),a}function Dn(a){for(var c=[],f=0;31>f;f++)c.push(a);return c}function Er(a,c){a.pendingLanes|=c,c!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Ys(a,c,f,y,E,O){var B=a.pendingLanes;a.pendingLanes=f,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=f,a.entangledLanes&=f,a.errorRecoveryDisabledLanes&=f,a.shellSuspendCounter=0;var te=a.entanglements,ye=a.expirationTimes,Be=a.hiddenUpdates;for(f=B&~f;0"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var th=/[\n"\\]/g;function Js(a){return a.replace(th,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function Lp(a,c,f,y,E,O,B,te){a.name="",B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"?a.type=B:a.removeAttribute("type"),c!=null?B==="number"?(c===0&&a.value===""||a.value!=c)&&(a.value=""+Ws(c)):a.value!==""+Ws(c)&&(a.value=""+Ws(c)):B!=="submit"&&B!=="reset"||a.removeAttribute("value"),c!=null?zp(a,B,Ws(c)):f!=null?zp(a,B,Ws(f)):y!=null&&a.removeAttribute("value"),E==null&&O!=null&&(a.defaultChecked=!!O),E!=null&&(a.checked=E&&typeof E!="function"&&typeof E!="symbol"),te!=null&&typeof te!="function"&&typeof te!="symbol"&&typeof te!="boolean"?a.name=""+Ws(te):a.removeAttribute("name")}function qg(a,c,f,y,E,O,B,te){if(O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(a.type=O),c!=null||f!=null){if(!(O!=="submit"&&O!=="reset"||c!=null)){ho(a);return}f=f!=null?""+Ws(f):"",c=c!=null?""+Ws(c):f,te||c===a.value||(a.value=c),a.defaultValue=c}y=y??E,y=typeof y!="function"&&typeof y!="symbol"&&!!y,a.checked=te?a.checked:!!y,a.defaultChecked=!!y,B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"&&(a.name=B),ho(a)}function zp(a,c,f){c==="number"&&hl(a.ownerDocument)===a||a.defaultValue===""+f||(a.defaultValue=""+f)}function Au(a,c,f,y){if(a=a.options,c){c={};for(var E=0;E"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Bp=!1;if(ar)try{var po={};Object.defineProperty(po,"passive",{get:function(){Bp=!0}}),window.addEventListener("test",po,po),window.removeEventListener("test",po,po)}catch{Bp=!1}var Rr=null,sh=null,Tu=null;function Cw(){if(Tu)return Tu;var a,c=sh,f=c.length,y,E="value"in Rr?Rr.value:Rr.textContent,O=E.length;for(a=0;a=ba),Uw=" ",Zg=!1;function Kw(a,c){switch(a){case"keyup":return Bw.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wg(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var yc=!1;function Nu(a,c){switch(a){case"compositionend":return Wg(c);case"keypress":return c.which!==32?null:(Zg=!0,Uw);case"textInput":return a=c.data,a===Uw&&Zg?null:a;default:return null}}function uA(a,c){if(yc)return a==="compositionend"||!Gi&&Kw(a,c)?(a=Cw(),Tu=sh=Rr=null,yc=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1=c)return{node:f,offset:c-a};a=y}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=Zw(f)}}function Jw(a,c){return a&&c?a===c?!0:a&&a.nodeType===3?!1:c&&c.nodeType===3?Jw(a,c.parentNode):"contains"in a?a.contains(c):a.compareDocumentPosition?!!(a.compareDocumentPosition(c)&16):!1:!1}function Qw(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var c=hl(a.document);c instanceof a.HTMLIFrameElement;){try{var f=typeof c.contentWindow.location.href=="string"}catch{f=!1}if(f)a=c.contentWindow;else break;c=hl(a.document)}return c}function Qg(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c&&(c==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||c==="textarea"||a.contentEditable==="true")}var e0=ar&&"documentMode"in document&&11>=document.documentMode,fl=null,Lu=null,go=null,Xp=!1;function ey(a,c,f){var y=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;Xp||fl==null||fl!==hl(y)||(y=fl,"selectionStart"in y&&Qg(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),go&&Iu(go,y)||(go=y,y=Yf(Lu,"onSelect"),0>=B,E-=B,Kn=1<<32-Xr(c)+E|f<rn?(wn=Pt,Pt=null):wn=Pt.sibling;var On=Ue($e,Pt,Pe[rn],nt);if(On===null){Pt===null&&(Pt=wn);break}a&&Pt&&On.alternate===null&&c($e,Pt),Ee=O(On,Ee,rn),pn===null?Ut=On:pn.sibling=On,pn=On,Pt=wn}if(rn===Pe.length)return f($e,Pt),vn&&ii($e,rn),Ut;if(Pt===null){for(;rnrn?(wn=Pt,Pt=null):wn=Pt.sibling;var Bl=Ue($e,Pt,On.value,nt);if(Bl===null){Pt===null&&(Pt=wn);break}a&&Pt&&Bl.alternate===null&&c($e,Pt),Ee=O(Bl,Ee,rn),pn===null?Ut=Bl:pn.sibling=Bl,pn=Bl,Pt=wn}if(On.done)return f($e,Pt),vn&&ii($e,rn),Ut;if(Pt===null){for(;!On.done;rn++,On=Pe.next())On=rt($e,On.value,nt),On!==null&&(Ee=O(On,Ee,rn),pn===null?Ut=On:pn.sibling=On,pn=On);return vn&&ii($e,rn),Ut}for(Pt=y(Pt);!On.done;rn++,On=Pe.next())On=Xe(Pt,$e,rn,On.value,nt),On!==null&&(a&&On.alternate!==null&&Pt.delete(On.key===null?rn:On.key),Ee=O(On,Ee,rn),pn===null?Ut=On:pn.sibling=On,pn=On);return a&&Pt.forEach(function(GS){return c($e,GS)}),vn&&ii($e,rn),Ut}function Qn($e,Ee,Pe,nt){if(typeof Pe=="object"&&Pe!==null&&Pe.type===I&&Pe.key===null&&(Pe=Pe.props.children),typeof Pe=="object"&&Pe!==null){switch(Pe.$$typeof){case T:e:{for(var Ut=Pe.key;Ee!==null;){if(Ee.key===Ut){if(Ut=Pe.type,Ut===I){if(Ee.tag===7){f($e,Ee.sibling),nt=E(Ee,Pe.props.children),nt.return=$e,$e=nt;break e}}else if(Ee.elementType===Ut||typeof Ut=="object"&&Ut!==null&&Ut.$$typeof===ne&&kc(Ut)===Ee.type){f($e,Ee.sibling),nt=E(Ee,Pe.props),ks(nt,Pe),nt.return=$e,$e=nt;break e}f($e,Ee);break}else c($e,Ee);Ee=Ee.sibling}Pe.type===I?(nt=gl(Pe.props.children,$e.mode,nt,Pe.key),nt.return=$e,$e=nt):(nt=Bu(Pe.type,Pe.key,Pe.props,null,$e.mode,nt),ks(nt,Pe),nt.return=$e,$e=nt)}return B($e);case M:e:{for(Ut=Pe.key;Ee!==null;){if(Ee.key===Ut)if(Ee.tag===4&&Ee.stateNode.containerInfo===Pe.containerInfo&&Ee.stateNode.implementation===Pe.implementation){f($e,Ee.sibling),nt=E(Ee,Pe.children||[]),nt.return=$e,$e=nt;break e}else{f($e,Ee);break}else c($e,Ee);Ee=Ee.sibling}nt=dy(Pe,$e.mode,nt),nt.return=$e,$e=nt}return B($e);case ne:return Pe=kc(Pe),Qn($e,Ee,Pe,nt)}if(Ke(Pe))return Dt($e,Ee,Pe,nt);if(le(Pe)){if(Ut=le(Pe),typeof Ut!="function")throw Error(o(150));return Pe=Ut.call(Pe),Xt($e,Ee,Pe,nt)}if(typeof Pe.then=="function")return Qn($e,Ee,Wu(Pe),nt);if(Pe.$$typeof===X)return Qn($e,Ee,Hu($e,Pe),nt);Ju($e,Pe)}return typeof Pe=="string"&&Pe!==""||typeof Pe=="number"||typeof Pe=="bigint"?(Pe=""+Pe,Ee!==null&&Ee.tag===6?(f($e,Ee.sibling),nt=E(Ee,Pe),nt.return=$e,$e=nt):(f($e,Ee),nt=Uu(Pe,$e.mode,nt),nt.return=$e,$e=nt),B($e)):f($e,Ee)}return function($e,Ee,Pe,nt){try{Tc=0;var Ut=Qn($e,Ee,Pe,nt);return Zu=null,Ut}catch(Pt){if(Pt===Oc||Pt===Yu)throw Pt;var pn=ti(29,Pt,null,$e.mode);return pn.lanes=nt,pn.return=$e,pn}finally{}}}var _c=So(!0),hh=So(!1),li=!1;function df(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function hf(a,c){a=a.updateQueue,c.updateQueue===a&&(c.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function Eo(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function jl(a,c,f){var y=a.updateQueue;if(y===null)return null;if(y=y.shared,(Hn&2)!==0){var E=y.pending;return E===null?c.next=c:(c.next=E.next,E.next=c),y.pending=c,c=Jp(a),n0(a,null,f),c}return Wp(a,y,c,f),Jp(a)}function Ji(a,c,f){if(c=c.updateQueue,c!==null&&(c=c.shared,(f&4194048)!==0)){var y=c.lanes;y&=a.pendingLanes,f|=y,c.lanes=f,gs(a,f)}}function Qu(a,c){var f=a.updateQueue,y=a.alternate;if(y!==null&&(y=y.updateQueue,f===y)){var E=null,O=null;if(f=f.firstBaseUpdate,f!==null){do{var B={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};O===null?E=O=B:O=O.next=B,f=f.next}while(f!==null);O===null?E=O=c:O=O.next=c}else E=O=c;f={baseState:y.baseState,firstBaseUpdate:E,lastBaseUpdate:O,shared:y.shared,callbacks:y.callbacks},a.updateQueue=f;return}a=f.lastBaseUpdate,a===null?f.firstBaseUpdate=c:a.next=c,f.lastBaseUpdate=c}var $c=!1;function ph(){if($c){var a=qa;if(a!==null)throw a}}function fh(a,c,f,y){$c=!1;var E=a.updateQueue;li=!1;var O=E.firstBaseUpdate,B=E.lastBaseUpdate,te=E.shared.pending;if(te!==null){E.shared.pending=null;var ye=te,Be=ye.next;ye.next=null,B===null?O=Be:B.next=Be,B=ye;var We=a.alternate;We!==null&&(We=We.updateQueue,te=We.lastBaseUpdate,te!==B&&(te===null?We.firstBaseUpdate=Be:te.next=Be,We.lastBaseUpdate=ye))}if(O!==null){var rt=E.baseState;B=0,We=Be=ye=null,te=O;do{var Ue=te.lane&-536870913,Xe=Ue!==te.lane;if(Xe?(An&Ue)===Ue:(y&Ue)===Ue){Ue!==0&&Ue===Sl&&($c=!0),We!==null&&(We=We.next={lane:0,tag:te.tag,payload:te.payload,callback:null,next:null});e:{var Dt=a,Xt=te;Ue=c;var Qn=f;switch(Xt.tag){case 1:if(Dt=Xt.payload,typeof Dt=="function"){rt=Dt.call(Qn,rt,Ue);break e}rt=Dt;break e;case 3:Dt.flags=Dt.flags&-65537|128;case 0:if(Dt=Xt.payload,Ue=typeof Dt=="function"?Dt.call(Qn,rt,Ue):Dt,Ue==null)break e;rt=A({},rt,Ue);break e;case 2:li=!0}}Ue=te.callback,Ue!==null&&(a.flags|=64,Xe&&(a.flags|=8192),Xe=E.callbacks,Xe===null?E.callbacks=[Ue]:Xe.push(Ue))}else Xe={lane:Ue,tag:te.tag,payload:te.payload,callback:te.callback,next:null},We===null?(Be=We=Xe,ye=rt):We=We.next=Xe,B|=Ue;if(te=te.next,te===null){if(te=E.shared.pending,te===null)break;Xe=te,te=Xe.next,Xe.next=null,E.lastBaseUpdate=Xe,E.shared.pending=null}}while(!0);We===null&&(ye=rt),E.baseState=ye,E.firstBaseUpdate=Be,E.lastBaseUpdate=We,O===null&&(E.shared.lanes=0),Ga|=B,a.lanes=B,a.memoizedState=rt}}function pf(a,c){if(typeof a!="function")throw Error(o(191,a));a.call(c)}function l0(a,c){var f=a.callbacks;if(f!==null)for(a.callbacks=null,a=0;aO?O:8;var B=ce.T,te={};ce.T=te,Yy(a,!1,c,f);try{var ye=E(),Be=ce.S;if(Be!==null&&Be(te,ye),ye!==null&&typeof ye=="object"&&typeof ye.then=="function"){var We=sf(ye,y);wh(a,c,We,ki(a))}else wh(a,c,y,ki(a))}catch(rt){wh(a,c,{then:function(){},status:"rejected",reason:rt},ki())}finally{re.p=O,B!==null&&te.types!==null&&(B.types=te.types),ce.T=B}}function vA(){}function Vy(a,c,f,y){if(a.tag!==5)throw Error(o(476));var E=Hy(a).queue;S0(a,E,c,ue,f===null?vA:function(){return Gy(a),f(y)})}function Hy(a){var c=a.memoizedState;if(c!==null)return c;c={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ta,lastRenderedState:ue},next:null};var f={};return c.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ta,lastRenderedState:f},next:null},a.memoizedState=c,a=a.alternate,a!==null&&(a.memoizedState=c),c}function Gy(a){var c=Hy(a);c.next===null&&(c=a.alternate.memoizedState),wh(a,c.next.queue,{},ki())}function bh(){return Wr(bd)}function E0(){return Mr().memoizedState}function Xy(){return Mr().memoizedState}function xA(a){for(var c=a.return;c!==null;){switch(c.tag){case 24:case 3:var f=ki();a=Eo(f);var y=jl(c,a,f);y!==null&&(_s(y,c,f),Ji(y,c,f)),c={cache:rf()},a.payload=c;return}c=c.return}}function j0(a,c,f){var y=ki();f={lane:y,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},xf(a)?A0(c,f):(f=cy(a,c,f,y),f!==null&&(_s(f,a,y),O0(f,c,y)))}function C0(a,c,f){var y=ki();wh(a,c,f,y)}function wh(a,c,f,y){var E={lane:y,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if(xf(a))A0(c,E);else{var O=a.alternate;if(a.lanes===0&&(O===null||O.lanes===0)&&(O=c.lastRenderedReducer,O!==null))try{var B=c.lastRenderedState,te=O(B,f);if(E.hasEagerState=!0,E.eagerState=te,ei(te,B))return Wp(a,c,E,0),lr===null&&Zp(),!1}catch{}finally{}if(f=cy(a,c,E,y),f!==null)return _s(f,a,y),O0(f,c,y),!0}return!1}function Yy(a,c,f,y){if(y={lane:2,revertLane:Nv(),gesture:null,action:y,hasEagerState:!1,eagerState:null,next:null},xf(a)){if(c)throw Error(o(479))}else c=cy(a,f,y,2),c!==null&&_s(c,a,2)}function xf(a){var c=a.alternate;return a===en||c!==null&&c===en}function A0(a,c){Nc=mh=!0;var f=a.pending;f===null?c.next=c:(c.next=f.next,f.next=c),a.pending=c}function O0(a,c,f){if((f&4194048)!==0){var y=c.lanes;y&=a.pendingLanes,f|=y,c.lanes=f,gs(a,f)}}var Sh={readContext:Wr,use:mf,useCallback:Cr,useContext:Cr,useEffect:Cr,useImperativeHandle:Cr,useLayoutEffect:Cr,useInsertionEffect:Cr,useMemo:Cr,useReducer:Cr,useRef:Cr,useState:Cr,useDebugValue:Cr,useDeferredValue:Cr,useTransition:Cr,useSyncExternalStore:Cr,useId:Cr,useHostTransitionStatus:Cr,useFormState:Cr,useActionState:Cr,useOptimistic:Cr,useMemoCache:Cr,useCacheRefresh:Cr};Sh.useEffectEvent=Cr;var k0={readContext:Wr,use:mf,useCallback:function(a,c){return Rs().memoizedState=[a,c===void 0?null:c],a},useContext:Wr,useEffect:zy,useImperativeHandle:function(a,c,f){f=f!=null?f.concat([a]):null,xh(4194308,4,b0.bind(null,c,a),f)},useLayoutEffect:function(a,c){return xh(4194308,4,a,c)},useInsertionEffect:function(a,c){xh(4,2,a,c)},useMemo:function(a,c){var f=Rs();c=c===void 0?null:c;var y=a();if(jo){wi(!0);try{a()}finally{wi(!1)}}return f.memoizedState=[y,c],y},useReducer:function(a,c,f){var y=Rs();if(f!==void 0){var E=f(c);if(jo){wi(!0);try{f(c)}finally{wi(!1)}}}else E=c;return y.memoizedState=y.baseState=E,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:E},y.queue=a,a=a.dispatch=j0.bind(null,en,a),[y.memoizedState,a]},useRef:function(a){var c=Rs();return a={current:a},c.memoizedState=a},useState:function(a){a=Ny(a);var c=a.queue,f=C0.bind(null,en,c);return c.dispatch=f,[a.memoizedState,f]},useDebugValue:qy,useDeferredValue:function(a,c){var f=Rs();return Ky(f,a,c)},useTransition:function(){var a=Ny(!1);return a=S0.bind(null,en,a.queue,!0,!1),Rs().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,c,f){var y=en,E=Rs();if(vn){if(f===void 0)throw Error(o(407));f=f()}else{if(f=c(),lr===null)throw Error(o(349));(An&127)!==0||Ry(y,c,f)}E.memoizedState=f;var O={value:f,getSnapshot:c};return E.queue=O,zy(d0.bind(null,y,O,a),[a]),y.flags|=2048,id(9,{destroy:void 0},Ty.bind(null,y,O,f,c),null),f},useId:function(){var a=Rs(),c=lr.identifierPrefix;if(vn){var f=La,y=Kn;f=(y&~(1<<32-Xr(y)-1)).toString(32)+f,c="_"+c+"R_"+f,f=gh++,0<\/script>",O=O.removeChild(O.firstChild);break;case"select":O=typeof y.is=="string"?B.createElement("select",{is:y.is}):B.createElement("select"),y.multiple?O.multiple=!0:y.size&&(O.size=y.size);break;default:O=typeof y.is=="string"?B.createElement(E,{is:y.is}):B.createElement(E)}}O[ss]=c,O[Ps]=y;e:for(B=c.child;B!==null;){if(B.tag===5||B.tag===6)O.appendChild(B.stateNode);else if(B.tag!==4&&B.tag!==27&&B.child!==null){B.child.return=B,B=B.child;continue}if(B===c)break e;for(;B.sibling===null;){if(B.return===null||B.return===c)break e;B=B.return}B.sibling.return=B.return,B=B.sibling}c.stateNode=O;e:switch(vs(O,E,y),E){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}y&&Oo(c)}}return or(c),cv(c,c.type,a===null?null:a.memoizedProps,c.pendingProps,f),null;case 6:if(a&&c.stateNode!=null)a.memoizedProps!==y&&Oo(c);else{if(typeof y!="string"&&c.stateNode===null)throw Error(o(166));if(a=De.current,Vu(c)){if(a=c.stateNode,f=c.memoizedProps,y=null,E=Fr,E!==null)switch(E.tag){case 27:case 5:y=E.memoizedProps}a[ss]=c,a=!!(a.nodeValue===f||y!==null&&y.suppressHydrationWarning===!0||zh(a.nodeValue,f)),a||xl(c,!0)}else a=qc(a).createTextNode(y),a[ss]=c,c.stateNode=a}return or(c),null;case 31:if(f=c.memoizedState,a===null||a.memoizedState!==null){if(y=Vu(c),f!==null){if(a===null){if(!y)throw Error(o(318));if(a=c.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(o(557));a[ss]=c}else za(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;or(c),a=!1}else f=py(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=f),a=!0;if(!a)return c.flags&256?(Is(c),c):(Is(c),null);if((c.flags&128)!==0)throw Error(o(558))}return or(c),null;case 13:if(y=c.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(E=Vu(c),y!==null&&y.dehydrated!==null){if(a===null){if(!E)throw Error(o(318));if(E=c.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(o(317));E[ss]=c}else za(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;or(c),E=!1}else E=py(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=E),E=!0;if(!E)return c.flags&256?(Is(c),c):(Is(c),null)}return Is(c),(c.flags&128)!==0?(c.lanes=f,c):(f=y!==null,a=a!==null&&a.memoizedState!==null,f&&(y=c.child,E=null,y.alternate!==null&&y.alternate.memoizedState!==null&&y.alternate.memoizedState.cachePool!==null&&(E=y.alternate.memoizedState.cachePool.pool),O=null,y.memoizedState!==null&&y.memoizedState.cachePool!==null&&(O=y.memoizedState.cachePool.pool),O!==E&&(y.flags|=2048)),f!==a&&f&&(c.child.flags|=8192),Of(c,c.updateQueue),or(c),null);case 4:return ft(),a===null&&Xf(c.stateNode.containerInfo),or(c),null;case 10:return oi(c.type),or(c),null;case 19:if(Oe(jr),y=c.memoizedState,y===null)return or(c),null;if(E=(c.flags&128)!==0,O=y.rendering,O===null)if(E)ld(y,!1);else{if(Ar!==0||a!==null&&(a.flags&128)!==0)for(a=c.child;a!==null;){if(O=ff(a),O!==null){for(c.flags|=128,ld(y,!1),a=O.updateQueue,c.updateQueue=a,Of(c,a),c.subtreeFlags=0,a=f,f=c.child;f!==null;)uy(f,a),f=f.sibling;return ke(jr,jr.current&1|2),vn&&ii(c,y.treeForkCount),c.child}a=a.sibling}y.tail!==null&&z()>Df&&(c.flags|=128,E=!0,ld(y,!1),c.lanes=4194304)}else{if(!E)if(a=ff(O),a!==null){if(c.flags|=128,E=!0,a=a.updateQueue,c.updateQueue=a,Of(c,a),ld(y,!0),y.tail===null&&y.tailMode==="hidden"&&!O.alternate&&!vn)return or(c),null}else 2*z()-y.renderingStartTime>Df&&f!==536870912&&(c.flags|=128,E=!0,ld(y,!1),c.lanes=4194304);y.isBackwards?(O.sibling=c.child,c.child=O):(a=y.last,a!==null?a.sibling=O:c.child=O,y.last=O)}return y.tail!==null?(a=y.tail,y.rendering=a,y.tail=a.sibling,y.renderingStartTime=z(),a.sibling=null,f=jr.current,ke(jr,E?f&1|2:f&1),vn&&ii(c,y.treeForkCount),a):(or(c),null);case 22:case 23:return Is(c),nd(),y=c.memoizedState!==null,a!==null?a.memoizedState!==null!==y&&(c.flags|=8192):y&&(c.flags|=8192),y?(f&536870912)!==0&&(c.flags&128)===0&&(or(c),c.subtreeFlags&6&&(c.flags|=8192)):or(c),f=c.updateQueue,f!==null&&Of(c,f.retryQueue),f=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),y=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(y=c.memoizedState.cachePool.pool),y!==f&&(c.flags|=2048),a!==null&&Oe(El),null;case 24:return f=null,a!==null&&(f=a.memoizedState.cache),c.memoizedState.cache!==f&&(c.flags|=2048),oi(Dr),or(c),null;case 25:return null;case 30:return null}throw Error(o(156,c.tag))}function uv(a,c){switch(xo(c),c.tag){case 1:return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 3:return oi(Dr),ft(),a=c.flags,(a&65536)!==0&&(a&128)===0?(c.flags=a&-65537|128,c):null;case 26:case 27:case 5:return Ft(c),null;case 31:if(c.memoizedState!==null){if(Is(c),c.alternate===null)throw Error(o(340));za()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 13:if(Is(c),a=c.memoizedState,a!==null&&a.dehydrated!==null){if(c.alternate===null)throw Error(o(340));za()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 19:return Oe(jr),null;case 4:return ft(),null;case 10:return oi(c.type),null;case 22:case 23:return Is(c),nd(),a!==null&&Oe(El),a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 24:return oi(Dr),null;case 25:return null;default:return null}}function U0(a,c){switch(xo(c),c.tag){case 3:oi(Dr),ft();break;case 26:case 27:case 5:Ft(c);break;case 4:ft();break;case 31:c.memoizedState!==null&&Is(c);break;case 13:Is(c);break;case 19:Oe(jr);break;case 10:oi(c.type);break;case 22:case 23:Is(c),nd(),a!==null&&Oe(El);break;case 24:oi(Dr)}}function jh(a,c){try{var f=c.updateQueue,y=f!==null?f.lastEffect:null;if(y!==null){var E=y.next;f=E;do{if((f.tag&a)===a){y=void 0;var O=f.create,B=f.inst;y=O(),B.destroy=y}f=f.next}while(f!==E)}}catch(te){Xn(c,c.return,te)}}function Tl(a,c,f){try{var y=c.updateQueue,E=y!==null?y.lastEffect:null;if(E!==null){var O=E.next;y=O;do{if((y.tag&a)===a){var B=y.inst,te=B.destroy;if(te!==void 0){B.destroy=void 0,E=c;var ye=f,Be=te;try{Be()}catch(We){Xn(E,ye,We)}}}y=y.next}while(y!==O)}}catch(We){Xn(c,c.return,We)}}function K0(a){var c=a.updateQueue;if(c!==null){var f=a.stateNode;try{l0(c,f)}catch(y){Xn(a,a.return,y)}}}function V0(a,c,f){f.props=Mc(a.type,a.memoizedProps),f.state=a.memoizedState;try{f.componentWillUnmount()}catch(y){Xn(a,c,y)}}function Ch(a,c){try{var f=a.ref;if(f!==null){switch(a.tag){case 26:case 27:case 5:var y=a.stateNode;break;case 30:y=a.stateNode;break;default:y=a.stateNode}typeof f=="function"?a.refCleanup=f(y):f.current=y}}catch(E){Xn(a,c,E)}}function Ha(a,c){var f=a.ref,y=a.refCleanup;if(f!==null)if(typeof y=="function")try{y()}catch(E){Xn(a,c,E)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(E){Xn(a,c,E)}else f.current=null}function H0(a){var c=a.type,f=a.memoizedProps,y=a.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":f.autoFocus&&y.focus();break e;case"img":f.src?y.src=f.src:f.srcSet&&(y.srcset=f.srcSet)}}catch(E){Xn(a,a.return,E)}}function Ah(a,c,f){try{var y=a.stateNode;NA(y,a.type,f,c),y[Ps]=c}catch(E){Xn(a,a.return,E)}}function dv(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Il(a.type)||a.tag===4}function hv(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||dv(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&Il(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function pv(a,c,f){var y=a.tag;if(y===5||y===6)a=a.stateNode,c?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(a,c):(c=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,c.appendChild(a),f=f._reactRootContainer,f!=null||c.onclick!==null||(c.onclick=xa));else if(y!==4&&(y===27&&Il(a.type)&&(f=a.stateNode,c=null),a=a.child,a!==null))for(pv(a,c,f),a=a.sibling;a!==null;)pv(a,c,f),a=a.sibling}function kf(a,c,f){var y=a.tag;if(y===5||y===6)a=a.stateNode,c?f.insertBefore(a,c):f.appendChild(a);else if(y!==4&&(y===27&&Il(a.type)&&(f=a.stateNode),a=a.child,a!==null))for(kf(a,c,f),a=a.sibling;a!==null;)kf(a,c,f),a=a.sibling}function Rf(a){var c=a.stateNode,f=a.memoizedProps;try{for(var y=a.type,E=c.attributes;E.length;)c.removeAttributeNode(E[0]);vs(c,y,f),c[ss]=a,c[Ps]=f}catch(O){Xn(a,a.return,O)}}var ko=!1,Br=!1,fv=!1,G0=typeof WeakSet=="function"?WeakSet:Set,ls=null;function X0(a,c){if(a=a.containerInfo,Zf=lm,a=Qw(a),Qg(a)){if("selectionStart"in a)var f={start:a.selectionStart,end:a.selectionEnd};else e:{f=(f=a.ownerDocument)&&f.defaultView||window;var y=f.getSelection&&f.getSelection();if(y&&y.rangeCount!==0){f=y.anchorNode;var E=y.anchorOffset,O=y.focusNode;y=y.focusOffset;try{f.nodeType,O.nodeType}catch{f=null;break e}var B=0,te=-1,ye=-1,Be=0,We=0,rt=a,Ue=null;t:for(;;){for(var Xe;rt!==f||E!==0&&rt.nodeType!==3||(te=B+E),rt!==O||y!==0&&rt.nodeType!==3||(ye=B+y),rt.nodeType===3&&(B+=rt.nodeValue.length),(Xe=rt.firstChild)!==null;)Ue=rt,rt=Xe;for(;;){if(rt===a)break t;if(Ue===f&&++Be===E&&(te=B),Ue===O&&++We===y&&(ye=B),(Xe=rt.nextSibling)!==null)break;rt=Ue,Ue=rt.parentNode}rt=Xe}f=te===-1||ye===-1?null:{start:te,end:ye}}else f=null}f=f||{start:0,end:0}}else f=null;for(Wf={focusedElem:a,selectionRange:f},lm=!1,ls=c;ls!==null;)if(c=ls,a=c.child,(c.subtreeFlags&1028)!==0&&a!==null)a.return=c,ls=a;else for(;ls!==null;){switch(c=ls,O=c.alternate,a=c.flags,c.tag){case 0:if((a&4)!==0&&(a=c.updateQueue,a=a!==null?a.events:null,a!==null))for(f=0;f title"))),vs(O,y,f),O[ss]=a,Zr(O),y=O;break e;case"link":var B=IS("link","href",E).get(y+(f.href||""));if(B){for(var te=0;teQn&&(B=Qn,Qn=Xt,Xt=B);var $e=Ww(te,Xt),Ee=Ww(te,Qn);if($e&&Ee&&(Xe.rangeCount!==1||Xe.anchorNode!==$e.node||Xe.anchorOffset!==$e.offset||Xe.focusNode!==Ee.node||Xe.focusOffset!==Ee.offset)){var Pe=rt.createRange();Pe.setStart($e.node,$e.offset),Xe.removeAllRanges(),Xt>Qn?(Xe.addRange(Pe),Xe.extend(Ee.node,Ee.offset)):(Pe.setEnd(Ee.node,Ee.offset),Xe.addRange(Pe))}}}}for(rt=[],Xe=te;Xe=Xe.parentNode;)Xe.nodeType===1&&rt.push({element:Xe,left:Xe.scrollLeft,top:Xe.scrollTop});for(typeof te.focus=="function"&&te.focus(),te=0;tef?32:f,ce.T=null,f=Mf,Mf=null;var O=Dl,B=No;if(Jr=0,dd=Dl=null,No=0,(Hn&6)!==0)throw Error(o(331));var te=Hn;if(Hn|=4,tS(O.current),vv(O,O.current,B,f),Hn=te,pd(0,!1),Ht&&typeof Ht.onPostCommitFiberRoot=="function")try{Ht.onPostCommitFiberRoot(dn,O)}catch{}return!0}finally{re.p=E,ce.T=y,mS(a,c)}}function gS(a,c,f){c=ri(f,c),c=Jy(a.stateNode,c,2),a=jl(a,c,2),a!==null&&(Er(a,2),Xa(a))}function Xn(a,c,f){if(a.tag===3)gS(a,a,f);else for(;c!==null;){if(c.tag===3){gS(c,a,f);break}else if(c.tag===1){var y=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(Nl===null||!Nl.has(y))){a=ri(f,a),f=Qy(2),y=jl(c,f,2),y!==null&&(Cl(f,y,c,a),Er(y,2),Xa(y));break}}c=c.return}}function Ov(a,c,f){var y=a.pingCache;if(y===null){y=a.pingCache=new jA;var E=new Set;y.set(c,E)}else E=y.get(c),E===void 0&&(E=new Set,y.set(c,E));E.has(f)||(bv=!0,E.add(f),a=Uf.bind(null,a,c,f),c.then(a,a))}function Uf(a,c,f){var y=a.pingCache;y!==null&&y.delete(c),a.pingedLanes|=a.suspendedLanes&f,a.warmLanes&=~f,lr===a&&(An&f)===f&&(Ar===4||Ar===3&&(An&62914560)===An&&300>z()-$h?(Hn&2)===0&&Ml(a,0):$f|=f,$l===An&&($l=0)),Xa(a)}function kv(a,c){c===0&&(c=Os()),a=bc(a,c),a!==null&&(Er(a,c),Xa(a))}function kA(a){var c=a.memoizedState,f=0;c!==null&&(f=c.retryLane),kv(a,f)}function RA(a,c){var f=0;switch(a.tag){case 31:case 13:var y=a.stateNode,E=a.memoizedState;E!==null&&(f=E.retryLane);break;case 19:y=a.stateNode;break;case 22:y=a.stateNode._retryCache;break;default:throw Error(o(314))}y!==null&&y.delete(c),kv(a,f)}function Rv(a,c){return xe(a,c)}var Kf=null,Fc=null,Tv=!1,Vf=!1,_v=!1,Aa=0;function Xa(a){a!==Fc&&a.next===null&&(Fc===null?Kf=Fc=a:Fc=Fc.next=a),Vf=!0,Tv||(Tv=!0,TA())}function pd(a,c){if(!_v&&Vf){_v=!0;do for(var f=!1,y=Kf;y!==null;){if(a!==0){var E=y.pendingLanes;if(E===0)var O=0;else{var B=y.suspendedLanes,te=y.pingedLanes;O=(1<<31-Xr(42|a)+1)-1,O&=E&~(B&~te),O=O&201326741?O&201326741|1:O?O|2:0}O!==0&&(f=!0,xS(y,O))}else O=An,O=Lt(y,y===lr?O:0,y.cancelPendingCommit!==null||y.timeoutHandle!==-1),(O&3)===0||vr(y,O)||(f=!0,xS(y,O));y=y.next}while(f);_v=!1}}function $v(){Hf()}function Hf(){Vf=Tv=!1;var a=0;Aa!==0&&PA()&&(a=Aa);for(var c=z(),f=null,y=Kf;y!==null;){var E=y.next,O=yS(y,c);O===0?(y.next=null,f===null?Kf=E:f.next=E,E===null&&(Fc=f)):(f=y,(a!==0||(O&3)!==0)&&(Vf=!0)),y=E}Jr!==0&&Jr!==5||pd(a),Aa!==0&&(Aa=0)}function yS(a,c){for(var f=a.suspendedLanes,y=a.pingedLanes,E=a.expirationTimes,O=a.pendingLanes&-62914561;0te)break;var We=ye.transferSize,rt=ye.initiatorType;We&&Lv(rt)&&(ye=ye.responseEnd,B+=We*(ye"u"?null:document;function TS(a,c,f){var y=Bc;if(y&&typeof c=="string"&&c){var E=Js(c);E='link[rel="'+a+'"][href="'+E+'"]',typeof f=="string"&&(E+='[crossorigin="'+f+'"]'),Gv.has(E)||(Gv.add(E),a={rel:a,crossOrigin:f,href:c},y.querySelector(E)===null&&(c=y.createElement("link"),vs(c,"link",a),Zr(c),y.head.appendChild(c)))}}function Xv(a){Do.D(a),TS("dns-prefetch",a,null)}function _S(a,c){Do.C(a,c),TS("preconnect",a,c)}function zA(a,c,f){Do.L(a,c,f);var y=Bc;if(y&&a&&c){var E='link[rel="preload"][as="'+Js(c)+'"]';c==="image"&&f&&f.imageSrcSet?(E+='[imagesrcset="'+Js(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(E+='[imagesizes="'+Js(f.imageSizes)+'"]')):E+='[href="'+Js(a)+'"]';var O=E;switch(c){case"style":O=vd(a);break;case"script":O=zl(a)}na.has(O)||(a=A({rel:"preload",href:c==="image"&&f&&f.imageSrcSet?void 0:a,as:c},f),na.set(O,a),y.querySelector(E)!==null||c==="style"&&y.querySelector(Uh(O))||c==="script"&&y.querySelector(Kh(O))||(c=y.createElement("link"),vs(c,"link",a),Zr(c),y.head.appendChild(c)))}}function $S(a,c){Do.m(a,c);var f=Bc;if(f&&a){var y=c&&typeof c.as=="string"?c.as:"script",E='link[rel="modulepreload"][as="'+Js(y)+'"][href="'+Js(a)+'"]',O=E;switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":O=zl(a)}if(!na.has(O)&&(a=A({rel:"modulepreload",href:a},c),na.set(O,a),f.querySelector(E)===null)){switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(Kh(O)))return}y=f.createElement("link"),vs(y,"link",a),Zr(y),f.head.appendChild(y)}}}function FA(a,c,f){Do.S(a,c,f);var y=Bc;if(y&&a){var E=ul(y).hoistableStyles,O=vd(a);c=c||"default";var B=E.get(O);if(!B){var te={loading:0,preload:null};if(B=y.querySelector(Uh(O)))te.loading=5;else{a=A({rel:"stylesheet",href:a,"data-precedence":c},f),(f=na.get(O))&&Yv(a,f);var ye=B=y.createElement("link");Zr(ye),vs(ye,"link",a),ye._p=new Promise(function(Be,We){ye.onload=Be,ye.onerror=We}),ye.addEventListener("load",function(){te.loading|=1}),ye.addEventListener("error",function(){te.loading|=2}),te.loading|=4,rm(B,c,y)}B={type:"stylesheet",instance:B,count:1,state:te},E.set(O,B)}}}function qA(a,c){Do.X(a,c);var f=Bc;if(f&&a){var y=ul(f).hoistableScripts,E=zl(a),O=y.get(E);O||(O=f.querySelector(Kh(E)),O||(a=A({src:a,async:!0},c),(c=na.get(E))&&Zv(a,c),O=f.createElement("script"),Zr(O),vs(O,"link",a),f.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},y.set(E,O))}}function BA(a,c){Do.M(a,c);var f=Bc;if(f&&a){var y=ul(f).hoistableScripts,E=zl(a),O=y.get(E);O||(O=f.querySelector(Kh(E)),O||(a=A({src:a,async:!0,type:"module"},c),(c=na.get(E))&&Zv(a,c),O=f.createElement("script"),Zr(O),vs(O,"link",a),f.head.appendChild(O)),O={type:"script",instance:O,count:1,state:null},y.set(E,O))}}function NS(a,c,f,y){var E=(E=De.current)?nm(E):null;if(!E)throw Error(o(446));switch(a){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(c=vd(f.href),f=ul(E).hoistableStyles,y=f.get(c),y||(y={type:"style",instance:null,count:0,state:null},f.set(c,y)),y):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){a=vd(f.href);var O=ul(E).hoistableStyles,B=O.get(a);if(B||(E=E.ownerDocument||E,B={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},O.set(a,B),(O=E.querySelector(Uh(a)))&&!O._p&&(B.instance=O,B.state.loading=5),na.has(a)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},na.set(a,f),O||PS(E,a,f,B.state))),c&&y===null)throw Error(o(528,""));return B}if(c&&y!==null)throw Error(o(529,""));return null;case"script":return c=f.async,f=f.src,typeof f=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=zl(f),f=ul(E).hoistableScripts,y=f.get(c),y||(y={type:"script",instance:null,count:0,state:null},f.set(c,y)),y):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,a))}}function vd(a){return'href="'+Js(a)+'"'}function Uh(a){return'link[rel="stylesheet"]['+a+"]"}function DS(a){return A({},a,{"data-precedence":a.precedence,precedence:null})}function PS(a,c,f,y){a.querySelector('link[rel="preload"][as="style"]['+c+"]")?y.loading=1:(c=a.createElement("link"),y.preload=c,c.addEventListener("load",function(){return y.loading|=1}),c.addEventListener("error",function(){return y.loading|=2}),vs(c,"link",f),Zr(c),a.head.appendChild(c))}function zl(a){return'[src="'+Js(a)+'"]'}function Kh(a){return"script[async]"+a}function MS(a,c,f){if(c.count++,c.instance===null)switch(c.type){case"style":var y=a.querySelector('style[data-href~="'+Js(f.href)+'"]');if(y)return c.instance=y,Zr(y),y;var E=A({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return y=(a.ownerDocument||a).createElement("style"),Zr(y),vs(y,"style",E),rm(y,f.precedence,a),c.instance=y;case"stylesheet":E=vd(f.href);var O=a.querySelector(Uh(E));if(O)return c.state.loading|=4,c.instance=O,Zr(O),O;y=DS(f),(E=na.get(E))&&Yv(y,E),O=(a.ownerDocument||a).createElement("link"),Zr(O);var B=O;return B._p=new Promise(function(te,ye){B.onload=te,B.onerror=ye}),vs(O,"link",y),c.state.loading|=4,rm(O,f.precedence,a),c.instance=O;case"script":return O=zl(f.src),(E=a.querySelector(Kh(O)))?(c.instance=E,Zr(E),E):(y=f,(E=na.get(O))&&(y=A({},f),Zv(y,E)),a=a.ownerDocument||a,E=a.createElement("script"),Zr(E),vs(E,"link",y),a.head.appendChild(E),c.instance=E);case"void":return null;default:throw Error(o(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(y=c.instance,c.state.loading|=4,rm(y,f.precedence,a));return c.instance}function rm(a,c,f){for(var y=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),E=y.length?y[y.length-1]:null,O=E,B=0;B title"):null)}function UA(a,c,f){if(f===1||c.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;switch(c.rel){case"stylesheet":return a=c.disabled,typeof c.precedence=="string"&&a==null;default:return!0}case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function zS(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function FS(a,c,f,y){if(f.type==="stylesheet"&&(typeof y.media!="string"||matchMedia(y.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var E=vd(y.href),O=c.querySelector(Uh(E));if(O){c=O._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(a.count++,a=Uc.bind(a),c.then(a,a)),f.state.loading|=4,f.instance=O,Zr(O);return}O=c.ownerDocument||c,y=DS(y),(E=na.get(E))&&Yv(y,E),O=O.createElement("link"),Zr(O);var B=O;B._p=new Promise(function(te,ye){B.onload=te,B.onerror=ye}),vs(O,"link",y),f.instance=O}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(f,c),(c=f.state.preload)&&(f.state.loading&3)===0&&(a.count++,f=Uc.bind(a),c.addEventListener("load",f),c.addEventListener("error",f))}}var im=0;function KA(a,c){return a.stylesheets&&a.count===0&&am(a,a.stylesheets),0im?50:800)+c);return a.unsuspend=f,function(){a.unsuspend=null,clearTimeout(y),clearTimeout(E)}}:null}function Uc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)am(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var xd=null;function am(a,c){a.stylesheets=null,a.unsuspend!==null&&(a.count++,xd=new Map,c.forEach(qS,a),xd=null,Uc.call(a))}function qS(a,c){if(!(c.state.loading&4)){var f=xd.get(a);if(f)var y=f.get(null);else{f=new Map,xd.set(a,f);for(var E=a.querySelectorAll("link[data-precedence],style[data-precedence]"),O=0;O"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}return e(),TR.exports=hJ(),TR.exports}var fJ=pJ();const Tj="autoglue.tokens",_T="autoglue.auth-change";let Jl=$T();function $T(){try{const e=localStorage.getItem(Tj);return e?JSON.parse(e):null}catch{return null}}function mJ(e){e?localStorage.setItem(Tj,JSON.stringify(e)):localStorage.removeItem(Tj)}function gJ(e){window.dispatchEvent(new CustomEvent(_T,{detail:e}))}const Ks={get(){return Jl},set(e){Jl=e,mJ(e),gJ(e)},reload(){return Jl=$T(),Jl},isAuthed(){return!!Jl?.access_token},getAccessToken(){return Jl?.access_token??null},isExpired(e=Math.floor(Date.now()/1e3)){const r=MM(Jl?.access_token);return r!==null?e>=r:!0},willExpireSoon(e=60,r=Math.floor(Date.now()/1e3)){const s=MM(Jl?.access_token);return s!==null?s-r<=e:!0},logout(){Ks.set(null)},subscribe(e){const r=o=>e(o.detail??null),s=o=>{o.key===Tj&&(Jl=$T(),e(Jl))};return window.addEventListener(_T,r),window.addEventListener("storage",s),()=>{window.removeEventListener(_T,r),window.removeEventListener("storage",s)}}};function MM(e){if(!e)return null;const r=e.split(".");if(r.length<2)return null;try{const s=JSON.parse(atob(yJ(r[1])));return(typeof s?.exp=="number"?s.exp:null)??null}catch{return null}}function yJ(e){return e.replace(/-/g,"+").replace(/_/g,"/")+"==".slice((2-e.length*3%4)%4)}const NT="autoglue.org";let qE=localStorage.getItem(NT);const Qo={get(){return qE},set(e){qE=e,localStorage.setItem(NT,e),window.dispatchEvent(new CustomEvent("autoglue:org-change",{detail:e}))},subscribe(e){const r=o=>e(o.detail??null),s=o=>{o.key===NT&&(qE=o.newValue,e(qE))};return window.addEventListener("autoglue:org-change",r),window.addEventListener("storage",s),()=>{window.removeEventListener("autoglue:org-change",r),window.removeEventListener("storage",s)}}},vJ="https://autoglue.glueopshosted.com/api/v1".replace(/\/+$/,"");class uL{constructor(r={}){this.configuration=r}set config(r){this.configuration=r}get basePath(){return this.configuration.basePath!=null?this.configuration.basePath:vJ}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||dL}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){const r=this.configuration.apiKey;if(r)return typeof r=="function"?r:()=>r}get accessToken(){const r=this.configuration.accessToken;if(r)return typeof r=="function"?r:async()=>r}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}}const xJ=new uL;class Gs{constructor(r=xJ){this.configuration=r,this.middleware=r.middleware}static jsonRegex=new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$","i");middleware;withMiddleware(...r){const s=this.clone();return s.middleware=s.middleware.concat(...r),s}withPreMiddleware(...r){const s=r.map(o=>({pre:o}));return this.withMiddleware(...s)}withPostMiddleware(...r){const s=r.map(o=>({post:o}));return this.withMiddleware(...s)}isJsonMime(r){return r?Gs.jsonRegex.test(r):!1}async request(r,s){const{url:o,init:d}=await this.createFetchParams(r,s),p=await this.fetchApi(o,d);if(p&&p.status>=200&&p.status<300)return p;throw new SJ(p,"Response returned an error code")}async createFetchParams(r,s){let o=this.configuration.basePath+r.path;r.query!==void 0&&Object.keys(r.query).length!==0&&(o+="?"+this.configuration.queryParamsStringify(r.query));const d=Object.assign({},this.configuration.headers,r.headers);Object.keys(d).forEach(j=>d[j]===void 0?delete d[j]:{});const p=typeof s=="function"?s:async()=>s,m={method:r.method,headers:d,body:r.body,credentials:this.configuration.credentials},g={...m,...await p({init:m,context:r})};let b;wJ(g.body)||g.body instanceof URLSearchParams||bJ(g.body)?b=g.body:this.isJsonMime(d["Content-Type"])?b=JSON.stringify(g.body):b=g.body;const S={...g,body:b};return{url:o,init:S}}fetchApi=async(r,s)=>{let o={url:r,init:s};for(const p of this.middleware)p.pre&&(o=await p.pre({fetch:this.fetchApi,...o})||o);let d;try{d=await(this.configuration.fetchApi||fetch)(o.url,o.init)}catch(p){for(const m of this.middleware)m.onError&&(d=await m.onError({fetch:this.fetchApi,url:o.url,init:o.init,error:p,response:d?d.clone():void 0})||d);if(d===void 0)throw p instanceof Error?new EJ(p,"The request failed and the interceptors did not return an alternative response"):p}for(const p of this.middleware)p.post&&(d=await p.post({fetch:this.fetchApi,url:o.url,init:o.init,response:d.clone()})||d);return d};clone(){const r=this.constructor,s=new r(this.configuration);return s.middleware=this.middleware.slice(),s}}function bJ(e){return typeof Blob<"u"&&e instanceof Blob}function wJ(e){return typeof FormData<"u"&&e instanceof FormData}class SJ extends Error{constructor(r,s){super(s),this.response=r}name="ResponseError"}class EJ extends Error{constructor(r,s){super(s),this.cause=r}name="FetchError"}class et extends Error{constructor(r,s){super(s),this.field=r}name="RequiredError"}function dL(e,r=""){return Object.keys(e).map(s=>hL(s,e[s],r)).filter(s=>s.length>0).join("&")}function hL(e,r,s=""){const o=s+(s.length?`[${e}]`:e);if(r instanceof Array){const d=r.map(p=>encodeURIComponent(String(p))).join(`&${encodeURIComponent(o)}=`);return`${encodeURIComponent(o)}=${d}`}if(r instanceof Set){const d=Array.from(r);return hL(e,d,s)}return r instanceof Date?`${encodeURIComponent(o)}=${encodeURIComponent(r.toISOString())}`:r instanceof Object?dL(r,o):`${encodeURIComponent(o)}=${encodeURIComponent(String(r))}`}class pt{constructor(r,s=o=>o){this.raw=r,this.transformer=s}async value(){return this.transformer(await this.raw.json())}}class Ii{constructor(r){this.raw=r}async value(){}}class ec{constructor(r){this.raw=r}async value(){return await this.raw.text()}}function tg(e){return jJ(e)}function jJ(e,r){return e==null?e:{created_at:e.created_at==null?void 0:e.created_at,id:e.id==null?void 0:e.id,key:e.key==null?void 0:e.key,organization_id:e.organization_id==null?void 0:e.organization_id,updated_at:e.updated_at==null?void 0:e.updated_at,value:e.value==null?void 0:e.value}}function CJ(e){return AJ(e,!1)}function AJ(e,r=!1){return e==null?e:{annotation_ids:e.annotation_ids}}function OJ(e){return kJ(e,!1)}function kJ(e,r=!1){return e==null?e:{server_id:e.server_id}}function RJ(e){return TJ(e,!1)}function TJ(e,r=!1){return e==null?e:{domain_id:e.domain_id}}function _J(e){return $J(e,!1)}function $J(e,r=!1){return e==null?e:{label_ids:e.label_ids}}function IM(e){return NJ(e,!1)}function NJ(e,r=!1){return e==null?e:{load_balancer_id:e.load_balancer_id}}function DJ(e){return PJ(e,!1)}function PJ(e,r=!1){return e==null?e:{node_pool_id:e.node_pool_id}}function MJ(e){return IJ(e,!1)}function IJ(e,r=!1){return e==null?e:{record_set_id:e.record_set_id}}function LJ(e){return zJ(e,!1)}function zJ(e,r=!1){return e==null?e:{server_ids:e.server_ids}}function FJ(e){return qJ(e,!1)}function qJ(e,r=!1){return e==null?e:{taint_ids:e.taint_ids}}function BJ(e){return UJ(e)}function UJ(e,r){return e==null?e:{auth_url:e.auth_url==null?void 0:e.auth_url}}function yb(e){return KJ(e)}function KJ(e,r){return e==null?e:{created_at:e.created_at==null?void 0:e.created_at,credential_id:e.credential_id==null?void 0:e.credential_id,domain_name:e.domain_name==null?void 0:e.domain_name,id:e.id==null?void 0:e.id,last_error:e.last_error==null?void 0:e.last_error,organization_id:e.organization_id==null?void 0:e.organization_id,status:e.status==null?void 0:e.status,updated_at:e.updated_at==null?void 0:e.updated_at,zone_id:e.zone_id==null?void 0:e.zone_id}}function ng(e){return VJ(e)}function VJ(e,r){return e==null?e:{created_at:e.created_at==null?void 0:e.created_at,id:e.id==null?void 0:e.id,kind:e.kind==null?void 0:e.kind,name:e.name==null?void 0:e.name,organization_id:e.organization_id==null?void 0:e.organization_id,private_ip_address:e.private_ip_address==null?void 0:e.private_ip_address,public_ip_address:e.public_ip_address==null?void 0:e.public_ip_address,updated_at:e.updated_at==null?void 0:e.updated_at}}function rg(e){return HJ(e)}function HJ(e,r){return e==null?e:{created_at:e.created_at==null?void 0:e.created_at,effect:e.effect==null?void 0:e.effect,id:e.id==null?void 0:e.id,key:e.key==null?void 0:e.key,organization_id:e.organization_id==null?void 0:e.organization_id,updated_at:e.updated_at==null?void 0:e.updated_at,value:e.value==null?void 0:e.value}}function sg(e){return GJ(e)}function GJ(e,r){return e==null?e:{created_at:e.created_at==null?void 0:e.created_at,id:e.id==null?void 0:e.id,key:e.key==null?void 0:e.key,organization_id:e.organization_id==null?void 0:e.organization_id,updated_at:e.updated_at==null?void 0:e.updated_at,value:e.value==null?void 0:e.value}}function Id(e){return XJ(e)}function XJ(e,r){return e==null?e:{created_at:e.created_at==null?void 0:e.created_at,hostname:e.hostname==null?void 0:e.hostname,id:e.id==null?void 0:e.id,organization_id:e.organization_id==null?void 0:e.organization_id,private_ip_address:e.private_ip_address==null?void 0:e.private_ip_address,public_ip_address:e.public_ip_address==null?void 0:e.public_ip_address,role:e.role==null?void 0:e.role,ssh_key_id:e.ssh_key_id==null?void 0:e.ssh_key_id,ssh_user:e.ssh_user==null?void 0:e.ssh_user,status:e.status==null?void 0:e.status,updated_at:e.updated_at==null?void 0:e.updated_at}}function vb(e){return YJ(e)}function YJ(e,r){return e==null?e:{annotations:e.annotations==null?void 0:e.annotations.map(tg),created_at:e.created_at==null?void 0:e.created_at,id:e.id==null?void 0:e.id,labels:e.labels==null?void 0:e.labels.map(sg),name:e.name==null?void 0:e.name,organization_id:e.organization_id==null?void 0:e.organization_id,role:e.role==null?void 0:e.role,servers:e.servers==null?void 0:e.servers.map(Id),taints:e.taints==null?void 0:e.taints.map(rg),updated_at:e.updated_at==null?void 0:e.updated_at}}function fj(e){return ZJ(e)}function ZJ(e,r){return e==null?e:{created_at:e.created_at==null?void 0:e.created_at,domain_id:e.domain_id==null?void 0:e.domain_id,fingerprint:e.fingerprint==null?void 0:e.fingerprint,id:e.id==null?void 0:e.id,last_error:e.last_error==null?void 0:e.last_error,name:e.name==null?void 0:e.name,owner:e.owner==null?void 0:e.owner,status:e.status==null?void 0:e.status,ttl:e.ttl==null?void 0:e.ttl,type:e.type==null?void 0:e.type,updated_at:e.updated_at==null?void 0:e.updated_at,values:e.values==null?void 0:e.values}}function Ns(e){return WJ(e)}function WJ(e,r){return e==null?e:{apps_load_balancer:e.apps_load_balancer==null?void 0:ng(e.apps_load_balancer),bastion_server:e.bastion_server==null?void 0:Id(e.bastion_server),captain_domain:e.captain_domain==null?void 0:yb(e.captain_domain),certificate_key:e.certificate_key==null?void 0:e.certificate_key,cluster_provider:e.cluster_provider==null?void 0:e.cluster_provider,control_plane_fqdn:e.control_plane_fqdn==null?void 0:e.control_plane_fqdn,control_plane_record_set:e.control_plane_record_set==null?void 0:fj(e.control_plane_record_set),created_at:e.created_at==null?void 0:e.created_at,glueops_load_balancer:e.glueops_load_balancer==null?void 0:ng(e.glueops_load_balancer),id:e.id==null?void 0:e.id,last_error:e.last_error==null?void 0:e.last_error,name:e.name==null?void 0:e.name,node_pools:e.node_pools==null?void 0:e.node_pools.map(vb),random_token:e.random_token==null?void 0:e.random_token,region:e.region==null?void 0:e.region,status:e.status==null?void 0:e.status,updated_at:e.updated_at==null?void 0:e.updated_at}}function JJ(e){return QJ(e,!1)}function QJ(e,r=!1){return e==null?e:{key:e.key,value:e.value}}function eQ(e){return tQ(e,!1)}function tQ(e,r=!1){return e==null?e:{cluster_provider:e.cluster_provider,name:e.name,region:e.region}}function nQ(e){return rQ(e,!1)}function rQ(e,r=!1){return e==null?e:{account_id:e.account_id,credential_provider:e.credential_provider,kind:e.kind,name:e.name,region:e.region,schema_version:e.schema_version,scope:e.scope,scope_kind:e.scope_kind,scope_version:e.scope_version,secret:e.secret}}function sQ(e){return iQ(e,!1)}function iQ(e,r=!1){return e==null?e:{credential_id:e.credential_id,domain_name:e.domain_name,zone_id:e.zone_id}}function aQ(e){return oQ(e,!1)}function oQ(e,r=!1){return e==null?e:{key:e.key,value:e.value}}function lQ(e){return cQ(e,!1)}function cQ(e,r=!1){return e==null?e:{kind:e.kind,name:e.name,private_ip_address:e.private_ip_address,public_ip_address:e.public_ip_address}}function uQ(e){return dQ(e,!1)}function dQ(e,r=!1){return e==null?e:{name:e.name,role:e.role}}function hQ(e){return pQ(e,!1)}function pQ(e,r=!1){return e==null?e:{name:e.name,ttl:e.ttl,type:e.type,values:e.values}}function fQ(e){return mQ(e,!1)}function mQ(e,r=!1){return e==null?e:{bits:e.bits,comment:e.comment,name:e.name,type:e.type}}function gQ(e){return yQ(e,!1)}function yQ(e,r=!1){return e==null?e:{hostname:e.hostname,private_ip_address:e.private_ip_address,public_ip_address:e.public_ip_address,role:e.role,ssh_key_id:e.ssh_key_id,ssh_user:e.ssh_user,status:e.status}}function vQ(e){return xQ(e,!1)}function xQ(e,r=!1){return e==null?e:{effect:e.effect,key:e.key,value:e.value}}function BE(e){return bQ(e)}function bQ(e,r){return e==null?e:{account_id:e.account_id==null?void 0:e.account_id,created_at:e.created_at==null?void 0:e.created_at,credential_provider:e.credential_provider==null?void 0:e.credential_provider,id:e.id==null?void 0:e.id,kind:e.kind==null?void 0:e.kind,name:e.name==null?void 0:e.name,region:e.region==null?void 0:e.region,schema_version:e.schema_version==null?void 0:e.schema_version,scope:e.scope==null?void 0:e.scope,scope_kind:e.scope_kind==null?void 0:e.scope_kind,scope_version:e.scope_version==null?void 0:e.scope_version,updated_at:e.updated_at==null?void 0:e.updated_at}}function wQ(e){return SQ(e,!1)}function SQ(e,r=!1){return e==null?e:{payload:e.payload,queue:e.queue,run_at:e.run_at,type:e.type}}function EQ(e){return jQ(e)}function jQ(e,r){return e==null?e:{alg:e.alg==null?void 0:e.alg,e:e.e==null?void 0:e.e,kid:e.kid==null?void 0:e.kid,kty:e.kty==null?void 0:e.kty,n:e.n==null?void 0:e.n,use:e.use==null?void 0:e.use,x:e.x==null?void 0:e.x}}function CQ(e){return AQ(e)}function AQ(e,r){return e==null?e:{keys:e.keys==null?void 0:e.keys.map(EQ)}}function OQ(e){return kQ(e)}function kQ(e,r){return e}function mj(e){return RQ(e)}function RQ(e,r){return e==null?e:{attempts:e.attempts==null?void 0:e.attempts,created_at:e.created_at==null?void 0:e.created_at,id:e.id==null?void 0:e.id,last_error:e.last_error==null?void 0:e.last_error,max_attempts:e.max_attempts==null?void 0:e.max_attempts,payload:e.payload==null?void 0:e.payload,queue:e.queue==null?void 0:e.queue,run_at:e.run_at==null?void 0:e.run_at,status:e.status==null?void 0:OQ(e.status),type:e.type==null?void 0:e.type,updated_at:e.updated_at==null?void 0:e.updated_at}}function TQ(e){return _Q(e,!1)}function _Q(e,r=!1){return e==null?e:{refresh_token:e.refresh_token}}function $Q(e){return NQ(e)}function NQ(e,r){return e==null?e:{items:e.items==null?void 0:e.items.map(mj),page:e.page==null?void 0:e.page,page_size:e.page_size==null?void 0:e.page_size,total:e.total==null?void 0:e.total}}function DQ(e){return PQ(e)}function PQ(e,r){return e==null?e:{failed:e.failed==null?void 0:e.failed,name:e.name==null?void 0:e.name,pending:e.pending==null?void 0:e.pending,running:e.running==null?void 0:e.running,scheduled:e.scheduled==null?void 0:e.scheduled}}function MQ(e){return IQ(e,!1)}function IQ(e,r=!1){return e==null?e:{refresh_token:e.refresh_token}}function LQ(e){return zQ(e,!1)}function zQ(e,r=!1){return e==null?e:{kubeconfig:e.kubeconfig}}function LM(e){return pL(e)}function pL(e,r){return e==null?e:{created_at:e.created_at==null?void 0:e.created_at,fingerprint:e.fingerprint==null?void 0:e.fingerprint,id:e.id==null?void 0:e.id,name:e.name==null?void 0:e.name,organization_id:e.organization_id==null?void 0:e.organization_id,public_key:e.public_key==null?void 0:e.public_key,updated_at:e.updated_at==null?void 0:e.updated_at}}function zM(e){return FQ(e)}function FQ(e,r){return e==null?e:{access_token:e.access_token==null?void 0:e.access_token,expires_in:e.expires_in==null?void 0:e.expires_in,refresh_token:e.refresh_token==null?void 0:e.refresh_token,token_type:e.token_type==null?void 0:e.token_type}}function qQ(e){return BQ(e,!1)}function BQ(e,r=!1){return e==null?e:{key:e.key,value:e.value}}function UQ(e){return KQ(e,!1)}function KQ(e,r=!1){return e==null?e:{cluster_provider:e.cluster_provider,name:e.name,region:e.region}}function VQ(e){return HQ(e,!1)}function HQ(e,r=!1){return e==null?e:{account_id:e.account_id,name:e.name,region:e.region,scope:e.scope,scope_kind:e.scope_kind,scope_version:e.scope_version,secret:e.secret}}function GQ(e){return XQ(e,!1)}function XQ(e,r=!1){return e==null?e:{credential_id:e.credential_id,domain_name:e.domain_name,status:e.status,zone_id:e.zone_id}}function YQ(e){return ZQ(e,!1)}function ZQ(e,r=!1){return e==null?e:{key:e.key,value:e.value}}function WQ(e){return JQ(e,!1)}function JQ(e,r=!1){return e==null?e:{kind:e.kind,name:e.name,private_ip_address:e.private_ip_address,public_ip_address:e.public_ip_address}}function QQ(e){return eee(e,!1)}function eee(e,r=!1){return e==null?e:{name:e.name,role:e.role}}function tee(e){return nee(e,!1)}function nee(e,r=!1){return e==null?e:{name:e.name,status:e.status,ttl:e.ttl,type:e.type,values:e.values}}function ree(e){return see(e,!1)}function see(e,r=!1){return e==null?e:{hostname:e.hostname,private_ip_address:e.private_ip_address,public_ip_address:e.public_ip_address,role:e.role,ssh_key_id:e.ssh_key_id,ssh_user:e.ssh_user,status:e.status}}function iee(e){return aee(e,!1)}function aee(e,r=!1){return e==null?e:{effect:e.effect,key:e.key,value:e.value}}function oee(e){return lee(e)}function lee(e,r){return e==null||typeof e!="object"?e:pL(e)}function cee(e){return uee(e,!1)}function uee(e,r=!1){return e==null?e:{expires_in_hours:e.expires_in_hours,name:e.name}}function fL(e){return dee(e)}function dee(e,r){return e==null?e:{avatar_url:e.avatar_url==null?void 0:e.avatar_url,created_at:e.created_at==null?void 0:new Date(e.created_at),display_name:e.display_name==null?void 0:e.display_name,id:e.id==null?void 0:e.id,is_admin:e.is_admin==null?void 0:e.is_admin,is_disabled:e.is_disabled==null?void 0:e.is_disabled,primary_email:e.primary_email==null?void 0:e.primary_email,updated_at:e.updated_at==null?void 0:new Date(e.updated_at)}}function hee(e){return pee(e)}function pee(e,r){return e==null?e:{created_at:e.created_at==null?void 0:new Date(e.created_at),email:e.email==null?void 0:e.email,id:e.id==null?void 0:e.id,is_primary:e.is_primary==null?void 0:e.is_primary,is_verified:e.is_verified==null?void 0:e.is_verified,updated_at:e.updated_at==null?void 0:new Date(e.updated_at),user:e.user==null?void 0:fL(e.user),user_id:e.user_id==null?void 0:e.user_id}}function xb(e){return fee(e)}function fee(e,r){return e==null?e:{created_at:e.created_at==null?void 0:new Date(e.created_at),domain:e.domain==null?void 0:e.domain,id:e.id==null?void 0:e.id,name:e.name==null?void 0:e.name,updated_at:e.updated_at==null?void 0:new Date(e.updated_at)}}function mee(e){return gee(e)}function gee(e,r){return e==null?e:{avatar_url:e.avatar_url==null?void 0:e.avatar_url,created_at:e.created_at==null?void 0:new Date(e.created_at),display_name:e.display_name==null?void 0:e.display_name,emails:e.emails==null?void 0:e.emails.map(hee),id:e.id==null?void 0:e.id,is_admin:e.is_admin==null?void 0:e.is_admin,is_disabled:e.is_disabled==null?void 0:e.is_disabled,organizations:e.organizations==null?void 0:e.organizations.map(xb),primary_email:e.primary_email==null?void 0:e.primary_email,updated_at:e.updated_at==null?void 0:new Date(e.updated_at)}}function FM(e){return yee(e)}function yee(e,r){return e==null?e:{email:e.email==null?void 0:e.email,role:e.role==null?void 0:e.role,user_id:e.user_id==null?void 0:e.user_id}}function vee(e){return xee(e,!1)}function xee(e,r=!1){return e==null?e:{role:e.role,user_id:e.user_id}}function bee(e){return wee(e,!1)}function wee(e,r=!1){return e==null?e:{domain:e.domain,name:e.name}}function See(e){return Eee(e,!1)}function Eee(e,r=!1){return e==null?e:{expires_in_hours:e.expires_in_hours,name:e.name}}function jee(e){return Cee(e)}function Cee(e,r){return e==null?e:{created_at:e.created_at==null?void 0:e.created_at,expires_at:e.expires_at==null?void 0:e.expires_at,id:e.id==null?void 0:e.id,name:e.name==null?void 0:e.name,org_key:e.org_key==null?void 0:e.org_key,org_secret:e.org_secret==null?void 0:e.org_secret,scope:e.scope==null?void 0:e.scope}}function Aee(e){return Oee(e,!1)}function Oee(e,r=!1){return e==null?e:{domain:e.domain,name:e.name}}function kee(e){return Ree(e,!1)}function Ree(e,r=!1){return e==null?e:{display_name:e.display_name}}function qM(e){return Tee(e)}function Tee(e,r){return e==null?e:{created_at:e.created_at==null?void 0:e.created_at,expires_at:e.expires_at==null?void 0:e.expires_at,id:e.id==null?void 0:e.id,last_used_at:e.last_used_at==null?void 0:e.last_used_at,name:e.name==null?void 0:e.name,plain:e.plain==null?void 0:e.plain,scope:e.scope==null?void 0:e.scope}}function _ee(e){return $ee(e)}function $ee(e,r){return e==null?e:{created_at:e.created_at==null?void 0:new Date(e.created_at),expires_at:e.expires_at==null?void 0:new Date(e.expires_at),id:e.id==null?void 0:e.id,last_used_at:e.last_used_at==null?void 0:new Date(e.last_used_at),name:e.name==null?void 0:e.name,org_id:e.org_id==null?void 0:e.org_id,prefix:e.prefix==null?void 0:e.prefix,revoked:e.revoked==null?void 0:e.revoked,scope:e.scope==null?void 0:e.scope,updated_at:e.updated_at==null?void 0:new Date(e.updated_at),user_id:e.user_id==null?void 0:e.user_id}}class Nee extends Gs{async createAnnotationRaw(r,s){if(r.dtoCreateAnnotationRequest==null)throw new et("dtoCreateAnnotationRequest",'Required parameter "dtoCreateAnnotationRequest" was null or undefined when calling createAnnotation().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/annotations",method:"POST",headers:d,query:o,body:JJ(r.dtoCreateAnnotationRequest)},s);return new pt(m,g=>tg(g))}async createAnnotation(r,s){return await(await this.createAnnotationRaw(r,s)).value()}async deleteAnnotationRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling deleteAnnotation().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/annotations/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new Ii(m)}async deleteAnnotation(r,s){await this.deleteAnnotationRaw(r,s)}async getAnnotationRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling getAnnotation().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/annotations/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>tg(g))}async getAnnotation(r,s){return await(await this.getAnnotationRaw(r,s)).value()}async listAnnotationsRaw(r,s){const o={};r.key!=null&&(o.key=r.key),r.value!=null&&(o.value=r.value),r.q!=null&&(o.q=r.q);const d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/annotations",method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(tg))}async listAnnotations(r={},s){return await(await this.listAnnotationsRaw(r,s)).value()}async updateAnnotationRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling updateAnnotation().');if(r.dtoUpdateAnnotationRequest==null)throw new et("dtoUpdateAnnotationRequest",'Required parameter "dtoUpdateAnnotationRequest" was null or undefined when calling updateAnnotation().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/annotations/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"PATCH",headers:d,query:o,body:qQ(r.dtoUpdateAnnotationRequest)},s);return new pt(m,g=>tg(g))}async updateAnnotation(r,s){return await(await this.updateAnnotationRaw(r,s)).value()}}class Dee extends Gs{async adminCancelArcherJobRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling adminCancelArcherJob().');const o={},d={};d["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/admin/archer/jobs/{id}/cancel";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:r.body},s);return new pt(m,g=>mj(g))}async adminCancelArcherJob(r,s){return await(await this.adminCancelArcherJobRaw(r,s)).value()}async adminEnqueueArcherJobRaw(r,s){if(r.dtoEnqueueRequest==null)throw new et("dtoEnqueueRequest",'Required parameter "dtoEnqueueRequest" was null or undefined when calling adminEnqueueArcherJob().');const o={},d={};d["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/admin/archer/jobs",method:"POST",headers:d,query:o,body:wQ(r.dtoEnqueueRequest)},s);return new pt(m,g=>mj(g))}async adminEnqueueArcherJob(r,s){return await(await this.adminEnqueueArcherJobRaw(r,s)).value()}async adminListArcherJobsRaw(r,s){const o={};r.status!=null&&(o.status=r.status),r.queue!=null&&(o.queue=r.queue),r.q!=null&&(o.q=r.q),r.page!=null&&(o.page=r.page),r.pageSize!=null&&(o.page_size=r.pageSize);const d={};this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/admin/archer/jobs",method:"GET",headers:d,query:o},s);return new pt(m,g=>$Q(g))}async adminListArcherJobs(r={},s){return await(await this.adminListArcherJobsRaw(r,s)).value()}async adminListArcherQueuesRaw(r){const s={},o={};this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));const p=await this.request({path:"/admin/archer/queues",method:"GET",headers:o,query:s},r);return new pt(p,m=>m.map(DQ))}async adminListArcherQueues(r){return await(await this.adminListArcherQueuesRaw(r)).value()}async adminRetryArcherJobRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling adminRetryArcherJob().');const o={},d={};d["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/admin/archer/jobs/{id}/retry";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:r.body},s);return new pt(m,g=>mj(g))}async adminRetryArcherJob(r,s){return await(await this.adminRetryArcherJobRaw(r,s)).value()}}const Ra={queued:"queued",running:"running",succeeded:"succeeded",failed:"failed",canceled:"canceled",retrying:"retrying",scheduled:"scheduled"};class Pee extends Gs{async authCallbackRaw(r,s){if(r.provider==null)throw new et("provider",'Required parameter "provider" was null or undefined when calling authCallback().');const o={},d={};let p="/auth/{provider}/callback";p=p.replace("{provider}",encodeURIComponent(String(r.provider)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>zM(g))}async authCallback(r,s){return await(await this.authCallbackRaw(r,s)).value()}async authStartRaw(r,s){if(r.provider==null)throw new et("provider",'Required parameter "provider" was null or undefined when calling authStart().');const o={},d={};let p="/auth/{provider}/start";p=p.replace("{provider}",encodeURIComponent(String(r.provider)));const m=await this.request({path:p,method:"POST",headers:d,query:o},s);return new pt(m,g=>BJ(g))}async authStart(r,s){return await(await this.authStartRaw(r,s)).value()}async getJWKSRaw(r){const s={},o={},p=await this.request({path:"/.well-known/jwks.json",method:"GET",headers:o,query:s},r);return new pt(p,m=>CQ(m))}async getJWKS(r){return await(await this.getJWKSRaw(r)).value()}async logoutRaw(r,s){if(r.dtoLogoutRequest==null)throw new et("dtoLogoutRequest",'Required parameter "dtoLogoutRequest" was null or undefined when calling logout().');const o={},d={};d["Content-Type"]="application/json";const m=await this.request({path:"/auth/logout",method:"POST",headers:d,query:o,body:TQ(r.dtoLogoutRequest)},s);return new Ii(m)}async logout(r,s){await this.logoutRaw(r,s)}async refreshRaw(r,s){if(r.dtoRefreshRequest==null)throw new et("dtoRefreshRequest",'Required parameter "dtoRefreshRequest" was null or undefined when calling refresh().');const o={},d={};d["Content-Type"]="application/json";const m=await this.request({path:"/auth/refresh",method:"POST",headers:d,query:o,body:MQ(r.dtoRefreshRequest)},s);return new pt(m,g=>zM(g))}async refresh(r,s){return await(await this.refreshRaw(r,s)).value()}}class Mee extends Gs{async attachAppsLoadBalancerRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling attachAppsLoadBalancer().');if(r.dtoAttachLoadBalancerRequest==null)throw new et("dtoAttachLoadBalancerRequest",'Required parameter "dtoAttachLoadBalancerRequest" was null or undefined when calling attachAppsLoadBalancer().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}/apps-load-balancer";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:IM(r.dtoAttachLoadBalancerRequest)},s);return new pt(m,g=>Ns(g))}async attachAppsLoadBalancer(r,s){return await(await this.attachAppsLoadBalancerRaw(r,s)).value()}async attachBastionServerRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling attachBastionServer().');if(r.dtoAttachBastionRequest==null)throw new et("dtoAttachBastionRequest",'Required parameter "dtoAttachBastionRequest" was null or undefined when calling attachBastionServer().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}/bastion";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:OJ(r.dtoAttachBastionRequest)},s);return new pt(m,g=>Ns(g))}async attachBastionServer(r,s){return await(await this.attachBastionServerRaw(r,s)).value()}async attachCaptainDomainRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling attachCaptainDomain().');if(r.dtoAttachCaptainDomainRequest==null)throw new et("dtoAttachCaptainDomainRequest",'Required parameter "dtoAttachCaptainDomainRequest" was null or undefined when calling attachCaptainDomain().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}/captain-domain";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:RJ(r.dtoAttachCaptainDomainRequest)},s);return new pt(m,g=>Ns(g))}async attachCaptainDomain(r,s){return await(await this.attachCaptainDomainRaw(r,s)).value()}async attachControlPlaneRecordSetRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling attachControlPlaneRecordSet().');if(r.dtoAttachRecordSetRequest==null)throw new et("dtoAttachRecordSetRequest",'Required parameter "dtoAttachRecordSetRequest" was null or undefined when calling attachControlPlaneRecordSet().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}/control-plane-record-set";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:MJ(r.dtoAttachRecordSetRequest)},s);return new pt(m,g=>Ns(g))}async attachControlPlaneRecordSet(r,s){return await(await this.attachControlPlaneRecordSetRaw(r,s)).value()}async attachGlueOpsLoadBalancerRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling attachGlueOpsLoadBalancer().');if(r.dtoAttachLoadBalancerRequest==null)throw new et("dtoAttachLoadBalancerRequest",'Required parameter "dtoAttachLoadBalancerRequest" was null or undefined when calling attachGlueOpsLoadBalancer().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}/glueops-load-balancer";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:IM(r.dtoAttachLoadBalancerRequest)},s);return new pt(m,g=>Ns(g))}async attachGlueOpsLoadBalancer(r,s){return await(await this.attachGlueOpsLoadBalancerRaw(r,s)).value()}async attachNodePoolRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling attachNodePool().');if(r.dtoAttachNodePoolRequest==null)throw new et("dtoAttachNodePoolRequest",'Required parameter "dtoAttachNodePoolRequest" was null or undefined when calling attachNodePool().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}/node-pools";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:DJ(r.dtoAttachNodePoolRequest)},s);return new pt(m,g=>Ns(g))}async attachNodePool(r,s){return await(await this.attachNodePoolRaw(r,s)).value()}async clearClusterKubeconfigRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling clearClusterKubeconfig().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}/kubeconfig";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new pt(m,g=>Ns(g))}async clearClusterKubeconfig(r,s){return await(await this.clearClusterKubeconfigRaw(r,s)).value()}async createClusterRaw(r,s){if(r.dtoCreateClusterRequest==null)throw new et("dtoCreateClusterRequest",'Required parameter "dtoCreateClusterRequest" was null or undefined when calling createCluster().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/clusters",method:"POST",headers:d,query:o,body:eQ(r.dtoCreateClusterRequest)},s);return new pt(m,g=>Ns(g))}async createCluster(r,s){return await(await this.createClusterRaw(r,s)).value()}async deleteClusterRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling deleteCluster().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return this.isJsonMime(m.headers.get("content-type"))?new pt(m):new ec(m)}async deleteCluster(r,s){return await(await this.deleteClusterRaw(r,s)).value()}async detachAppsLoadBalancerRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling detachAppsLoadBalancer().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}/apps-load-balancer";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new pt(m,g=>Ns(g))}async detachAppsLoadBalancer(r,s){return await(await this.detachAppsLoadBalancerRaw(r,s)).value()}async detachBastionServerRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling detachBastionServer().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}/bastion";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new pt(m,g=>Ns(g))}async detachBastionServer(r,s){return await(await this.detachBastionServerRaw(r,s)).value()}async detachCaptainDomainRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling detachCaptainDomain().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}/captain-domain";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new pt(m,g=>Ns(g))}async detachCaptainDomain(r,s){return await(await this.detachCaptainDomainRaw(r,s)).value()}async detachControlPlaneRecordSetRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling detachControlPlaneRecordSet().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}/control-plane-record-set";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new pt(m,g=>Ns(g))}async detachControlPlaneRecordSet(r,s){return await(await this.detachControlPlaneRecordSetRaw(r,s)).value()}async detachGlueOpsLoadBalancerRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling detachGlueOpsLoadBalancer().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}/glueops-load-balancer";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new pt(m,g=>Ns(g))}async detachGlueOpsLoadBalancer(r,s){return await(await this.detachGlueOpsLoadBalancerRaw(r,s)).value()}async detachNodePoolRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling detachNodePool().');if(r.nodePoolID==null)throw new et("nodePoolID",'Required parameter "nodePoolID" was null or undefined when calling detachNodePool().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}/node-pools/{nodePoolID}";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID))),p=p.replace("{nodePoolID}",encodeURIComponent(String(r.nodePoolID)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new pt(m,g=>Ns(g))}async detachNodePool(r,s){return await(await this.detachNodePoolRaw(r,s)).value()}async getClusterRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling getCluster().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>Ns(g))}async getCluster(r,s){return await(await this.getClusterRaw(r,s)).value()}async listClustersRaw(r,s){const o={};r.q!=null&&(o.q=r.q);const d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/clusters",method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(Ns))}async listClusters(r={},s){return await(await this.listClustersRaw(r,s)).value()}async setClusterKubeconfigRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling setClusterKubeconfig().');if(r.dtoSetKubeconfigRequest==null)throw new et("dtoSetKubeconfigRequest",'Required parameter "dtoSetKubeconfigRequest" was null or undefined when calling setClusterKubeconfig().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}/kubeconfig";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:LQ(r.dtoSetKubeconfigRequest)},s);return new pt(m,g=>Ns(g))}async setClusterKubeconfig(r,s){return await(await this.setClusterKubeconfigRaw(r,s)).value()}async updateClusterRaw(r,s){if(r.clusterID==null)throw new et("clusterID",'Required parameter "clusterID" was null or undefined when calling updateCluster().');if(r.dtoUpdateClusterRequest==null)throw new et("dtoUpdateClusterRequest",'Required parameter "dtoUpdateClusterRequest" was null or undefined when calling updateCluster().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/clusters/{clusterID}";p=p.replace("{clusterID}",encodeURIComponent(String(r.clusterID)));const m=await this.request({path:p,method:"PATCH",headers:d,query:o,body:UQ(r.dtoUpdateClusterRequest)},s);return new pt(m,g=>Ns(g))}async updateCluster(r,s){return await(await this.updateClusterRaw(r,s)).value()}}class Iee extends Gs{async createCredentialRaw(r,s){if(r.dtoCreateCredentialRequest==null)throw new et("dtoCreateCredentialRequest",'Required parameter "dtoCreateCredentialRequest" was null or undefined when calling createCredential().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/credentials",method:"POST",headers:d,query:o,body:nQ(r.dtoCreateCredentialRequest)},s);return new pt(m,g=>BE(g))}async createCredential(r,s){return await(await this.createCredentialRaw(r,s)).value()}async deleteCredentialRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling deleteCredential().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/credentials/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new Ii(m)}async deleteCredential(r,s){await this.deleteCredentialRaw(r,s)}async getCredentialRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling getCredential().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/credentials/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>BE(g))}async getCredential(r,s){return await(await this.getCredentialRaw(r,s)).value()}async listCredentialsRaw(r,s){const o={};r.credentialProvider!=null&&(o.credential_provider=r.credentialProvider),r.kind!=null&&(o.kind=r.kind),r.scopeKind!=null&&(o.scope_kind=r.scopeKind);const d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/credentials",method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(BE))}async listCredentials(r={},s){return await(await this.listCredentialsRaw(r,s)).value()}async revealCredentialRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling revealCredential().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/credentials/{id}/reveal";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:r.body},s);return new pt(m)}async revealCredential(r,s){return await(await this.revealCredentialRaw(r,s)).value()}async updateCredentialRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling updateCredential().');if(r.dtoUpdateCredentialRequest==null)throw new et("dtoUpdateCredentialRequest",'Required parameter "dtoUpdateCredentialRequest" was null or undefined when calling updateCredential().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/credentials/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"PATCH",headers:d,query:o,body:VQ(r.dtoUpdateCredentialRequest)},s);return new pt(m,g=>BE(g))}async updateCredential(r,s){return await(await this.updateCredentialRaw(r,s)).value()}}class Lee extends Gs{async createDomainRaw(r,s){if(r.dtoCreateDomainRequest==null)throw new et("dtoCreateDomainRequest",'Required parameter "dtoCreateDomainRequest" was null or undefined when calling createDomain().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/dns/domains",method:"POST",headers:d,query:o,body:sQ(r.dtoCreateDomainRequest)},s);return new pt(m,g=>yb(g))}async createDomain(r,s){return await(await this.createDomainRaw(r,s)).value()}async createRecordSetRaw(r,s){if(r.domainId==null)throw new et("domainId",'Required parameter "domainId" was null or undefined when calling createRecordSet().');if(r.dtoCreateRecordSetRequest==null)throw new et("dtoCreateRecordSetRequest",'Required parameter "dtoCreateRecordSetRequest" was null or undefined when calling createRecordSet().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/dns/domains/{domain_id}/records";p=p.replace("{domain_id}",encodeURIComponent(String(r.domainId)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:hQ(r.dtoCreateRecordSetRequest)},s);return new pt(m,g=>fj(g))}async createRecordSet(r,s){return await(await this.createRecordSetRaw(r,s)).value()}async deleteDomainRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling deleteDomain().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/dns/domains/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new Ii(m)}async deleteDomain(r,s){await this.deleteDomainRaw(r,s)}async deleteRecordSetRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling deleteRecordSet().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/dns/records/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new Ii(m)}async deleteRecordSet(r,s){await this.deleteRecordSetRaw(r,s)}async getDomainRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling getDomain().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/dns/domains/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>yb(g))}async getDomain(r,s){return await(await this.getDomainRaw(r,s)).value()}async listDomainsRaw(r,s){const o={};r.domainName!=null&&(o.domain_name=r.domainName),r.status!=null&&(o.status=r.status),r.q!=null&&(o.q=r.q);const d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/dns/domains",method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(yb))}async listDomains(r={},s){return await(await this.listDomainsRaw(r,s)).value()}async listRecordSetsRaw(r,s){if(r.domainId==null)throw new et("domainId",'Required parameter "domainId" was null or undefined when calling listRecordSets().');const o={};r.name!=null&&(o.name=r.name),r.type!=null&&(o.type=r.type),r.status!=null&&(o.status=r.status);const d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/dns/domains/{domain_id}/records";p=p.replace("{domain_id}",encodeURIComponent(String(r.domainId)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(fj))}async listRecordSets(r,s){return await(await this.listRecordSetsRaw(r,s)).value()}async updateDomainRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling updateDomain().');if(r.dtoUpdateDomainRequest==null)throw new et("dtoUpdateDomainRequest",'Required parameter "dtoUpdateDomainRequest" was null or undefined when calling updateDomain().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/dns/domains/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"PATCH",headers:d,query:o,body:GQ(r.dtoUpdateDomainRequest)},s);return new pt(m,g=>yb(g))}async updateDomain(r,s){return await(await this.updateDomainRaw(r,s)).value()}async updateRecordSetRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling updateRecordSet().');if(r.dtoUpdateRecordSetRequest==null)throw new et("dtoUpdateRecordSetRequest",'Required parameter "dtoUpdateRecordSetRequest" was null or undefined when calling updateRecordSet().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/dns/records/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"PATCH",headers:d,query:o,body:tee(r.dtoUpdateRecordSetRequest)},s);return new pt(m,g=>fj(g))}async updateRecordSet(r,s){return await(await this.updateRecordSetRaw(r,s)).value()}}class zee extends Gs{async createLabelRaw(r,s){if(r.dtoCreateLabelRequest==null)throw new et("dtoCreateLabelRequest",'Required parameter "dtoCreateLabelRequest" was null or undefined when calling createLabel().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/labels",method:"POST",headers:d,query:o,body:aQ(r.dtoCreateLabelRequest)},s);return new pt(m,g=>sg(g))}async createLabel(r,s){return await(await this.createLabelRaw(r,s)).value()}async deleteLabelRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling deleteLabel().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/labels/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new Ii(m)}async deleteLabel(r,s){await this.deleteLabelRaw(r,s)}async getLabelRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling getLabel().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/labels/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>sg(g))}async getLabel(r,s){return await(await this.getLabelRaw(r,s)).value()}async listLabelsRaw(r,s){const o={};r.key!=null&&(o.key=r.key),r.value!=null&&(o.value=r.value),r.q!=null&&(o.q=r.q);const d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/labels",method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(sg))}async listLabels(r={},s){return await(await this.listLabelsRaw(r,s)).value()}async updateLabelRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling updateLabel().');if(r.dtoUpdateLabelRequest==null)throw new et("dtoUpdateLabelRequest",'Required parameter "dtoUpdateLabelRequest" was null or undefined when calling updateLabel().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/labels/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"PATCH",headers:d,query:o,body:YQ(r.dtoUpdateLabelRequest)},s);return new pt(m,g=>sg(g))}async updateLabel(r,s){return await(await this.updateLabelRaw(r,s)).value()}}class Fee extends Gs{async createLoadBalancerRaw(r,s){if(r.dtoCreateLoadBalancerRequest==null)throw new et("dtoCreateLoadBalancerRequest",'Required parameter "dtoCreateLoadBalancerRequest" was null or undefined when calling createLoadBalancer().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/load-balancers",method:"POST",headers:d,query:o,body:lQ(r.dtoCreateLoadBalancerRequest)},s);return new pt(m,g=>ng(g))}async createLoadBalancer(r,s){return await(await this.createLoadBalancerRaw(r,s)).value()}async deleteLoadBalancerRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling deleteLoadBalancer().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/load-balancers/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new Ii(m)}async deleteLoadBalancer(r,s){await this.deleteLoadBalancerRaw(r,s)}async getLoadBalancersRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling getLoadBalancers().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/load-balancers/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(ng))}async getLoadBalancers(r,s){return await(await this.getLoadBalancersRaw(r,s)).value()}async listLoadBalancersRaw(r,s){const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/load-balancers",method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(ng))}async listLoadBalancers(r={},s){return await(await this.listLoadBalancersRaw(r,s)).value()}async updateLoadBalancerRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling updateLoadBalancer().');if(r.dtoUpdateLoadBalancerRequest==null)throw new et("dtoUpdateLoadBalancerRequest",'Required parameter "dtoUpdateLoadBalancerRequest" was null or undefined when calling updateLoadBalancer().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/load-balancers/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"PATCH",headers:d,query:o,body:WQ(r.dtoUpdateLoadBalancerRequest)},s);return new pt(m,g=>ng(g))}async updateLoadBalancer(r,s){return await(await this.updateLoadBalancerRaw(r,s)).value()}}class qee extends Gs{async getMeRaw(r){const s={},o={};this.configuration&&this.configuration.apiKey&&(o["X-API-KEY"]=await this.configuration.apiKey("X-API-KEY")),this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));const p=await this.request({path:"/me",method:"GET",headers:o,query:s},r);return new pt(p,m=>mee(m))}async getMe(r){return await(await this.getMeRaw(r)).value()}async updateMeRaw(r,s){if(r.handlersUpdateMeRequest==null)throw new et("handlersUpdateMeRequest",'Required parameter "handlersUpdateMeRequest" was null or undefined when calling updateMe().');const o={},d={};d["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(d["X-API-KEY"]=await this.configuration.apiKey("X-API-KEY")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/me",method:"PATCH",headers:d,query:o,body:kee(r.handlersUpdateMeRequest)},s);return new pt(m,g=>fL(g))}async updateMe(r,s){return await(await this.updateMeRaw(r,s)).value()}}class Bee extends Gs{async createUserAPIKeyRaw(r,s){if(r.handlersCreateUserKeyRequest==null)throw new et("handlersCreateUserKeyRequest",'Required parameter "handlersCreateUserKeyRequest" was null or undefined when calling createUserAPIKey().');const o={},d={};d["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(d["X-API-KEY"]=await this.configuration.apiKey("X-API-KEY")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/me/api-keys",method:"POST",headers:d,query:o,body:cee(r.handlersCreateUserKeyRequest)},s);return new pt(m,g=>qM(g))}async createUserAPIKey(r,s){return await(await this.createUserAPIKeyRaw(r,s)).value()}async deleteUserAPIKeyRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling deleteUserAPIKey().');const o={},d={};this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/me/api-keys/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new Ii(m)}async deleteUserAPIKey(r,s){await this.deleteUserAPIKeyRaw(r,s)}async listUserAPIKeysRaw(r){const s={},o={};this.configuration&&this.configuration.apiKey&&(o["X-API-KEY"]=await this.configuration.apiKey("X-API-KEY")),this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));const p=await this.request({path:"/me/api-keys",method:"GET",headers:o,query:s},r);return new pt(p,m=>m.map(qM))}async listUserAPIKeys(r){return await(await this.listUserAPIKeysRaw(r)).value()}}class Uee extends Gs{async attachNodePoolAnnotationsRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling attachNodePoolAnnotations().');if(r.dtoAttachAnnotationsRequest==null)throw new et("dtoAttachAnnotationsRequest",'Required parameter "dtoAttachAnnotationsRequest" was null or undefined when calling attachNodePoolAnnotations().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/node-pools/{id}/annotations";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:CJ(r.dtoAttachAnnotationsRequest)},s);return this.isJsonMime(m.headers.get("content-type"))?new pt(m):new ec(m)}async attachNodePoolAnnotations(r,s){return await(await this.attachNodePoolAnnotationsRaw(r,s)).value()}async attachNodePoolLabelsRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling attachNodePoolLabels().');if(r.dtoAttachLabelsRequest==null)throw new et("dtoAttachLabelsRequest",'Required parameter "dtoAttachLabelsRequest" was null or undefined when calling attachNodePoolLabels().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/node-pools/{id}/labels";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:_J(r.dtoAttachLabelsRequest)},s);return this.isJsonMime(m.headers.get("content-type"))?new pt(m):new ec(m)}async attachNodePoolLabels(r,s){return await(await this.attachNodePoolLabelsRaw(r,s)).value()}async attachNodePoolServersRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling attachNodePoolServers().');if(r.dtoAttachServersRequest==null)throw new et("dtoAttachServersRequest",'Required parameter "dtoAttachServersRequest" was null or undefined when calling attachNodePoolServers().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/node-pools/{id}/servers";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:LJ(r.dtoAttachServersRequest)},s);return this.isJsonMime(m.headers.get("content-type"))?new pt(m):new ec(m)}async attachNodePoolServers(r,s){return await(await this.attachNodePoolServersRaw(r,s)).value()}async attachNodePoolTaintsRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling attachNodePoolTaints().');if(r.dtoAttachTaintsRequest==null)throw new et("dtoAttachTaintsRequest",'Required parameter "dtoAttachTaintsRequest" was null or undefined when calling attachNodePoolTaints().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/node-pools/{id}/taints";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:FJ(r.dtoAttachTaintsRequest)},s);return this.isJsonMime(m.headers.get("content-type"))?new pt(m):new ec(m)}async attachNodePoolTaints(r,s){return await(await this.attachNodePoolTaintsRaw(r,s)).value()}async createNodePoolRaw(r,s){if(r.dtoCreateNodePoolRequest==null)throw new et("dtoCreateNodePoolRequest",'Required parameter "dtoCreateNodePoolRequest" was null or undefined when calling createNodePool().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/node-pools",method:"POST",headers:d,query:o,body:uQ(r.dtoCreateNodePoolRequest)},s);return new pt(m,g=>vb(g))}async createNodePool(r,s){return await(await this.createNodePoolRaw(r,s)).value()}async deleteNodePoolRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling deleteNodePool().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/node-pools/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new Ii(m)}async deleteNodePool(r,s){await this.deleteNodePoolRaw(r,s)}async detachNodePoolAnnotationRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling detachNodePoolAnnotation().');if(r.annotationId==null)throw new et("annotationId",'Required parameter "annotationId" was null or undefined when calling detachNodePoolAnnotation().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/node-pools/{id}/annotations/{annotationId}";p=p.replace("{id}",encodeURIComponent(String(r.id))),p=p.replace("{annotationId}",encodeURIComponent(String(r.annotationId)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return this.isJsonMime(m.headers.get("content-type"))?new pt(m):new ec(m)}async detachNodePoolAnnotation(r,s){return await(await this.detachNodePoolAnnotationRaw(r,s)).value()}async detachNodePoolLabelRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling detachNodePoolLabel().');if(r.labelId==null)throw new et("labelId",'Required parameter "labelId" was null or undefined when calling detachNodePoolLabel().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/node-pools/{id}/labels/{labelId}";p=p.replace("{id}",encodeURIComponent(String(r.id))),p=p.replace("{labelId}",encodeURIComponent(String(r.labelId)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return this.isJsonMime(m.headers.get("content-type"))?new pt(m):new ec(m)}async detachNodePoolLabel(r,s){return await(await this.detachNodePoolLabelRaw(r,s)).value()}async detachNodePoolServerRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling detachNodePoolServer().');if(r.serverId==null)throw new et("serverId",'Required parameter "serverId" was null or undefined when calling detachNodePoolServer().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/node-pools/{id}/servers/{serverId}";p=p.replace("{id}",encodeURIComponent(String(r.id))),p=p.replace("{serverId}",encodeURIComponent(String(r.serverId)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return this.isJsonMime(m.headers.get("content-type"))?new pt(m):new ec(m)}async detachNodePoolServer(r,s){return await(await this.detachNodePoolServerRaw(r,s)).value()}async detachNodePoolTaintRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling detachNodePoolTaint().');if(r.taintId==null)throw new et("taintId",'Required parameter "taintId" was null or undefined when calling detachNodePoolTaint().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/node-pools/{id}/taints/{taintId}";p=p.replace("{id}",encodeURIComponent(String(r.id))),p=p.replace("{taintId}",encodeURIComponent(String(r.taintId)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return this.isJsonMime(m.headers.get("content-type"))?new pt(m):new ec(m)}async detachNodePoolTaint(r,s){return await(await this.detachNodePoolTaintRaw(r,s)).value()}async getNodePoolRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling getNodePool().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/node-pools/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>vb(g))}async getNodePool(r,s){return await(await this.getNodePoolRaw(r,s)).value()}async listNodePoolAnnotationsRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling listNodePoolAnnotations().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/node-pools/{id}/annotations";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(tg))}async listNodePoolAnnotations(r,s){return await(await this.listNodePoolAnnotationsRaw(r,s)).value()}async listNodePoolLabelsRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling listNodePoolLabels().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/node-pools/{id}/labels";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(sg))}async listNodePoolLabels(r,s){return await(await this.listNodePoolLabelsRaw(r,s)).value()}async listNodePoolServersRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling listNodePoolServers().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/node-pools/{id}/servers";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(Id))}async listNodePoolServers(r,s){return await(await this.listNodePoolServersRaw(r,s)).value()}async listNodePoolTaintsRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling listNodePoolTaints().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/node-pools/{id}/taints";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(rg))}async listNodePoolTaints(r,s){return await(await this.listNodePoolTaintsRaw(r,s)).value()}async listNodePoolsRaw(r,s){const o={};r.q!=null&&(o.q=r.q);const d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/node-pools",method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(vb))}async listNodePools(r={},s){return await(await this.listNodePoolsRaw(r,s)).value()}async updateNodePoolRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling updateNodePool().');if(r.dtoUpdateNodePoolRequest==null)throw new et("dtoUpdateNodePoolRequest",'Required parameter "dtoUpdateNodePoolRequest" was null or undefined when calling updateNodePool().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/node-pools/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"PATCH",headers:d,query:o,body:QQ(r.dtoUpdateNodePoolRequest)},s);return new pt(m,g=>vb(g))}async updateNodePool(r,s){return await(await this.updateNodePoolRaw(r,s)).value()}}class Kee extends Gs{async addOrUpdateMemberRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling addOrUpdateMember().');if(r.handlersMemberUpsertReq==null)throw new et("handlersMemberUpsertReq",'Required parameter "handlersMemberUpsertReq" was null or undefined when calling addOrUpdateMember().');const o={},d={};d["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/orgs/{id}/members";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:vee(r.handlersMemberUpsertReq)},s);return new pt(m,g=>FM(g))}async addOrUpdateMember(r,s){return await(await this.addOrUpdateMemberRaw(r,s)).value()}async createOrgRaw(r,s){if(r.handlersOrgCreateReq==null)throw new et("handlersOrgCreateReq",'Required parameter "handlersOrgCreateReq" was null or undefined when calling createOrg().');const o={},d={};d["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/orgs",method:"POST",headers:d,query:o,body:bee(r.handlersOrgCreateReq)},s);return new pt(m,g=>xb(g))}async createOrg(r,s){return await(await this.createOrgRaw(r,s)).value()}async createOrgKeyRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling createOrgKey().');if(r.handlersOrgKeyCreateReq==null)throw new et("handlersOrgKeyCreateReq",'Required parameter "handlersOrgKeyCreateReq" was null or undefined when calling createOrgKey().');const o={},d={};d["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/orgs/{id}/api-keys";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:See(r.handlersOrgKeyCreateReq)},s);return new pt(m,g=>jee(g))}async createOrgKey(r,s){return await(await this.createOrgKeyRaw(r,s)).value()}async deleteOrgRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling deleteOrg().');const o={},d={};this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/orgs/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new Ii(m)}async deleteOrg(r,s){await this.deleteOrgRaw(r,s)}async deleteOrgKeyRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling deleteOrgKey().');if(r.keyId==null)throw new et("keyId",'Required parameter "keyId" was null or undefined when calling deleteOrgKey().');const o={},d={};this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/orgs/{id}/api-keys/{key_id}";p=p.replace("{id}",encodeURIComponent(String(r.id))),p=p.replace("{key_id}",encodeURIComponent(String(r.keyId)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new Ii(m)}async deleteOrgKey(r,s){await this.deleteOrgKeyRaw(r,s)}async getOrgRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling getOrg().');const o={},d={};this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/orgs/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>xb(g))}async getOrg(r,s){return await(await this.getOrgRaw(r,s)).value()}async listMembersRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling listMembers().');const o={},d={};this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/orgs/{id}/members";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(FM))}async listMembers(r,s){return await(await this.listMembersRaw(r,s)).value()}async listMyOrgsRaw(r){const s={},o={};this.configuration&&this.configuration.apiKey&&(o.Authorization=await this.configuration.apiKey("Authorization"));const p=await this.request({path:"/orgs",method:"GET",headers:o,query:s},r);return new pt(p,m=>m.map(xb))}async listMyOrgs(r){return await(await this.listMyOrgsRaw(r)).value()}async listOrgKeysRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling listOrgKeys().');const o={},d={};this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/orgs/{id}/api-keys";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(_ee))}async listOrgKeys(r,s){return await(await this.listOrgKeysRaw(r,s)).value()}async removeMemberRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling removeMember().');if(r.userId==null)throw new et("userId",'Required parameter "userId" was null or undefined when calling removeMember().');const o={},d={};this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/orgs/{id}/members/{user_id}";p=p.replace("{id}",encodeURIComponent(String(r.id))),p=p.replace("{user_id}",encodeURIComponent(String(r.userId)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new Ii(m)}async removeMember(r,s){await this.removeMemberRaw(r,s)}async updateOrgRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling updateOrg().');if(r.handlersOrgUpdateReq==null)throw new et("handlersOrgUpdateReq",'Required parameter "handlersOrgUpdateReq" was null or undefined when calling updateOrg().');const o={},d={};d["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/orgs/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"PATCH",headers:d,query:o,body:Aee(r.handlersOrgUpdateReq)},s);return new pt(m,g=>xb(g))}async updateOrg(r,s){return await(await this.updateOrgRaw(r,s)).value()}}class Vee extends Gs{async createServerRaw(r,s){if(r.dtoCreateServerRequest==null)throw new et("dtoCreateServerRequest",'Required parameter "dtoCreateServerRequest" was null or undefined when calling createServer().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/servers",method:"POST",headers:d,query:o,body:gQ(r.dtoCreateServerRequest)},s);return new pt(m,g=>Id(g))}async createServer(r,s){return await(await this.createServerRaw(r,s)).value()}async deleteServerRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling deleteServer().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/servers/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new Ii(m)}async deleteServer(r,s){await this.deleteServerRaw(r,s)}async getServerRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling getServer().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/servers/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>Id(g))}async getServer(r,s){return await(await this.getServerRaw(r,s)).value()}async listServersRaw(r,s){const o={};r.status!=null&&(o.status=r.status),r.role!=null&&(o.role=r.role);const d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/servers",method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(Id))}async listServers(r={},s){return await(await this.listServersRaw(r,s)).value()}async resetServerHostKeyRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling resetServerHostKey().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/servers/{id}/reset-hostkey";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"POST",headers:d,query:o,body:r.body},s);return new pt(m,g=>Id(g))}async resetServerHostKey(r,s){return await(await this.resetServerHostKeyRaw(r,s)).value()}async updateServerRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling updateServer().');if(r.dtoUpdateServerRequest==null)throw new et("dtoUpdateServerRequest",'Required parameter "dtoUpdateServerRequest" was null or undefined when calling updateServer().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/servers/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"PATCH",headers:d,query:o,body:ree(r.dtoUpdateServerRequest)},s);return new pt(m,g=>Id(g))}async updateServer(r,s){return await(await this.updateServerRaw(r,s)).value()}}class Hee extends Gs{async createSSHKeyRaw(r,s){if(r.dtoCreateSSHRequest==null)throw new et("dtoCreateSSHRequest",'Required parameter "dtoCreateSSHRequest" was null or undefined when calling createSSHKey().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/ssh",method:"POST",headers:d,query:o,body:fQ(r.dtoCreateSSHRequest)},s);return new pt(m,g=>LM(g))}async createSSHKey(r,s){return await(await this.createSSHKeyRaw(r,s)).value()}async deleteSSHKeyRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling deleteSSHKey().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/ssh/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new Ii(m)}async deleteSSHKey(r,s){await this.deleteSSHKeyRaw(r,s)}async downloadSSHKeyRaw(r,s){if(r.xOrgID==null)throw new et("xOrgID",'Required parameter "xOrgID" was null or undefined when calling downloadSSHKey().');if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling downloadSSHKey().');if(r.part==null)throw new et("part",'Required parameter "part" was null or undefined when calling downloadSSHKey().');const o={};r.part!=null&&(o.part=r.part);const d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/ssh/{id}/download";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return this.isJsonMime(m.headers.get("content-type"))?new pt(m):new ec(m)}async downloadSSHKey(r,s){return await(await this.downloadSSHKeyRaw(r,s)).value()}async getSSHKeyRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling getSSHKey().');const o={};r.reveal!=null&&(o.reveal=r.reveal);const d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/ssh/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>oee(g))}async getSSHKey(r,s){return await(await this.getSSHKeyRaw(r,s)).value()}async listPublicSshKeysRaw(r,s){const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/ssh",method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(LM))}async listPublicSshKeys(r={},s){return await(await this.listPublicSshKeysRaw(r,s)).value()}}class Gee extends Gs{async createTaintRaw(r,s){if(r.dtoCreateTaintRequest==null)throw new et("dtoCreateTaintRequest",'Required parameter "dtoCreateTaintRequest" was null or undefined when calling createTaint().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/taints",method:"POST",headers:d,query:o,body:vQ(r.dtoCreateTaintRequest)},s);return new pt(m,g=>rg(g))}async createTaint(r,s){return await(await this.createTaintRaw(r,s)).value()}async deleteTaintRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling deleteTaint().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/taints/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"DELETE",headers:d,query:o},s);return new Ii(m)}async deleteTaint(r,s){await this.deleteTaintRaw(r,s)}async getTaintRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling getTaint().');const o={},d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/taints/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"GET",headers:d,query:o},s);return new pt(m,g=>rg(g))}async getTaint(r,s){return await(await this.getTaintRaw(r,s)).value()}async listTaintsRaw(r,s){const o={};r.key!=null&&(o.key=r.key),r.value!=null&&(o.value=r.value),r.q!=null&&(o.q=r.q);const d={};r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));const m=await this.request({path:"/taints",method:"GET",headers:d,query:o},s);return new pt(m,g=>g.map(rg))}async listTaints(r={},s){return await(await this.listTaintsRaw(r,s)).value()}async updateTaintRaw(r,s){if(r.id==null)throw new et("id",'Required parameter "id" was null or undefined when calling updateTaint().');if(r.dtoUpdateTaintRequest==null)throw new et("dtoUpdateTaintRequest",'Required parameter "dtoUpdateTaintRequest" was null or undefined when calling updateTaint().');const o={},d={};d["Content-Type"]="application/json",r.xOrgID!=null&&(d["X-Org-ID"]=String(r.xOrgID)),this.configuration&&this.configuration.apiKey&&(d["X-ORG-KEY"]=await this.configuration.apiKey("X-ORG-KEY")),this.configuration&&this.configuration.apiKey&&(d["X-ORG-SECRET"]=await this.configuration.apiKey("X-ORG-SECRET")),this.configuration&&this.configuration.apiKey&&(d.Authorization=await this.configuration.apiKey("Authorization"));let p="/taints/{id}";p=p.replace("{id}",encodeURIComponent(String(r.id)));const m=await this.request({path:p,method:"PATCH",headers:d,query:o,body:iee(r.dtoUpdateTaintRequest)},s);return new pt(m,g=>rg(g))}async updateTaint(r,s){return await(await this.updateTaintRaw(r,s)).value()}}const B_="/api/v1";function Xee(){return new uL({basePath:B_,accessToken:async()=>Ks.getAccessToken()??"",middleware:[{async pre(e){const r=new Headers(e.init?.headers??{});e.init?.body!=null&&!(e.init.body instanceof FormData)&&!(e.init.body instanceof Blob)&&!r.has("Content-Type")&&r.set("Content-Type","application/json");const o=Ks.getAccessToken();o&&r.set("Authorization",`Bearer ${o}`);const d=Qo.get();return d&&r.set("X-Org-ID",d),{...e,init:{...e.init,headers:r}}},async post(e){return e.response}}]})}function Ui(e){return new e(Xee())}function Yee(){return Ui(Pee)}function Zee(){return Ui(qee)}function Wee(){return Ui(Bee)}function yC(){return Ui(Kee)}function Jee(){return Ui(Hee)}function Qee(){return Ui(Vee)}function ete(){return Ui(Gee)}function tte(){return Ui(zee)}function nte(){return Ui(Nee)}function rte(){return Ui(Dee)}function ste(){return Ui(Uee)}function ite(){return Ui(Iee)}function ate(){return Ui(Lee)}function ote(){return Ui(Fee)}function lte(){return Ui(Mee)}let UE=null;async function cte(){const e=Ks.get();if(!e?.refresh_token)return!1;try{const r=await fetch(`${B_}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refresh_token:e.refresh_token})});if(!r.ok)return!1;const s=await r.json();return Ks.set(s),!0}catch{return!1}}async function BM(){return UE||(UE=cte().finally(()=>{UE=null})),UE}function ute(e){return e?.status===401||e?.cause?.status===401||e?.response?.status===401||e instanceof Response&&e.status===401}async function ut(e){Ks.willExpireSoon?.(30)&&await BM();try{return await e()}catch(r){if(!ute(r)||!await BM())throw r;return await e()}}const UM=Zee(),NR=Wee(),yp={getMe:()=>ut(async()=>await UM.getMe()),updateMe:e=>ut(async()=>await UM.updateMe({handlersUpdateMeRequest:e})),listKeys:()=>ut(async()=>await NR.listUserAPIKeys()),createKey:e=>ut(async()=>await NR.createUserAPIKey({handlersCreateUserKeyRequest:e})),deleteKey:e=>ut(async()=>(await NR.deleteUserAPIKey({id:e}),!0))},dte={footer:async()=>{const e=await fetch("/api/v1/version",{cache:"no-store"});if(!e.ok)throw new Error("failed to fetch version");return await e.json()}};function KM(e,r){if(typeof e=="function")return e(r);e!=null&&(e.current=r)}function Li(...e){return r=>{let s=!1;const o=e.map(d=>{const p=KM(d,r);return!s&&typeof p=="function"&&(s=!0),p});if(s)return()=>{for(let d=0;d{let{children:p,...m}=o;mL(p)&&typeof _j=="function"&&(p=_j(p._payload));const g=R.Children.toArray(p),b=g.find(gte);if(b){const S=b.props.children,j=g.map(A=>A===b?R.Children.count(S)>1?R.Children.only(null):R.isValidElement(S)?S.props.children:null:A);return u.jsx(r,{...m,ref:d,children:R.isValidElement(S)?R.cloneElement(S,void 0,j):null})}return u.jsx(r,{...m,ref:d,children:p})});return s.displayName=`${e}.Slot`,s}var Cg=ew("Slot");function fte(e){const r=R.forwardRef((s,o)=>{let{children:d,...p}=s;if(mL(d)&&typeof _j=="function"&&(d=_j(d._payload)),R.isValidElement(d)){const m=vte(d),g=yte(p,d.props);return d.type!==R.Fragment&&(g.ref=o?Li(o,m):m),R.cloneElement(d,g)}return R.Children.count(d)>1?R.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var mte=Symbol("radix.slottable");function gte(e){return R.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===mte}function yte(e,r){const s={...r};for(const o in r){const d=e[o],p=r[o];/^on[A-Z]/.test(o)?d&&p?s[o]=(...g)=>{const b=p(...g);return d(...g),b}:d&&(s[o]=d):o==="style"?s[o]={...d,...p}:o==="className"&&(s[o]=[d,p].filter(Boolean).join(" "))}return{...e,...s}}function vte(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning;return s?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}function gL(e){var r,s,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var d=e.length;for(r=0;rtypeof e=="boolean"?`${e}`:e===0?"0":e,HM=yL,U_=(e,r)=>s=>{var o;if(r?.variants==null)return HM(e,s?.class,s?.className);const{variants:d,defaultVariants:p}=r,m=Object.keys(d).map(S=>{const j=s?.[S],A=p?.[S];if(j===null)return null;const k=VM(j)||VM(A);return d[S][k]}),g=s&&Object.entries(s).reduce((S,j)=>{let[A,k]=j;return k===void 0||(S[A]=k),S},{}),b=r==null||(o=r.compoundVariants)===null||o===void 0?void 0:o.reduce((S,j)=>{let{class:A,className:k,...T}=j;return Object.entries(T).every(M=>{let[I,q]=M;return Array.isArray(q)?q.includes({...p,...g}[I]):{...p,...g}[I]===q})?[...S,A,k]:S},[]);return HM(e,m,b,s?.class,s?.className)},xte=(e,r)=>{const s=new Array(e.length+r.length);for(let o=0;o({classGroupId:e,validator:r}),vL=(e=new Map,r=null,s)=>({nextPart:e,validators:r,classGroupId:s}),$j="-",GM=[],wte="arbitrary..",Ste=e=>{const r=jte(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:m=>{if(m.startsWith("[")&&m.endsWith("]"))return Ete(m);const g=m.split($j),b=g[0]===""&&g.length>1?1:0;return xL(g,b,r)},getConflictingClassGroupIds:(m,g)=>{if(g){const b=o[m],S=s[m];return b?S?xte(S,b):b:S||GM}return s[m]||GM}}},xL=(e,r,s)=>{if(e.length-r===0)return s.classGroupId;const d=e[r],p=s.nextPart.get(d);if(p){const S=xL(e,r+1,p);if(S)return S}const m=s.validators;if(m===null)return;const g=r===0?e.join($j):e.slice(r).join($j),b=m.length;for(let S=0;Se.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const r=e.slice(1,-1),s=r.indexOf(":"),o=r.slice(0,s);return o?wte+o:void 0})(),jte=e=>{const{theme:r,classGroups:s}=e;return Cte(s,r)},Cte=(e,r)=>{const s=vL();for(const o in e){const d=e[o];K_(d,s,o,r)}return s},K_=(e,r,s,o)=>{const d=e.length;for(let p=0;p{if(typeof e=="string"){Ote(e,r,s);return}if(typeof e=="function"){kte(e,r,s,o);return}Rte(e,r,s,o)},Ote=(e,r,s)=>{const o=e===""?r:bL(r,e);o.classGroupId=s},kte=(e,r,s,o)=>{if(Tte(e)){K_(e(o),r,s,o);return}r.validators===null&&(r.validators=[]),r.validators.push(bte(s,e))},Rte=(e,r,s,o)=>{const d=Object.entries(e),p=d.length;for(let m=0;m{let s=e;const o=r.split($j),d=o.length;for(let p=0;p"isThemeGetter"in e&&e.isThemeGetter===!0,_te=e=>{if(e<1)return{get:()=>{},set:()=>{}};let r=0,s=Object.create(null),o=Object.create(null);const d=(p,m)=>{s[p]=m,r++,r>e&&(r=0,o=s,s=Object.create(null))};return{get(p){let m=s[p];if(m!==void 0)return m;if((m=o[p])!==void 0)return d(p,m),m},set(p,m){p in s?s[p]=m:d(p,m)}}},DT="!",XM=":",$te=[],YM=(e,r,s,o,d)=>({modifiers:e,hasImportantModifier:r,baseClassName:s,maybePostfixModifierPosition:o,isExternal:d}),Nte=e=>{const{prefix:r,experimentalParseClassName:s}=e;let o=d=>{const p=[];let m=0,g=0,b=0,S;const j=d.length;for(let I=0;Ib?S-b:void 0;return YM(p,T,k,M)};if(r){const d=r+XM,p=o;o=m=>m.startsWith(d)?p(m.slice(d.length)):YM($te,!1,m,void 0,!0)}if(s){const d=o;o=p=>s({className:p,parseClassName:d})}return o},Dte=e=>{const r=new Map;return e.orderSensitiveModifiers.forEach((s,o)=>{r.set(s,1e6+o)}),s=>{const o=[];let d=[];for(let p=0;p0&&(d.sort(),o.push(...d),d=[]),o.push(m)):d.push(m)}return d.length>0&&(d.sort(),o.push(...d)),o}},Pte=e=>({cache:_te(e.cacheSize),parseClassName:Nte(e),sortModifiers:Dte(e),...Ste(e)}),Mte=/\s+/,Ite=(e,r)=>{const{parseClassName:s,getClassGroupId:o,getConflictingClassGroupIds:d,sortModifiers:p}=r,m=[],g=e.trim().split(Mte);let b="";for(let S=g.length-1;S>=0;S-=1){const j=g[S],{isExternal:A,modifiers:k,hasImportantModifier:T,baseClassName:M,maybePostfixModifierPosition:I}=s(j);if(A){b=j+(b.length>0?" "+b:b);continue}let q=!!I,G=o(q?M.substring(0,I):M);if(!G){if(!q){b=j+(b.length>0?" "+b:b);continue}if(G=o(M),!G){b=j+(b.length>0?" "+b:b);continue}q=!1}const K=k.length===0?"":k.length===1?k[0]:p(k).join(":"),X=T?K+DT:K,L=X+G;if(m.indexOf(L)>-1)continue;m.push(L);const ee=d(G,q);for(let oe=0;oe0?" "+b:b)}return b},Lte=(...e)=>{let r=0,s,o,d="";for(;r{if(typeof e=="string")return e;let r,s="";for(let o=0;o{let s,o,d,p;const m=b=>{const S=r.reduce((j,A)=>A(j),e());return s=Pte(S),o=s.cache.get,d=s.cache.set,p=g,g(b)},g=b=>{const S=o(b);if(S)return S;const j=Ite(b,s);return d(b,j),j};return p=m,(...b)=>p(Lte(...b))},Fte=[],bs=e=>{const r=s=>s[e]||Fte;return r.isThemeGetter=!0,r},SL=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,EL=/^\((?:(\w[\w-]*):)?(.+)\)$/i,qte=/^\d+\/\d+$/,Bte=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ute=/\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$/,Kte=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Vte=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Hte=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Km=e=>qte.test(e),jn=e=>!!e&&!Number.isNaN(Number(e)),Nd=e=>!!e&&Number.isInteger(Number(e)),DR=e=>e.endsWith("%")&&jn(e.slice(0,-1)),lu=e=>Bte.test(e),Gte=()=>!0,Xte=e=>Ute.test(e)&&!Kte.test(e),jL=()=>!1,Yte=e=>Vte.test(e),Zte=e=>Hte.test(e),Wte=e=>!Mt(e)&&!It(e),Jte=e=>Ag(e,OL,jL),Mt=e=>SL.test(e),fp=e=>Ag(e,kL,Xte),PR=e=>Ag(e,rne,jn),ZM=e=>Ag(e,CL,jL),Qte=e=>Ag(e,AL,Zte),KE=e=>Ag(e,RL,Yte),It=e=>EL.test(e),sb=e=>Og(e,kL),ene=e=>Og(e,sne),WM=e=>Og(e,CL),tne=e=>Og(e,OL),nne=e=>Og(e,AL),VE=e=>Og(e,RL,!0),Ag=(e,r,s)=>{const o=SL.exec(e);return o?o[1]?r(o[1]):s(o[2]):!1},Og=(e,r,s=!1)=>{const o=EL.exec(e);return o?o[1]?r(o[1]):s:!1},CL=e=>e==="position"||e==="percentage",AL=e=>e==="image"||e==="url",OL=e=>e==="length"||e==="size"||e==="bg-size",kL=e=>e==="length",rne=e=>e==="number",sne=e=>e==="family-name",RL=e=>e==="shadow",ine=()=>{const e=bs("color"),r=bs("font"),s=bs("text"),o=bs("font-weight"),d=bs("tracking"),p=bs("leading"),m=bs("breakpoint"),g=bs("container"),b=bs("spacing"),S=bs("radius"),j=bs("shadow"),A=bs("inset-shadow"),k=bs("text-shadow"),T=bs("drop-shadow"),M=bs("blur"),I=bs("perspective"),q=bs("aspect"),G=bs("ease"),K=bs("animate"),X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],ee=()=>[...L(),It,Mt],oe=()=>["auto","hidden","clip","visible","scroll"],Q=()=>["auto","contain","none"],ne=()=>[It,Mt,b],de=()=>[Km,"full","auto",...ne()],je=()=>[Nd,"none","subgrid",It,Mt],ve=()=>["auto",{span:["full",Nd,It,Mt]},Nd,It,Mt],le=()=>[Nd,"auto",It,Mt],be=()=>["auto","min","max","fr",It,Mt],Ce=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Ke=()=>["start","end","center","stretch","center-safe","end-safe"],ce=()=>["auto",...ne()],re=()=>[Km,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...ne()],ue=()=>[e,It,Mt],_e=()=>[...L(),WM,ZM,{position:[It,Mt]}],fe=()=>["no-repeat",{repeat:["","x","y","space","round"]}],He=()=>["auto","cover","contain",tne,Jte,{size:[It,Mt]}],Oe=()=>[DR,sb,fp],ke=()=>["","none","full",S,It,Mt],Ve=()=>["",jn,sb,fp],ie=()=>["solid","dashed","dotted","double"],De=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Le=()=>[jn,DR,WM,ZM],tt=()=>["","none",M,It,Mt],ft=()=>["none",jn,It,Mt],Ot=()=>["none",jn,It,Mt],Ft=()=>[jn,It,Mt],kt=()=>[Km,"full",...ne()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[lu],breakpoint:[lu],color:[Gte],container:[lu],"drop-shadow":[lu],ease:["in","out","in-out"],font:[Wte],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[lu],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[lu],shadow:[lu],spacing:["px",jn],text:[lu],"text-shadow":[lu],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Km,Mt,It,q]}],container:["container"],columns:[{columns:[jn,Mt,It,g]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:ee()}],overflow:[{overflow:oe()}],"overflow-x":[{"overflow-x":oe()}],"overflow-y":[{"overflow-y":oe()}],overscroll:[{overscroll:Q()}],"overscroll-x":[{"overscroll-x":Q()}],"overscroll-y":[{"overscroll-y":Q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:de()}],"inset-x":[{"inset-x":de()}],"inset-y":[{"inset-y":de()}],start:[{start:de()}],end:[{end:de()}],top:[{top:de()}],right:[{right:de()}],bottom:[{bottom:de()}],left:[{left:de()}],visibility:["visible","invisible","collapse"],z:[{z:[Nd,"auto",It,Mt]}],basis:[{basis:[Km,"full","auto",g,...ne()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[jn,Km,"auto","initial","none",Mt]}],grow:[{grow:["",jn,It,Mt]}],shrink:[{shrink:["",jn,It,Mt]}],order:[{order:[Nd,"first","last","none",It,Mt]}],"grid-cols":[{"grid-cols":je()}],"col-start-end":[{col:ve()}],"col-start":[{"col-start":le()}],"col-end":[{"col-end":le()}],"grid-rows":[{"grid-rows":je()}],"row-start-end":[{row:ve()}],"row-start":[{"row-start":le()}],"row-end":[{"row-end":le()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":be()}],"auto-rows":[{"auto-rows":be()}],gap:[{gap:ne()}],"gap-x":[{"gap-x":ne()}],"gap-y":[{"gap-y":ne()}],"justify-content":[{justify:[...Ce(),"normal"]}],"justify-items":[{"justify-items":[...Ke(),"normal"]}],"justify-self":[{"justify-self":["auto",...Ke()]}],"align-content":[{content:["normal",...Ce()]}],"align-items":[{items:[...Ke(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Ke(),{baseline:["","last"]}]}],"place-content":[{"place-content":Ce()}],"place-items":[{"place-items":[...Ke(),"baseline"]}],"place-self":[{"place-self":["auto",...Ke()]}],p:[{p:ne()}],px:[{px:ne()}],py:[{py:ne()}],ps:[{ps:ne()}],pe:[{pe:ne()}],pt:[{pt:ne()}],pr:[{pr:ne()}],pb:[{pb:ne()}],pl:[{pl:ne()}],m:[{m:ce()}],mx:[{mx:ce()}],my:[{my:ce()}],ms:[{ms:ce()}],me:[{me:ce()}],mt:[{mt:ce()}],mr:[{mr:ce()}],mb:[{mb:ce()}],ml:[{ml:ce()}],"space-x":[{"space-x":ne()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":ne()}],"space-y-reverse":["space-y-reverse"],size:[{size:re()}],w:[{w:[g,"screen",...re()]}],"min-w":[{"min-w":[g,"screen","none",...re()]}],"max-w":[{"max-w":[g,"screen","none","prose",{screen:[m]},...re()]}],h:[{h:["screen","lh",...re()]}],"min-h":[{"min-h":["screen","lh","none",...re()]}],"max-h":[{"max-h":["screen","lh",...re()]}],"font-size":[{text:["base",s,sb,fp]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,It,PR]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",DR,Mt]}],"font-family":[{font:[ene,Mt,r]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[d,It,Mt]}],"line-clamp":[{"line-clamp":[jn,"none",It,PR]}],leading:[{leading:[p,...ne()]}],"list-image":[{"list-image":["none",It,Mt]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",It,Mt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:ue()}],"text-color":[{text:ue()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ie(),"wavy"]}],"text-decoration-thickness":[{decoration:[jn,"from-font","auto",It,fp]}],"text-decoration-color":[{decoration:ue()}],"underline-offset":[{"underline-offset":[jn,"auto",It,Mt]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:ne()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",It,Mt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",It,Mt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:_e()}],"bg-repeat":[{bg:fe()}],"bg-size":[{bg:He()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Nd,It,Mt],radial:["",It,Mt],conic:[Nd,It,Mt]},nne,Qte]}],"bg-color":[{bg:ue()}],"gradient-from-pos":[{from:Oe()}],"gradient-via-pos":[{via:Oe()}],"gradient-to-pos":[{to:Oe()}],"gradient-from":[{from:ue()}],"gradient-via":[{via:ue()}],"gradient-to":[{to:ue()}],rounded:[{rounded:ke()}],"rounded-s":[{"rounded-s":ke()}],"rounded-e":[{"rounded-e":ke()}],"rounded-t":[{"rounded-t":ke()}],"rounded-r":[{"rounded-r":ke()}],"rounded-b":[{"rounded-b":ke()}],"rounded-l":[{"rounded-l":ke()}],"rounded-ss":[{"rounded-ss":ke()}],"rounded-se":[{"rounded-se":ke()}],"rounded-ee":[{"rounded-ee":ke()}],"rounded-es":[{"rounded-es":ke()}],"rounded-tl":[{"rounded-tl":ke()}],"rounded-tr":[{"rounded-tr":ke()}],"rounded-br":[{"rounded-br":ke()}],"rounded-bl":[{"rounded-bl":ke()}],"border-w":[{border:Ve()}],"border-w-x":[{"border-x":Ve()}],"border-w-y":[{"border-y":Ve()}],"border-w-s":[{"border-s":Ve()}],"border-w-e":[{"border-e":Ve()}],"border-w-t":[{"border-t":Ve()}],"border-w-r":[{"border-r":Ve()}],"border-w-b":[{"border-b":Ve()}],"border-w-l":[{"border-l":Ve()}],"divide-x":[{"divide-x":Ve()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Ve()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ie(),"hidden","none"]}],"divide-style":[{divide:[...ie(),"hidden","none"]}],"border-color":[{border:ue()}],"border-color-x":[{"border-x":ue()}],"border-color-y":[{"border-y":ue()}],"border-color-s":[{"border-s":ue()}],"border-color-e":[{"border-e":ue()}],"border-color-t":[{"border-t":ue()}],"border-color-r":[{"border-r":ue()}],"border-color-b":[{"border-b":ue()}],"border-color-l":[{"border-l":ue()}],"divide-color":[{divide:ue()}],"outline-style":[{outline:[...ie(),"none","hidden"]}],"outline-offset":[{"outline-offset":[jn,It,Mt]}],"outline-w":[{outline:["",jn,sb,fp]}],"outline-color":[{outline:ue()}],shadow:[{shadow:["","none",j,VE,KE]}],"shadow-color":[{shadow:ue()}],"inset-shadow":[{"inset-shadow":["none",A,VE,KE]}],"inset-shadow-color":[{"inset-shadow":ue()}],"ring-w":[{ring:Ve()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:ue()}],"ring-offset-w":[{"ring-offset":[jn,fp]}],"ring-offset-color":[{"ring-offset":ue()}],"inset-ring-w":[{"inset-ring":Ve()}],"inset-ring-color":[{"inset-ring":ue()}],"text-shadow":[{"text-shadow":["none",k,VE,KE]}],"text-shadow-color":[{"text-shadow":ue()}],opacity:[{opacity:[jn,It,Mt]}],"mix-blend":[{"mix-blend":[...De(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":De()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[jn]}],"mask-image-linear-from-pos":[{"mask-linear-from":Le()}],"mask-image-linear-to-pos":[{"mask-linear-to":Le()}],"mask-image-linear-from-color":[{"mask-linear-from":ue()}],"mask-image-linear-to-color":[{"mask-linear-to":ue()}],"mask-image-t-from-pos":[{"mask-t-from":Le()}],"mask-image-t-to-pos":[{"mask-t-to":Le()}],"mask-image-t-from-color":[{"mask-t-from":ue()}],"mask-image-t-to-color":[{"mask-t-to":ue()}],"mask-image-r-from-pos":[{"mask-r-from":Le()}],"mask-image-r-to-pos":[{"mask-r-to":Le()}],"mask-image-r-from-color":[{"mask-r-from":ue()}],"mask-image-r-to-color":[{"mask-r-to":ue()}],"mask-image-b-from-pos":[{"mask-b-from":Le()}],"mask-image-b-to-pos":[{"mask-b-to":Le()}],"mask-image-b-from-color":[{"mask-b-from":ue()}],"mask-image-b-to-color":[{"mask-b-to":ue()}],"mask-image-l-from-pos":[{"mask-l-from":Le()}],"mask-image-l-to-pos":[{"mask-l-to":Le()}],"mask-image-l-from-color":[{"mask-l-from":ue()}],"mask-image-l-to-color":[{"mask-l-to":ue()}],"mask-image-x-from-pos":[{"mask-x-from":Le()}],"mask-image-x-to-pos":[{"mask-x-to":Le()}],"mask-image-x-from-color":[{"mask-x-from":ue()}],"mask-image-x-to-color":[{"mask-x-to":ue()}],"mask-image-y-from-pos":[{"mask-y-from":Le()}],"mask-image-y-to-pos":[{"mask-y-to":Le()}],"mask-image-y-from-color":[{"mask-y-from":ue()}],"mask-image-y-to-color":[{"mask-y-to":ue()}],"mask-image-radial":[{"mask-radial":[It,Mt]}],"mask-image-radial-from-pos":[{"mask-radial-from":Le()}],"mask-image-radial-to-pos":[{"mask-radial-to":Le()}],"mask-image-radial-from-color":[{"mask-radial-from":ue()}],"mask-image-radial-to-color":[{"mask-radial-to":ue()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":L()}],"mask-image-conic-pos":[{"mask-conic":[jn]}],"mask-image-conic-from-pos":[{"mask-conic-from":Le()}],"mask-image-conic-to-pos":[{"mask-conic-to":Le()}],"mask-image-conic-from-color":[{"mask-conic-from":ue()}],"mask-image-conic-to-color":[{"mask-conic-to":ue()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:_e()}],"mask-repeat":[{mask:fe()}],"mask-size":[{mask:He()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",It,Mt]}],filter:[{filter:["","none",It,Mt]}],blur:[{blur:tt()}],brightness:[{brightness:[jn,It,Mt]}],contrast:[{contrast:[jn,It,Mt]}],"drop-shadow":[{"drop-shadow":["","none",T,VE,KE]}],"drop-shadow-color":[{"drop-shadow":ue()}],grayscale:[{grayscale:["",jn,It,Mt]}],"hue-rotate":[{"hue-rotate":[jn,It,Mt]}],invert:[{invert:["",jn,It,Mt]}],saturate:[{saturate:[jn,It,Mt]}],sepia:[{sepia:["",jn,It,Mt]}],"backdrop-filter":[{"backdrop-filter":["","none",It,Mt]}],"backdrop-blur":[{"backdrop-blur":tt()}],"backdrop-brightness":[{"backdrop-brightness":[jn,It,Mt]}],"backdrop-contrast":[{"backdrop-contrast":[jn,It,Mt]}],"backdrop-grayscale":[{"backdrop-grayscale":["",jn,It,Mt]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[jn,It,Mt]}],"backdrop-invert":[{"backdrop-invert":["",jn,It,Mt]}],"backdrop-opacity":[{"backdrop-opacity":[jn,It,Mt]}],"backdrop-saturate":[{"backdrop-saturate":[jn,It,Mt]}],"backdrop-sepia":[{"backdrop-sepia":["",jn,It,Mt]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":ne()}],"border-spacing-x":[{"border-spacing-x":ne()}],"border-spacing-y":[{"border-spacing-y":ne()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",It,Mt]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[jn,"initial",It,Mt]}],ease:[{ease:["linear","initial",G,It,Mt]}],delay:[{delay:[jn,It,Mt]}],animate:[{animate:["none",K,It,Mt]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[I,It,Mt]}],"perspective-origin":[{"perspective-origin":ee()}],rotate:[{rotate:ft()}],"rotate-x":[{"rotate-x":ft()}],"rotate-y":[{"rotate-y":ft()}],"rotate-z":[{"rotate-z":ft()}],scale:[{scale:Ot()}],"scale-x":[{"scale-x":Ot()}],"scale-y":[{"scale-y":Ot()}],"scale-z":[{"scale-z":Ot()}],"scale-3d":["scale-3d"],skew:[{skew:Ft()}],"skew-x":[{"skew-x":Ft()}],"skew-y":[{"skew-y":Ft()}],transform:[{transform:[It,Mt,"","none","gpu","cpu"]}],"transform-origin":[{origin:ee()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:kt()}],"translate-x":[{"translate-x":kt()}],"translate-y":[{"translate-y":kt()}],"translate-z":[{"translate-z":kt()}],"translate-none":["translate-none"],accent:[{accent:ue()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:ue()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",It,Mt]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ne()}],"scroll-mx":[{"scroll-mx":ne()}],"scroll-my":[{"scroll-my":ne()}],"scroll-ms":[{"scroll-ms":ne()}],"scroll-me":[{"scroll-me":ne()}],"scroll-mt":[{"scroll-mt":ne()}],"scroll-mr":[{"scroll-mr":ne()}],"scroll-mb":[{"scroll-mb":ne()}],"scroll-ml":[{"scroll-ml":ne()}],"scroll-p":[{"scroll-p":ne()}],"scroll-px":[{"scroll-px":ne()}],"scroll-py":[{"scroll-py":ne()}],"scroll-ps":[{"scroll-ps":ne()}],"scroll-pe":[{"scroll-pe":ne()}],"scroll-pt":[{"scroll-pt":ne()}],"scroll-pr":[{"scroll-pr":ne()}],"scroll-pb":[{"scroll-pb":ne()}],"scroll-pl":[{"scroll-pl":ne()}],"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",It,Mt]}],fill:[{fill:["none",...ue()]}],"stroke-w":[{stroke:[jn,sb,fp,PR]}],stroke:[{stroke:["none",...ue()]}],"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-x","border-w-y","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-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},ane=zte(ine);function ht(...e){return ane(yL(e))}function el(e,r=24){return!e||e.length<=r*2+3?e:`${e.slice(0,r)}…${e.slice(-r)}`}const one=U_("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function ns({className:e,variant:r,asChild:s=!1,...o}){const d=s?Cg:"span";return u.jsx(d,{"data-slot":"badge",className:ht(one({variant:r}),e),...o})}const V_=U_("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Fe({className:e,variant:r,size:s,asChild:o=!1,...d}){const p=o?Cg:"button";return u.jsx(p,{"data-slot":"button",className:ht(V_({variant:r,size:s,className:e})),...d})}var lne=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],cne=lne.reduce((e,r)=>{const s=ew(`Primitive.${r}`),o=R.forwardRef((d,p)=>{const{asChild:m,...g}=d,b=m?s:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(b,{...g,ref:p})});return o.displayName=`Primitive.${r}`,{...e,[r]:o}},{}),une="Separator",JM="horizontal",dne=["horizontal","vertical"],TL=R.forwardRef((e,r)=>{const{decorative:s,orientation:o=JM,...d}=e,p=hne(o)?o:JM,g=s?{role:"none"}:{"aria-orientation":p==="vertical"?p:void 0,role:"separator"};return u.jsx(cne.div,{"data-orientation":p,...g,...d,ref:r})});TL.displayName=une;function hne(e){return dne.includes(e)}var pne=TL;function bb({className:e,orientation:r="horizontal",decorative:s=!0,...o}){return u.jsx(pne,{"data-slot":"separator",decorative:s,orientation:r,className:ht("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...o})}function $t(e,r,{checkForDefaultPrevented:s=!0}={}){return function(d){if(e?.(d),s===!1||!d.defaultPrevented)return r?.(d)}}function fne(e,r){const s=R.createContext(r),o=p=>{const{children:m,...g}=p,b=R.useMemo(()=>g,Object.values(g));return u.jsx(s.Provider,{value:b,children:m})};o.displayName=e+"Provider";function d(p){const m=R.useContext(s);if(m)return m;if(r!==void 0)return r;throw new Error(`\`${p}\` must be used within \`${e}\``)}return[o,d]}function al(e,r=[]){let s=[];function o(p,m){const g=R.createContext(m),b=s.length;s=[...s,m];const S=A=>{const{scope:k,children:T,...M}=A,I=k?.[e]?.[b]||g,q=R.useMemo(()=>M,Object.values(M));return u.jsx(I.Provider,{value:q,children:T})};S.displayName=p+"Provider";function j(A,k){const T=k?.[e]?.[b]||g,M=R.useContext(T);if(M)return M;if(m!==void 0)return m;throw new Error(`\`${A}\` must be used within \`${p}\``)}return[S,j]}const d=()=>{const p=s.map(m=>R.createContext(m));return function(g){const b=g?.[e]||p;return R.useMemo(()=>({[`__scope${e}`]:{...g,[e]:b}}),[g,b])}};return d.scopeName=e,[o,mne(d,...r)]}function mne(...e){const r=e[0];if(e.length===1)return r;const s=()=>{const o=e.map(d=>({useScope:d(),scopeName:d.scopeName}));return function(p){const m=o.reduce((g,{useScope:b,scopeName:S})=>{const A=b(p)[`__scope${S}`];return{...g,...A}},{});return R.useMemo(()=>({[`__scope${r.scopeName}`]:m}),[m])}};return s.scopeName=r.scopeName,s}function gne(e){const r=yne(e),s=R.forwardRef((o,d)=>{const{children:p,...m}=o,g=R.Children.toArray(p),b=g.find(xne);if(b){const S=b.props.children,j=g.map(A=>A===b?R.Children.count(S)>1?R.Children.only(null):R.isValidElement(S)?S.props.children:null:A);return u.jsx(r,{...m,ref:d,children:R.isValidElement(S)?R.cloneElement(S,void 0,j):null})}return u.jsx(r,{...m,ref:d,children:p})});return s.displayName=`${e}.Slot`,s}function yne(e){const r=R.forwardRef((s,o)=>{const{children:d,...p}=s;if(R.isValidElement(d)){const m=wne(d),g=bne(p,d.props);return d.type!==R.Fragment&&(g.ref=o?Li(o,m):m),R.cloneElement(d,g)}return R.Children.count(d)>1?R.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var vne=Symbol("radix.slottable");function xne(e){return R.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===vne}function bne(e,r){const s={...r};for(const o in r){const d=e[o],p=r[o];/^on[A-Z]/.test(o)?d&&p?s[o]=(...g)=>{const b=p(...g);return d(...g),b}:d&&(s[o]=d):o==="style"?s[o]={...d,...p}:o==="className"&&(s[o]=[d,p].filter(Boolean).join(" "))}return{...e,...s}}function wne(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning;return s?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var Sne=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Cn=Sne.reduce((e,r)=>{const s=gne(`Primitive.${r}`),o=R.forwardRef((d,p)=>{const{asChild:m,...g}=d,b=m?s:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(b,{...g,ref:p})});return o.displayName=`Primitive.${r}`,{...e,[r]:o}},{});function _L(e,r){e&&mC.flushSync(()=>e.dispatchEvent(r))}function tl(e){const r=R.useRef(e);return R.useEffect(()=>{r.current=e}),R.useMemo(()=>(...s)=>r.current?.(...s),[])}function Ene(e,r=globalThis?.document){const s=tl(e);R.useEffect(()=>{const o=d=>{d.key==="Escape"&&s(d)};return r.addEventListener("keydown",o,{capture:!0}),()=>r.removeEventListener("keydown",o,{capture:!0})},[s,r])}var jne="DismissableLayer",PT="dismissableLayer.update",Cne="dismissableLayer.pointerDownOutside",Ane="dismissableLayer.focusOutside",QM,$L=R.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),kg=R.forwardRef((e,r)=>{const{disableOutsidePointerEvents:s=!1,onEscapeKeyDown:o,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:m,onDismiss:g,...b}=e,S=R.useContext($L),[j,A]=R.useState(null),k=j?.ownerDocument??globalThis?.document,[,T]=R.useState({}),M=zn(r,Q=>A(Q)),I=Array.from(S.layers),[q]=[...S.layersWithOutsidePointerEventsDisabled].slice(-1),G=I.indexOf(q),K=j?I.indexOf(j):-1,X=S.layersWithOutsidePointerEventsDisabled.size>0,L=K>=G,ee=Rne(Q=>{const ne=Q.target,de=[...S.branches].some(je=>je.contains(ne));!L||de||(d?.(Q),m?.(Q),Q.defaultPrevented||g?.())},k),oe=Tne(Q=>{const ne=Q.target;[...S.branches].some(je=>je.contains(ne))||(p?.(Q),m?.(Q),Q.defaultPrevented||g?.())},k);return Ene(Q=>{K===S.layers.size-1&&(o?.(Q),!Q.defaultPrevented&&g&&(Q.preventDefault(),g()))},k),R.useEffect(()=>{if(j)return s&&(S.layersWithOutsidePointerEventsDisabled.size===0&&(QM=k.body.style.pointerEvents,k.body.style.pointerEvents="none"),S.layersWithOutsidePointerEventsDisabled.add(j)),S.layers.add(j),eI(),()=>{s&&S.layersWithOutsidePointerEventsDisabled.size===1&&(k.body.style.pointerEvents=QM)}},[j,k,s,S]),R.useEffect(()=>()=>{j&&(S.layers.delete(j),S.layersWithOutsidePointerEventsDisabled.delete(j),eI())},[j,S]),R.useEffect(()=>{const Q=()=>T({});return document.addEventListener(PT,Q),()=>document.removeEventListener(PT,Q)},[]),u.jsx(Cn.div,{...b,ref:M,style:{pointerEvents:X?L?"auto":"none":void 0,...e.style},onFocusCapture:$t(e.onFocusCapture,oe.onFocusCapture),onBlurCapture:$t(e.onBlurCapture,oe.onBlurCapture),onPointerDownCapture:$t(e.onPointerDownCapture,ee.onPointerDownCapture)})});kg.displayName=jne;var One="DismissableLayerBranch",kne=R.forwardRef((e,r)=>{const s=R.useContext($L),o=R.useRef(null),d=zn(r,o);return R.useEffect(()=>{const p=o.current;if(p)return s.branches.add(p),()=>{s.branches.delete(p)}},[s.branches]),u.jsx(Cn.div,{...e,ref:d})});kne.displayName=One;function Rne(e,r=globalThis?.document){const s=tl(e),o=R.useRef(!1),d=R.useRef(()=>{});return R.useEffect(()=>{const p=g=>{if(g.target&&!o.current){let b=function(){NL(Cne,s,S,{discrete:!0})};const S={originalEvent:g};g.pointerType==="touch"?(r.removeEventListener("click",d.current),d.current=b,r.addEventListener("click",d.current,{once:!0})):b()}else r.removeEventListener("click",d.current);o.current=!1},m=window.setTimeout(()=>{r.addEventListener("pointerdown",p)},0);return()=>{window.clearTimeout(m),r.removeEventListener("pointerdown",p),r.removeEventListener("click",d.current)}},[r,s]),{onPointerDownCapture:()=>o.current=!0}}function Tne(e,r=globalThis?.document){const s=tl(e),o=R.useRef(!1);return R.useEffect(()=>{const d=p=>{p.target&&!o.current&&NL(Ane,s,{originalEvent:p},{discrete:!1})};return r.addEventListener("focusin",d),()=>r.removeEventListener("focusin",d)},[r,s]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function eI(){const e=new CustomEvent(PT);document.dispatchEvent(e)}function NL(e,r,s,{discrete:o}){const d=s.originalEvent.target,p=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:s});r&&d.addEventListener(e,r,{once:!0}),o?_L(d,p):d.dispatchEvent(p)}var As=globalThis?.document?R.useLayoutEffect:()=>{},_ne=T_[" useId ".trim().toString()]||(()=>{}),$ne=0;function Vs(e){const[r,s]=R.useState(_ne());return As(()=>{s(o=>o??String($ne++))},[e]),r?`radix-${r}`:""}const Nne=["top","right","bottom","left"],zd=Math.min,_a=Math.max,Nj=Math.round,HE=Math.floor,sc=e=>({x:e,y:e}),Dne={left:"right",right:"left",bottom:"top",top:"bottom"},Pne={start:"end",end:"start"};function MT(e,r,s){return _a(e,zd(r,s))}function fu(e,r){return typeof e=="function"?e(r):e}function mu(e){return e.split("-")[0]}function Rg(e){return e.split("-")[1]}function H_(e){return e==="x"?"y":"x"}function G_(e){return e==="y"?"height":"width"}const Mne=new Set(["top","bottom"]);function rc(e){return Mne.has(mu(e))?"y":"x"}function X_(e){return H_(rc(e))}function Ine(e,r,s){s===void 0&&(s=!1);const o=Rg(e),d=X_(e),p=G_(d);let m=d==="x"?o===(s?"end":"start")?"right":"left":o==="start"?"bottom":"top";return r.reference[p]>r.floating[p]&&(m=Dj(m)),[m,Dj(m)]}function Lne(e){const r=Dj(e);return[IT(e),r,IT(r)]}function IT(e){return e.replace(/start|end/g,r=>Pne[r])}const tI=["left","right"],nI=["right","left"],zne=["top","bottom"],Fne=["bottom","top"];function qne(e,r,s){switch(e){case"top":case"bottom":return s?r?nI:tI:r?tI:nI;case"left":case"right":return r?zne:Fne;default:return[]}}function Bne(e,r,s,o){const d=Rg(e);let p=qne(mu(e),s==="start",o);return d&&(p=p.map(m=>m+"-"+d),r&&(p=p.concat(p.map(IT)))),p}function Dj(e){return e.replace(/left|right|bottom|top/g,r=>Dne[r])}function Une(e){return{top:0,right:0,bottom:0,left:0,...e}}function DL(e){return typeof e!="number"?Une(e):{top:e,right:e,bottom:e,left:e}}function Pj(e){const{x:r,y:s,width:o,height:d}=e;return{width:o,height:d,top:s,left:r,right:r+o,bottom:s+d,x:r,y:s}}function rI(e,r,s){let{reference:o,floating:d}=e;const p=rc(r),m=X_(r),g=G_(m),b=mu(r),S=p==="y",j=o.x+o.width/2-d.width/2,A=o.y+o.height/2-d.height/2,k=o[g]/2-d[g]/2;let T;switch(b){case"top":T={x:j,y:o.y-d.height};break;case"bottom":T={x:j,y:o.y+o.height};break;case"right":T={x:o.x+o.width,y:A};break;case"left":T={x:o.x-d.width,y:A};break;default:T={x:o.x,y:o.y}}switch(Rg(r)){case"start":T[m]-=k*(s&&S?-1:1);break;case"end":T[m]+=k*(s&&S?-1:1);break}return T}const Kne=async(e,r,s)=>{const{placement:o="bottom",strategy:d="absolute",middleware:p=[],platform:m}=s,g=p.filter(Boolean),b=await(m.isRTL==null?void 0:m.isRTL(r));let S=await m.getElementRects({reference:e,floating:r,strategy:d}),{x:j,y:A}=rI(S,o,b),k=o,T={},M=0;for(let I=0;I({name:"arrow",options:e,async fn(r){const{x:s,y:o,placement:d,rects:p,platform:m,elements:g,middlewareData:b}=r,{element:S,padding:j=0}=fu(e,r)||{};if(S==null)return{};const A=DL(j),k={x:s,y:o},T=X_(d),M=G_(T),I=await m.getDimensions(S),q=T==="y",G=q?"top":"left",K=q?"bottom":"right",X=q?"clientHeight":"clientWidth",L=p.reference[M]+p.reference[T]-k[T]-p.floating[M],ee=k[T]-p.reference[T],oe=await(m.getOffsetParent==null?void 0:m.getOffsetParent(S));let Q=oe?oe[X]:0;(!Q||!await(m.isElement==null?void 0:m.isElement(oe)))&&(Q=g.floating[X]||p.floating[M]);const ne=L/2-ee/2,de=Q/2-I[M]/2-1,je=zd(A[G],de),ve=zd(A[K],de),le=je,be=Q-I[M]-ve,Ce=Q/2-I[M]/2+ne,Ke=MT(le,Ce,be),ce=!b.arrow&&Rg(d)!=null&&Ce!==Ke&&p.reference[M]/2-(CeCe<=0)){var ve,le;const Ce=(((ve=p.flip)==null?void 0:ve.index)||0)+1,Ke=Q[Ce];if(Ke&&(!(A==="alignment"?K!==rc(Ke):!1)||je.every(ue=>rc(ue.placement)===K?ue.overflows[0]>0:!0)))return{data:{index:Ce,overflows:je},reset:{placement:Ke}};let ce=(le=je.filter(re=>re.overflows[0]<=0).sort((re,ue)=>re.overflows[1]-ue.overflows[1])[0])==null?void 0:le.placement;if(!ce)switch(T){case"bestFit":{var be;const re=(be=je.filter(ue=>{if(oe){const _e=rc(ue.placement);return _e===K||_e==="y"}return!0}).map(ue=>[ue.placement,ue.overflows.filter(_e=>_e>0).reduce((_e,fe)=>_e+fe,0)]).sort((ue,_e)=>ue[1]-_e[1])[0])==null?void 0:be[0];re&&(ce=re);break}case"initialPlacement":ce=g;break}if(d!==ce)return{reset:{placement:ce}}}return{}}}};function sI(e,r){return{top:e.top-r.height,right:e.right-r.width,bottom:e.bottom-r.height,left:e.left-r.width}}function iI(e){return Nne.some(r=>e[r]>=0)}const Gne=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(r){const{rects:s}=r,{strategy:o="referenceHidden",...d}=fu(e,r);switch(o){case"referenceHidden":{const p=await Lb(r,{...d,elementContext:"reference"}),m=sI(p,s.reference);return{data:{referenceHiddenOffsets:m,referenceHidden:iI(m)}}}case"escaped":{const p=await Lb(r,{...d,altBoundary:!0}),m=sI(p,s.floating);return{data:{escapedOffsets:m,escaped:iI(m)}}}default:return{}}}}},PL=new Set(["left","top"]);async function Xne(e,r){const{placement:s,platform:o,elements:d}=e,p=await(o.isRTL==null?void 0:o.isRTL(d.floating)),m=mu(s),g=Rg(s),b=rc(s)==="y",S=PL.has(m)?-1:1,j=p&&b?-1:1,A=fu(r,e);let{mainAxis:k,crossAxis:T,alignmentAxis:M}=typeof A=="number"?{mainAxis:A,crossAxis:0,alignmentAxis:null}:{mainAxis:A.mainAxis||0,crossAxis:A.crossAxis||0,alignmentAxis:A.alignmentAxis};return g&&typeof M=="number"&&(T=g==="end"?M*-1:M),b?{x:T*j,y:k*S}:{x:k*S,y:T*j}}const Yne=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(r){var s,o;const{x:d,y:p,placement:m,middlewareData:g}=r,b=await Xne(r,e);return m===((s=g.offset)==null?void 0:s.placement)&&(o=g.arrow)!=null&&o.alignmentOffset?{}:{x:d+b.x,y:p+b.y,data:{...b,placement:m}}}}},Zne=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(r){const{x:s,y:o,placement:d}=r,{mainAxis:p=!0,crossAxis:m=!1,limiter:g={fn:q=>{let{x:G,y:K}=q;return{x:G,y:K}}},...b}=fu(e,r),S={x:s,y:o},j=await Lb(r,b),A=rc(mu(d)),k=H_(A);let T=S[k],M=S[A];if(p){const q=k==="y"?"top":"left",G=k==="y"?"bottom":"right",K=T+j[q],X=T-j[G];T=MT(K,T,X)}if(m){const q=A==="y"?"top":"left",G=A==="y"?"bottom":"right",K=M+j[q],X=M-j[G];M=MT(K,M,X)}const I=g.fn({...r,[k]:T,[A]:M});return{...I,data:{x:I.x-s,y:I.y-o,enabled:{[k]:p,[A]:m}}}}}},Wne=function(e){return e===void 0&&(e={}),{options:e,fn(r){const{x:s,y:o,placement:d,rects:p,middlewareData:m}=r,{offset:g=0,mainAxis:b=!0,crossAxis:S=!0}=fu(e,r),j={x:s,y:o},A=rc(d),k=H_(A);let T=j[k],M=j[A];const I=fu(g,r),q=typeof I=="number"?{mainAxis:I,crossAxis:0}:{mainAxis:0,crossAxis:0,...I};if(b){const X=k==="y"?"height":"width",L=p.reference[k]-p.floating[X]+q.mainAxis,ee=p.reference[k]+p.reference[X]-q.mainAxis;Tee&&(T=ee)}if(S){var G,K;const X=k==="y"?"width":"height",L=PL.has(mu(d)),ee=p.reference[A]-p.floating[X]+(L&&((G=m.offset)==null?void 0:G[A])||0)+(L?0:q.crossAxis),oe=p.reference[A]+p.reference[X]+(L?0:((K=m.offset)==null?void 0:K[A])||0)-(L?q.crossAxis:0);Moe&&(M=oe)}return{[k]:T,[A]:M}}}},Jne=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(r){var s,o;const{placement:d,rects:p,platform:m,elements:g}=r,{apply:b=()=>{},...S}=fu(e,r),j=await Lb(r,S),A=mu(d),k=Rg(d),T=rc(d)==="y",{width:M,height:I}=p.floating;let q,G;A==="top"||A==="bottom"?(q=A,G=k===(await(m.isRTL==null?void 0:m.isRTL(g.floating))?"start":"end")?"left":"right"):(G=A,q=k==="end"?"top":"bottom");const K=I-j.top-j.bottom,X=M-j.left-j.right,L=zd(I-j[q],K),ee=zd(M-j[G],X),oe=!r.middlewareData.shift;let Q=L,ne=ee;if((s=r.middlewareData.shift)!=null&&s.enabled.x&&(ne=X),(o=r.middlewareData.shift)!=null&&o.enabled.y&&(Q=K),oe&&!k){const je=_a(j.left,0),ve=_a(j.right,0),le=_a(j.top,0),be=_a(j.bottom,0);T?ne=M-2*(je!==0||ve!==0?je+ve:_a(j.left,j.right)):Q=I-2*(le!==0||be!==0?le+be:_a(j.top,j.bottom))}await b({...r,availableWidth:ne,availableHeight:Q});const de=await m.getDimensions(g.floating);return M!==de.width||I!==de.height?{reset:{rects:!0}}:{}}}};function vC(){return typeof window<"u"}function Tg(e){return ML(e)?(e.nodeName||"").toLowerCase():"#document"}function Na(e){var r;return(e==null||(r=e.ownerDocument)==null?void 0:r.defaultView)||window}function lc(e){var r;return(r=(ML(e)?e.ownerDocument:e.document)||window.document)==null?void 0:r.documentElement}function ML(e){return vC()?e instanceof Node||e instanceof Na(e).Node:!1}function nl(e){return vC()?e instanceof Element||e instanceof Na(e).Element:!1}function oc(e){return vC()?e instanceof HTMLElement||e instanceof Na(e).HTMLElement:!1}function aI(e){return!vC()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Na(e).ShadowRoot}const Qne=new Set(["inline","contents"]);function tw(e){const{overflow:r,overflowX:s,overflowY:o,display:d}=rl(e);return/auto|scroll|overlay|hidden|clip/.test(r+o+s)&&!Qne.has(d)}const ere=new Set(["table","td","th"]);function tre(e){return ere.has(Tg(e))}const nre=[":popover-open",":modal"];function xC(e){return nre.some(r=>{try{return e.matches(r)}catch{return!1}})}const rre=["transform","translate","scale","rotate","perspective"],sre=["transform","translate","scale","rotate","perspective","filter"],ire=["paint","layout","strict","content"];function Y_(e){const r=Z_(),s=nl(e)?rl(e):e;return rre.some(o=>s[o]?s[o]!=="none":!1)||(s.containerType?s.containerType!=="normal":!1)||!r&&(s.backdropFilter?s.backdropFilter!=="none":!1)||!r&&(s.filter?s.filter!=="none":!1)||sre.some(o=>(s.willChange||"").includes(o))||ire.some(o=>(s.contain||"").includes(o))}function are(e){let r=Fd(e);for(;oc(r)&&!vg(r);){if(Y_(r))return r;if(xC(r))return null;r=Fd(r)}return null}function Z_(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const ore=new Set(["html","body","#document"]);function vg(e){return ore.has(Tg(e))}function rl(e){return Na(e).getComputedStyle(e)}function bC(e){return nl(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Fd(e){if(Tg(e)==="html")return e;const r=e.assignedSlot||e.parentNode||aI(e)&&e.host||lc(e);return aI(r)?r.host:r}function IL(e){const r=Fd(e);return vg(r)?e.ownerDocument?e.ownerDocument.body:e.body:oc(r)&&tw(r)?r:IL(r)}function zb(e,r,s){var o;r===void 0&&(r=[]),s===void 0&&(s=!0);const d=IL(e),p=d===((o=e.ownerDocument)==null?void 0:o.body),m=Na(d);if(p){const g=LT(m);return r.concat(m,m.visualViewport||[],tw(d)?d:[],g&&s?zb(g):[])}return r.concat(d,zb(d,[],s))}function LT(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function LL(e){const r=rl(e);let s=parseFloat(r.width)||0,o=parseFloat(r.height)||0;const d=oc(e),p=d?e.offsetWidth:s,m=d?e.offsetHeight:o,g=Nj(s)!==p||Nj(o)!==m;return g&&(s=p,o=m),{width:s,height:o,$:g}}function W_(e){return nl(e)?e:e.contextElement}function pg(e){const r=W_(e);if(!oc(r))return sc(1);const s=r.getBoundingClientRect(),{width:o,height:d,$:p}=LL(r);let m=(p?Nj(s.width):s.width)/o,g=(p?Nj(s.height):s.height)/d;return(!m||!Number.isFinite(m))&&(m=1),(!g||!Number.isFinite(g))&&(g=1),{x:m,y:g}}const lre=sc(0);function zL(e){const r=Na(e);return!Z_()||!r.visualViewport?lre:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function cre(e,r,s){return r===void 0&&(r=!1),!s||r&&s!==Na(e)?!1:r}function Op(e,r,s,o){r===void 0&&(r=!1),s===void 0&&(s=!1);const d=e.getBoundingClientRect(),p=W_(e);let m=sc(1);r&&(o?nl(o)&&(m=pg(o)):m=pg(e));const g=cre(p,s,o)?zL(p):sc(0);let b=(d.left+g.x)/m.x,S=(d.top+g.y)/m.y,j=d.width/m.x,A=d.height/m.y;if(p){const k=Na(p),T=o&&nl(o)?Na(o):o;let M=k,I=LT(M);for(;I&&o&&T!==M;){const q=pg(I),G=I.getBoundingClientRect(),K=rl(I),X=G.left+(I.clientLeft+parseFloat(K.paddingLeft))*q.x,L=G.top+(I.clientTop+parseFloat(K.paddingTop))*q.y;b*=q.x,S*=q.y,j*=q.x,A*=q.y,b+=X,S+=L,M=Na(I),I=LT(M)}}return Pj({width:j,height:A,x:b,y:S})}function wC(e,r){const s=bC(e).scrollLeft;return r?r.left+s:Op(lc(e)).left+s}function FL(e,r){const s=e.getBoundingClientRect(),o=s.left+r.scrollLeft-wC(e,s),d=s.top+r.scrollTop;return{x:o,y:d}}function ure(e){let{elements:r,rect:s,offsetParent:o,strategy:d}=e;const p=d==="fixed",m=lc(o),g=r?xC(r.floating):!1;if(o===m||g&&p)return s;let b={scrollLeft:0,scrollTop:0},S=sc(1);const j=sc(0),A=oc(o);if((A||!A&&!p)&&((Tg(o)!=="body"||tw(m))&&(b=bC(o)),oc(o))){const T=Op(o);S=pg(o),j.x=T.x+o.clientLeft,j.y=T.y+o.clientTop}const k=m&&!A&&!p?FL(m,b):sc(0);return{width:s.width*S.x,height:s.height*S.y,x:s.x*S.x-b.scrollLeft*S.x+j.x+k.x,y:s.y*S.y-b.scrollTop*S.y+j.y+k.y}}function dre(e){return Array.from(e.getClientRects())}function hre(e){const r=lc(e),s=bC(e),o=e.ownerDocument.body,d=_a(r.scrollWidth,r.clientWidth,o.scrollWidth,o.clientWidth),p=_a(r.scrollHeight,r.clientHeight,o.scrollHeight,o.clientHeight);let m=-s.scrollLeft+wC(e);const g=-s.scrollTop;return rl(o).direction==="rtl"&&(m+=_a(r.clientWidth,o.clientWidth)-d),{width:d,height:p,x:m,y:g}}const oI=25;function pre(e,r){const s=Na(e),o=lc(e),d=s.visualViewport;let p=o.clientWidth,m=o.clientHeight,g=0,b=0;if(d){p=d.width,m=d.height;const j=Z_();(!j||j&&r==="fixed")&&(g=d.offsetLeft,b=d.offsetTop)}const S=wC(o);if(S<=0){const j=o.ownerDocument,A=j.body,k=getComputedStyle(A),T=j.compatMode==="CSS1Compat"&&parseFloat(k.marginLeft)+parseFloat(k.marginRight)||0,M=Math.abs(o.clientWidth-A.clientWidth-T);M<=oI&&(p-=M)}else S<=oI&&(p+=S);return{width:p,height:m,x:g,y:b}}const fre=new Set(["absolute","fixed"]);function mre(e,r){const s=Op(e,!0,r==="fixed"),o=s.top+e.clientTop,d=s.left+e.clientLeft,p=oc(e)?pg(e):sc(1),m=e.clientWidth*p.x,g=e.clientHeight*p.y,b=d*p.x,S=o*p.y;return{width:m,height:g,x:b,y:S}}function lI(e,r,s){let o;if(r==="viewport")o=pre(e,s);else if(r==="document")o=hre(lc(e));else if(nl(r))o=mre(r,s);else{const d=zL(e);o={x:r.x-d.x,y:r.y-d.y,width:r.width,height:r.height}}return Pj(o)}function qL(e,r){const s=Fd(e);return s===r||!nl(s)||vg(s)?!1:rl(s).position==="fixed"||qL(s,r)}function gre(e,r){const s=r.get(e);if(s)return s;let o=zb(e,[],!1).filter(g=>nl(g)&&Tg(g)!=="body"),d=null;const p=rl(e).position==="fixed";let m=p?Fd(e):e;for(;nl(m)&&!vg(m);){const g=rl(m),b=Y_(m);!b&&g.position==="fixed"&&(d=null),(p?!b&&!d:!b&&g.position==="static"&&!!d&&fre.has(d.position)||tw(m)&&!b&&qL(e,m))?o=o.filter(j=>j!==m):d=g,m=Fd(m)}return r.set(e,o),o}function yre(e){let{element:r,boundary:s,rootBoundary:o,strategy:d}=e;const m=[...s==="clippingAncestors"?xC(r)?[]:gre(r,this._c):[].concat(s),o],g=m[0],b=m.reduce((S,j)=>{const A=lI(r,j,d);return S.top=_a(A.top,S.top),S.right=zd(A.right,S.right),S.bottom=zd(A.bottom,S.bottom),S.left=_a(A.left,S.left),S},lI(r,g,d));return{width:b.right-b.left,height:b.bottom-b.top,x:b.left,y:b.top}}function vre(e){const{width:r,height:s}=LL(e);return{width:r,height:s}}function xre(e,r,s){const o=oc(r),d=lc(r),p=s==="fixed",m=Op(e,!0,p,r);let g={scrollLeft:0,scrollTop:0};const b=sc(0);function S(){b.x=wC(d)}if(o||!o&&!p)if((Tg(r)!=="body"||tw(d))&&(g=bC(r)),o){const T=Op(r,!0,p,r);b.x=T.x+r.clientLeft,b.y=T.y+r.clientTop}else d&&S();p&&!o&&d&&S();const j=d&&!o&&!p?FL(d,g):sc(0),A=m.left+g.scrollLeft-b.x-j.x,k=m.top+g.scrollTop-b.y-j.y;return{x:A,y:k,width:m.width,height:m.height}}function MR(e){return rl(e).position==="static"}function cI(e,r){if(!oc(e)||rl(e).position==="fixed")return null;if(r)return r(e);let s=e.offsetParent;return lc(e)===s&&(s=s.ownerDocument.body),s}function BL(e,r){const s=Na(e);if(xC(e))return s;if(!oc(e)){let d=Fd(e);for(;d&&!vg(d);){if(nl(d)&&!MR(d))return d;d=Fd(d)}return s}let o=cI(e,r);for(;o&&tre(o)&&MR(o);)o=cI(o,r);return o&&vg(o)&&MR(o)&&!Y_(o)?s:o||are(e)||s}const bre=async function(e){const r=this.getOffsetParent||BL,s=this.getDimensions,o=await s(e.floating);return{reference:xre(e.reference,await r(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function wre(e){return rl(e).direction==="rtl"}const Sre={convertOffsetParentRelativeRectToViewportRelativeRect:ure,getDocumentElement:lc,getClippingRect:yre,getOffsetParent:BL,getElementRects:bre,getClientRects:dre,getDimensions:vre,getScale:pg,isElement:nl,isRTL:wre};function UL(e,r){return e.x===r.x&&e.y===r.y&&e.width===r.width&&e.height===r.height}function Ere(e,r){let s=null,o;const d=lc(e);function p(){var g;clearTimeout(o),(g=s)==null||g.disconnect(),s=null}function m(g,b){g===void 0&&(g=!1),b===void 0&&(b=1),p();const S=e.getBoundingClientRect(),{left:j,top:A,width:k,height:T}=S;if(g||r(),!k||!T)return;const M=HE(A),I=HE(d.clientWidth-(j+k)),q=HE(d.clientHeight-(A+T)),G=HE(j),X={rootMargin:-M+"px "+-I+"px "+-q+"px "+-G+"px",threshold:_a(0,zd(1,b))||1};let L=!0;function ee(oe){const Q=oe[0].intersectionRatio;if(Q!==b){if(!L)return m();Q?m(!1,Q):o=setTimeout(()=>{m(!1,1e-7)},1e3)}Q===1&&!UL(S,e.getBoundingClientRect())&&m(),L=!1}try{s=new IntersectionObserver(ee,{...X,root:d.ownerDocument})}catch{s=new IntersectionObserver(ee,X)}s.observe(e)}return m(!0),p}function jre(e,r,s,o){o===void 0&&(o={});const{ancestorScroll:d=!0,ancestorResize:p=!0,elementResize:m=typeof ResizeObserver=="function",layoutShift:g=typeof IntersectionObserver=="function",animationFrame:b=!1}=o,S=W_(e),j=d||p?[...S?zb(S):[],...zb(r)]:[];j.forEach(G=>{d&&G.addEventListener("scroll",s,{passive:!0}),p&&G.addEventListener("resize",s)});const A=S&&g?Ere(S,s):null;let k=-1,T=null;m&&(T=new ResizeObserver(G=>{let[K]=G;K&&K.target===S&&T&&(T.unobserve(r),cancelAnimationFrame(k),k=requestAnimationFrame(()=>{var X;(X=T)==null||X.observe(r)})),s()}),S&&!b&&T.observe(S),T.observe(r));let M,I=b?Op(e):null;b&&q();function q(){const G=Op(e);I&&!UL(I,G)&&s(),I=G,M=requestAnimationFrame(q)}return s(),()=>{var G;j.forEach(K=>{d&&K.removeEventListener("scroll",s),p&&K.removeEventListener("resize",s)}),A?.(),(G=T)==null||G.disconnect(),T=null,b&&cancelAnimationFrame(M)}}const Cre=Yne,Are=Zne,Ore=Hne,kre=Jne,Rre=Gne,uI=Vne,Tre=Wne,_re=(e,r,s)=>{const o=new Map,d={platform:Sre,...s},p={...d.platform,_c:o};return Kne(e,r,{...d,platform:p})};var $re=typeof document<"u",Nre=function(){},gj=$re?R.useLayoutEffect:Nre;function Mj(e,r){if(e===r)return!0;if(typeof e!=typeof r)return!1;if(typeof e=="function"&&e.toString()===r.toString())return!0;let s,o,d;if(e&&r&&typeof e=="object"){if(Array.isArray(e)){if(s=e.length,s!==r.length)return!1;for(o=s;o--!==0;)if(!Mj(e[o],r[o]))return!1;return!0}if(d=Object.keys(e),s=d.length,s!==Object.keys(r).length)return!1;for(o=s;o--!==0;)if(!{}.hasOwnProperty.call(r,d[o]))return!1;for(o=s;o--!==0;){const p=d[o];if(!(p==="_owner"&&e.$$typeof)&&!Mj(e[p],r[p]))return!1}return!0}return e!==e&&r!==r}function KL(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function dI(e,r){const s=KL(e);return Math.round(r*s)/s}function IR(e){const r=R.useRef(e);return gj(()=>{r.current=e}),r}function Dre(e){e===void 0&&(e={});const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:d,elements:{reference:p,floating:m}={},transform:g=!0,whileElementsMounted:b,open:S}=e,[j,A]=R.useState({x:0,y:0,strategy:s,placement:r,middlewareData:{},isPositioned:!1}),[k,T]=R.useState(o);Mj(k,o)||T(o);const[M,I]=R.useState(null),[q,G]=R.useState(null),K=R.useCallback(ue=>{ue!==oe.current&&(oe.current=ue,I(ue))},[]),X=R.useCallback(ue=>{ue!==Q.current&&(Q.current=ue,G(ue))},[]),L=p||M,ee=m||q,oe=R.useRef(null),Q=R.useRef(null),ne=R.useRef(j),de=b!=null,je=IR(b),ve=IR(d),le=IR(S),be=R.useCallback(()=>{if(!oe.current||!Q.current)return;const ue={placement:r,strategy:s,middleware:k};ve.current&&(ue.platform=ve.current),_re(oe.current,Q.current,ue).then(_e=>{const fe={..._e,isPositioned:le.current!==!1};Ce.current&&!Mj(ne.current,fe)&&(ne.current=fe,mC.flushSync(()=>{A(fe)}))})},[k,r,s,ve,le]);gj(()=>{S===!1&&ne.current.isPositioned&&(ne.current.isPositioned=!1,A(ue=>({...ue,isPositioned:!1})))},[S]);const Ce=R.useRef(!1);gj(()=>(Ce.current=!0,()=>{Ce.current=!1}),[]),gj(()=>{if(L&&(oe.current=L),ee&&(Q.current=ee),L&&ee){if(je.current)return je.current(L,ee,be);be()}},[L,ee,be,je,de]);const Ke=R.useMemo(()=>({reference:oe,floating:Q,setReference:K,setFloating:X}),[K,X]),ce=R.useMemo(()=>({reference:L,floating:ee}),[L,ee]),re=R.useMemo(()=>{const ue={position:s,left:0,top:0};if(!ce.floating)return ue;const _e=dI(ce.floating,j.x),fe=dI(ce.floating,j.y);return g?{...ue,transform:"translate("+_e+"px, "+fe+"px)",...KL(ce.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:_e,top:fe}},[s,g,ce.floating,j.x,j.y]);return R.useMemo(()=>({...j,update:be,refs:Ke,elements:ce,floatingStyles:re}),[j,be,Ke,ce,re])}const Pre=e=>{function r(s){return{}.hasOwnProperty.call(s,"current")}return{name:"arrow",options:e,fn(s){const{element:o,padding:d}=typeof e=="function"?e(s):e;return o&&r(o)?o.current!=null?uI({element:o.current,padding:d}).fn(s):{}:o?uI({element:o,padding:d}).fn(s):{}}}},Mre=(e,r)=>({...Cre(e),options:[e,r]}),Ire=(e,r)=>({...Are(e),options:[e,r]}),Lre=(e,r)=>({...Tre(e),options:[e,r]}),zre=(e,r)=>({...Ore(e),options:[e,r]}),Fre=(e,r)=>({...kre(e),options:[e,r]}),qre=(e,r)=>({...Rre(e),options:[e,r]}),Bre=(e,r)=>({...Pre(e),options:[e,r]});var Ure="Arrow",VL=R.forwardRef((e,r)=>{const{children:s,width:o=10,height:d=5,...p}=e;return u.jsx(Cn.svg,{...p,ref:r,width:o,height:d,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?s:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});VL.displayName=Ure;var Kre=VL;function HL(e){const[r,s]=R.useState(void 0);return As(()=>{if(e){s({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(d=>{if(!Array.isArray(d)||!d.length)return;const p=d[0];let m,g;if("borderBoxSize"in p){const b=p.borderBoxSize,S=Array.isArray(b)?b[0]:b;m=S.inlineSize,g=S.blockSize}else m=e.offsetWidth,g=e.offsetHeight;s({width:m,height:g})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else s(void 0)},[e]),r}var J_="Popper",[GL,Hd]=al(J_),[Vre,XL]=GL(J_),YL=e=>{const{__scopePopper:r,children:s}=e,[o,d]=R.useState(null);return u.jsx(Vre,{scope:r,anchor:o,onAnchorChange:d,children:s})};YL.displayName=J_;var ZL="PopperAnchor",WL=R.forwardRef((e,r)=>{const{__scopePopper:s,virtualRef:o,...d}=e,p=XL(ZL,s),m=R.useRef(null),g=zn(r,m),b=R.useRef(null);return R.useEffect(()=>{const S=b.current;b.current=o?.current||m.current,S!==b.current&&p.onAnchorChange(b.current)}),o?null:u.jsx(Cn.div,{...d,ref:g})});WL.displayName=ZL;var Q_="PopperContent",[Hre,Gre]=GL(Q_),JL=R.forwardRef((e,r)=>{const{__scopePopper:s,side:o="bottom",sideOffset:d=0,align:p="center",alignOffset:m=0,arrowPadding:g=0,avoidCollisions:b=!0,collisionBoundary:S=[],collisionPadding:j=0,sticky:A="partial",hideWhenDetached:k=!1,updatePositionStrategy:T="optimized",onPlaced:M,...I}=e,q=XL(Q_,s),[G,K]=R.useState(null),X=zn(r,Le=>K(Le)),[L,ee]=R.useState(null),oe=HL(L),Q=oe?.width??0,ne=oe?.height??0,de=o+(p!=="center"?"-"+p:""),je=typeof j=="number"?j:{top:0,right:0,bottom:0,left:0,...j},ve=Array.isArray(S)?S:[S],le=ve.length>0,be={padding:je,boundary:ve.filter(Yre),altBoundary:le},{refs:Ce,floatingStyles:Ke,placement:ce,isPositioned:re,middlewareData:ue}=Dre({strategy:"fixed",placement:de,whileElementsMounted:(...Le)=>jre(...Le,{animationFrame:T==="always"}),elements:{reference:q.anchor},middleware:[Mre({mainAxis:d+ne,alignmentAxis:m}),b&&Ire({mainAxis:!0,crossAxis:!1,limiter:A==="partial"?Lre():void 0,...be}),b&&zre({...be}),Fre({...be,apply:({elements:Le,rects:tt,availableWidth:ft,availableHeight:Ot})=>{const{width:Ft,height:kt}=tt.reference,Jt=Le.floating.style;Jt.setProperty("--radix-popper-available-width",`${ft}px`),Jt.setProperty("--radix-popper-available-height",`${Ot}px`),Jt.setProperty("--radix-popper-anchor-width",`${Ft}px`),Jt.setProperty("--radix-popper-anchor-height",`${kt}px`)}}),L&&Bre({element:L,padding:g}),Zre({arrowWidth:Q,arrowHeight:ne}),k&&qre({strategy:"referenceHidden",...be})]}),[_e,fe]=tz(ce),He=tl(M);As(()=>{re&&He?.()},[re,He]);const Oe=ue.arrow?.x,ke=ue.arrow?.y,Ve=ue.arrow?.centerOffset!==0,[ie,De]=R.useState();return As(()=>{G&&De(window.getComputedStyle(G).zIndex)},[G]),u.jsx("div",{ref:Ce.setFloating,"data-radix-popper-content-wrapper":"",style:{...Ke,transform:re?Ke.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ie,"--radix-popper-transform-origin":[ue.transformOrigin?.x,ue.transformOrigin?.y].join(" "),...ue.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(Hre,{scope:s,placedSide:_e,onArrowChange:ee,arrowX:Oe,arrowY:ke,shouldHideArrow:Ve,children:u.jsx(Cn.div,{"data-side":_e,"data-align":fe,...I,ref:X,style:{...I.style,animation:re?void 0:"none"}})})})});JL.displayName=Q_;var QL="PopperArrow",Xre={top:"bottom",right:"left",bottom:"top",left:"right"},ez=R.forwardRef(function(r,s){const{__scopePopper:o,...d}=r,p=Gre(QL,o),m=Xre[p.placedSide];return u.jsx("span",{ref:p.onArrowChange,style:{position:"absolute",left:p.arrowX,top:p.arrowY,[m]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[p.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[p.placedSide],visibility:p.shouldHideArrow?"hidden":void 0},children:u.jsx(Kre,{...d,ref:s,style:{...d.style,display:"block"}})})});ez.displayName=QL;function Yre(e){return e!==null}var Zre=e=>({name:"transformOrigin",options:e,fn(r){const{placement:s,rects:o,middlewareData:d}=r,m=d.arrow?.centerOffset!==0,g=m?0:e.arrowWidth,b=m?0:e.arrowHeight,[S,j]=tz(s),A={start:"0%",center:"50%",end:"100%"}[j],k=(d.arrow?.x??0)+g/2,T=(d.arrow?.y??0)+b/2;let M="",I="";return S==="bottom"?(M=m?A:`${k}px`,I=`${-b}px`):S==="top"?(M=m?A:`${k}px`,I=`${o.floating.height+b}px`):S==="right"?(M=`${-b}px`,I=m?A:`${T}px`):S==="left"&&(M=`${o.floating.width+b}px`,I=m?A:`${T}px`),{data:{x:M,y:I}}}});function tz(e){const[r,s="center"]=e.split("-");return[r,s]}var SC=YL,nw=WL,EC=JL,jC=ez,Wre="Portal",_g=R.forwardRef((e,r)=>{const{container:s,...o}=e,[d,p]=R.useState(!1);As(()=>p(!0),[]);const m=s||d&&globalThis?.document?.body;return m?U3.createPortal(u.jsx(Cn.div,{...o,ref:r}),m):null});_g.displayName=Wre;function Jre(e,r){return R.useReducer((s,o)=>r[s][o]??s,e)}var lo=e=>{const{present:r,children:s}=e,o=Qre(r),d=typeof s=="function"?s({present:o.isPresent}):R.Children.only(s),p=zn(o.ref,ese(d));return typeof s=="function"||o.isPresent?R.cloneElement(d,{ref:p}):null};lo.displayName="Presence";function Qre(e){const[r,s]=R.useState(),o=R.useRef(null),d=R.useRef(e),p=R.useRef("none"),m=e?"mounted":"unmounted",[g,b]=Jre(m,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return R.useEffect(()=>{const S=GE(o.current);p.current=g==="mounted"?S:"none"},[g]),As(()=>{const S=o.current,j=d.current;if(j!==e){const k=p.current,T=GE(S);e?b("MOUNT"):T==="none"||S?.display==="none"?b("UNMOUNT"):b(j&&k!==T?"ANIMATION_OUT":"UNMOUNT"),d.current=e}},[e,b]),As(()=>{if(r){let S;const j=r.ownerDocument.defaultView??window,A=T=>{const I=GE(o.current).includes(CSS.escape(T.animationName));if(T.target===r&&I&&(b("ANIMATION_END"),!d.current)){const q=r.style.animationFillMode;r.style.animationFillMode="forwards",S=j.setTimeout(()=>{r.style.animationFillMode==="forwards"&&(r.style.animationFillMode=q)})}},k=T=>{T.target===r&&(p.current=GE(o.current))};return r.addEventListener("animationstart",k),r.addEventListener("animationcancel",A),r.addEventListener("animationend",A),()=>{j.clearTimeout(S),r.removeEventListener("animationstart",k),r.removeEventListener("animationcancel",A),r.removeEventListener("animationend",A)}}else b("ANIMATION_END")},[r,b]),{isPresent:["mounted","unmountSuspended"].includes(g),ref:R.useCallback(S=>{o.current=S?getComputedStyle(S):null,s(S)},[])}}function GE(e){return e?.animationName||"none"}function ese(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning;return s?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var tse=Symbol("radix.slottable");function nse(e){const r=({children:s})=>u.jsx(u.Fragment,{children:s});return r.displayName=`${e}.Slottable`,r.__radixId=tse,r}var rse=T_[" useInsertionEffect ".trim().toString()]||As;function qd({prop:e,defaultProp:r,onChange:s=()=>{},caller:o}){const[d,p,m]=sse({defaultProp:r,onChange:s}),g=e!==void 0,b=g?e:d;{const j=R.useRef(e!==void 0);R.useEffect(()=>{const A=j.current;A!==g&&console.warn(`${o} is changing from ${A?"controlled":"uncontrolled"} to ${g?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),j.current=g},[g,o])}const S=R.useCallback(j=>{if(g){const A=ise(j)?j(e):j;A!==e&&m.current?.(A)}else p(j)},[g,e,p,m]);return[b,S]}function sse({defaultProp:e,onChange:r}){const[s,o]=R.useState(e),d=R.useRef(s),p=R.useRef(r);return rse(()=>{p.current=r},[r]),R.useEffect(()=>{d.current!==s&&(p.current?.(s),d.current=s)},[s,d]),[s,o,p]}function ise(e){return typeof e=="function"}var nz=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),ase="VisuallyHidden",rz=R.forwardRef((e,r)=>u.jsx(Cn.span,{...e,ref:r,style:{...nz,...e.style}}));rz.displayName=ase;var ose=rz,[CC]=al("Tooltip",[Hd]),AC=Hd(),sz="TooltipProvider",lse=700,zT="tooltip.open",[cse,e2]=CC(sz),iz=e=>{const{__scopeTooltip:r,delayDuration:s=lse,skipDelayDuration:o=300,disableHoverableContent:d=!1,children:p}=e,m=R.useRef(!0),g=R.useRef(!1),b=R.useRef(0);return R.useEffect(()=>{const S=b.current;return()=>window.clearTimeout(S)},[]),u.jsx(cse,{scope:r,isOpenDelayedRef:m,delayDuration:s,onOpen:R.useCallback(()=>{window.clearTimeout(b.current),m.current=!1},[]),onClose:R.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>m.current=!0,o)},[o]),isPointerInTransitRef:g,onPointerInTransitChange:R.useCallback(S=>{g.current=S},[]),disableHoverableContent:d,children:p})};iz.displayName=sz;var Fb="Tooltip",[use,rw]=CC(Fb),az=e=>{const{__scopeTooltip:r,children:s,open:o,defaultOpen:d,onOpenChange:p,disableHoverableContent:m,delayDuration:g}=e,b=e2(Fb,e.__scopeTooltip),S=AC(r),[j,A]=R.useState(null),k=Vs(),T=R.useRef(0),M=m??b.disableHoverableContent,I=g??b.delayDuration,q=R.useRef(!1),[G,K]=qd({prop:o,defaultProp:d??!1,onChange:Q=>{Q?(b.onOpen(),document.dispatchEvent(new CustomEvent(zT))):b.onClose(),p?.(Q)},caller:Fb}),X=R.useMemo(()=>G?q.current?"delayed-open":"instant-open":"closed",[G]),L=R.useCallback(()=>{window.clearTimeout(T.current),T.current=0,q.current=!1,K(!0)},[K]),ee=R.useCallback(()=>{window.clearTimeout(T.current),T.current=0,K(!1)},[K]),oe=R.useCallback(()=>{window.clearTimeout(T.current),T.current=window.setTimeout(()=>{q.current=!0,K(!0),T.current=0},I)},[I,K]);return R.useEffect(()=>()=>{T.current&&(window.clearTimeout(T.current),T.current=0)},[]),u.jsx(SC,{...S,children:u.jsx(use,{scope:r,contentId:k,open:G,stateAttribute:X,trigger:j,onTriggerChange:A,onTriggerEnter:R.useCallback(()=>{b.isOpenDelayedRef.current?oe():L()},[b.isOpenDelayedRef,oe,L]),onTriggerLeave:R.useCallback(()=>{M?ee():(window.clearTimeout(T.current),T.current=0)},[ee,M]),onOpen:L,onClose:ee,disableHoverableContent:M,children:s})})};az.displayName=Fb;var FT="TooltipTrigger",oz=R.forwardRef((e,r)=>{const{__scopeTooltip:s,...o}=e,d=rw(FT,s),p=e2(FT,s),m=AC(s),g=R.useRef(null),b=zn(r,g,d.onTriggerChange),S=R.useRef(!1),j=R.useRef(!1),A=R.useCallback(()=>S.current=!1,[]);return R.useEffect(()=>()=>document.removeEventListener("pointerup",A),[A]),u.jsx(nw,{asChild:!0,...m,children:u.jsx(Cn.button,{"aria-describedby":d.open?d.contentId:void 0,"data-state":d.stateAttribute,...o,ref:b,onPointerMove:$t(e.onPointerMove,k=>{k.pointerType!=="touch"&&!j.current&&!p.isPointerInTransitRef.current&&(d.onTriggerEnter(),j.current=!0)}),onPointerLeave:$t(e.onPointerLeave,()=>{d.onTriggerLeave(),j.current=!1}),onPointerDown:$t(e.onPointerDown,()=>{d.open&&d.onClose(),S.current=!0,document.addEventListener("pointerup",A,{once:!0})}),onFocus:$t(e.onFocus,()=>{S.current||d.onOpen()}),onBlur:$t(e.onBlur,d.onClose),onClick:$t(e.onClick,d.onClose)})})});oz.displayName=FT;var t2="TooltipPortal",[dse,hse]=CC(t2,{forceMount:void 0}),lz=e=>{const{__scopeTooltip:r,forceMount:s,children:o,container:d}=e,p=rw(t2,r);return u.jsx(dse,{scope:r,forceMount:s,children:u.jsx(lo,{present:s||p.open,children:u.jsx(_g,{asChild:!0,container:d,children:o})})})};lz.displayName=t2;var xg="TooltipContent",cz=R.forwardRef((e,r)=>{const s=hse(xg,e.__scopeTooltip),{forceMount:o=s.forceMount,side:d="top",...p}=e,m=rw(xg,e.__scopeTooltip);return u.jsx(lo,{present:o||m.open,children:m.disableHoverableContent?u.jsx(uz,{side:d,...p,ref:r}):u.jsx(pse,{side:d,...p,ref:r})})}),pse=R.forwardRef((e,r)=>{const s=rw(xg,e.__scopeTooltip),o=e2(xg,e.__scopeTooltip),d=R.useRef(null),p=zn(r,d),[m,g]=R.useState(null),{trigger:b,onClose:S}=s,j=d.current,{onPointerInTransitChange:A}=o,k=R.useCallback(()=>{g(null),A(!1)},[A]),T=R.useCallback((M,I)=>{const q=M.currentTarget,G={x:M.clientX,y:M.clientY},K=yse(G,q.getBoundingClientRect()),X=vse(G,K),L=xse(I.getBoundingClientRect()),ee=wse([...X,...L]);g(ee),A(!0)},[A]);return R.useEffect(()=>()=>k(),[k]),R.useEffect(()=>{if(b&&j){const M=q=>T(q,j),I=q=>T(q,b);return b.addEventListener("pointerleave",M),j.addEventListener("pointerleave",I),()=>{b.removeEventListener("pointerleave",M),j.removeEventListener("pointerleave",I)}}},[b,j,T,k]),R.useEffect(()=>{if(m){const M=I=>{const q=I.target,G={x:I.clientX,y:I.clientY},K=b?.contains(q)||j?.contains(q),X=!bse(G,m);K?k():X&&(k(),S())};return document.addEventListener("pointermove",M),()=>document.removeEventListener("pointermove",M)}},[b,j,m,S,k]),u.jsx(uz,{...e,ref:p})}),[fse,mse]=CC(Fb,{isInside:!1}),gse=nse("TooltipContent"),uz=R.forwardRef((e,r)=>{const{__scopeTooltip:s,children:o,"aria-label":d,onEscapeKeyDown:p,onPointerDownOutside:m,...g}=e,b=rw(xg,s),S=AC(s),{onClose:j}=b;return R.useEffect(()=>(document.addEventListener(zT,j),()=>document.removeEventListener(zT,j)),[j]),R.useEffect(()=>{if(b.trigger){const A=k=>{k.target?.contains(b.trigger)&&j()};return window.addEventListener("scroll",A,{capture:!0}),()=>window.removeEventListener("scroll",A,{capture:!0})}},[b.trigger,j]),u.jsx(kg,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:p,onPointerDownOutside:m,onFocusOutside:A=>A.preventDefault(),onDismiss:j,children:u.jsxs(EC,{"data-state":b.stateAttribute,...S,...g,ref:r,style:{...g.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(gse,{children:o}),u.jsx(fse,{scope:s,isInside:!0,children:u.jsx(ose,{id:b.contentId,role:"tooltip",children:d||o})})]})})});cz.displayName=xg;var dz="TooltipArrow",hz=R.forwardRef((e,r)=>{const{__scopeTooltip:s,...o}=e,d=AC(s);return mse(dz,s).isInside?null:u.jsx(jC,{...d,...o,ref:r})});hz.displayName=dz;function yse(e,r){const s=Math.abs(r.top-e.y),o=Math.abs(r.bottom-e.y),d=Math.abs(r.right-e.x),p=Math.abs(r.left-e.x);switch(Math.min(s,o,d,p)){case p:return"left";case d:return"right";case s:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function vse(e,r,s=5){const o=[];switch(r){case"top":o.push({x:e.x-s,y:e.y+s},{x:e.x+s,y:e.y+s});break;case"bottom":o.push({x:e.x-s,y:e.y-s},{x:e.x+s,y:e.y-s});break;case"left":o.push({x:e.x+s,y:e.y-s},{x:e.x+s,y:e.y+s});break;case"right":o.push({x:e.x-s,y:e.y-s},{x:e.x-s,y:e.y+s});break}return o}function xse(e){const{top:r,right:s,bottom:o,left:d}=e;return[{x:d,y:r},{x:s,y:r},{x:s,y:o},{x:d,y:o}]}function bse(e,r){const{x:s,y:o}=e;let d=!1;for(let p=0,m=r.length-1;po!=k>o&&s<(A-S)*(o-j)/(k-j)+S&&(d=!d)}return d}function wse(e){const r=e.slice();return r.sort((s,o)=>s.xo.x?1:s.yo.y?1:0),Sse(r)}function Sse(e){if(e.length<=1)return e.slice();const r=[];for(let o=0;o=2;){const p=r[r.length-1],m=r[r.length-2];if((p.x-m.x)*(d.y-m.y)>=(p.y-m.y)*(d.x-m.x))r.pop();else break}r.push(d)}r.pop();const s=[];for(let o=e.length-1;o>=0;o--){const d=e[o];for(;s.length>=2;){const p=s[s.length-1],m=s[s.length-2];if((p.x-m.x)*(d.y-m.y)>=(p.y-m.y)*(d.x-m.x))s.pop();else break}s.push(d)}return s.pop(),r.length===1&&s.length===1&&r[0].x===s[0].x&&r[0].y===s[0].y?r:r.concat(s)}var Ese=iz,jse=az,Cse=oz,Ase=lz,Ose=cz,kse=hz;function sw({delayDuration:e=0,...r}){return u.jsx(Ese,{"data-slot":"tooltip-provider",delayDuration:e,...r})}function Ij({...e}){return u.jsx(sw,{children:u.jsx(jse,{"data-slot":"tooltip",...e})})}function Lj({...e}){return u.jsx(Cse,{"data-slot":"tooltip-trigger",...e})}function zj({className:e,sideOffset:r=0,children:s,...o}){return u.jsx(Ase,{children:u.jsxs(Ose,{"data-slot":"tooltip-content",sideOffset:r,className:ht("bg-foreground text-background 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 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...o,children:[s,u.jsx(kse,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function pz(e){return e&&e!=="none"?e.slice(0,7):"none"}function Rse(e){if(!e||e==="unknown")return"unknown";const r=new Date(e);return isNaN(+r)?e:r.toLocaleString()}function Tse(e){return e?`v${e.version} (${pz(e.commit)}) • built ${e.built} • ${e.go} ${e.goOS}/${e.goArch}`:""}const _se=R.memo(function(){const r=rr({queryKey:["footer"],queryFn:()=>dte.footer(),staleTime:6e4,refetchOnWindowFocus:!1}),s=r.data,o=R.useMemo(()=>Tse(s),[s]);return u.jsx("footer",{className:"bg-background text-muted-foreground w-full border-t px-3 py-2 text-xs sm:text-sm",children:u.jsxs("div",{className:"mx-auto flex max-w-screen-2xl items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-2 text-xs sm:text-sm",children:[u.jsxs("span",{children:["© ",new Date().getFullYear()," GlueOps"]}),u.jsx(bb,{orientation:"vertical",className:"hidden h-4 sm:block"}),u.jsx("span",{className:"hidden sm:block",children:"All systems nominal."})]}),u.jsx("div",{className:"flex flex-wrap items-center gap-2 text-xs sm:text-sm",children:r.isLoading?u.jsx("span",{className:"animate-pulse",children:"loading version…"}):r.isError?u.jsx("span",{className:"text-destructive",children:"version unavailable"}):s?u.jsx(sw,{children:u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(ns,{variant:"secondary",className:"font-mono",children:s.version}),u.jsxs(Ij,{children:[u.jsx(Lj,{asChild:!0,children:u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(YZ,{className:"h-3.5 w-3.5"}),u.jsx("span",{className:"font-mono",children:pz(s.commit)})]})}),u.jsx(zj,{side:"top",children:u.jsx("div",{className:"font-mono text-xs",children:s.commit})})]}),u.jsx(bb,{orientation:"vertical",className:"h-4"}),u.jsxs(Ij,{children:[u.jsx(Lj,{asChild:!0,children:u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(lL,{className:"h-3.5 w-3.5"}),u.jsx("span",{children:s.go})]})}),u.jsx(zj,{side:"top",children:u.jsxs("div",{className:"font-mono text-xs",children:[s.goOS,"/",s.goArch]})})]}),u.jsx(bb,{orientation:"vertical",className:"hidden h-4 sm:block"}),u.jsxs("span",{className:"hidden sm:inline",children:["built ",u.jsx("span",{className:"font-mono",children:Rse(s.built)})]}),u.jsx(bb,{orientation:"vertical",className:"hidden h-4 sm:block"}),u.jsx(Fe,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{navigator.clipboard?.writeText(o).catch(()=>{})},title:"Copy version details",children:u.jsx(NZ,{className:"h-4 w-4"})}),u.jsxs("a",{href:"/api/v1/version",target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-xs underline-offset-4 hover:underline",title:"Open raw version JSON",children:["JSON ",u.jsx(BZ,{className:"h-3.5 w-3.5"})]})]})}):null})]})})});var fz={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},hI=Je.createContext&&Je.createContext(fz),$se=["attr","size","title"];function Nse(e,r){if(e==null)return{};var s=Dse(e,r),o,d;if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(e);for(d=0;d=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(s[o]=e[o])}return s}function Dse(e,r){if(e==null)return{};var s={};for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){if(r.indexOf(o)>=0)continue;s[o]=e[o]}return s}function Fj(){return Fj=Object.assign?Object.assign.bind():function(e){for(var r=1;rJe.createElement(r.tag,qj({key:s},r.attr),mz(r.child)))}function iw(e){return r=>Je.createElement(Lse,Fj({attr:qj({},e.attr)},r),mz(e.child))}function Lse(e){var r=s=>{var{attr:o,size:d,title:p}=e,m=Nse(e,$se),g=d||s.size||"1em",b;return s.className&&(b=s.className),e.className&&(b=(b?b+" ":"")+e.className),Je.createElement("svg",Fj({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},s.attr,o,m,{className:b,style:qj(qj({color:e.color||s.color},s.style),e.style),height:g,width:g,xmlns:"http://www.w3.org/2000/svg"}),p&&Je.createElement("title",null,p),e.children)};return hI!==void 0?Je.createElement(hI.Consumer,null,s=>r(s)):r(fz)}function zse(e){return iw({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M888 680h-54V540H546v-92h238c8.8 0 16-7.2 16-16V168c0-8.8-7.2-16-16-16H240c-8.8 0-16 7.2-16 16v264c0 8.8 7.2 16 16 16h238v92H190v140h-54c-4.4 0-8 3.6-8 8v176c0 4.4 3.6 8 8 8h176c4.4 0 8-3.6 8-8V688c0-4.4-3.6-8-8-8h-54v-72h220v72h-54c-4.4 0-8 3.6-8 8v176c0 4.4 3.6 8 8 8h176c4.4 0 8-3.6 8-8V688c0-4.4-3.6-8-8-8h-54v-72h220v72h-54c-4.4 0-8 3.6-8 8v176c0 4.4 3.6 8 8 8h176c4.4 0 8-3.6 8-8V688c0-4.4-3.6-8-8-8zM256 805.3c0 1.5-1.2 2.7-2.7 2.7h-58.7c-1.5 0-2.7-1.2-2.7-2.7v-58.7c0-1.5 1.2-2.7 2.7-2.7h58.7c1.5 0 2.7 1.2 2.7 2.7v58.7zm288 0c0 1.5-1.2 2.7-2.7 2.7h-58.7c-1.5 0-2.7-1.2-2.7-2.7v-58.7c0-1.5 1.2-2.7 2.7-2.7h58.7c1.5 0 2.7 1.2 2.7 2.7v58.7zM288 384V216h448v168H288zm544 421.3c0 1.5-1.2 2.7-2.7 2.7h-58.7c-1.5 0-2.7-1.2-2.7-2.7v-58.7c0-1.5 1.2-2.7 2.7-2.7h58.7c1.5 0 2.7 1.2 2.7 2.7v58.7zM360 300a40 40 0 1 0 80 0 40 40 0 1 0-80 0z"},child:[]}]})(e)}function Fse(e){return iw({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",strokeWidth:"2",d:"M3,6 L21,6 L3,6 Z M10,2 L10,4 M14,2 L14,4 M16,12 C18.3736719,13.1826446 20,15.6506255 20,19 L20,23 L4,23 L4,19 C4,15.6457258 5.6310898,13.1754259 8,12 M12,16.5 L12,23 M12,13 C15.3137085,13 18,10.3137085 18,7 C18,3.6862915 15.3137085,1 12,1 C8.6862915,1 6,3.6862915 6,7 C6,10.3137085 8.6862915,13 12,13 Z M8,12 C8,14.209139 9.790861,16 12,16 L12,16 C14.209139,16 16,14.209139 16,12"},child:[]}]})(e)}function qse(e){return iw({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M19 15v4H5v-4h14m1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1v-6c0-.55-.45-1-1-1zM7 18.5c-.82 0-1.5-.67-1.5-1.5s.68-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zM19 5v4H5V5h14m1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1zM7 8.5c-.82 0-1.5-.67-1.5-1.5S6.18 5.5 7 5.5s1.5.68 1.5 1.5S7.83 8.5 7 8.5z"},child:[]}]})(e)}function Bse(e){return iw({attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 0C5.383 0 0 5.383 0 12s5.383 12 12 12c6.616 0 12-5.383 12-12S18.616 0 12 0zm0 1.144c5.995 0 10.856 4.86 10.856 10.856 0 5.995-4.86 10.856-10.856 10.856-5.996 0-10.856-4.86-10.856-10.856C1.144 6.004 6.004 1.144 12 1.144zM8.37 5.868a6.707 6.707 0 0 0-.423.005c-.983.056-1.573.517-1.735 1.472-.115.665-.096 1.348-.143 2.017-.013.35-.05.697-.115 1.038-.134.609-.397.798-1.016.83a2.65 2.65 0 0 0-.244.042v1.463c1.126.055 1.278.452 1.37 1.629.033.429-.013.858.015 1.287.018.406.073.808.156 1.2.259 1.075 1.307 1.435 2.575 1.218v-1.283c-.203 0-.383.005-.558 0-.43-.013-.591-.12-.632-.535-.056-.535-.042-1.08-.075-1.62-.064-1.001-.175-1.988-1.153-2.625.503-.37.868-.812.983-1.398.083-.41.134-.821.166-1.237.028-.415-.023-.84.014-1.25.06-.665.102-.937.9-.91.12 0 .235-.017.369-.027v-1.31c-.16 0-.31-.004-.454-.006zm7.593.009a4.247 4.247 0 0 0-.813.06v1.274c.245 0 .434 0 .623.005.328.004.577.13.61.494.032.332.031.669.064 1.006.065.669.101 1.347.217 2.007.102.544.475.95.941 1.283-.817.549-1.057 1.333-1.098 2.215-.023.604-.037 1.213-.069 1.822-.028.554-.222.734-.78.748-.157.004-.31.018-.484.028v1.305c.327 0 .627.019.927 0 .932-.055 1.495-.507 1.68-1.412.078-.498.124-1 .138-1.504.032-.461.028-.927.074-1.384.069-.715.397-1.01 1.112-1.057a.972.972 0 0 0 .199-.046v-1.463c-.12-.014-.204-.027-.291-.032-.536-.023-.804-.203-.937-.71a5.146 5.146 0 0 1-.152-.993c-.037-.618-.033-1.241-.074-1.86-.08-1.192-.794-1.753-1.887-1.786zm-6.89 5.28a.844.844 0 0 0-.083 1.684h.055a.83.83 0 0 0 .877-.78v-.046a.845.845 0 0 0-.83-.858zm2.911 0a.808.808 0 0 0-.834.78c0 .027 0 .05.004.078 0 .503.342.826.859.826.507 0 .826-.332.826-.853-.005-.503-.342-.836-.855-.831zm2.963 0a.861.861 0 0 0-.876.835c0 .47.378.849.849.849h.009c.425.074.853-.337.881-.83.023-.457-.392-.854-.863-.854z"},child:[]}]})(e)}function Use(e){return iw({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 13m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"},child:[]},{tag:"path",attr:{d:"M12 20m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},child:[]},{tag:"path",attr:{d:"M12 16v3"},child:[]},{tag:"path",attr:{d:"M12 10v-7"},child:[]},{tag:"path",attr:{d:"M9 6l3 -3l3 3"},child:[]},{tag:"path",attr:{d:"M12 10v-7"},child:[]},{tag:"path",attr:{d:"M9 6l3 -3l3 3"},child:[]},{tag:"path",attr:{d:"M14.894 12.227l6.11 -2.224"},child:[]},{tag:"path",attr:{d:"M17.159 8.21l3.845 1.793l-1.793 3.845"},child:[]},{tag:"path",attr:{d:"M9.101 12.214l-6.075 -2.211"},child:[]},{tag:"path",attr:{d:"M6.871 8.21l-3.845 1.793l1.793 3.845"},child:[]}]})(e)}const Kse=[{to:"/clusters",label:"Clusters",icon:zse},{to:"/load-balancers",label:"Load Balancers",icon:Use},{to:"/dns",label:"DNS",icon:qse},{to:"/node-pools",label:"Node Pools",icon:yZ},{to:"/annotations",label:"Annotations",icon:PZ},{to:"/labels",label:"Labels",icon:gC},{to:"/taints",label:"Taints",icon:SW},{to:"/servers",label:"Servers",icon:F_},{to:"/ssh",label:"SSH Keys",icon:GZ},{to:"/credentials",label:"Credentials",icon:nW}],Vse=[{to:"/org/members",label:"Members",icon:cL},{to:"/org/api-keys",label:"Org API Keys",icon:JZ},{to:"/org/settings",label:"Org Settings",icon:iL}],Hse=[{to:"/me",label:"Profile",icon:RW}],Gse=[{to:"/admin/users",label:"Users Admin",icon:cL},{to:"/admin/jobs",label:"Jobs Admin",icon:Fse},{to:"/docs",label:"API Docs ",icon:Bse,target:"_blank"}];var fI=1,Xse=.9,Yse=.8,Zse=.17,LR=.1,zR=.999,Wse=.9999,Jse=.99,Qse=/[\\\/_+.#"@\[\(\{&]/,eie=/[\\\/_+.#"@\[\(\{&]/g,tie=/[\s-]/,gz=/[\s-]/g;function qT(e,r,s,o,d,p,m){if(p===r.length)return d===e.length?fI:Jse;var g=`${d},${p}`;if(m[g]!==void 0)return m[g];for(var b=o.charAt(p),S=s.indexOf(b,d),j=0,A,k,T,M;S>=0;)A=qT(e,r,s,o,S+1,p+1,m),A>j&&(S===d?A*=fI:Qse.test(e.charAt(S-1))?(A*=Yse,T=e.slice(d,S-1).match(eie),T&&d>0&&(A*=Math.pow(zR,T.length))):tie.test(e.charAt(S-1))?(A*=Xse,M=e.slice(d,S-1).match(gz),M&&d>0&&(A*=Math.pow(zR,M.length))):(A*=Zse,d>0&&(A*=Math.pow(zR,S-d))),e.charAt(S)!==r.charAt(p)&&(A*=Wse)),(AA&&(A=k*LR)),A>j&&(j=A),S=s.indexOf(b,S+1);return m[g]=j,j}function mI(e){return e.toLowerCase().replace(gz," ")}function nie(e,r,s){return e=s&&s.length>0?`${e+" "+s.join(" ")}`:e,qT(e,r,mI(e),mI(r),0,0,{})}var FR="focusScope.autoFocusOnMount",qR="focusScope.autoFocusOnUnmount",gI={bubbles:!1,cancelable:!0},rie="FocusScope",aw=R.forwardRef((e,r)=>{const{loop:s=!1,trapped:o=!1,onMountAutoFocus:d,onUnmountAutoFocus:p,...m}=e,[g,b]=R.useState(null),S=tl(d),j=tl(p),A=R.useRef(null),k=zn(r,I=>b(I)),T=R.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;R.useEffect(()=>{if(o){let I=function(X){if(T.paused||!g)return;const L=X.target;g.contains(L)?A.current=L:Pd(A.current,{select:!0})},q=function(X){if(T.paused||!g)return;const L=X.relatedTarget;L!==null&&(g.contains(L)||Pd(A.current,{select:!0}))},G=function(X){if(document.activeElement===document.body)for(const ee of X)ee.removedNodes.length>0&&Pd(g)};document.addEventListener("focusin",I),document.addEventListener("focusout",q);const K=new MutationObserver(G);return g&&K.observe(g,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",I),document.removeEventListener("focusout",q),K.disconnect()}}},[o,g,T.paused]),R.useEffect(()=>{if(g){vI.add(T);const I=document.activeElement;if(!g.contains(I)){const G=new CustomEvent(FR,gI);g.addEventListener(FR,S),g.dispatchEvent(G),G.defaultPrevented||(sie(cie(yz(g)),{select:!0}),document.activeElement===I&&Pd(g))}return()=>{g.removeEventListener(FR,S),setTimeout(()=>{const G=new CustomEvent(qR,gI);g.addEventListener(qR,j),g.dispatchEvent(G),G.defaultPrevented||Pd(I??document.body,{select:!0}),g.removeEventListener(qR,j),vI.remove(T)},0)}}},[g,S,j,T]);const M=R.useCallback(I=>{if(!s&&!o||T.paused)return;const q=I.key==="Tab"&&!I.altKey&&!I.ctrlKey&&!I.metaKey,G=document.activeElement;if(q&&G){const K=I.currentTarget,[X,L]=iie(K);X&&L?!I.shiftKey&&G===L?(I.preventDefault(),s&&Pd(X,{select:!0})):I.shiftKey&&G===X&&(I.preventDefault(),s&&Pd(L,{select:!0})):G===K&&I.preventDefault()}},[s,o,T.paused]);return u.jsx(Cn.div,{tabIndex:-1,...m,ref:k,onKeyDown:M})});aw.displayName=rie;function sie(e,{select:r=!1}={}){const s=document.activeElement;for(const o of e)if(Pd(o,{select:r}),document.activeElement!==s)return}function iie(e){const r=yz(e),s=yI(r,e),o=yI(r.reverse(),e);return[s,o]}function yz(e){const r=[],s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const d=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||d?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)r.push(s.currentNode);return r}function yI(e,r){for(const s of e)if(!aie(s,{upTo:r}))return s}function aie(e,{upTo:r}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(r!==void 0&&e===r)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function oie(e){return e instanceof HTMLInputElement&&"select"in e}function Pd(e,{select:r=!1}={}){if(e&&e.focus){const s=document.activeElement;e.focus({preventScroll:!0}),e!==s&&oie(e)&&r&&e.select()}}var vI=lie();function lie(){let e=[];return{add(r){const s=e[0];r!==s&&s?.pause(),e=xI(e,r),e.unshift(r)},remove(r){e=xI(e,r),e[0]?.resume()}}}function xI(e,r){const s=[...e],o=s.indexOf(r);return o!==-1&&s.splice(o,1),s}function cie(e){return e.filter(r=>r.tagName!=="A")}var BR=0;function OC(){R.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??bI()),document.body.insertAdjacentElement("beforeend",e[1]??bI()),BR++,()=>{BR===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),BR--}},[])}function bI(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var nc=function(){return nc=Object.assign||function(r){for(var s,o=1,d=arguments.length;o"u")return Aie;var r=Oie(e),s=document.documentElement.clientWidth,o=window.innerWidth;return{left:r[0],top:r[1],right:r[2],gap:Math.max(0,o-s+r[2]-r[0])}},Rie=wz(),fg="data-scroll-locked",Tie=function(e,r,s,o){var d=e.left,p=e.top,m=e.right,g=e.gap;return s===void 0&&(s="margin"),` + .`.concat(die,` { overflow: hidden `).concat(o,`; padding-right: `).concat(g,"px ").concat(o,`; } @@ -24,62 +24,62 @@ Error generating stack: `+y.message+` `),s==="padding"&&"padding-right: ".concat(g,"px ").concat(o,";")].filter(Boolean).join(""),` } - .`).concat(vj,` { + .`).concat(yj,` { right: `).concat(g,"px ").concat(o,`; } - .`).concat(xj,` { + .`).concat(vj,` { margin-right: `).concat(g,"px ").concat(o,`; } - .`).concat(vj," .").concat(vj,` { + .`).concat(yj," .").concat(yj,` { right: 0 `).concat(o,`; } - .`).concat(xj," .").concat(xj,` { + .`).concat(vj," .").concat(vj,` { margin-right: 0 `).concat(o,`; } body[`).concat(fg,`] { - `).concat(die,": ").concat(g,`px; + `).concat(hie,": ").concat(g,`px; } -`)},wI=function(){var e=parseInt(document.body.getAttribute(fg)||"0",10);return isFinite(e)?e:0},Tie=function(){R.useEffect(function(){return document.body.setAttribute(fg,(wI()+1).toString()),function(){var e=wI()-1;e<=0?document.body.removeAttribute(fg):document.body.setAttribute(fg,e.toString())}},[])},_ie=function(e){var r=e.noRelative,s=e.noImportant,o=e.gapMode,d=o===void 0?"margin":o;Tie();var p=R.useMemo(function(){return Oie(d)},[d]);return R.createElement(kie,{styles:Rie(p,!r,d,s?"":"!important")})},qT=!1;if(typeof window<"u")try{var ZE=Object.defineProperty({},"passive",{get:function(){return qT=!0,!0}});window.addEventListener("test",ZE,ZE),window.removeEventListener("test",ZE,ZE)}catch{qT=!1}var Vm=qT?{passive:!1}:!1,$ie=function(e){return e.tagName==="TEXTAREA"},wL=function(e,r){if(!(e instanceof Element))return!1;var s=window.getComputedStyle(e);return s[r]!=="hidden"&&!(s.overflowY===s.overflowX&&!$ie(e)&&s[r]==="visible")},Nie=function(e){return wL(e,"overflowY")},Die=function(e){return wL(e,"overflowX")},SI=function(e,r){var s=r.ownerDocument,o=r;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var d=SL(e,o);if(d){var p=EL(e,o),m=p[1],g=p[2];if(m>g)return!0}o=o.parentNode}while(o&&o!==s.body);return!1},Pie=function(e){var r=e.scrollTop,s=e.scrollHeight,o=e.clientHeight;return[r,s,o]},Mie=function(e){var r=e.scrollLeft,s=e.scrollWidth,o=e.clientWidth;return[r,s,o]},SL=function(e,r){return e==="v"?Nie(r):Die(r)},EL=function(e,r){return e==="v"?Pie(r):Mie(r)},Iie=function(e,r){return e==="h"&&r==="rtl"?-1:1},zie=function(e,r,s,o,d){var p=Iie(e,window.getComputedStyle(r).direction),m=p*o,g=s.target,b=r.contains(g),S=!1,E=m>0,A=0,k=0;do{if(!g)break;var T=EL(e,g),M=T[0],I=T[1],q=T[2],G=I-q-p*M;(M||G)&&SL(e,g)&&(A+=G,k+=M);var K=g.parentNode;g=K&&K.nodeType===Node.DOCUMENT_FRAGMENT_NODE?K.host:K}while(!b&&g!==document.body||b&&(r.contains(g)||r===g));return(E&&Math.abs(A)<1||!E&&Math.abs(k)<1)&&(S=!0),S},WE=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},EI=function(e){return[e.deltaX,e.deltaY]},jI=function(e){return e&&"current"in e?e.current:e},Lie=function(e,r){return e[0]===r[0]&&e[1]===r[1]},Fie=function(e){return` +`)},SI=function(){var e=parseInt(document.body.getAttribute(fg)||"0",10);return isFinite(e)?e:0},_ie=function(){R.useEffect(function(){return document.body.setAttribute(fg,(SI()+1).toString()),function(){var e=SI()-1;e<=0?document.body.removeAttribute(fg):document.body.setAttribute(fg,e.toString())}},[])},$ie=function(e){var r=e.noRelative,s=e.noImportant,o=e.gapMode,d=o===void 0?"margin":o;_ie();var p=R.useMemo(function(){return kie(d)},[d]);return R.createElement(Rie,{styles:Tie(p,!r,d,s?"":"!important")})},BT=!1;if(typeof window<"u")try{var XE=Object.defineProperty({},"passive",{get:function(){return BT=!0,!0}});window.addEventListener("test",XE,XE),window.removeEventListener("test",XE,XE)}catch{BT=!1}var Vm=BT?{passive:!1}:!1,Nie=function(e){return e.tagName==="TEXTAREA"},Sz=function(e,r){if(!(e instanceof Element))return!1;var s=window.getComputedStyle(e);return s[r]!=="hidden"&&!(s.overflowY===s.overflowX&&!Nie(e)&&s[r]==="visible")},Die=function(e){return Sz(e,"overflowY")},Pie=function(e){return Sz(e,"overflowX")},EI=function(e,r){var s=r.ownerDocument,o=r;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var d=Ez(e,o);if(d){var p=jz(e,o),m=p[1],g=p[2];if(m>g)return!0}o=o.parentNode}while(o&&o!==s.body);return!1},Mie=function(e){var r=e.scrollTop,s=e.scrollHeight,o=e.clientHeight;return[r,s,o]},Iie=function(e){var r=e.scrollLeft,s=e.scrollWidth,o=e.clientWidth;return[r,s,o]},Ez=function(e,r){return e==="v"?Die(r):Pie(r)},jz=function(e,r){return e==="v"?Mie(r):Iie(r)},Lie=function(e,r){return e==="h"&&r==="rtl"?-1:1},zie=function(e,r,s,o,d){var p=Lie(e,window.getComputedStyle(r).direction),m=p*o,g=s.target,b=r.contains(g),S=!1,j=m>0,A=0,k=0;do{if(!g)break;var T=jz(e,g),M=T[0],I=T[1],q=T[2],G=I-q-p*M;(M||G)&&Ez(e,g)&&(A+=G,k+=M);var K=g.parentNode;g=K&&K.nodeType===Node.DOCUMENT_FRAGMENT_NODE?K.host:K}while(!b&&g!==document.body||b&&(r.contains(g)||r===g));return(j&&Math.abs(A)<1||!j&&Math.abs(k)<1)&&(S=!0),S},YE=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},jI=function(e){return[e.deltaX,e.deltaY]},CI=function(e){return e&&"current"in e?e.current:e},Fie=function(e,r){return e[0]===r[0]&&e[1]===r[1]},qie=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},qie=0,Hm=[];function Bie(e){var r=R.useRef([]),s=R.useRef([0,0]),o=R.useRef(),d=R.useState(qie++)[0],p=R.useState(bL)[0],m=R.useRef(e);R.useEffect(function(){m.current=e},[e]),R.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(d));var I=cie([e.lockRef.current],(e.shards||[]).map(jI),!0).filter(Boolean);return I.forEach(function(q){return q.classList.add("allow-interactivity-".concat(d))}),function(){document.body.classList.remove("block-interactivity-".concat(d)),I.forEach(function(q){return q.classList.remove("allow-interactivity-".concat(d))})}}},[e.inert,e.lockRef.current,e.shards]);var g=R.useCallback(function(I,q){if("touches"in I&&I.touches.length===2||I.type==="wheel"&&I.ctrlKey)return!m.current.allowPinchZoom;var G=WE(I),K=s.current,X="deltaX"in I?I.deltaX:K[0]-G[0],z="deltaY"in I?I.deltaY:K[1]-G[1],ee,oe=I.target,Q=Math.abs(X)>Math.abs(z)?"h":"v";if("touches"in I&&Q==="h"&&oe.type==="range")return!1;var ne=SI(Q,oe);if(!ne)return!0;if(ne?ee=Q:(ee=Q==="v"?"h":"v",ne=SI(Q,oe)),!ne)return!1;if(!o.current&&"changedTouches"in I&&(X||z)&&(o.current=ee),!ee)return!0;var de=o.current||ee;return zie(de,q,I,de==="h"?X:z)},[]),b=R.useCallback(function(I){var q=I;if(!(!Hm.length||Hm[Hm.length-1]!==p)){var G="deltaY"in q?EI(q):WE(q),K=r.current.filter(function(ee){return ee.name===q.type&&(ee.target===q.target||q.target===ee.shadowParent)&&Lie(ee.delta,G)})[0];if(K&&K.should){q.cancelable&&q.preventDefault();return}if(!K){var X=(m.current.shards||[]).map(jI).filter(Boolean).filter(function(ee){return ee.contains(q.target)}),z=X.length>0?g(q,X[0]):!m.current.noIsolation;z&&q.cancelable&&q.preventDefault()}}},[]),S=R.useCallback(function(I,q,G,K){var X={name:I,delta:q,target:G,should:K,shadowParent:Uie(G)};r.current.push(X),setTimeout(function(){r.current=r.current.filter(function(z){return z!==X})},1)},[]),E=R.useCallback(function(I){s.current=WE(I),o.current=void 0},[]),A=R.useCallback(function(I){S(I.type,EI(I),I.target,g(I,e.lockRef.current))},[]),k=R.useCallback(function(I){S(I.type,WE(I),I.target,g(I,e.lockRef.current))},[]);R.useEffect(function(){return Hm.push(p),e.setCallbacks({onScrollCapture:A,onWheelCapture:A,onTouchMoveCapture:k}),document.addEventListener("wheel",b,Vm),document.addEventListener("touchmove",b,Vm),document.addEventListener("touchstart",E,Vm),function(){Hm=Hm.filter(function(I){return I!==p}),document.removeEventListener("wheel",b,Vm),document.removeEventListener("touchmove",b,Vm),document.removeEventListener("touchstart",E,Vm)}},[]);var T=e.removeScrollBar,M=e.inert;return R.createElement(R.Fragment,null,M?R.createElement(p,{styles:Fie(d)}):null,T?R.createElement(_ie,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Uie(e){for(var r=null;e!==null;)e instanceof ShadowRoot&&(r=e.host,e=e.host),e=e.parentNode;return r}const Kie=vie(xL,Bie);var lw=R.forwardRef(function(e,r){return R.createElement(kC,nc({},e,{ref:r,sideCar:Kie}))});lw.classNames=kC.classNames;var Vie=function(e){if(typeof document>"u")return null;var r=Array.isArray(e)?e[0]:e;return r.ownerDocument.body},Gm=new WeakMap,JE=new WeakMap,QE={},HR=0,jL=function(e){return e&&(e.host||jL(e.parentNode))},Hie=function(e,r){return r.map(function(s){if(e.contains(s))return s;var o=jL(s);return o&&e.contains(o)?o:(console.error("aria-hidden",s,"in not contained inside",e,". Doing nothing"),null)}).filter(function(s){return!!s})},Gie=function(e,r,s,o){var d=Hie(r,Array.isArray(e)?e:[e]);QE[s]||(QE[s]=new WeakMap);var p=QE[s],m=[],g=new Set,b=new Set(d),S=function(A){!A||g.has(A)||(g.add(A),S(A.parentNode))};d.forEach(S);var E=function(A){!A||b.has(A)||Array.prototype.forEach.call(A.children,function(k){if(g.has(k))E(k);else try{var T=k.getAttribute(o),M=T!==null&&T!=="false",I=(Gm.get(k)||0)+1,q=(p.get(k)||0)+1;Gm.set(k,I),p.set(k,q),m.push(k),I===1&&M&&JE.set(k,!0),q===1&&k.setAttribute(s,"true"),M||k.setAttribute(o,"true")}catch(G){console.error("aria-hidden: cannot operate on ",k,G)}})};return E(r),g.clear(),HR++,function(){m.forEach(function(A){var k=Gm.get(A)-1,T=p.get(A)-1;Gm.set(A,k),p.set(A,T),k||(JE.has(A)||A.removeAttribute(o),JE.delete(A)),T||A.removeAttribute(s)}),HR--,HR||(Gm=new WeakMap,Gm=new WeakMap,JE=new WeakMap,QE={})}},RC=function(e,r,s){s===void 0&&(s="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),d=Vie(e);return d?(o.push.apply(o,Array.from(d.querySelectorAll("[aria-live], script"))),Gie(o,d,s,"aria-hidden")):function(){return null}};function Xie(e){const r=Yie(e),s=R.forwardRef((o,d)=>{const{children:p,...m}=o,g=R.Children.toArray(p),b=g.find(Wie);if(b){const S=b.props.children,E=g.map(A=>A===b?R.Children.count(S)>1?R.Children.only(null):R.isValidElement(S)?S.props.children:null:A);return u.jsx(r,{...m,ref:d,children:R.isValidElement(S)?R.cloneElement(S,void 0,E):null})}return u.jsx(r,{...m,ref:d,children:p})});return s.displayName=`${e}.Slot`,s}function Yie(e){const r=R.forwardRef((s,o)=>{const{children:d,...p}=s;if(R.isValidElement(d)){const m=Qie(d),g=Jie(p,d.props);return d.type!==R.Fragment&&(g.ref=o?zi(o,m):m),R.cloneElement(d,g)}return R.Children.count(d)>1?R.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var Zie=Symbol("radix.slottable");function Wie(e){return R.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Zie}function Jie(e,r){const s={...r};for(const o in r){const d=e[o],p=r[o];/^on[A-Z]/.test(o)?d&&p?s[o]=(...g)=>{const b=p(...g);return d(...g),b}:d&&(s[o]=d):o==="style"?s[o]={...d,...p}:o==="className"&&(s[o]=[d,p].filter(Boolean).join(" "))}return{...e,...s}}function Qie(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning;return s?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var TC="Dialog",[CL,AL]=al(TC),[eae,ol]=CL(TC),OL=e=>{const{__scopeDialog:r,children:s,open:o,defaultOpen:d,onOpenChange:p,modal:m=!0}=e,g=R.useRef(null),b=R.useRef(null),[S,E]=qd({prop:o,defaultProp:d??!1,onChange:p,caller:TC});return u.jsx(eae,{scope:r,triggerRef:g,contentRef:b,contentId:Vs(),titleId:Vs(),descriptionId:Vs(),open:S,onOpenChange:E,onOpenToggle:R.useCallback(()=>E(A=>!A),[E]),modal:m,children:s})};OL.displayName=TC;var kL="DialogTrigger",RL=R.forwardRef((e,r)=>{const{__scopeDialog:s,...o}=e,d=ol(kL,s),p=Ln(r,d.triggerRef);return u.jsx(Cn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":d.open,"aria-controls":d.contentId,"data-state":r2(d.open),...o,ref:p,onClick:$t(e.onClick,d.onOpenToggle)})});RL.displayName=kL;var t2="DialogPortal",[tae,TL]=CL(t2,{forceMount:void 0}),_L=e=>{const{__scopeDialog:r,forceMount:s,children:o,container:d}=e,p=ol(t2,r);return u.jsx(tae,{scope:r,forceMount:s,children:R.Children.map(o,m=>u.jsx(co,{present:s||p.open,children:u.jsx(_g,{asChild:!0,container:d,children:m})}))})};_L.displayName=t2;var Uj="DialogOverlay",$L=R.forwardRef((e,r)=>{const s=TL(Uj,e.__scopeDialog),{forceMount:o=s.forceMount,...d}=e,p=ol(Uj,e.__scopeDialog);return p.modal?u.jsx(co,{present:o||p.open,children:u.jsx(rae,{...d,ref:r})}):null});$L.displayName=Uj;var nae=Xie("DialogOverlay.RemoveScroll"),rae=R.forwardRef((e,r)=>{const{__scopeDialog:s,...o}=e,d=ol(Uj,s);return u.jsx(lw,{as:nae,allowPinchZoom:!0,shards:[d.contentRef],children:u.jsx(Cn.div,{"data-state":r2(d.open),...o,ref:r,style:{pointerEvents:"auto",...o.style}})})}),kp="DialogContent",NL=R.forwardRef((e,r)=>{const s=TL(kp,e.__scopeDialog),{forceMount:o=s.forceMount,...d}=e,p=ol(kp,e.__scopeDialog);return u.jsx(co,{present:o||p.open,children:p.modal?u.jsx(sae,{...d,ref:r}):u.jsx(iae,{...d,ref:r})})});NL.displayName=kp;var sae=R.forwardRef((e,r)=>{const s=ol(kp,e.__scopeDialog),o=R.useRef(null),d=Ln(r,s.contentRef,o);return R.useEffect(()=>{const p=o.current;if(p)return RC(p)},[]),u.jsx(DL,{...e,ref:d,trapFocus:s.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:$t(e.onCloseAutoFocus,p=>{p.preventDefault(),s.triggerRef.current?.focus()}),onPointerDownOutside:$t(e.onPointerDownOutside,p=>{const m=p.detail.originalEvent,g=m.button===0&&m.ctrlKey===!0;(m.button===2||g)&&p.preventDefault()}),onFocusOutside:$t(e.onFocusOutside,p=>p.preventDefault())})}),iae=R.forwardRef((e,r)=>{const s=ol(kp,e.__scopeDialog),o=R.useRef(!1),d=R.useRef(!1);return u.jsx(DL,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:p=>{e.onCloseAutoFocus?.(p),p.defaultPrevented||(o.current||s.triggerRef.current?.focus(),p.preventDefault()),o.current=!1,d.current=!1},onInteractOutside:p=>{e.onInteractOutside?.(p),p.defaultPrevented||(o.current=!0,p.detail.originalEvent.type==="pointerdown"&&(d.current=!0));const m=p.target;s.triggerRef.current?.contains(m)&&p.preventDefault(),p.detail.originalEvent.type==="focusin"&&d.current&&p.preventDefault()}})}),DL=R.forwardRef((e,r)=>{const{__scopeDialog:s,trapFocus:o,onOpenAutoFocus:d,onCloseAutoFocus:p,...m}=e,g=ol(kp,s),b=R.useRef(null),S=Ln(r,b);return OC(),u.jsxs(u.Fragment,{children:[u.jsx(ow,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:d,onUnmountAutoFocus:p,children:u.jsx(kg,{role:"dialog",id:g.contentId,"aria-describedby":g.descriptionId,"aria-labelledby":g.titleId,"data-state":r2(g.open),...m,ref:S,onDismiss:()=>g.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(oae,{titleId:g.titleId}),u.jsx(cae,{contentRef:b,descriptionId:g.descriptionId})]})]})}),n2="DialogTitle",PL=R.forwardRef((e,r)=>{const{__scopeDialog:s,...o}=e,d=ol(n2,s);return u.jsx(Cn.h2,{id:d.titleId,...o,ref:r})});PL.displayName=n2;var ML="DialogDescription",IL=R.forwardRef((e,r)=>{const{__scopeDialog:s,...o}=e,d=ol(ML,s);return u.jsx(Cn.p,{id:d.descriptionId,...o,ref:r})});IL.displayName=ML;var zL="DialogClose",LL=R.forwardRef((e,r)=>{const{__scopeDialog:s,...o}=e,d=ol(zL,s);return u.jsx(Cn.button,{type:"button",...o,ref:r,onClick:$t(e.onClick,()=>d.onOpenChange(!1))})});LL.displayName=zL;function r2(e){return e?"open":"closed"}var FL="DialogTitleWarning",[aae,qL]=pne(FL,{contentName:kp,titleName:n2,docsSlug:"dialog"}),oae=({titleId:e})=>{const r=qL(FL),s=`\`${r.contentName}\` requires a \`${r.titleName}\` for the component to be accessible for screen reader users. +`)},Bie=0,Hm=[];function Uie(e){var r=R.useRef([]),s=R.useRef([0,0]),o=R.useRef(),d=R.useState(Bie++)[0],p=R.useState(wz)[0],m=R.useRef(e);R.useEffect(function(){m.current=e},[e]),R.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(d));var I=uie([e.lockRef.current],(e.shards||[]).map(CI),!0).filter(Boolean);return I.forEach(function(q){return q.classList.add("allow-interactivity-".concat(d))}),function(){document.body.classList.remove("block-interactivity-".concat(d)),I.forEach(function(q){return q.classList.remove("allow-interactivity-".concat(d))})}}},[e.inert,e.lockRef.current,e.shards]);var g=R.useCallback(function(I,q){if("touches"in I&&I.touches.length===2||I.type==="wheel"&&I.ctrlKey)return!m.current.allowPinchZoom;var G=YE(I),K=s.current,X="deltaX"in I?I.deltaX:K[0]-G[0],L="deltaY"in I?I.deltaY:K[1]-G[1],ee,oe=I.target,Q=Math.abs(X)>Math.abs(L)?"h":"v";if("touches"in I&&Q==="h"&&oe.type==="range")return!1;var ne=window.getSelection(),de=ne&&ne.anchorNode,je=de?de===oe||de.contains(oe):!1;if(je)return!1;var ve=EI(Q,oe);if(!ve)return!0;if(ve?ee=Q:(ee=Q==="v"?"h":"v",ve=EI(Q,oe)),!ve)return!1;if(!o.current&&"changedTouches"in I&&(X||L)&&(o.current=ee),!ee)return!0;var le=o.current||ee;return zie(le,q,I,le==="h"?X:L)},[]),b=R.useCallback(function(I){var q=I;if(!(!Hm.length||Hm[Hm.length-1]!==p)){var G="deltaY"in q?jI(q):YE(q),K=r.current.filter(function(ee){return ee.name===q.type&&(ee.target===q.target||q.target===ee.shadowParent)&&Fie(ee.delta,G)})[0];if(K&&K.should){q.cancelable&&q.preventDefault();return}if(!K){var X=(m.current.shards||[]).map(CI).filter(Boolean).filter(function(ee){return ee.contains(q.target)}),L=X.length>0?g(q,X[0]):!m.current.noIsolation;L&&q.cancelable&&q.preventDefault()}}},[]),S=R.useCallback(function(I,q,G,K){var X={name:I,delta:q,target:G,should:K,shadowParent:Kie(G)};r.current.push(X),setTimeout(function(){r.current=r.current.filter(function(L){return L!==X})},1)},[]),j=R.useCallback(function(I){s.current=YE(I),o.current=void 0},[]),A=R.useCallback(function(I){S(I.type,jI(I),I.target,g(I,e.lockRef.current))},[]),k=R.useCallback(function(I){S(I.type,YE(I),I.target,g(I,e.lockRef.current))},[]);R.useEffect(function(){return Hm.push(p),e.setCallbacks({onScrollCapture:A,onWheelCapture:A,onTouchMoveCapture:k}),document.addEventListener("wheel",b,Vm),document.addEventListener("touchmove",b,Vm),document.addEventListener("touchstart",j,Vm),function(){Hm=Hm.filter(function(I){return I!==p}),document.removeEventListener("wheel",b,Vm),document.removeEventListener("touchmove",b,Vm),document.removeEventListener("touchstart",j,Vm)}},[]);var T=e.removeScrollBar,M=e.inert;return R.createElement(R.Fragment,null,M?R.createElement(p,{styles:qie(d)}):null,T?R.createElement($ie,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Kie(e){for(var r=null;e!==null;)e instanceof ShadowRoot&&(r=e.host,e=e.host),e=e.parentNode;return r}const Vie=xie(bz,Uie);var ow=R.forwardRef(function(e,r){return R.createElement(kC,nc({},e,{ref:r,sideCar:Vie}))});ow.classNames=kC.classNames;var Hie=function(e){if(typeof document>"u")return null;var r=Array.isArray(e)?e[0]:e;return r.ownerDocument.body},Gm=new WeakMap,ZE=new WeakMap,WE={},HR=0,Cz=function(e){return e&&(e.host||Cz(e.parentNode))},Gie=function(e,r){return r.map(function(s){if(e.contains(s))return s;var o=Cz(s);return o&&e.contains(o)?o:(console.error("aria-hidden",s,"in not contained inside",e,". Doing nothing"),null)}).filter(function(s){return!!s})},Xie=function(e,r,s,o){var d=Gie(r,Array.isArray(e)?e:[e]);WE[s]||(WE[s]=new WeakMap);var p=WE[s],m=[],g=new Set,b=new Set(d),S=function(A){!A||g.has(A)||(g.add(A),S(A.parentNode))};d.forEach(S);var j=function(A){!A||b.has(A)||Array.prototype.forEach.call(A.children,function(k){if(g.has(k))j(k);else try{var T=k.getAttribute(o),M=T!==null&&T!=="false",I=(Gm.get(k)||0)+1,q=(p.get(k)||0)+1;Gm.set(k,I),p.set(k,q),m.push(k),I===1&&M&&ZE.set(k,!0),q===1&&k.setAttribute(s,"true"),M||k.setAttribute(o,"true")}catch(G){console.error("aria-hidden: cannot operate on ",k,G)}})};return j(r),g.clear(),HR++,function(){m.forEach(function(A){var k=Gm.get(A)-1,T=p.get(A)-1;Gm.set(A,k),p.set(A,T),k||(ZE.has(A)||A.removeAttribute(o),ZE.delete(A)),T||A.removeAttribute(s)}),HR--,HR||(Gm=new WeakMap,Gm=new WeakMap,ZE=new WeakMap,WE={})}},RC=function(e,r,s){s===void 0&&(s="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),d=Hie(e);return d?(o.push.apply(o,Array.from(d.querySelectorAll("[aria-live], script"))),Xie(o,d,s,"aria-hidden")):function(){return null}};function Yie(e){const r=Zie(e),s=R.forwardRef((o,d)=>{const{children:p,...m}=o,g=R.Children.toArray(p),b=g.find(Jie);if(b){const S=b.props.children,j=g.map(A=>A===b?R.Children.count(S)>1?R.Children.only(null):R.isValidElement(S)?S.props.children:null:A);return u.jsx(r,{...m,ref:d,children:R.isValidElement(S)?R.cloneElement(S,void 0,j):null})}return u.jsx(r,{...m,ref:d,children:p})});return s.displayName=`${e}.Slot`,s}function Zie(e){const r=R.forwardRef((s,o)=>{const{children:d,...p}=s;if(R.isValidElement(d)){const m=eae(d),g=Qie(p,d.props);return d.type!==R.Fragment&&(g.ref=o?Li(o,m):m),R.cloneElement(d,g)}return R.Children.count(d)>1?R.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var Wie=Symbol("radix.slottable");function Jie(e){return R.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Wie}function Qie(e,r){const s={...r};for(const o in r){const d=e[o],p=r[o];/^on[A-Z]/.test(o)?d&&p?s[o]=(...g)=>{const b=p(...g);return d(...g),b}:d&&(s[o]=d):o==="style"?s[o]={...d,...p}:o==="className"&&(s[o]=[d,p].filter(Boolean).join(" "))}return{...e,...s}}function eae(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning;return s?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var TC="Dialog",[Az,Oz]=al(TC),[tae,ol]=Az(TC),kz=e=>{const{__scopeDialog:r,children:s,open:o,defaultOpen:d,onOpenChange:p,modal:m=!0}=e,g=R.useRef(null),b=R.useRef(null),[S,j]=qd({prop:o,defaultProp:d??!1,onChange:p,caller:TC});return u.jsx(tae,{scope:r,triggerRef:g,contentRef:b,contentId:Vs(),titleId:Vs(),descriptionId:Vs(),open:S,onOpenChange:j,onOpenToggle:R.useCallback(()=>j(A=>!A),[j]),modal:m,children:s})};kz.displayName=TC;var Rz="DialogTrigger",Tz=R.forwardRef((e,r)=>{const{__scopeDialog:s,...o}=e,d=ol(Rz,s),p=zn(r,d.triggerRef);return u.jsx(Cn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":d.open,"aria-controls":d.contentId,"data-state":s2(d.open),...o,ref:p,onClick:$t(e.onClick,d.onOpenToggle)})});Tz.displayName=Rz;var n2="DialogPortal",[nae,_z]=Az(n2,{forceMount:void 0}),$z=e=>{const{__scopeDialog:r,forceMount:s,children:o,container:d}=e,p=ol(n2,r);return u.jsx(nae,{scope:r,forceMount:s,children:R.Children.map(o,m=>u.jsx(lo,{present:s||p.open,children:u.jsx(_g,{asChild:!0,container:d,children:m})}))})};$z.displayName=n2;var Bj="DialogOverlay",Nz=R.forwardRef((e,r)=>{const s=_z(Bj,e.__scopeDialog),{forceMount:o=s.forceMount,...d}=e,p=ol(Bj,e.__scopeDialog);return p.modal?u.jsx(lo,{present:o||p.open,children:u.jsx(sae,{...d,ref:r})}):null});Nz.displayName=Bj;var rae=Yie("DialogOverlay.RemoveScroll"),sae=R.forwardRef((e,r)=>{const{__scopeDialog:s,...o}=e,d=ol(Bj,s);return u.jsx(ow,{as:rae,allowPinchZoom:!0,shards:[d.contentRef],children:u.jsx(Cn.div,{"data-state":s2(d.open),...o,ref:r,style:{pointerEvents:"auto",...o.style}})})}),kp="DialogContent",Dz=R.forwardRef((e,r)=>{const s=_z(kp,e.__scopeDialog),{forceMount:o=s.forceMount,...d}=e,p=ol(kp,e.__scopeDialog);return u.jsx(lo,{present:o||p.open,children:p.modal?u.jsx(iae,{...d,ref:r}):u.jsx(aae,{...d,ref:r})})});Dz.displayName=kp;var iae=R.forwardRef((e,r)=>{const s=ol(kp,e.__scopeDialog),o=R.useRef(null),d=zn(r,s.contentRef,o);return R.useEffect(()=>{const p=o.current;if(p)return RC(p)},[]),u.jsx(Pz,{...e,ref:d,trapFocus:s.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:$t(e.onCloseAutoFocus,p=>{p.preventDefault(),s.triggerRef.current?.focus()}),onPointerDownOutside:$t(e.onPointerDownOutside,p=>{const m=p.detail.originalEvent,g=m.button===0&&m.ctrlKey===!0;(m.button===2||g)&&p.preventDefault()}),onFocusOutside:$t(e.onFocusOutside,p=>p.preventDefault())})}),aae=R.forwardRef((e,r)=>{const s=ol(kp,e.__scopeDialog),o=R.useRef(!1),d=R.useRef(!1);return u.jsx(Pz,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:p=>{e.onCloseAutoFocus?.(p),p.defaultPrevented||(o.current||s.triggerRef.current?.focus(),p.preventDefault()),o.current=!1,d.current=!1},onInteractOutside:p=>{e.onInteractOutside?.(p),p.defaultPrevented||(o.current=!0,p.detail.originalEvent.type==="pointerdown"&&(d.current=!0));const m=p.target;s.triggerRef.current?.contains(m)&&p.preventDefault(),p.detail.originalEvent.type==="focusin"&&d.current&&p.preventDefault()}})}),Pz=R.forwardRef((e,r)=>{const{__scopeDialog:s,trapFocus:o,onOpenAutoFocus:d,onCloseAutoFocus:p,...m}=e,g=ol(kp,s),b=R.useRef(null),S=zn(r,b);return OC(),u.jsxs(u.Fragment,{children:[u.jsx(aw,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:d,onUnmountAutoFocus:p,children:u.jsx(kg,{role:"dialog",id:g.contentId,"aria-describedby":g.descriptionId,"aria-labelledby":g.titleId,"data-state":s2(g.open),...m,ref:S,onDismiss:()=>g.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(lae,{titleId:g.titleId}),u.jsx(uae,{contentRef:b,descriptionId:g.descriptionId})]})]})}),r2="DialogTitle",Mz=R.forwardRef((e,r)=>{const{__scopeDialog:s,...o}=e,d=ol(r2,s);return u.jsx(Cn.h2,{id:d.titleId,...o,ref:r})});Mz.displayName=r2;var Iz="DialogDescription",Lz=R.forwardRef((e,r)=>{const{__scopeDialog:s,...o}=e,d=ol(Iz,s);return u.jsx(Cn.p,{id:d.descriptionId,...o,ref:r})});Lz.displayName=Iz;var zz="DialogClose",Fz=R.forwardRef((e,r)=>{const{__scopeDialog:s,...o}=e,d=ol(zz,s);return u.jsx(Cn.button,{type:"button",...o,ref:r,onClick:$t(e.onClick,()=>d.onOpenChange(!1))})});Fz.displayName=zz;function s2(e){return e?"open":"closed"}var qz="DialogTitleWarning",[oae,Bz]=fne(qz,{contentName:kp,titleName:r2,docsSlug:"dialog"}),lae=({titleId:e})=>{const r=Bz(qz),s=`\`${r.contentName}\` requires a \`${r.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${r.titleName}\`, you can wrap it with our VisuallyHidden component. -For more information, see https://radix-ui.com/primitives/docs/components/${r.docsSlug}`;return R.useEffect(()=>{e&&(document.getElementById(e)||console.error(s))},[s,e]),null},lae="DialogDescriptionWarning",cae=({contentRef:e,descriptionId:r})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${qL(lae).contentName}}.`;return R.useEffect(()=>{const d=e.current?.getAttribute("aria-describedby");r&&d&&(document.getElementById(r)||console.warn(o))},[o,e,r]),null},_C=OL,BL=RL,$C=_L,NC=$L,DC=NL,s2=PL,i2=IL,cw=LL,uae=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Gd=uae.reduce((e,r)=>{const s=tw(`Primitive.${r}`),o=R.forwardRef((d,p)=>{const{asChild:m,...g}=d,b=m?s:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(b,{...g,ref:p})});return o.displayName=`Primitive.${r}`,{...e,[r]:o}},{}),sb='[cmdk-group=""]',GR='[cmdk-group-items=""]',dae='[cmdk-group-heading=""]',UL='[cmdk-item=""]',CI=`${UL}:not([aria-disabled="true"])`,BT="cmdk-item-select",Zm="data-value",hae=(e,r,s)=>tie(e,r,s),KL=R.createContext(void 0),uw=()=>R.useContext(KL),VL=R.createContext(void 0),a2=()=>R.useContext(VL),HL=R.createContext(void 0),GL=R.forwardRef((e,r)=>{let s=Wm(()=>{var Oe,ke;return{search:"",value:(ke=(Oe=e.value)!=null?Oe:e.defaultValue)!=null?ke:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),o=Wm(()=>new Set),d=Wm(()=>new Map),p=Wm(()=>new Map),m=Wm(()=>new Set),g=XL(e),{label:b,children:S,value:E,onValueChange:A,filter:k,shouldFilter:T,loop:M,disablePointerSelection:I=!1,vimBindings:q=!0,...G}=e,K=Vs(),X=Vs(),z=Vs(),ee=R.useRef(null),oe=Eae();Rp(()=>{if(E!==void 0){let Oe=E.trim();s.current.value=Oe,Q.emit()}},[E]),Rp(()=>{oe(6,be)},[]);let Q=R.useMemo(()=>({subscribe:Oe=>(m.current.add(Oe),()=>m.current.delete(Oe)),snapshot:()=>s.current,setState:(Oe,ke,Ve)=>{var ie,Ne,ze,tt;if(!Object.is(s.current[Oe],ke)){if(s.current[Oe]=ke,Oe==="search")le(),Ce(),oe(1,xe);else if(Oe==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ft=document.getElementById(z);ft?ft.focus():(ie=document.getElementById(K))==null||ie.focus()}if(oe(7,()=>{var ft;s.current.selectedItemId=(ft=je())==null?void 0:ft.id,Q.emit()}),Ve||oe(5,be),((Ne=g.current)==null?void 0:Ne.value)!==void 0){let ft=ke??"";(tt=(ze=g.current).onValueChange)==null||tt.call(ze,ft);return}}Q.emit()}},emit:()=>{m.current.forEach(Oe=>Oe())}}),[]),ne=R.useMemo(()=>({value:(Oe,ke,Ve)=>{var ie;ke!==((ie=p.current.get(Oe))==null?void 0:ie.value)&&(p.current.set(Oe,{value:ke,keywords:Ve}),s.current.filtered.items.set(Oe,de(ke,Ve)),oe(2,()=>{Ce(),Q.emit()}))},item:(Oe,ke)=>(o.current.add(Oe),ke&&(d.current.has(ke)?d.current.get(ke).add(Oe):d.current.set(ke,new Set([Oe]))),oe(3,()=>{le(),Ce(),s.current.value||xe(),Q.emit()}),()=>{p.current.delete(Oe),o.current.delete(Oe),s.current.filtered.items.delete(Oe);let Ve=je();oe(4,()=>{le(),Ve?.getAttribute("id")===Oe&&xe(),Q.emit()})}),group:Oe=>(d.current.has(Oe)||d.current.set(Oe,new Set),()=>{p.current.delete(Oe),d.current.delete(Oe)}),filter:()=>g.current.shouldFilter,label:b||e["aria-label"],getDisablePointerSelection:()=>g.current.disablePointerSelection,listId:K,inputId:z,labelId:X,listInnerRef:ee}),[]);function de(Oe,ke){var Ve,ie;let Ne=(ie=(Ve=g.current)==null?void 0:Ve.filter)!=null?ie:hae;return Oe?Ne(Oe,s.current.search,ke):0}function Ce(){if(!s.current.search||g.current.shouldFilter===!1)return;let Oe=s.current.filtered.items,ke=[];s.current.filtered.groups.forEach(ie=>{let Ne=d.current.get(ie),ze=0;Ne.forEach(tt=>{let ft=Oe.get(tt);ze=Math.max(ft,ze)}),ke.push([ie,ze])});let Ve=ee.current;Ke().sort((ie,Ne)=>{var ze,tt;let ft=ie.getAttribute("id"),Ot=Ne.getAttribute("id");return((ze=Oe.get(Ot))!=null?ze:0)-((tt=Oe.get(ft))!=null?tt:0)}).forEach(ie=>{let Ne=ie.closest(GR);Ne?Ne.appendChild(ie.parentElement===Ne?ie:ie.closest(`${GR} > *`)):Ve.appendChild(ie.parentElement===Ve?ie:ie.closest(`${GR} > *`))}),ke.sort((ie,Ne)=>Ne[1]-ie[1]).forEach(ie=>{var Ne;let ze=(Ne=ee.current)==null?void 0:Ne.querySelector(`${sb}[${Zm}="${encodeURIComponent(ie[0])}"]`);ze?.parentElement.appendChild(ze)})}function xe(){let Oe=Ke().find(Ve=>Ve.getAttribute("aria-disabled")!=="true"),ke=Oe?.getAttribute(Zm);Q.setState("value",ke||void 0)}function le(){var Oe,ke,Ve,ie;if(!s.current.search||g.current.shouldFilter===!1){s.current.filtered.count=o.current.size;return}s.current.filtered.groups=new Set;let Ne=0;for(let ze of o.current){let tt=(ke=(Oe=p.current.get(ze))==null?void 0:Oe.value)!=null?ke:"",ft=(ie=(Ve=p.current.get(ze))==null?void 0:Ve.keywords)!=null?ie:[],Ot=de(tt,ft);s.current.filtered.items.set(ze,Ot),Ot>0&&Ne++}for(let[ze,tt]of d.current)for(let ft of tt)if(s.current.filtered.items.get(ft)>0){s.current.filtered.groups.add(ze);break}s.current.filtered.count=Ne}function be(){var Oe,ke,Ve;let ie=je();ie&&(((Oe=ie.parentElement)==null?void 0:Oe.firstChild)===ie&&((Ve=(ke=ie.closest(sb))==null?void 0:ke.querySelector(dae))==null||Ve.scrollIntoView({block:"nearest"})),ie.scrollIntoView({block:"nearest"}))}function je(){var Oe;return(Oe=ee.current)==null?void 0:Oe.querySelector(`${UL}[aria-selected="true"]`)}function Ke(){var Oe;return Array.from(((Oe=ee.current)==null?void 0:Oe.querySelectorAll(CI))||[])}function ce(Oe){let ke=Ke()[Oe];ke&&Q.setState("value",ke.getAttribute(Zm))}function re(Oe){var ke;let Ve=je(),ie=Ke(),Ne=ie.findIndex(tt=>tt===Ve),ze=ie[Ne+Oe];(ke=g.current)!=null&&ke.loop&&(ze=Ne+Oe<0?ie[ie.length-1]:Ne+Oe===ie.length?ie[0]:ie[Ne+Oe]),ze&&Q.setState("value",ze.getAttribute(Zm))}function ue(Oe){let ke=je(),Ve=ke?.closest(sb),ie;for(;Ve&&!ie;)Ve=Oe>0?wae(Ve,sb):Sae(Ve,sb),ie=Ve?.querySelector(CI);ie?Q.setState("value",ie.getAttribute(Zm)):re(Oe)}let _e=()=>ce(Ke().length-1),fe=Oe=>{Oe.preventDefault(),Oe.metaKey?_e():Oe.altKey?ue(1):re(1)},He=Oe=>{Oe.preventDefault(),Oe.metaKey?ce(0):Oe.altKey?ue(-1):re(-1)};return R.createElement(Gd.div,{ref:r,tabIndex:-1,...G,"cmdk-root":"",onKeyDown:Oe=>{var ke;(ke=G.onKeyDown)==null||ke.call(G,Oe);let Ve=Oe.nativeEvent.isComposing||Oe.keyCode===229;if(!(Oe.defaultPrevented||Ve))switch(Oe.key){case"n":case"j":{q&&Oe.ctrlKey&&fe(Oe);break}case"ArrowDown":{fe(Oe);break}case"p":case"k":{q&&Oe.ctrlKey&&He(Oe);break}case"ArrowUp":{He(Oe);break}case"Home":{Oe.preventDefault(),ce(0);break}case"End":{Oe.preventDefault(),_e();break}case"Enter":{Oe.preventDefault();let ie=je();if(ie){let Ne=new Event(BT);ie.dispatchEvent(Ne)}}}}},R.createElement("label",{"cmdk-label":"",htmlFor:ne.inputId,id:ne.labelId,style:Cae},b),PC(e,Oe=>R.createElement(VL.Provider,{value:Q},R.createElement(KL.Provider,{value:ne},Oe))))}),pae=R.forwardRef((e,r)=>{var s,o;let d=Vs(),p=R.useRef(null),m=R.useContext(HL),g=uw(),b=XL(e),S=(o=(s=b.current)==null?void 0:s.forceMount)!=null?o:m?.forceMount;Rp(()=>{if(!S)return g.item(d,m?.id)},[S]);let E=YL(d,p,[e.value,e.children,p],e.keywords),A=a2(),k=Bd(oe=>oe.value&&oe.value===E.current),T=Bd(oe=>S||g.filter()===!1?!0:oe.search?oe.filtered.items.get(d)>0:!0);R.useEffect(()=>{let oe=p.current;if(!(!oe||e.disabled))return oe.addEventListener(BT,M),()=>oe.removeEventListener(BT,M)},[T,e.onSelect,e.disabled]);function M(){var oe,Q;I(),(Q=(oe=b.current).onSelect)==null||Q.call(oe,E.current)}function I(){A.setState("value",E.current,!0)}if(!T)return null;let{disabled:q,value:G,onSelect:K,forceMount:X,keywords:z,...ee}=e;return R.createElement(Gd.div,{ref:zi(p,r),...ee,id:d,"cmdk-item":"",role:"option","aria-disabled":!!q,"aria-selected":!!k,"data-disabled":!!q,"data-selected":!!k,onPointerMove:q||g.getDisablePointerSelection()?void 0:I,onClick:q?void 0:M},e.children)}),fae=R.forwardRef((e,r)=>{let{heading:s,children:o,forceMount:d,...p}=e,m=Vs(),g=R.useRef(null),b=R.useRef(null),S=Vs(),E=uw(),A=Bd(T=>d||E.filter()===!1?!0:T.search?T.filtered.groups.has(m):!0);Rp(()=>E.group(m),[]),YL(m,g,[e.value,e.heading,b]);let k=R.useMemo(()=>({id:m,forceMount:d}),[d]);return R.createElement(Gd.div,{ref:zi(g,r),...p,"cmdk-group":"",role:"presentation",hidden:A?void 0:!0},s&&R.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:S},s),PC(e,T=>R.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":s?S:void 0},R.createElement(HL.Provider,{value:k},T))))}),mae=R.forwardRef((e,r)=>{let{alwaysRender:s,...o}=e,d=R.useRef(null),p=Bd(m=>!m.search);return!s&&!p?null:R.createElement(Gd.div,{ref:zi(d,r),...o,"cmdk-separator":"",role:"separator"})}),gae=R.forwardRef((e,r)=>{let{onValueChange:s,...o}=e,d=e.value!=null,p=a2(),m=Bd(S=>S.search),g=Bd(S=>S.selectedItemId),b=uw();return R.useEffect(()=>{e.value!=null&&p.setState("search",e.value)},[e.value]),R.createElement(Gd.input,{ref:r,...o,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":g,id:b.inputId,type:"text",value:d?e.value:m,onChange:S=>{d||p.setState("search",S.target.value),s?.(S.target.value)}})}),yae=R.forwardRef((e,r)=>{let{children:s,label:o="Suggestions",...d}=e,p=R.useRef(null),m=R.useRef(null),g=Bd(S=>S.selectedItemId),b=uw();return R.useEffect(()=>{if(m.current&&p.current){let S=m.current,E=p.current,A,k=new ResizeObserver(()=>{A=requestAnimationFrame(()=>{let T=S.offsetHeight;E.style.setProperty("--cmdk-list-height",T.toFixed(1)+"px")})});return k.observe(S),()=>{cancelAnimationFrame(A),k.unobserve(S)}}},[]),R.createElement(Gd.div,{ref:zi(p,r),...d,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":g,"aria-label":o,id:b.listId},PC(e,S=>R.createElement("div",{ref:zi(m,b.listInnerRef),"cmdk-list-sizer":""},S)))}),vae=R.forwardRef((e,r)=>{let{open:s,onOpenChange:o,overlayClassName:d,contentClassName:p,container:m,...g}=e;return R.createElement(_C,{open:s,onOpenChange:o},R.createElement($C,{container:m},R.createElement(NC,{"cmdk-overlay":"",className:d}),R.createElement(DC,{"aria-label":e.label,"cmdk-dialog":"",className:p},R.createElement(GL,{ref:r,...g}))))}),xae=R.forwardRef((e,r)=>Bd(s=>s.filtered.count===0)?R.createElement(Gd.div,{ref:r,...e,"cmdk-empty":"",role:"presentation"}):null),bae=R.forwardRef((e,r)=>{let{progress:s,children:o,label:d="Loading...",...p}=e;return R.createElement(Gd.div,{ref:r,...p,"cmdk-loading":"",role:"progressbar","aria-valuenow":s,"aria-valuemin":0,"aria-valuemax":100,"aria-label":d},PC(e,m=>R.createElement("div",{"aria-hidden":!0},m)))}),$g=Object.assign(GL,{List:yae,Item:pae,Input:gae,Group:fae,Separator:mae,Dialog:vae,Empty:xae,Loading:bae});function wae(e,r){let s=e.nextElementSibling;for(;s;){if(s.matches(r))return s;s=s.nextElementSibling}}function Sae(e,r){let s=e.previousElementSibling;for(;s;){if(s.matches(r))return s;s=s.previousElementSibling}}function XL(e){let r=R.useRef(e);return Rp(()=>{r.current=e}),r}var Rp=typeof window>"u"?R.useEffect:R.useLayoutEffect;function Wm(e){let r=R.useRef();return r.current===void 0&&(r.current=e()),r}function Bd(e){let r=a2(),s=()=>e(r.snapshot());return R.useSyncExternalStore(r.subscribe,s,s)}function YL(e,r,s,o=[]){let d=R.useRef(),p=uw();return Rp(()=>{var m;let g=(()=>{var S;for(let E of s){if(typeof E=="string")return E.trim();if(typeof E=="object"&&"current"in E)return E.current?(S=E.current.textContent)==null?void 0:S.trim():d.current}})(),b=o.map(S=>S.trim());p.value(e,g,b),(m=r.current)==null||m.setAttribute(Zm,g),d.current=g}),d}var Eae=()=>{let[e,r]=R.useState(),s=Wm(()=>new Map);return Rp(()=>{s.current.forEach(o=>o()),s.current=new Map},[e]),(o,d)=>{s.current.set(o,d),r({})}};function jae(e){let r=e.type;return typeof r=="function"?r(e.props):"render"in r?r.render(e.props):e}function PC({asChild:e,children:r},s){return e&&R.isValidElement(r)?R.cloneElement(jae(r),{ref:r.ref},s(r.props.children)):s(r)}var Cae={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function fn({...e}){return u.jsx(_C,{"data-slot":"dialog",...e})}function Li({...e}){return u.jsx(BL,{"data-slot":"dialog-trigger",...e})}function Aae({...e}){return u.jsx($C,{"data-slot":"dialog-portal",...e})}function Kj({...e}){return u.jsx(cw,{"data-slot":"dialog-close",...e})}function Oae({className:e,...r}){return u.jsx(NC,{"data-slot":"dialog-overlay",className:ht("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...r})}function mn({className:e,children:r,showCloseButton:s=!0,...o}){return u.jsxs(Aae,{"data-slot":"dialog-portal",children:[u.jsx(Oae,{}),u.jsxs(DC,{"data-slot":"dialog-content",className:ht("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...o,children:[r,s&&u.jsxs(cw,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[u.jsx(F_,{}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function gn({className:e,...r}){return u.jsx("div",{"data-slot":"dialog-header",className:ht("flex flex-col gap-2 text-center sm:text-left",e),...r})}function Sn({className:e,...r}){return u.jsx("div",{"data-slot":"dialog-footer",className:ht("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r})}function yn({className:e,...r}){return u.jsx(s2,{"data-slot":"dialog-title",className:ht("text-lg leading-none font-semibold",e),...r})}function XR({className:e,...r}){return u.jsx(i2,{"data-slot":"dialog-description",className:ht("text-muted-foreground text-sm",e),...r})}function kae({className:e,...r}){return u.jsx($g,{"data-slot":"command",className:ht("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...r})}function Rae({className:e,...r}){return u.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[u.jsx(Pa,{className:"size-4 shrink-0 opacity-50"}),u.jsx($g.Input,{"data-slot":"command-input",className:ht("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...r})]})}function Tae({className:e,...r}){return u.jsx($g.List,{"data-slot":"command-list",className:ht("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...r})}function _ae({...e}){return u.jsx($g.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function $ae({className:e,...r}){return u.jsx($g.Group,{"data-slot":"command-group",className:ht("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...r})}function Nae({className:e,...r}){return u.jsx($g.Item,{"data-slot":"command-item",className:ht("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function Dae(e){const r=Pae(e),s=R.forwardRef((o,d)=>{const{children:p,...m}=o,g=R.Children.toArray(p),b=g.find(Iae);if(b){const S=b.props.children,E=g.map(A=>A===b?R.Children.count(S)>1?R.Children.only(null):R.isValidElement(S)?S.props.children:null:A);return u.jsx(r,{...m,ref:d,children:R.isValidElement(S)?R.cloneElement(S,void 0,E):null})}return u.jsx(r,{...m,ref:d,children:p})});return s.displayName=`${e}.Slot`,s}function Pae(e){const r=R.forwardRef((s,o)=>{const{children:d,...p}=s;if(R.isValidElement(d)){const m=Lae(d),g=zae(p,d.props);return d.type!==R.Fragment&&(g.ref=o?zi(o,m):m),R.cloneElement(d,g)}return R.Children.count(d)>1?R.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var Mae=Symbol("radix.slottable");function Iae(e){return R.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Mae}function zae(e,r){const s={...r};for(const o in r){const d=e[o],p=r[o];/^on[A-Z]/.test(o)?d&&p?s[o]=(...g)=>{const b=p(...g);return d(...g),b}:d&&(s[o]=d):o==="style"?s[o]={...d,...p}:o==="className"&&(s[o]=[d,p].filter(Boolean).join(" "))}return{...e,...s}}function Lae(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning;return s?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var MC="Popover",[ZL]=al(MC,[Hd]),dw=Hd(),[Fae,Xd]=ZL(MC),WL=e=>{const{__scopePopover:r,children:s,open:o,defaultOpen:d,onOpenChange:p,modal:m=!1}=e,g=dw(r),b=R.useRef(null),[S,E]=R.useState(!1),[A,k]=qd({prop:o,defaultProp:d??!1,onChange:p,caller:MC});return u.jsx(SC,{...g,children:u.jsx(Fae,{scope:r,contentId:Vs(),triggerRef:b,open:A,onOpenChange:k,onOpenToggle:R.useCallback(()=>k(T=>!T),[k]),hasCustomAnchor:S,onCustomAnchorAdd:R.useCallback(()=>E(!0),[]),onCustomAnchorRemove:R.useCallback(()=>E(!1),[]),modal:m,children:s})})};WL.displayName=MC;var JL="PopoverAnchor",qae=R.forwardRef((e,r)=>{const{__scopePopover:s,...o}=e,d=Xd(JL,s),p=dw(s),{onCustomAnchorAdd:m,onCustomAnchorRemove:g}=d;return R.useEffect(()=>(m(),()=>g()),[m,g]),u.jsx(rw,{...p,...o,ref:r})});qae.displayName=JL;var QL="PopoverTrigger",e5=R.forwardRef((e,r)=>{const{__scopePopover:s,...o}=e,d=Xd(QL,s),p=dw(s),m=Ln(r,d.triggerRef),g=u.jsx(Cn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":d.open,"aria-controls":d.contentId,"data-state":i5(d.open),...o,ref:m,onClick:$t(e.onClick,d.onOpenToggle)});return d.hasCustomAnchor?g:u.jsx(rw,{asChild:!0,...p,children:g})});e5.displayName=QL;var o2="PopoverPortal",[Bae,Uae]=ZL(o2,{forceMount:void 0}),t5=e=>{const{__scopePopover:r,forceMount:s,children:o,container:d}=e,p=Xd(o2,r);return u.jsx(Bae,{scope:r,forceMount:s,children:u.jsx(co,{present:s||p.open,children:u.jsx(_g,{asChild:!0,container:d,children:o})})})};t5.displayName=o2;var bg="PopoverContent",n5=R.forwardRef((e,r)=>{const s=Uae(bg,e.__scopePopover),{forceMount:o=s.forceMount,...d}=e,p=Xd(bg,e.__scopePopover);return u.jsx(co,{present:o||p.open,children:p.modal?u.jsx(Vae,{...d,ref:r}):u.jsx(Hae,{...d,ref:r})})});n5.displayName=bg;var Kae=Dae("PopoverContent.RemoveScroll"),Vae=R.forwardRef((e,r)=>{const s=Xd(bg,e.__scopePopover),o=R.useRef(null),d=Ln(r,o),p=R.useRef(!1);return R.useEffect(()=>{const m=o.current;if(m)return RC(m)},[]),u.jsx(lw,{as:Kae,allowPinchZoom:!0,children:u.jsx(r5,{...e,ref:d,trapFocus:s.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:$t(e.onCloseAutoFocus,m=>{m.preventDefault(),p.current||s.triggerRef.current?.focus()}),onPointerDownOutside:$t(e.onPointerDownOutside,m=>{const g=m.detail.originalEvent,b=g.button===0&&g.ctrlKey===!0,S=g.button===2||b;p.current=S},{checkForDefaultPrevented:!1}),onFocusOutside:$t(e.onFocusOutside,m=>m.preventDefault(),{checkForDefaultPrevented:!1})})})}),Hae=R.forwardRef((e,r)=>{const s=Xd(bg,e.__scopePopover),o=R.useRef(!1),d=R.useRef(!1);return u.jsx(r5,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:p=>{e.onCloseAutoFocus?.(p),p.defaultPrevented||(o.current||s.triggerRef.current?.focus(),p.preventDefault()),o.current=!1,d.current=!1},onInteractOutside:p=>{e.onInteractOutside?.(p),p.defaultPrevented||(o.current=!0,p.detail.originalEvent.type==="pointerdown"&&(d.current=!0));const m=p.target;s.triggerRef.current?.contains(m)&&p.preventDefault(),p.detail.originalEvent.type==="focusin"&&d.current&&p.preventDefault()}})}),r5=R.forwardRef((e,r)=>{const{__scopePopover:s,trapFocus:o,onOpenAutoFocus:d,onCloseAutoFocus:p,disableOutsidePointerEvents:m,onEscapeKeyDown:g,onPointerDownOutside:b,onFocusOutside:S,onInteractOutside:E,...A}=e,k=Xd(bg,s),T=dw(s);return OC(),u.jsx(ow,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:d,onUnmountAutoFocus:p,children:u.jsx(kg,{asChild:!0,disableOutsidePointerEvents:m,onInteractOutside:E,onEscapeKeyDown:g,onPointerDownOutside:b,onFocusOutside:S,onDismiss:()=>k.onOpenChange(!1),children:u.jsx(EC,{"data-state":i5(k.open),role:"dialog",id:k.contentId,...T,...A,ref:r,style:{...A.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),s5="PopoverClose",Gae=R.forwardRef((e,r)=>{const{__scopePopover:s,...o}=e,d=Xd(s5,s);return u.jsx(Cn.button,{type:"button",...o,ref:r,onClick:$t(e.onClick,()=>d.onOpenChange(!1))})});Gae.displayName=s5;var Xae="PopoverArrow",Yae=R.forwardRef((e,r)=>{const{__scopePopover:s,...o}=e,d=dw(s);return u.jsx(jC,{...d,...o,ref:r})});Yae.displayName=Xae;function i5(e){return e?"open":"closed"}var Zae=WL,Wae=e5,Jae=t5,Qae=n5;function eoe({...e}){return u.jsx(Zae,{"data-slot":"popover",...e})}function toe({...e}){return u.jsx(Wae,{"data-slot":"popover-trigger",...e})}function noe({className:e,align:r="center",sideOffset:s=4,...o}){return u.jsx(Jae,{children:u.jsx(Qae,{"data-slot":"popover-content",align:r,sideOffset:s,className:ht("bg-popover text-popover-foreground 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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...o})})}const roe=({orgs:e})=>{const[r,s]=R.useState(!1),[o,d]=R.useState(Qo.get()??"");R.useEffect(()=>Qo.subscribe(m=>d(m??"")),[]);const p=e.find(m=>m.id===o);return u.jsxs(eoe,{open:r,onOpenChange:s,children:[u.jsx(toe,{asChild:!0,children:u.jsxs(Fe,{variant:"ghost",className:"h-9 w-full justify-between px-2","aria-label":"Switch organization",children:[u.jsxs("span",{className:"flex items-center gap-2 truncate",children:[u.jsx(sz,{className:"h-4 w-4"}),u.jsx("span",{className:"truncate",children:p?.name??"Select org"})]}),u.jsx(CZ,{className:"ml-2 h-4 w-4 opacity-50"})]})}),u.jsx(noe,{className:"w-[280px] p-0",align:"start",children:u.jsxs(kae,{children:[u.jsx(Rae,{placeholder:"Search orgs..."}),u.jsxs(Tae,{children:[u.jsx(_ae,{children:"No orgs found."}),u.jsx($ae,{heading:"Organizations",children:e.map(m=>u.jsxs(Nae,{value:m.id,onSelect:g=>{Qo.set(g),s(!1)},children:[u.jsx(iz,{className:ht("mr-2 h-4 w-4",o===m.id?"opacity-100":"opacity-0")}),u.jsx("span",{className:"truncate",children:m.name})]},m.id))})]})]})})]})},a5=R.createContext({});function soe(e){const r=R.useRef(null);return r.current===null&&(r.current=e()),r.current}const l2=typeof window<"u",ioe=l2?R.useLayoutEffect:R.useEffect,c2=R.createContext(null);function u2(e,r){e.indexOf(r)===-1&&e.push(r)}function d2(e,r){const s=e.indexOf(r);s>-1&&e.splice(s,1)}const gu=(e,r,s)=>s>r?r:s{};const yu={},o5=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function l5(e){return typeof e=="object"&&e!==null}const c5=e=>/^0[^.\s]+$/u.test(e);function p2(e){let r;return()=>(r===void 0&&(r=e()),r)}const io=e=>e,aoe=(e,r)=>s=>r(e(s)),hw=(...e)=>e.reduce(aoe),Bb=(e,r,s)=>{const o=r-e;return o===0?1:(s-e)/o};class f2{constructor(){this.subscriptions=[]}add(r){return u2(this.subscriptions,r),()=>d2(this.subscriptions,r)}notify(r,s,o){const d=this.subscriptions.length;if(d)if(d===1)this.subscriptions[0](r,s,o);else for(let p=0;pe*1e3,so=e=>e/1e3;function u5(e,r){return r?e*(1e3/r):0}const d5=(e,r,s)=>(((1-3*s+3*r)*e+(3*s-6*r))*e+3*r)*e,ooe=1e-7,loe=12;function coe(e,r,s,o,d){let p,m,g=0;do m=r+(s-r)/2,p=d5(m,o,d)-e,p>0?s=m:r=m;while(Math.abs(p)>ooe&&++gcoe(p,0,1,e,s);return p=>p===0||p===1?p:d5(d(p),r,o)}const h5=e=>r=>r<=.5?e(2*r)/2:(2-e(2*(1-r)))/2,p5=e=>r=>1-e(1-r),f5=pw(.33,1.53,.69,.99),m2=p5(f5),m5=h5(m2),g5=e=>(e*=2)<1?.5*m2(e):.5*(2-Math.pow(2,-10*(e-1))),g2=e=>1-Math.sin(Math.acos(e)),y5=p5(g2),v5=h5(g2),uoe=pw(.42,0,1,1),doe=pw(0,0,.58,1),x5=pw(.42,0,.58,1),hoe=e=>Array.isArray(e)&&typeof e[0]!="number",b5=e=>Array.isArray(e)&&typeof e[0]=="number",poe={linear:io,easeIn:uoe,easeInOut:x5,easeOut:doe,circIn:g2,circInOut:v5,circOut:y5,backIn:m2,backInOut:m5,backOut:f5,anticipate:g5},foe=e=>typeof e=="string",AI=e=>{if(b5(e)){h2(e.length===4);const[r,s,o,d]=e;return pw(r,s,o,d)}else if(foe(e))return poe[e];return e},ej=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function moe(e,r){let s=new Set,o=new Set,d=!1,p=!1;const m=new WeakSet;let g={delta:0,timestamp:0,isProcessing:!1};function b(E){m.has(E)&&(S.schedule(E),e()),E(g)}const S={schedule:(E,A=!1,k=!1)=>{const M=k&&d?s:o;return A&&m.add(E),M.has(E)||M.add(E),E},cancel:E=>{o.delete(E),m.delete(E)},process:E=>{if(g=E,d){p=!0;return}d=!0,[s,o]=[o,s],s.forEach(b),s.clear(),d=!1,p&&(p=!1,S.process(E))}};return S}const goe=40;function w5(e,r){let s=!1,o=!0;const d={delta:0,timestamp:0,isProcessing:!1},p=()=>s=!0,m=ej.reduce((X,z)=>(X[z]=moe(p),X),{}),{setup:g,read:b,resolveKeyframes:S,preUpdate:E,update:A,preRender:k,render:T,postRender:M}=m,I=()=>{const X=yu.useManualTiming?d.timestamp:performance.now();s=!1,yu.useManualTiming||(d.delta=o?1e3/60:Math.max(Math.min(X-d.timestamp,goe),1)),d.timestamp=X,d.isProcessing=!0,g.process(d),b.process(d),S.process(d),E.process(d),A.process(d),k.process(d),T.process(d),M.process(d),d.isProcessing=!1,s&&r&&(o=!1,e(I))},q=()=>{s=!0,o=!0,d.isProcessing||e(I)};return{schedule:ej.reduce((X,z)=>{const ee=m[z];return X[z]=(oe,Q=!1,ne=!1)=>(s||q(),ee.schedule(oe,Q,ne)),X},{}),cancel:X=>{for(let z=0;z(bj===void 0&&da.set(Us.isProcessing||yu.useManualTiming?Us.timestamp:performance.now()),bj),set:e=>{bj=e,queueMicrotask(yoe)}},S5=e=>r=>typeof r=="string"&&r.startsWith(e),y2=S5("--"),voe=S5("var(--"),v2=e=>voe(e)?xoe.test(e.split("/*")[0].trim()):!1,xoe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Ng={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ub={...Ng,transform:e=>gu(0,1,e)},tj={...Ng,default:1},Tb=e=>Math.round(e*1e5)/1e5,x2=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function boe(e){return e==null}const woe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,b2=(e,r)=>s=>!!(typeof s=="string"&&woe.test(s)&&s.startsWith(e)||r&&!boe(s)&&Object.prototype.hasOwnProperty.call(s,r)),E5=(e,r,s)=>o=>{if(typeof o!="string")return o;const[d,p,m,g]=o.match(x2);return{[e]:parseFloat(d),[r]:parseFloat(p),[s]:parseFloat(m),alpha:g!==void 0?parseFloat(g):1}},Soe=e=>gu(0,255,e),ZR={...Ng,transform:e=>Math.round(Soe(e))},xp={test:b2("rgb","red"),parse:E5("red","green","blue"),transform:({red:e,green:r,blue:s,alpha:o=1})=>"rgba("+ZR.transform(e)+", "+ZR.transform(r)+", "+ZR.transform(s)+", "+Tb(Ub.transform(o))+")"};function Eoe(e){let r="",s="",o="",d="";return e.length>5?(r=e.substring(1,3),s=e.substring(3,5),o=e.substring(5,7),d=e.substring(7,9)):(r=e.substring(1,2),s=e.substring(2,3),o=e.substring(3,4),d=e.substring(4,5),r+=r,s+=s,o+=o,d+=d),{red:parseInt(r,16),green:parseInt(s,16),blue:parseInt(o,16),alpha:d?parseInt(d,16)/255:1}}const UT={test:b2("#"),parse:Eoe,transform:xp.transform},fw=e=>({test:r=>typeof r=="string"&&r.endsWith(e)&&r.split(" ").length===1,parse:parseFloat,transform:r=>`${r}${e}`}),Md=fw("deg"),ac=fw("%"),tn=fw("px"),joe=fw("vh"),Coe=fw("vw"),OI={...ac,parse:e=>ac.parse(e)/100,transform:e=>ac.transform(e*100)},ig={test:b2("hsl","hue"),parse:E5("hue","saturation","lightness"),transform:({hue:e,saturation:r,lightness:s,alpha:o=1})=>"hsla("+Math.round(e)+", "+ac.transform(Tb(r))+", "+ac.transform(Tb(s))+", "+Tb(Ub.transform(o))+")"},ms={test:e=>xp.test(e)||UT.test(e)||ig.test(e),parse:e=>xp.test(e)?xp.parse(e):ig.test(e)?ig.parse(e):UT.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?xp.transform(e):ig.transform(e),getAnimatableNone:e=>{const r=ms.parse(e);return r.alpha=0,ms.transform(r)}},Aoe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Ooe(e){return isNaN(e)&&typeof e=="string"&&(e.match(x2)?.length||0)+(e.match(Aoe)?.length||0)>0}const j5="number",C5="color",koe="var",Roe="var(",kI="${}",Toe=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Kb(e){const r=e.toString(),s=[],o={color:[],number:[],var:[]},d=[];let p=0;const g=r.replace(Toe,b=>(ms.test(b)?(o.color.push(p),d.push(C5),s.push(ms.parse(b))):b.startsWith(Roe)?(o.var.push(p),d.push(koe),s.push(b)):(o.number.push(p),d.push(j5),s.push(parseFloat(b))),++p,kI)).split(kI);return{values:s,split:g,indexes:o,types:d}}function A5(e){return Kb(e).values}function O5(e){const{split:r,types:s}=Kb(e),o=r.length;return d=>{let p="";for(let m=0;mtypeof e=="number"?0:ms.test(e)?ms.getAnimatableNone(e):e;function $oe(e){const r=A5(e);return O5(e)(r.map(_oe))}const Kd={test:Ooe,parse:A5,createTransformer:O5,getAnimatableNone:$oe};function WR(e,r,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?e+(r-e)*6*s:s<1/2?r:s<2/3?e+(r-e)*(2/3-s)*6:e}function Noe({hue:e,saturation:r,lightness:s,alpha:o}){e/=360,r/=100,s/=100;let d=0,p=0,m=0;if(!r)d=p=m=s;else{const g=s<.5?s*(1+r):s+r-s*r,b=2*s-g;d=WR(b,g,e+1/3),p=WR(b,g,e),m=WR(b,g,e-1/3)}return{red:Math.round(d*255),green:Math.round(p*255),blue:Math.round(m*255),alpha:o}}function Vj(e,r){return s=>s>0?r:e}const zr=(e,r,s)=>e+(r-e)*s,JR=(e,r,s)=>{const o=e*e,d=s*(r*r-o)+o;return d<0?0:Math.sqrt(d)},Doe=[UT,xp,ig],Poe=e=>Doe.find(r=>r.test(e));function RI(e){const r=Poe(e);if(!r)return!1;let s=r.parse(e);return r===ig&&(s=Noe(s)),s}const TI=(e,r)=>{const s=RI(e),o=RI(r);if(!s||!o)return Vj(e,r);const d={...s};return p=>(d.red=JR(s.red,o.red,p),d.green=JR(s.green,o.green,p),d.blue=JR(s.blue,o.blue,p),d.alpha=zr(s.alpha,o.alpha,p),xp.transform(d))},KT=new Set(["none","hidden"]);function Moe(e,r){return KT.has(e)?s=>s<=0?e:r:s=>s>=1?r:e}function Ioe(e,r){return s=>zr(e,r,s)}function w2(e){return typeof e=="number"?Ioe:typeof e=="string"?v2(e)?Vj:ms.test(e)?TI:Foe:Array.isArray(e)?k5:typeof e=="object"?ms.test(e)?TI:zoe:Vj}function k5(e,r){const s=[...e],o=s.length,d=e.map((p,m)=>w2(p)(p,r[m]));return p=>{for(let m=0;m{for(const p in o)s[p]=o[p](d);return s}}function Loe(e,r){const s=[],o={color:0,var:0,number:0};for(let d=0;d{const s=Kd.createTransformer(r),o=Kb(e),d=Kb(r);return o.indexes.var.length===d.indexes.var.length&&o.indexes.color.length===d.indexes.color.length&&o.indexes.number.length>=d.indexes.number.length?KT.has(e)&&!d.values.length||KT.has(r)&&!o.values.length?Moe(e,r):hw(k5(Loe(o,d),d.values),s):Vj(e,r)};function R5(e,r,s){return typeof e=="number"&&typeof r=="number"&&typeof s=="number"?zr(e,r,s):w2(e)(e,r)}const qoe=e=>{const r=({timestamp:s})=>e(s);return{start:(s=!0)=>_r.update(r,s),stop:()=>Ud(r),now:()=>Us.isProcessing?Us.timestamp:da.now()}},T5=(e,r,s=10)=>{let o="";const d=Math.max(Math.round(r/s),2);for(let p=0;p=Hj?1/0:r}function Boe(e,r=100,s){const o=s({...e,keyframes:[0,r]}),d=Math.min(S2(o),Hj);return{type:"keyframes",ease:p=>o.next(d*p).value/r,duration:so(d)}}const Uoe=5;function _5(e,r,s){const o=Math.max(r-Uoe,0);return u5(s-e(o),r-o)}const Vr={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},QR=.001;function Koe({duration:e=Vr.duration,bounce:r=Vr.bounce,velocity:s=Vr.velocity,mass:o=Vr.mass}){let d,p,m=1-r;m=gu(Vr.minDamping,Vr.maxDamping,m),e=gu(Vr.minDuration,Vr.maxDuration,so(e)),m<1?(d=S=>{const E=S*m,A=E*e,k=E-s,T=VT(S,m),M=Math.exp(-A);return QR-k/T*M},p=S=>{const A=S*m*e,k=A*s+s,T=Math.pow(m,2)*Math.pow(S,2)*e,M=Math.exp(-A),I=VT(Math.pow(S,2),m);return(-d(S)+QR>0?-1:1)*((k-T)*M)/I}):(d=S=>{const E=Math.exp(-S*e),A=(S-s)*e+1;return-QR+E*A},p=S=>{const E=Math.exp(-S*e),A=(s-S)*(e*e);return E*A});const g=5/e,b=Hoe(d,p,g);if(e=ic(e),isNaN(b))return{stiffness:Vr.stiffness,damping:Vr.damping,duration:e};{const S=Math.pow(b,2)*o;return{stiffness:S,damping:m*2*Math.sqrt(o*S),duration:e}}}const Voe=12;function Hoe(e,r,s){let o=s;for(let d=1;de[s]!==void 0)}function Yoe(e){let r={velocity:Vr.velocity,stiffness:Vr.stiffness,damping:Vr.damping,mass:Vr.mass,isResolvedFromDuration:!1,...e};if(!_I(e,Xoe)&&_I(e,Goe))if(e.visualDuration){const s=e.visualDuration,o=2*Math.PI/(s*1.2),d=o*o,p=2*gu(.05,1,1-(e.bounce||0))*Math.sqrt(d);r={...r,mass:Vr.mass,stiffness:d,damping:p}}else{const s=Koe(e);r={...r,...s,mass:Vr.mass},r.isResolvedFromDuration=!0}return r}function Gj(e=Vr.visualDuration,r=Vr.bounce){const s=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:r}:e;let{restSpeed:o,restDelta:d}=s;const p=s.keyframes[0],m=s.keyframes[s.keyframes.length-1],g={done:!1,value:p},{stiffness:b,damping:S,mass:E,duration:A,velocity:k,isResolvedFromDuration:T}=Yoe({...s,velocity:-so(s.velocity||0)}),M=k||0,I=S/(2*Math.sqrt(b*E)),q=m-p,G=so(Math.sqrt(b/E)),K=Math.abs(q)<5;o||(o=K?Vr.restSpeed.granular:Vr.restSpeed.default),d||(d=K?Vr.restDelta.granular:Vr.restDelta.default);let X;if(I<1){const ee=VT(G,I);X=oe=>{const Q=Math.exp(-I*G*oe);return m-Q*((M+I*G*q)/ee*Math.sin(ee*oe)+q*Math.cos(ee*oe))}}else if(I===1)X=ee=>m-Math.exp(-G*ee)*(q+(M+G*q)*ee);else{const ee=G*Math.sqrt(I*I-1);X=oe=>{const Q=Math.exp(-I*G*oe),ne=Math.min(ee*oe,300);return m-Q*((M+I*G*q)*Math.sinh(ne)+ee*q*Math.cosh(ne))/ee}}const z={calculatedDuration:T&&A||null,next:ee=>{const oe=X(ee);if(T)g.done=ee>=A;else{let Q=ee===0?M:0;I<1&&(Q=ee===0?ic(M):_5(X,ee,oe));const ne=Math.abs(Q)<=o,de=Math.abs(m-oe)<=d;g.done=ne&&de}return g.value=g.done?m:oe,g},toString:()=>{const ee=Math.min(S2(z),Hj),oe=T5(Q=>z.next(ee*Q).value,ee,30);return ee+"ms "+oe},toTransition:()=>{}};return z}Gj.applyToOptions=e=>{const r=Boe(e,100,Gj);return e.ease=r.ease,e.duration=ic(r.duration),e.type="keyframes",e};function HT({keyframes:e,velocity:r=0,power:s=.8,timeConstant:o=325,bounceDamping:d=10,bounceStiffness:p=500,modifyTarget:m,min:g,max:b,restDelta:S=.5,restSpeed:E}){const A=e[0],k={done:!1,value:A},T=ne=>g!==void 0&&neb,M=ne=>g===void 0?b:b===void 0||Math.abs(g-ne)-I*Math.exp(-ne/o),X=ne=>G+K(ne),z=ne=>{const de=K(ne),Ce=X(ne);k.done=Math.abs(de)<=S,k.value=k.done?G:Ce};let ee,oe;const Q=ne=>{T(k.value)&&(ee=ne,oe=Gj({keyframes:[k.value,M(k.value)],velocity:_5(X,ne,k.value),damping:d,stiffness:p,restDelta:S,restSpeed:E}))};return Q(0),{calculatedDuration:null,next:ne=>{let de=!1;return!oe&&ee===void 0&&(de=!0,z(ne),Q(ne)),ee!==void 0&&ne>=ee?oe.next(ne-ee):(!de&&z(ne),k)}}}function Zoe(e,r,s){const o=[],d=s||yu.mix||R5,p=e.length-1;for(let m=0;mr[0];if(p===2&&r[0]===r[1])return()=>r[1];const m=e[0]===e[1];e[0]>e[p-1]&&(e=[...e].reverse(),r=[...r].reverse());const g=Zoe(r,o,d),b=g.length,S=E=>{if(m&&E1)for(;AS(gu(e[0],e[p-1],E)):S}function Joe(e,r){const s=e[e.length-1];for(let o=1;o<=r;o++){const d=Bb(0,r,o);e.push(zr(s,1,d))}}function Qoe(e){const r=[0];return Joe(r,e.length-1),r}function ele(e,r){return e.map(s=>s*r)}function tle(e,r){return e.map(()=>r||x5).splice(0,e.length-1)}function _b({duration:e=300,keyframes:r,times:s,ease:o="easeInOut"}){const d=hoe(o)?o.map(AI):AI(o),p={done:!1,value:r[0]},m=ele(s&&s.length===r.length?s:Qoe(r),e),g=Woe(m,r,{ease:Array.isArray(d)?d:tle(r,d)});return{calculatedDuration:e,next:b=>(p.value=g(b),p.done=b>=e,p)}}const nle=e=>e!==null;function E2(e,{repeat:r,repeatType:s="loop"},o,d=1){const p=e.filter(nle),g=d<0||r&&s!=="loop"&&r%2===1?0:p.length-1;return!g||o===void 0?p[g]:o}const rle={decay:HT,inertia:HT,tween:_b,keyframes:_b,spring:Gj};function $5(e){typeof e.type=="string"&&(e.type=rle[e.type])}class j2{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(r=>{this.resolve=r})}notifyFinished(){this.resolve()}then(r,s){return this.finished.then(r,s)}}const sle=e=>e/100;class C2 extends j2{constructor(r){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:s}=this.options;s&&s.updatedAt!==da.now()&&this.tick(da.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=r,this.initAnimation(),this.play(),r.autoplay===!1&&this.pause()}initAnimation(){const{options:r}=this;$5(r);const{type:s=_b,repeat:o=0,repeatDelay:d=0,repeatType:p,velocity:m=0}=r;let{keyframes:g}=r;const b=s||_b;b!==_b&&typeof g[0]!="number"&&(this.mixKeyframes=hw(sle,R5(g[0],g[1])),g=[0,100]);const S=b({...r,keyframes:g});p==="mirror"&&(this.mirroredGenerator=b({...r,keyframes:[...g].reverse(),velocity:-m})),S.calculatedDuration===null&&(S.calculatedDuration=S2(S));const{calculatedDuration:E}=S;this.calculatedDuration=E,this.resolvedDuration=E+d,this.totalDuration=this.resolvedDuration*(o+1)-d,this.generator=S}updateTime(r){const s=Math.round(r-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=s}tick(r,s=!1){const{generator:o,totalDuration:d,mixKeyframes:p,mirroredGenerator:m,resolvedDuration:g,calculatedDuration:b}=this;if(this.startTime===null)return o.next(0);const{delay:S=0,keyframes:E,repeat:A,repeatType:k,repeatDelay:T,type:M,onUpdate:I,finalKeyframe:q}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,r):this.speed<0&&(this.startTime=Math.min(r-d/this.speed,this.startTime)),s?this.currentTime=r:this.updateTime(r);const G=this.currentTime-S*(this.playbackSpeed>=0?1:-1),K=this.playbackSpeed>=0?G<0:G>d;this.currentTime=Math.max(G,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let X=this.currentTime,z=o;if(A){const ne=Math.min(this.currentTime,d)/g;let de=Math.floor(ne),Ce=ne%1;!Ce&&ne>=1&&(Ce=1),Ce===1&&de--,de=Math.min(de,A+1),!!(de%2)&&(k==="reverse"?(Ce=1-Ce,T&&(Ce-=T/g)):k==="mirror"&&(z=m)),X=gu(0,1,Ce)*g}const ee=K?{done:!1,value:E[0]}:z.next(X);p&&(ee.value=p(ee.value));let{done:oe}=ee;!K&&b!==null&&(oe=this.playbackSpeed>=0?this.currentTime>=d:this.currentTime<=0);const Q=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&oe);return Q&&M!==HT&&(ee.value=E2(E,this.options,q,this.speed)),I&&I(ee.value),Q&&this.finish(),ee}then(r,s){return this.finished.then(r,s)}get duration(){return so(this.calculatedDuration)}get iterationDuration(){const{delay:r=0}=this.options||{};return this.duration+so(r)}get time(){return so(this.currentTime)}set time(r){r=ic(r),this.currentTime=r,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=r:this.driver&&(this.startTime=this.driver.now()-r/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(r){this.updateTime(da.now());const s=this.playbackSpeed!==r;this.playbackSpeed=r,s&&(this.time=so(this.currentTime))}play(){if(this.isStopped)return;const{driver:r=qoe,startTime:s}=this.options;this.driver||(this.driver=r(d=>this.tick(d))),this.options.onPlay?.();const o=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=o):this.holdTime!==null?this.startTime=o-this.holdTime:this.startTime||(this.startTime=s??o),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(da.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(r){return this.startTime=0,this.tick(r,!0)}attachTimeline(r){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),r.observe(this)}}function ile(e){for(let r=1;re*180/Math.PI,GT=e=>{const r=bp(Math.atan2(e[1],e[0]));return XT(r)},ale={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:GT,rotateZ:GT,skewX:e=>bp(Math.atan(e[1])),skewY:e=>bp(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},XT=e=>(e=e%360,e<0&&(e+=360),e),$I=GT,NI=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),DI=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),ole={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:NI,scaleY:DI,scale:e=>(NI(e)+DI(e))/2,rotateX:e=>XT(bp(Math.atan2(e[6],e[5]))),rotateY:e=>XT(bp(Math.atan2(-e[2],e[0]))),rotateZ:$I,rotate:$I,skewX:e=>bp(Math.atan(e[4])),skewY:e=>bp(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function YT(e){return e.includes("scale")?1:0}function ZT(e,r){if(!e||e==="none")return YT(r);const s=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let o,d;if(s)o=ole,d=s;else{const g=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);o=ale,d=g}if(!d)return YT(r);const p=o[r],m=d[1].split(",").map(cle);return typeof p=="function"?p(m):m[p]}const lle=(e,r)=>{const{transform:s="none"}=getComputedStyle(e);return ZT(s,r)};function cle(e){return parseFloat(e.trim())}const Dg=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Pg=new Set(Dg),PI=e=>e===Ng||e===tn,ule=new Set(["x","y","z"]),dle=Dg.filter(e=>!ule.has(e));function hle(e){const r=[];return dle.forEach(s=>{const o=e.getValue(s);o!==void 0&&(r.push([s,o.get()]),o.set(s.startsWith("scale")?1:0))}),r}const Sp={width:({x:e},{paddingLeft:r="0",paddingRight:s="0"})=>e.max-e.min-parseFloat(r)-parseFloat(s),height:({y:e},{paddingTop:r="0",paddingBottom:s="0"})=>e.max-e.min-parseFloat(r)-parseFloat(s),top:(e,{top:r})=>parseFloat(r),left:(e,{left:r})=>parseFloat(r),bottom:({y:e},{top:r})=>parseFloat(r)+(e.max-e.min),right:({x:e},{left:r})=>parseFloat(r)+(e.max-e.min),x:(e,{transform:r})=>ZT(r,"x"),y:(e,{transform:r})=>ZT(r,"y")};Sp.translateX=Sp.x;Sp.translateY=Sp.y;const Ep=new Set;let WT=!1,JT=!1,QT=!1;function N5(){if(JT){const e=Array.from(Ep).filter(o=>o.needsMeasurement),r=new Set(e.map(o=>o.element)),s=new Map;r.forEach(o=>{const d=hle(o);d.length&&(s.set(o,d),o.render())}),e.forEach(o=>o.measureInitialState()),r.forEach(o=>{o.render();const d=s.get(o);d&&d.forEach(([p,m])=>{o.getValue(p)?.set(m)})}),e.forEach(o=>o.measureEndState()),e.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY)})}JT=!1,WT=!1,Ep.forEach(e=>e.complete(QT)),Ep.clear()}function D5(){Ep.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(JT=!0)})}function ple(){QT=!0,D5(),N5(),QT=!1}class A2{constructor(r,s,o,d,p,m=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...r],this.onComplete=s,this.name=o,this.motionValue=d,this.element=p,this.isAsync=m}scheduleResolve(){this.state="scheduled",this.isAsync?(Ep.add(this),WT||(WT=!0,_r.read(D5),_r.resolveKeyframes(N5))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:r,name:s,element:o,motionValue:d}=this;if(r[0]===null){const p=d?.get(),m=r[r.length-1];if(p!==void 0)r[0]=p;else if(o&&s){const g=o.readValue(s,m);g!=null&&(r[0]=g)}r[0]===void 0&&(r[0]=m),d&&p===void 0&&d.set(r[0])}ile(r)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(r=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,r),Ep.delete(this)}cancel(){this.state==="scheduled"&&(Ep.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const fle=e=>e.startsWith("--");function mle(e,r,s){fle(r)?e.style.setProperty(r,s):e.style[r]=s}const gle=p2(()=>window.ScrollTimeline!==void 0),yle={};function vle(e,r){const s=p2(e);return()=>yle[r]??s()}const P5=vle(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),wb=([e,r,s,o])=>`cubic-bezier(${e}, ${r}, ${s}, ${o})`,MI={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:wb([0,.65,.55,1]),circOut:wb([.55,0,1,.45]),backIn:wb([.31,.01,.66,-.59]),backOut:wb([.33,1.53,.69,.99])};function M5(e,r){if(e)return typeof e=="function"?P5()?T5(e,r):"ease-out":b5(e)?wb(e):Array.isArray(e)?e.map(s=>M5(s,r)||MI.easeOut):MI[e]}function xle(e,r,s,{delay:o=0,duration:d=300,repeat:p=0,repeatType:m="loop",ease:g="easeOut",times:b}={},S=void 0){const E={[r]:s};b&&(E.offset=b);const A=M5(g,d);Array.isArray(A)&&(E.easing=A);const k={delay:o,duration:d,easing:Array.isArray(A)?"linear":A,fill:"both",iterations:p+1,direction:m==="reverse"?"alternate":"normal"};return S&&(k.pseudoElement=S),e.animate(E,k)}function I5(e){return typeof e=="function"&&"applyToOptions"in e}function ble({type:e,...r}){return I5(e)&&P5()?e.applyToOptions(r):(r.duration??(r.duration=300),r.ease??(r.ease="easeOut"),r)}class wle extends j2{constructor(r){if(super(),this.finishedTime=null,this.isStopped=!1,!r)return;const{element:s,name:o,keyframes:d,pseudoElement:p,allowFlatten:m=!1,finalKeyframe:g,onComplete:b}=r;this.isPseudoElement=!!p,this.allowFlatten=m,this.options=r,h2(typeof r.type!="string");const S=ble(r);this.animation=xle(s,o,d,S,p),S.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!p){const E=E2(d,this.options,g,this.speed);this.updateMotionValue?this.updateMotionValue(E):mle(s,o,E),this.animation.cancel()}b?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:r}=this;r==="idle"||r==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const r=this.animation.effect?.getComputedTiming?.().duration||0;return so(Number(r))}get iterationDuration(){const{delay:r=0}=this.options||{};return this.duration+so(r)}get time(){return so(Number(this.animation.currentTime)||0)}set time(r){this.finishedTime=null,this.animation.currentTime=ic(r)}get speed(){return this.animation.playbackRate}set speed(r){r<0&&(this.finishedTime=null),this.animation.playbackRate=r}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(r){this.animation.startTime=r}attachTimeline({timeline:r,observe:s}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,r&&gle()?(this.animation.timeline=r,io):s(this)}}const z5={anticipate:g5,backInOut:m5,circInOut:v5};function Sle(e){return e in z5}function Ele(e){typeof e.ease=="string"&&Sle(e.ease)&&(e.ease=z5[e.ease])}const II=10;class jle extends wle{constructor(r){Ele(r),$5(r),super(r),r.startTime&&(this.startTime=r.startTime),this.options=r}updateMotionValue(r){const{motionValue:s,onUpdate:o,onComplete:d,element:p,...m}=this.options;if(!s)return;if(r!==void 0){s.set(r);return}const g=new C2({...m,autoplay:!1}),b=ic(this.finishedTime??this.time);s.setWithVelocity(g.sample(b-II).value,g.sample(b).value,II),g.stop()}}const zI=(e,r)=>r==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Kd.test(e)||e==="0")&&!e.startsWith("url("));function Cle(e){const r=e[0];if(e.length===1)return!0;for(let s=0;sObject.hasOwnProperty.call(Element.prototype,"animate"));function Rle(e){const{motionValue:r,name:s,repeatDelay:o,repeatType:d,damping:p,type:m}=e;if(!(r?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:b,transformTemplate:S}=r.owner.getProps();return kle()&&s&&Ole.has(s)&&(s!=="transform"||!S)&&!b&&!o&&d!=="mirror"&&p!==0&&m!=="inertia"}const Tle=40;class _le extends j2{constructor({autoplay:r=!0,delay:s=0,type:o="keyframes",repeat:d=0,repeatDelay:p=0,repeatType:m="loop",keyframes:g,name:b,motionValue:S,element:E,...A}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=da.now();const k={autoplay:r,delay:s,type:o,repeat:d,repeatDelay:p,repeatType:m,name:b,motionValue:S,element:E,...A},T=E?.KeyframeResolver||A2;this.keyframeResolver=new T(g,(M,I,q)=>this.onKeyframesResolved(M,I,k,!q),b,S,E),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(r,s,o,d){this.keyframeResolver=void 0;const{name:p,type:m,velocity:g,delay:b,isHandoff:S,onUpdate:E}=o;this.resolvedAt=da.now(),Ale(r,p,m,g)||((yu.instantAnimations||!b)&&E?.(E2(r,o,s)),r[0]=r[r.length-1],e_(o),o.repeat=0);const k={startTime:d?this.resolvedAt?this.resolvedAt-this.createdAt>Tle?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:s,...o,keyframes:r},T=!S&&Rle(k)?new jle({...k,element:k.motionValue.owner.current}):new C2(k);T.finished.then(()=>this.notifyFinished()).catch(io),this.pendingTimeline&&(this.stopTimeline=T.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=T}get finished(){return this._animation?this.animation.finished:this._finished}then(r,s){return this.finished.finally(r).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),ple()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(r){this.animation.time=r}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(r){this.animation.speed=r}get startTime(){return this.animation.startTime}attachTimeline(r){return this._animation?this.stopTimeline=this.animation.attachTimeline(r):this.pendingTimeline=r,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const $le=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Nle(e){const r=$le.exec(e);if(!r)return[,];const[,s,o,d]=r;return[`--${s??o}`,d]}function L5(e,r,s=1){const[o,d]=Nle(e);if(!o)return;const p=window.getComputedStyle(r).getPropertyValue(o);if(p){const m=p.trim();return o5(m)?parseFloat(m):m}return v2(d)?L5(d,r,s+1):d}function O2(e,r){return e?.[r]??e?.default??e}const F5=new Set(["width","height","top","left","right","bottom",...Dg]),Dle={test:e=>e==="auto",parse:e=>e},q5=e=>r=>r.test(e),B5=[Ng,tn,ac,Md,Coe,joe,Dle],LI=e=>B5.find(q5(e));function Ple(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||c5(e):!0}const Mle=new Set(["brightness","contrast","saturate","opacity"]);function Ile(e){const[r,s]=e.slice(0,-1).split("(");if(r==="drop-shadow")return e;const[o]=s.match(x2)||[];if(!o)return e;const d=s.replace(o,"");let p=Mle.has(r)?1:0;return o!==s&&(p*=100),r+"("+p+d+")"}const zle=/\b([a-z-]*)\(.*?\)/gu,t_={...Kd,getAnimatableNone:e=>{const r=e.match(zle);return r?r.map(Ile).join(" "):e}},FI={...Ng,transform:Math.round},Lle={rotate:Md,rotateX:Md,rotateY:Md,rotateZ:Md,scale:tj,scaleX:tj,scaleY:tj,scaleZ:tj,skew:Md,skewX:Md,skewY:Md,distance:tn,translateX:tn,translateY:tn,translateZ:tn,x:tn,y:tn,z:tn,perspective:tn,transformPerspective:tn,opacity:Ub,originX:OI,originY:OI,originZ:tn},k2={borderWidth:tn,borderTopWidth:tn,borderRightWidth:tn,borderBottomWidth:tn,borderLeftWidth:tn,borderRadius:tn,radius:tn,borderTopLeftRadius:tn,borderTopRightRadius:tn,borderBottomRightRadius:tn,borderBottomLeftRadius:tn,width:tn,maxWidth:tn,height:tn,maxHeight:tn,top:tn,right:tn,bottom:tn,left:tn,padding:tn,paddingTop:tn,paddingRight:tn,paddingBottom:tn,paddingLeft:tn,margin:tn,marginTop:tn,marginRight:tn,marginBottom:tn,marginLeft:tn,backgroundPositionX:tn,backgroundPositionY:tn,...Lle,zIndex:FI,fillOpacity:Ub,strokeOpacity:Ub,numOctaves:FI},Fle={...k2,color:ms,backgroundColor:ms,outlineColor:ms,fill:ms,stroke:ms,borderColor:ms,borderTopColor:ms,borderRightColor:ms,borderBottomColor:ms,borderLeftColor:ms,filter:t_,WebkitFilter:t_},U5=e=>Fle[e];function K5(e,r){let s=U5(e);return s!==t_&&(s=Kd),s.getAnimatableNone?s.getAnimatableNone(r):void 0}const qle=new Set(["auto","none","0"]);function Ble(e,r,s){let o=0,d;for(;o{r.getValue(g).set(b)}),this.resolveNoneKeyframes()}}function Kle(e,r,s){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let o=document;const d=s?.[e]??o.querySelectorAll(e);return d?Array.from(d):[]}return Array.from(e)}const V5=(e,r)=>r&&typeof e=="number"?r.transform(e):e;function Vle(e){return l5(e)&&"offsetHeight"in e}const qI=30,Hle=e=>!isNaN(parseFloat(e));class Gle{constructor(r,s={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=o=>{const d=da.now();if(this.updatedAt!==d&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(o),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const p of this.dependents)p.dirty()},this.hasAnimated=!1,this.setCurrent(r),this.owner=s.owner}setCurrent(r){this.current=r,this.updatedAt=da.now(),this.canTrackVelocity===null&&r!==void 0&&(this.canTrackVelocity=Hle(this.current))}setPrevFrameValue(r=this.current){this.prevFrameValue=r,this.prevUpdatedAt=this.updatedAt}onChange(r){return this.on("change",r)}on(r,s){this.events[r]||(this.events[r]=new f2);const o=this.events[r].add(s);return r==="change"?()=>{o(),_r.read(()=>{this.events.change.getSize()||this.stop()})}:o}clearListeners(){for(const r in this.events)this.events[r].clear()}attach(r,s){this.passiveEffect=r,this.stopPassiveEffect=s}set(r){this.passiveEffect?this.passiveEffect(r,this.updateAndNotify):this.updateAndNotify(r)}setWithVelocity(r,s,o){this.set(s),this.prev=void 0,this.prevFrameValue=r,this.prevUpdatedAt=this.updatedAt-o}jump(r,s=!0){this.updateAndNotify(r),this.prev=r,this.prevUpdatedAt=this.prevFrameValue=void 0,s&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(r){this.dependents||(this.dependents=new Set),this.dependents.add(r)}removeDependent(r){this.dependents&&this.dependents.delete(r)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const r=da.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||r-this.updatedAt>qI)return 0;const s=Math.min(this.updatedAt-this.prevUpdatedAt,qI);return u5(parseFloat(this.current)-parseFloat(this.prevFrameValue),s)}start(r){return this.stop(),new Promise(s=>{this.hasAnimated=!0,this.animation=r(s),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function wg(e,r){return new Gle(e,r)}const{schedule:R2}=w5(queueMicrotask,!1),Xo={x:!1,y:!1};function H5(){return Xo.x||Xo.y}function Xle(e){return e==="x"||e==="y"?Xo[e]?null:(Xo[e]=!0,()=>{Xo[e]=!1}):Xo.x||Xo.y?null:(Xo.x=Xo.y=!0,()=>{Xo.x=Xo.y=!1})}function G5(e,r){const s=Kle(e),o=new AbortController,d={passive:!0,...r,signal:o.signal};return[s,d,()=>o.abort()]}function BI(e){return!(e.pointerType==="touch"||H5())}function Yle(e,r,s={}){const[o,d,p]=G5(e,s),m=g=>{if(!BI(g))return;const{target:b}=g,S=r(b,g);if(typeof S!="function"||!b)return;const E=A=>{BI(A)&&(S(A),b.removeEventListener("pointerleave",E))};b.addEventListener("pointerleave",E,d)};return o.forEach(g=>{g.addEventListener("pointerenter",m,d)}),p}const X5=(e,r)=>r?e===r?!0:X5(e,r.parentElement):!1,T2=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Zle=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Wle(e){return Zle.has(e.tagName)||e.tabIndex!==-1}const wj=new WeakSet;function UI(e){return r=>{r.key==="Enter"&&e(r)}}function eT(e,r){e.dispatchEvent(new PointerEvent("pointer"+r,{isPrimary:!0,bubbles:!0}))}const Jle=(e,r)=>{const s=e.currentTarget;if(!s)return;const o=UI(()=>{if(wj.has(s))return;eT(s,"down");const d=UI(()=>{eT(s,"up")}),p=()=>eT(s,"cancel");s.addEventListener("keyup",d,r),s.addEventListener("blur",p,r)});s.addEventListener("keydown",o,r),s.addEventListener("blur",()=>s.removeEventListener("keydown",o),r)};function KI(e){return T2(e)&&!H5()}function Qle(e,r,s={}){const[o,d,p]=G5(e,s),m=g=>{const b=g.currentTarget;if(!KI(g))return;wj.add(b);const S=r(b,g),E=(T,M)=>{window.removeEventListener("pointerup",A),window.removeEventListener("pointercancel",k),wj.has(b)&&wj.delete(b),KI(T)&&typeof S=="function"&&S(T,{success:M})},A=T=>{E(T,b===window||b===document||s.useGlobalTarget||X5(b,T.target))},k=T=>{E(T,!1)};window.addEventListener("pointerup",A,d),window.addEventListener("pointercancel",k,d)};return o.forEach(g=>{(s.useGlobalTarget?window:g).addEventListener("pointerdown",m,d),Vle(g)&&(g.addEventListener("focus",S=>Jle(S,d)),!Wle(g)&&!g.hasAttribute("tabindex")&&(g.tabIndex=0))}),p}function Y5(e){return l5(e)&&"ownerSVGElement"in e}function ece(e){return Y5(e)&&e.tagName==="svg"}const bi=e=>!!(e&&e.getVelocity),tce=[...B5,ms,Kd],nce=e=>tce.find(q5(e)),Z5=R.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function rce(e=!0){const r=R.useContext(c2);if(r===null)return[!0,null];const{isPresent:s,onExitComplete:o,register:d}=r,p=R.useId();R.useEffect(()=>{if(e)return d(p)},[e]);const m=R.useCallback(()=>e&&o&&o(p),[p,o,e]);return!s&&o?[!1,m]:[!0]}const W5=R.createContext({strict:!1}),VI={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Sg={};for(const e in VI)Sg[e]={isEnabled:r=>VI[e].some(s=>!!r[s])};function sce(e){for(const r in e)Sg[r]={...Sg[r],...e[r]}}const ice=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Xj(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||ice.has(e)}let J5=e=>!Xj(e);function ace(e){typeof e=="function"&&(J5=r=>r.startsWith("on")?!Xj(r):e(r))}try{ace(require("@emotion/is-prop-valid").default)}catch{}function oce(e,r,s){const o={};for(const d in e)d==="values"&&typeof e.values=="object"||(J5(d)||s===!0&&Xj(d)||!r&&!Xj(d)||e.draggable&&d.startsWith("onDrag"))&&(o[d]=e[d]);return o}const IC=R.createContext({});function zC(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Vb(e){return typeof e=="string"||Array.isArray(e)}const _2=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],$2=["initial",..._2];function LC(e){return zC(e.animate)||$2.some(r=>Vb(e[r]))}function Q5(e){return!!(LC(e)||e.variants)}function lce(e,r){if(LC(e)){const{initial:s,animate:o}=e;return{initial:s===!1||Vb(s)?s:void 0,animate:Vb(o)?o:void 0}}return e.inherit!==!1?r:{}}function cce(e){const{initial:r,animate:s}=lce(e,R.useContext(IC));return R.useMemo(()=>({initial:r,animate:s}),[HI(r),HI(s)])}function HI(e){return Array.isArray(e)?e.join(" "):e}const Hb={};function uce(e){for(const r in e)Hb[r]=e[r],y2(r)&&(Hb[r].isCSSVariable=!0)}function eF(e,{layout:r,layoutId:s}){return Pg.has(e)||e.startsWith("origin")||(r||s!==void 0)&&(!!Hb[e]||e==="opacity")}const dce={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},hce=Dg.length;function pce(e,r,s){let o="",d=!0;for(let p=0;p({style:{},transform:{},transformOrigin:{},vars:{}});function tF(e,r,s){for(const o in r)!bi(r[o])&&!eF(o,s)&&(e[o]=r[o])}function fce({transformTemplate:e},r){return R.useMemo(()=>{const s=D2();return N2(s,r,e),Object.assign({},s.vars,s.style)},[r])}function mce(e,r){const s=e.style||{},o={};return tF(o,s,e),Object.assign(o,fce(e,r)),o}function gce(e,r){const s={},o=mce(e,r);return e.drag&&e.dragListener!==!1&&(s.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(s.tabIndex=0),s.style=o,s}const yce={offset:"stroke-dashoffset",array:"stroke-dasharray"},vce={offset:"strokeDashoffset",array:"strokeDasharray"};function xce(e,r,s=1,o=0,d=!0){e.pathLength=1;const p=d?yce:vce;e[p.offset]=tn.transform(-o);const m=tn.transform(r),g=tn.transform(s);e[p.array]=`${m} ${g}`}function nF(e,{attrX:r,attrY:s,attrScale:o,pathLength:d,pathSpacing:p=1,pathOffset:m=0,...g},b,S,E){if(N2(e,g,S),b){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:A,style:k}=e;A.transform&&(k.transform=A.transform,delete A.transform),(k.transform||A.transformOrigin)&&(k.transformOrigin=A.transformOrigin??"50% 50%",delete A.transformOrigin),k.transform&&(k.transformBox=E?.transformBox??"fill-box",delete A.transformBox),r!==void 0&&(A.x=r),s!==void 0&&(A.y=s),o!==void 0&&(A.scale=o),d!==void 0&&xce(A,d,p,m,!1)}const rF=()=>({...D2(),attrs:{}}),sF=e=>typeof e=="string"&&e.toLowerCase()==="svg";function bce(e,r,s,o){const d=R.useMemo(()=>{const p=rF();return nF(p,r,sF(o),e.transformTemplate,e.style),{...p.attrs,style:{...p.style}}},[r]);if(e.style){const p={};tF(p,e.style,e),d.style={...p,...d.style}}return d}const wce=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function P2(e){return typeof e!="string"||e.includes("-")?!1:!!(wce.indexOf(e)>-1||/[A-Z]/u.test(e))}function Sce(e,r,s,{latestValues:o},d,p=!1){const g=(P2(e)?bce:gce)(r,o,d,e),b=oce(r,typeof e=="string",p),S=e!==R.Fragment?{...b,...g,ref:s}:{},{children:E}=r,A=R.useMemo(()=>bi(E)?E.get():E,[E]);return R.createElement(e,{...S,children:A})}function GI(e){const r=[{},{}];return e?.values.forEach((s,o)=>{r[0][o]=s.get(),r[1][o]=s.getVelocity()}),r}function M2(e,r,s,o){if(typeof r=="function"){const[d,p]=GI(o);r=r(s!==void 0?s:e.custom,d,p)}if(typeof r=="string"&&(r=e.variants&&e.variants[r]),typeof r=="function"){const[d,p]=GI(o);r=r(s!==void 0?s:e.custom,d,p)}return r}function Sj(e){return bi(e)?e.get():e}function Ece({scrapeMotionValuesFromProps:e,createRenderState:r},s,o,d){return{latestValues:jce(s,o,d,e),renderState:r()}}function jce(e,r,s,o){const d={},p=o(e,{});for(const k in p)d[k]=Sj(p[k]);let{initial:m,animate:g}=e;const b=LC(e),S=Q5(e);r&&S&&!b&&e.inherit!==!1&&(m===void 0&&(m=r.initial),g===void 0&&(g=r.animate));let E=s?s.initial===!1:!1;E=E||m===!1;const A=E?g:m;if(A&&typeof A!="boolean"&&!zC(A)){const k=Array.isArray(A)?A:[A];for(let T=0;T(r,s)=>{const o=R.useContext(IC),d=R.useContext(c2),p=()=>Ece(e,r,o,d);return s?p():soe(p)};function I2(e,r,s){const{style:o}=e,d={};for(const p in o)(bi(o[p])||r.style&&bi(r.style[p])||eF(p,e)||s?.getValue(p)?.liveStyle!==void 0)&&(d[p]=o[p]);return d}const Cce=iF({scrapeMotionValuesFromProps:I2,createRenderState:D2});function aF(e,r,s){const o=I2(e,r,s);for(const d in e)if(bi(e[d])||bi(r[d])){const p=Dg.indexOf(d)!==-1?"attr"+d.charAt(0).toUpperCase()+d.substring(1):d;o[p]=e[d]}return o}const Ace=iF({scrapeMotionValuesFromProps:aF,createRenderState:rF}),Oce=Symbol.for("motionComponentSymbol");function ag(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function kce(e,r,s){return R.useCallback(o=>{o&&e.onMount&&e.onMount(o),r&&(o?r.mount(o):r.unmount()),s&&(typeof s=="function"?s(o):ag(s)&&(s.current=o))},[r])}const z2=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Rce="framerAppearId",oF="data-"+z2(Rce),lF=R.createContext({});function Tce(e,r,s,o,d){const{visualElement:p}=R.useContext(IC),m=R.useContext(W5),g=R.useContext(c2),b=R.useContext(Z5).reducedMotion,S=R.useRef(null);o=o||m.renderer,!S.current&&o&&(S.current=o(e,{visualState:r,parent:p,props:s,presenceContext:g,blockInitialAnimation:g?g.initial===!1:!1,reducedMotionConfig:b}));const E=S.current,A=R.useContext(lF);E&&!E.projection&&d&&(E.type==="html"||E.type==="svg")&&_ce(S.current,s,d,A);const k=R.useRef(!1);R.useInsertionEffect(()=>{E&&k.current&&E.update(s,g)});const T=s[oF],M=R.useRef(!!T&&!window.MotionHandoffIsComplete?.(T)&&window.MotionHasOptimisedAnimation?.(T));return ioe(()=>{E&&(k.current=!0,window.MotionIsMounted=!0,E.updateFeatures(),E.scheduleRenderMicrotask(),M.current&&E.animationState&&E.animationState.animateChanges())}),R.useEffect(()=>{E&&(!M.current&&E.animationState&&E.animationState.animateChanges(),M.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(T)}),M.current=!1),E.enteringChildren=void 0)}),E}function _ce(e,r,s,o){const{layoutId:d,layout:p,drag:m,dragConstraints:g,layoutScroll:b,layoutRoot:S,layoutCrossfade:E}=r;e.projection=new s(e.latestValues,r["data-framer-portal-id"]?void 0:cF(e.parent)),e.projection.setOptions({layoutId:d,layout:p,alwaysMeasureLayout:!!m||g&&ag(g),visualElement:e,animationType:typeof p=="string"?p:"both",initialPromotionConfig:o,crossfade:E,layoutScroll:b,layoutRoot:S})}function cF(e){if(e)return e.options.allowProjection!==!1?e.projection:cF(e.parent)}function tT(e,{forwardMotionProps:r=!1}={},s,o){s&&sce(s);const d=P2(e)?Ace:Cce;function p(g,b){let S;const E={...R.useContext(Z5),...g,layoutId:$ce(g)},{isStatic:A}=E,k=cce(g),T=d(g,A);if(!A&&l2){Nce();const M=Dce(E);S=M.MeasureLayout,k.visualElement=Tce(e,T,E,o,M.ProjectionNode)}return u.jsxs(IC.Provider,{value:k,children:[S&&k.visualElement?u.jsx(S,{visualElement:k.visualElement,...E}):null,Sce(e,g,kce(T,k.visualElement,b),T,A,r)]})}p.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const m=R.forwardRef(p);return m[Oce]=e,m}function $ce({layoutId:e}){const r=R.useContext(a5).id;return r&&e!==void 0?r+"-"+e:e}function Nce(e,r){R.useContext(W5).strict}function Dce(e){const{drag:r,layout:s}=Sg;if(!r&&!s)return{};const o={...r,...s};return{MeasureLayout:r?.isEnabled(e)||s?.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function Pce(e,r){if(typeof Proxy>"u")return tT;const s=new Map,o=(p,m)=>tT(p,m,e,r),d=(p,m)=>o(p,m);return new Proxy(d,{get:(p,m)=>m==="create"?o:(s.has(m)||s.set(m,tT(m,void 0,e,r)),s.get(m))})}function uF({top:e,left:r,right:s,bottom:o}){return{x:{min:r,max:s},y:{min:e,max:o}}}function Mce({x:e,y:r}){return{top:r.min,right:e.max,bottom:r.max,left:e.min}}function Ice(e,r){if(!r)return e;const s=r({x:e.left,y:e.top}),o=r({x:e.right,y:e.bottom});return{top:s.y,left:s.x,bottom:o.y,right:o.x}}function nT(e){return e===void 0||e===1}function n_({scale:e,scaleX:r,scaleY:s}){return!nT(e)||!nT(r)||!nT(s)}function gp(e){return n_(e)||dF(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function dF(e){return XI(e.x)||XI(e.y)}function XI(e){return e&&e!=="0%"}function Yj(e,r,s){const o=e-s,d=r*o;return s+d}function YI(e,r,s,o,d){return d!==void 0&&(e=Yj(e,d,o)),Yj(e,s,o)+r}function r_(e,r=0,s=1,o,d){e.min=YI(e.min,r,s,o,d),e.max=YI(e.max,r,s,o,d)}function hF(e,{x:r,y:s}){r_(e.x,r.translate,r.scale,r.originPoint),r_(e.y,s.translate,s.scale,s.originPoint)}const ZI=.999999999999,WI=1.0000000000001;function zce(e,r,s,o=!1){const d=s.length;if(!d)return;r.x=r.y=1;let p,m;for(let g=0;gZI&&(r.x=1),r.yZI&&(r.y=1)}function og(e,r){e.min=e.min+r,e.max=e.max+r}function JI(e,r,s,o,d=.5){const p=zr(e.min,e.max,d);r_(e,r,s,p,o)}function lg(e,r){JI(e.x,r.x,r.scaleX,r.scale,r.originX),JI(e.y,r.y,r.scaleY,r.scale,r.originY)}function pF(e,r){return uF(Ice(e.getBoundingClientRect(),r))}function Lce(e,r,s){const o=pF(e,s),{scroll:d}=r;return d&&(og(o.x,d.offset.x),og(o.y,d.offset.y)),o}const QI=()=>({translate:0,scale:1,origin:0,originPoint:0}),cg=()=>({x:QI(),y:QI()}),e4=()=>({min:0,max:0}),ns=()=>({x:e4(),y:e4()}),s_={current:null},fF={current:!1};function Fce(){if(fF.current=!0,!!l2)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),r=()=>s_.current=e.matches;e.addEventListener("change",r),r()}else s_.current=!1}const qce=new WeakMap;function Bce(e,r,s){for(const o in r){const d=r[o],p=s[o];if(bi(d))e.addValue(o,d);else if(bi(p))e.addValue(o,wg(d,{owner:e}));else if(p!==d)if(e.hasValue(o)){const m=e.getValue(o);m.liveStyle===!0?m.jump(d):m.hasAnimated||m.set(d)}else{const m=e.getStaticValue(o);e.addValue(o,wg(m!==void 0?m:d,{owner:e}))}}for(const o in s)r[o]===void 0&&e.removeValue(o);return r}const t4=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Uce{scrapeMotionValuesFromProps(r,s,o){return{}}constructor({parent:r,props:s,presenceContext:o,reducedMotionConfig:d,blockInitialAnimation:p,visualState:m},g={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=A2,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const k=da.now();this.renderScheduledAtthis.bindToMotionValue(o,s)),fF.current||Fce(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:s_.current,this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Ud(this.notifyUpdate),Ud(this.render),this.valueSubscriptions.forEach(r=>r()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const r in this.events)this.events[r].clear();for(const r in this.features){const s=this.features[r];s&&(s.unmount(),s.isMounted=!1)}this.current=null}addChild(r){this.children.add(r),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(r)}removeChild(r){this.children.delete(r),this.enteringChildren&&this.enteringChildren.delete(r)}bindToMotionValue(r,s){this.valueSubscriptions.has(r)&&this.valueSubscriptions.get(r)();const o=Pg.has(r);o&&this.onBindTransform&&this.onBindTransform();const d=s.on("change",m=>{this.latestValues[r]=m,this.props.onUpdate&&_r.preRender(this.notifyUpdate),o&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let p;window.MotionCheckAppearSync&&(p=window.MotionCheckAppearSync(this,r,s)),this.valueSubscriptions.set(r,()=>{d(),p&&p(),s.owner&&s.stop()})}sortNodePosition(r){return!this.current||!this.sortInstanceNodePosition||this.type!==r.type?0:this.sortInstanceNodePosition(this.current,r.current)}updateFeatures(){let r="animation";for(r in Sg){const s=Sg[r];if(!s)continue;const{isEnabled:o,Feature:d}=s;if(!this.features[r]&&d&&o(this.props)&&(this.features[r]=new d(this)),this.features[r]){const p=this.features[r];p.isMounted?p.update():(p.mount(),p.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ns()}getStaticValue(r){return this.latestValues[r]}setStaticValue(r,s){this.latestValues[r]=s}update(r,s){(r.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=r,this.prevPresenceContext=this.presenceContext,this.presenceContext=s;for(let o=0;os.variantChildren.delete(r)}addValue(r,s){const o=this.values.get(r);s!==o&&(o&&this.removeValue(r),this.bindToMotionValue(r,s),this.values.set(r,s),this.latestValues[r]=s.get())}removeValue(r){this.values.delete(r);const s=this.valueSubscriptions.get(r);s&&(s(),this.valueSubscriptions.delete(r)),delete this.latestValues[r],this.removeValueFromRenderState(r,this.renderState)}hasValue(r){return this.values.has(r)}getValue(r,s){if(this.props.values&&this.props.values[r])return this.props.values[r];let o=this.values.get(r);return o===void 0&&s!==void 0&&(o=wg(s===null?void 0:s,{owner:this}),this.addValue(r,o)),o}readValue(r,s){let o=this.latestValues[r]!==void 0||!this.current?this.latestValues[r]:this.getBaseTargetFromProps(this.props,r)??this.readValueFromInstance(this.current,r,this.options);return o!=null&&(typeof o=="string"&&(o5(o)||c5(o))?o=parseFloat(o):!nce(o)&&Kd.test(s)&&(o=K5(r,s)),this.setBaseTarget(r,bi(o)?o.get():o)),bi(o)?o.get():o}setBaseTarget(r,s){this.baseTarget[r]=s}getBaseTarget(r){const{initial:s}=this.props;let o;if(typeof s=="string"||typeof s=="object"){const p=M2(this.props,s,this.presenceContext?.custom);p&&(o=p[r])}if(s&&o!==void 0)return o;const d=this.getBaseTargetFromProps(this.props,r);return d!==void 0&&!bi(d)?d:this.initialValues[r]!==void 0&&o===void 0?void 0:this.baseTarget[r]}on(r,s){return this.events[r]||(this.events[r]=new f2),this.events[r].add(s)}notify(r,...s){this.events[r]&&this.events[r].notify(...s)}scheduleRenderMicrotask(){R2.render(this.render)}}class mF extends Uce{constructor(){super(...arguments),this.KeyframeResolver=Ule}sortInstanceNodePosition(r,s){return r.compareDocumentPosition(s)&2?1:-1}getBaseTargetFromProps(r,s){return r.style?r.style[s]:void 0}removeValueFromRenderState(r,{vars:s,style:o}){delete s[r],delete o[r]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:r}=this.props;bi(r)&&(this.childSubscription=r.on("change",s=>{this.current&&(this.current.textContent=`${s}`)}))}}function gF(e,{style:r,vars:s},o,d){const p=e.style;let m;for(m in r)p[m]=r[m];d?.applyProjectionStyles(p,o);for(m in s)p.setProperty(m,s[m])}function Kce(e){return window.getComputedStyle(e)}class Vce extends mF{constructor(){super(...arguments),this.type="html",this.renderInstance=gF}readValueFromInstance(r,s){if(Pg.has(s))return this.projection?.isProjecting?YT(s):lle(r,s);{const o=Kce(r),d=(y2(s)?o.getPropertyValue(s):o[s])||0;return typeof d=="string"?d.trim():d}}measureInstanceViewportBox(r,{transformPagePoint:s}){return pF(r,s)}build(r,s,o){N2(r,s,o.transformTemplate)}scrapeMotionValuesFromProps(r,s,o){return I2(r,s,o)}}const yF=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Hce(e,r,s,o){gF(e,r,void 0,o);for(const d in r.attrs)e.setAttribute(yF.has(d)?d:z2(d),r.attrs[d])}class Gce extends mF{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ns}getBaseTargetFromProps(r,s){return r[s]}readValueFromInstance(r,s){if(Pg.has(s)){const o=U5(s);return o&&o.default||0}return s=yF.has(s)?s:z2(s),r.getAttribute(s)}scrapeMotionValuesFromProps(r,s,o){return aF(r,s,o)}build(r,s,o){nF(r,s,this.isSVGTag,o.transformTemplate,o.style)}renderInstance(r,s,o,d){Hce(r,s,o,d)}mount(r){this.isSVGTag=sF(r.tagName),super.mount(r)}}const Xce=(e,r)=>P2(e)?new Gce(r):new Vce(r,{allowProjection:e!==R.Fragment});function mg(e,r,s){const o=e.getProps();return M2(o,r,s!==void 0?s:o.custom,e)}const i_=e=>Array.isArray(e);function Yce(e,r,s){e.hasValue(r)?e.getValue(r).set(s):e.addValue(r,wg(s))}function Zce(e){return i_(e)?e[e.length-1]||0:e}function Wce(e,r){const s=mg(e,r);let{transitionEnd:o={},transition:d={},...p}=s||{};p={...p,...o};for(const m in p){const g=Zce(p[m]);Yce(e,m,g)}}function Jce(e){return!!(bi(e)&&e.add)}function a_(e,r){const s=e.getValue("willChange");if(Jce(s))return s.add(r);if(!s&&yu.WillChange){const o=new yu.WillChange("auto");e.addValue("willChange",o),o.add(r)}}function vF(e){return e.props[oF]}const Qce=e=>e!==null;function eue(e,{repeat:r,repeatType:s="loop"},o){const d=e.filter(Qce),p=r&&s!=="loop"&&r%2===1?0:d.length-1;return d[p]}const tue={type:"spring",stiffness:500,damping:25,restSpeed:10},nue=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),rue={type:"keyframes",duration:.8},sue={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},iue=(e,{keyframes:r})=>r.length>2?rue:Pg.has(e)?e.startsWith("scale")?nue(r[1]):tue:sue;function aue({when:e,delay:r,delayChildren:s,staggerChildren:o,staggerDirection:d,repeat:p,repeatType:m,repeatDelay:g,from:b,elapsed:S,...E}){return!!Object.keys(E).length}const L2=(e,r,s,o={},d,p)=>m=>{const g=O2(o,e)||{},b=g.delay||o.delay||0;let{elapsed:S=0}=o;S=S-ic(b);const E={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:r.getVelocity(),...g,delay:-S,onUpdate:k=>{r.set(k),g.onUpdate&&g.onUpdate(k)},onComplete:()=>{m(),g.onComplete&&g.onComplete()},name:e,motionValue:r,element:p?void 0:d};aue(g)||Object.assign(E,iue(e,E)),E.duration&&(E.duration=ic(E.duration)),E.repeatDelay&&(E.repeatDelay=ic(E.repeatDelay)),E.from!==void 0&&(E.keyframes[0]=E.from);let A=!1;if((E.type===!1||E.duration===0&&!E.repeatDelay)&&(e_(E),E.delay===0&&(A=!0)),(yu.instantAnimations||yu.skipAnimations)&&(A=!0,e_(E),E.delay=0),E.allowFlatten=!g.type&&!g.ease,A&&!p&&r.get()!==void 0){const k=eue(E.keyframes,g);if(k!==void 0){_r.update(()=>{E.onUpdate(k),E.onComplete()});return}}return g.isSync?new C2(E):new _le(E)};function oue({protectedKeys:e,needsAnimating:r},s){const o=e.hasOwnProperty(s)&&r[s]!==!0;return r[s]=!1,o}function xF(e,r,{delay:s=0,transitionOverride:o,type:d}={}){let{transition:p=e.getDefaultTransition(),transitionEnd:m,...g}=r;o&&(p=o);const b=[],S=d&&e.animationState&&e.animationState.getState()[d];for(const E in g){const A=e.getValue(E,e.latestValues[E]??null),k=g[E];if(k===void 0||S&&oue(S,E))continue;const T={delay:s,...O2(p||{},E)},M=A.get();if(M!==void 0&&!A.isAnimating&&!Array.isArray(k)&&k===M&&!T.velocity)continue;let I=!1;if(window.MotionHandoffAnimation){const G=vF(e);if(G){const K=window.MotionHandoffAnimation(G,E,_r);K!==null&&(T.startTime=K,I=!0)}}a_(e,E),A.start(L2(E,A,k,e.shouldReduceMotion&&F5.has(E)?{type:!1}:T,e,I));const q=A.animation;q&&b.push(q)}return m&&Promise.all(b).then(()=>{_r.update(()=>{m&&Wce(e,m)})}),b}function bF(e,r,s,o=0,d=1){const p=Array.from(e).sort((S,E)=>S.sortNodePosition(E)).indexOf(r),m=e.size,g=(m-1)*o;return typeof s=="function"?s(p,m):d===1?p*o:g-p*o}function o_(e,r,s={}){const o=mg(e,r,s.type==="exit"?e.presenceContext?.custom:void 0);let{transition:d=e.getDefaultTransition()||{}}=o||{};s.transitionOverride&&(d=s.transitionOverride);const p=o?()=>Promise.all(xF(e,o,s)):()=>Promise.resolve(),m=e.variantChildren&&e.variantChildren.size?(b=0)=>{const{delayChildren:S=0,staggerChildren:E,staggerDirection:A}=d;return lue(e,r,b,S,E,A,s)}:()=>Promise.resolve(),{when:g}=d;if(g){const[b,S]=g==="beforeChildren"?[p,m]:[m,p];return b().then(()=>S())}else return Promise.all([p(),m(s.delay)])}function lue(e,r,s=0,o=0,d=0,p=1,m){const g=[];for(const b of e.variantChildren)b.notify("AnimationStart",r),g.push(o_(b,r,{...m,delay:s+(typeof o=="function"?0:o)+bF(e.variantChildren,b,o,d,p)}).then(()=>b.notify("AnimationComplete",r)));return Promise.all(g)}function cue(e,r,s={}){e.notify("AnimationStart",r);let o;if(Array.isArray(r)){const d=r.map(p=>o_(e,p,s));o=Promise.all(d)}else if(typeof r=="string")o=o_(e,r,s);else{const d=typeof r=="function"?mg(e,r,s.custom):r;o=Promise.all(xF(e,d,s))}return o.then(()=>{e.notify("AnimationComplete",r)})}function wF(e,r){if(!Array.isArray(r))return!1;const s=r.length;if(s!==e.length)return!1;for(let o=0;oPromise.all(r.map(({animation:s,options:o})=>cue(e,s,o)))}function fue(e){let r=pue(e),s=n4(),o=!0;const d=b=>(S,E)=>{const A=mg(e,E,b==="exit"?e.presenceContext?.custom:void 0);if(A){const{transition:k,transitionEnd:T,...M}=A;S={...S,...M,...T}}return S};function p(b){r=b(e)}function m(b){const{props:S}=e,E=SF(e.parent)||{},A=[],k=new Set;let T={},M=1/0;for(let q=0;qM&&z,de=!1;const Ce=Array.isArray(X)?X:[X];let xe=Ce.reduce(d(G),{});ee===!1&&(xe={});const{prevResolvedValues:le={}}=K,be={...le,...xe},je=re=>{ne=!0,k.has(re)&&(de=!0,k.delete(re)),K.needsAnimating[re]=!0;const ue=e.getValue(re);ue&&(ue.liveStyle=!1)};for(const re in be){const ue=xe[re],_e=le[re];if(T.hasOwnProperty(re))continue;let fe=!1;i_(ue)&&i_(_e)?fe=!wF(ue,_e):fe=ue!==_e,fe?ue!=null?je(re):k.add(re):ue!==void 0&&k.has(re)?je(re):K.protectedKeys[re]=!0}K.prevProp=X,K.prevResolvedValues=xe,K.isActive&&(T={...T,...xe}),o&&e.blockInitialAnimation&&(ne=!1);const Ke=oe&&Q;ne&&(!Ke||de)&&A.push(...Ce.map(re=>{const ue={type:G};if(typeof re=="string"&&o&&!Ke&&e.manuallyAnimateOnMount&&e.parent){const{parent:_e}=e,fe=mg(_e,re);if(_e.enteringChildren&&fe){const{delayChildren:He}=fe.transition||{};ue.delay=bF(_e.enteringChildren,e,He)}}return{animation:re,options:ue}}))}if(k.size){const q={};if(typeof S.initial!="boolean"){const G=mg(e,Array.isArray(S.initial)?S.initial[0]:S.initial);G&&G.transition&&(q.transition=G.transition)}k.forEach(G=>{const K=e.getBaseTarget(G),X=e.getValue(G);X&&(X.liveStyle=!0),q[G]=K??null}),A.push({animation:q})}let I=!!A.length;return o&&(S.initial===!1||S.initial===S.animate)&&!e.manuallyAnimateOnMount&&(I=!1),o=!1,I?r(A):Promise.resolve()}function g(b,S){if(s[b].isActive===S)return Promise.resolve();e.variantChildren?.forEach(A=>A.animationState?.setActive(b,S)),s[b].isActive=S;const E=m(b);for(const A in s)s[A].protectedKeys={};return E}return{animateChanges:m,setActive:g,setAnimateFunction:p,getState:()=>s,reset:()=>{s=n4()}}}function mue(e,r){return typeof r=="string"?r!==e:Array.isArray(r)?!wF(r,e):!1}function mp(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function n4(){return{animate:mp(!0),whileInView:mp(),whileHover:mp(),whileTap:mp(),whileDrag:mp(),whileFocus:mp(),exit:mp()}}class Yd{constructor(r){this.isMounted=!1,this.node=r}update(){}}class gue extends Yd{constructor(r){super(r),r.animationState||(r.animationState=fue(r))}updateAnimationControlsSubscription(){const{animate:r}=this.node.getProps();zC(r)&&(this.unmountControls=r.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:r}=this.node.getProps(),{animate:s}=this.node.prevProps||{};r!==s&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let yue=0;class vue extends Yd{constructor(){super(...arguments),this.id=yue++}update(){if(!this.node.presenceContext)return;const{isPresent:r,onExitComplete:s}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||r===o)return;const d=this.node.animationState.setActive("exit",!r);s&&!r&&d.then(()=>{s(this.id)})}mount(){const{register:r,onExitComplete:s}=this.node.presenceContext||{};s&&s(this.id),r&&(this.unmount=r(this.id))}unmount(){}}const xue={animation:{Feature:gue},exit:{Feature:vue}};function Gb(e,r,s,o={passive:!0}){return e.addEventListener(r,s,o),()=>e.removeEventListener(r,s)}function mw(e){return{point:{x:e.pageX,y:e.pageY}}}const bue=e=>r=>T2(r)&&e(r,mw(r));function $b(e,r,s,o){return Gb(e,r,bue(s),o)}const EF=1e-4,wue=1-EF,Sue=1+EF,jF=.01,Eue=0-jF,jue=0+jF;function Mi(e){return e.max-e.min}function Cue(e,r,s){return Math.abs(e-r)<=s}function r4(e,r,s,o=.5){e.origin=o,e.originPoint=zr(r.min,r.max,e.origin),e.scale=Mi(s)/Mi(r),e.translate=zr(s.min,s.max,e.origin)-e.originPoint,(e.scale>=wue&&e.scale<=Sue||isNaN(e.scale))&&(e.scale=1),(e.translate>=Eue&&e.translate<=jue||isNaN(e.translate))&&(e.translate=0)}function Nb(e,r,s,o){r4(e.x,r.x,s.x,o?o.originX:void 0),r4(e.y,r.y,s.y,o?o.originY:void 0)}function s4(e,r,s){e.min=s.min+r.min,e.max=e.min+Mi(r)}function Aue(e,r,s){s4(e.x,r.x,s.x),s4(e.y,r.y,s.y)}function i4(e,r,s){e.min=r.min-s.min,e.max=e.min+Mi(r)}function Db(e,r,s){i4(e.x,r.x,s.x),i4(e.y,r.y,s.y)}function no(e){return[e("x"),e("y")]}const CF=({current:e})=>e?e.ownerDocument.defaultView:null,a4=(e,r)=>Math.abs(e-r);function Oue(e,r){const s=a4(e.x,r.x),o=a4(e.y,r.y);return Math.sqrt(s**2+o**2)}class AF{constructor(r,s,{transformPagePoint:o,contextWindow:d=window,dragSnapToOrigin:p=!1,distanceThreshold:m=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const k=sT(this.lastMoveEventInfo,this.history),T=this.startEvent!==null,M=Oue(k.offset,{x:0,y:0})>=this.distanceThreshold;if(!T&&!M)return;const{point:I}=k,{timestamp:q}=Us;this.history.push({...I,timestamp:q});const{onStart:G,onMove:K}=this.handlers;T||(G&&G(this.lastMoveEvent,k),this.startEvent=this.lastMoveEvent),K&&K(this.lastMoveEvent,k)},this.handlePointerMove=(k,T)=>{this.lastMoveEvent=k,this.lastMoveEventInfo=rT(T,this.transformPagePoint),_r.update(this.updatePoint,!0)},this.handlePointerUp=(k,T)=>{this.end();const{onEnd:M,onSessionEnd:I,resumeAnimation:q}=this.handlers;if(this.dragSnapToOrigin&&q&&q(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const G=sT(k.type==="pointercancel"?this.lastMoveEventInfo:rT(T,this.transformPagePoint),this.history);this.startEvent&&M&&M(k,G),I&&I(k,G)},!T2(r))return;this.dragSnapToOrigin=p,this.handlers=s,this.transformPagePoint=o,this.distanceThreshold=m,this.contextWindow=d||window;const g=mw(r),b=rT(g,this.transformPagePoint),{point:S}=b,{timestamp:E}=Us;this.history=[{...S,timestamp:E}];const{onSessionStart:A}=s;A&&A(r,sT(b,this.history)),this.removeListeners=hw($b(this.contextWindow,"pointermove",this.handlePointerMove),$b(this.contextWindow,"pointerup",this.handlePointerUp),$b(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(r){this.handlers=r}end(){this.removeListeners&&this.removeListeners(),Ud(this.updatePoint)}}function rT(e,r){return r?{point:r(e.point)}:e}function o4(e,r){return{x:e.x-r.x,y:e.y-r.y}}function sT({point:e},r){return{point:e,delta:o4(e,OF(r)),offset:o4(e,kue(r)),velocity:Rue(r,.1)}}function kue(e){return e[0]}function OF(e){return e[e.length-1]}function Rue(e,r){if(e.length<2)return{x:0,y:0};let s=e.length-1,o=null;const d=OF(e);for(;s>=0&&(o=e[s],!(d.timestamp-o.timestamp>ic(r)));)s--;if(!o)return{x:0,y:0};const p=so(d.timestamp-o.timestamp);if(p===0)return{x:0,y:0};const m={x:(d.x-o.x)/p,y:(d.y-o.y)/p};return m.x===1/0&&(m.x=0),m.y===1/0&&(m.y=0),m}function Tue(e,{min:r,max:s},o){return r!==void 0&&es&&(e=o?zr(s,e,o.max):Math.min(e,s)),e}function l4(e,r,s){return{min:r!==void 0?e.min+r:void 0,max:s!==void 0?e.max+s-(e.max-e.min):void 0}}function _ue(e,{top:r,left:s,bottom:o,right:d}){return{x:l4(e.x,s,d),y:l4(e.y,r,o)}}function c4(e,r){let s=r.min-e.min,o=r.max-e.max;return r.max-r.mino?s=Bb(r.min,r.max-o,e.min):o>d&&(s=Bb(e.min,e.max-d,r.min)),gu(0,1,s)}function Due(e,r){const s={};return r.min!==void 0&&(s.min=r.min-e.min),r.max!==void 0&&(s.max=r.max-e.min),s}const l_=.35;function Pue(e=l_){return e===!1?e=0:e===!0&&(e=l_),{x:u4(e,"left","right"),y:u4(e,"top","bottom")}}function u4(e,r,s){return{min:d4(e,r),max:d4(e,s)}}function d4(e,r){return typeof e=="number"?e:e[r]||0}const Mue=new WeakMap;class Iue{constructor(r){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ns(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=r}start(r,{snapToCursor:s=!1,distanceThreshold:o}={}){const{presenceContext:d}=this.visualElement;if(d&&d.isPresent===!1)return;const p=A=>{const{dragSnapToOrigin:k}=this.getProps();k?this.pauseAnimation():this.stopAnimation(),s&&this.snapToCursor(mw(A).point)},m=(A,k)=>{const{drag:T,dragPropagation:M,onDragStart:I}=this.getProps();if(T&&!M&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Xle(T),!this.openDragLock))return;this.latestPointerEvent=A,this.latestPanInfo=k,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),no(G=>{let K=this.getAxisMotionValue(G).get()||0;if(ac.test(K)){const{projection:X}=this.visualElement;if(X&&X.layout){const z=X.layout.layoutBox[G];z&&(K=Mi(z)*(parseFloat(K)/100))}}this.originPoint[G]=K}),I&&_r.postRender(()=>I(A,k)),a_(this.visualElement,"transform");const{animationState:q}=this.visualElement;q&&q.setActive("whileDrag",!0)},g=(A,k)=>{this.latestPointerEvent=A,this.latestPanInfo=k;const{dragPropagation:T,dragDirectionLock:M,onDirectionLock:I,onDrag:q}=this.getProps();if(!T&&!this.openDragLock)return;const{offset:G}=k;if(M&&this.currentDirection===null){this.currentDirection=zue(G),this.currentDirection!==null&&I&&I(this.currentDirection);return}this.updateAxis("x",k.point,G),this.updateAxis("y",k.point,G),this.visualElement.render(),q&&q(A,k)},b=(A,k)=>{this.latestPointerEvent=A,this.latestPanInfo=k,this.stop(A,k),this.latestPointerEvent=null,this.latestPanInfo=null},S=()=>no(A=>this.getAnimationState(A)==="paused"&&this.getAxisMotionValue(A).animation?.play()),{dragSnapToOrigin:E}=this.getProps();this.panSession=new AF(r,{onSessionStart:p,onStart:m,onMove:g,onSessionEnd:b,resumeAnimation:S},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:E,distanceThreshold:o,contextWindow:CF(this.visualElement)})}stop(r,s){const o=r||this.latestPointerEvent,d=s||this.latestPanInfo,p=this.isDragging;if(this.cancel(),!p||!d||!o)return;const{velocity:m}=d;this.startAnimation(m);const{onDragEnd:g}=this.getProps();g&&_r.postRender(()=>g(o,d))}cancel(){this.isDragging=!1;const{projection:r,animationState:s}=this.visualElement;r&&(r.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),s&&s.setActive("whileDrag",!1)}updateAxis(r,s,o){const{drag:d}=this.getProps();if(!o||!nj(r,d,this.currentDirection))return;const p=this.getAxisMotionValue(r);let m=this.originPoint[r]+o[r];this.constraints&&this.constraints[r]&&(m=Tue(m,this.constraints[r],this.elastic[r])),p.set(m)}resolveConstraints(){const{dragConstraints:r,dragElastic:s}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,d=this.constraints;r&&ag(r)?this.constraints||(this.constraints=this.resolveRefConstraints()):r&&o?this.constraints=_ue(o.layoutBox,r):this.constraints=!1,this.elastic=Pue(s),d!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&no(p=>{this.constraints!==!1&&this.getAxisMotionValue(p)&&(this.constraints[p]=Due(o.layoutBox[p],this.constraints[p]))})}resolveRefConstraints(){const{dragConstraints:r,onMeasureDragConstraints:s}=this.getProps();if(!r||!ag(r))return!1;const o=r.current,{projection:d}=this.visualElement;if(!d||!d.layout)return!1;const p=Lce(o,d.root,this.visualElement.getTransformPagePoint());let m=$ue(d.layout.layoutBox,p);if(s){const g=s(Mce(m));this.hasMutatedConstraints=!!g,g&&(m=uF(g))}return m}startAnimation(r){const{drag:s,dragMomentum:o,dragElastic:d,dragTransition:p,dragSnapToOrigin:m,onDragTransitionEnd:g}=this.getProps(),b=this.constraints||{},S=no(E=>{if(!nj(E,s,this.currentDirection))return;let A=b&&b[E]||{};m&&(A={min:0,max:0});const k=d?200:1e6,T=d?40:1e7,M={type:"inertia",velocity:o?r[E]:0,bounceStiffness:k,bounceDamping:T,timeConstant:750,restDelta:1,restSpeed:10,...p,...A};return this.startAxisValueAnimation(E,M)});return Promise.all(S).then(g)}startAxisValueAnimation(r,s){const o=this.getAxisMotionValue(r);return a_(this.visualElement,r),o.start(L2(r,o,0,s,this.visualElement,!1))}stopAnimation(){no(r=>this.getAxisMotionValue(r).stop())}pauseAnimation(){no(r=>this.getAxisMotionValue(r).animation?.pause())}getAnimationState(r){return this.getAxisMotionValue(r).animation?.state}getAxisMotionValue(r){const s=`_drag${r.toUpperCase()}`,o=this.visualElement.getProps(),d=o[s];return d||this.visualElement.getValue(r,(o.initial?o.initial[r]:void 0)||0)}snapToCursor(r){no(s=>{const{drag:o}=this.getProps();if(!nj(s,o,this.currentDirection))return;const{projection:d}=this.visualElement,p=this.getAxisMotionValue(s);if(d&&d.layout){const{min:m,max:g}=d.layout.layoutBox[s];p.set(r[s]-zr(m,g,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:r,dragConstraints:s}=this.getProps(),{projection:o}=this.visualElement;if(!ag(s)||!o||!this.constraints)return;this.stopAnimation();const d={x:0,y:0};no(m=>{const g=this.getAxisMotionValue(m);if(g&&this.constraints!==!1){const b=g.get();d[m]=Nue({min:b,max:b},this.constraints[m])}});const{transformTemplate:p}=this.visualElement.getProps();this.visualElement.current.style.transform=p?p({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.resolveConstraints(),no(m=>{if(!nj(m,r,null))return;const g=this.getAxisMotionValue(m),{min:b,max:S}=this.constraints[m];g.set(zr(b,S,d[m]))})}addListeners(){if(!this.visualElement.current)return;Mue.set(this.visualElement,this);const r=this.visualElement.current,s=$b(r,"pointerdown",b=>{const{drag:S,dragListener:E=!0}=this.getProps();S&&E&&this.start(b)}),o=()=>{const{dragConstraints:b}=this.getProps();ag(b)&&b.current&&(this.constraints=this.resolveRefConstraints())},{projection:d}=this.visualElement,p=d.addEventListener("measure",o);d&&!d.layout&&(d.root&&d.root.updateScroll(),d.updateLayout()),_r.read(o);const m=Gb(window,"resize",()=>this.scalePositionWithinConstraints()),g=d.addEventListener("didUpdate",(({delta:b,hasLayoutChanged:S})=>{this.isDragging&&S&&(no(E=>{const A=this.getAxisMotionValue(E);A&&(this.originPoint[E]+=b[E].translate,A.set(A.get()+b[E].translate))}),this.visualElement.render())}));return()=>{m(),s(),p(),g&&g()}}getProps(){const r=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:o=!1,dragPropagation:d=!1,dragConstraints:p=!1,dragElastic:m=l_,dragMomentum:g=!0}=r;return{...r,drag:s,dragDirectionLock:o,dragPropagation:d,dragConstraints:p,dragElastic:m,dragMomentum:g}}}function nj(e,r,s){return(r===!0||r===e)&&(s===null||s===e)}function zue(e,r=10){let s=null;return Math.abs(e.y)>r?s="y":Math.abs(e.x)>r&&(s="x"),s}class Lue extends Yd{constructor(r){super(r),this.removeGroupControls=io,this.removeListeners=io,this.controls=new Iue(r)}mount(){const{dragControls:r}=this.node.getProps();r&&(this.removeGroupControls=r.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||io}unmount(){this.removeGroupControls(),this.removeListeners()}}const h4=e=>(r,s)=>{e&&_r.postRender(()=>e(r,s))};class Fue extends Yd{constructor(){super(...arguments),this.removePointerDownListener=io}onPointerDown(r){this.session=new AF(r,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:CF(this.node)})}createPanHandlers(){const{onPanSessionStart:r,onPanStart:s,onPan:o,onPanEnd:d}=this.node.getProps();return{onSessionStart:h4(r),onStart:h4(s),onMove:o,onEnd:(p,m)=>{delete this.session,d&&_r.postRender(()=>d(p,m))}}}mount(){this.removePointerDownListener=$b(this.node.current,"pointerdown",r=>this.onPointerDown(r))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Ej={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function p4(e,r){return r.max===r.min?0:e/(r.max-r.min)*100}const ib={correct:(e,r)=>{if(!r.target)return e;if(typeof e=="string")if(tn.test(e))e=parseFloat(e);else return e;const s=p4(e,r.target.x),o=p4(e,r.target.y);return`${s}% ${o}%`}},que={correct:(e,{treeScale:r,projectionDelta:s})=>{const o=e,d=Kd.parse(e);if(d.length>5)return o;const p=Kd.createTransformer(e),m=typeof d[0]!="number"?1:0,g=s.x.scale*r.x,b=s.y.scale*r.y;d[0+m]/=g,d[1+m]/=b;const S=zr(g,b,.5);return typeof d[2+m]=="number"&&(d[2+m]/=S),typeof d[3+m]=="number"&&(d[3+m]/=S),p(d)}};let iT=!1;class Bue extends R.Component{componentDidMount(){const{visualElement:r,layoutGroup:s,switchLayoutGroup:o,layoutId:d}=this.props,{projection:p}=r;uce(Uue),p&&(s.group&&s.group.add(p),o&&o.register&&d&&o.register(p),iT&&p.root.didUpdate(),p.addEventListener("animationComplete",()=>{this.safeToRemove()}),p.setOptions({...p.options,onExitComplete:()=>this.safeToRemove()})),Ej.hasEverUpdated=!0}getSnapshotBeforeUpdate(r){const{layoutDependency:s,visualElement:o,drag:d,isPresent:p}=this.props,{projection:m}=o;return m&&(m.isPresent=p,iT=!0,d||r.layoutDependency!==s||s===void 0||r.isPresent!==p?m.willUpdate():this.safeToRemove(),r.isPresent!==p&&(p?m.promote():m.relegate()||_r.postRender(()=>{const g=m.getStack();(!g||!g.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:r}=this.props.visualElement;r&&(r.root.didUpdate(),R2.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:r,layoutGroup:s,switchLayoutGroup:o}=this.props,{projection:d}=r;iT=!0,d&&(d.scheduleCheckAfterUnmount(),s&&s.group&&s.group.remove(d),o&&o.deregister&&o.deregister(d))}safeToRemove(){const{safeToRemove:r}=this.props;r&&r()}render(){return null}}function kF(e){const[r,s]=rce(),o=R.useContext(a5);return u.jsx(Bue,{...e,layoutGroup:o,switchLayoutGroup:R.useContext(lF),isPresent:r,safeToRemove:s})}const Uue={borderRadius:{...ib,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ib,borderTopRightRadius:ib,borderBottomLeftRadius:ib,borderBottomRightRadius:ib,boxShadow:que};function Kue(e,r,s){const o=bi(e)?e:wg(e);return o.start(L2("",o,r,s)),o.animation}const Vue=(e,r)=>e.depth-r.depth;class Hue{constructor(){this.children=[],this.isDirty=!1}add(r){u2(this.children,r),this.isDirty=!0}remove(r){d2(this.children,r),this.isDirty=!0}forEach(r){this.isDirty&&this.children.sort(Vue),this.isDirty=!1,this.children.forEach(r)}}function Gue(e,r){const s=da.now(),o=({timestamp:d})=>{const p=d-s;p>=r&&(Ud(o),e(p-r))};return _r.setup(o,!0),()=>Ud(o)}const RF=["TopLeft","TopRight","BottomLeft","BottomRight"],Xue=RF.length,f4=e=>typeof e=="string"?parseFloat(e):e,m4=e=>typeof e=="number"||tn.test(e);function Yue(e,r,s,o,d,p){d?(e.opacity=zr(0,s.opacity??1,Zue(o)),e.opacityExit=zr(r.opacity??1,0,Wue(o))):p&&(e.opacity=zr(r.opacity??1,s.opacity??1,o));for(let m=0;mor?1:s(Bb(e,r,o))}function y4(e,r){e.min=r.min,e.max=r.max}function to(e,r){y4(e.x,r.x),y4(e.y,r.y)}function v4(e,r){e.translate=r.translate,e.scale=r.scale,e.originPoint=r.originPoint,e.origin=r.origin}function x4(e,r,s,o,d){return e-=r,e=Yj(e,1/s,o),d!==void 0&&(e=Yj(e,1/d,o)),e}function Jue(e,r=0,s=1,o=.5,d,p=e,m=e){if(ac.test(r)&&(r=parseFloat(r),r=zr(m.min,m.max,r/100)-m.min),typeof r!="number")return;let g=zr(p.min,p.max,o);e===p&&(g-=r),e.min=x4(e.min,r,s,g,d),e.max=x4(e.max,r,s,g,d)}function b4(e,r,[s,o,d],p,m){Jue(e,r[s],r[o],r[d],r.scale,p,m)}const Que=["x","scaleX","originX"],ede=["y","scaleY","originY"];function w4(e,r,s,o){b4(e.x,r,Que,s?s.x:void 0,o?o.x:void 0),b4(e.y,r,ede,s?s.y:void 0,o?o.y:void 0)}function S4(e){return e.translate===0&&e.scale===1}function _F(e){return S4(e.x)&&S4(e.y)}function E4(e,r){return e.min===r.min&&e.max===r.max}function tde(e,r){return E4(e.x,r.x)&&E4(e.y,r.y)}function j4(e,r){return Math.round(e.min)===Math.round(r.min)&&Math.round(e.max)===Math.round(r.max)}function $F(e,r){return j4(e.x,r.x)&&j4(e.y,r.y)}function C4(e){return Mi(e.x)/Mi(e.y)}function A4(e,r){return e.translate===r.translate&&e.scale===r.scale&&e.originPoint===r.originPoint}class nde{constructor(){this.members=[]}add(r){u2(this.members,r),r.scheduleRender()}remove(r){if(d2(this.members,r),r===this.prevLead&&(this.prevLead=void 0),r===this.lead){const s=this.members[this.members.length-1];s&&this.promote(s)}}relegate(r){const s=this.members.findIndex(d=>r===d);if(s===0)return!1;let o;for(let d=s;d>=0;d--){const p=this.members[d];if(p.isPresent!==!1){o=p;break}}return o?(this.promote(o),!0):!1}promote(r,s){const o=this.lead;if(r!==o&&(this.prevLead=o,this.lead=r,r.show(),o)){o.instance&&o.scheduleRender(),r.scheduleRender(),r.resumeFrom=o,s&&(r.resumeFrom.preserveOpacity=!0),o.snapshot&&(r.snapshot=o.snapshot,r.snapshot.latestValues=o.animationValues||o.latestValues),r.root&&r.root.isUpdating&&(r.isLayoutDirty=!0);const{crossfade:d}=r.options;d===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(r=>{const{options:s,resumingFrom:o}=r;s.onExitComplete&&s.onExitComplete(),o&&o.options.onExitComplete&&o.options.onExitComplete()})}scheduleRender(){this.members.forEach(r=>{r.instance&&r.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function rde(e,r,s){let o="";const d=e.x.translate/r.x,p=e.y.translate/r.y,m=s?.z||0;if((d||p||m)&&(o=`translate3d(${d}px, ${p}px, ${m}px) `),(r.x!==1||r.y!==1)&&(o+=`scale(${1/r.x}, ${1/r.y}) `),s){const{transformPerspective:S,rotate:E,rotateX:A,rotateY:k,skewX:T,skewY:M}=s;S&&(o=`perspective(${S}px) ${o}`),E&&(o+=`rotate(${E}deg) `),A&&(o+=`rotateX(${A}deg) `),k&&(o+=`rotateY(${k}deg) `),T&&(o+=`skewX(${T}deg) `),M&&(o+=`skewY(${M}deg) `)}const g=e.x.scale*r.x,b=e.y.scale*r.y;return(g!==1||b!==1)&&(o+=`scale(${g}, ${b})`),o||"none"}const aT=["","X","Y","Z"],sde=1e3;let ide=0;function oT(e,r,s,o){const{latestValues:d}=r;d[e]&&(s[e]=d[e],r.setStaticValue(e,0),o&&(o[e]=0))}function NF(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:r}=e.options;if(!r)return;const s=vF(r);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:d,layoutId:p}=e.options;window.MotionCancelOptimisedAnimation(s,"transform",_r,!(d||p))}const{parent:o}=e;o&&!o.hasCheckedOptimisedAppear&&NF(o)}function DF({attachResizeListener:e,defaultParent:r,measureScroll:s,checkIsScrollRoot:o,resetTransform:d}){return class{constructor(m={},g=r?.()){this.id=ide++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(lde),this.nodes.forEach(hde),this.nodes.forEach(pde),this.nodes.forEach(cde)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=m,this.root=g?g.root||g:this,this.path=g?[...g.path,g]:[],this.parent=g,this.depth=g?g.depth+1:0;for(let b=0;bthis.root.updateBlockedByResize=!1;_r.read(()=>{A=window.innerWidth}),e(m,()=>{const T=window.innerWidth;T!==A&&(A=T,this.root.updateBlockedByResize=!0,E&&E(),E=Gue(k,250),Ej.hasAnimatedSinceResize&&(Ej.hasAnimatedSinceResize=!1,this.nodes.forEach(R4)))})}g&&this.root.registerSharedNode(g,this),this.options.animate!==!1&&S&&(g||b)&&this.addEventListener("didUpdate",({delta:E,hasLayoutChanged:A,hasRelativeLayoutChanged:k,layout:T})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const M=this.options.transition||S.getDefaultTransition()||vde,{onLayoutAnimationStart:I,onLayoutAnimationComplete:q}=S.getProps(),G=!this.targetLayout||!$F(this.targetLayout,T),K=!A&&k;if(this.options.layoutRoot||this.resumeFrom||K||A&&(G||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const X={...O2(M,"layout"),onPlay:I,onComplete:q};(S.shouldReduceMotion||this.options.layoutRoot)&&(X.delay=0,X.type=!1),this.startAnimation(X),this.setAnimationOrigin(E,K)}else A||R4(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=T})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const m=this.getStack();m&&m.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Ud(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(fde),this.animationId++)}getTransformTemplate(){const{visualElement:m}=this.options;return m&&m.getProps().transformTemplate}willUpdate(m=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&NF(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let E=0;E{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Mi(this.snapshot.measuredBox.x)&&!Mi(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let b=0;b{const ee=z/1e3;T4(A.x,m.x,ee),T4(A.y,m.y,ee),this.setTargetDelta(A),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Db(k,this.layout.layoutBox,this.relativeParent.layout.layoutBox),gde(this.relativeTarget,this.relativeTargetOrigin,k,ee),X&&tde(this.relativeTarget,X)&&(this.isProjectionDirty=!1),X||(X=ns()),to(X,this.relativeTarget)),I&&(this.animationValues=E,Yue(E,S,this.latestValues,ee,K,G)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=ee},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(m){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Ud(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=_r.update(()=>{Ej.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=wg(0)),this.currentAnimation=Kue(this.motionValue,[0,1e3],{...m,velocity:0,isSync:!0,onUpdate:g=>{this.mixTargetDelta(g),m.onUpdate&&m.onUpdate(g)},onStop:()=>{},onComplete:()=>{m.onComplete&&m.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const m=this.getStack();m&&m.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(sde),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const m=this.getLead();let{targetWithTransforms:g,target:b,layout:S,latestValues:E}=m;if(!(!g||!b||!S)){if(this!==m&&this.layout&&S&&PF(this.options.animationType,this.layout.layoutBox,S.layoutBox)){b=this.target||ns();const A=Mi(this.layout.layoutBox.x);b.x.min=m.target.x.min,b.x.max=b.x.min+A;const k=Mi(this.layout.layoutBox.y);b.y.min=m.target.y.min,b.y.max=b.y.min+k}to(g,b),lg(g,E),Nb(this.projectionDeltaWithTransform,this.layoutCorrected,g,E)}}registerSharedNode(m,g){this.sharedNodes.has(m)||this.sharedNodes.set(m,new nde),this.sharedNodes.get(m).add(g);const S=g.options.initialPromotionConfig;g.promote({transition:S?S.transition:void 0,preserveFollowOpacity:S&&S.shouldPreserveFollowOpacity?S.shouldPreserveFollowOpacity(g):void 0})}isLead(){const m=this.getStack();return m?m.lead===this:!0}getLead(){const{layoutId:m}=this.options;return m?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:m}=this.options;return m?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:m}=this.options;if(m)return this.root.sharedNodes.get(m)}promote({needsReset:m,transition:g,preserveFollowOpacity:b}={}){const S=this.getStack();S&&S.promote(this,b),m&&(this.projectionDelta=void 0,this.needsReset=!0),g&&this.setOptions({transition:g})}relegate(){const m=this.getStack();return m?m.relegate(this):!1}resetSkewAndRotation(){const{visualElement:m}=this.options;if(!m)return;let g=!1;const{latestValues:b}=m;if((b.z||b.rotate||b.rotateX||b.rotateY||b.rotateZ||b.skewX||b.skewY)&&(g=!0),!g)return;const S={};b.z&&oT("z",m,S,this.animationValues);for(let E=0;Em.currentAnimation?.stop()),this.root.nodes.forEach(O4),this.root.sharedNodes.clear()}}}function ade(e){e.updateLayout()}function ode(e){const r=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&r&&e.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:o}=e.layout,{animationType:d}=e.options,p=r.source!==e.layout.source;d==="size"?no(E=>{const A=p?r.measuredBox[E]:r.layoutBox[E],k=Mi(A);A.min=s[E].min,A.max=A.min+k}):PF(d,r.layoutBox,s)&&no(E=>{const A=p?r.measuredBox[E]:r.layoutBox[E],k=Mi(s[E]);A.max=A.min+k,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[E].max=e.relativeTarget[E].min+k)});const m=cg();Nb(m,s,r.layoutBox);const g=cg();p?Nb(g,e.applyTransform(o,!0),r.measuredBox):Nb(g,s,r.layoutBox);const b=!_F(m);let S=!1;if(!e.resumeFrom){const E=e.getClosestProjectingParent();if(E&&!E.resumeFrom){const{snapshot:A,layout:k}=E;if(A&&k){const T=ns();Db(T,r.layoutBox,A.layoutBox);const M=ns();Db(M,s,k.layoutBox),$F(T,M)||(S=!0),E.options.layoutRoot&&(e.relativeTarget=M,e.relativeTargetOrigin=T,e.relativeParent=E)}}}e.notifyListeners("didUpdate",{layout:s,snapshot:r,delta:g,layoutDelta:m,hasLayoutChanged:b,hasRelativeLayoutChanged:S})}else if(e.isLead()){const{onExitComplete:s}=e.options;s&&s()}e.options.transition=void 0}function lde(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function cde(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ude(e){e.clearSnapshot()}function O4(e){e.clearMeasurements()}function k4(e){e.isLayoutDirty=!1}function dde(e){const{visualElement:r}=e.options;r&&r.getProps().onBeforeLayoutMeasure&&r.notify("BeforeLayoutMeasure"),e.resetTransform()}function R4(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function hde(e){e.resolveTargetDelta()}function pde(e){e.calcProjection()}function fde(e){e.resetSkewAndRotation()}function mde(e){e.removeLeadSnapshot()}function T4(e,r,s){e.translate=zr(r.translate,0,s),e.scale=zr(r.scale,1,s),e.origin=r.origin,e.originPoint=r.originPoint}function _4(e,r,s,o){e.min=zr(r.min,s.min,o),e.max=zr(r.max,s.max,o)}function gde(e,r,s,o){_4(e.x,r.x,s.x,o),_4(e.y,r.y,s.y,o)}function yde(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const vde={duration:.45,ease:[.4,0,.1,1]},$4=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),N4=$4("applewebkit/")&&!$4("chrome/")?Math.round:io;function D4(e){e.min=N4(e.min),e.max=N4(e.max)}function xde(e){D4(e.x),D4(e.y)}function PF(e,r,s){return e==="position"||e==="preserve-aspect"&&!Cue(C4(r),C4(s),.2)}function bde(e){return e!==e.root&&e.scroll?.wasRoot}const wde=DF({attachResizeListener:(e,r)=>Gb(e,"resize",r),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),lT={current:void 0},MF=DF({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!lT.current){const e=new wde({});e.mount(window),e.setOptions({layoutScroll:!0}),lT.current=e}return lT.current},resetTransform:(e,r)=>{e.style.transform=r!==void 0?r:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Sde={pan:{Feature:Fue},drag:{Feature:Lue,ProjectionNode:MF,MeasureLayout:kF}};function P4(e,r,s){const{props:o}=e;e.animationState&&o.whileHover&&e.animationState.setActive("whileHover",s==="Start");const d="onHover"+s,p=o[d];p&&_r.postRender(()=>p(r,mw(r)))}class Ede extends Yd{mount(){const{current:r}=this.node;r&&(this.unmount=Yle(r,(s,o)=>(P4(this.node,o,"Start"),d=>P4(this.node,d,"End"))))}unmount(){}}class jde extends Yd{constructor(){super(...arguments),this.isActive=!1}onFocus(){let r=!1;try{r=this.node.current.matches(":focus-visible")}catch{r=!0}!r||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=hw(Gb(this.node.current,"focus",()=>this.onFocus()),Gb(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function M4(e,r,s){const{props:o}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&o.whileTap&&e.animationState.setActive("whileTap",s==="Start");const d="onTap"+(s==="End"?"":s),p=o[d];p&&_r.postRender(()=>p(r,mw(r)))}class Cde extends Yd{mount(){const{current:r}=this.node;r&&(this.unmount=Qle(r,(s,o)=>(M4(this.node,o,"Start"),(d,{success:p})=>M4(this.node,d,p?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const c_=new WeakMap,cT=new WeakMap,Ade=e=>{const r=c_.get(e.target);r&&r(e)},Ode=e=>{e.forEach(Ade)};function kde({root:e,...r}){const s=e||document;cT.has(s)||cT.set(s,{});const o=cT.get(s),d=JSON.stringify(r);return o[d]||(o[d]=new IntersectionObserver(Ode,{root:e,...r})),o[d]}function Rde(e,r,s){const o=kde(r);return c_.set(e,s),o.observe(e),()=>{c_.delete(e),o.unobserve(e)}}const Tde={some:0,all:1};class _de extends Yd{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:r={}}=this.node.getProps(),{root:s,margin:o,amount:d="some",once:p}=r,m={root:s?s.current:void 0,rootMargin:o,threshold:typeof d=="number"?d:Tde[d]},g=b=>{const{isIntersecting:S}=b;if(this.isInView===S||(this.isInView=S,p&&!S&&this.hasEnteredView))return;S&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",S);const{onViewportEnter:E,onViewportLeave:A}=this.node.getProps(),k=S?E:A;k&&k(b)};return Rde(this.node.current,m,g)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:r,prevProps:s}=this.node;["amount","margin","root"].some($de(r,s))&&this.startObserver()}unmount(){}}function $de({viewport:e={}},{viewport:r={}}={}){return s=>e[s]!==r[s]}const Nde={inView:{Feature:_de},tap:{Feature:Cde},focus:{Feature:jde},hover:{Feature:Ede}},Dde={layout:{ProjectionNode:MF,MeasureLayout:kF}},Pde={...xue,...Nde,...Sde,...Dde},Mde=Pce(Pde,Xce),Ide=[{id:"light",icon:EW,label:"Light"},{id:"dark",icon:oW,label:"Dark"},{id:"system",icon:iW,label:"System"}],IF=({className:e="",variant:r="pill",ariaLabel:s="Toggle theme"})=>{const{theme:o,setTheme:d}=$_(),p=o??"system",m=r==="pill";return u.jsx("div",{className:ht("inline-flex items-center",m&&"bg-muted/70 rounded-full p-1 text-xs shadow-sm",!m&&"gap-2",e),"aria-label":s,role:"radiogroup",children:Ide.map(({id:g,icon:b,label:S})=>{const E=p===g;return u.jsxs("button",{type:"button",role:"radio","aria-checked":E,onClick:()=>d(g),"aria-label":m?S:void 0,className:ht("focus-visible:ring-ring focus-visible:ring-offset-background relative flex items-center justify-center rounded-full transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",E?"text-foreground border":"text-muted-foreground hover:text-foreground",m&&"h-8 w-8",!m&&"h-8 gap-2 px-3 text-sm font-medium"),children:[E&&u.jsx(Mde.span,{layoutId:"theme-switcher-pill",className:"bg-background absolute inset-0 rounded-full shadow-sm",transition:{type:"spring",stiffness:350,damping:26}}),u.jsx(b,{className:"relative z-10 h-4 w-4"}),!m&&u.jsx("span",{className:"relative z-10",children:S})]},g)})})};function zde(){return rr({queryKey:["me"],queryFn:()=>yp.getMe(),staleTime:300*1e3})}function Lde(e,r=[]){let s=[];function o(p,m){const g=R.createContext(m);g.displayName=p+"Context";const b=s.length;s=[...s,m];const S=A=>{const{scope:k,children:T,...M}=A,I=k?.[e]?.[b]||g,q=R.useMemo(()=>M,Object.values(M));return u.jsx(I.Provider,{value:q,children:T})};S.displayName=p+"Provider";function E(A,k){const T=k?.[e]?.[b]||g,M=R.useContext(T);if(M)return M;if(m!==void 0)return m;throw new Error(`\`${A}\` must be used within \`${p}\``)}return[S,E]}const d=()=>{const p=s.map(m=>R.createContext(m));return function(g){const b=g?.[e]||p;return R.useMemo(()=>({[`__scope${e}`]:{...g,[e]:b}}),[g,b])}};return d.scopeName=e,[o,Fde(d,...r)]}function Fde(...e){const r=e[0];if(e.length===1)return r;const s=()=>{const o=e.map(d=>({useScope:d(),scopeName:d.scopeName}));return function(p){const m=o.reduce((g,{useScope:b,scopeName:S})=>{const A=b(p)[`__scope${S}`];return{...g,...A}},{});return R.useMemo(()=>({[`__scope${r.scopeName}`]:m}),[m])}};return s.scopeName=r.scopeName,s}var qde=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],F2=qde.reduce((e,r)=>{const s=tw(`Primitive.${r}`),o=R.forwardRef((d,p)=>{const{asChild:m,...g}=d,b=m?s:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(b,{...g,ref:p})});return o.displayName=`Primitive.${r}`,{...e,[r]:o}},{}),uT={exports:{}},dT={};var I4;function Bde(){if(I4)return dT;I4=1;var e=U3();function r(A,k){return A===k&&(A!==0||1/A===1/k)||A!==A&&k!==k}var s=typeof Object.is=="function"?Object.is:r,o=e.useState,d=e.useEffect,p=e.useLayoutEffect,m=e.useDebugValue;function g(A,k){var T=k(),M=o({inst:{value:T,getSnapshot:k}}),I=M[0].inst,q=M[1];return p(function(){I.value=T,I.getSnapshot=k,b(I)&&q({inst:I})},[A,T,k]),d(function(){return b(I)&&q({inst:I}),A(function(){b(I)&&q({inst:I})})},[A]),m(T),T}function b(A){var k=A.getSnapshot;A=A.value;try{var T=k();return!s(A,T)}catch{return!0}}function S(A,k){return k()}var E=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?S:g;return dT.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:E,dT}var z4;function Ude(){return z4||(z4=1,uT.exports=Bde()),uT.exports}var Kde=Ude();function Vde(){return Kde.useSyncExternalStore(Hde,()=>!0,()=>!1)}function Hde(){return()=>{}}var q2="Avatar",[Gde]=Lde(q2),[Xde,zF]=Gde(q2),LF=R.forwardRef((e,r)=>{const{__scopeAvatar:s,...o}=e,[d,p]=R.useState("idle");return u.jsx(Xde,{scope:s,imageLoadingStatus:d,onImageLoadingStatusChange:p,children:u.jsx(F2.span,{...o,ref:r})})});LF.displayName=q2;var FF="AvatarImage",Yde=R.forwardRef((e,r)=>{const{__scopeAvatar:s,src:o,onLoadingStatusChange:d=()=>{},...p}=e,m=zF(FF,s),g=Zde(o,p),b=tl(S=>{d(S),m.onImageLoadingStatusChange(S)});return As(()=>{g!=="idle"&&b(g)},[g,b]),g==="loaded"?u.jsx(F2.img,{...p,ref:r,src:o}):null});Yde.displayName=FF;var qF="AvatarFallback",BF=R.forwardRef((e,r)=>{const{__scopeAvatar:s,delayMs:o,...d}=e,p=zF(qF,s),[m,g]=R.useState(o===void 0);return R.useEffect(()=>{if(o!==void 0){const b=window.setTimeout(()=>g(!0),o);return()=>window.clearTimeout(b)}},[o]),m&&p.imageLoadingStatus!=="loaded"?u.jsx(F2.span,{...d,ref:r}):null});BF.displayName=qF;function L4(e,r){return e?r?(e.src!==r&&(e.src=r),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function Zde(e,{referrerPolicy:r,crossOrigin:s}){const o=Vde(),d=R.useRef(null),p=o?(d.current||(d.current=new window.Image),d.current):null,[m,g]=R.useState(()=>L4(p,e));return As(()=>{g(L4(p,e))},[p,e]),As(()=>{const b=A=>()=>{g(A)};if(!p)return;const S=b("loaded"),E=b("error");return p.addEventListener("load",S),p.addEventListener("error",E),r&&(p.referrerPolicy=r),typeof s=="string"&&(p.crossOrigin=s),()=>{p.removeEventListener("load",S),p.removeEventListener("error",E)}},[p,s,r]),m}var Wde=LF,Jde=BF;function Qde({className:e,...r}){return u.jsx(Wde,{"data-slot":"avatar",className:ht("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...r})}function ehe({className:e,...r}){return u.jsx(Jde,{"data-slot":"avatar-fallback",className:ht("bg-muted flex size-full items-center justify-center rounded-full",e),...r})}function the({...e}){return u.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function nhe({className:e,...r}){return u.jsx("ol",{"data-slot":"breadcrumb-list",className:ht("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...r})}function F4({className:e,...r}){return u.jsx("li",{"data-slot":"breadcrumb-item",className:ht("inline-flex items-center gap-1.5",e),...r})}function q4({asChild:e,className:r,...s}){const o=e?Cg:"a";return u.jsx(o,{"data-slot":"breadcrumb-link",className:ht("hover:text-foreground transition-colors",r),...s})}function rhe({className:e,...r}){return u.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:ht("text-foreground font-normal",e),...r})}function she({children:e,className:r,...s}){return u.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:ht("[&>svg]:size-3.5",r),...s,children:e??u.jsx(wZ,{})})}const hT=768;function ihe(){const[e,r]=R.useState(void 0);return R.useEffect(()=>{const s=window.matchMedia(`(max-width: ${hT-1}px)`),o=()=>{r(window.innerWidths.removeEventListener("change",o)},[]),!!e}function xt({className:e,type:r,...s}){return u.jsx("input",{type:r,"data-slot":"input",className:ht("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...s})}function ahe({...e}){return u.jsx(_C,{"data-slot":"sheet",...e})}function ohe({...e}){return u.jsx($C,{"data-slot":"sheet-portal",...e})}function lhe({className:e,...r}){return u.jsx(NC,{"data-slot":"sheet-overlay",className:ht("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...r})}function che({className:e,children:r,side:s="right",...o}){return u.jsxs(ohe,{children:[u.jsx(lhe,{}),u.jsxs(DC,{"data-slot":"sheet-content",className:ht("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",s==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",s==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",s==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",s==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...o,children:[r,u.jsxs(cw,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[u.jsx(F_,{className:"size-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function uhe({className:e,...r}){return u.jsx("div",{"data-slot":"sheet-header",className:ht("flex flex-col gap-1.5 p-4",e),...r})}function dhe({className:e,...r}){return u.jsx(s2,{"data-slot":"sheet-title",className:ht("text-foreground font-semibold",e),...r})}function hhe({className:e,...r}){return u.jsx(i2,{"data-slot":"sheet-description",className:ht("text-muted-foreground text-sm",e),...r})}const phe="sidebar_state",fhe=3600*24*7,mhe="16rem",ghe="18rem",yhe="3rem",vhe="b",UF=R.createContext(null);function B2(){const e=R.useContext(UF);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function xhe({defaultOpen:e=!0,open:r,onOpenChange:s,className:o,style:d,children:p,...m}){const g=ihe(),[b,S]=R.useState(!1),[E,A]=R.useState(e),k=r??E,T=R.useCallback(G=>{const K=typeof G=="function"?G(k):G;s?s(K):A(K),document.cookie=`${phe}=${K}; path=/; max-age=${fhe}`},[s,k]),M=R.useCallback(()=>g?S(G=>!G):T(G=>!G),[g,T,S]);R.useEffect(()=>{const G=K=>{K.key===vhe&&(K.metaKey||K.ctrlKey)&&(K.preventDefault(),M())};return window.addEventListener("keydown",G),()=>window.removeEventListener("keydown",G)},[M]);const I=k?"expanded":"collapsed",q=R.useMemo(()=>({state:I,open:k,setOpen:T,isMobile:g,openMobile:b,setOpenMobile:S,toggleSidebar:M}),[I,k,T,g,b,S,M]);return u.jsx(UF.Provider,{value:q,children:u.jsx(iw,{delayDuration:0,children:u.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":mhe,"--sidebar-width-icon":yhe,...d},className:ht("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",o),...m,children:p})})})}function bhe({side:e="left",variant:r="sidebar",collapsible:s="offcanvas",className:o,children:d,...p}){const{isMobile:m,state:g,openMobile:b,setOpenMobile:S}=B2();return s==="none"?u.jsx("div",{"data-slot":"sidebar",className:ht("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",o),...p,children:d}):m?u.jsx(ahe,{open:b,onOpenChange:S,...p,children:u.jsxs(che,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":ghe},side:e,children:[u.jsxs(uhe,{className:"sr-only",children:[u.jsx(dhe,{children:"Sidebar"}),u.jsx(hhe,{children:"Displays the mobile sidebar."})]}),u.jsx("div",{className:"flex h-full w-full flex-col",children:d})]})}):u.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":g,"data-collapsible":g==="collapsed"?s:"","data-variant":r,"data-side":e,"data-slot":"sidebar",children:[u.jsx("div",{"data-slot":"sidebar-gap",className:ht("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",r==="floating"||r==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),u.jsx("div",{"data-slot":"sidebar-container",className:ht("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",r==="floating"||r==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",o),...p,children:u.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:d})})]})}function whe({className:e,onClick:r,...s}){const{toggleSidebar:o}=B2();return u.jsxs(Fe,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:ht("size-7",e),onClick:d=>{r?.(d),o()},...s,children:[u.jsx(pW,{}),u.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function She({className:e,...r}){return u.jsx("main",{"data-slot":"sidebar-inset",className:ht("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...r})}function Ehe({className:e,...r}){return u.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:ht("flex flex-col gap-2 p-2",e),...r})}function jhe({className:e,...r}){return u.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:ht("flex flex-col gap-2 p-2",e),...r})}function Che({className:e,...r}){return u.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:ht("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...r})}function rj({className:e,...r}){return u.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:ht("relative flex w-full min-w-0 flex-col p-2",e),...r})}function sj({className:e,asChild:r=!1,...s}){const o=r?Cg:"div";return u.jsx(o,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:ht("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...s})}function ij({className:e,...r}){return u.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:ht("w-full text-sm",e),...r})}function aj({className:e,...r}){return u.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:ht("flex w-full min-w-0 flex-col gap-1",e),...r})}function oj({className:e,...r}){return u.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:ht("group/menu-item relative",e),...r})}const Ahe=B_("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function lj({asChild:e=!1,isActive:r=!1,variant:s="default",size:o="default",tooltip:d,className:p,...m}){const g=e?Cg:"button",{isMobile:b,state:S}=B2(),E=u.jsx(g,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":o,"data-active":r,className:ht(Ahe({variant:s,size:o}),p),...m});return d?(typeof d=="string"&&(d={children:d}),u.jsxs(zj,{children:[u.jsx(Lj,{asChild:!0,children:E}),u.jsx(Fj,{side:"right",align:"center",hidden:S!=="collapsed"||b,...d})]})):E}const Ohe=()=>{const e=T_(),{data:r,isLoading:s}=zde(),o=R.useMemo(()=>{const p=e.pathname.split("/").filter(Boolean),m=[];let g="";for(const b of p)g+=`/${b}`,m.push({to:g,label:b});return m},[e.pathname]),d=R.useMemo(()=>{if(!r)return"U";const m=(r.display_name||r.primary_email||"").trim().split(/\s+/);return m.length>=2?(m[0][0]+m[1][0]).toUpperCase():m.length===1&&m[0]?m[0][0].toUpperCase():"U"},[r]);return u.jsxs("div",{className:"flex h-12 items-center gap-2 border-b px-3",children:[u.jsx(whe,{}),u.jsx("div",{className:"flex-1",children:u.jsx(the,{children:u.jsxs(nhe,{children:[u.jsx(F4,{children:u.jsx(q4,{asChild:!0,children:u.jsx(OR,{to:"/",children:"Home"})})}),o.map((p,m)=>u.jsxs("span",{className:"flex items-center",children:[u.jsx(she,{}),u.jsx(F4,{children:m===o.length-1?u.jsx(rhe,{className:"capitalize",children:p.label}):u.jsx(q4,{asChild:!0,children:u.jsx(OR,{to:p.to,className:"capitalize",children:p.label})})})]},p.to))]})})}),u.jsx(IF,{variant:"wide"}),u.jsx(Fe,{variant:"ghost",size:"sm",asChild:!0,children:u.jsx(OR,{to:"/me",children:s?"…":r?.display_name||"Profile"})}),u.jsx(Qde,{className:"h-7 w-7",children:u.jsx(ehe,{children:d})})]})};async function khe(){const e=Ks.get();if(!e?.refresh_token){Ks.logout();return}try{const r={refresh_token:e.refresh_token};await Xee().logout({dtoLogoutRequest:r})}catch(r){console.warn("Logout API failed; clearing local state anyway",r)}finally{Ks.logout()}}function Rhe(){return{logout:R.useCallback(()=>khe(),[])}}const The=()=>{const[e,r]=R.useState([]),{logout:s}=Rhe();return R.useEffect(()=>{let o=!0;return(async()=>{try{const p=((await yp.getMe()).organizations??[]).map(m=>({id:m.id,name:m.name??m.id}));if(!o)return;r(p),!Qo.get()&&p.length>0&&Qo.set(p[0].id)}catch{}})(),()=>{o=!1}},[]),u.jsxs(xhe,{defaultOpen:!0,children:[u.jsxs(bhe,{collapsible:"icon",variant:"floating",children:[u.jsx(Ehe,{children:u.jsx("div",{className:"px-2 py-2",children:u.jsx(roe,{orgs:e})})}),u.jsxs(Che,{children:[u.jsxs(rj,{children:[u.jsx(sj,{children:"Navigation"}),u.jsx(ij,{children:u.jsx(aj,{children:Use.map(o=>u.jsx(oj,{children:u.jsx(lj,{asChild:!0,tooltip:o.label,children:u.jsxs(LE,{to:o.to,className:({isActive:d})=>ht("flex items-center gap-2",d&&"text-primary"),children:[u.jsx(o.icon,{className:"h-4 w-4"}),u.jsx("span",{children:o.label})]})})},o.to))})})]}),u.jsxs(rj,{children:[u.jsx(sj,{children:"Organization"}),u.jsx(ij,{children:u.jsx(aj,{children:Kse.map(o=>u.jsx(oj,{children:u.jsx(lj,{asChild:!0,tooltip:o.label,children:u.jsxs(LE,{to:o.to,className:({isActive:d})=>ht("flex items-center gap-2",d&&"text-primary"),children:[u.jsx(o.icon,{className:"h-4 w-4"}),u.jsx("span",{children:o.label})]})})},o.to))})})]}),u.jsxs(rj,{children:[u.jsx(sj,{children:"User"}),u.jsx(ij,{children:u.jsx(aj,{children:Vse.map(o=>u.jsx(oj,{children:u.jsx(lj,{asChild:!0,tooltip:o.label,children:u.jsxs(LE,{to:o.to,className:({isActive:d})=>ht("flex items-center gap-2",d&&"text-primary"),children:[u.jsx(o.icon,{className:"h-4 w-4"}),u.jsx("span",{children:o.label})]})})},o.to))})})]}),u.jsxs(rj,{children:[u.jsx(sj,{children:"Admin"}),u.jsx(ij,{children:u.jsx(aj,{children:Hse.map(o=>u.jsx(oj,{children:u.jsx(lj,{asChild:!0,tooltip:o.label,children:u.jsxs(LE,{to:o.to,target:o.target?o.target:"_self",className:({isActive:d})=>ht("flex items-center gap-2",d&&"text-primary"),children:[u.jsx(o.icon,{className:"h-4 w-4"}),u.jsx("span",{children:o.label})]})})},o.to))})})]}),u.jsx("div",{className:"mt-auto flex items-center justify-center p-3",children:u.jsx(IF,{})})]}),u.jsx(jhe,{children:u.jsx("div",{className:"px-2 py-2",children:u.jsx(Fe,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>void s(),children:"Sign out"})})})]}),u.jsxs(She,{className:"flex min-h-screen flex-col",children:[u.jsx(Ohe,{}),u.jsx("main",{className:"p-4",children:u.jsx(K3,{})}),u.jsx(Tse,{})]})]})},_he=()=>{const e=R.useSyncExternalStore(r=>Ks.subscribe(r),()=>Ks.get(),()=>Ks.get());return{tokens:e,authed:!!e?.access_token,isExpired:Ks.isExpired(),willExpireSoon:Ks.willExpireSoon()}},$he=()=>{const{authed:e}=_he(),r=T_();return e?u.jsx(K3,{}):u.jsx(pY,{to:`/login?to=${encodeURIComponent(r.pathname+r.search)}`,replace:!0})},ab=tte(),Sb={listAnnotations:()=>ut(async()=>await ab.listAnnotations()),createAnnotation:e=>ut(async()=>await ab.createAnnotation({dtoCreateAnnotationRequest:e})),getAnnotation:e=>ut(async()=>await ab.getAnnotation({id:e})),deleteAnnotation:e=>ut(async()=>{await ab.deleteAnnotation({id:e})}),updateAnnotation:(e,r)=>ut(async()=>await ab.updateAnnotation({id:e,dtoUpdateAnnotationRequest:r}))};var gw=e=>e.type==="checkbox",wp=e=>e instanceof Date,ua=e=>e==null;const KF=e=>typeof e=="object";var gs=e=>!ua(e)&&!Array.isArray(e)&&KF(e)&&!wp(e),VF=e=>gs(e)&&e.target?gw(e.target)?e.target.checked:e.target.value:e,Nhe=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,HF=(e,r)=>e.has(Nhe(r)),Dhe=e=>{const r=e.constructor&&e.constructor.prototype;return gs(r)&&r.hasOwnProperty("isPrototypeOf")},U2=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function js(e){let r;const s=Array.isArray(e),o=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)r=new Date(e);else if(!(U2&&(e instanceof Blob||o))&&(s||gs(e)))if(r=s?[]:Object.create(Object.getPrototypeOf(e)),!s&&!Dhe(e))r=e;else for(const d in e)e.hasOwnProperty(d)&&(r[d]=js(e[d]));else return e;return r}var FC=e=>/^\w*$/.test(e),Hr=e=>e===void 0,K2=e=>Array.isArray(e)?e.filter(Boolean):[],V2=e=>K2(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Et=(e,r,s)=>{if(!r||!gs(e))return s;const o=(FC(r)?[r]:V2(r)).reduce((d,p)=>ua(d)?d:d[p],e);return Hr(o)||o===e?Hr(e[r])?s:e[r]:o},Ta=e=>typeof e=="boolean",dr=(e,r,s)=>{let o=-1;const d=FC(r)?[r]:V2(r),p=d.length,m=p-1;for(;++oJe.useContext(H2),Phe=e=>{const{children:r,...s}=e;return Je.createElement(H2.Provider,{value:s},r)};var GF=(e,r,s,o=!0)=>{const d={defaultValues:r._defaultValues};for(const p in e)Object.defineProperty(d,p,{get:()=>{const m=p;return r._proxyFormState[m]!==Zo.all&&(r._proxyFormState[m]=!o||Zo.all),s&&(s[m]=!0),e[m]}});return d};const G2=typeof window<"u"?Je.useLayoutEffect:Je.useEffect;function XF(e){const r=qC(),{control:s=r.control,disabled:o,name:d,exact:p}=e||{},[m,g]=Je.useState(s._formState),b=Je.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return G2(()=>s._subscribe({name:d,formState:b.current,exact:p,callback:S=>{!o&&g({...s._formState,...S})}}),[d,o,p]),Je.useEffect(()=>{b.current.isValid&&s._setValid(!0)},[s]),Je.useMemo(()=>GF(m,s,b.current,!1),[m,s])}var $a=e=>typeof e=="string",u_=(e,r,s,o,d)=>$a(e)?(o&&r.watch.add(e),Et(s,e,d)):Array.isArray(e)?e.map(p=>(o&&r.watch.add(p),Et(s,p))):(o&&(r.watchAll=!0),s),d_=e=>ua(e)||!KF(e);function Wo(e,r,s=new WeakSet){if(d_(e)||d_(r))return e===r;if(wp(e)&&wp(r))return e.getTime()===r.getTime();const o=Object.keys(e),d=Object.keys(r);if(o.length!==d.length)return!1;if(s.has(e)||s.has(r))return!0;s.add(e),s.add(r);for(const p of o){const m=e[p];if(!d.includes(p))return!1;if(p!=="ref"){const g=r[p];if(wp(m)&&wp(g)||gs(m)&&gs(g)||Array.isArray(m)&&Array.isArray(g)?!Wo(m,g,s):m!==g)return!1}}return!0}function ug(e){const r=qC(),{control:s=r.control,name:o,defaultValue:d,disabled:p,exact:m,compute:g}=e||{},b=Je.useRef(d),S=Je.useRef(g),E=Je.useRef(void 0),A=Je.useRef(s),k=Je.useRef(o);S.current=g;const[T,M]=Je.useState(()=>{const z=s._getWatch(o,b.current);return S.current?S.current(z):z}),I=Je.useCallback(z=>{const ee=u_(o,s._names,z||s._formValues,!1,b.current);return S.current?S.current(ee):ee},[s._formValues,s._names,o]),q=Je.useCallback(z=>{if(!p){const ee=u_(o,s._names,z||s._formValues,!1,b.current);if(S.current){const oe=S.current(ee);Wo(oe,E.current)||(M(oe),E.current=oe)}else M(ee)}},[s._formValues,s._names,p,o]);G2(()=>((A.current!==s||!Wo(k.current,o))&&(A.current=s,k.current=o,q()),s._subscribe({name:o,formState:{values:!0},exact:m,callback:z=>{q(z.values)}})),[s,m,o,q]),Je.useEffect(()=>s._removeUnmounted());const G=A.current!==s,K=k.current,X=Je.useMemo(()=>{if(p)return null;const z=!G&&!Wo(K,o);return G||z?I():null},[p,G,o,K,I]);return X!==null?X:T}function Mhe(e){const r=qC(),{name:s,disabled:o,control:d=r.control,shouldUnregister:p,defaultValue:m}=e,g=HF(d._names.array,s),b=Je.useMemo(()=>Et(d._formValues,s,Et(d._defaultValues,s,m)),[d,s,m]),S=ug({control:d,name:s,defaultValue:b,exact:!0}),E=XF({control:d,name:s,exact:!0}),A=Je.useRef(e),k=Je.useRef(void 0),T=Je.useRef(d.register(s,{...e.rules,value:S,...Ta(e.disabled)?{disabled:e.disabled}:{}}));A.current=e;const M=Je.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Et(E.errors,s)},isDirty:{enumerable:!0,get:()=>!!Et(E.dirtyFields,s)},isTouched:{enumerable:!0,get:()=>!!Et(E.touchedFields,s)},isValidating:{enumerable:!0,get:()=>!!Et(E.validatingFields,s)},error:{enumerable:!0,get:()=>Et(E.errors,s)}}),[E,s]),I=Je.useCallback(X=>T.current.onChange({target:{value:VF(X),name:s},type:Zj.CHANGE}),[s]),q=Je.useCallback(()=>T.current.onBlur({target:{value:Et(d._formValues,s),name:s},type:Zj.BLUR}),[s,d._formValues]),G=Je.useCallback(X=>{const z=Et(d._fields,s);z&&X&&(z._f.ref={focus:()=>X.focus&&X.focus(),select:()=>X.select&&X.select(),setCustomValidity:ee=>X.setCustomValidity(ee),reportValidity:()=>X.reportValidity()})},[d._fields,s]),K=Je.useMemo(()=>({name:s,value:S,...Ta(o)||E.disabled?{disabled:E.disabled||o}:{},onChange:I,onBlur:q,ref:G}),[s,o,E.disabled,I,q,G,S]);return Je.useEffect(()=>{const X=d._options.shouldUnregister||p,z=k.current;z&&z!==s&&!g&&d.unregister(z),d.register(s,{...A.current.rules,...Ta(A.current.disabled)?{disabled:A.current.disabled}:{}});const ee=(oe,Q)=>{const ne=Et(d._fields,oe);ne&&ne._f&&(ne._f.mount=Q)};if(ee(s,!0),X){const oe=js(Et(d._options.defaultValues,s,A.current.defaultValue));dr(d._defaultValues,s,oe),Hr(Et(d._formValues,s))&&dr(d._formValues,s,oe)}return!g&&d.register(s),k.current=s,()=>{(g?X&&!d._state.action:X)?d.unregister(s):ee(s,!1)}},[s,d,g,p]),Je.useEffect(()=>{d._setDisabledField({disabled:o,name:s})},[o,s,d]),Je.useMemo(()=>({field:K,formState:E,fieldState:M}),[K,E,M])}const Go=e=>e.render(Mhe(e));var X2=(e,r,s,o,d)=>r?{...s[e],types:{...s[e]&&s[e].types?s[e].types:{},[o]:d||!0}}:{},Pb=e=>Array.isArray(e)?e:[e],B4=()=>{let e=[];return{get observers(){return e},next:d=>{for(const p of e)p.next&&p.next(d)},subscribe:d=>(e.push(d),{unsubscribe:()=>{e=e.filter(p=>p!==d)}}),unsubscribe:()=>{e=[]}}};function YF(e,r){const s={};for(const o in e)if(e.hasOwnProperty(o)){const d=e[o],p=r[o];if(d&&gs(d)&&p){const m=YF(d,p);gs(m)&&(s[o]=m)}else e[o]&&(s[o]=p)}return s}var Di=e=>gs(e)&&!Object.keys(e).length,Y2=e=>e.type==="file",Jo=e=>typeof e=="function",Wj=e=>{if(!U2)return!1;const r=e?e.ownerDocument:0;return e instanceof(r&&r.defaultView?r.defaultView.HTMLElement:HTMLElement)},ZF=e=>e.type==="select-multiple",Z2=e=>e.type==="radio",Ihe=e=>Z2(e)||gw(e),pT=e=>Wj(e)&&e.isConnected;function zhe(e,r){const s=r.slice(0,-1).length;let o=0;for(;o{for(const r in e)if(Jo(e[r]))return!0;return!1};function WF(e){return Array.isArray(e)||gs(e)&&!Fhe(e)}function h_(e,r={}){for(const s in e)WF(e[s])?(r[s]=Array.isArray(e[s])?[]:{},h_(e[s],r[s])):Hr(e[s])||(r[s]=!0);return r}function Jm(e,r,s){s||(s=h_(r));for(const o in e)WF(e[o])?Hr(r)||d_(s[o])?s[o]=h_(e[o],Array.isArray(e[o])?[]:{}):Jm(e[o],ua(r)?{}:r[o],s[o]):s[o]=!Wo(e[o],r[o]);return s}const U4={value:!1,isValid:!1},K4={value:!0,isValid:!0};var JF=e=>{if(Array.isArray(e)){if(e.length>1){const r=e.filter(s=>s&&s.checked&&!s.disabled).map(s=>s.value);return{value:r,isValid:!!r.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Hr(e[0].attributes.value)?Hr(e[0].value)||e[0].value===""?K4:{value:e[0].value,isValid:!0}:K4:U4}return U4},QF=(e,{valueAsNumber:r,valueAsDate:s,setValueAs:o})=>Hr(e)?e:r?e===""?NaN:e&&+e:s&&$a(e)?new Date(e):o?o(e):e;const V4={isValid:!1,value:null};var e6=e=>Array.isArray(e)?e.reduce((r,s)=>s&&s.checked&&!s.disabled?{isValid:!0,value:s.value}:r,V4):V4;function H4(e){const r=e.ref;return Y2(r)?r.files:Z2(r)?e6(e.refs).value:ZF(r)?[...r.selectedOptions].map(({value:s})=>s):gw(r)?JF(e.refs).value:QF(Hr(r.value)?e.ref.value:r.value,e)}var qhe=(e,r,s,o)=>{const d={};for(const p of e){const m=Et(r,p);m&&dr(d,p,m._f)}return{criteriaMode:s,names:[...e],fields:d,shouldUseNativeValidation:o}},Jj=e=>e instanceof RegExp,ob=e=>Hr(e)?e:Jj(e)?e.source:gs(e)?Jj(e.value)?e.value.source:e.value:e,G4=e=>({isOnSubmit:!e||e===Zo.onSubmit,isOnBlur:e===Zo.onBlur,isOnChange:e===Zo.onChange,isOnAll:e===Zo.all,isOnTouch:e===Zo.onTouched});const X4="AsyncFunction";var Bhe=e=>!!e&&!!e.validate&&!!(Jo(e.validate)&&e.validate.constructor.name===X4||gs(e.validate)&&Object.values(e.validate).find(r=>r.constructor.name===X4)),Uhe=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Y4=(e,r,s)=>!s&&(r.watchAll||r.watch.has(e)||[...r.watch].some(o=>e.startsWith(o)&&/^\.\w+/.test(e.slice(o.length))));const Mb=(e,r,s,o)=>{for(const d of s||Object.keys(e)){const p=Et(e,d);if(p){const{_f:m,...g}=p;if(m){if(m.refs&&m.refs[0]&&r(m.refs[0],d)&&!o)return!0;if(m.ref&&r(m.ref,m.name)&&!o)return!0;if(Mb(g,r))break}else if(gs(g)&&Mb(g,r))break}}};function Z4(e,r,s){const o=Et(e,s);if(o||FC(s))return{error:o,name:s};const d=s.split(".");for(;d.length;){const p=d.join("."),m=Et(r,p),g=Et(e,p);if(m&&!Array.isArray(m)&&s!==p)return{name:s};if(g&&g.type)return{name:p,error:g};if(g&&g.root&&g.root.type)return{name:`${p}.root`,error:g.root};d.pop()}return{name:s}}var Khe=(e,r,s,o)=>{s(e);const{name:d,...p}=e;return Di(p)||Object.keys(p).length>=Object.keys(r).length||Object.keys(p).find(m=>r[m]===(!o||Zo.all))},Vhe=(e,r,s)=>!e||!r||e===r||Pb(e).some(o=>o&&(s?o===r:o.startsWith(r)||r.startsWith(o))),Hhe=(e,r,s,o,d)=>d.isOnAll?!1:!s&&d.isOnTouch?!(r||e):(s?o.isOnBlur:d.isOnBlur)?!e:(s?o.isOnChange:d.isOnChange)?e:!0,Ghe=(e,r)=>!K2(Et(e,r)).length&&fs(e,r),Xhe=(e,r,s)=>{const o=Pb(Et(e,s));return dr(o,"root",r[s]),dr(e,s,o),e};function W4(e,r,s="validate"){if($a(e)||Array.isArray(e)&&e.every($a)||Ta(e)&&!e)return{type:s,message:$a(e)?e:"",ref:r}}var Xm=e=>gs(e)&&!Jj(e)?e:{value:e,message:""},J4=async(e,r,s,o,d,p)=>{const{ref:m,refs:g,required:b,maxLength:S,minLength:E,min:A,max:k,pattern:T,validate:M,name:I,valueAsNumber:q,mount:G}=e._f,K=Et(s,I);if(!G||r.has(I))return{};const X=g?g[0]:m,z=le=>{d&&X.reportValidity&&(X.setCustomValidity(Ta(le)?"":le||""),X.reportValidity())},ee={},oe=Z2(m),Q=gw(m),ne=oe||Q,de=(q||Y2(m))&&Hr(m.value)&&Hr(K)||Wj(m)&&m.value===""||K===""||Array.isArray(K)&&!K.length,Ce=X2.bind(null,I,o,ee),xe=(le,be,je,Ke=cu.maxLength,ce=cu.minLength)=>{const re=le?be:je;ee[I]={type:le?Ke:ce,message:re,ref:m,...Ce(le?Ke:ce,re)}};if(p?!Array.isArray(K)||!K.length:b&&(!ne&&(de||ua(K))||Ta(K)&&!K||Q&&!JF(g).isValid||oe&&!e6(g).isValid)){const{value:le,message:be}=$a(b)?{value:!!b,message:b}:Xm(b);if(le&&(ee[I]={type:cu.required,message:be,ref:X,...Ce(cu.required,be)},!o))return z(be),ee}if(!de&&(!ua(A)||!ua(k))){let le,be;const je=Xm(k),Ke=Xm(A);if(!ua(K)&&!isNaN(K)){const ce=m.valueAsNumber||K&&+K;ua(je.value)||(le=ce>je.value),ua(Ke.value)||(be=cenew Date(new Date().toDateString()+" "+fe),ue=m.type=="time",_e=m.type=="week";$a(je.value)&&K&&(le=ue?re(K)>re(je.value):_e?K>je.value:ce>new Date(je.value)),$a(Ke.value)&&K&&(be=ue?re(K)+le.value,Ke=!ua(be.value)&&K.length<+be.value;if((je||Ke)&&(xe(je,le.message,be.message),!o))return z(ee[I].message),ee}if(T&&!de&&$a(K)){const{value:le,message:be}=Xm(T);if(Jj(le)&&!K.match(le)&&(ee[I]={type:cu.pattern,message:be,ref:m,...Ce(cu.pattern,be)},!o))return z(be),ee}if(M){if(Jo(M)){const le=await M(K,s),be=W4(le,X);if(be&&(ee[I]={...be,...Ce(cu.validate,be.message)},!o))return z(be.message),ee}else if(gs(M)){let le={};for(const be in M){if(!Di(le)&&!o)break;const je=W4(await M[be](K,s),X,be);je&&(le={...je,...Ce(be,je.message)},z(je.message),o&&(ee[I]=le))}if(!Di(le)&&(ee[I]={ref:X,...le},!o))return ee}}return z(!0),ee};const Yhe={mode:Zo.onSubmit,reValidateMode:Zo.onChange,shouldFocusError:!0};function Zhe(e={}){let r={...Yhe,...e},s={submitCount:0,isDirty:!1,isReady:!1,isLoading:Jo(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},o={},d=gs(r.defaultValues)||gs(r.values)?js(r.defaultValues||r.values)||{}:{},p=r.shouldUnregister?{}:js(d),m={action:!1,mount:!1,watch:!1},g={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},b,S=0;const E={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let A={...E};const k={array:B4(),state:B4()},T=r.criteriaMode===Zo.all,M=ve=>De=>{clearTimeout(S),S=setTimeout(ve,De)},I=async ve=>{if(!r.disabled&&(E.isValid||A.isValid||ve)){const De=r.resolver?Di((await Q()).errors):await de(o,!0);De!==s.isValid&&k.state.next({isValid:De})}},q=(ve,De)=>{!r.disabled&&(E.isValidating||E.validatingFields||A.isValidating||A.validatingFields)&&((ve||Array.from(g.mount)).forEach(Ge=>{Ge&&(De?dr(s.validatingFields,Ge,De):fs(s.validatingFields,Ge))}),k.state.next({validatingFields:s.validatingFields,isValidating:!Di(s.validatingFields)}))},G=(ve,De=[],Ge,D,L=!0,H=!0)=>{if(D&&Ge&&!r.disabled){if(m.action=!0,H&&Array.isArray(Et(o,ve))){const W=Ge(Et(o,ve),D.argA,D.argB);L&&dr(o,ve,W)}if(H&&Array.isArray(Et(s.errors,ve))){const W=Ge(Et(s.errors,ve),D.argA,D.argB);L&&dr(s.errors,ve,W),Ghe(s.errors,ve)}if((E.touchedFields||A.touchedFields)&&H&&Array.isArray(Et(s.touchedFields,ve))){const W=Ge(Et(s.touchedFields,ve),D.argA,D.argB);L&&dr(s.touchedFields,ve,W)}(E.dirtyFields||A.dirtyFields)&&(s.dirtyFields=Jm(d,p)),k.state.next({name:ve,isDirty:xe(ve,De),dirtyFields:s.dirtyFields,errors:s.errors,isValid:s.isValid})}else dr(p,ve,De)},K=(ve,De)=>{dr(s.errors,ve,De),k.state.next({errors:s.errors})},X=ve=>{s.errors=ve,k.state.next({errors:s.errors,isValid:!1})},z=(ve,De,Ge,D)=>{const L=Et(o,ve);if(L){const H=Et(p,ve,Hr(Ge)?Et(d,ve):Ge);Hr(H)||D&&D.defaultChecked||De?dr(p,ve,De?H:H4(L._f)):je(ve,H),m.mount&&I()}},ee=(ve,De,Ge,D,L)=>{let H=!1,W=!1;const we={name:ve};if(!r.disabled){if(!Ge||D){(E.isDirty||A.isDirty)&&(W=s.isDirty,s.isDirty=we.isDirty=xe(),H=W!==we.isDirty);const Re=Wo(Et(d,ve),De);W=!!Et(s.dirtyFields,ve),Re?fs(s.dirtyFields,ve):dr(s.dirtyFields,ve,!0),we.dirtyFields=s.dirtyFields,H=H||(E.dirtyFields||A.dirtyFields)&&W!==!Re}if(Ge){const Re=Et(s.touchedFields,ve);Re||(dr(s.touchedFields,ve,Ge),we.touchedFields=s.touchedFields,H=H||(E.touchedFields||A.touchedFields)&&Re!==Ge)}H&&L&&k.state.next(we)}return H?we:{}},oe=(ve,De,Ge,D)=>{const L=Et(s.errors,ve),H=(E.isValid||A.isValid)&&Ta(De)&&s.isValid!==De;if(r.delayError&&Ge?(b=M(()=>K(ve,Ge)),b(r.delayError)):(clearTimeout(S),b=null,Ge?dr(s.errors,ve,Ge):fs(s.errors,ve)),(Ge?!Wo(L,Ge):L)||!Di(D)||H){const W={...D,...H&&Ta(De)?{isValid:De}:{},errors:s.errors,name:ve};s={...s,...W},k.state.next(W)}},Q=async ve=>{q(ve,!0);const De=await r.resolver(p,r.context,qhe(ve||g.mount,o,r.criteriaMode,r.shouldUseNativeValidation));return q(ve),De},ne=async ve=>{const{errors:De}=await Q(ve);if(ve)for(const Ge of ve){const D=Et(De,Ge);D?dr(s.errors,Ge,D):fs(s.errors,Ge)}else s.errors=De;return De},de=async(ve,De,Ge={valid:!0})=>{for(const D in ve){const L=ve[D];if(L){const{_f:H,...W}=L;if(H){const we=g.array.has(H.name),Re=L._f&&Bhe(L._f);Re&&E.validatingFields&&q([H.name],!0);const st=await J4(L,g.disabled,p,T,r.shouldUseNativeValidation&&!De,we);if(Re&&E.validatingFields&&q([H.name]),st[H.name]&&(Ge.valid=!1,De))break;!De&&(Et(st,H.name)?we?Xhe(s.errors,st,H.name):dr(s.errors,H.name,st[H.name]):fs(s.errors,H.name))}!Di(W)&&await de(W,De,Ge)}}return Ge.valid},Ce=()=>{for(const ve of g.unMount){const De=Et(o,ve);De&&(De._f.refs?De._f.refs.every(Ge=>!pT(Ge)):!pT(De._f.ref))&&ze(ve)}g.unMount=new Set},xe=(ve,De)=>!r.disabled&&(ve&&De&&dr(p,ve,De),!Wo(fe(),d)),le=(ve,De,Ge)=>u_(ve,g,{...m.mount?p:Hr(De)?d:$a(ve)?{[ve]:De}:De},Ge,De),be=ve=>K2(Et(m.mount?p:d,ve,r.shouldUnregister?Et(d,ve,[]):[])),je=(ve,De,Ge={})=>{const D=Et(o,ve);let L=De;if(D){const H=D._f;H&&(!H.disabled&&dr(p,ve,QF(De,H)),L=Wj(H.ref)&&ua(De)?"":De,ZF(H.ref)?[...H.ref.options].forEach(W=>W.selected=L.includes(W.value)):H.refs?gw(H.ref)?H.refs.forEach(W=>{(!W.defaultChecked||!W.disabled)&&(Array.isArray(L)?W.checked=!!L.find(we=>we===W.value):W.checked=L===W.value||!!L)}):H.refs.forEach(W=>W.checked=W.value===L):Y2(H.ref)?H.ref.value="":(H.ref.value=L,H.ref.type||k.state.next({name:ve,values:js(p)})))}(Ge.shouldDirty||Ge.shouldTouch)&&ee(ve,L,Ge.shouldTouch,Ge.shouldDirty,!0),Ge.shouldValidate&&_e(ve)},Ke=(ve,De,Ge)=>{for(const D in De){if(!De.hasOwnProperty(D))return;const L=De[D],H=ve+"."+D,W=Et(o,H);(g.array.has(ve)||gs(L)||W&&!W._f)&&!wp(L)?Ke(H,L,Ge):je(H,L,Ge)}},ce=(ve,De,Ge={})=>{const D=Et(o,ve),L=g.array.has(ve),H=js(De);dr(p,ve,H),L?(k.array.next({name:ve,values:js(p)}),(E.isDirty||E.dirtyFields||A.isDirty||A.dirtyFields)&&Ge.shouldDirty&&k.state.next({name:ve,dirtyFields:Jm(d,p),isDirty:xe(ve,H)})):D&&!D._f&&!ua(H)?Ke(ve,H,Ge):je(ve,H,Ge),Y4(ve,g)&&k.state.next({...s,name:ve}),k.state.next({name:m.mount?ve:void 0,values:js(p)})},re=async ve=>{m.mount=!0;const De=ve.target;let Ge=De.name,D=!0;const L=Et(o,Ge),H=Re=>{D=Number.isNaN(Re)||wp(Re)&&isNaN(Re.getTime())||Wo(Re,Et(p,Ge,Re))},W=G4(r.mode),we=G4(r.reValidateMode);if(L){let Re,st;const Kt=De.type?H4(L._f):VF(ve),Qt=ve.type===Zj.BLUR||ve.type===Zj.FOCUS_OUT,Fn=!Uhe(L._f)&&!r.resolver&&!Et(s.errors,Ge)&&!L._f.deps||Hhe(Qt,Et(s.touchedFields,Ge),s.isSubmitted,we,W),dn=Y4(Ge,g,Qt);dr(p,Ge,Kt),Qt?(!De||!De.readOnly)&&(L._f.onBlur&&L._f.onBlur(ve),b&&b(0)):L._f.onChange&&L._f.onChange(ve);const Ht=ee(Ge,Kt,Qt),wi=!Di(Ht)||dn;if(!Qt&&k.state.next({name:Ge,type:ve.type,values:js(p)}),Fn)return(E.isValid||A.isValid)&&(r.mode==="onBlur"?Qt&&I():Qt||I()),wi&&k.state.next({name:Ge,...dn?{}:Ht});if(!Qt&&dn&&k.state.next({...s}),r.resolver){const{errors:Xr}=await Q([Ge]);if(H(Kt),D){const fa=Z4(s.errors,o,Ge),ho=Z4(Xr,o,fa.name||Ge);Re=ho.error,Ge=ho.name,st=Di(Xr)}}else q([Ge],!0),Re=(await J4(L,g.disabled,p,T,r.shouldUseNativeValidation))[Ge],q([Ge]),H(Kt),D&&(Re?st=!1:(E.isValid||A.isValid)&&(st=await de(o,!0)));D&&(L._f.deps&&(!Array.isArray(L._f.deps)||L._f.deps.length>0)&&_e(L._f.deps),oe(Ge,st,Re,Ht))}},ue=(ve,De)=>{if(Et(s.errors,De)&&ve.focus)return ve.focus(),1},_e=async(ve,De={})=>{let Ge,D;const L=Pb(ve);if(r.resolver){const H=await ne(Hr(ve)?ve:L);Ge=Di(H),D=ve?!L.some(W=>Et(H,W)):Ge}else ve?(D=(await Promise.all(L.map(async H=>{const W=Et(o,H);return await de(W&&W._f?{[H]:W}:W)}))).every(Boolean),!(!D&&!s.isValid)&&I()):D=Ge=await de(o);return k.state.next({...!$a(ve)||(E.isValid||A.isValid)&&Ge!==s.isValid?{}:{name:ve},...r.resolver||!ve?{isValid:Ge}:{},errors:s.errors}),De.shouldFocus&&!D&&Mb(o,ue,ve?L:g.mount),D},fe=(ve,De)=>{let Ge={...m.mount?p:d};return De&&(Ge=YF(De.dirtyFields?s.dirtyFields:s.touchedFields,Ge)),Hr(ve)?Ge:$a(ve)?Et(Ge,ve):ve.map(D=>Et(Ge,D))},He=(ve,De)=>({invalid:!!Et((De||s).errors,ve),isDirty:!!Et((De||s).dirtyFields,ve),error:Et((De||s).errors,ve),isValidating:!!Et(s.validatingFields,ve),isTouched:!!Et((De||s).touchedFields,ve)}),Oe=ve=>{ve&&Pb(ve).forEach(De=>fs(s.errors,De)),k.state.next({errors:ve?s.errors:{}})},ke=(ve,De,Ge)=>{const D=(Et(o,ve,{_f:{}})._f||{}).ref,L=Et(s.errors,ve)||{},{ref:H,message:W,type:we,...Re}=L;dr(s.errors,ve,{...Re,...De,ref:D}),k.state.next({name:ve,errors:s.errors,isValid:!1}),Ge&&Ge.shouldFocus&&D&&D.focus&&D.focus()},Ve=(ve,De)=>Jo(ve)?k.state.subscribe({next:Ge=>"values"in Ge&&ve(le(void 0,De),Ge)}):le(ve,De,!0),ie=ve=>k.state.subscribe({next:De=>{Vhe(ve.name,De.name,ve.exact)&&Khe(De,ve.formState||E,V,ve.reRenderRoot)&&ve.callback({values:{...p},...s,...De,defaultValues:d})}}).unsubscribe,Ne=ve=>(m.mount=!0,A={...A,...ve.formState},ie({...ve,formState:A})),ze=(ve,De={})=>{for(const Ge of ve?Pb(ve):g.mount)g.mount.delete(Ge),g.array.delete(Ge),De.keepValue||(fs(o,Ge),fs(p,Ge)),!De.keepError&&fs(s.errors,Ge),!De.keepDirty&&fs(s.dirtyFields,Ge),!De.keepTouched&&fs(s.touchedFields,Ge),!De.keepIsValidating&&fs(s.validatingFields,Ge),!r.shouldUnregister&&!De.keepDefaultValue&&fs(d,Ge);k.state.next({values:js(p)}),k.state.next({...s,...De.keepDirty?{isDirty:xe()}:{}}),!De.keepIsValid&&I()},tt=({disabled:ve,name:De})=>{(Ta(ve)&&m.mount||ve||g.disabled.has(De))&&(ve?g.disabled.add(De):g.disabled.delete(De))},ft=(ve,De={})=>{let Ge=Et(o,ve);const D=Ta(De.disabled)||Ta(r.disabled);return dr(o,ve,{...Ge||{},_f:{...Ge&&Ge._f?Ge._f:{ref:{name:ve}},name:ve,mount:!0,...De}}),g.mount.add(ve),Ge?tt({disabled:Ta(De.disabled)?De.disabled:r.disabled,name:ve}):z(ve,!0,De.value),{...D?{disabled:De.disabled||r.disabled}:{},...r.progressive?{required:!!De.required,min:ob(De.min),max:ob(De.max),minLength:ob(De.minLength),maxLength:ob(De.maxLength),pattern:ob(De.pattern)}:{},name:ve,onChange:re,onBlur:re,ref:L=>{if(L){ft(ve,De),Ge=Et(o,ve);const H=Hr(L.value)&&L.querySelectorAll&&L.querySelectorAll("input,select,textarea")[0]||L,W=Ihe(H),we=Ge._f.refs||[];if(W?we.find(Re=>Re===H):H===Ge._f.ref)return;dr(o,ve,{_f:{...Ge._f,...W?{refs:[...we.filter(pT),H,...Array.isArray(Et(d,ve))?[{}]:[]],ref:{type:H.type,name:ve}}:{ref:H}}}),z(ve,!1,void 0,H)}else Ge=Et(o,ve,{}),Ge._f&&(Ge._f.mount=!1),(r.shouldUnregister||De.shouldUnregister)&&!(HF(g.array,ve)&&m.action)&&g.unMount.add(ve)}}},Ot=()=>r.shouldFocusError&&Mb(o,ue,g.mount),Ft=ve=>{Ta(ve)&&(k.state.next({disabled:ve}),Mb(o,(De,Ge)=>{const D=Et(o,Ge);D&&(De.disabled=D._f.disabled||ve,Array.isArray(D._f.refs)&&D._f.refs.forEach(L=>{L.disabled=D._f.disabled||ve}))},0,!1))},kt=(ve,De)=>async Ge=>{let D;Ge&&(Ge.preventDefault&&Ge.preventDefault(),Ge.persist&&Ge.persist());let L=js(p);if(k.state.next({isSubmitting:!0}),r.resolver){const{errors:H,values:W}=await Q();s.errors=H,L=js(W)}else await de(o);if(g.disabled.size)for(const H of g.disabled)fs(L,H);if(fs(s.errors,"root"),Di(s.errors)){k.state.next({errors:{}});try{await ve(L,Ge)}catch(H){D=H}}else De&&await De({...s.errors},Ge),Ot(),setTimeout(Ot);if(k.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Di(s.errors)&&!D,submitCount:s.submitCount+1,errors:s.errors}),D)throw D},Jt=(ve,De={})=>{Et(o,ve)&&(Hr(De.defaultValue)?ce(ve,js(Et(d,ve))):(ce(ve,De.defaultValue),dr(d,ve,js(De.defaultValue))),De.keepTouched||fs(s.touchedFields,ve),De.keepDirty||(fs(s.dirtyFields,ve),s.isDirty=De.defaultValue?xe(ve,js(Et(d,ve))):xe()),De.keepError||(fs(s.errors,ve),E.isValid&&I()),k.state.next({...s}))},Le=(ve,De={})=>{const Ge=ve?js(ve):d,D=js(Ge),L=Di(ve),H=L?d:D;if(De.keepDefaultValues||(d=Ge),!De.keepValues){if(De.keepDirtyValues){const W=new Set([...g.mount,...Object.keys(Jm(d,p))]);for(const we of Array.from(W))Et(s.dirtyFields,we)?dr(H,we,Et(p,we)):ce(we,Et(H,we))}else{if(U2&&Hr(ve))for(const W of g.mount){const we=Et(o,W);if(we&&we._f){const Re=Array.isArray(we._f.refs)?we._f.refs[0]:we._f.ref;if(Wj(Re)){const st=Re.closest("form");if(st){st.reset();break}}}}if(De.keepFieldsRef)for(const W of g.mount)ce(W,Et(H,W));else o={}}p=r.shouldUnregister?De.keepDefaultValues?js(d):{}:js(H),k.array.next({values:{...H}}),k.state.next({values:{...H}})}g={mount:De.keepDirtyValues?g.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},m.mount=!E.isValid||!!De.keepIsValid||!!De.keepDirtyValues||!r.shouldUnregister&&!Di(H),m.watch=!!r.shouldUnregister,k.state.next({submitCount:De.keepSubmitCount?s.submitCount:0,isDirty:L?!1:De.keepDirty?s.isDirty:!!(De.keepDefaultValues&&!Wo(ve,d)),isSubmitted:De.keepIsSubmitted?s.isSubmitted:!1,dirtyFields:L?{}:De.keepDirtyValues?De.keepDefaultValues&&p?Jm(d,p):s.dirtyFields:De.keepDefaultValues&&ve?Jm(d,ve):De.keepDirty?s.dirtyFields:{},touchedFields:De.keepTouched?s.touchedFields:{},errors:De.keepErrors?s.errors:{},isSubmitSuccessful:De.keepIsSubmitSuccessful?s.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:d})},Lt=(ve,De)=>Le(Jo(ve)?ve(p):ve,De),Rt=(ve,De={})=>{const Ge=Et(o,ve),D=Ge&&Ge._f;if(D){const L=D.refs?D.refs[0]:D.ref;L.focus&&(L.focus(),De.shouldSelect&&Jo(L.select)&&L.select())}},V=ve=>{s={...s,...ve}},cn={control:{register:ft,unregister:ze,getFieldState:He,handleSubmit:kt,setError:ke,_subscribe:ie,_runSchema:Q,_focusError:Ot,_getWatch:le,_getDirty:xe,_setValid:I,_setFieldArray:G,_setDisabledField:tt,_setErrors:X,_getFieldArray:be,_reset:Le,_resetDefaultValues:()=>Jo(r.defaultValues)&&r.defaultValues().then(ve=>{Lt(ve,r.resetOptions),k.state.next({isLoading:!1})}),_removeUnmounted:Ce,_disableForm:Ft,_subjects:k,_proxyFormState:E,get _fields(){return o},get _formValues(){return p},get _state(){return m},set _state(ve){m=ve},get _defaultValues(){return d},get _names(){return g},set _names(ve){g=ve},get _formState(){return s},get _options(){return r},set _options(ve){r={...r,...ve}}},subscribe:Ne,trigger:_e,register:ft,handleSubmit:kt,watch:Ve,setValue:ce,getValues:fe,reset:Lt,resetField:Jt,clearErrors:Oe,unregister:ze,setError:ke,setFocus:Rt,getFieldState:He};return{...cn,formControl:cn}}function mr(e={}){const r=Je.useRef(void 0),s=Je.useRef(void 0),[o,d]=Je.useState({isDirty:!1,isValidating:!1,isLoading:Jo(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Jo(e.defaultValues)?void 0:e.defaultValues});if(!r.current)if(e.formControl)r.current={...e.formControl,formState:o},e.defaultValues&&!Jo(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:m,...g}=Zhe(e);r.current={...g,formState:o}}const p=r.current.control;return p._options=e,G2(()=>{const m=p._subscribe({formState:p._proxyFormState,callback:()=>d({...p._formState}),reRenderRoot:!0});return d(g=>({...g,isReady:!0})),p._formState.isReady=!0,m},[p]),Je.useEffect(()=>p._disableForm(e.disabled),[p,e.disabled]),Je.useEffect(()=>{e.mode&&(p._options.mode=e.mode),e.reValidateMode&&(p._options.reValidateMode=e.reValidateMode)},[p,e.mode,e.reValidateMode]),Je.useEffect(()=>{e.errors&&(p._setErrors(e.errors),p._focusError())},[p,e.errors]),Je.useEffect(()=>{e.shouldUnregister&&p._subjects.state.next({values:p._getWatch()})},[p,e.shouldUnregister]),Je.useEffect(()=>{if(p._proxyFormState.isDirty){const m=p._getDirty();m!==o.isDirty&&p._subjects.state.next({isDirty:m})}},[p,o.isDirty]),Je.useEffect(()=>{e.values&&!Wo(e.values,s.current)?(p._reset(e.values,{keepFieldsRef:!0,...p._options.resetOptions}),s.current=e.values,d(m=>({...m}))):p._resetDefaultValues()},[p,e.values]),Je.useEffect(()=>{p._state.mount||(p._setValid(),p._state.mount=!0),p._state.watch&&(p._state.watch=!1,p._subjects.state.next({...p._formState})),p._removeUnmounted()}),r.current.formState=GF(o,p),r.current}const Q4=(e,r,s)=>{if(e&&"reportValidity"in e){const o=Et(s,r);e.setCustomValidity(o&&o.message||""),e.reportValidity()}},p_=(e,r)=>{for(const s in r.fields){const o=r.fields[s];o&&o.ref&&"reportValidity"in o.ref?Q4(o.ref,s,e):o&&o.refs&&o.refs.forEach(d=>Q4(d,s,e))}},e3=(e,r)=>{r.shouldUseNativeValidation&&p_(e,r);const s={};for(const o in e){const d=Et(r.fields,o),p=Object.assign(e[o]||{},{ref:d&&d.ref});if(Whe(r.names||Object.keys(e),o)){const m=Object.assign({},Et(s,o));dr(m,"root",p),dr(s,o,m)}else dr(s,o,p)}return s},Whe=(e,r)=>{const s=t3(r);return e.some(o=>t3(o).match(`^${s}\\.\\d+`))};function t3(e){return e.replace(/\]|\[/g,"")}function at(e,r,s){function o(g,b){var S;Object.defineProperty(g,"_zod",{value:g._zod??{},enumerable:!1}),(S=g._zod).traits??(S.traits=new Set),g._zod.traits.add(e),r(g,b);for(const E in m.prototype)E in g||Object.defineProperty(g,E,{value:m.prototype[E].bind(g)});g._zod.constr=m,g._zod.def=b}const d=s?.Parent??Object;class p extends d{}Object.defineProperty(p,"name",{value:e});function m(g){var b;const S=s?.Parent?new p:this;o(S,g),(b=S._zod).deferred??(b.deferred=[]);for(const E of S._zod.deferred)E();return S}return Object.defineProperty(m,"init",{value:o}),Object.defineProperty(m,Symbol.hasInstance,{value:g=>s?.Parent&&g instanceof s.Parent?!0:g?._zod?.traits?.has(e)}),Object.defineProperty(m,"name",{value:e}),m}class gg extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class t6 extends Error{constructor(r){super(`Encountered unidirectional transform during encode: ${r}`),this.name="ZodEncodeError"}}const n6={};function Tp(e){return n6}function Jhe(e){const r=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,d])=>r.indexOf(+o)===-1).map(([o,d])=>d)}function f_(e,r){return typeof r=="bigint"?r.toString():r}function W2(e){return{get value(){{const r=e();return Object.defineProperty(this,"value",{value:r}),r}}}}function J2(e){return e==null}function Q2(e){const r=e.startsWith("^")?1:0,s=e.endsWith("$")?e.length-1:e.length;return e.slice(r,s)}function Qhe(e,r){const s=(e.toString().split(".")[1]||"").length,o=r.toString();let d=(o.split(".")[1]||"").length;if(d===0&&/\d?e-\d?/.test(o)){const b=o.match(/\d?e-(\d?)/);b?.[1]&&(d=Number.parseInt(b[1]))}const p=s>d?s:d,m=Number.parseInt(e.toFixed(p).replace(".","")),g=Number.parseInt(r.toFixed(p).replace(".",""));return m%g/10**p}const n3=Symbol("evaluating");function Sr(e,r,s){let o;Object.defineProperty(e,r,{get(){if(o!==n3)return o===void 0&&(o=n3,o=s()),o},set(d){Object.defineProperty(e,r,{value:d})},configurable:!0})}function Dp(e,r,s){Object.defineProperty(e,r,{value:s,writable:!0,enumerable:!0,configurable:!0})}function Pp(...e){const r={};for(const s of e){const o=Object.getOwnPropertyDescriptors(s);Object.assign(r,o)}return Object.defineProperties({},r)}function r3(e){return JSON.stringify(e)}const r6="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Qj(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const epe=W2(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Xb(e){if(Qj(e)===!1)return!1;const r=e.constructor;if(r===void 0)return!0;const s=r.prototype;return!(Qj(s)===!1||Object.prototype.hasOwnProperty.call(s,"isPrototypeOf")===!1)}function s6(e){return Xb(e)?{...e}:Array.isArray(e)?[...e]:e}const tpe=new Set(["string","number","symbol"]);function Eg(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Zd(e,r,s){const o=new e._zod.constr(r??e._zod.def);return(!r||s?.parent)&&(o._zod.parent=e),o}function Yt(e){const r=e;if(!r)return{};if(typeof r=="string")return{error:()=>r};if(r?.message!==void 0){if(r?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");r.error=r.message}return delete r.message,typeof r.error=="string"?{...r,error:()=>r.error}:r}function npe(e){return Object.keys(e).filter(r=>e[r]._zod.optin==="optional"&&e[r]._zod.optout==="optional")}const rpe={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function spe(e,r){const s=e._zod.def,o=Pp(e._zod.def,{get shape(){const d={};for(const p in r){if(!(p in s.shape))throw new Error(`Unrecognized key: "${p}"`);r[p]&&(d[p]=s.shape[p])}return Dp(this,"shape",d),d},checks:[]});return Zd(e,o)}function ipe(e,r){const s=e._zod.def,o=Pp(e._zod.def,{get shape(){const d={...e._zod.def.shape};for(const p in r){if(!(p in s.shape))throw new Error(`Unrecognized key: "${p}"`);r[p]&&delete d[p]}return Dp(this,"shape",d),d},checks:[]});return Zd(e,o)}function ape(e,r){if(!Xb(r))throw new Error("Invalid input to extend: expected a plain object");const s=e._zod.def.checks;if(s&&s.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const d=Pp(e._zod.def,{get shape(){const p={...e._zod.def.shape,...r};return Dp(this,"shape",p),p},checks:[]});return Zd(e,d)}function ope(e,r){if(!Xb(r))throw new Error("Invalid input to safeExtend: expected a plain object");const s={...e._zod.def,get shape(){const o={...e._zod.def.shape,...r};return Dp(this,"shape",o),o},checks:e._zod.def.checks};return Zd(e,s)}function lpe(e,r){const s=Pp(e._zod.def,{get shape(){const o={...e._zod.def.shape,...r._zod.def.shape};return Dp(this,"shape",o),o},get catchall(){return r._zod.def.catchall},checks:[]});return Zd(e,s)}function cpe(e,r,s){const o=Pp(r._zod.def,{get shape(){const d=r._zod.def.shape,p={...d};if(s)for(const m in s){if(!(m in d))throw new Error(`Unrecognized key: "${m}"`);s[m]&&(p[m]=e?new e({type:"optional",innerType:d[m]}):d[m])}else for(const m in d)p[m]=e?new e({type:"optional",innerType:d[m]}):d[m];return Dp(this,"shape",p),p},checks:[]});return Zd(r,o)}function upe(e,r,s){const o=Pp(r._zod.def,{get shape(){const d=r._zod.def.shape,p={...d};if(s)for(const m in s){if(!(m in p))throw new Error(`Unrecognized key: "${m}"`);s[m]&&(p[m]=new e({type:"nonoptional",innerType:d[m]}))}else for(const m in d)p[m]=new e({type:"nonoptional",innerType:d[m]});return Dp(this,"shape",p),p},checks:[]});return Zd(r,o)}function dg(e,r=0){if(e.aborted===!0)return!0;for(let s=r;s{var o;return(o=s).path??(o.path=[]),s.path.unshift(e),s})}function cj(e){return typeof e=="string"?e:e?.message}function _p(e,r,s){const o={...e,path:e.path??[]};if(!e.message){const d=cj(e.inst?._zod.def?.error?.(e))??cj(r?.error?.(e))??cj(s.customError?.(e))??cj(s.localeError?.(e))??"Invalid input";o.message=d}return delete o.inst,delete o.continue,r?.reportInput||delete o.input,o}function e$(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Yb(...e){const[r,s,o]=e;return typeof r=="string"?{message:r,code:"custom",input:s,inst:o}:{...r}}const a6=(e,r)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:r,enumerable:!1}),e.message=JSON.stringify(r,f_,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},t$=at("$ZodError",a6),BC=at("$ZodError",a6,{Parent:Error});function dpe(e,r=s=>s.message){const s={},o=[];for(const d of e.issues)d.path.length>0?(s[d.path[0]]=s[d.path[0]]||[],s[d.path[0]].push(r(d))):o.push(r(d));return{formErrors:o,fieldErrors:s}}function hpe(e,r=s=>s.message){const s={_errors:[]},o=d=>{for(const p of d.issues)if(p.code==="invalid_union"&&p.errors.length)p.errors.map(m=>o({issues:m}));else if(p.code==="invalid_key")o({issues:p.issues});else if(p.code==="invalid_element")o({issues:p.issues});else if(p.path.length===0)s._errors.push(r(p));else{let m=s,g=0;for(;g(r,s,o,d)=>{const p=o?Object.assign(o,{async:!1}):{async:!1},m=r._zod.run({value:s,issues:[]},p);if(m instanceof Promise)throw new gg;if(m.issues.length){const g=new(d?.Err??e)(m.issues.map(b=>_p(b,p,Tp())));throw r6(g,d?.callee),g}return m.value},ppe=UC(BC),KC=e=>async(r,s,o,d)=>{const p=o?Object.assign(o,{async:!0}):{async:!0};let m=r._zod.run({value:s,issues:[]},p);if(m instanceof Promise&&(m=await m),m.issues.length){const g=new(d?.Err??e)(m.issues.map(b=>_p(b,p,Tp())));throw r6(g,d?.callee),g}return m.value},fpe=KC(BC),VC=e=>(r,s,o)=>{const d=o?{...o,async:!1}:{async:!1},p=r._zod.run({value:s,issues:[]},d);if(p instanceof Promise)throw new gg;return p.issues.length?{success:!1,error:new(e??t$)(p.issues.map(m=>_p(m,d,Tp())))}:{success:!0,data:p.value}},mpe=VC(BC),HC=e=>async(r,s,o)=>{const d=o?Object.assign(o,{async:!0}):{async:!0};let p=r._zod.run({value:s,issues:[]},d);return p instanceof Promise&&(p=await p),p.issues.length?{success:!1,error:new e(p.issues.map(m=>_p(m,d,Tp())))}:{success:!0,data:p.value}},gpe=HC(BC),ype=e=>(r,s,o)=>{const d=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return UC(e)(r,s,d)},vpe=e=>(r,s,o)=>UC(e)(r,s,o),xpe=e=>async(r,s,o)=>{const d=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return KC(e)(r,s,d)},bpe=e=>async(r,s,o)=>KC(e)(r,s,o),wpe=e=>(r,s,o)=>{const d=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return VC(e)(r,s,d)},Spe=e=>(r,s,o)=>VC(e)(r,s,o),Epe=e=>async(r,s,o)=>{const d=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return HC(e)(r,s,d)},jpe=e=>async(r,s,o)=>HC(e)(r,s,o),Cpe=/^[cC][^\s-]{8,}$/,Ape=/^[0-9a-z]+$/,Ope=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,kpe=/^[0-9a-vA-V]{20}$/,Rpe=/^[A-Za-z0-9]{27}$/,Tpe=/^[a-zA-Z0-9_-]{21}$/,_pe=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,$pe=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,s3=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Npe=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Dpe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ppe(){return new RegExp(Dpe,"u")}const Mpe=/^(?:(?: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])$/,Ipe=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,zpe=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Lpe=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Fpe=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,o6=/^[A-Za-z0-9_-]*$/,qpe=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Bpe=/^\+(?:[0-9]){6,14}[0-9]$/,l6="(?:(?:\\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])))",Upe=new RegExp(`^${l6}$`);function c6(e){const r="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${r}`:e.precision===0?`${r}:[0-5]\\d`:`${r}:[0-5]\\d\\.\\d{${e.precision}}`:`${r}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Kpe(e){return new RegExp(`^${c6(e)}$`)}function Vpe(e){const r=c6({precision:e.precision}),s=["Z"];e.local&&s.push(""),e.offset&&s.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const o=`${r}(?:${s.join("|")})`;return new RegExp(`^${l6}T(?:${o})$`)}const Hpe=e=>{const r=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${r}$`)},Gpe=/^-?\d+$/,Xpe=/^-?\d+(?:\.\d+)?/,Ype=/^[^A-Z]*$/,Zpe=/^[^a-z]*$/,pa=at("$ZodCheck",(e,r)=>{var s;e._zod??(e._zod={}),e._zod.def=r,(s=e._zod).onattach??(s.onattach=[])}),u6={number:"number",bigint:"bigint",object:"date"},d6=at("$ZodCheckLessThan",(e,r)=>{pa.init(e,r);const s=u6[typeof r.value];e._zod.onattach.push(o=>{const d=o._zod.bag,p=(r.inclusive?d.maximum:d.exclusiveMaximum)??Number.POSITIVE_INFINITY;r.value{(r.inclusive?o.value<=r.value:o.value{pa.init(e,r);const s=u6[typeof r.value];e._zod.onattach.push(o=>{const d=o._zod.bag,p=(r.inclusive?d.minimum:d.exclusiveMinimum)??Number.NEGATIVE_INFINITY;r.value>p&&(r.inclusive?d.minimum=r.value:d.exclusiveMinimum=r.value)}),e._zod.check=o=>{(r.inclusive?o.value>=r.value:o.value>r.value)||o.issues.push({origin:s,code:"too_small",minimum:r.value,input:o.value,inclusive:r.inclusive,inst:e,continue:!r.abort})}}),Wpe=at("$ZodCheckMultipleOf",(e,r)=>{pa.init(e,r),e._zod.onattach.push(s=>{var o;(o=s._zod.bag).multipleOf??(o.multipleOf=r.value)}),e._zod.check=s=>{if(typeof s.value!=typeof r.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof s.value=="bigint"?s.value%r.value===BigInt(0):Qhe(s.value,r.value)===0)||s.issues.push({origin:typeof s.value,code:"not_multiple_of",divisor:r.value,input:s.value,inst:e,continue:!r.abort})}}),Jpe=at("$ZodCheckNumberFormat",(e,r)=>{pa.init(e,r),r.format=r.format||"float64";const s=r.format?.includes("int"),o=s?"int":"number",[d,p]=rpe[r.format];e._zod.onattach.push(m=>{const g=m._zod.bag;g.format=r.format,g.minimum=d,g.maximum=p,s&&(g.pattern=Gpe)}),e._zod.check=m=>{const g=m.value;if(s){if(!Number.isInteger(g)){m.issues.push({expected:o,format:r.format,code:"invalid_type",continue:!1,input:g,inst:e});return}if(!Number.isSafeInteger(g)){g>0?m.issues.push({input:g,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!r.abort}):m.issues.push({input:g,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!r.abort});return}}gp&&m.issues.push({origin:"number",input:g,code:"too_big",maximum:p,inst:e})}}),Qpe=at("$ZodCheckMaxLength",(e,r)=>{var s;pa.init(e,r),(s=e._zod.def).when??(s.when=o=>{const d=o.value;return!J2(d)&&d.length!==void 0}),e._zod.onattach.push(o=>{const d=o._zod.bag.maximum??Number.POSITIVE_INFINITY;r.maximum{const d=o.value;if(d.length<=r.maximum)return;const m=e$(d);o.issues.push({origin:m,code:"too_big",maximum:r.maximum,inclusive:!0,input:d,inst:e,continue:!r.abort})}}),efe=at("$ZodCheckMinLength",(e,r)=>{var s;pa.init(e,r),(s=e._zod.def).when??(s.when=o=>{const d=o.value;return!J2(d)&&d.length!==void 0}),e._zod.onattach.push(o=>{const d=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;r.minimum>d&&(o._zod.bag.minimum=r.minimum)}),e._zod.check=o=>{const d=o.value;if(d.length>=r.minimum)return;const m=e$(d);o.issues.push({origin:m,code:"too_small",minimum:r.minimum,inclusive:!0,input:d,inst:e,continue:!r.abort})}}),tfe=at("$ZodCheckLengthEquals",(e,r)=>{var s;pa.init(e,r),(s=e._zod.def).when??(s.when=o=>{const d=o.value;return!J2(d)&&d.length!==void 0}),e._zod.onattach.push(o=>{const d=o._zod.bag;d.minimum=r.length,d.maximum=r.length,d.length=r.length}),e._zod.check=o=>{const d=o.value,p=d.length;if(p===r.length)return;const m=e$(d),g=p>r.length;o.issues.push({origin:m,...g?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!r.abort})}}),GC=at("$ZodCheckStringFormat",(e,r)=>{var s,o;pa.init(e,r),e._zod.onattach.push(d=>{const p=d._zod.bag;p.format=r.format,r.pattern&&(p.patterns??(p.patterns=new Set),p.patterns.add(r.pattern))}),r.pattern?(s=e._zod).check??(s.check=d=>{r.pattern.lastIndex=0,!r.pattern.test(d.value)&&d.issues.push({origin:"string",code:"invalid_format",format:r.format,input:d.value,...r.pattern?{pattern:r.pattern.toString()}:{},inst:e,continue:!r.abort})}):(o=e._zod).check??(o.check=()=>{})}),nfe=at("$ZodCheckRegex",(e,r)=>{GC.init(e,r),e._zod.check=s=>{r.pattern.lastIndex=0,!r.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:"regex",input:s.value,pattern:r.pattern.toString(),inst:e,continue:!r.abort})}}),rfe=at("$ZodCheckLowerCase",(e,r)=>{r.pattern??(r.pattern=Ype),GC.init(e,r)}),sfe=at("$ZodCheckUpperCase",(e,r)=>{r.pattern??(r.pattern=Zpe),GC.init(e,r)}),ife=at("$ZodCheckIncludes",(e,r)=>{pa.init(e,r);const s=Eg(r.includes),o=new RegExp(typeof r.position=="number"?`^.{${r.position}}${s}`:s);r.pattern=o,e._zod.onattach.push(d=>{const p=d._zod.bag;p.patterns??(p.patterns=new Set),p.patterns.add(o)}),e._zod.check=d=>{d.value.includes(r.includes,r.position)||d.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:r.includes,input:d.value,inst:e,continue:!r.abort})}}),afe=at("$ZodCheckStartsWith",(e,r)=>{pa.init(e,r);const s=new RegExp(`^${Eg(r.prefix)}.*`);r.pattern??(r.pattern=s),e._zod.onattach.push(o=>{const d=o._zod.bag;d.patterns??(d.patterns=new Set),d.patterns.add(s)}),e._zod.check=o=>{o.value.startsWith(r.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:r.prefix,input:o.value,inst:e,continue:!r.abort})}}),ofe=at("$ZodCheckEndsWith",(e,r)=>{pa.init(e,r);const s=new RegExp(`.*${Eg(r.suffix)}$`);r.pattern??(r.pattern=s),e._zod.onattach.push(o=>{const d=o._zod.bag;d.patterns??(d.patterns=new Set),d.patterns.add(s)}),e._zod.check=o=>{o.value.endsWith(r.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:r.suffix,input:o.value,inst:e,continue:!r.abort})}}),lfe=at("$ZodCheckOverwrite",(e,r)=>{pa.init(e,r),e._zod.check=s=>{s.value=r.tx(s.value)}});class cfe{constructor(r=[]){this.content=[],this.indent=0,this&&(this.args=r)}indented(r){this.indent+=1,r(this),this.indent-=1}write(r){if(typeof r=="function"){r(this,{execution:"sync"}),r(this,{execution:"async"});return}const o=r.split(` +For more information, see https://radix-ui.com/primitives/docs/components/${r.docsSlug}`;return R.useEffect(()=>{e&&(document.getElementById(e)||console.error(s))},[s,e]),null},cae="DialogDescriptionWarning",uae=({contentRef:e,descriptionId:r})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Bz(cae).contentName}}.`;return R.useEffect(()=>{const d=e.current?.getAttribute("aria-describedby");r&&d&&(document.getElementById(r)||console.warn(o))},[o,e,r]),null},_C=kz,Uz=Tz,$C=$z,NC=Nz,DC=Dz,i2=Mz,a2=Lz,lw=Fz,dae=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Gd=dae.reduce((e,r)=>{const s=ew(`Primitive.${r}`),o=R.forwardRef((d,p)=>{const{asChild:m,...g}=d,b=m?s:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(b,{...g,ref:p})});return o.displayName=`Primitive.${r}`,{...e,[r]:o}},{}),ib='[cmdk-group=""]',GR='[cmdk-group-items=""]',hae='[cmdk-group-heading=""]',Kz='[cmdk-item=""]',AI=`${Kz}:not([aria-disabled="true"])`,UT="cmdk-item-select",Zm="data-value",pae=(e,r,s)=>nie(e,r,s),Vz=R.createContext(void 0),cw=()=>R.useContext(Vz),Hz=R.createContext(void 0),o2=()=>R.useContext(Hz),Gz=R.createContext(void 0),Xz=R.forwardRef((e,r)=>{let s=Wm(()=>{var Oe,ke;return{search:"",value:(ke=(Oe=e.value)!=null?Oe:e.defaultValue)!=null?ke:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),o=Wm(()=>new Set),d=Wm(()=>new Map),p=Wm(()=>new Map),m=Wm(()=>new Set),g=Yz(e),{label:b,children:S,value:j,onValueChange:A,filter:k,shouldFilter:T,loop:M,disablePointerSelection:I=!1,vimBindings:q=!0,...G}=e,K=Vs(),X=Vs(),L=Vs(),ee=R.useRef(null),oe=jae();Rp(()=>{if(j!==void 0){let Oe=j.trim();s.current.value=Oe,Q.emit()}},[j]),Rp(()=>{oe(6,be)},[]);let Q=R.useMemo(()=>({subscribe:Oe=>(m.current.add(Oe),()=>m.current.delete(Oe)),snapshot:()=>s.current,setState:(Oe,ke,Ve)=>{var ie,De,Le,tt;if(!Object.is(s.current[Oe],ke)){if(s.current[Oe]=ke,Oe==="search")le(),je(),oe(1,ve);else if(Oe==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ft=document.getElementById(L);ft?ft.focus():(ie=document.getElementById(K))==null||ie.focus()}if(oe(7,()=>{var ft;s.current.selectedItemId=(ft=Ce())==null?void 0:ft.id,Q.emit()}),Ve||oe(5,be),((De=g.current)==null?void 0:De.value)!==void 0){let ft=ke??"";(tt=(Le=g.current).onValueChange)==null||tt.call(Le,ft);return}}Q.emit()}},emit:()=>{m.current.forEach(Oe=>Oe())}}),[]),ne=R.useMemo(()=>({value:(Oe,ke,Ve)=>{var ie;ke!==((ie=p.current.get(Oe))==null?void 0:ie.value)&&(p.current.set(Oe,{value:ke,keywords:Ve}),s.current.filtered.items.set(Oe,de(ke,Ve)),oe(2,()=>{je(),Q.emit()}))},item:(Oe,ke)=>(o.current.add(Oe),ke&&(d.current.has(ke)?d.current.get(ke).add(Oe):d.current.set(ke,new Set([Oe]))),oe(3,()=>{le(),je(),s.current.value||ve(),Q.emit()}),()=>{p.current.delete(Oe),o.current.delete(Oe),s.current.filtered.items.delete(Oe);let Ve=Ce();oe(4,()=>{le(),Ve?.getAttribute("id")===Oe&&ve(),Q.emit()})}),group:Oe=>(d.current.has(Oe)||d.current.set(Oe,new Set),()=>{p.current.delete(Oe),d.current.delete(Oe)}),filter:()=>g.current.shouldFilter,label:b||e["aria-label"],getDisablePointerSelection:()=>g.current.disablePointerSelection,listId:K,inputId:L,labelId:X,listInnerRef:ee}),[]);function de(Oe,ke){var Ve,ie;let De=(ie=(Ve=g.current)==null?void 0:Ve.filter)!=null?ie:pae;return Oe?De(Oe,s.current.search,ke):0}function je(){if(!s.current.search||g.current.shouldFilter===!1)return;let Oe=s.current.filtered.items,ke=[];s.current.filtered.groups.forEach(ie=>{let De=d.current.get(ie),Le=0;De.forEach(tt=>{let ft=Oe.get(tt);Le=Math.max(ft,Le)}),ke.push([ie,Le])});let Ve=ee.current;Ke().sort((ie,De)=>{var Le,tt;let ft=ie.getAttribute("id"),Ot=De.getAttribute("id");return((Le=Oe.get(Ot))!=null?Le:0)-((tt=Oe.get(ft))!=null?tt:0)}).forEach(ie=>{let De=ie.closest(GR);De?De.appendChild(ie.parentElement===De?ie:ie.closest(`${GR} > *`)):Ve.appendChild(ie.parentElement===Ve?ie:ie.closest(`${GR} > *`))}),ke.sort((ie,De)=>De[1]-ie[1]).forEach(ie=>{var De;let Le=(De=ee.current)==null?void 0:De.querySelector(`${ib}[${Zm}="${encodeURIComponent(ie[0])}"]`);Le?.parentElement.appendChild(Le)})}function ve(){let Oe=Ke().find(Ve=>Ve.getAttribute("aria-disabled")!=="true"),ke=Oe?.getAttribute(Zm);Q.setState("value",ke||void 0)}function le(){var Oe,ke,Ve,ie;if(!s.current.search||g.current.shouldFilter===!1){s.current.filtered.count=o.current.size;return}s.current.filtered.groups=new Set;let De=0;for(let Le of o.current){let tt=(ke=(Oe=p.current.get(Le))==null?void 0:Oe.value)!=null?ke:"",ft=(ie=(Ve=p.current.get(Le))==null?void 0:Ve.keywords)!=null?ie:[],Ot=de(tt,ft);s.current.filtered.items.set(Le,Ot),Ot>0&&De++}for(let[Le,tt]of d.current)for(let ft of tt)if(s.current.filtered.items.get(ft)>0){s.current.filtered.groups.add(Le);break}s.current.filtered.count=De}function be(){var Oe,ke,Ve;let ie=Ce();ie&&(((Oe=ie.parentElement)==null?void 0:Oe.firstChild)===ie&&((Ve=(ke=ie.closest(ib))==null?void 0:ke.querySelector(hae))==null||Ve.scrollIntoView({block:"nearest"})),ie.scrollIntoView({block:"nearest"}))}function Ce(){var Oe;return(Oe=ee.current)==null?void 0:Oe.querySelector(`${Kz}[aria-selected="true"]`)}function Ke(){var Oe;return Array.from(((Oe=ee.current)==null?void 0:Oe.querySelectorAll(AI))||[])}function ce(Oe){let ke=Ke()[Oe];ke&&Q.setState("value",ke.getAttribute(Zm))}function re(Oe){var ke;let Ve=Ce(),ie=Ke(),De=ie.findIndex(tt=>tt===Ve),Le=ie[De+Oe];(ke=g.current)!=null&&ke.loop&&(Le=De+Oe<0?ie[ie.length-1]:De+Oe===ie.length?ie[0]:ie[De+Oe]),Le&&Q.setState("value",Le.getAttribute(Zm))}function ue(Oe){let ke=Ce(),Ve=ke?.closest(ib),ie;for(;Ve&&!ie;)Ve=Oe>0?Sae(Ve,ib):Eae(Ve,ib),ie=Ve?.querySelector(AI);ie?Q.setState("value",ie.getAttribute(Zm)):re(Oe)}let _e=()=>ce(Ke().length-1),fe=Oe=>{Oe.preventDefault(),Oe.metaKey?_e():Oe.altKey?ue(1):re(1)},He=Oe=>{Oe.preventDefault(),Oe.metaKey?ce(0):Oe.altKey?ue(-1):re(-1)};return R.createElement(Gd.div,{ref:r,tabIndex:-1,...G,"cmdk-root":"",onKeyDown:Oe=>{var ke;(ke=G.onKeyDown)==null||ke.call(G,Oe);let Ve=Oe.nativeEvent.isComposing||Oe.keyCode===229;if(!(Oe.defaultPrevented||Ve))switch(Oe.key){case"n":case"j":{q&&Oe.ctrlKey&&fe(Oe);break}case"ArrowDown":{fe(Oe);break}case"p":case"k":{q&&Oe.ctrlKey&&He(Oe);break}case"ArrowUp":{He(Oe);break}case"Home":{Oe.preventDefault(),ce(0);break}case"End":{Oe.preventDefault(),_e();break}case"Enter":{Oe.preventDefault();let ie=Ce();if(ie){let De=new Event(UT);ie.dispatchEvent(De)}}}}},R.createElement("label",{"cmdk-label":"",htmlFor:ne.inputId,id:ne.labelId,style:Aae},b),PC(e,Oe=>R.createElement(Hz.Provider,{value:Q},R.createElement(Vz.Provider,{value:ne},Oe))))}),fae=R.forwardRef((e,r)=>{var s,o;let d=Vs(),p=R.useRef(null),m=R.useContext(Gz),g=cw(),b=Yz(e),S=(o=(s=b.current)==null?void 0:s.forceMount)!=null?o:m?.forceMount;Rp(()=>{if(!S)return g.item(d,m?.id)},[S]);let j=Zz(d,p,[e.value,e.children,p],e.keywords),A=o2(),k=Bd(oe=>oe.value&&oe.value===j.current),T=Bd(oe=>S||g.filter()===!1?!0:oe.search?oe.filtered.items.get(d)>0:!0);R.useEffect(()=>{let oe=p.current;if(!(!oe||e.disabled))return oe.addEventListener(UT,M),()=>oe.removeEventListener(UT,M)},[T,e.onSelect,e.disabled]);function M(){var oe,Q;I(),(Q=(oe=b.current).onSelect)==null||Q.call(oe,j.current)}function I(){A.setState("value",j.current,!0)}if(!T)return null;let{disabled:q,value:G,onSelect:K,forceMount:X,keywords:L,...ee}=e;return R.createElement(Gd.div,{ref:Li(p,r),...ee,id:d,"cmdk-item":"",role:"option","aria-disabled":!!q,"aria-selected":!!k,"data-disabled":!!q,"data-selected":!!k,onPointerMove:q||g.getDisablePointerSelection()?void 0:I,onClick:q?void 0:M},e.children)}),mae=R.forwardRef((e,r)=>{let{heading:s,children:o,forceMount:d,...p}=e,m=Vs(),g=R.useRef(null),b=R.useRef(null),S=Vs(),j=cw(),A=Bd(T=>d||j.filter()===!1?!0:T.search?T.filtered.groups.has(m):!0);Rp(()=>j.group(m),[]),Zz(m,g,[e.value,e.heading,b]);let k=R.useMemo(()=>({id:m,forceMount:d}),[d]);return R.createElement(Gd.div,{ref:Li(g,r),...p,"cmdk-group":"",role:"presentation",hidden:A?void 0:!0},s&&R.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:S},s),PC(e,T=>R.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":s?S:void 0},R.createElement(Gz.Provider,{value:k},T))))}),gae=R.forwardRef((e,r)=>{let{alwaysRender:s,...o}=e,d=R.useRef(null),p=Bd(m=>!m.search);return!s&&!p?null:R.createElement(Gd.div,{ref:Li(d,r),...o,"cmdk-separator":"",role:"separator"})}),yae=R.forwardRef((e,r)=>{let{onValueChange:s,...o}=e,d=e.value!=null,p=o2(),m=Bd(S=>S.search),g=Bd(S=>S.selectedItemId),b=cw();return R.useEffect(()=>{e.value!=null&&p.setState("search",e.value)},[e.value]),R.createElement(Gd.input,{ref:r,...o,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":g,id:b.inputId,type:"text",value:d?e.value:m,onChange:S=>{d||p.setState("search",S.target.value),s?.(S.target.value)}})}),vae=R.forwardRef((e,r)=>{let{children:s,label:o="Suggestions",...d}=e,p=R.useRef(null),m=R.useRef(null),g=Bd(S=>S.selectedItemId),b=cw();return R.useEffect(()=>{if(m.current&&p.current){let S=m.current,j=p.current,A,k=new ResizeObserver(()=>{A=requestAnimationFrame(()=>{let T=S.offsetHeight;j.style.setProperty("--cmdk-list-height",T.toFixed(1)+"px")})});return k.observe(S),()=>{cancelAnimationFrame(A),k.unobserve(S)}}},[]),R.createElement(Gd.div,{ref:Li(p,r),...d,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":g,"aria-label":o,id:b.listId},PC(e,S=>R.createElement("div",{ref:Li(m,b.listInnerRef),"cmdk-list-sizer":""},S)))}),xae=R.forwardRef((e,r)=>{let{open:s,onOpenChange:o,overlayClassName:d,contentClassName:p,container:m,...g}=e;return R.createElement(_C,{open:s,onOpenChange:o},R.createElement($C,{container:m},R.createElement(NC,{"cmdk-overlay":"",className:d}),R.createElement(DC,{"aria-label":e.label,"cmdk-dialog":"",className:p},R.createElement(Xz,{ref:r,...g}))))}),bae=R.forwardRef((e,r)=>Bd(s=>s.filtered.count===0)?R.createElement(Gd.div,{ref:r,...e,"cmdk-empty":"",role:"presentation"}):null),wae=R.forwardRef((e,r)=>{let{progress:s,children:o,label:d="Loading...",...p}=e;return R.createElement(Gd.div,{ref:r,...p,"cmdk-loading":"",role:"progressbar","aria-valuenow":s,"aria-valuemin":0,"aria-valuemax":100,"aria-label":d},PC(e,m=>R.createElement("div",{"aria-hidden":!0},m)))}),$g=Object.assign(Xz,{List:vae,Item:fae,Input:yae,Group:mae,Separator:gae,Dialog:xae,Empty:bae,Loading:wae});function Sae(e,r){let s=e.nextElementSibling;for(;s;){if(s.matches(r))return s;s=s.nextElementSibling}}function Eae(e,r){let s=e.previousElementSibling;for(;s;){if(s.matches(r))return s;s=s.previousElementSibling}}function Yz(e){let r=R.useRef(e);return Rp(()=>{r.current=e}),r}var Rp=typeof window>"u"?R.useEffect:R.useLayoutEffect;function Wm(e){let r=R.useRef();return r.current===void 0&&(r.current=e()),r}function Bd(e){let r=o2(),s=()=>e(r.snapshot());return R.useSyncExternalStore(r.subscribe,s,s)}function Zz(e,r,s,o=[]){let d=R.useRef(),p=cw();return Rp(()=>{var m;let g=(()=>{var S;for(let j of s){if(typeof j=="string")return j.trim();if(typeof j=="object"&&"current"in j)return j.current?(S=j.current.textContent)==null?void 0:S.trim():d.current}})(),b=o.map(S=>S.trim());p.value(e,g,b),(m=r.current)==null||m.setAttribute(Zm,g),d.current=g}),d}var jae=()=>{let[e,r]=R.useState(),s=Wm(()=>new Map);return Rp(()=>{s.current.forEach(o=>o()),s.current=new Map},[e]),(o,d)=>{s.current.set(o,d),r({})}};function Cae(e){let r=e.type;return typeof r=="function"?r(e.props):"render"in r?r.render(e.props):e}function PC({asChild:e,children:r},s){return e&&R.isValidElement(r)?R.cloneElement(Cae(r),{ref:r.ref},s(r.props.children)):s(r)}var Aae={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function fn({...e}){return u.jsx(_C,{"data-slot":"dialog",...e})}function zi({...e}){return u.jsx(Uz,{"data-slot":"dialog-trigger",...e})}function Oae({...e}){return u.jsx($C,{"data-slot":"dialog-portal",...e})}function Uj({...e}){return u.jsx(lw,{"data-slot":"dialog-close",...e})}function kae({className:e,...r}){return u.jsx(NC,{"data-slot":"dialog-overlay",className:ht("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...r})}function mn({className:e,children:r,showCloseButton:s=!0,...o}){return u.jsxs(Oae,{"data-slot":"dialog-portal",children:[u.jsx(kae,{}),u.jsxs(DC,{"data-slot":"dialog-content",className:ht("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...o,children:[r,s&&u.jsxs(lw,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[u.jsx(q_,{}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function gn({className:e,...r}){return u.jsx("div",{"data-slot":"dialog-header",className:ht("flex flex-col gap-2 text-center sm:text-left",e),...r})}function Sn({className:e,...r}){return u.jsx("div",{"data-slot":"dialog-footer",className:ht("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r})}function yn({className:e,...r}){return u.jsx(i2,{"data-slot":"dialog-title",className:ht("text-lg leading-none font-semibold",e),...r})}function XR({className:e,...r}){return u.jsx(a2,{"data-slot":"dialog-description",className:ht("text-muted-foreground text-sm",e),...r})}function Rae({className:e,...r}){return u.jsx($g,{"data-slot":"command",className:ht("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...r})}function Tae({className:e,...r}){return u.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[u.jsx(Pa,{className:"size-4 shrink-0 opacity-50"}),u.jsx($g.Input,{"data-slot":"command-input",className:ht("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...r})]})}function _ae({className:e,...r}){return u.jsx($g.List,{"data-slot":"command-list",className:ht("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...r})}function $ae({...e}){return u.jsx($g.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function Nae({className:e,...r}){return u.jsx($g.Group,{"data-slot":"command-group",className:ht("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...r})}function Dae({className:e,...r}){return u.jsx($g.Item,{"data-slot":"command-item",className:ht("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function Pae(e){const r=Mae(e),s=R.forwardRef((o,d)=>{const{children:p,...m}=o,g=R.Children.toArray(p),b=g.find(Lae);if(b){const S=b.props.children,j=g.map(A=>A===b?R.Children.count(S)>1?R.Children.only(null):R.isValidElement(S)?S.props.children:null:A);return u.jsx(r,{...m,ref:d,children:R.isValidElement(S)?R.cloneElement(S,void 0,j):null})}return u.jsx(r,{...m,ref:d,children:p})});return s.displayName=`${e}.Slot`,s}function Mae(e){const r=R.forwardRef((s,o)=>{const{children:d,...p}=s;if(R.isValidElement(d)){const m=Fae(d),g=zae(p,d.props);return d.type!==R.Fragment&&(g.ref=o?Li(o,m):m),R.cloneElement(d,g)}return R.Children.count(d)>1?R.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var Iae=Symbol("radix.slottable");function Lae(e){return R.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Iae}function zae(e,r){const s={...r};for(const o in r){const d=e[o],p=r[o];/^on[A-Z]/.test(o)?d&&p?s[o]=(...g)=>{const b=p(...g);return d(...g),b}:d&&(s[o]=d):o==="style"?s[o]={...d,...p}:o==="className"&&(s[o]=[d,p].filter(Boolean).join(" "))}return{...e,...s}}function Fae(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning;return s?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var MC="Popover",[Wz]=al(MC,[Hd]),uw=Hd(),[qae,Xd]=Wz(MC),Jz=e=>{const{__scopePopover:r,children:s,open:o,defaultOpen:d,onOpenChange:p,modal:m=!1}=e,g=uw(r),b=R.useRef(null),[S,j]=R.useState(!1),[A,k]=qd({prop:o,defaultProp:d??!1,onChange:p,caller:MC});return u.jsx(SC,{...g,children:u.jsx(qae,{scope:r,contentId:Vs(),triggerRef:b,open:A,onOpenChange:k,onOpenToggle:R.useCallback(()=>k(T=>!T),[k]),hasCustomAnchor:S,onCustomAnchorAdd:R.useCallback(()=>j(!0),[]),onCustomAnchorRemove:R.useCallback(()=>j(!1),[]),modal:m,children:s})})};Jz.displayName=MC;var Qz="PopoverAnchor",Bae=R.forwardRef((e,r)=>{const{__scopePopover:s,...o}=e,d=Xd(Qz,s),p=uw(s),{onCustomAnchorAdd:m,onCustomAnchorRemove:g}=d;return R.useEffect(()=>(m(),()=>g()),[m,g]),u.jsx(nw,{...p,...o,ref:r})});Bae.displayName=Qz;var e5="PopoverTrigger",t5=R.forwardRef((e,r)=>{const{__scopePopover:s,...o}=e,d=Xd(e5,s),p=uw(s),m=zn(r,d.triggerRef),g=u.jsx(Cn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":d.open,"aria-controls":d.contentId,"data-state":a5(d.open),...o,ref:m,onClick:$t(e.onClick,d.onOpenToggle)});return d.hasCustomAnchor?g:u.jsx(nw,{asChild:!0,...p,children:g})});t5.displayName=e5;var l2="PopoverPortal",[Uae,Kae]=Wz(l2,{forceMount:void 0}),n5=e=>{const{__scopePopover:r,forceMount:s,children:o,container:d}=e,p=Xd(l2,r);return u.jsx(Uae,{scope:r,forceMount:s,children:u.jsx(lo,{present:s||p.open,children:u.jsx(_g,{asChild:!0,container:d,children:o})})})};n5.displayName=l2;var bg="PopoverContent",r5=R.forwardRef((e,r)=>{const s=Kae(bg,e.__scopePopover),{forceMount:o=s.forceMount,...d}=e,p=Xd(bg,e.__scopePopover);return u.jsx(lo,{present:o||p.open,children:p.modal?u.jsx(Hae,{...d,ref:r}):u.jsx(Gae,{...d,ref:r})})});r5.displayName=bg;var Vae=Pae("PopoverContent.RemoveScroll"),Hae=R.forwardRef((e,r)=>{const s=Xd(bg,e.__scopePopover),o=R.useRef(null),d=zn(r,o),p=R.useRef(!1);return R.useEffect(()=>{const m=o.current;if(m)return RC(m)},[]),u.jsx(ow,{as:Vae,allowPinchZoom:!0,children:u.jsx(s5,{...e,ref:d,trapFocus:s.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:$t(e.onCloseAutoFocus,m=>{m.preventDefault(),p.current||s.triggerRef.current?.focus()}),onPointerDownOutside:$t(e.onPointerDownOutside,m=>{const g=m.detail.originalEvent,b=g.button===0&&g.ctrlKey===!0,S=g.button===2||b;p.current=S},{checkForDefaultPrevented:!1}),onFocusOutside:$t(e.onFocusOutside,m=>m.preventDefault(),{checkForDefaultPrevented:!1})})})}),Gae=R.forwardRef((e,r)=>{const s=Xd(bg,e.__scopePopover),o=R.useRef(!1),d=R.useRef(!1);return u.jsx(s5,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:p=>{e.onCloseAutoFocus?.(p),p.defaultPrevented||(o.current||s.triggerRef.current?.focus(),p.preventDefault()),o.current=!1,d.current=!1},onInteractOutside:p=>{e.onInteractOutside?.(p),p.defaultPrevented||(o.current=!0,p.detail.originalEvent.type==="pointerdown"&&(d.current=!0));const m=p.target;s.triggerRef.current?.contains(m)&&p.preventDefault(),p.detail.originalEvent.type==="focusin"&&d.current&&p.preventDefault()}})}),s5=R.forwardRef((e,r)=>{const{__scopePopover:s,trapFocus:o,onOpenAutoFocus:d,onCloseAutoFocus:p,disableOutsidePointerEvents:m,onEscapeKeyDown:g,onPointerDownOutside:b,onFocusOutside:S,onInteractOutside:j,...A}=e,k=Xd(bg,s),T=uw(s);return OC(),u.jsx(aw,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:d,onUnmountAutoFocus:p,children:u.jsx(kg,{asChild:!0,disableOutsidePointerEvents:m,onInteractOutside:j,onEscapeKeyDown:g,onPointerDownOutside:b,onFocusOutside:S,onDismiss:()=>k.onOpenChange(!1),children:u.jsx(EC,{"data-state":a5(k.open),role:"dialog",id:k.contentId,...T,...A,ref:r,style:{...A.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),i5="PopoverClose",Xae=R.forwardRef((e,r)=>{const{__scopePopover:s,...o}=e,d=Xd(i5,s);return u.jsx(Cn.button,{type:"button",...o,ref:r,onClick:$t(e.onClick,()=>d.onOpenChange(!1))})});Xae.displayName=i5;var Yae="PopoverArrow",Zae=R.forwardRef((e,r)=>{const{__scopePopover:s,...o}=e,d=uw(s);return u.jsx(jC,{...d,...o,ref:r})});Zae.displayName=Yae;function a5(e){return e?"open":"closed"}var Wae=Jz,Jae=t5,Qae=n5,eoe=r5;function toe({...e}){return u.jsx(Wae,{"data-slot":"popover",...e})}function noe({...e}){return u.jsx(Jae,{"data-slot":"popover-trigger",...e})}function roe({className:e,align:r="center",sideOffset:s=4,...o}){return u.jsx(Qae,{children:u.jsx(eoe,{"data-slot":"popover-content",align:r,sideOffset:s,className:ht("bg-popover text-popover-foreground 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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...o})})}const soe=({orgs:e})=>{const[r,s]=R.useState(!1),[o,d]=R.useState(Qo.get()??"");R.useEffect(()=>Qo.subscribe(m=>d(m??"")),[]);const p=e.find(m=>m.id===o);return u.jsxs(toe,{open:r,onOpenChange:s,children:[u.jsx(noe,{asChild:!0,children:u.jsxs(Fe,{variant:"ghost",className:"h-9 w-full justify-between px-2","aria-label":"Switch organization",children:[u.jsxs("span",{className:"flex items-center gap-2 truncate",children:[u.jsx(iL,{className:"h-4 w-4"}),u.jsx("span",{className:"truncate",children:p?.name??"Select org"})]}),u.jsx(AZ,{className:"ml-2 h-4 w-4 opacity-50"})]})}),u.jsx(roe,{className:"w-[280px] p-0",align:"start",children:u.jsxs(Rae,{children:[u.jsx(Tae,{placeholder:"Search orgs..."}),u.jsxs(_ae,{children:[u.jsx($ae,{children:"No orgs found."}),u.jsx(Nae,{heading:"Organizations",children:e.map(m=>u.jsxs(Dae,{value:m.id,onSelect:g=>{Qo.set(g),s(!1)},children:[u.jsx(aL,{className:ht("mr-2 h-4 w-4",o===m.id?"opacity-100":"opacity-0")}),u.jsx("span",{className:"truncate",children:m.name})]},m.id))})]})]})})]})},o5=R.createContext({});function ioe(e){const r=R.useRef(null);return r.current===null&&(r.current=e()),r.current}const c2=typeof window<"u",aoe=c2?R.useLayoutEffect:R.useEffect,u2=R.createContext(null);function d2(e,r){e.indexOf(r)===-1&&e.push(r)}function h2(e,r){const s=e.indexOf(r);s>-1&&e.splice(s,1)}const gu=(e,r,s)=>s>r?r:s{};const yu={},l5=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function c5(e){return typeof e=="object"&&e!==null}const u5=e=>/^0[^.\s]+$/u.test(e);function f2(e){let r;return()=>(r===void 0&&(r=e()),r)}const so=e=>e,ooe=(e,r)=>s=>r(e(s)),dw=(...e)=>e.reduce(ooe),qb=(e,r,s)=>{const o=r-e;return o===0?1:(s-e)/o};class m2{constructor(){this.subscriptions=[]}add(r){return d2(this.subscriptions,r),()=>h2(this.subscriptions,r)}notify(r,s,o){const d=this.subscriptions.length;if(d)if(d===1)this.subscriptions[0](r,s,o);else for(let p=0;pe*1e3,ro=e=>e/1e3;function d5(e,r){return r?e*(1e3/r):0}const h5=(e,r,s)=>(((1-3*s+3*r)*e+(3*s-6*r))*e+3*r)*e,loe=1e-7,coe=12;function uoe(e,r,s,o,d){let p,m,g=0;do m=r+(s-r)/2,p=h5(m,o,d)-e,p>0?s=m:r=m;while(Math.abs(p)>loe&&++guoe(p,0,1,e,s);return p=>p===0||p===1?p:h5(d(p),r,o)}const p5=e=>r=>r<=.5?e(2*r)/2:(2-e(2*(1-r)))/2,f5=e=>r=>1-e(1-r),m5=hw(.33,1.53,.69,.99),g2=f5(m5),g5=p5(g2),y5=e=>(e*=2)<1?.5*g2(e):.5*(2-Math.pow(2,-10*(e-1))),y2=e=>1-Math.sin(Math.acos(e)),v5=f5(y2),x5=p5(y2),doe=hw(.42,0,1,1),hoe=hw(0,0,.58,1),b5=hw(.42,0,.58,1),poe=e=>Array.isArray(e)&&typeof e[0]!="number",w5=e=>Array.isArray(e)&&typeof e[0]=="number",foe={linear:so,easeIn:doe,easeInOut:b5,easeOut:hoe,circIn:y2,circInOut:x5,circOut:v5,backIn:g2,backInOut:g5,backOut:m5,anticipate:y5},moe=e=>typeof e=="string",OI=e=>{if(w5(e)){p2(e.length===4);const[r,s,o,d]=e;return hw(r,s,o,d)}else if(moe(e))return foe[e];return e},JE=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function goe(e,r){let s=new Set,o=new Set,d=!1,p=!1;const m=new WeakSet;let g={delta:0,timestamp:0,isProcessing:!1};function b(j){m.has(j)&&(S.schedule(j),e()),j(g)}const S={schedule:(j,A=!1,k=!1)=>{const M=k&&d?s:o;return A&&m.add(j),M.has(j)||M.add(j),j},cancel:j=>{o.delete(j),m.delete(j)},process:j=>{if(g=j,d){p=!0;return}d=!0,[s,o]=[o,s],s.forEach(b),s.clear(),d=!1,p&&(p=!1,S.process(j))}};return S}const yoe=40;function S5(e,r){let s=!1,o=!0;const d={delta:0,timestamp:0,isProcessing:!1},p=()=>s=!0,m=JE.reduce((X,L)=>(X[L]=goe(p),X),{}),{setup:g,read:b,resolveKeyframes:S,preUpdate:j,update:A,preRender:k,render:T,postRender:M}=m,I=()=>{const X=yu.useManualTiming?d.timestamp:performance.now();s=!1,yu.useManualTiming||(d.delta=o?1e3/60:Math.max(Math.min(X-d.timestamp,yoe),1)),d.timestamp=X,d.isProcessing=!0,g.process(d),b.process(d),S.process(d),j.process(d),A.process(d),k.process(d),T.process(d),M.process(d),d.isProcessing=!1,s&&r&&(o=!1,e(I))},q=()=>{s=!0,o=!0,d.isProcessing||e(I)};return{schedule:JE.reduce((X,L)=>{const ee=m[L];return X[L]=(oe,Q=!1,ne=!1)=>(s||q(),ee.schedule(oe,Q,ne)),X},{}),cancel:X=>{for(let L=0;L(xj===void 0&&da.set(Us.isProcessing||yu.useManualTiming?Us.timestamp:performance.now()),xj),set:e=>{xj=e,queueMicrotask(voe)}},E5=e=>r=>typeof r=="string"&&r.startsWith(e),v2=E5("--"),xoe=E5("var(--"),x2=e=>xoe(e)?boe.test(e.split("/*")[0].trim()):!1,boe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Ng={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Bb={...Ng,transform:e=>gu(0,1,e)},QE={...Ng,default:1},Tb=e=>Math.round(e*1e5)/1e5,b2=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function woe(e){return e==null}const Soe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,w2=(e,r)=>s=>!!(typeof s=="string"&&Soe.test(s)&&s.startsWith(e)||r&&!woe(s)&&Object.prototype.hasOwnProperty.call(s,r)),j5=(e,r,s)=>o=>{if(typeof o!="string")return o;const[d,p,m,g]=o.match(b2);return{[e]:parseFloat(d),[r]:parseFloat(p),[s]:parseFloat(m),alpha:g!==void 0?parseFloat(g):1}},Eoe=e=>gu(0,255,e),ZR={...Ng,transform:e=>Math.round(Eoe(e))},xp={test:w2("rgb","red"),parse:j5("red","green","blue"),transform:({red:e,green:r,blue:s,alpha:o=1})=>"rgba("+ZR.transform(e)+", "+ZR.transform(r)+", "+ZR.transform(s)+", "+Tb(Bb.transform(o))+")"};function joe(e){let r="",s="",o="",d="";return e.length>5?(r=e.substring(1,3),s=e.substring(3,5),o=e.substring(5,7),d=e.substring(7,9)):(r=e.substring(1,2),s=e.substring(2,3),o=e.substring(3,4),d=e.substring(4,5),r+=r,s+=s,o+=o,d+=d),{red:parseInt(r,16),green:parseInt(s,16),blue:parseInt(o,16),alpha:d?parseInt(d,16)/255:1}}const KT={test:w2("#"),parse:joe,transform:xp.transform},pw=e=>({test:r=>typeof r=="string"&&r.endsWith(e)&&r.split(" ").length===1,parse:parseFloat,transform:r=>`${r}${e}`}),Md=pw("deg"),ac=pw("%"),tn=pw("px"),Coe=pw("vh"),Aoe=pw("vw"),kI={...ac,parse:e=>ac.parse(e)/100,transform:e=>ac.transform(e*100)},ig={test:w2("hsl","hue"),parse:j5("hue","saturation","lightness"),transform:({hue:e,saturation:r,lightness:s,alpha:o=1})=>"hsla("+Math.round(e)+", "+ac.transform(Tb(r))+", "+ac.transform(Tb(s))+", "+Tb(Bb.transform(o))+")"},fs={test:e=>xp.test(e)||KT.test(e)||ig.test(e),parse:e=>xp.test(e)?xp.parse(e):ig.test(e)?ig.parse(e):KT.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?xp.transform(e):ig.transform(e),getAnimatableNone:e=>{const r=fs.parse(e);return r.alpha=0,fs.transform(r)}},Ooe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function koe(e){return isNaN(e)&&typeof e=="string"&&(e.match(b2)?.length||0)+(e.match(Ooe)?.length||0)>0}const C5="number",A5="color",Roe="var",Toe="var(",RI="${}",_oe=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ub(e){const r=e.toString(),s=[],o={color:[],number:[],var:[]},d=[];let p=0;const g=r.replace(_oe,b=>(fs.test(b)?(o.color.push(p),d.push(A5),s.push(fs.parse(b))):b.startsWith(Toe)?(o.var.push(p),d.push(Roe),s.push(b)):(o.number.push(p),d.push(C5),s.push(parseFloat(b))),++p,RI)).split(RI);return{values:s,split:g,indexes:o,types:d}}function O5(e){return Ub(e).values}function k5(e){const{split:r,types:s}=Ub(e),o=r.length;return d=>{let p="";for(let m=0;mtypeof e=="number"?0:fs.test(e)?fs.getAnimatableNone(e):e;function Noe(e){const r=O5(e);return k5(e)(r.map($oe))}const Kd={test:koe,parse:O5,createTransformer:k5,getAnimatableNone:Noe};function WR(e,r,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?e+(r-e)*6*s:s<1/2?r:s<2/3?e+(r-e)*(2/3-s)*6:e}function Doe({hue:e,saturation:r,lightness:s,alpha:o}){e/=360,r/=100,s/=100;let d=0,p=0,m=0;if(!r)d=p=m=s;else{const g=s<.5?s*(1+r):s+r-s*r,b=2*s-g;d=WR(b,g,e+1/3),p=WR(b,g,e),m=WR(b,g,e-1/3)}return{red:Math.round(d*255),green:Math.round(p*255),blue:Math.round(m*255),alpha:o}}function Kj(e,r){return s=>s>0?r:e}const Lr=(e,r,s)=>e+(r-e)*s,JR=(e,r,s)=>{const o=e*e,d=s*(r*r-o)+o;return d<0?0:Math.sqrt(d)},Poe=[KT,xp,ig],Moe=e=>Poe.find(r=>r.test(e));function TI(e){const r=Moe(e);if(!r)return!1;let s=r.parse(e);return r===ig&&(s=Doe(s)),s}const _I=(e,r)=>{const s=TI(e),o=TI(r);if(!s||!o)return Kj(e,r);const d={...s};return p=>(d.red=JR(s.red,o.red,p),d.green=JR(s.green,o.green,p),d.blue=JR(s.blue,o.blue,p),d.alpha=Lr(s.alpha,o.alpha,p),xp.transform(d))},VT=new Set(["none","hidden"]);function Ioe(e,r){return VT.has(e)?s=>s<=0?e:r:s=>s>=1?r:e}function Loe(e,r){return s=>Lr(e,r,s)}function S2(e){return typeof e=="number"?Loe:typeof e=="string"?x2(e)?Kj:fs.test(e)?_I:qoe:Array.isArray(e)?R5:typeof e=="object"?fs.test(e)?_I:zoe:Kj}function R5(e,r){const s=[...e],o=s.length,d=e.map((p,m)=>S2(p)(p,r[m]));return p=>{for(let m=0;m{for(const p in o)s[p]=o[p](d);return s}}function Foe(e,r){const s=[],o={color:0,var:0,number:0};for(let d=0;d{const s=Kd.createTransformer(r),o=Ub(e),d=Ub(r);return o.indexes.var.length===d.indexes.var.length&&o.indexes.color.length===d.indexes.color.length&&o.indexes.number.length>=d.indexes.number.length?VT.has(e)&&!d.values.length||VT.has(r)&&!o.values.length?Ioe(e,r):dw(R5(Foe(o,d),d.values),s):Kj(e,r)};function T5(e,r,s){return typeof e=="number"&&typeof r=="number"&&typeof s=="number"?Lr(e,r,s):S2(e)(e,r)}const Boe=e=>{const r=({timestamp:s})=>e(s);return{start:(s=!0)=>_r.update(r,s),stop:()=>Ud(r),now:()=>Us.isProcessing?Us.timestamp:da.now()}},_5=(e,r,s=10)=>{let o="";const d=Math.max(Math.round(r/s),2);for(let p=0;p=Vj?1/0:r}function Uoe(e,r=100,s){const o=s({...e,keyframes:[0,r]}),d=Math.min(E2(o),Vj);return{type:"keyframes",ease:p=>o.next(d*p).value/r,duration:ro(d)}}const Koe=5;function $5(e,r,s){const o=Math.max(r-Koe,0);return d5(s-e(o),r-o)}const Vr={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},QR=.001;function Voe({duration:e=Vr.duration,bounce:r=Vr.bounce,velocity:s=Vr.velocity,mass:o=Vr.mass}){let d,p,m=1-r;m=gu(Vr.minDamping,Vr.maxDamping,m),e=gu(Vr.minDuration,Vr.maxDuration,ro(e)),m<1?(d=S=>{const j=S*m,A=j*e,k=j-s,T=HT(S,m),M=Math.exp(-A);return QR-k/T*M},p=S=>{const A=S*m*e,k=A*s+s,T=Math.pow(m,2)*Math.pow(S,2)*e,M=Math.exp(-A),I=HT(Math.pow(S,2),m);return(-d(S)+QR>0?-1:1)*((k-T)*M)/I}):(d=S=>{const j=Math.exp(-S*e),A=(S-s)*e+1;return-QR+j*A},p=S=>{const j=Math.exp(-S*e),A=(s-S)*(e*e);return j*A});const g=5/e,b=Goe(d,p,g);if(e=ic(e),isNaN(b))return{stiffness:Vr.stiffness,damping:Vr.damping,duration:e};{const S=Math.pow(b,2)*o;return{stiffness:S,damping:m*2*Math.sqrt(o*S),duration:e}}}const Hoe=12;function Goe(e,r,s){let o=s;for(let d=1;de[s]!==void 0)}function Zoe(e){let r={velocity:Vr.velocity,stiffness:Vr.stiffness,damping:Vr.damping,mass:Vr.mass,isResolvedFromDuration:!1,...e};if(!$I(e,Yoe)&&$I(e,Xoe))if(e.visualDuration){const s=e.visualDuration,o=2*Math.PI/(s*1.2),d=o*o,p=2*gu(.05,1,1-(e.bounce||0))*Math.sqrt(d);r={...r,mass:Vr.mass,stiffness:d,damping:p}}else{const s=Voe(e);r={...r,...s,mass:Vr.mass},r.isResolvedFromDuration=!0}return r}function Hj(e=Vr.visualDuration,r=Vr.bounce){const s=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:r}:e;let{restSpeed:o,restDelta:d}=s;const p=s.keyframes[0],m=s.keyframes[s.keyframes.length-1],g={done:!1,value:p},{stiffness:b,damping:S,mass:j,duration:A,velocity:k,isResolvedFromDuration:T}=Zoe({...s,velocity:-ro(s.velocity||0)}),M=k||0,I=S/(2*Math.sqrt(b*j)),q=m-p,G=ro(Math.sqrt(b/j)),K=Math.abs(q)<5;o||(o=K?Vr.restSpeed.granular:Vr.restSpeed.default),d||(d=K?Vr.restDelta.granular:Vr.restDelta.default);let X;if(I<1){const ee=HT(G,I);X=oe=>{const Q=Math.exp(-I*G*oe);return m-Q*((M+I*G*q)/ee*Math.sin(ee*oe)+q*Math.cos(ee*oe))}}else if(I===1)X=ee=>m-Math.exp(-G*ee)*(q+(M+G*q)*ee);else{const ee=G*Math.sqrt(I*I-1);X=oe=>{const Q=Math.exp(-I*G*oe),ne=Math.min(ee*oe,300);return m-Q*((M+I*G*q)*Math.sinh(ne)+ee*q*Math.cosh(ne))/ee}}const L={calculatedDuration:T&&A||null,next:ee=>{const oe=X(ee);if(T)g.done=ee>=A;else{let Q=ee===0?M:0;I<1&&(Q=ee===0?ic(M):$5(X,ee,oe));const ne=Math.abs(Q)<=o,de=Math.abs(m-oe)<=d;g.done=ne&&de}return g.value=g.done?m:oe,g},toString:()=>{const ee=Math.min(E2(L),Vj),oe=_5(Q=>L.next(ee*Q).value,ee,30);return ee+"ms "+oe},toTransition:()=>{}};return L}Hj.applyToOptions=e=>{const r=Uoe(e,100,Hj);return e.ease=r.ease,e.duration=ic(r.duration),e.type="keyframes",e};function GT({keyframes:e,velocity:r=0,power:s=.8,timeConstant:o=325,bounceDamping:d=10,bounceStiffness:p=500,modifyTarget:m,min:g,max:b,restDelta:S=.5,restSpeed:j}){const A=e[0],k={done:!1,value:A},T=ne=>g!==void 0&&neb,M=ne=>g===void 0?b:b===void 0||Math.abs(g-ne)-I*Math.exp(-ne/o),X=ne=>G+K(ne),L=ne=>{const de=K(ne),je=X(ne);k.done=Math.abs(de)<=S,k.value=k.done?G:je};let ee,oe;const Q=ne=>{T(k.value)&&(ee=ne,oe=Hj({keyframes:[k.value,M(k.value)],velocity:$5(X,ne,k.value),damping:d,stiffness:p,restDelta:S,restSpeed:j}))};return Q(0),{calculatedDuration:null,next:ne=>{let de=!1;return!oe&&ee===void 0&&(de=!0,L(ne),Q(ne)),ee!==void 0&&ne>=ee?oe.next(ne-ee):(!de&&L(ne),k)}}}function Woe(e,r,s){const o=[],d=s||yu.mix||T5,p=e.length-1;for(let m=0;mr[0];if(p===2&&r[0]===r[1])return()=>r[1];const m=e[0]===e[1];e[0]>e[p-1]&&(e=[...e].reverse(),r=[...r].reverse());const g=Woe(r,o,d),b=g.length,S=j=>{if(m&&j1)for(;AS(gu(e[0],e[p-1],j)):S}function Qoe(e,r){const s=e[e.length-1];for(let o=1;o<=r;o++){const d=qb(0,r,o);e.push(Lr(s,1,d))}}function ele(e){const r=[0];return Qoe(r,e.length-1),r}function tle(e,r){return e.map(s=>s*r)}function nle(e,r){return e.map(()=>r||b5).splice(0,e.length-1)}function _b({duration:e=300,keyframes:r,times:s,ease:o="easeInOut"}){const d=poe(o)?o.map(OI):OI(o),p={done:!1,value:r[0]},m=tle(s&&s.length===r.length?s:ele(r),e),g=Joe(m,r,{ease:Array.isArray(d)?d:nle(r,d)});return{calculatedDuration:e,next:b=>(p.value=g(b),p.done=b>=e,p)}}const rle=e=>e!==null;function j2(e,{repeat:r,repeatType:s="loop"},o,d=1){const p=e.filter(rle),g=d<0||r&&s!=="loop"&&r%2===1?0:p.length-1;return!g||o===void 0?p[g]:o}const sle={decay:GT,inertia:GT,tween:_b,keyframes:_b,spring:Hj};function N5(e){typeof e.type=="string"&&(e.type=sle[e.type])}class C2{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(r=>{this.resolve=r})}notifyFinished(){this.resolve()}then(r,s){return this.finished.then(r,s)}}const ile=e=>e/100;class A2 extends C2{constructor(r){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:s}=this.options;s&&s.updatedAt!==da.now()&&this.tick(da.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=r,this.initAnimation(),this.play(),r.autoplay===!1&&this.pause()}initAnimation(){const{options:r}=this;N5(r);const{type:s=_b,repeat:o=0,repeatDelay:d=0,repeatType:p,velocity:m=0}=r;let{keyframes:g}=r;const b=s||_b;b!==_b&&typeof g[0]!="number"&&(this.mixKeyframes=dw(ile,T5(g[0],g[1])),g=[0,100]);const S=b({...r,keyframes:g});p==="mirror"&&(this.mirroredGenerator=b({...r,keyframes:[...g].reverse(),velocity:-m})),S.calculatedDuration===null&&(S.calculatedDuration=E2(S));const{calculatedDuration:j}=S;this.calculatedDuration=j,this.resolvedDuration=j+d,this.totalDuration=this.resolvedDuration*(o+1)-d,this.generator=S}updateTime(r){const s=Math.round(r-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=s}tick(r,s=!1){const{generator:o,totalDuration:d,mixKeyframes:p,mirroredGenerator:m,resolvedDuration:g,calculatedDuration:b}=this;if(this.startTime===null)return o.next(0);const{delay:S=0,keyframes:j,repeat:A,repeatType:k,repeatDelay:T,type:M,onUpdate:I,finalKeyframe:q}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,r):this.speed<0&&(this.startTime=Math.min(r-d/this.speed,this.startTime)),s?this.currentTime=r:this.updateTime(r);const G=this.currentTime-S*(this.playbackSpeed>=0?1:-1),K=this.playbackSpeed>=0?G<0:G>d;this.currentTime=Math.max(G,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let X=this.currentTime,L=o;if(A){const ne=Math.min(this.currentTime,d)/g;let de=Math.floor(ne),je=ne%1;!je&&ne>=1&&(je=1),je===1&&de--,de=Math.min(de,A+1),!!(de%2)&&(k==="reverse"?(je=1-je,T&&(je-=T/g)):k==="mirror"&&(L=m)),X=gu(0,1,je)*g}const ee=K?{done:!1,value:j[0]}:L.next(X);p&&(ee.value=p(ee.value));let{done:oe}=ee;!K&&b!==null&&(oe=this.playbackSpeed>=0?this.currentTime>=d:this.currentTime<=0);const Q=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&oe);return Q&&M!==GT&&(ee.value=j2(j,this.options,q,this.speed)),I&&I(ee.value),Q&&this.finish(),ee}then(r,s){return this.finished.then(r,s)}get duration(){return ro(this.calculatedDuration)}get iterationDuration(){const{delay:r=0}=this.options||{};return this.duration+ro(r)}get time(){return ro(this.currentTime)}set time(r){r=ic(r),this.currentTime=r,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=r:this.driver&&(this.startTime=this.driver.now()-r/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(r){this.updateTime(da.now());const s=this.playbackSpeed!==r;this.playbackSpeed=r,s&&(this.time=ro(this.currentTime))}play(){if(this.isStopped)return;const{driver:r=Boe,startTime:s}=this.options;this.driver||(this.driver=r(d=>this.tick(d))),this.options.onPlay?.();const o=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=o):this.holdTime!==null?this.startTime=o-this.holdTime:this.startTime||(this.startTime=s??o),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(da.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(r){return this.startTime=0,this.tick(r,!0)}attachTimeline(r){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),r.observe(this)}}function ale(e){for(let r=1;re*180/Math.PI,XT=e=>{const r=bp(Math.atan2(e[1],e[0]));return YT(r)},ole={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:XT,rotateZ:XT,skewX:e=>bp(Math.atan(e[1])),skewY:e=>bp(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},YT=e=>(e=e%360,e<0&&(e+=360),e),NI=XT,DI=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),PI=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),lle={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:DI,scaleY:PI,scale:e=>(DI(e)+PI(e))/2,rotateX:e=>YT(bp(Math.atan2(e[6],e[5]))),rotateY:e=>YT(bp(Math.atan2(-e[2],e[0]))),rotateZ:NI,rotate:NI,skewX:e=>bp(Math.atan(e[4])),skewY:e=>bp(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function ZT(e){return e.includes("scale")?1:0}function WT(e,r){if(!e||e==="none")return ZT(r);const s=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let o,d;if(s)o=lle,d=s;else{const g=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);o=ole,d=g}if(!d)return ZT(r);const p=o[r],m=d[1].split(",").map(ule);return typeof p=="function"?p(m):m[p]}const cle=(e,r)=>{const{transform:s="none"}=getComputedStyle(e);return WT(s,r)};function ule(e){return parseFloat(e.trim())}const Dg=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Pg=new Set(Dg),MI=e=>e===Ng||e===tn,dle=new Set(["x","y","z"]),hle=Dg.filter(e=>!dle.has(e));function ple(e){const r=[];return hle.forEach(s=>{const o=e.getValue(s);o!==void 0&&(r.push([s,o.get()]),o.set(s.startsWith("scale")?1:0))}),r}const Sp={width:({x:e},{paddingLeft:r="0",paddingRight:s="0"})=>e.max-e.min-parseFloat(r)-parseFloat(s),height:({y:e},{paddingTop:r="0",paddingBottom:s="0"})=>e.max-e.min-parseFloat(r)-parseFloat(s),top:(e,{top:r})=>parseFloat(r),left:(e,{left:r})=>parseFloat(r),bottom:({y:e},{top:r})=>parseFloat(r)+(e.max-e.min),right:({x:e},{left:r})=>parseFloat(r)+(e.max-e.min),x:(e,{transform:r})=>WT(r,"x"),y:(e,{transform:r})=>WT(r,"y")};Sp.translateX=Sp.x;Sp.translateY=Sp.y;const Ep=new Set;let JT=!1,QT=!1,e_=!1;function D5(){if(QT){const e=Array.from(Ep).filter(o=>o.needsMeasurement),r=new Set(e.map(o=>o.element)),s=new Map;r.forEach(o=>{const d=ple(o);d.length&&(s.set(o,d),o.render())}),e.forEach(o=>o.measureInitialState()),r.forEach(o=>{o.render();const d=s.get(o);d&&d.forEach(([p,m])=>{o.getValue(p)?.set(m)})}),e.forEach(o=>o.measureEndState()),e.forEach(o=>{o.suspendedScrollY!==void 0&&window.scrollTo(0,o.suspendedScrollY)})}QT=!1,JT=!1,Ep.forEach(e=>e.complete(e_)),Ep.clear()}function P5(){Ep.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(QT=!0)})}function fle(){e_=!0,P5(),D5(),e_=!1}class O2{constructor(r,s,o,d,p,m=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...r],this.onComplete=s,this.name=o,this.motionValue=d,this.element=p,this.isAsync=m}scheduleResolve(){this.state="scheduled",this.isAsync?(Ep.add(this),JT||(JT=!0,_r.read(P5),_r.resolveKeyframes(D5))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:r,name:s,element:o,motionValue:d}=this;if(r[0]===null){const p=d?.get(),m=r[r.length-1];if(p!==void 0)r[0]=p;else if(o&&s){const g=o.readValue(s,m);g!=null&&(r[0]=g)}r[0]===void 0&&(r[0]=m),d&&p===void 0&&d.set(r[0])}ale(r)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(r=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,r),Ep.delete(this)}cancel(){this.state==="scheduled"&&(Ep.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const mle=e=>e.startsWith("--");function gle(e,r,s){mle(r)?e.style.setProperty(r,s):e.style[r]=s}const yle=f2(()=>window.ScrollTimeline!==void 0),vle={};function xle(e,r){const s=f2(e);return()=>vle[r]??s()}const M5=xle(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),wb=([e,r,s,o])=>`cubic-bezier(${e}, ${r}, ${s}, ${o})`,II={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:wb([0,.65,.55,1]),circOut:wb([.55,0,1,.45]),backIn:wb([.31,.01,.66,-.59]),backOut:wb([.33,1.53,.69,.99])};function I5(e,r){if(e)return typeof e=="function"?M5()?_5(e,r):"ease-out":w5(e)?wb(e):Array.isArray(e)?e.map(s=>I5(s,r)||II.easeOut):II[e]}function ble(e,r,s,{delay:o=0,duration:d=300,repeat:p=0,repeatType:m="loop",ease:g="easeOut",times:b}={},S=void 0){const j={[r]:s};b&&(j.offset=b);const A=I5(g,d);Array.isArray(A)&&(j.easing=A);const k={delay:o,duration:d,easing:Array.isArray(A)?"linear":A,fill:"both",iterations:p+1,direction:m==="reverse"?"alternate":"normal"};return S&&(k.pseudoElement=S),e.animate(j,k)}function L5(e){return typeof e=="function"&&"applyToOptions"in e}function wle({type:e,...r}){return L5(e)&&M5()?e.applyToOptions(r):(r.duration??(r.duration=300),r.ease??(r.ease="easeOut"),r)}class Sle extends C2{constructor(r){if(super(),this.finishedTime=null,this.isStopped=!1,!r)return;const{element:s,name:o,keyframes:d,pseudoElement:p,allowFlatten:m=!1,finalKeyframe:g,onComplete:b}=r;this.isPseudoElement=!!p,this.allowFlatten=m,this.options=r,p2(typeof r.type!="string");const S=wle(r);this.animation=ble(s,o,d,S,p),S.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!p){const j=j2(d,this.options,g,this.speed);this.updateMotionValue?this.updateMotionValue(j):gle(s,o,j),this.animation.cancel()}b?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:r}=this;r==="idle"||r==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const r=this.animation.effect?.getComputedTiming?.().duration||0;return ro(Number(r))}get iterationDuration(){const{delay:r=0}=this.options||{};return this.duration+ro(r)}get time(){return ro(Number(this.animation.currentTime)||0)}set time(r){this.finishedTime=null,this.animation.currentTime=ic(r)}get speed(){return this.animation.playbackRate}set speed(r){r<0&&(this.finishedTime=null),this.animation.playbackRate=r}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(r){this.animation.startTime=r}attachTimeline({timeline:r,observe:s}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,r&&yle()?(this.animation.timeline=r,so):s(this)}}const z5={anticipate:y5,backInOut:g5,circInOut:x5};function Ele(e){return e in z5}function jle(e){typeof e.ease=="string"&&Ele(e.ease)&&(e.ease=z5[e.ease])}const LI=10;class Cle extends Sle{constructor(r){jle(r),N5(r),super(r),r.startTime&&(this.startTime=r.startTime),this.options=r}updateMotionValue(r){const{motionValue:s,onUpdate:o,onComplete:d,element:p,...m}=this.options;if(!s)return;if(r!==void 0){s.set(r);return}const g=new A2({...m,autoplay:!1}),b=ic(this.finishedTime??this.time);s.setWithVelocity(g.sample(b-LI).value,g.sample(b).value,LI),g.stop()}}const zI=(e,r)=>r==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Kd.test(e)||e==="0")&&!e.startsWith("url("));function Ale(e){const r=e[0];if(e.length===1)return!0;for(let s=0;sObject.hasOwnProperty.call(Element.prototype,"animate"));function Tle(e){const{motionValue:r,name:s,repeatDelay:o,repeatType:d,damping:p,type:m}=e;if(!(r?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:b,transformTemplate:S}=r.owner.getProps();return Rle()&&s&&kle.has(s)&&(s!=="transform"||!S)&&!b&&!o&&d!=="mirror"&&p!==0&&m!=="inertia"}const _le=40;class $le extends C2{constructor({autoplay:r=!0,delay:s=0,type:o="keyframes",repeat:d=0,repeatDelay:p=0,repeatType:m="loop",keyframes:g,name:b,motionValue:S,element:j,...A}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=da.now();const k={autoplay:r,delay:s,type:o,repeat:d,repeatDelay:p,repeatType:m,name:b,motionValue:S,element:j,...A},T=j?.KeyframeResolver||O2;this.keyframeResolver=new T(g,(M,I,q)=>this.onKeyframesResolved(M,I,k,!q),b,S,j),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(r,s,o,d){this.keyframeResolver=void 0;const{name:p,type:m,velocity:g,delay:b,isHandoff:S,onUpdate:j}=o;this.resolvedAt=da.now(),Ole(r,p,m,g)||((yu.instantAnimations||!b)&&j?.(j2(r,o,s)),r[0]=r[r.length-1],t_(o),o.repeat=0);const k={startTime:d?this.resolvedAt?this.resolvedAt-this.createdAt>_le?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:s,...o,keyframes:r},T=!S&&Tle(k)?new Cle({...k,element:k.motionValue.owner.current}):new A2(k);T.finished.then(()=>this.notifyFinished()).catch(so),this.pendingTimeline&&(this.stopTimeline=T.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=T}get finished(){return this._animation?this.animation.finished:this._finished}then(r,s){return this.finished.finally(r).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),fle()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(r){this.animation.time=r}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(r){this.animation.speed=r}get startTime(){return this.animation.startTime}attachTimeline(r){return this._animation?this.stopTimeline=this.animation.attachTimeline(r):this.pendingTimeline=r,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const Nle=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Dle(e){const r=Nle.exec(e);if(!r)return[,];const[,s,o,d]=r;return[`--${s??o}`,d]}function F5(e,r,s=1){const[o,d]=Dle(e);if(!o)return;const p=window.getComputedStyle(r).getPropertyValue(o);if(p){const m=p.trim();return l5(m)?parseFloat(m):m}return x2(d)?F5(d,r,s+1):d}function k2(e,r){return e?.[r]??e?.default??e}const q5=new Set(["width","height","top","left","right","bottom",...Dg]),Ple={test:e=>e==="auto",parse:e=>e},B5=e=>r=>r.test(e),U5=[Ng,tn,ac,Md,Aoe,Coe,Ple],FI=e=>U5.find(B5(e));function Mle(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||u5(e):!0}const Ile=new Set(["brightness","contrast","saturate","opacity"]);function Lle(e){const[r,s]=e.slice(0,-1).split("(");if(r==="drop-shadow")return e;const[o]=s.match(b2)||[];if(!o)return e;const d=s.replace(o,"");let p=Ile.has(r)?1:0;return o!==s&&(p*=100),r+"("+p+d+")"}const zle=/\b([a-z-]*)\(.*?\)/gu,n_={...Kd,getAnimatableNone:e=>{const r=e.match(zle);return r?r.map(Lle).join(" "):e}},qI={...Ng,transform:Math.round},Fle={rotate:Md,rotateX:Md,rotateY:Md,rotateZ:Md,scale:QE,scaleX:QE,scaleY:QE,scaleZ:QE,skew:Md,skewX:Md,skewY:Md,distance:tn,translateX:tn,translateY:tn,translateZ:tn,x:tn,y:tn,z:tn,perspective:tn,transformPerspective:tn,opacity:Bb,originX:kI,originY:kI,originZ:tn},R2={borderWidth:tn,borderTopWidth:tn,borderRightWidth:tn,borderBottomWidth:tn,borderLeftWidth:tn,borderRadius:tn,radius:tn,borderTopLeftRadius:tn,borderTopRightRadius:tn,borderBottomRightRadius:tn,borderBottomLeftRadius:tn,width:tn,maxWidth:tn,height:tn,maxHeight:tn,top:tn,right:tn,bottom:tn,left:tn,padding:tn,paddingTop:tn,paddingRight:tn,paddingBottom:tn,paddingLeft:tn,margin:tn,marginTop:tn,marginRight:tn,marginBottom:tn,marginLeft:tn,backgroundPositionX:tn,backgroundPositionY:tn,...Fle,zIndex:qI,fillOpacity:Bb,strokeOpacity:Bb,numOctaves:qI},qle={...R2,color:fs,backgroundColor:fs,outlineColor:fs,fill:fs,stroke:fs,borderColor:fs,borderTopColor:fs,borderRightColor:fs,borderBottomColor:fs,borderLeftColor:fs,filter:n_,WebkitFilter:n_},K5=e=>qle[e];function V5(e,r){let s=K5(e);return s!==n_&&(s=Kd),s.getAnimatableNone?s.getAnimatableNone(r):void 0}const Ble=new Set(["auto","none","0"]);function Ule(e,r,s){let o=0,d;for(;o{r.getValue(g).set(b)}),this.resolveNoneKeyframes()}}function Vle(e,r,s){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let o=document;const d=s?.[e]??o.querySelectorAll(e);return d?Array.from(d):[]}return Array.from(e)}const H5=(e,r)=>r&&typeof e=="number"?r.transform(e):e;function Hle(e){return c5(e)&&"offsetHeight"in e}const BI=30,Gle=e=>!isNaN(parseFloat(e));class Xle{constructor(r,s={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=o=>{const d=da.now();if(this.updatedAt!==d&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(o),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const p of this.dependents)p.dirty()},this.hasAnimated=!1,this.setCurrent(r),this.owner=s.owner}setCurrent(r){this.current=r,this.updatedAt=da.now(),this.canTrackVelocity===null&&r!==void 0&&(this.canTrackVelocity=Gle(this.current))}setPrevFrameValue(r=this.current){this.prevFrameValue=r,this.prevUpdatedAt=this.updatedAt}onChange(r){return this.on("change",r)}on(r,s){this.events[r]||(this.events[r]=new m2);const o=this.events[r].add(s);return r==="change"?()=>{o(),_r.read(()=>{this.events.change.getSize()||this.stop()})}:o}clearListeners(){for(const r in this.events)this.events[r].clear()}attach(r,s){this.passiveEffect=r,this.stopPassiveEffect=s}set(r){this.passiveEffect?this.passiveEffect(r,this.updateAndNotify):this.updateAndNotify(r)}setWithVelocity(r,s,o){this.set(s),this.prev=void 0,this.prevFrameValue=r,this.prevUpdatedAt=this.updatedAt-o}jump(r,s=!0){this.updateAndNotify(r),this.prev=r,this.prevUpdatedAt=this.prevFrameValue=void 0,s&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(r){this.dependents||(this.dependents=new Set),this.dependents.add(r)}removeDependent(r){this.dependents&&this.dependents.delete(r)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const r=da.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||r-this.updatedAt>BI)return 0;const s=Math.min(this.updatedAt-this.prevUpdatedAt,BI);return d5(parseFloat(this.current)-parseFloat(this.prevFrameValue),s)}start(r){return this.stop(),new Promise(s=>{this.hasAnimated=!0,this.animation=r(s),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function wg(e,r){return new Xle(e,r)}const{schedule:T2}=S5(queueMicrotask,!1),Xo={x:!1,y:!1};function G5(){return Xo.x||Xo.y}function Yle(e){return e==="x"||e==="y"?Xo[e]?null:(Xo[e]=!0,()=>{Xo[e]=!1}):Xo.x||Xo.y?null:(Xo.x=Xo.y=!0,()=>{Xo.x=Xo.y=!1})}function X5(e,r){const s=Vle(e),o=new AbortController,d={passive:!0,...r,signal:o.signal};return[s,d,()=>o.abort()]}function UI(e){return!(e.pointerType==="touch"||G5())}function Zle(e,r,s={}){const[o,d,p]=X5(e,s),m=g=>{if(!UI(g))return;const{target:b}=g,S=r(b,g);if(typeof S!="function"||!b)return;const j=A=>{UI(A)&&(S(A),b.removeEventListener("pointerleave",j))};b.addEventListener("pointerleave",j,d)};return o.forEach(g=>{g.addEventListener("pointerenter",m,d)}),p}const Y5=(e,r)=>r?e===r?!0:Y5(e,r.parentElement):!1,_2=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Wle=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Jle(e){return Wle.has(e.tagName)||e.tabIndex!==-1}const bj=new WeakSet;function KI(e){return r=>{r.key==="Enter"&&e(r)}}function eT(e,r){e.dispatchEvent(new PointerEvent("pointer"+r,{isPrimary:!0,bubbles:!0}))}const Qle=(e,r)=>{const s=e.currentTarget;if(!s)return;const o=KI(()=>{if(bj.has(s))return;eT(s,"down");const d=KI(()=>{eT(s,"up")}),p=()=>eT(s,"cancel");s.addEventListener("keyup",d,r),s.addEventListener("blur",p,r)});s.addEventListener("keydown",o,r),s.addEventListener("blur",()=>s.removeEventListener("keydown",o),r)};function VI(e){return _2(e)&&!G5()}function ece(e,r,s={}){const[o,d,p]=X5(e,s),m=g=>{const b=g.currentTarget;if(!VI(g))return;bj.add(b);const S=r(b,g),j=(T,M)=>{window.removeEventListener("pointerup",A),window.removeEventListener("pointercancel",k),bj.has(b)&&bj.delete(b),VI(T)&&typeof S=="function"&&S(T,{success:M})},A=T=>{j(T,b===window||b===document||s.useGlobalTarget||Y5(b,T.target))},k=T=>{j(T,!1)};window.addEventListener("pointerup",A,d),window.addEventListener("pointercancel",k,d)};return o.forEach(g=>{(s.useGlobalTarget?window:g).addEventListener("pointerdown",m,d),Hle(g)&&(g.addEventListener("focus",S=>Qle(S,d)),!Jle(g)&&!g.hasAttribute("tabindex")&&(g.tabIndex=0))}),p}function Z5(e){return c5(e)&&"ownerSVGElement"in e}function tce(e){return Z5(e)&&e.tagName==="svg"}const bi=e=>!!(e&&e.getVelocity),nce=[...U5,fs,Kd],rce=e=>nce.find(B5(e)),W5=R.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function sce(e=!0){const r=R.useContext(u2);if(r===null)return[!0,null];const{isPresent:s,onExitComplete:o,register:d}=r,p=R.useId();R.useEffect(()=>{if(e)return d(p)},[e]);const m=R.useCallback(()=>e&&o&&o(p),[p,o,e]);return!s&&o?[!1,m]:[!0]}const J5=R.createContext({strict:!1}),HI={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Sg={};for(const e in HI)Sg[e]={isEnabled:r=>HI[e].some(s=>!!r[s])};function ice(e){for(const r in e)Sg[r]={...Sg[r],...e[r]}}const ace=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Gj(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||ace.has(e)}let Q5=e=>!Gj(e);function oce(e){typeof e=="function"&&(Q5=r=>r.startsWith("on")?!Gj(r):e(r))}try{oce(require("@emotion/is-prop-valid").default)}catch{}function lce(e,r,s){const o={};for(const d in e)d==="values"&&typeof e.values=="object"||(Q5(d)||s===!0&&Gj(d)||!r&&!Gj(d)||e.draggable&&d.startsWith("onDrag"))&&(o[d]=e[d]);return o}const IC=R.createContext({});function LC(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Kb(e){return typeof e=="string"||Array.isArray(e)}const $2=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],N2=["initial",...$2];function zC(e){return LC(e.animate)||N2.some(r=>Kb(e[r]))}function eF(e){return!!(zC(e)||e.variants)}function cce(e,r){if(zC(e)){const{initial:s,animate:o}=e;return{initial:s===!1||Kb(s)?s:void 0,animate:Kb(o)?o:void 0}}return e.inherit!==!1?r:{}}function uce(e){const{initial:r,animate:s}=cce(e,R.useContext(IC));return R.useMemo(()=>({initial:r,animate:s}),[GI(r),GI(s)])}function GI(e){return Array.isArray(e)?e.join(" "):e}const Vb={};function dce(e){for(const r in e)Vb[r]=e[r],v2(r)&&(Vb[r].isCSSVariable=!0)}function tF(e,{layout:r,layoutId:s}){return Pg.has(e)||e.startsWith("origin")||(r||s!==void 0)&&(!!Vb[e]||e==="opacity")}const hce={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},pce=Dg.length;function fce(e,r,s){let o="",d=!0;for(let p=0;p({style:{},transform:{},transformOrigin:{},vars:{}});function nF(e,r,s){for(const o in r)!bi(r[o])&&!tF(o,s)&&(e[o]=r[o])}function mce({transformTemplate:e},r){return R.useMemo(()=>{const s=P2();return D2(s,r,e),Object.assign({},s.vars,s.style)},[r])}function gce(e,r){const s=e.style||{},o={};return nF(o,s,e),Object.assign(o,mce(e,r)),o}function yce(e,r){const s={},o=gce(e,r);return e.drag&&e.dragListener!==!1&&(s.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(s.tabIndex=0),s.style=o,s}const vce={offset:"stroke-dashoffset",array:"stroke-dasharray"},xce={offset:"strokeDashoffset",array:"strokeDasharray"};function bce(e,r,s=1,o=0,d=!0){e.pathLength=1;const p=d?vce:xce;e[p.offset]=tn.transform(-o);const m=tn.transform(r),g=tn.transform(s);e[p.array]=`${m} ${g}`}function rF(e,{attrX:r,attrY:s,attrScale:o,pathLength:d,pathSpacing:p=1,pathOffset:m=0,...g},b,S,j){if(D2(e,g,S),b){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:A,style:k}=e;A.transform&&(k.transform=A.transform,delete A.transform),(k.transform||A.transformOrigin)&&(k.transformOrigin=A.transformOrigin??"50% 50%",delete A.transformOrigin),k.transform&&(k.transformBox=j?.transformBox??"fill-box",delete A.transformBox),r!==void 0&&(A.x=r),s!==void 0&&(A.y=s),o!==void 0&&(A.scale=o),d!==void 0&&bce(A,d,p,m,!1)}const sF=()=>({...P2(),attrs:{}}),iF=e=>typeof e=="string"&&e.toLowerCase()==="svg";function wce(e,r,s,o){const d=R.useMemo(()=>{const p=sF();return rF(p,r,iF(o),e.transformTemplate,e.style),{...p.attrs,style:{...p.style}}},[r]);if(e.style){const p={};nF(p,e.style,e),d.style={...p,...d.style}}return d}const Sce=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function M2(e){return typeof e!="string"||e.includes("-")?!1:!!(Sce.indexOf(e)>-1||/[A-Z]/u.test(e))}function Ece(e,r,s,{latestValues:o},d,p=!1){const g=(M2(e)?wce:yce)(r,o,d,e),b=lce(r,typeof e=="string",p),S=e!==R.Fragment?{...b,...g,ref:s}:{},{children:j}=r,A=R.useMemo(()=>bi(j)?j.get():j,[j]);return R.createElement(e,{...S,children:A})}function XI(e){const r=[{},{}];return e?.values.forEach((s,o)=>{r[0][o]=s.get(),r[1][o]=s.getVelocity()}),r}function I2(e,r,s,o){if(typeof r=="function"){const[d,p]=XI(o);r=r(s!==void 0?s:e.custom,d,p)}if(typeof r=="string"&&(r=e.variants&&e.variants[r]),typeof r=="function"){const[d,p]=XI(o);r=r(s!==void 0?s:e.custom,d,p)}return r}function wj(e){return bi(e)?e.get():e}function jce({scrapeMotionValuesFromProps:e,createRenderState:r},s,o,d){return{latestValues:Cce(s,o,d,e),renderState:r()}}function Cce(e,r,s,o){const d={},p=o(e,{});for(const k in p)d[k]=wj(p[k]);let{initial:m,animate:g}=e;const b=zC(e),S=eF(e);r&&S&&!b&&e.inherit!==!1&&(m===void 0&&(m=r.initial),g===void 0&&(g=r.animate));let j=s?s.initial===!1:!1;j=j||m===!1;const A=j?g:m;if(A&&typeof A!="boolean"&&!LC(A)){const k=Array.isArray(A)?A:[A];for(let T=0;T(r,s)=>{const o=R.useContext(IC),d=R.useContext(u2),p=()=>jce(e,r,o,d);return s?p():ioe(p)};function L2(e,r,s){const{style:o}=e,d={};for(const p in o)(bi(o[p])||r.style&&bi(r.style[p])||tF(p,e)||s?.getValue(p)?.liveStyle!==void 0)&&(d[p]=o[p]);return d}const Ace=aF({scrapeMotionValuesFromProps:L2,createRenderState:P2});function oF(e,r,s){const o=L2(e,r,s);for(const d in e)if(bi(e[d])||bi(r[d])){const p=Dg.indexOf(d)!==-1?"attr"+d.charAt(0).toUpperCase()+d.substring(1):d;o[p]=e[d]}return o}const Oce=aF({scrapeMotionValuesFromProps:oF,createRenderState:sF}),kce=Symbol.for("motionComponentSymbol");function ag(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Rce(e,r,s){return R.useCallback(o=>{o&&e.onMount&&e.onMount(o),r&&(o?r.mount(o):r.unmount()),s&&(typeof s=="function"?s(o):ag(s)&&(s.current=o))},[r])}const z2=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Tce="framerAppearId",lF="data-"+z2(Tce),cF=R.createContext({});function _ce(e,r,s,o,d){const{visualElement:p}=R.useContext(IC),m=R.useContext(J5),g=R.useContext(u2),b=R.useContext(W5).reducedMotion,S=R.useRef(null);o=o||m.renderer,!S.current&&o&&(S.current=o(e,{visualState:r,parent:p,props:s,presenceContext:g,blockInitialAnimation:g?g.initial===!1:!1,reducedMotionConfig:b}));const j=S.current,A=R.useContext(cF);j&&!j.projection&&d&&(j.type==="html"||j.type==="svg")&&$ce(S.current,s,d,A);const k=R.useRef(!1);R.useInsertionEffect(()=>{j&&k.current&&j.update(s,g)});const T=s[lF],M=R.useRef(!!T&&!window.MotionHandoffIsComplete?.(T)&&window.MotionHasOptimisedAnimation?.(T));return aoe(()=>{j&&(k.current=!0,window.MotionIsMounted=!0,j.updateFeatures(),j.scheduleRenderMicrotask(),M.current&&j.animationState&&j.animationState.animateChanges())}),R.useEffect(()=>{j&&(!M.current&&j.animationState&&j.animationState.animateChanges(),M.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(T)}),M.current=!1),j.enteringChildren=void 0)}),j}function $ce(e,r,s,o){const{layoutId:d,layout:p,drag:m,dragConstraints:g,layoutScroll:b,layoutRoot:S,layoutCrossfade:j}=r;e.projection=new s(e.latestValues,r["data-framer-portal-id"]?void 0:uF(e.parent)),e.projection.setOptions({layoutId:d,layout:p,alwaysMeasureLayout:!!m||g&&ag(g),visualElement:e,animationType:typeof p=="string"?p:"both",initialPromotionConfig:o,crossfade:j,layoutScroll:b,layoutRoot:S})}function uF(e){if(e)return e.options.allowProjection!==!1?e.projection:uF(e.parent)}function tT(e,{forwardMotionProps:r=!1}={},s,o){s&&ice(s);const d=M2(e)?Oce:Ace;function p(g,b){let S;const j={...R.useContext(W5),...g,layoutId:Nce(g)},{isStatic:A}=j,k=uce(g),T=d(g,A);if(!A&&c2){Dce();const M=Pce(j);S=M.MeasureLayout,k.visualElement=_ce(e,T,j,o,M.ProjectionNode)}return u.jsxs(IC.Provider,{value:k,children:[S&&k.visualElement?u.jsx(S,{visualElement:k.visualElement,...j}):null,Ece(e,g,Rce(T,k.visualElement,b),T,A,r)]})}p.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const m=R.forwardRef(p);return m[kce]=e,m}function Nce({layoutId:e}){const r=R.useContext(o5).id;return r&&e!==void 0?r+"-"+e:e}function Dce(e,r){R.useContext(J5).strict}function Pce(e){const{drag:r,layout:s}=Sg;if(!r&&!s)return{};const o={...r,...s};return{MeasureLayout:r?.isEnabled(e)||s?.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function Mce(e,r){if(typeof Proxy>"u")return tT;const s=new Map,o=(p,m)=>tT(p,m,e,r),d=(p,m)=>o(p,m);return new Proxy(d,{get:(p,m)=>m==="create"?o:(s.has(m)||s.set(m,tT(m,void 0,e,r)),s.get(m))})}function dF({top:e,left:r,right:s,bottom:o}){return{x:{min:r,max:s},y:{min:e,max:o}}}function Ice({x:e,y:r}){return{top:r.min,right:e.max,bottom:r.max,left:e.min}}function Lce(e,r){if(!r)return e;const s=r({x:e.left,y:e.top}),o=r({x:e.right,y:e.bottom});return{top:s.y,left:s.x,bottom:o.y,right:o.x}}function nT(e){return e===void 0||e===1}function r_({scale:e,scaleX:r,scaleY:s}){return!nT(e)||!nT(r)||!nT(s)}function gp(e){return r_(e)||hF(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function hF(e){return YI(e.x)||YI(e.y)}function YI(e){return e&&e!=="0%"}function Xj(e,r,s){const o=e-s,d=r*o;return s+d}function ZI(e,r,s,o,d){return d!==void 0&&(e=Xj(e,d,o)),Xj(e,s,o)+r}function s_(e,r=0,s=1,o,d){e.min=ZI(e.min,r,s,o,d),e.max=ZI(e.max,r,s,o,d)}function pF(e,{x:r,y:s}){s_(e.x,r.translate,r.scale,r.originPoint),s_(e.y,s.translate,s.scale,s.originPoint)}const WI=.999999999999,JI=1.0000000000001;function zce(e,r,s,o=!1){const d=s.length;if(!d)return;r.x=r.y=1;let p,m;for(let g=0;gWI&&(r.x=1),r.yWI&&(r.y=1)}function og(e,r){e.min=e.min+r,e.max=e.max+r}function QI(e,r,s,o,d=.5){const p=Lr(e.min,e.max,d);s_(e,r,s,p,o)}function lg(e,r){QI(e.x,r.x,r.scaleX,r.scale,r.originX),QI(e.y,r.y,r.scaleY,r.scale,r.originY)}function fF(e,r){return dF(Lce(e.getBoundingClientRect(),r))}function Fce(e,r,s){const o=fF(e,s),{scroll:d}=r;return d&&(og(o.x,d.offset.x),og(o.y,d.offset.y)),o}const e4=()=>({translate:0,scale:1,origin:0,originPoint:0}),cg=()=>({x:e4(),y:e4()}),t4=()=>({min:0,max:0}),js=()=>({x:t4(),y:t4()}),i_={current:null},mF={current:!1};function qce(){if(mF.current=!0,!!c2)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),r=()=>i_.current=e.matches;e.addEventListener("change",r),r()}else i_.current=!1}const Bce=new WeakMap;function Uce(e,r,s){for(const o in r){const d=r[o],p=s[o];if(bi(d))e.addValue(o,d);else if(bi(p))e.addValue(o,wg(d,{owner:e}));else if(p!==d)if(e.hasValue(o)){const m=e.getValue(o);m.liveStyle===!0?m.jump(d):m.hasAnimated||m.set(d)}else{const m=e.getStaticValue(o);e.addValue(o,wg(m!==void 0?m:d,{owner:e}))}}for(const o in s)r[o]===void 0&&e.removeValue(o);return r}const n4=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Kce{scrapeMotionValuesFromProps(r,s,o){return{}}constructor({parent:r,props:s,presenceContext:o,reducedMotionConfig:d,blockInitialAnimation:p,visualState:m},g={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=O2,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const k=da.now();this.renderScheduledAtthis.bindToMotionValue(o,s)),mF.current||qce(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:i_.current,this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Ud(this.notifyUpdate),Ud(this.render),this.valueSubscriptions.forEach(r=>r()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const r in this.events)this.events[r].clear();for(const r in this.features){const s=this.features[r];s&&(s.unmount(),s.isMounted=!1)}this.current=null}addChild(r){this.children.add(r),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(r)}removeChild(r){this.children.delete(r),this.enteringChildren&&this.enteringChildren.delete(r)}bindToMotionValue(r,s){this.valueSubscriptions.has(r)&&this.valueSubscriptions.get(r)();const o=Pg.has(r);o&&this.onBindTransform&&this.onBindTransform();const d=s.on("change",m=>{this.latestValues[r]=m,this.props.onUpdate&&_r.preRender(this.notifyUpdate),o&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let p;window.MotionCheckAppearSync&&(p=window.MotionCheckAppearSync(this,r,s)),this.valueSubscriptions.set(r,()=>{d(),p&&p(),s.owner&&s.stop()})}sortNodePosition(r){return!this.current||!this.sortInstanceNodePosition||this.type!==r.type?0:this.sortInstanceNodePosition(this.current,r.current)}updateFeatures(){let r="animation";for(r in Sg){const s=Sg[r];if(!s)continue;const{isEnabled:o,Feature:d}=s;if(!this.features[r]&&d&&o(this.props)&&(this.features[r]=new d(this)),this.features[r]){const p=this.features[r];p.isMounted?p.update():(p.mount(),p.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):js()}getStaticValue(r){return this.latestValues[r]}setStaticValue(r,s){this.latestValues[r]=s}update(r,s){(r.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=r,this.prevPresenceContext=this.presenceContext,this.presenceContext=s;for(let o=0;os.variantChildren.delete(r)}addValue(r,s){const o=this.values.get(r);s!==o&&(o&&this.removeValue(r),this.bindToMotionValue(r,s),this.values.set(r,s),this.latestValues[r]=s.get())}removeValue(r){this.values.delete(r);const s=this.valueSubscriptions.get(r);s&&(s(),this.valueSubscriptions.delete(r)),delete this.latestValues[r],this.removeValueFromRenderState(r,this.renderState)}hasValue(r){return this.values.has(r)}getValue(r,s){if(this.props.values&&this.props.values[r])return this.props.values[r];let o=this.values.get(r);return o===void 0&&s!==void 0&&(o=wg(s===null?void 0:s,{owner:this}),this.addValue(r,o)),o}readValue(r,s){let o=this.latestValues[r]!==void 0||!this.current?this.latestValues[r]:this.getBaseTargetFromProps(this.props,r)??this.readValueFromInstance(this.current,r,this.options);return o!=null&&(typeof o=="string"&&(l5(o)||u5(o))?o=parseFloat(o):!rce(o)&&Kd.test(s)&&(o=V5(r,s)),this.setBaseTarget(r,bi(o)?o.get():o)),bi(o)?o.get():o}setBaseTarget(r,s){this.baseTarget[r]=s}getBaseTarget(r){const{initial:s}=this.props;let o;if(typeof s=="string"||typeof s=="object"){const p=I2(this.props,s,this.presenceContext?.custom);p&&(o=p[r])}if(s&&o!==void 0)return o;const d=this.getBaseTargetFromProps(this.props,r);return d!==void 0&&!bi(d)?d:this.initialValues[r]!==void 0&&o===void 0?void 0:this.baseTarget[r]}on(r,s){return this.events[r]||(this.events[r]=new m2),this.events[r].add(s)}notify(r,...s){this.events[r]&&this.events[r].notify(...s)}scheduleRenderMicrotask(){T2.render(this.render)}}class gF extends Kce{constructor(){super(...arguments),this.KeyframeResolver=Kle}sortInstanceNodePosition(r,s){return r.compareDocumentPosition(s)&2?1:-1}getBaseTargetFromProps(r,s){return r.style?r.style[s]:void 0}removeValueFromRenderState(r,{vars:s,style:o}){delete s[r],delete o[r]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:r}=this.props;bi(r)&&(this.childSubscription=r.on("change",s=>{this.current&&(this.current.textContent=`${s}`)}))}}function yF(e,{style:r,vars:s},o,d){const p=e.style;let m;for(m in r)p[m]=r[m];d?.applyProjectionStyles(p,o);for(m in s)p.setProperty(m,s[m])}function Vce(e){return window.getComputedStyle(e)}class Hce extends gF{constructor(){super(...arguments),this.type="html",this.renderInstance=yF}readValueFromInstance(r,s){if(Pg.has(s))return this.projection?.isProjecting?ZT(s):cle(r,s);{const o=Vce(r),d=(v2(s)?o.getPropertyValue(s):o[s])||0;return typeof d=="string"?d.trim():d}}measureInstanceViewportBox(r,{transformPagePoint:s}){return fF(r,s)}build(r,s,o){D2(r,s,o.transformTemplate)}scrapeMotionValuesFromProps(r,s,o){return L2(r,s,o)}}const vF=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Gce(e,r,s,o){yF(e,r,void 0,o);for(const d in r.attrs)e.setAttribute(vF.has(d)?d:z2(d),r.attrs[d])}class Xce extends gF{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=js}getBaseTargetFromProps(r,s){return r[s]}readValueFromInstance(r,s){if(Pg.has(s)){const o=K5(s);return o&&o.default||0}return s=vF.has(s)?s:z2(s),r.getAttribute(s)}scrapeMotionValuesFromProps(r,s,o){return oF(r,s,o)}build(r,s,o){rF(r,s,this.isSVGTag,o.transformTemplate,o.style)}renderInstance(r,s,o,d){Gce(r,s,o,d)}mount(r){this.isSVGTag=iF(r.tagName),super.mount(r)}}const Yce=(e,r)=>M2(e)?new Xce(r):new Hce(r,{allowProjection:e!==R.Fragment});function mg(e,r,s){const o=e.getProps();return I2(o,r,s!==void 0?s:o.custom,e)}const a_=e=>Array.isArray(e);function Zce(e,r,s){e.hasValue(r)?e.getValue(r).set(s):e.addValue(r,wg(s))}function Wce(e){return a_(e)?e[e.length-1]||0:e}function Jce(e,r){const s=mg(e,r);let{transitionEnd:o={},transition:d={},...p}=s||{};p={...p,...o};for(const m in p){const g=Wce(p[m]);Zce(e,m,g)}}function Qce(e){return!!(bi(e)&&e.add)}function o_(e,r){const s=e.getValue("willChange");if(Qce(s))return s.add(r);if(!s&&yu.WillChange){const o=new yu.WillChange("auto");e.addValue("willChange",o),o.add(r)}}function xF(e){return e.props[lF]}const eue=e=>e!==null;function tue(e,{repeat:r,repeatType:s="loop"},o){const d=e.filter(eue),p=r&&s!=="loop"&&r%2===1?0:d.length-1;return d[p]}const nue={type:"spring",stiffness:500,damping:25,restSpeed:10},rue=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),sue={type:"keyframes",duration:.8},iue={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},aue=(e,{keyframes:r})=>r.length>2?sue:Pg.has(e)?e.startsWith("scale")?rue(r[1]):nue:iue;function oue({when:e,delay:r,delayChildren:s,staggerChildren:o,staggerDirection:d,repeat:p,repeatType:m,repeatDelay:g,from:b,elapsed:S,...j}){return!!Object.keys(j).length}const F2=(e,r,s,o={},d,p)=>m=>{const g=k2(o,e)||{},b=g.delay||o.delay||0;let{elapsed:S=0}=o;S=S-ic(b);const j={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:r.getVelocity(),...g,delay:-S,onUpdate:k=>{r.set(k),g.onUpdate&&g.onUpdate(k)},onComplete:()=>{m(),g.onComplete&&g.onComplete()},name:e,motionValue:r,element:p?void 0:d};oue(g)||Object.assign(j,aue(e,j)),j.duration&&(j.duration=ic(j.duration)),j.repeatDelay&&(j.repeatDelay=ic(j.repeatDelay)),j.from!==void 0&&(j.keyframes[0]=j.from);let A=!1;if((j.type===!1||j.duration===0&&!j.repeatDelay)&&(t_(j),j.delay===0&&(A=!0)),(yu.instantAnimations||yu.skipAnimations)&&(A=!0,t_(j),j.delay=0),j.allowFlatten=!g.type&&!g.ease,A&&!p&&r.get()!==void 0){const k=tue(j.keyframes,g);if(k!==void 0){_r.update(()=>{j.onUpdate(k),j.onComplete()});return}}return g.isSync?new A2(j):new $le(j)};function lue({protectedKeys:e,needsAnimating:r},s){const o=e.hasOwnProperty(s)&&r[s]!==!0;return r[s]=!1,o}function bF(e,r,{delay:s=0,transitionOverride:o,type:d}={}){let{transition:p=e.getDefaultTransition(),transitionEnd:m,...g}=r;o&&(p=o);const b=[],S=d&&e.animationState&&e.animationState.getState()[d];for(const j in g){const A=e.getValue(j,e.latestValues[j]??null),k=g[j];if(k===void 0||S&&lue(S,j))continue;const T={delay:s,...k2(p||{},j)},M=A.get();if(M!==void 0&&!A.isAnimating&&!Array.isArray(k)&&k===M&&!T.velocity)continue;let I=!1;if(window.MotionHandoffAnimation){const G=xF(e);if(G){const K=window.MotionHandoffAnimation(G,j,_r);K!==null&&(T.startTime=K,I=!0)}}o_(e,j),A.start(F2(j,A,k,e.shouldReduceMotion&&q5.has(j)?{type:!1}:T,e,I));const q=A.animation;q&&b.push(q)}return m&&Promise.all(b).then(()=>{_r.update(()=>{m&&Jce(e,m)})}),b}function wF(e,r,s,o=0,d=1){const p=Array.from(e).sort((S,j)=>S.sortNodePosition(j)).indexOf(r),m=e.size,g=(m-1)*o;return typeof s=="function"?s(p,m):d===1?p*o:g-p*o}function l_(e,r,s={}){const o=mg(e,r,s.type==="exit"?e.presenceContext?.custom:void 0);let{transition:d=e.getDefaultTransition()||{}}=o||{};s.transitionOverride&&(d=s.transitionOverride);const p=o?()=>Promise.all(bF(e,o,s)):()=>Promise.resolve(),m=e.variantChildren&&e.variantChildren.size?(b=0)=>{const{delayChildren:S=0,staggerChildren:j,staggerDirection:A}=d;return cue(e,r,b,S,j,A,s)}:()=>Promise.resolve(),{when:g}=d;if(g){const[b,S]=g==="beforeChildren"?[p,m]:[m,p];return b().then(()=>S())}else return Promise.all([p(),m(s.delay)])}function cue(e,r,s=0,o=0,d=0,p=1,m){const g=[];for(const b of e.variantChildren)b.notify("AnimationStart",r),g.push(l_(b,r,{...m,delay:s+(typeof o=="function"?0:o)+wF(e.variantChildren,b,o,d,p)}).then(()=>b.notify("AnimationComplete",r)));return Promise.all(g)}function uue(e,r,s={}){e.notify("AnimationStart",r);let o;if(Array.isArray(r)){const d=r.map(p=>l_(e,p,s));o=Promise.all(d)}else if(typeof r=="string")o=l_(e,r,s);else{const d=typeof r=="function"?mg(e,r,s.custom):r;o=Promise.all(bF(e,d,s))}return o.then(()=>{e.notify("AnimationComplete",r)})}function SF(e,r){if(!Array.isArray(r))return!1;const s=r.length;if(s!==e.length)return!1;for(let o=0;oPromise.all(r.map(({animation:s,options:o})=>uue(e,s,o)))}function mue(e){let r=fue(e),s=r4(),o=!0;const d=b=>(S,j)=>{const A=mg(e,j,b==="exit"?e.presenceContext?.custom:void 0);if(A){const{transition:k,transitionEnd:T,...M}=A;S={...S,...M,...T}}return S};function p(b){r=b(e)}function m(b){const{props:S}=e,j=EF(e.parent)||{},A=[],k=new Set;let T={},M=1/0;for(let q=0;qM&&L,de=!1;const je=Array.isArray(X)?X:[X];let ve=je.reduce(d(G),{});ee===!1&&(ve={});const{prevResolvedValues:le={}}=K,be={...le,...ve},Ce=re=>{ne=!0,k.has(re)&&(de=!0,k.delete(re)),K.needsAnimating[re]=!0;const ue=e.getValue(re);ue&&(ue.liveStyle=!1)};for(const re in be){const ue=ve[re],_e=le[re];if(T.hasOwnProperty(re))continue;let fe=!1;a_(ue)&&a_(_e)?fe=!SF(ue,_e):fe=ue!==_e,fe?ue!=null?Ce(re):k.add(re):ue!==void 0&&k.has(re)?Ce(re):K.protectedKeys[re]=!0}K.prevProp=X,K.prevResolvedValues=ve,K.isActive&&(T={...T,...ve}),o&&e.blockInitialAnimation&&(ne=!1);const Ke=oe&&Q;ne&&(!Ke||de)&&A.push(...je.map(re=>{const ue={type:G};if(typeof re=="string"&&o&&!Ke&&e.manuallyAnimateOnMount&&e.parent){const{parent:_e}=e,fe=mg(_e,re);if(_e.enteringChildren&&fe){const{delayChildren:He}=fe.transition||{};ue.delay=wF(_e.enteringChildren,e,He)}}return{animation:re,options:ue}}))}if(k.size){const q={};if(typeof S.initial!="boolean"){const G=mg(e,Array.isArray(S.initial)?S.initial[0]:S.initial);G&&G.transition&&(q.transition=G.transition)}k.forEach(G=>{const K=e.getBaseTarget(G),X=e.getValue(G);X&&(X.liveStyle=!0),q[G]=K??null}),A.push({animation:q})}let I=!!A.length;return o&&(S.initial===!1||S.initial===S.animate)&&!e.manuallyAnimateOnMount&&(I=!1),o=!1,I?r(A):Promise.resolve()}function g(b,S){if(s[b].isActive===S)return Promise.resolve();e.variantChildren?.forEach(A=>A.animationState?.setActive(b,S)),s[b].isActive=S;const j=m(b);for(const A in s)s[A].protectedKeys={};return j}return{animateChanges:m,setActive:g,setAnimateFunction:p,getState:()=>s,reset:()=>{s=r4()}}}function gue(e,r){return typeof r=="string"?r!==e:Array.isArray(r)?!SF(r,e):!1}function mp(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function r4(){return{animate:mp(!0),whileInView:mp(),whileHover:mp(),whileTap:mp(),whileDrag:mp(),whileFocus:mp(),exit:mp()}}class Yd{constructor(r){this.isMounted=!1,this.node=r}update(){}}class yue extends Yd{constructor(r){super(r),r.animationState||(r.animationState=mue(r))}updateAnimationControlsSubscription(){const{animate:r}=this.node.getProps();LC(r)&&(this.unmountControls=r.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:r}=this.node.getProps(),{animate:s}=this.node.prevProps||{};r!==s&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let vue=0;class xue extends Yd{constructor(){super(...arguments),this.id=vue++}update(){if(!this.node.presenceContext)return;const{isPresent:r,onExitComplete:s}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||r===o)return;const d=this.node.animationState.setActive("exit",!r);s&&!r&&d.then(()=>{s(this.id)})}mount(){const{register:r,onExitComplete:s}=this.node.presenceContext||{};s&&s(this.id),r&&(this.unmount=r(this.id))}unmount(){}}const bue={animation:{Feature:yue},exit:{Feature:xue}};function Hb(e,r,s,o={passive:!0}){return e.addEventListener(r,s,o),()=>e.removeEventListener(r,s)}function fw(e){return{point:{x:e.pageX,y:e.pageY}}}const wue=e=>r=>_2(r)&&e(r,fw(r));function $b(e,r,s,o){return Hb(e,r,wue(s),o)}const jF=1e-4,Sue=1-jF,Eue=1+jF,CF=.01,jue=0-CF,Cue=0+CF;function Mi(e){return e.max-e.min}function Aue(e,r,s){return Math.abs(e-r)<=s}function s4(e,r,s,o=.5){e.origin=o,e.originPoint=Lr(r.min,r.max,e.origin),e.scale=Mi(s)/Mi(r),e.translate=Lr(s.min,s.max,e.origin)-e.originPoint,(e.scale>=Sue&&e.scale<=Eue||isNaN(e.scale))&&(e.scale=1),(e.translate>=jue&&e.translate<=Cue||isNaN(e.translate))&&(e.translate=0)}function Nb(e,r,s,o){s4(e.x,r.x,s.x,o?o.originX:void 0),s4(e.y,r.y,s.y,o?o.originY:void 0)}function i4(e,r,s){e.min=s.min+r.min,e.max=e.min+Mi(r)}function Oue(e,r,s){i4(e.x,r.x,s.x),i4(e.y,r.y,s.y)}function a4(e,r,s){e.min=r.min-s.min,e.max=e.min+Mi(r)}function Yj(e,r,s){a4(e.x,r.x,s.x),a4(e.y,r.y,s.y)}function to(e){return[e("x"),e("y")]}const AF=({current:e})=>e?e.ownerDocument.defaultView:null,o4=(e,r)=>Math.abs(e-r);function kue(e,r){const s=o4(e.x,r.x),o=o4(e.y,r.y);return Math.sqrt(s**2+o**2)}class OF{constructor(r,s,{transformPagePoint:o,contextWindow:d=window,dragSnapToOrigin:p=!1,distanceThreshold:m=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const k=sT(this.lastMoveEventInfo,this.history),T=this.startEvent!==null,M=kue(k.offset,{x:0,y:0})>=this.distanceThreshold;if(!T&&!M)return;const{point:I}=k,{timestamp:q}=Us;this.history.push({...I,timestamp:q});const{onStart:G,onMove:K}=this.handlers;T||(G&&G(this.lastMoveEvent,k),this.startEvent=this.lastMoveEvent),K&&K(this.lastMoveEvent,k)},this.handlePointerMove=(k,T)=>{this.lastMoveEvent=k,this.lastMoveEventInfo=rT(T,this.transformPagePoint),_r.update(this.updatePoint,!0)},this.handlePointerUp=(k,T)=>{this.end();const{onEnd:M,onSessionEnd:I,resumeAnimation:q}=this.handlers;if(this.dragSnapToOrigin&&q&&q(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const G=sT(k.type==="pointercancel"?this.lastMoveEventInfo:rT(T,this.transformPagePoint),this.history);this.startEvent&&M&&M(k,G),I&&I(k,G)},!_2(r))return;this.dragSnapToOrigin=p,this.handlers=s,this.transformPagePoint=o,this.distanceThreshold=m,this.contextWindow=d||window;const g=fw(r),b=rT(g,this.transformPagePoint),{point:S}=b,{timestamp:j}=Us;this.history=[{...S,timestamp:j}];const{onSessionStart:A}=s;A&&A(r,sT(b,this.history)),this.removeListeners=dw($b(this.contextWindow,"pointermove",this.handlePointerMove),$b(this.contextWindow,"pointerup",this.handlePointerUp),$b(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(r){this.handlers=r}end(){this.removeListeners&&this.removeListeners(),Ud(this.updatePoint)}}function rT(e,r){return r?{point:r(e.point)}:e}function l4(e,r){return{x:e.x-r.x,y:e.y-r.y}}function sT({point:e},r){return{point:e,delta:l4(e,kF(r)),offset:l4(e,Rue(r)),velocity:Tue(r,.1)}}function Rue(e){return e[0]}function kF(e){return e[e.length-1]}function Tue(e,r){if(e.length<2)return{x:0,y:0};let s=e.length-1,o=null;const d=kF(e);for(;s>=0&&(o=e[s],!(d.timestamp-o.timestamp>ic(r)));)s--;if(!o)return{x:0,y:0};const p=ro(d.timestamp-o.timestamp);if(p===0)return{x:0,y:0};const m={x:(d.x-o.x)/p,y:(d.y-o.y)/p};return m.x===1/0&&(m.x=0),m.y===1/0&&(m.y=0),m}function _ue(e,{min:r,max:s},o){return r!==void 0&&es&&(e=o?Lr(s,e,o.max):Math.min(e,s)),e}function c4(e,r,s){return{min:r!==void 0?e.min+r:void 0,max:s!==void 0?e.max+s-(e.max-e.min):void 0}}function $ue(e,{top:r,left:s,bottom:o,right:d}){return{x:c4(e.x,s,d),y:c4(e.y,r,o)}}function u4(e,r){let s=r.min-e.min,o=r.max-e.max;return r.max-r.mino?s=qb(r.min,r.max-o,e.min):o>d&&(s=qb(e.min,e.max-d,r.min)),gu(0,1,s)}function Pue(e,r){const s={};return r.min!==void 0&&(s.min=r.min-e.min),r.max!==void 0&&(s.max=r.max-e.min),s}const c_=.35;function Mue(e=c_){return e===!1?e=0:e===!0&&(e=c_),{x:d4(e,"left","right"),y:d4(e,"top","bottom")}}function d4(e,r,s){return{min:h4(e,r),max:h4(e,s)}}function h4(e,r){return typeof e=="number"?e:e[r]||0}const Iue=new WeakMap;class Lue{constructor(r){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=js(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=r}start(r,{snapToCursor:s=!1,distanceThreshold:o}={}){const{presenceContext:d}=this.visualElement;if(d&&d.isPresent===!1)return;const p=A=>{const{dragSnapToOrigin:k}=this.getProps();k?this.pauseAnimation():this.stopAnimation(),s&&this.snapToCursor(fw(A).point)},m=(A,k)=>{const{drag:T,dragPropagation:M,onDragStart:I}=this.getProps();if(T&&!M&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Yle(T),!this.openDragLock))return;this.latestPointerEvent=A,this.latestPanInfo=k,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),to(G=>{let K=this.getAxisMotionValue(G).get()||0;if(ac.test(K)){const{projection:X}=this.visualElement;if(X&&X.layout){const L=X.layout.layoutBox[G];L&&(K=Mi(L)*(parseFloat(K)/100))}}this.originPoint[G]=K}),I&&_r.postRender(()=>I(A,k)),o_(this.visualElement,"transform");const{animationState:q}=this.visualElement;q&&q.setActive("whileDrag",!0)},g=(A,k)=>{this.latestPointerEvent=A,this.latestPanInfo=k;const{dragPropagation:T,dragDirectionLock:M,onDirectionLock:I,onDrag:q}=this.getProps();if(!T&&!this.openDragLock)return;const{offset:G}=k;if(M&&this.currentDirection===null){this.currentDirection=zue(G),this.currentDirection!==null&&I&&I(this.currentDirection);return}this.updateAxis("x",k.point,G),this.updateAxis("y",k.point,G),this.visualElement.render(),q&&q(A,k)},b=(A,k)=>{this.latestPointerEvent=A,this.latestPanInfo=k,this.stop(A,k),this.latestPointerEvent=null,this.latestPanInfo=null},S=()=>to(A=>this.getAnimationState(A)==="paused"&&this.getAxisMotionValue(A).animation?.play()),{dragSnapToOrigin:j}=this.getProps();this.panSession=new OF(r,{onSessionStart:p,onStart:m,onMove:g,onSessionEnd:b,resumeAnimation:S},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:j,distanceThreshold:o,contextWindow:AF(this.visualElement)})}stop(r,s){const o=r||this.latestPointerEvent,d=s||this.latestPanInfo,p=this.isDragging;if(this.cancel(),!p||!d||!o)return;const{velocity:m}=d;this.startAnimation(m);const{onDragEnd:g}=this.getProps();g&&_r.postRender(()=>g(o,d))}cancel(){this.isDragging=!1;const{projection:r,animationState:s}=this.visualElement;r&&(r.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),s&&s.setActive("whileDrag",!1)}updateAxis(r,s,o){const{drag:d}=this.getProps();if(!o||!ej(r,d,this.currentDirection))return;const p=this.getAxisMotionValue(r);let m=this.originPoint[r]+o[r];this.constraints&&this.constraints[r]&&(m=_ue(m,this.constraints[r],this.elastic[r])),p.set(m)}resolveConstraints(){const{dragConstraints:r,dragElastic:s}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,d=this.constraints;r&&ag(r)?this.constraints||(this.constraints=this.resolveRefConstraints()):r&&o?this.constraints=$ue(o.layoutBox,r):this.constraints=!1,this.elastic=Mue(s),d!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&to(p=>{this.constraints!==!1&&this.getAxisMotionValue(p)&&(this.constraints[p]=Pue(o.layoutBox[p],this.constraints[p]))})}resolveRefConstraints(){const{dragConstraints:r,onMeasureDragConstraints:s}=this.getProps();if(!r||!ag(r))return!1;const o=r.current,{projection:d}=this.visualElement;if(!d||!d.layout)return!1;const p=Fce(o,d.root,this.visualElement.getTransformPagePoint());let m=Nue(d.layout.layoutBox,p);if(s){const g=s(Ice(m));this.hasMutatedConstraints=!!g,g&&(m=dF(g))}return m}startAnimation(r){const{drag:s,dragMomentum:o,dragElastic:d,dragTransition:p,dragSnapToOrigin:m,onDragTransitionEnd:g}=this.getProps(),b=this.constraints||{},S=to(j=>{if(!ej(j,s,this.currentDirection))return;let A=b&&b[j]||{};m&&(A={min:0,max:0});const k=d?200:1e6,T=d?40:1e7,M={type:"inertia",velocity:o?r[j]:0,bounceStiffness:k,bounceDamping:T,timeConstant:750,restDelta:1,restSpeed:10,...p,...A};return this.startAxisValueAnimation(j,M)});return Promise.all(S).then(g)}startAxisValueAnimation(r,s){const o=this.getAxisMotionValue(r);return o_(this.visualElement,r),o.start(F2(r,o,0,s,this.visualElement,!1))}stopAnimation(){to(r=>this.getAxisMotionValue(r).stop())}pauseAnimation(){to(r=>this.getAxisMotionValue(r).animation?.pause())}getAnimationState(r){return this.getAxisMotionValue(r).animation?.state}getAxisMotionValue(r){const s=`_drag${r.toUpperCase()}`,o=this.visualElement.getProps(),d=o[s];return d||this.visualElement.getValue(r,(o.initial?o.initial[r]:void 0)||0)}snapToCursor(r){to(s=>{const{drag:o}=this.getProps();if(!ej(s,o,this.currentDirection))return;const{projection:d}=this.visualElement,p=this.getAxisMotionValue(s);if(d&&d.layout){const{min:m,max:g}=d.layout.layoutBox[s];p.set(r[s]-Lr(m,g,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:r,dragConstraints:s}=this.getProps(),{projection:o}=this.visualElement;if(!ag(s)||!o||!this.constraints)return;this.stopAnimation();const d={x:0,y:0};to(m=>{const g=this.getAxisMotionValue(m);if(g&&this.constraints!==!1){const b=g.get();d[m]=Due({min:b,max:b},this.constraints[m])}});const{transformTemplate:p}=this.visualElement.getProps();this.visualElement.current.style.transform=p?p({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.resolveConstraints(),to(m=>{if(!ej(m,r,null))return;const g=this.getAxisMotionValue(m),{min:b,max:S}=this.constraints[m];g.set(Lr(b,S,d[m]))})}addListeners(){if(!this.visualElement.current)return;Iue.set(this.visualElement,this);const r=this.visualElement.current,s=$b(r,"pointerdown",b=>{const{drag:S,dragListener:j=!0}=this.getProps();S&&j&&this.start(b)}),o=()=>{const{dragConstraints:b}=this.getProps();ag(b)&&b.current&&(this.constraints=this.resolveRefConstraints())},{projection:d}=this.visualElement,p=d.addEventListener("measure",o);d&&!d.layout&&(d.root&&d.root.updateScroll(),d.updateLayout()),_r.read(o);const m=Hb(window,"resize",()=>this.scalePositionWithinConstraints()),g=d.addEventListener("didUpdate",(({delta:b,hasLayoutChanged:S})=>{this.isDragging&&S&&(to(j=>{const A=this.getAxisMotionValue(j);A&&(this.originPoint[j]+=b[j].translate,A.set(A.get()+b[j].translate))}),this.visualElement.render())}));return()=>{m(),s(),p(),g&&g()}}getProps(){const r=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:o=!1,dragPropagation:d=!1,dragConstraints:p=!1,dragElastic:m=c_,dragMomentum:g=!0}=r;return{...r,drag:s,dragDirectionLock:o,dragPropagation:d,dragConstraints:p,dragElastic:m,dragMomentum:g}}}function ej(e,r,s){return(r===!0||r===e)&&(s===null||s===e)}function zue(e,r=10){let s=null;return Math.abs(e.y)>r?s="y":Math.abs(e.x)>r&&(s="x"),s}class Fue extends Yd{constructor(r){super(r),this.removeGroupControls=so,this.removeListeners=so,this.controls=new Lue(r)}mount(){const{dragControls:r}=this.node.getProps();r&&(this.removeGroupControls=r.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||so}unmount(){this.removeGroupControls(),this.removeListeners()}}const p4=e=>(r,s)=>{e&&_r.postRender(()=>e(r,s))};class que extends Yd{constructor(){super(...arguments),this.removePointerDownListener=so}onPointerDown(r){this.session=new OF(r,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:AF(this.node)})}createPanHandlers(){const{onPanSessionStart:r,onPanStart:s,onPan:o,onPanEnd:d}=this.node.getProps();return{onSessionStart:p4(r),onStart:p4(s),onMove:o,onEnd:(p,m)=>{delete this.session,d&&_r.postRender(()=>d(p,m))}}}mount(){this.removePointerDownListener=$b(this.node.current,"pointerdown",r=>this.onPointerDown(r))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Sj={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function f4(e,r){return r.max===r.min?0:e/(r.max-r.min)*100}const ab={correct:(e,r)=>{if(!r.target)return e;if(typeof e=="string")if(tn.test(e))e=parseFloat(e);else return e;const s=f4(e,r.target.x),o=f4(e,r.target.y);return`${s}% ${o}%`}},Bue={correct:(e,{treeScale:r,projectionDelta:s})=>{const o=e,d=Kd.parse(e);if(d.length>5)return o;const p=Kd.createTransformer(e),m=typeof d[0]!="number"?1:0,g=s.x.scale*r.x,b=s.y.scale*r.y;d[0+m]/=g,d[1+m]/=b;const S=Lr(g,b,.5);return typeof d[2+m]=="number"&&(d[2+m]/=S),typeof d[3+m]=="number"&&(d[3+m]/=S),p(d)}};let iT=!1;class Uue extends R.Component{componentDidMount(){const{visualElement:r,layoutGroup:s,switchLayoutGroup:o,layoutId:d}=this.props,{projection:p}=r;dce(Kue),p&&(s.group&&s.group.add(p),o&&o.register&&d&&o.register(p),iT&&p.root.didUpdate(),p.addEventListener("animationComplete",()=>{this.safeToRemove()}),p.setOptions({...p.options,onExitComplete:()=>this.safeToRemove()})),Sj.hasEverUpdated=!0}getSnapshotBeforeUpdate(r){const{layoutDependency:s,visualElement:o,drag:d,isPresent:p}=this.props,{projection:m}=o;return m&&(m.isPresent=p,iT=!0,d||r.layoutDependency!==s||s===void 0||r.isPresent!==p?m.willUpdate():this.safeToRemove(),r.isPresent!==p&&(p?m.promote():m.relegate()||_r.postRender(()=>{const g=m.getStack();(!g||!g.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:r}=this.props.visualElement;r&&(r.root.didUpdate(),T2.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:r,layoutGroup:s,switchLayoutGroup:o}=this.props,{projection:d}=r;iT=!0,d&&(d.scheduleCheckAfterUnmount(),s&&s.group&&s.group.remove(d),o&&o.deregister&&o.deregister(d))}safeToRemove(){const{safeToRemove:r}=this.props;r&&r()}render(){return null}}function RF(e){const[r,s]=sce(),o=R.useContext(o5);return u.jsx(Uue,{...e,layoutGroup:o,switchLayoutGroup:R.useContext(cF),isPresent:r,safeToRemove:s})}const Kue={borderRadius:{...ab,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ab,borderTopRightRadius:ab,borderBottomLeftRadius:ab,borderBottomRightRadius:ab,boxShadow:Bue};function Vue(e,r,s){const o=bi(e)?e:wg(e);return o.start(F2("",o,r,s)),o.animation}const Hue=(e,r)=>e.depth-r.depth;class Gue{constructor(){this.children=[],this.isDirty=!1}add(r){d2(this.children,r),this.isDirty=!0}remove(r){h2(this.children,r),this.isDirty=!0}forEach(r){this.isDirty&&this.children.sort(Hue),this.isDirty=!1,this.children.forEach(r)}}function Xue(e,r){const s=da.now(),o=({timestamp:d})=>{const p=d-s;p>=r&&(Ud(o),e(p-r))};return _r.setup(o,!0),()=>Ud(o)}const TF=["TopLeft","TopRight","BottomLeft","BottomRight"],Yue=TF.length,m4=e=>typeof e=="string"?parseFloat(e):e,g4=e=>typeof e=="number"||tn.test(e);function Zue(e,r,s,o,d,p){d?(e.opacity=Lr(0,s.opacity??1,Wue(o)),e.opacityExit=Lr(r.opacity??1,0,Jue(o))):p&&(e.opacity=Lr(r.opacity??1,s.opacity??1,o));for(let m=0;mor?1:s(qb(e,r,o))}function v4(e,r){e.min=r.min,e.max=r.max}function Ho(e,r){v4(e.x,r.x),v4(e.y,r.y)}function x4(e,r){e.translate=r.translate,e.scale=r.scale,e.originPoint=r.originPoint,e.origin=r.origin}function b4(e,r,s,o,d){return e-=r,e=Xj(e,1/s,o),d!==void 0&&(e=Xj(e,1/d,o)),e}function Que(e,r=0,s=1,o=.5,d,p=e,m=e){if(ac.test(r)&&(r=parseFloat(r),r=Lr(m.min,m.max,r/100)-m.min),typeof r!="number")return;let g=Lr(p.min,p.max,o);e===p&&(g-=r),e.min=b4(e.min,r,s,g,d),e.max=b4(e.max,r,s,g,d)}function w4(e,r,[s,o,d],p,m){Que(e,r[s],r[o],r[d],r.scale,p,m)}const ede=["x","scaleX","originX"],tde=["y","scaleY","originY"];function S4(e,r,s,o){w4(e.x,r,ede,s?s.x:void 0,o?o.x:void 0),w4(e.y,r,tde,s?s.y:void 0,o?o.y:void 0)}function E4(e){return e.translate===0&&e.scale===1}function $F(e){return E4(e.x)&&E4(e.y)}function j4(e,r){return e.min===r.min&&e.max===r.max}function nde(e,r){return j4(e.x,r.x)&&j4(e.y,r.y)}function C4(e,r){return Math.round(e.min)===Math.round(r.min)&&Math.round(e.max)===Math.round(r.max)}function NF(e,r){return C4(e.x,r.x)&&C4(e.y,r.y)}function A4(e){return Mi(e.x)/Mi(e.y)}function O4(e,r){return e.translate===r.translate&&e.scale===r.scale&&e.originPoint===r.originPoint}class rde{constructor(){this.members=[]}add(r){d2(this.members,r),r.scheduleRender()}remove(r){if(h2(this.members,r),r===this.prevLead&&(this.prevLead=void 0),r===this.lead){const s=this.members[this.members.length-1];s&&this.promote(s)}}relegate(r){const s=this.members.findIndex(d=>r===d);if(s===0)return!1;let o;for(let d=s;d>=0;d--){const p=this.members[d];if(p.isPresent!==!1){o=p;break}}return o?(this.promote(o),!0):!1}promote(r,s){const o=this.lead;if(r!==o&&(this.prevLead=o,this.lead=r,r.show(),o)){o.instance&&o.scheduleRender(),r.scheduleRender(),r.resumeFrom=o,s&&(r.resumeFrom.preserveOpacity=!0),o.snapshot&&(r.snapshot=o.snapshot,r.snapshot.latestValues=o.animationValues||o.latestValues),r.root&&r.root.isUpdating&&(r.isLayoutDirty=!0);const{crossfade:d}=r.options;d===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(r=>{const{options:s,resumingFrom:o}=r;s.onExitComplete&&s.onExitComplete(),o&&o.options.onExitComplete&&o.options.onExitComplete()})}scheduleRender(){this.members.forEach(r=>{r.instance&&r.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function sde(e,r,s){let o="";const d=e.x.translate/r.x,p=e.y.translate/r.y,m=s?.z||0;if((d||p||m)&&(o=`translate3d(${d}px, ${p}px, ${m}px) `),(r.x!==1||r.y!==1)&&(o+=`scale(${1/r.x}, ${1/r.y}) `),s){const{transformPerspective:S,rotate:j,rotateX:A,rotateY:k,skewX:T,skewY:M}=s;S&&(o=`perspective(${S}px) ${o}`),j&&(o+=`rotate(${j}deg) `),A&&(o+=`rotateX(${A}deg) `),k&&(o+=`rotateY(${k}deg) `),T&&(o+=`skewX(${T}deg) `),M&&(o+=`skewY(${M}deg) `)}const g=e.x.scale*r.x,b=e.y.scale*r.y;return(g!==1||b!==1)&&(o+=`scale(${g}, ${b})`),o||"none"}const aT=["","X","Y","Z"],ide=1e3;let ade=0;function oT(e,r,s,o){const{latestValues:d}=r;d[e]&&(s[e]=d[e],r.setStaticValue(e,0),o&&(o[e]=0))}function DF(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:r}=e.options;if(!r)return;const s=xF(r);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:d,layoutId:p}=e.options;window.MotionCancelOptimisedAnimation(s,"transform",_r,!(d||p))}const{parent:o}=e;o&&!o.hasCheckedOptimisedAppear&&DF(o)}function PF({attachResizeListener:e,defaultParent:r,measureScroll:s,checkIsScrollRoot:o,resetTransform:d}){return class{constructor(m={},g=r?.()){this.id=ade++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(cde),this.nodes.forEach(pde),this.nodes.forEach(fde),this.nodes.forEach(ude)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=m,this.root=g?g.root||g:this,this.path=g?[...g.path,g]:[],this.parent=g,this.depth=g?g.depth+1:0;for(let b=0;bthis.root.updateBlockedByResize=!1;_r.read(()=>{A=window.innerWidth}),e(m,()=>{const T=window.innerWidth;T!==A&&(A=T,this.root.updateBlockedByResize=!0,j&&j(),j=Xue(k,250),Sj.hasAnimatedSinceResize&&(Sj.hasAnimatedSinceResize=!1,this.nodes.forEach(T4)))})}g&&this.root.registerSharedNode(g,this),this.options.animate!==!1&&S&&(g||b)&&this.addEventListener("didUpdate",({delta:j,hasLayoutChanged:A,hasRelativeLayoutChanged:k,layout:T})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const M=this.options.transition||S.getDefaultTransition()||xde,{onLayoutAnimationStart:I,onLayoutAnimationComplete:q}=S.getProps(),G=!this.targetLayout||!NF(this.targetLayout,T),K=!A&&k;if(this.options.layoutRoot||this.resumeFrom||K||A&&(G||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const X={...k2(M,"layout"),onPlay:I,onComplete:q};(S.shouldReduceMotion||this.options.layoutRoot)&&(X.delay=0,X.type=!1),this.startAnimation(X),this.setAnimationOrigin(j,K)}else A||T4(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=T})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const m=this.getStack();m&&m.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Ud(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(mde),this.animationId++)}getTransformTemplate(){const{visualElement:m}=this.options;return m&&m.getProps().transformTemplate}willUpdate(m=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&DF(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let j=0;j{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Mi(this.snapshot.measuredBox.x)&&!Mi(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let b=0;b{const ee=L/1e3;_4(A.x,m.x,ee),_4(A.y,m.y,ee),this.setTargetDelta(A),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Yj(k,this.layout.layoutBox,this.relativeParent.layout.layoutBox),yde(this.relativeTarget,this.relativeTargetOrigin,k,ee),X&&nde(this.relativeTarget,X)&&(this.isProjectionDirty=!1),X||(X=js()),Ho(X,this.relativeTarget)),I&&(this.animationValues=j,Zue(j,S,this.latestValues,ee,K,G)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=ee},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(m){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Ud(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=_r.update(()=>{Sj.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=wg(0)),this.currentAnimation=Vue(this.motionValue,[0,1e3],{...m,velocity:0,isSync:!0,onUpdate:g=>{this.mixTargetDelta(g),m.onUpdate&&m.onUpdate(g)},onStop:()=>{},onComplete:()=>{m.onComplete&&m.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const m=this.getStack();m&&m.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ide),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const m=this.getLead();let{targetWithTransforms:g,target:b,layout:S,latestValues:j}=m;if(!(!g||!b||!S)){if(this!==m&&this.layout&&S&&MF(this.options.animationType,this.layout.layoutBox,S.layoutBox)){b=this.target||js();const A=Mi(this.layout.layoutBox.x);b.x.min=m.target.x.min,b.x.max=b.x.min+A;const k=Mi(this.layout.layoutBox.y);b.y.min=m.target.y.min,b.y.max=b.y.min+k}Ho(g,b),lg(g,j),Nb(this.projectionDeltaWithTransform,this.layoutCorrected,g,j)}}registerSharedNode(m,g){this.sharedNodes.has(m)||this.sharedNodes.set(m,new rde),this.sharedNodes.get(m).add(g);const S=g.options.initialPromotionConfig;g.promote({transition:S?S.transition:void 0,preserveFollowOpacity:S&&S.shouldPreserveFollowOpacity?S.shouldPreserveFollowOpacity(g):void 0})}isLead(){const m=this.getStack();return m?m.lead===this:!0}getLead(){const{layoutId:m}=this.options;return m?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:m}=this.options;return m?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:m}=this.options;if(m)return this.root.sharedNodes.get(m)}promote({needsReset:m,transition:g,preserveFollowOpacity:b}={}){const S=this.getStack();S&&S.promote(this,b),m&&(this.projectionDelta=void 0,this.needsReset=!0),g&&this.setOptions({transition:g})}relegate(){const m=this.getStack();return m?m.relegate(this):!1}resetSkewAndRotation(){const{visualElement:m}=this.options;if(!m)return;let g=!1;const{latestValues:b}=m;if((b.z||b.rotate||b.rotateX||b.rotateY||b.rotateZ||b.skewX||b.skewY)&&(g=!0),!g)return;const S={};b.z&&oT("z",m,S,this.animationValues);for(let j=0;jm.currentAnimation?.stop()),this.root.nodes.forEach(k4),this.root.sharedNodes.clear()}}}function ode(e){e.updateLayout()}function lde(e){const r=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&r&&e.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:o}=e.layout,{animationType:d}=e.options,p=r.source!==e.layout.source;d==="size"?to(j=>{const A=p?r.measuredBox[j]:r.layoutBox[j],k=Mi(A);A.min=s[j].min,A.max=A.min+k}):MF(d,r.layoutBox,s)&&to(j=>{const A=p?r.measuredBox[j]:r.layoutBox[j],k=Mi(s[j]);A.max=A.min+k,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[j].max=e.relativeTarget[j].min+k)});const m=cg();Nb(m,s,r.layoutBox);const g=cg();p?Nb(g,e.applyTransform(o,!0),r.measuredBox):Nb(g,s,r.layoutBox);const b=!$F(m);let S=!1;if(!e.resumeFrom){const j=e.getClosestProjectingParent();if(j&&!j.resumeFrom){const{snapshot:A,layout:k}=j;if(A&&k){const T=js();Yj(T,r.layoutBox,A.layoutBox);const M=js();Yj(M,s,k.layoutBox),NF(T,M)||(S=!0),j.options.layoutRoot&&(e.relativeTarget=M,e.relativeTargetOrigin=T,e.relativeParent=j)}}}e.notifyListeners("didUpdate",{layout:s,snapshot:r,delta:g,layoutDelta:m,hasLayoutChanged:b,hasRelativeLayoutChanged:S})}else if(e.isLead()){const{onExitComplete:s}=e.options;s&&s()}e.options.transition=void 0}function cde(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function ude(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function dde(e){e.clearSnapshot()}function k4(e){e.clearMeasurements()}function R4(e){e.isLayoutDirty=!1}function hde(e){const{visualElement:r}=e.options;r&&r.getProps().onBeforeLayoutMeasure&&r.notify("BeforeLayoutMeasure"),e.resetTransform()}function T4(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function pde(e){e.resolveTargetDelta()}function fde(e){e.calcProjection()}function mde(e){e.resetSkewAndRotation()}function gde(e){e.removeLeadSnapshot()}function _4(e,r,s){e.translate=Lr(r.translate,0,s),e.scale=Lr(r.scale,1,s),e.origin=r.origin,e.originPoint=r.originPoint}function $4(e,r,s,o){e.min=Lr(r.min,s.min,o),e.max=Lr(r.max,s.max,o)}function yde(e,r,s,o){$4(e.x,r.x,s.x,o),$4(e.y,r.y,s.y,o)}function vde(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const xde={duration:.45,ease:[.4,0,.1,1]},N4=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),D4=N4("applewebkit/")&&!N4("chrome/")?Math.round:so;function P4(e){e.min=D4(e.min),e.max=D4(e.max)}function bde(e){P4(e.x),P4(e.y)}function MF(e,r,s){return e==="position"||e==="preserve-aspect"&&!Aue(A4(r),A4(s),.2)}function wde(e){return e!==e.root&&e.scroll?.wasRoot}const Sde=PF({attachResizeListener:(e,r)=>Hb(e,"resize",r),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),lT={current:void 0},IF=PF({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!lT.current){const e=new Sde({});e.mount(window),e.setOptions({layoutScroll:!0}),lT.current=e}return lT.current},resetTransform:(e,r)=>{e.style.transform=r!==void 0?r:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Ede={pan:{Feature:que},drag:{Feature:Fue,ProjectionNode:IF,MeasureLayout:RF}};function M4(e,r,s){const{props:o}=e;e.animationState&&o.whileHover&&e.animationState.setActive("whileHover",s==="Start");const d="onHover"+s,p=o[d];p&&_r.postRender(()=>p(r,fw(r)))}class jde extends Yd{mount(){const{current:r}=this.node;r&&(this.unmount=Zle(r,(s,o)=>(M4(this.node,o,"Start"),d=>M4(this.node,d,"End"))))}unmount(){}}class Cde extends Yd{constructor(){super(...arguments),this.isActive=!1}onFocus(){let r=!1;try{r=this.node.current.matches(":focus-visible")}catch{r=!0}!r||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=dw(Hb(this.node.current,"focus",()=>this.onFocus()),Hb(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function I4(e,r,s){const{props:o}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&o.whileTap&&e.animationState.setActive("whileTap",s==="Start");const d="onTap"+(s==="End"?"":s),p=o[d];p&&_r.postRender(()=>p(r,fw(r)))}class Ade extends Yd{mount(){const{current:r}=this.node;r&&(this.unmount=ece(r,(s,o)=>(I4(this.node,o,"Start"),(d,{success:p})=>I4(this.node,d,p?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const u_=new WeakMap,cT=new WeakMap,Ode=e=>{const r=u_.get(e.target);r&&r(e)},kde=e=>{e.forEach(Ode)};function Rde({root:e,...r}){const s=e||document;cT.has(s)||cT.set(s,{});const o=cT.get(s),d=JSON.stringify(r);return o[d]||(o[d]=new IntersectionObserver(kde,{root:e,...r})),o[d]}function Tde(e,r,s){const o=Rde(r);return u_.set(e,s),o.observe(e),()=>{u_.delete(e),o.unobserve(e)}}const _de={some:0,all:1};class $de extends Yd{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:r={}}=this.node.getProps(),{root:s,margin:o,amount:d="some",once:p}=r,m={root:s?s.current:void 0,rootMargin:o,threshold:typeof d=="number"?d:_de[d]},g=b=>{const{isIntersecting:S}=b;if(this.isInView===S||(this.isInView=S,p&&!S&&this.hasEnteredView))return;S&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",S);const{onViewportEnter:j,onViewportLeave:A}=this.node.getProps(),k=S?j:A;k&&k(b)};return Tde(this.node.current,m,g)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:r,prevProps:s}=this.node;["amount","margin","root"].some(Nde(r,s))&&this.startObserver()}unmount(){}}function Nde({viewport:e={}},{viewport:r={}}={}){return s=>e[s]!==r[s]}const Dde={inView:{Feature:$de},tap:{Feature:Ade},focus:{Feature:Cde},hover:{Feature:jde}},Pde={layout:{ProjectionNode:IF,MeasureLayout:RF}},Mde={...bue,...Dde,...Ede,...Pde},Ide=Mce(Mde,Yce),Lde=[{id:"light",icon:jW,label:"Light"},{id:"dark",icon:lW,label:"Dark"},{id:"system",icon:aW,label:"System"}],LF=({className:e="",variant:r="pill",ariaLabel:s="Toggle theme"})=>{const{theme:o,setTheme:d}=N_(),p=o??"system",m=r==="pill";return u.jsx("div",{className:ht("inline-flex items-center",m&&"bg-muted/70 rounded-full p-1 text-xs shadow-sm",!m&&"gap-2",e),"aria-label":s,role:"radiogroup",children:Lde.map(({id:g,icon:b,label:S})=>{const j=p===g;return u.jsxs("button",{type:"button",role:"radio","aria-checked":j,onClick:()=>d(g),"aria-label":m?S:void 0,className:ht("focus-visible:ring-ring focus-visible:ring-offset-background relative flex items-center justify-center rounded-full transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",j?"text-foreground border":"text-muted-foreground hover:text-foreground",m&&"h-8 w-8",!m&&"h-8 gap-2 px-3 text-sm font-medium"),children:[j&&u.jsx(Ide.span,{layoutId:"theme-switcher-pill",className:"bg-background absolute inset-0 rounded-full shadow-sm",transition:{type:"spring",stiffness:350,damping:26}}),u.jsx(b,{className:"relative z-10 h-4 w-4"}),!m&&u.jsx("span",{className:"relative z-10",children:S})]},g)})})};function zde(){return rr({queryKey:["me"],queryFn:()=>yp.getMe(),staleTime:300*1e3})}function Fde(e,r=[]){let s=[];function o(p,m){const g=R.createContext(m);g.displayName=p+"Context";const b=s.length;s=[...s,m];const S=A=>{const{scope:k,children:T,...M}=A,I=k?.[e]?.[b]||g,q=R.useMemo(()=>M,Object.values(M));return u.jsx(I.Provider,{value:q,children:T})};S.displayName=p+"Provider";function j(A,k){const T=k?.[e]?.[b]||g,M=R.useContext(T);if(M)return M;if(m!==void 0)return m;throw new Error(`\`${A}\` must be used within \`${p}\``)}return[S,j]}const d=()=>{const p=s.map(m=>R.createContext(m));return function(g){const b=g?.[e]||p;return R.useMemo(()=>({[`__scope${e}`]:{...g,[e]:b}}),[g,b])}};return d.scopeName=e,[o,qde(d,...r)]}function qde(...e){const r=e[0];if(e.length===1)return r;const s=()=>{const o=e.map(d=>({useScope:d(),scopeName:d.scopeName}));return function(p){const m=o.reduce((g,{useScope:b,scopeName:S})=>{const A=b(p)[`__scope${S}`];return{...g,...A}},{});return R.useMemo(()=>({[`__scope${r.scopeName}`]:m}),[m])}};return s.scopeName=r.scopeName,s}var Bde=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],q2=Bde.reduce((e,r)=>{const s=ew(`Primitive.${r}`),o=R.forwardRef((d,p)=>{const{asChild:m,...g}=d,b=m?s:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(b,{...g,ref:p})});return o.displayName=`Primitive.${r}`,{...e,[r]:o}},{}),uT={exports:{}},dT={};var L4;function Ude(){if(L4)return dT;L4=1;var e=K3();function r(A,k){return A===k&&(A!==0||1/A===1/k)||A!==A&&k!==k}var s=typeof Object.is=="function"?Object.is:r,o=e.useState,d=e.useEffect,p=e.useLayoutEffect,m=e.useDebugValue;function g(A,k){var T=k(),M=o({inst:{value:T,getSnapshot:k}}),I=M[0].inst,q=M[1];return p(function(){I.value=T,I.getSnapshot=k,b(I)&&q({inst:I})},[A,T,k]),d(function(){return b(I)&&q({inst:I}),A(function(){b(I)&&q({inst:I})})},[A]),m(T),T}function b(A){var k=A.getSnapshot;A=A.value;try{var T=k();return!s(A,T)}catch{return!0}}function S(A,k){return k()}var j=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?S:g;return dT.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:j,dT}var z4;function Kde(){return z4||(z4=1,uT.exports=Ude()),uT.exports}var Vde=Kde();function Hde(){return Vde.useSyncExternalStore(Gde,()=>!0,()=>!1)}function Gde(){return()=>{}}var B2="Avatar",[Xde]=Fde(B2),[Yde,zF]=Xde(B2),FF=R.forwardRef((e,r)=>{const{__scopeAvatar:s,...o}=e,[d,p]=R.useState("idle");return u.jsx(Yde,{scope:s,imageLoadingStatus:d,onImageLoadingStatusChange:p,children:u.jsx(q2.span,{...o,ref:r})})});FF.displayName=B2;var qF="AvatarImage",Zde=R.forwardRef((e,r)=>{const{__scopeAvatar:s,src:o,onLoadingStatusChange:d=()=>{},...p}=e,m=zF(qF,s),g=Wde(o,p),b=tl(S=>{d(S),m.onImageLoadingStatusChange(S)});return As(()=>{g!=="idle"&&b(g)},[g,b]),g==="loaded"?u.jsx(q2.img,{...p,ref:r,src:o}):null});Zde.displayName=qF;var BF="AvatarFallback",UF=R.forwardRef((e,r)=>{const{__scopeAvatar:s,delayMs:o,...d}=e,p=zF(BF,s),[m,g]=R.useState(o===void 0);return R.useEffect(()=>{if(o!==void 0){const b=window.setTimeout(()=>g(!0),o);return()=>window.clearTimeout(b)}},[o]),m&&p.imageLoadingStatus!=="loaded"?u.jsx(q2.span,{...d,ref:r}):null});UF.displayName=BF;function F4(e,r){return e?r?(e.src!==r&&(e.src=r),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function Wde(e,{referrerPolicy:r,crossOrigin:s}){const o=Hde(),d=R.useRef(null),p=o?(d.current||(d.current=new window.Image),d.current):null,[m,g]=R.useState(()=>F4(p,e));return As(()=>{g(F4(p,e))},[p,e]),As(()=>{const b=A=>()=>{g(A)};if(!p)return;const S=b("loaded"),j=b("error");return p.addEventListener("load",S),p.addEventListener("error",j),r&&(p.referrerPolicy=r),typeof s=="string"&&(p.crossOrigin=s),()=>{p.removeEventListener("load",S),p.removeEventListener("error",j)}},[p,s,r]),m}var Jde=FF,Qde=UF;function ehe({className:e,...r}){return u.jsx(Jde,{"data-slot":"avatar",className:ht("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...r})}function the({className:e,...r}){return u.jsx(Qde,{"data-slot":"avatar-fallback",className:ht("bg-muted flex size-full items-center justify-center rounded-full",e),...r})}function nhe({...e}){return u.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function rhe({className:e,...r}){return u.jsx("ol",{"data-slot":"breadcrumb-list",className:ht("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...r})}function q4({className:e,...r}){return u.jsx("li",{"data-slot":"breadcrumb-item",className:ht("inline-flex items-center gap-1.5",e),...r})}function B4({asChild:e,className:r,...s}){const o=e?Cg:"a";return u.jsx(o,{"data-slot":"breadcrumb-link",className:ht("hover:text-foreground transition-colors",r),...s})}function she({className:e,...r}){return u.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:ht("text-foreground font-normal",e),...r})}function ihe({children:e,className:r,...s}){return u.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:ht("[&>svg]:size-3.5",r),...s,children:e??u.jsx(SZ,{})})}const hT=768;function ahe(){const[e,r]=R.useState(void 0);return R.useEffect(()=>{const s=window.matchMedia(`(max-width: ${hT-1}px)`),o=()=>{r(window.innerWidths.removeEventListener("change",o)},[]),!!e}function xt({className:e,type:r,...s}){return u.jsx("input",{type:r,"data-slot":"input",className:ht("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...s})}function ohe({...e}){return u.jsx(_C,{"data-slot":"sheet",...e})}function lhe({...e}){return u.jsx($C,{"data-slot":"sheet-portal",...e})}function che({className:e,...r}){return u.jsx(NC,{"data-slot":"sheet-overlay",className:ht("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...r})}function uhe({className:e,children:r,side:s="right",...o}){return u.jsxs(lhe,{children:[u.jsx(che,{}),u.jsxs(DC,{"data-slot":"sheet-content",className:ht("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",s==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",s==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",s==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",s==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...o,children:[r,u.jsxs(lw,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[u.jsx(q_,{className:"size-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function dhe({className:e,...r}){return u.jsx("div",{"data-slot":"sheet-header",className:ht("flex flex-col gap-1.5 p-4",e),...r})}function hhe({className:e,...r}){return u.jsx(i2,{"data-slot":"sheet-title",className:ht("text-foreground font-semibold",e),...r})}function phe({className:e,...r}){return u.jsx(a2,{"data-slot":"sheet-description",className:ht("text-muted-foreground text-sm",e),...r})}const fhe="sidebar_state",mhe=3600*24*7,ghe="16rem",yhe="18rem",vhe="3rem",xhe="b",KF=R.createContext(null);function U2(){const e=R.useContext(KF);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function bhe({defaultOpen:e=!0,open:r,onOpenChange:s,className:o,style:d,children:p,...m}){const g=ahe(),[b,S]=R.useState(!1),[j,A]=R.useState(e),k=r??j,T=R.useCallback(G=>{const K=typeof G=="function"?G(k):G;s?s(K):A(K),document.cookie=`${fhe}=${K}; path=/; max-age=${mhe}`},[s,k]),M=R.useCallback(()=>g?S(G=>!G):T(G=>!G),[g,T,S]);R.useEffect(()=>{const G=K=>{K.key===xhe&&(K.metaKey||K.ctrlKey)&&(K.preventDefault(),M())};return window.addEventListener("keydown",G),()=>window.removeEventListener("keydown",G)},[M]);const I=k?"expanded":"collapsed",q=R.useMemo(()=>({state:I,open:k,setOpen:T,isMobile:g,openMobile:b,setOpenMobile:S,toggleSidebar:M}),[I,k,T,g,b,S,M]);return u.jsx(KF.Provider,{value:q,children:u.jsx(sw,{delayDuration:0,children:u.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":ghe,"--sidebar-width-icon":vhe,...d},className:ht("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",o),...m,children:p})})})}function whe({side:e="left",variant:r="sidebar",collapsible:s="offcanvas",className:o,children:d,...p}){const{isMobile:m,state:g,openMobile:b,setOpenMobile:S}=U2();return s==="none"?u.jsx("div",{"data-slot":"sidebar",className:ht("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",o),...p,children:d}):m?u.jsx(ohe,{open:b,onOpenChange:S,...p,children:u.jsxs(uhe,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":yhe},side:e,children:[u.jsxs(dhe,{className:"sr-only",children:[u.jsx(hhe,{children:"Sidebar"}),u.jsx(phe,{children:"Displays the mobile sidebar."})]}),u.jsx("div",{className:"flex h-full w-full flex-col",children:d})]})}):u.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":g,"data-collapsible":g==="collapsed"?s:"","data-variant":r,"data-side":e,"data-slot":"sidebar",children:[u.jsx("div",{"data-slot":"sidebar-gap",className:ht("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",r==="floating"||r==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),u.jsx("div",{"data-slot":"sidebar-container",className:ht("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",r==="floating"||r==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",o),...p,children:u.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:d})})]})}function She({className:e,onClick:r,...s}){const{toggleSidebar:o}=U2();return u.jsxs(Fe,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:ht("size-7",e),onClick:d=>{r?.(d),o()},...s,children:[u.jsx(fW,{}),u.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Ehe({className:e,...r}){return u.jsx("main",{"data-slot":"sidebar-inset",className:ht("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...r})}function jhe({className:e,...r}){return u.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:ht("flex flex-col gap-2 p-2",e),...r})}function Che({className:e,...r}){return u.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:ht("flex flex-col gap-2 p-2",e),...r})}function Ahe({className:e,...r}){return u.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:ht("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...r})}function tj({className:e,...r}){return u.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:ht("relative flex w-full min-w-0 flex-col p-2",e),...r})}function nj({className:e,asChild:r=!1,...s}){const o=r?Cg:"div";return u.jsx(o,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:ht("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...s})}function rj({className:e,...r}){return u.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:ht("w-full text-sm",e),...r})}function sj({className:e,...r}){return u.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:ht("flex w-full min-w-0 flex-col gap-1",e),...r})}function ij({className:e,...r}){return u.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:ht("group/menu-item relative",e),...r})}const Ohe=U_("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function aj({asChild:e=!1,isActive:r=!1,variant:s="default",size:o="default",tooltip:d,className:p,...m}){const g=e?Cg:"button",{isMobile:b,state:S}=U2(),j=u.jsx(g,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":o,"data-active":r,className:ht(Ohe({variant:s,size:o}),p),...m});return d?(typeof d=="string"&&(d={children:d}),u.jsxs(Ij,{children:[u.jsx(Lj,{asChild:!0,children:j}),u.jsx(zj,{side:"right",align:"center",hidden:S!=="collapsed"||b,...d})]})):j}const khe=()=>{const e=__(),{data:r,isLoading:s}=zde(),o=R.useMemo(()=>{const p=e.pathname.split("/").filter(Boolean),m=[];let g="";for(const b of p)g+=`/${b}`,m.push({to:g,label:b});return m},[e.pathname]),d=R.useMemo(()=>{if(!r)return"U";const m=(r.display_name||r.primary_email||"").trim().split(/\s+/);return m.length>=2?(m[0][0]+m[1][0]).toUpperCase():m.length===1&&m[0]?m[0][0].toUpperCase():"U"},[r]);return u.jsxs("div",{className:"flex h-12 items-center gap-2 border-b px-3",children:[u.jsx(She,{}),u.jsx("div",{className:"flex-1",children:u.jsx(nhe,{children:u.jsxs(rhe,{children:[u.jsx(q4,{children:u.jsx(B4,{asChild:!0,children:u.jsx(OR,{to:"/",children:"Home"})})}),o.map((p,m)=>u.jsxs("span",{className:"flex items-center",children:[u.jsx(ihe,{}),u.jsx(q4,{children:m===o.length-1?u.jsx(she,{className:"capitalize",children:p.label}):u.jsx(B4,{asChild:!0,children:u.jsx(OR,{to:p.to,className:"capitalize",children:p.label})})})]},p.to))]})})}),u.jsx(LF,{variant:"wide"}),u.jsx(Fe,{variant:"ghost",size:"sm",asChild:!0,children:u.jsx(OR,{to:"/me",children:s?"…":r?.display_name||"Profile"})}),u.jsx(ehe,{className:"h-7 w-7",children:u.jsx(the,{children:d})})]})};async function Rhe(){const e=Ks.get();if(!e?.refresh_token){Ks.logout();return}try{const r={refresh_token:e.refresh_token};await Yee().logout({dtoLogoutRequest:r})}catch(r){console.warn("Logout API failed; clearing local state anyway",r)}finally{Ks.logout()}}function The(){return{logout:R.useCallback(()=>Rhe(),[])}}const _he=()=>{const[e,r]=R.useState([]),{logout:s}=The();return R.useEffect(()=>{let o=!0;return(async()=>{try{const p=((await yp.getMe()).organizations??[]).map(m=>({id:m.id,name:m.name??m.id}));if(!o)return;r(p),!Qo.get()&&p.length>0&&Qo.set(p[0].id)}catch{}})(),()=>{o=!1}},[]),u.jsxs(bhe,{defaultOpen:!0,children:[u.jsxs(whe,{collapsible:"icon",variant:"floating",children:[u.jsx(jhe,{children:u.jsx("div",{className:"px-2 py-2",children:u.jsx(soe,{orgs:e})})}),u.jsxs(Ahe,{children:[u.jsxs(tj,{children:[u.jsx(nj,{children:"Navigation"}),u.jsx(rj,{children:u.jsx(sj,{children:Kse.map(o=>u.jsx(ij,{children:u.jsx(aj,{asChild:!0,tooltip:o.label,children:u.jsxs(IE,{to:o.to,className:({isActive:d})=>ht("flex items-center gap-2",d&&"text-primary"),children:[u.jsx(o.icon,{className:"h-4 w-4"}),u.jsx("span",{children:o.label})]})})},o.to))})})]}),u.jsxs(tj,{children:[u.jsx(nj,{children:"Organization"}),u.jsx(rj,{children:u.jsx(sj,{children:Vse.map(o=>u.jsx(ij,{children:u.jsx(aj,{asChild:!0,tooltip:o.label,children:u.jsxs(IE,{to:o.to,className:({isActive:d})=>ht("flex items-center gap-2",d&&"text-primary"),children:[u.jsx(o.icon,{className:"h-4 w-4"}),u.jsx("span",{children:o.label})]})})},o.to))})})]}),u.jsxs(tj,{children:[u.jsx(nj,{children:"User"}),u.jsx(rj,{children:u.jsx(sj,{children:Hse.map(o=>u.jsx(ij,{children:u.jsx(aj,{asChild:!0,tooltip:o.label,children:u.jsxs(IE,{to:o.to,className:({isActive:d})=>ht("flex items-center gap-2",d&&"text-primary"),children:[u.jsx(o.icon,{className:"h-4 w-4"}),u.jsx("span",{children:o.label})]})})},o.to))})})]}),u.jsxs(tj,{children:[u.jsx(nj,{children:"Admin"}),u.jsx(rj,{children:u.jsx(sj,{children:Gse.map(o=>u.jsx(ij,{children:u.jsx(aj,{asChild:!0,tooltip:o.label,children:u.jsxs(IE,{to:o.to,target:o.target?o.target:"_self",className:({isActive:d})=>ht("flex items-center gap-2",d&&"text-primary"),children:[u.jsx(o.icon,{className:"h-4 w-4"}),u.jsx("span",{children:o.label})]})})},o.to))})})]}),u.jsx("div",{className:"mt-auto flex items-center justify-center p-3",children:u.jsx(LF,{})})]}),u.jsx(Che,{children:u.jsx("div",{className:"px-2 py-2",children:u.jsx(Fe,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>void s(),children:"Sign out"})})})]}),u.jsxs(Ehe,{className:"flex min-h-screen flex-col",children:[u.jsx(khe,{}),u.jsx("main",{className:"p-4",children:u.jsx(V3,{})}),u.jsx(_se,{})]})]})},$he=()=>{const e=R.useSyncExternalStore(r=>Ks.subscribe(r),()=>Ks.get(),()=>Ks.get());return{tokens:e,authed:!!e?.access_token,isExpired:Ks.isExpired(),willExpireSoon:Ks.willExpireSoon()}},Nhe=()=>{const{authed:e}=$he(),r=__();return e?u.jsx(V3,{}):u.jsx(fY,{to:`/login?to=${encodeURIComponent(r.pathname+r.search)}`,replace:!0})},ob=nte(),Sb={listAnnotations:()=>ut(async()=>await ob.listAnnotations()),createAnnotation:e=>ut(async()=>await ob.createAnnotation({dtoCreateAnnotationRequest:e})),getAnnotation:e=>ut(async()=>await ob.getAnnotation({id:e})),deleteAnnotation:e=>ut(async()=>{await ob.deleteAnnotation({id:e})}),updateAnnotation:(e,r)=>ut(async()=>await ob.updateAnnotation({id:e,dtoUpdateAnnotationRequest:r}))};var mw=e=>e.type==="checkbox",wp=e=>e instanceof Date,ua=e=>e==null;const VF=e=>typeof e=="object";var ms=e=>!ua(e)&&!Array.isArray(e)&&VF(e)&&!wp(e),HF=e=>ms(e)&&e.target?mw(e.target)?e.target.checked:e.target.value:e,Dhe=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,GF=(e,r)=>e.has(Dhe(r)),Phe=e=>{const r=e.constructor&&e.constructor.prototype;return ms(r)&&r.hasOwnProperty("isPrototypeOf")},K2=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Es(e){let r;const s=Array.isArray(e),o=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)r=new Date(e);else if(!(K2&&(e instanceof Blob||o))&&(s||ms(e)))if(r=s?[]:Object.create(Object.getPrototypeOf(e)),!s&&!Phe(e))r=e;else for(const d in e)e.hasOwnProperty(d)&&(r[d]=Es(e[d]));else return e;return r}var FC=e=>/^\w*$/.test(e),Hr=e=>e===void 0,V2=e=>Array.isArray(e)?e.filter(Boolean):[],H2=e=>V2(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Et=(e,r,s)=>{if(!r||!ms(e))return s;const o=(FC(r)?[r]:H2(r)).reduce((d,p)=>ua(d)?d:d[p],e);return Hr(o)||o===e?Hr(e[r])?s:e[r]:o},Ta=e=>typeof e=="boolean",dr=(e,r,s)=>{let o=-1;const d=FC(r)?[r]:H2(r),p=d.length,m=p-1;for(;++oJe.useContext(G2),Mhe=e=>{const{children:r,...s}=e;return Je.createElement(G2.Provider,{value:s},r)};var XF=(e,r,s,o=!0)=>{const d={defaultValues:r._defaultValues};for(const p in e)Object.defineProperty(d,p,{get:()=>{const m=p;return r._proxyFormState[m]!==Zo.all&&(r._proxyFormState[m]=!o||Zo.all),s&&(s[m]=!0),e[m]}});return d};const X2=typeof window<"u"?Je.useLayoutEffect:Je.useEffect;function YF(e){const r=qC(),{control:s=r.control,disabled:o,name:d,exact:p}=e||{},[m,g]=Je.useState(s._formState),b=Je.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return X2(()=>s._subscribe({name:d,formState:b.current,exact:p,callback:S=>{!o&&g({...s._formState,...S})}}),[d,o,p]),Je.useEffect(()=>{b.current.isValid&&s._setValid(!0)},[s]),Je.useMemo(()=>XF(m,s,b.current,!1),[m,s])}var $a=e=>typeof e=="string",d_=(e,r,s,o,d)=>$a(e)?(o&&r.watch.add(e),Et(s,e,d)):Array.isArray(e)?e.map(p=>(o&&r.watch.add(p),Et(s,p))):(o&&(r.watchAll=!0),s),h_=e=>ua(e)||!VF(e);function Wo(e,r,s=new WeakSet){if(h_(e)||h_(r))return Object.is(e,r);if(wp(e)&&wp(r))return e.getTime()===r.getTime();const o=Object.keys(e),d=Object.keys(r);if(o.length!==d.length)return!1;if(s.has(e)||s.has(r))return!0;s.add(e),s.add(r);for(const p of o){const m=e[p];if(!d.includes(p))return!1;if(p!=="ref"){const g=r[p];if(wp(m)&&wp(g)||ms(m)&&ms(g)||Array.isArray(m)&&Array.isArray(g)?!Wo(m,g,s):!Object.is(m,g))return!1}}return!0}function ug(e){const r=qC(),{control:s=r.control,name:o,defaultValue:d,disabled:p,exact:m,compute:g}=e||{},b=Je.useRef(d),S=Je.useRef(g),j=Je.useRef(void 0),A=Je.useRef(s),k=Je.useRef(o);S.current=g;const[T,M]=Je.useState(()=>{const L=s._getWatch(o,b.current);return S.current?S.current(L):L}),I=Je.useCallback(L=>{const ee=d_(o,s._names,L||s._formValues,!1,b.current);return S.current?S.current(ee):ee},[s._formValues,s._names,o]),q=Je.useCallback(L=>{if(!p){const ee=d_(o,s._names,L||s._formValues,!1,b.current);if(S.current){const oe=S.current(ee);Wo(oe,j.current)||(M(oe),j.current=oe)}else M(ee)}},[s._formValues,s._names,p,o]);X2(()=>((A.current!==s||!Wo(k.current,o))&&(A.current=s,k.current=o,q()),s._subscribe({name:o,formState:{values:!0},exact:m,callback:L=>{q(L.values)}})),[s,m,o,q]),Je.useEffect(()=>s._removeUnmounted());const G=A.current!==s,K=k.current,X=Je.useMemo(()=>{if(p)return null;const L=!G&&!Wo(K,o);return G||L?I():null},[p,G,o,K,I]);return X!==null?X:T}function Ihe(e){const r=qC(),{name:s,disabled:o,control:d=r.control,shouldUnregister:p,defaultValue:m,exact:g=!0}=e,b=GF(d._names.array,s),S=Je.useMemo(()=>Et(d._formValues,s,Et(d._defaultValues,s,m)),[d,s,m]),j=ug({control:d,name:s,defaultValue:S,exact:g}),A=YF({control:d,name:s,exact:g}),k=Je.useRef(e),T=Je.useRef(void 0),M=Je.useRef(d.register(s,{...e.rules,value:j,...Ta(e.disabled)?{disabled:e.disabled}:{}}));k.current=e;const I=Je.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Et(A.errors,s)},isDirty:{enumerable:!0,get:()=>!!Et(A.dirtyFields,s)},isTouched:{enumerable:!0,get:()=>!!Et(A.touchedFields,s)},isValidating:{enumerable:!0,get:()=>!!Et(A.validatingFields,s)},error:{enumerable:!0,get:()=>Et(A.errors,s)}}),[A,s]),q=Je.useCallback(L=>M.current.onChange({target:{value:HF(L),name:s},type:Zj.CHANGE}),[s]),G=Je.useCallback(()=>M.current.onBlur({target:{value:Et(d._formValues,s),name:s},type:Zj.BLUR}),[s,d._formValues]),K=Je.useCallback(L=>{const ee=Et(d._fields,s);ee&&L&&(ee._f.ref={focus:()=>L.focus&&L.focus(),select:()=>L.select&&L.select(),setCustomValidity:oe=>L.setCustomValidity(oe),reportValidity:()=>L.reportValidity()})},[d._fields,s]),X=Je.useMemo(()=>({name:s,value:j,...Ta(o)||A.disabled?{disabled:A.disabled||o}:{},onChange:q,onBlur:G,ref:K}),[s,o,A.disabled,q,G,K,j]);return Je.useEffect(()=>{const L=d._options.shouldUnregister||p,ee=T.current;ee&&ee!==s&&!b&&d.unregister(ee),d.register(s,{...k.current.rules,...Ta(k.current.disabled)?{disabled:k.current.disabled}:{}});const oe=(Q,ne)=>{const de=Et(d._fields,Q);de&&de._f&&(de._f.mount=ne)};if(oe(s,!0),L){const Q=Es(Et(d._options.defaultValues,s,k.current.defaultValue));dr(d._defaultValues,s,Q),Hr(Et(d._formValues,s))&&dr(d._formValues,s,Q)}return!b&&d.register(s),T.current=s,()=>{(b?L&&!d._state.action:L)?d.unregister(s):oe(s,!1)}},[s,d,b,p]),Je.useEffect(()=>{d._setDisabledField({disabled:o,name:s})},[o,s,d]),Je.useMemo(()=>({field:X,formState:A,fieldState:I}),[X,A,I])}const Go=e=>e.render(Ihe(e));var Y2=(e,r,s,o,d)=>r?{...s[e],types:{...s[e]&&s[e].types?s[e].types:{},[o]:d||!0}}:{},Db=e=>Array.isArray(e)?e:[e],U4=()=>{let e=[];return{get observers(){return e},next:d=>{for(const p of e)p.next&&p.next(d)},subscribe:d=>(e.push(d),{unsubscribe:()=>{e=e.filter(p=>p!==d)}}),unsubscribe:()=>{e=[]}}};function ZF(e,r){const s={};for(const o in e)if(e.hasOwnProperty(o)){const d=e[o],p=r[o];if(d&&ms(d)&&p){const m=ZF(d,p);ms(m)&&(s[o]=m)}else e[o]&&(s[o]=p)}return s}var Di=e=>ms(e)&&!Object.keys(e).length,Z2=e=>e.type==="file",Jo=e=>typeof e=="function",Wj=e=>{if(!K2)return!1;const r=e?e.ownerDocument:0;return e instanceof(r&&r.defaultView?r.defaultView.HTMLElement:HTMLElement)},WF=e=>e.type==="select-multiple",W2=e=>e.type==="radio",Lhe=e=>W2(e)||mw(e),pT=e=>Wj(e)&&e.isConnected;function zhe(e,r){const s=r.slice(0,-1).length;let o=0;for(;o{for(const r in e)if(Jo(e[r]))return!0;return!1};function JF(e){return Array.isArray(e)||ms(e)&&!qhe(e)}function p_(e,r={}){for(const s in e){const o=e[s];JF(o)?(r[s]=Array.isArray(o)?[]:{},p_(o,r[s])):Hr(o)||(r[s]=!0)}return r}function Jm(e,r,s){s||(s=p_(r));for(const o in e){const d=e[o];if(JF(d))Hr(r)||h_(s[o])?s[o]=p_(d,Array.isArray(d)?[]:{}):Jm(d,ua(r)?{}:r[o],s[o]);else{const p=r[o];s[o]=!Wo(d,p)}}return s}const K4={value:!1,isValid:!1},V4={value:!0,isValid:!0};var QF=e=>{if(Array.isArray(e)){if(e.length>1){const r=e.filter(s=>s&&s.checked&&!s.disabled).map(s=>s.value);return{value:r,isValid:!!r.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Hr(e[0].attributes.value)?Hr(e[0].value)||e[0].value===""?V4:{value:e[0].value,isValid:!0}:V4:K4}return K4},e6=(e,{valueAsNumber:r,valueAsDate:s,setValueAs:o})=>Hr(e)?e:r?e===""?NaN:e&&+e:s&&$a(e)?new Date(e):o?o(e):e;const H4={isValid:!1,value:null};var t6=e=>Array.isArray(e)?e.reduce((r,s)=>s&&s.checked&&!s.disabled?{isValid:!0,value:s.value}:r,H4):H4;function G4(e){const r=e.ref;return Z2(r)?r.files:W2(r)?t6(e.refs).value:WF(r)?[...r.selectedOptions].map(({value:s})=>s):mw(r)?QF(e.refs).value:e6(Hr(r.value)?e.ref.value:r.value,e)}var Bhe=(e,r,s,o)=>{const d={};for(const p of e){const m=Et(r,p);m&&dr(d,p,m._f)}return{criteriaMode:s,names:[...e],fields:d,shouldUseNativeValidation:o}},Jj=e=>e instanceof RegExp,lb=e=>Hr(e)?e:Jj(e)?e.source:ms(e)?Jj(e.value)?e.value.source:e.value:e,X4=e=>({isOnSubmit:!e||e===Zo.onSubmit,isOnBlur:e===Zo.onBlur,isOnChange:e===Zo.onChange,isOnAll:e===Zo.all,isOnTouch:e===Zo.onTouched});const Y4="AsyncFunction";var Uhe=e=>!!e&&!!e.validate&&!!(Jo(e.validate)&&e.validate.constructor.name===Y4||ms(e.validate)&&Object.values(e.validate).find(r=>r.constructor.name===Y4)),Khe=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Z4=(e,r,s)=>!s&&(r.watchAll||r.watch.has(e)||[...r.watch].some(o=>e.startsWith(o)&&/^\.\w+/.test(e.slice(o.length))));const Pb=(e,r,s,o)=>{for(const d of s||Object.keys(e)){const p=Et(e,d);if(p){const{_f:m,...g}=p;if(m){if(m.refs&&m.refs[0]&&r(m.refs[0],d)&&!o)return!0;if(m.ref&&r(m.ref,m.name)&&!o)return!0;if(Pb(g,r))break}else if(ms(g)&&Pb(g,r))break}}};function W4(e,r,s){const o=Et(e,s);if(o||FC(s))return{error:o,name:s};const d=s.split(".");for(;d.length;){const p=d.join("."),m=Et(r,p),g=Et(e,p);if(m&&!Array.isArray(m)&&s!==p)return{name:s};if(g&&g.type)return{name:p,error:g};if(g&&g.root&&g.root.type)return{name:`${p}.root`,error:g.root};d.pop()}return{name:s}}var Vhe=(e,r,s,o)=>{s(e);const{name:d,...p}=e;return Di(p)||Object.keys(p).length>=Object.keys(r).length||Object.keys(p).find(m=>r[m]===(!o||Zo.all))},Hhe=(e,r,s)=>!e||!r||e===r||Db(e).some(o=>o&&(s?o===r:o.startsWith(r)||r.startsWith(o))),Ghe=(e,r,s,o,d)=>d.isOnAll?!1:!s&&d.isOnTouch?!(r||e):(s?o.isOnBlur:d.isOnBlur)?!e:(s?o.isOnChange:d.isOnChange)?e:!0,Xhe=(e,r)=>!V2(Et(e,r)).length&&ps(e,r),Yhe=(e,r,s)=>{const o=Db(Et(e,s));return dr(o,"root",r[s]),dr(e,s,o),e};function J4(e,r,s="validate"){if($a(e)||Array.isArray(e)&&e.every($a)||Ta(e)&&!e)return{type:s,message:$a(e)?e:"",ref:r}}var Xm=e=>ms(e)&&!Jj(e)?e:{value:e,message:""},Q4=async(e,r,s,o,d,p)=>{const{ref:m,refs:g,required:b,maxLength:S,minLength:j,min:A,max:k,pattern:T,validate:M,name:I,valueAsNumber:q,mount:G}=e._f,K=Et(s,I);if(!G||r.has(I))return{};const X=g?g[0]:m,L=le=>{d&&X.reportValidity&&(X.setCustomValidity(Ta(le)?"":le||""),X.reportValidity())},ee={},oe=W2(m),Q=mw(m),ne=oe||Q,de=(q||Z2(m))&&Hr(m.value)&&Hr(K)||Wj(m)&&m.value===""||K===""||Array.isArray(K)&&!K.length,je=Y2.bind(null,I,o,ee),ve=(le,be,Ce,Ke=cu.maxLength,ce=cu.minLength)=>{const re=le?be:Ce;ee[I]={type:le?Ke:ce,message:re,ref:m,...je(le?Ke:ce,re)}};if(p?!Array.isArray(K)||!K.length:b&&(!ne&&(de||ua(K))||Ta(K)&&!K||Q&&!QF(g).isValid||oe&&!t6(g).isValid)){const{value:le,message:be}=$a(b)?{value:!!b,message:b}:Xm(b);if(le&&(ee[I]={type:cu.required,message:be,ref:X,...je(cu.required,be)},!o))return L(be),ee}if(!de&&(!ua(A)||!ua(k))){let le,be;const Ce=Xm(k),Ke=Xm(A);if(!ua(K)&&!isNaN(K)){const ce=m.valueAsNumber||K&&+K;ua(Ce.value)||(le=ce>Ce.value),ua(Ke.value)||(be=cenew Date(new Date().toDateString()+" "+fe),ue=m.type=="time",_e=m.type=="week";$a(Ce.value)&&K&&(le=ue?re(K)>re(Ce.value):_e?K>Ce.value:ce>new Date(Ce.value)),$a(Ke.value)&&K&&(be=ue?re(K)+le.value,Ke=!ua(be.value)&&K.length<+be.value;if((Ce||Ke)&&(ve(Ce,le.message,be.message),!o))return L(ee[I].message),ee}if(T&&!de&&$a(K)){const{value:le,message:be}=Xm(T);if(Jj(le)&&!K.match(le)&&(ee[I]={type:cu.pattern,message:be,ref:m,...je(cu.pattern,be)},!o))return L(be),ee}if(M){if(Jo(M)){const le=await M(K,s),be=J4(le,X);if(be&&(ee[I]={...be,...je(cu.validate,be.message)},!o))return L(be.message),ee}else if(ms(M)){let le={};for(const be in M){if(!Di(le)&&!o)break;const Ce=J4(await M[be](K,s),X,be);Ce&&(le={...Ce,...je(be,Ce.message)},L(Ce.message),o&&(ee[I]=le))}if(!Di(le)&&(ee[I]={ref:X,...le},!o))return ee}}return L(!0),ee};const Zhe={mode:Zo.onSubmit,reValidateMode:Zo.onChange,shouldFocusError:!0};function Whe(e={}){let r={...Zhe,...e},s={submitCount:0,isDirty:!1,isReady:!1,isLoading:Jo(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},o={},d=ms(r.defaultValues)||ms(r.values)?Es(r.defaultValues||r.values)||{}:{},p=r.shouldUnregister?{}:Es(d),m={action:!1,mount:!1,watch:!1},g={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},b,S=0;const j={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let A={...j};const k={array:U4(),state:U4()},T=r.criteriaMode===Zo.all,M=xe=>Ne=>{clearTimeout(S),S=setTimeout(xe,Ne)},I=async xe=>{if(!r.disabled&&(j.isValid||A.isValid||xe)){const Ne=r.resolver?Di((await Q()).errors):await de(o,!0);Ne!==s.isValid&&k.state.next({isValid:Ne})}},q=(xe,Ne)=>{!r.disabled&&(j.isValidating||j.validatingFields||A.isValidating||A.validatingFields)&&((xe||Array.from(g.mount)).forEach(Ge=>{Ge&&(Ne?dr(s.validatingFields,Ge,Ne):ps(s.validatingFields,Ge))}),k.state.next({validatingFields:s.validatingFields,isValidating:!Di(s.validatingFields)}))},G=(xe,Ne=[],Ge,D,z=!0,H=!0)=>{if(D&&Ge&&!r.disabled){if(m.action=!0,H&&Array.isArray(Et(o,xe))){const W=Ge(Et(o,xe),D.argA,D.argB);z&&dr(o,xe,W)}if(H&&Array.isArray(Et(s.errors,xe))){const W=Ge(Et(s.errors,xe),D.argA,D.argB);z&&dr(s.errors,xe,W),Xhe(s.errors,xe)}if((j.touchedFields||A.touchedFields)&&H&&Array.isArray(Et(s.touchedFields,xe))){const W=Ge(Et(s.touchedFields,xe),D.argA,D.argB);z&&dr(s.touchedFields,xe,W)}(j.dirtyFields||A.dirtyFields)&&(s.dirtyFields=Jm(d,p)),k.state.next({name:xe,isDirty:ve(xe,Ne),dirtyFields:s.dirtyFields,errors:s.errors,isValid:s.isValid})}else dr(p,xe,Ne)},K=(xe,Ne)=>{dr(s.errors,xe,Ne),k.state.next({errors:s.errors})},X=xe=>{s.errors=xe,k.state.next({errors:s.errors,isValid:!1})},L=(xe,Ne,Ge,D)=>{const z=Et(o,xe);if(z){const H=Et(p,xe,Hr(Ge)?Et(d,xe):Ge);Hr(H)||D&&D.defaultChecked||Ne?dr(p,xe,Ne?H:G4(z._f)):Ce(xe,H),m.mount&&!m.action&&I()}},ee=(xe,Ne,Ge,D,z)=>{let H=!1,W=!1;const we={name:xe};if(!r.disabled){if(!Ge||D){(j.isDirty||A.isDirty)&&(W=s.isDirty,s.isDirty=we.isDirty=ve(),H=W!==we.isDirty);const Re=Wo(Et(d,xe),Ne);W=!!Et(s.dirtyFields,xe),Re?ps(s.dirtyFields,xe):dr(s.dirtyFields,xe,!0),we.dirtyFields=s.dirtyFields,H=H||(j.dirtyFields||A.dirtyFields)&&W!==!Re}if(Ge){const Re=Et(s.touchedFields,xe);Re||(dr(s.touchedFields,xe,Ge),we.touchedFields=s.touchedFields,H=H||(j.touchedFields||A.touchedFields)&&Re!==Ge)}H&&z&&k.state.next(we)}return H?we:{}},oe=(xe,Ne,Ge,D)=>{const z=Et(s.errors,xe),H=(j.isValid||A.isValid)&&Ta(Ne)&&s.isValid!==Ne;if(r.delayError&&Ge?(b=M(()=>K(xe,Ge)),b(r.delayError)):(clearTimeout(S),b=null,Ge?dr(s.errors,xe,Ge):ps(s.errors,xe)),(Ge?!Wo(z,Ge):z)||!Di(D)||H){const W={...D,...H&&Ta(Ne)?{isValid:Ne}:{},errors:s.errors,name:xe};s={...s,...W},k.state.next(W)}},Q=async xe=>{q(xe,!0);const Ne=await r.resolver(p,r.context,Bhe(xe||g.mount,o,r.criteriaMode,r.shouldUseNativeValidation));return q(xe),Ne},ne=async xe=>{const{errors:Ne}=await Q(xe);if(xe)for(const Ge of xe){const D=Et(Ne,Ge);D?dr(s.errors,Ge,D):ps(s.errors,Ge)}else s.errors=Ne;return Ne},de=async(xe,Ne,Ge={valid:!0})=>{for(const D in xe){const z=xe[D];if(z){const{_f:H,...W}=z;if(H){const we=g.array.has(H.name),Re=z._f&&Uhe(z._f);Re&&j.validatingFields&&q([H.name],!0);const st=await Q4(z,g.disabled,p,T,r.shouldUseNativeValidation&&!Ne,we);if(Re&&j.validatingFields&&q([H.name]),st[H.name]&&(Ge.valid=!1,Ne))break;!Ne&&(Et(st,H.name)?we?Yhe(s.errors,st,H.name):dr(s.errors,H.name,st[H.name]):ps(s.errors,H.name))}!Di(W)&&await de(W,Ne,Ge)}}return Ge.valid},je=()=>{for(const xe of g.unMount){const Ne=Et(o,xe);Ne&&(Ne._f.refs?Ne._f.refs.every(Ge=>!pT(Ge)):!pT(Ne._f.ref))&&Le(xe)}g.unMount=new Set},ve=(xe,Ne)=>!r.disabled&&(xe&&Ne&&dr(p,xe,Ne),!Wo(fe(),d)),le=(xe,Ne,Ge)=>d_(xe,g,{...m.mount?p:Hr(Ne)?d:$a(xe)?{[xe]:Ne}:Ne},Ge,Ne),be=xe=>V2(Et(m.mount?p:d,xe,r.shouldUnregister?Et(d,xe,[]):[])),Ce=(xe,Ne,Ge={})=>{const D=Et(o,xe);let z=Ne;if(D){const H=D._f;H&&(!H.disabled&&dr(p,xe,e6(Ne,H)),z=Wj(H.ref)&&ua(Ne)?"":Ne,WF(H.ref)?[...H.ref.options].forEach(W=>W.selected=z.includes(W.value)):H.refs?mw(H.ref)?H.refs.forEach(W=>{(!W.defaultChecked||!W.disabled)&&(Array.isArray(z)?W.checked=!!z.find(we=>we===W.value):W.checked=z===W.value||!!z)}):H.refs.forEach(W=>W.checked=W.value===z):Z2(H.ref)?H.ref.value="":(H.ref.value=z,H.ref.type||k.state.next({name:xe,values:Es(p)})))}(Ge.shouldDirty||Ge.shouldTouch)&&ee(xe,z,Ge.shouldTouch,Ge.shouldDirty,!0),Ge.shouldValidate&&_e(xe)},Ke=(xe,Ne,Ge)=>{for(const D in Ne){if(!Ne.hasOwnProperty(D))return;const z=Ne[D],H=xe+"."+D,W=Et(o,H);(g.array.has(xe)||ms(z)||W&&!W._f)&&!wp(z)?Ke(H,z,Ge):Ce(H,z,Ge)}},ce=(xe,Ne,Ge={})=>{const D=Et(o,xe),z=g.array.has(xe),H=Es(Ne);dr(p,xe,H),z?(k.array.next({name:xe,values:Es(p)}),(j.isDirty||j.dirtyFields||A.isDirty||A.dirtyFields)&&Ge.shouldDirty&&k.state.next({name:xe,dirtyFields:Jm(d,p),isDirty:ve(xe,H)})):D&&!D._f&&!ua(H)?Ke(xe,H,Ge):Ce(xe,H,Ge),Z4(xe,g)&&k.state.next({...s,name:xe}),k.state.next({name:m.mount?xe:void 0,values:Es(p)})},re=async xe=>{m.mount=!0;const Ne=xe.target;let Ge=Ne.name,D=!0;const z=Et(o,Ge),H=Re=>{D=Number.isNaN(Re)||wp(Re)&&isNaN(Re.getTime())||Wo(Re,Et(p,Ge,Re))},W=X4(r.mode),we=X4(r.reValidateMode);if(z){let Re,st;const Kt=Ne.type?G4(z._f):HF(xe),Qt=xe.type===Zj.BLUR||xe.type===Zj.FOCUS_OUT,Fn=!Khe(z._f)&&!r.resolver&&!Et(s.errors,Ge)&&!z._f.deps||Ghe(Qt,Et(s.touchedFields,Ge),s.isSubmitted,we,W),dn=Z4(Ge,g,Qt);dr(p,Ge,Kt),Qt?(!Ne||!Ne.readOnly)&&(z._f.onBlur&&z._f.onBlur(xe),b&&b(0)):z._f.onChange&&z._f.onChange(xe);const Ht=ee(Ge,Kt,Qt),wi=!Di(Ht)||dn;if(!Qt&&k.state.next({name:Ge,type:xe.type,values:Es(p)}),Fn)return(j.isValid||A.isValid)&&(r.mode==="onBlur"?Qt&&I():Qt||I()),wi&&k.state.next({name:Ge,...dn?{}:Ht});if(!Qt&&dn&&k.state.next({...s}),r.resolver){const{errors:Xr}=await Q([Ge]);if(H(Kt),D){const fa=W4(s.errors,o,Ge),uo=W4(Xr,o,fa.name||Ge);Re=uo.error,Ge=uo.name,st=Di(Xr)}}else q([Ge],!0),Re=(await Q4(z,g.disabled,p,T,r.shouldUseNativeValidation))[Ge],q([Ge]),H(Kt),D&&(Re?st=!1:(j.isValid||A.isValid)&&(st=await de(o,!0)));D&&(z._f.deps&&(!Array.isArray(z._f.deps)||z._f.deps.length>0)&&_e(z._f.deps),oe(Ge,st,Re,Ht))}},ue=(xe,Ne)=>{if(Et(s.errors,Ne)&&xe.focus)return xe.focus(),1},_e=async(xe,Ne={})=>{let Ge,D;const z=Db(xe);if(r.resolver){const H=await ne(Hr(xe)?xe:z);Ge=Di(H),D=xe?!z.some(W=>Et(H,W)):Ge}else xe?(D=(await Promise.all(z.map(async H=>{const W=Et(o,H);return await de(W&&W._f?{[H]:W}:W)}))).every(Boolean),!(!D&&!s.isValid)&&I()):D=Ge=await de(o);return k.state.next({...!$a(xe)||(j.isValid||A.isValid)&&Ge!==s.isValid?{}:{name:xe},...r.resolver||!xe?{isValid:Ge}:{},errors:s.errors}),Ne.shouldFocus&&!D&&Pb(o,ue,xe?z:g.mount),D},fe=(xe,Ne)=>{let Ge={...m.mount?p:d};return Ne&&(Ge=ZF(Ne.dirtyFields?s.dirtyFields:s.touchedFields,Ge)),Hr(xe)?Ge:$a(xe)?Et(Ge,xe):xe.map(D=>Et(Ge,D))},He=(xe,Ne)=>({invalid:!!Et((Ne||s).errors,xe),isDirty:!!Et((Ne||s).dirtyFields,xe),error:Et((Ne||s).errors,xe),isValidating:!!Et(s.validatingFields,xe),isTouched:!!Et((Ne||s).touchedFields,xe)}),Oe=xe=>{xe&&Db(xe).forEach(Ne=>ps(s.errors,Ne)),k.state.next({errors:xe?s.errors:{}})},ke=(xe,Ne,Ge)=>{const D=(Et(o,xe,{_f:{}})._f||{}).ref,z=Et(s.errors,xe)||{},{ref:H,message:W,type:we,...Re}=z;dr(s.errors,xe,{...Re,...Ne,ref:D}),k.state.next({name:xe,errors:s.errors,isValid:!1}),Ge&&Ge.shouldFocus&&D&&D.focus&&D.focus()},Ve=(xe,Ne)=>Jo(xe)?k.state.subscribe({next:Ge=>"values"in Ge&&xe(le(void 0,Ne),Ge)}):le(xe,Ne,!0),ie=xe=>k.state.subscribe({next:Ne=>{Hhe(xe.name,Ne.name,xe.exact)&&Vhe(Ne,xe.formState||j,V,xe.reRenderRoot)&&xe.callback({values:{...p},...s,...Ne,defaultValues:d})}}).unsubscribe,De=xe=>(m.mount=!0,A={...A,...xe.formState},ie({...xe,formState:A})),Le=(xe,Ne={})=>{for(const Ge of xe?Db(xe):g.mount)g.mount.delete(Ge),g.array.delete(Ge),Ne.keepValue||(ps(o,Ge),ps(p,Ge)),!Ne.keepError&&ps(s.errors,Ge),!Ne.keepDirty&&ps(s.dirtyFields,Ge),!Ne.keepTouched&&ps(s.touchedFields,Ge),!Ne.keepIsValidating&&ps(s.validatingFields,Ge),!r.shouldUnregister&&!Ne.keepDefaultValue&&ps(d,Ge);k.state.next({values:Es(p)}),k.state.next({...s,...Ne.keepDirty?{isDirty:ve()}:{}}),!Ne.keepIsValid&&I()},tt=({disabled:xe,name:Ne})=>{(Ta(xe)&&m.mount||xe||g.disabled.has(Ne))&&(xe?g.disabled.add(Ne):g.disabled.delete(Ne))},ft=(xe,Ne={})=>{let Ge=Et(o,xe);const D=Ta(Ne.disabled)||Ta(r.disabled);return dr(o,xe,{...Ge||{},_f:{...Ge&&Ge._f?Ge._f:{ref:{name:xe}},name:xe,mount:!0,...Ne}}),g.mount.add(xe),Ge?tt({disabled:Ta(Ne.disabled)?Ne.disabled:r.disabled,name:xe}):L(xe,!0,Ne.value),{...D?{disabled:Ne.disabled||r.disabled}:{},...r.progressive?{required:!!Ne.required,min:lb(Ne.min),max:lb(Ne.max),minLength:lb(Ne.minLength),maxLength:lb(Ne.maxLength),pattern:lb(Ne.pattern)}:{},name:xe,onChange:re,onBlur:re,ref:z=>{if(z){ft(xe,Ne),Ge=Et(o,xe);const H=Hr(z.value)&&z.querySelectorAll&&z.querySelectorAll("input,select,textarea")[0]||z,W=Lhe(H),we=Ge._f.refs||[];if(W?we.find(Re=>Re===H):H===Ge._f.ref)return;dr(o,xe,{_f:{...Ge._f,...W?{refs:[...we.filter(pT),H,...Array.isArray(Et(d,xe))?[{}]:[]],ref:{type:H.type,name:xe}}:{ref:H}}}),L(xe,!1,void 0,H)}else Ge=Et(o,xe,{}),Ge._f&&(Ge._f.mount=!1),(r.shouldUnregister||Ne.shouldUnregister)&&!(GF(g.array,xe)&&m.action)&&g.unMount.add(xe)}}},Ot=()=>r.shouldFocusError&&Pb(o,ue,g.mount),Ft=xe=>{Ta(xe)&&(k.state.next({disabled:xe}),Pb(o,(Ne,Ge)=>{const D=Et(o,Ge);D&&(Ne.disabled=D._f.disabled||xe,Array.isArray(D._f.refs)&&D._f.refs.forEach(z=>{z.disabled=D._f.disabled||xe}))},0,!1))},kt=(xe,Ne)=>async Ge=>{let D;Ge&&(Ge.preventDefault&&Ge.preventDefault(),Ge.persist&&Ge.persist());let z=Es(p);if(k.state.next({isSubmitting:!0}),r.resolver){const{errors:H,values:W}=await Q();s.errors=H,z=Es(W)}else await de(o);if(g.disabled.size)for(const H of g.disabled)ps(z,H);if(ps(s.errors,"root"),Di(s.errors)){k.state.next({errors:{}});try{await xe(z,Ge)}catch(H){D=H}}else Ne&&await Ne({...s.errors},Ge),Ot(),setTimeout(Ot);if(k.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Di(s.errors)&&!D,submitCount:s.submitCount+1,errors:s.errors}),D)throw D},Jt=(xe,Ne={})=>{Et(o,xe)&&(Hr(Ne.defaultValue)?ce(xe,Es(Et(d,xe))):(ce(xe,Ne.defaultValue),dr(d,xe,Es(Ne.defaultValue))),Ne.keepTouched||ps(s.touchedFields,xe),Ne.keepDirty||(ps(s.dirtyFields,xe),s.isDirty=Ne.defaultValue?ve(xe,Es(Et(d,xe))):ve()),Ne.keepError||(ps(s.errors,xe),j.isValid&&I()),k.state.next({...s}))},ze=(xe,Ne={})=>{const Ge=xe?Es(xe):d,D=Es(Ge),z=Di(xe),H=z?d:D;if(Ne.keepDefaultValues||(d=Ge),!Ne.keepValues){if(Ne.keepDirtyValues){const W=new Set([...g.mount,...Object.keys(Jm(d,p))]);for(const we of Array.from(W))Et(s.dirtyFields,we)?dr(H,we,Et(p,we)):ce(we,Et(H,we))}else{if(K2&&Hr(xe))for(const W of g.mount){const we=Et(o,W);if(we&&we._f){const Re=Array.isArray(we._f.refs)?we._f.refs[0]:we._f.ref;if(Wj(Re)){const st=Re.closest("form");if(st){st.reset();break}}}}if(Ne.keepFieldsRef)for(const W of g.mount)ce(W,Et(H,W));else o={}}p=r.shouldUnregister?Ne.keepDefaultValues?Es(d):{}:Es(H),k.array.next({values:{...H}}),k.state.next({values:{...H}})}g={mount:Ne.keepDirtyValues?g.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},m.mount=!j.isValid||!!Ne.keepIsValid||!!Ne.keepDirtyValues||!r.shouldUnregister&&!Di(H),m.watch=!!r.shouldUnregister,m.action=!1,Ne.keepErrors||(s.errors={}),k.state.next({submitCount:Ne.keepSubmitCount?s.submitCount:0,isDirty:z?!1:Ne.keepDirty?s.isDirty:!!(Ne.keepDefaultValues&&!Wo(xe,d)),isSubmitted:Ne.keepIsSubmitted?s.isSubmitted:!1,dirtyFields:z?{}:Ne.keepDirtyValues?Ne.keepDefaultValues&&p?Jm(d,p):s.dirtyFields:Ne.keepDefaultValues&&xe?Jm(d,xe):Ne.keepDirty?s.dirtyFields:{},touchedFields:Ne.keepTouched?s.touchedFields:{},errors:Ne.keepErrors?s.errors:{},isSubmitSuccessful:Ne.keepIsSubmitSuccessful?s.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:d})},zt=(xe,Ne)=>ze(Jo(xe)?xe(p):xe,Ne),Rt=(xe,Ne={})=>{const Ge=Et(o,xe),D=Ge&&Ge._f;if(D){const z=D.refs?D.refs[0]:D.ref;z.focus&&(z.focus(),Ne.shouldSelect&&Jo(z.select)&&z.select())}},V=xe=>{s={...s,...xe}},cn={control:{register:ft,unregister:Le,getFieldState:He,handleSubmit:kt,setError:ke,_subscribe:ie,_runSchema:Q,_focusError:Ot,_getWatch:le,_getDirty:ve,_setValid:I,_setFieldArray:G,_setDisabledField:tt,_setErrors:X,_getFieldArray:be,_reset:ze,_resetDefaultValues:()=>Jo(r.defaultValues)&&r.defaultValues().then(xe=>{zt(xe,r.resetOptions),k.state.next({isLoading:!1})}),_removeUnmounted:je,_disableForm:Ft,_subjects:k,_proxyFormState:j,get _fields(){return o},get _formValues(){return p},get _state(){return m},set _state(xe){m=xe},get _defaultValues(){return d},get _names(){return g},set _names(xe){g=xe},get _formState(){return s},get _options(){return r},set _options(xe){r={...r,...xe}}},subscribe:De,trigger:_e,register:ft,handleSubmit:kt,watch:Ve,setValue:ce,getValues:fe,reset:zt,resetField:Jt,clearErrors:Oe,unregister:Le,setError:ke,setFocus:Rt,getFieldState:He};return{...cn,formControl:cn}}function mr(e={}){const r=Je.useRef(void 0),s=Je.useRef(void 0),[o,d]=Je.useState({isDirty:!1,isValidating:!1,isLoading:Jo(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Jo(e.defaultValues)?void 0:e.defaultValues});if(!r.current)if(e.formControl)r.current={...e.formControl,formState:o},e.defaultValues&&!Jo(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:m,...g}=Whe(e);r.current={...g,formState:o}}const p=r.current.control;return p._options=e,X2(()=>{const m=p._subscribe({formState:p._proxyFormState,callback:()=>d({...p._formState}),reRenderRoot:!0});return d(g=>({...g,isReady:!0})),p._formState.isReady=!0,m},[p]),Je.useEffect(()=>p._disableForm(e.disabled),[p,e.disabled]),Je.useEffect(()=>{e.mode&&(p._options.mode=e.mode),e.reValidateMode&&(p._options.reValidateMode=e.reValidateMode)},[p,e.mode,e.reValidateMode]),Je.useEffect(()=>{e.errors&&(p._setErrors(e.errors),p._focusError())},[p,e.errors]),Je.useEffect(()=>{e.shouldUnregister&&p._subjects.state.next({values:p._getWatch()})},[p,e.shouldUnregister]),Je.useEffect(()=>{if(p._proxyFormState.isDirty){const m=p._getDirty();m!==o.isDirty&&p._subjects.state.next({isDirty:m})}},[p,o.isDirty]),Je.useEffect(()=>{var m;e.values&&!Wo(e.values,s.current)?(p._reset(e.values,{keepFieldsRef:!0,...p._options.resetOptions}),!((m=p._options.resetOptions)===null||m===void 0)&&m.keepIsValid||p._setValid(),s.current=e.values,d(g=>({...g}))):p._resetDefaultValues()},[p,e.values]),Je.useEffect(()=>{p._state.mount||(p._setValid(),p._state.mount=!0),p._state.watch&&(p._state.watch=!1,p._subjects.state.next({...p._formState})),p._removeUnmounted()}),r.current.formState=XF(o,p),r.current}const e3=(e,r,s)=>{if(e&&"reportValidity"in e){const o=Et(s,r);e.setCustomValidity(o&&o.message||""),e.reportValidity()}},f_=(e,r)=>{for(const s in r.fields){const o=r.fields[s];o&&o.ref&&"reportValidity"in o.ref?e3(o.ref,s,e):o&&o.refs&&o.refs.forEach(d=>e3(d,s,e))}},t3=(e,r)=>{r.shouldUseNativeValidation&&f_(e,r);const s={};for(const o in e){const d=Et(r.fields,o),p=Object.assign(e[o]||{},{ref:d&&d.ref});if(Jhe(r.names||Object.keys(e),o)){const m=Object.assign({},Et(s,o));dr(m,"root",p),dr(s,o,m)}else dr(s,o,p)}return s},Jhe=(e,r)=>{const s=n3(r);return e.some(o=>n3(o).match(`^${s}\\.\\d+`))};function n3(e){return e.replace(/\]|\[/g,"")}function at(e,r,s){function o(g,b){if(g._zod||Object.defineProperty(g,"_zod",{value:{def:b,constr:m,traits:new Set},enumerable:!1}),g._zod.traits.has(e))return;g._zod.traits.add(e),r(g,b);const S=m.prototype,j=Object.keys(S);for(let A=0;As?.Parent&&g instanceof s.Parent?!0:g?._zod?.traits?.has(e)}),Object.defineProperty(m,"name",{value:e}),m}class gg extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class n6 extends Error{constructor(r){super(`Encountered unidirectional transform during encode: ${r}`),this.name="ZodEncodeError"}}const r6={};function Tp(e){return r6}function Qhe(e){const r=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,d])=>r.indexOf(+o)===-1).map(([o,d])=>d)}function m_(e,r){return typeof r=="bigint"?r.toString():r}function J2(e){return{get value(){{const r=e();return Object.defineProperty(this,"value",{value:r}),r}}}}function Q2(e){return e==null}function e$(e){const r=e.startsWith("^")?1:0,s=e.endsWith("$")?e.length-1:e.length;return e.slice(r,s)}function epe(e,r){const s=(e.toString().split(".")[1]||"").length,o=r.toString();let d=(o.split(".")[1]||"").length;if(d===0&&/\d?e-\d?/.test(o)){const b=o.match(/\d?e-(\d?)/);b?.[1]&&(d=Number.parseInt(b[1]))}const p=s>d?s:d,m=Number.parseInt(e.toFixed(p).replace(".","")),g=Number.parseInt(r.toFixed(p).replace(".",""));return m%g/10**p}const r3=Symbol("evaluating");function Sr(e,r,s){let o;Object.defineProperty(e,r,{get(){if(o!==r3)return o===void 0&&(o=r3,o=s()),o},set(d){Object.defineProperty(e,r,{value:d})},configurable:!0})}function Dp(e,r,s){Object.defineProperty(e,r,{value:s,writable:!0,enumerable:!0,configurable:!0})}function Pp(...e){const r={};for(const s of e){const o=Object.getOwnPropertyDescriptors(s);Object.assign(r,o)}return Object.defineProperties({},r)}function s3(e){return JSON.stringify(e)}function tpe(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const s6="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Qj(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const npe=J2(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Gb(e){if(Qj(e)===!1)return!1;const r=e.constructor;if(r===void 0||typeof r!="function")return!0;const s=r.prototype;return!(Qj(s)===!1||Object.prototype.hasOwnProperty.call(s,"isPrototypeOf")===!1)}function i6(e){return Gb(e)?{...e}:Array.isArray(e)?[...e]:e}const rpe=new Set(["string","number","symbol"]);function Eg(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Zd(e,r,s){const o=new e._zod.constr(r??e._zod.def);return(!r||s?.parent)&&(o._zod.parent=e),o}function Yt(e){const r=e;if(!r)return{};if(typeof r=="string")return{error:()=>r};if(r?.message!==void 0){if(r?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");r.error=r.message}return delete r.message,typeof r.error=="string"?{...r,error:()=>r.error}:r}function spe(e){return Object.keys(e).filter(r=>e[r]._zod.optin==="optional"&&e[r]._zod.optout==="optional")}const ipe={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function ape(e,r){const s=e._zod.def,o=Pp(e._zod.def,{get shape(){const d={};for(const p in r){if(!(p in s.shape))throw new Error(`Unrecognized key: "${p}"`);r[p]&&(d[p]=s.shape[p])}return Dp(this,"shape",d),d},checks:[]});return Zd(e,o)}function ope(e,r){const s=e._zod.def,o=Pp(e._zod.def,{get shape(){const d={...e._zod.def.shape};for(const p in r){if(!(p in s.shape))throw new Error(`Unrecognized key: "${p}"`);r[p]&&delete d[p]}return Dp(this,"shape",d),d},checks:[]});return Zd(e,o)}function lpe(e,r){if(!Gb(r))throw new Error("Invalid input to extend: expected a plain object");const s=e._zod.def.checks;if(s&&s.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const d=Pp(e._zod.def,{get shape(){const p={...e._zod.def.shape,...r};return Dp(this,"shape",p),p},checks:[]});return Zd(e,d)}function cpe(e,r){if(!Gb(r))throw new Error("Invalid input to safeExtend: expected a plain object");const s={...e._zod.def,get shape(){const o={...e._zod.def.shape,...r};return Dp(this,"shape",o),o},checks:e._zod.def.checks};return Zd(e,s)}function upe(e,r){const s=Pp(e._zod.def,{get shape(){const o={...e._zod.def.shape,...r._zod.def.shape};return Dp(this,"shape",o),o},get catchall(){return r._zod.def.catchall},checks:[]});return Zd(e,s)}function dpe(e,r,s){const o=Pp(r._zod.def,{get shape(){const d=r._zod.def.shape,p={...d};if(s)for(const m in s){if(!(m in d))throw new Error(`Unrecognized key: "${m}"`);s[m]&&(p[m]=e?new e({type:"optional",innerType:d[m]}):d[m])}else for(const m in d)p[m]=e?new e({type:"optional",innerType:d[m]}):d[m];return Dp(this,"shape",p),p},checks:[]});return Zd(r,o)}function hpe(e,r,s){const o=Pp(r._zod.def,{get shape(){const d=r._zod.def.shape,p={...d};if(s)for(const m in s){if(!(m in p))throw new Error(`Unrecognized key: "${m}"`);s[m]&&(p[m]=new e({type:"nonoptional",innerType:d[m]}))}else for(const m in d)p[m]=new e({type:"nonoptional",innerType:d[m]});return Dp(this,"shape",p),p},checks:[]});return Zd(r,o)}function dg(e,r=0){if(e.aborted===!0)return!0;for(let s=r;s{var o;return(o=s).path??(o.path=[]),s.path.unshift(e),s})}function oj(e){return typeof e=="string"?e:e?.message}function _p(e,r,s){const o={...e,path:e.path??[]};if(!e.message){const d=oj(e.inst?._zod.def?.error?.(e))??oj(r?.error?.(e))??oj(s.customError?.(e))??oj(s.localeError?.(e))??"Invalid input";o.message=d}return delete o.inst,delete o.continue,r?.reportInput||delete o.input,o}function t$(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Xb(...e){const[r,s,o]=e;return typeof r=="string"?{message:r,code:"custom",input:s,inst:o}:{...r}}const o6=(e,r)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:r,enumerable:!1}),e.message=JSON.stringify(r,m_,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},n$=at("$ZodError",o6),BC=at("$ZodError",o6,{Parent:Error});function ppe(e,r=s=>s.message){const s={},o=[];for(const d of e.issues)d.path.length>0?(s[d.path[0]]=s[d.path[0]]||[],s[d.path[0]].push(r(d))):o.push(r(d));return{formErrors:o,fieldErrors:s}}function fpe(e,r=s=>s.message){const s={_errors:[]},o=d=>{for(const p of d.issues)if(p.code==="invalid_union"&&p.errors.length)p.errors.map(m=>o({issues:m}));else if(p.code==="invalid_key")o({issues:p.issues});else if(p.code==="invalid_element")o({issues:p.issues});else if(p.path.length===0)s._errors.push(r(p));else{let m=s,g=0;for(;g(r,s,o,d)=>{const p=o?Object.assign(o,{async:!1}):{async:!1},m=r._zod.run({value:s,issues:[]},p);if(m instanceof Promise)throw new gg;if(m.issues.length){const g=new(d?.Err??e)(m.issues.map(b=>_p(b,p,Tp())));throw s6(g,d?.callee),g}return m.value},mpe=UC(BC),KC=e=>async(r,s,o,d)=>{const p=o?Object.assign(o,{async:!0}):{async:!0};let m=r._zod.run({value:s,issues:[]},p);if(m instanceof Promise&&(m=await m),m.issues.length){const g=new(d?.Err??e)(m.issues.map(b=>_p(b,p,Tp())));throw s6(g,d?.callee),g}return m.value},gpe=KC(BC),VC=e=>(r,s,o)=>{const d=o?{...o,async:!1}:{async:!1},p=r._zod.run({value:s,issues:[]},d);if(p instanceof Promise)throw new gg;return p.issues.length?{success:!1,error:new(e??n$)(p.issues.map(m=>_p(m,d,Tp())))}:{success:!0,data:p.value}},ype=VC(BC),HC=e=>async(r,s,o)=>{const d=o?Object.assign(o,{async:!0}):{async:!0};let p=r._zod.run({value:s,issues:[]},d);return p instanceof Promise&&(p=await p),p.issues.length?{success:!1,error:new e(p.issues.map(m=>_p(m,d,Tp())))}:{success:!0,data:p.value}},vpe=HC(BC),xpe=e=>(r,s,o)=>{const d=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return UC(e)(r,s,d)},bpe=e=>(r,s,o)=>UC(e)(r,s,o),wpe=e=>async(r,s,o)=>{const d=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return KC(e)(r,s,d)},Spe=e=>async(r,s,o)=>KC(e)(r,s,o),Epe=e=>(r,s,o)=>{const d=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return VC(e)(r,s,d)},jpe=e=>(r,s,o)=>VC(e)(r,s,o),Cpe=e=>async(r,s,o)=>{const d=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return HC(e)(r,s,d)},Ape=e=>async(r,s,o)=>HC(e)(r,s,o),Ope=/^[cC][^\s-]{8,}$/,kpe=/^[0-9a-z]+$/,Rpe=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Tpe=/^[0-9a-vA-V]{20}$/,_pe=/^[A-Za-z0-9]{27}$/,$pe=/^[a-zA-Z0-9_-]{21}$/,Npe=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Dpe=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,i3=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Ppe=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Mpe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ipe(){return new RegExp(Mpe,"u")}const Lpe=/^(?:(?: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])$/,zpe=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Fpe=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,qpe=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Bpe=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,l6=/^[A-Za-z0-9_-]*$/,Upe=/^\+(?:[0-9]){6,14}[0-9]$/,c6="(?:(?:\\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])))",Kpe=new RegExp(`^${c6}$`);function u6(e){const r="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${r}`:e.precision===0?`${r}:[0-5]\\d`:`${r}:[0-5]\\d\\.\\d{${e.precision}}`:`${r}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Vpe(e){return new RegExp(`^${u6(e)}$`)}function Hpe(e){const r=u6({precision:e.precision}),s=["Z"];e.local&&s.push(""),e.offset&&s.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const o=`${r}(?:${s.join("|")})`;return new RegExp(`^${c6}T(?:${o})$`)}const Gpe=e=>{const r=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${r}$`)},Xpe=/^-?\d+$/,Ype=/^-?\d+(?:\.\d+)?/,Zpe=/^[^A-Z]*$/,Wpe=/^[^a-z]*$/,pa=at("$ZodCheck",(e,r)=>{var s;e._zod??(e._zod={}),e._zod.def=r,(s=e._zod).onattach??(s.onattach=[])}),d6={number:"number",bigint:"bigint",object:"date"},h6=at("$ZodCheckLessThan",(e,r)=>{pa.init(e,r);const s=d6[typeof r.value];e._zod.onattach.push(o=>{const d=o._zod.bag,p=(r.inclusive?d.maximum:d.exclusiveMaximum)??Number.POSITIVE_INFINITY;r.value{(r.inclusive?o.value<=r.value:o.value{pa.init(e,r);const s=d6[typeof r.value];e._zod.onattach.push(o=>{const d=o._zod.bag,p=(r.inclusive?d.minimum:d.exclusiveMinimum)??Number.NEGATIVE_INFINITY;r.value>p&&(r.inclusive?d.minimum=r.value:d.exclusiveMinimum=r.value)}),e._zod.check=o=>{(r.inclusive?o.value>=r.value:o.value>r.value)||o.issues.push({origin:s,code:"too_small",minimum:r.value,input:o.value,inclusive:r.inclusive,inst:e,continue:!r.abort})}}),Jpe=at("$ZodCheckMultipleOf",(e,r)=>{pa.init(e,r),e._zod.onattach.push(s=>{var o;(o=s._zod.bag).multipleOf??(o.multipleOf=r.value)}),e._zod.check=s=>{if(typeof s.value!=typeof r.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof s.value=="bigint"?s.value%r.value===BigInt(0):epe(s.value,r.value)===0)||s.issues.push({origin:typeof s.value,code:"not_multiple_of",divisor:r.value,input:s.value,inst:e,continue:!r.abort})}}),Qpe=at("$ZodCheckNumberFormat",(e,r)=>{pa.init(e,r),r.format=r.format||"float64";const s=r.format?.includes("int"),o=s?"int":"number",[d,p]=ipe[r.format];e._zod.onattach.push(m=>{const g=m._zod.bag;g.format=r.format,g.minimum=d,g.maximum=p,s&&(g.pattern=Xpe)}),e._zod.check=m=>{const g=m.value;if(s){if(!Number.isInteger(g)){m.issues.push({expected:o,format:r.format,code:"invalid_type",continue:!1,input:g,inst:e});return}if(!Number.isSafeInteger(g)){g>0?m.issues.push({input:g,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!r.abort}):m.issues.push({input:g,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!r.abort});return}}gp&&m.issues.push({origin:"number",input:g,code:"too_big",maximum:p,inst:e})}}),efe=at("$ZodCheckMaxLength",(e,r)=>{var s;pa.init(e,r),(s=e._zod.def).when??(s.when=o=>{const d=o.value;return!Q2(d)&&d.length!==void 0}),e._zod.onattach.push(o=>{const d=o._zod.bag.maximum??Number.POSITIVE_INFINITY;r.maximum{const d=o.value;if(d.length<=r.maximum)return;const m=t$(d);o.issues.push({origin:m,code:"too_big",maximum:r.maximum,inclusive:!0,input:d,inst:e,continue:!r.abort})}}),tfe=at("$ZodCheckMinLength",(e,r)=>{var s;pa.init(e,r),(s=e._zod.def).when??(s.when=o=>{const d=o.value;return!Q2(d)&&d.length!==void 0}),e._zod.onattach.push(o=>{const d=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;r.minimum>d&&(o._zod.bag.minimum=r.minimum)}),e._zod.check=o=>{const d=o.value;if(d.length>=r.minimum)return;const m=t$(d);o.issues.push({origin:m,code:"too_small",minimum:r.minimum,inclusive:!0,input:d,inst:e,continue:!r.abort})}}),nfe=at("$ZodCheckLengthEquals",(e,r)=>{var s;pa.init(e,r),(s=e._zod.def).when??(s.when=o=>{const d=o.value;return!Q2(d)&&d.length!==void 0}),e._zod.onattach.push(o=>{const d=o._zod.bag;d.minimum=r.length,d.maximum=r.length,d.length=r.length}),e._zod.check=o=>{const d=o.value,p=d.length;if(p===r.length)return;const m=t$(d),g=p>r.length;o.issues.push({origin:m,...g?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!r.abort})}}),GC=at("$ZodCheckStringFormat",(e,r)=>{var s,o;pa.init(e,r),e._zod.onattach.push(d=>{const p=d._zod.bag;p.format=r.format,r.pattern&&(p.patterns??(p.patterns=new Set),p.patterns.add(r.pattern))}),r.pattern?(s=e._zod).check??(s.check=d=>{r.pattern.lastIndex=0,!r.pattern.test(d.value)&&d.issues.push({origin:"string",code:"invalid_format",format:r.format,input:d.value,...r.pattern?{pattern:r.pattern.toString()}:{},inst:e,continue:!r.abort})}):(o=e._zod).check??(o.check=()=>{})}),rfe=at("$ZodCheckRegex",(e,r)=>{GC.init(e,r),e._zod.check=s=>{r.pattern.lastIndex=0,!r.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:"regex",input:s.value,pattern:r.pattern.toString(),inst:e,continue:!r.abort})}}),sfe=at("$ZodCheckLowerCase",(e,r)=>{r.pattern??(r.pattern=Zpe),GC.init(e,r)}),ife=at("$ZodCheckUpperCase",(e,r)=>{r.pattern??(r.pattern=Wpe),GC.init(e,r)}),afe=at("$ZodCheckIncludes",(e,r)=>{pa.init(e,r);const s=Eg(r.includes),o=new RegExp(typeof r.position=="number"?`^.{${r.position}}${s}`:s);r.pattern=o,e._zod.onattach.push(d=>{const p=d._zod.bag;p.patterns??(p.patterns=new Set),p.patterns.add(o)}),e._zod.check=d=>{d.value.includes(r.includes,r.position)||d.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:r.includes,input:d.value,inst:e,continue:!r.abort})}}),ofe=at("$ZodCheckStartsWith",(e,r)=>{pa.init(e,r);const s=new RegExp(`^${Eg(r.prefix)}.*`);r.pattern??(r.pattern=s),e._zod.onattach.push(o=>{const d=o._zod.bag;d.patterns??(d.patterns=new Set),d.patterns.add(s)}),e._zod.check=o=>{o.value.startsWith(r.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:r.prefix,input:o.value,inst:e,continue:!r.abort})}}),lfe=at("$ZodCheckEndsWith",(e,r)=>{pa.init(e,r);const s=new RegExp(`.*${Eg(r.suffix)}$`);r.pattern??(r.pattern=s),e._zod.onattach.push(o=>{const d=o._zod.bag;d.patterns??(d.patterns=new Set),d.patterns.add(s)}),e._zod.check=o=>{o.value.endsWith(r.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:r.suffix,input:o.value,inst:e,continue:!r.abort})}}),cfe=at("$ZodCheckOverwrite",(e,r)=>{pa.init(e,r),e._zod.check=s=>{s.value=r.tx(s.value)}});class ufe{constructor(r=[]){this.content=[],this.indent=0,this&&(this.args=r)}indented(r){this.indent+=1,r(this),this.indent-=1}write(r){if(typeof r=="function"){r(this,{execution:"sync"}),r(this,{execution:"async"});return}const o=r.split(` `).filter(m=>m),d=Math.min(...o.map(m=>m.length-m.trimStart().length)),p=o.map(m=>m.slice(d)).map(m=>" ".repeat(this.indent*2)+m);for(const m of p)this.content.push(m)}compile(){const r=Function,s=this?.args,d=[...(this?.content??[""]).map(p=>` ${p}`)];return new r(...s,d.join(` -`))}}const ufe={major:4,minor:1,patch:12},Gr=at("$ZodType",(e,r)=>{var s;e??(e={}),e._zod.def=r,e._zod.bag=e._zod.bag||{},e._zod.version=ufe;const o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(const d of o)for(const p of d._zod.onattach)p(e);if(o.length===0)(s=e._zod).deferred??(s.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const d=(m,g,b)=>{let S=dg(m),E;for(const A of g){if(A._zod.def.when){if(!A._zod.def.when(m))continue}else if(S)continue;const k=m.issues.length,T=A._zod.check(m);if(T instanceof Promise&&b?.async===!1)throw new gg;if(E||T instanceof Promise)E=(E??Promise.resolve()).then(async()=>{await T,m.issues.length!==k&&(S||(S=dg(m,k)))});else{if(m.issues.length===k)continue;S||(S=dg(m,k))}}return E?E.then(()=>m):m},p=(m,g,b)=>{if(dg(m))return m.aborted=!0,m;const S=d(g,o,b);if(S instanceof Promise){if(b.async===!1)throw new gg;return S.then(E=>e._zod.parse(E,b))}return e._zod.parse(S,b)};e._zod.run=(m,g)=>{if(g.skipChecks)return e._zod.parse(m,g);if(g.direction==="backward"){const S=e._zod.parse({value:m.value,issues:[]},{...g,skipChecks:!0});return S instanceof Promise?S.then(E=>p(E,m,g)):p(S,m,g)}const b=e._zod.parse(m,g);if(b instanceof Promise){if(g.async===!1)throw new gg;return b.then(S=>d(S,o,g))}return d(b,o,g)}}e["~standard"]={validate:d=>{try{const p=mpe(e,d);return p.success?{value:p.data}:{issues:p.error?.issues}}catch{return gpe(e,d).then(m=>m.success?{value:m.data}:{issues:m.error?.issues})}},vendor:"zod",version:1}}),n$=at("$ZodString",(e,r)=>{Gr.init(e,r),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Hpe(e._zod.bag),e._zod.parse=(s,o)=>{if(r.coerce)try{s.value=String(s.value)}catch{}return typeof s.value=="string"||s.issues.push({expected:"string",code:"invalid_type",input:s.value,inst:e}),s}}),$r=at("$ZodStringFormat",(e,r)=>{GC.init(e,r),n$.init(e,r)}),dfe=at("$ZodGUID",(e,r)=>{r.pattern??(r.pattern=$pe),$r.init(e,r)}),hfe=at("$ZodUUID",(e,r)=>{if(r.version){const o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[r.version];if(o===void 0)throw new Error(`Invalid UUID version: "${r.version}"`);r.pattern??(r.pattern=s3(o))}else r.pattern??(r.pattern=s3());$r.init(e,r)}),pfe=at("$ZodEmail",(e,r)=>{r.pattern??(r.pattern=Npe),$r.init(e,r)}),ffe=at("$ZodURL",(e,r)=>{$r.init(e,r),e._zod.check=s=>{try{const o=s.value.trim(),d=new URL(o);r.hostname&&(r.hostname.lastIndex=0,r.hostname.test(d.hostname)||s.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:qpe.source,input:s.value,inst:e,continue:!r.abort})),r.protocol&&(r.protocol.lastIndex=0,r.protocol.test(d.protocol.endsWith(":")?d.protocol.slice(0,-1):d.protocol)||s.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:r.protocol.source,input:s.value,inst:e,continue:!r.abort})),r.normalize?s.value=d.href:s.value=o;return}catch{s.issues.push({code:"invalid_format",format:"url",input:s.value,inst:e,continue:!r.abort})}}}),mfe=at("$ZodEmoji",(e,r)=>{r.pattern??(r.pattern=Ppe()),$r.init(e,r)}),gfe=at("$ZodNanoID",(e,r)=>{r.pattern??(r.pattern=Tpe),$r.init(e,r)}),yfe=at("$ZodCUID",(e,r)=>{r.pattern??(r.pattern=Cpe),$r.init(e,r)}),vfe=at("$ZodCUID2",(e,r)=>{r.pattern??(r.pattern=Ape),$r.init(e,r)}),xfe=at("$ZodULID",(e,r)=>{r.pattern??(r.pattern=Ope),$r.init(e,r)}),bfe=at("$ZodXID",(e,r)=>{r.pattern??(r.pattern=kpe),$r.init(e,r)}),wfe=at("$ZodKSUID",(e,r)=>{r.pattern??(r.pattern=Rpe),$r.init(e,r)}),Sfe=at("$ZodISODateTime",(e,r)=>{r.pattern??(r.pattern=Vpe(r)),$r.init(e,r)}),Efe=at("$ZodISODate",(e,r)=>{r.pattern??(r.pattern=Upe),$r.init(e,r)}),jfe=at("$ZodISOTime",(e,r)=>{r.pattern??(r.pattern=Kpe(r)),$r.init(e,r)}),Cfe=at("$ZodISODuration",(e,r)=>{r.pattern??(r.pattern=_pe),$r.init(e,r)}),Afe=at("$ZodIPv4",(e,r)=>{r.pattern??(r.pattern=Mpe),$r.init(e,r),e._zod.onattach.push(s=>{const o=s._zod.bag;o.format="ipv4"})}),Ofe=at("$ZodIPv6",(e,r)=>{r.pattern??(r.pattern=Ipe),$r.init(e,r),e._zod.onattach.push(s=>{const o=s._zod.bag;o.format="ipv6"}),e._zod.check=s=>{try{new URL(`http://[${s.value}]`)}catch{s.issues.push({code:"invalid_format",format:"ipv6",input:s.value,inst:e,continue:!r.abort})}}}),kfe=at("$ZodCIDRv4",(e,r)=>{r.pattern??(r.pattern=zpe),$r.init(e,r)}),Rfe=at("$ZodCIDRv6",(e,r)=>{r.pattern??(r.pattern=Lpe),$r.init(e,r),e._zod.check=s=>{const o=s.value.split("/");try{if(o.length!==2)throw new Error;const[d,p]=o;if(!p)throw new Error;const m=Number(p);if(`${m}`!==p)throw new Error;if(m<0||m>128)throw new Error;new URL(`http://[${d}]`)}catch{s.issues.push({code:"invalid_format",format:"cidrv6",input:s.value,inst:e,continue:!r.abort})}}});function p6(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Tfe=at("$ZodBase64",(e,r)=>{r.pattern??(r.pattern=Fpe),$r.init(e,r),e._zod.onattach.push(s=>{s._zod.bag.contentEncoding="base64"}),e._zod.check=s=>{p6(s.value)||s.issues.push({code:"invalid_format",format:"base64",input:s.value,inst:e,continue:!r.abort})}});function _fe(e){if(!o6.test(e))return!1;const r=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),s=r.padEnd(Math.ceil(r.length/4)*4,"=");return p6(s)}const $fe=at("$ZodBase64URL",(e,r)=>{r.pattern??(r.pattern=o6),$r.init(e,r),e._zod.onattach.push(s=>{s._zod.bag.contentEncoding="base64url"}),e._zod.check=s=>{_fe(s.value)||s.issues.push({code:"invalid_format",format:"base64url",input:s.value,inst:e,continue:!r.abort})}}),Nfe=at("$ZodE164",(e,r)=>{r.pattern??(r.pattern=Bpe),$r.init(e,r)});function Dfe(e,r=null){try{const s=e.split(".");if(s.length!==3)return!1;const[o]=s;if(!o)return!1;const d=JSON.parse(atob(o));return!("typ"in d&&d?.typ!=="JWT"||!d.alg||r&&(!("alg"in d)||d.alg!==r))}catch{return!1}}const Pfe=at("$ZodJWT",(e,r)=>{$r.init(e,r),e._zod.check=s=>{Dfe(s.value,r.alg)||s.issues.push({code:"invalid_format",format:"jwt",input:s.value,inst:e,continue:!r.abort})}}),f6=at("$ZodNumber",(e,r)=>{Gr.init(e,r),e._zod.pattern=e._zod.bag.pattern??Xpe,e._zod.parse=(s,o)=>{if(r.coerce)try{s.value=Number(s.value)}catch{}const d=s.value;if(typeof d=="number"&&!Number.isNaN(d)&&Number.isFinite(d))return s;const p=typeof d=="number"?Number.isNaN(d)?"NaN":Number.isFinite(d)?void 0:"Infinity":void 0;return s.issues.push({expected:"number",code:"invalid_type",input:d,inst:e,...p?{received:p}:{}}),s}}),Mfe=at("$ZodNumber",(e,r)=>{Jpe.init(e,r),f6.init(e,r)}),Ife=at("$ZodAny",(e,r)=>{Gr.init(e,r),e._zod.parse=s=>s}),zfe=at("$ZodUnknown",(e,r)=>{Gr.init(e,r),e._zod.parse=s=>s}),Lfe=at("$ZodNever",(e,r)=>{Gr.init(e,r),e._zod.parse=(s,o)=>(s.issues.push({expected:"never",code:"invalid_type",input:s.value,inst:e}),s)});function i3(e,r,s){e.issues.length&&r.issues.push(...i6(s,e.issues)),r.value[s]=e.value}const Ffe=at("$ZodArray",(e,r)=>{Gr.init(e,r),e._zod.parse=(s,o)=>{const d=s.value;if(!Array.isArray(d))return s.issues.push({expected:"array",code:"invalid_type",input:d,inst:e}),s;s.value=Array(d.length);const p=[];for(let m=0;mi3(S,s,m))):i3(b,s,m)}return p.length?Promise.all(p).then(()=>s):s}});function eC(e,r,s,o){e.issues.length&&r.issues.push(...i6(s,e.issues)),e.value===void 0?s in o&&(r.value[s]=void 0):r.value[s]=e.value}function m6(e){const r=Object.keys(e.shape);for(const o of r)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);const s=npe(e.shape);return{...e,keys:r,keySet:new Set(r),numKeys:r.length,optionalKeys:new Set(s)}}function g6(e,r,s,o,d,p){const m=[],g=d.keySet,b=d.catchall._zod,S=b.def.type;for(const E of Object.keys(r)){if(g.has(E))continue;if(S==="never"){m.push(E);continue}const A=b.run({value:r[E],issues:[]},o);A instanceof Promise?e.push(A.then(k=>eC(k,s,E,r))):eC(A,s,E,r)}return m.length&&s.issues.push({code:"unrecognized_keys",keys:m,input:r,inst:p}),e.length?Promise.all(e).then(()=>s):s}const qfe=at("$ZodObject",(e,r)=>{if(Gr.init(e,r),!Object.getOwnPropertyDescriptor(r,"shape")?.get){const g=r.shape;Object.defineProperty(r,"shape",{get:()=>{const b={...g};return Object.defineProperty(r,"shape",{value:b}),b}})}const o=W2(()=>m6(r));Sr(e._zod,"propValues",()=>{const g=r.shape,b={};for(const S in g){const E=g[S]._zod;if(E.values){b[S]??(b[S]=new Set);for(const A of E.values)b[S].add(A)}}return b});const d=Qj,p=r.catchall;let m;e._zod.parse=(g,b)=>{m??(m=o.value);const S=g.value;if(!d(S))return g.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),g;g.value={};const E=[],A=m.shape;for(const k of m.keys){const M=A[k]._zod.run({value:S[k],issues:[]},b);M instanceof Promise?E.push(M.then(I=>eC(I,g,k,S))):eC(M,g,k,S)}return p?g6(E,S,g,b,o.value,e):E.length?Promise.all(E).then(()=>g):g}}),Bfe=at("$ZodObjectJIT",(e,r)=>{qfe.init(e,r);const s=e._zod.parse,o=W2(()=>m6(r)),d=k=>{const T=new cfe(["shape","payload","ctx"]),M=o.value,I=X=>{const z=r3(X);return`shape[${z}]._zod.run({ value: input[${z}], issues: [] }, ctx)`};T.write("const input = payload.value;");const q=Object.create(null);let G=0;for(const X of M.keys)q[X]=`key_${G++}`;T.write("const newResult = {};");for(const X of M.keys){const z=q[X],ee=r3(X);T.write(`const ${z} = ${I(X)};`),T.write(` - if (${z}.issues.length) { - payload.issues = payload.issues.concat(${z}.issues.map(iss => ({ +`))}}const dfe={major:4,minor:1,patch:13},Gr=at("$ZodType",(e,r)=>{var s;e??(e={}),e._zod.def=r,e._zod.bag=e._zod.bag||{},e._zod.version=dfe;const o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(const d of o)for(const p of d._zod.onattach)p(e);if(o.length===0)(s=e._zod).deferred??(s.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const d=(m,g,b)=>{let S=dg(m),j;for(const A of g){if(A._zod.def.when){if(!A._zod.def.when(m))continue}else if(S)continue;const k=m.issues.length,T=A._zod.check(m);if(T instanceof Promise&&b?.async===!1)throw new gg;if(j||T instanceof Promise)j=(j??Promise.resolve()).then(async()=>{await T,m.issues.length!==k&&(S||(S=dg(m,k)))});else{if(m.issues.length===k)continue;S||(S=dg(m,k))}}return j?j.then(()=>m):m},p=(m,g,b)=>{if(dg(m))return m.aborted=!0,m;const S=d(g,o,b);if(S instanceof Promise){if(b.async===!1)throw new gg;return S.then(j=>e._zod.parse(j,b))}return e._zod.parse(S,b)};e._zod.run=(m,g)=>{if(g.skipChecks)return e._zod.parse(m,g);if(g.direction==="backward"){const S=e._zod.parse({value:m.value,issues:[]},{...g,skipChecks:!0});return S instanceof Promise?S.then(j=>p(j,m,g)):p(S,m,g)}const b=e._zod.parse(m,g);if(b instanceof Promise){if(g.async===!1)throw new gg;return b.then(S=>d(S,o,g))}return d(b,o,g)}}e["~standard"]={validate:d=>{try{const p=ype(e,d);return p.success?{value:p.data}:{issues:p.error?.issues}}catch{return vpe(e,d).then(m=>m.success?{value:m.data}:{issues:m.error?.issues})}},vendor:"zod",version:1}}),r$=at("$ZodString",(e,r)=>{Gr.init(e,r),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Gpe(e._zod.bag),e._zod.parse=(s,o)=>{if(r.coerce)try{s.value=String(s.value)}catch{}return typeof s.value=="string"||s.issues.push({expected:"string",code:"invalid_type",input:s.value,inst:e}),s}}),$r=at("$ZodStringFormat",(e,r)=>{GC.init(e,r),r$.init(e,r)}),hfe=at("$ZodGUID",(e,r)=>{r.pattern??(r.pattern=Dpe),$r.init(e,r)}),pfe=at("$ZodUUID",(e,r)=>{if(r.version){const o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[r.version];if(o===void 0)throw new Error(`Invalid UUID version: "${r.version}"`);r.pattern??(r.pattern=i3(o))}else r.pattern??(r.pattern=i3());$r.init(e,r)}),ffe=at("$ZodEmail",(e,r)=>{r.pattern??(r.pattern=Ppe),$r.init(e,r)}),mfe=at("$ZodURL",(e,r)=>{$r.init(e,r),e._zod.check=s=>{try{const o=s.value.trim(),d=new URL(o);r.hostname&&(r.hostname.lastIndex=0,r.hostname.test(d.hostname)||s.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:r.hostname.source,input:s.value,inst:e,continue:!r.abort})),r.protocol&&(r.protocol.lastIndex=0,r.protocol.test(d.protocol.endsWith(":")?d.protocol.slice(0,-1):d.protocol)||s.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:r.protocol.source,input:s.value,inst:e,continue:!r.abort})),r.normalize?s.value=d.href:s.value=o;return}catch{s.issues.push({code:"invalid_format",format:"url",input:s.value,inst:e,continue:!r.abort})}}}),gfe=at("$ZodEmoji",(e,r)=>{r.pattern??(r.pattern=Ipe()),$r.init(e,r)}),yfe=at("$ZodNanoID",(e,r)=>{r.pattern??(r.pattern=$pe),$r.init(e,r)}),vfe=at("$ZodCUID",(e,r)=>{r.pattern??(r.pattern=Ope),$r.init(e,r)}),xfe=at("$ZodCUID2",(e,r)=>{r.pattern??(r.pattern=kpe),$r.init(e,r)}),bfe=at("$ZodULID",(e,r)=>{r.pattern??(r.pattern=Rpe),$r.init(e,r)}),wfe=at("$ZodXID",(e,r)=>{r.pattern??(r.pattern=Tpe),$r.init(e,r)}),Sfe=at("$ZodKSUID",(e,r)=>{r.pattern??(r.pattern=_pe),$r.init(e,r)}),Efe=at("$ZodISODateTime",(e,r)=>{r.pattern??(r.pattern=Hpe(r)),$r.init(e,r)}),jfe=at("$ZodISODate",(e,r)=>{r.pattern??(r.pattern=Kpe),$r.init(e,r)}),Cfe=at("$ZodISOTime",(e,r)=>{r.pattern??(r.pattern=Vpe(r)),$r.init(e,r)}),Afe=at("$ZodISODuration",(e,r)=>{r.pattern??(r.pattern=Npe),$r.init(e,r)}),Ofe=at("$ZodIPv4",(e,r)=>{r.pattern??(r.pattern=Lpe),$r.init(e,r),e._zod.bag.format="ipv4"}),kfe=at("$ZodIPv6",(e,r)=>{r.pattern??(r.pattern=zpe),$r.init(e,r),e._zod.bag.format="ipv6",e._zod.check=s=>{try{new URL(`http://[${s.value}]`)}catch{s.issues.push({code:"invalid_format",format:"ipv6",input:s.value,inst:e,continue:!r.abort})}}}),Rfe=at("$ZodCIDRv4",(e,r)=>{r.pattern??(r.pattern=Fpe),$r.init(e,r)}),Tfe=at("$ZodCIDRv6",(e,r)=>{r.pattern??(r.pattern=qpe),$r.init(e,r),e._zod.check=s=>{const o=s.value.split("/");try{if(o.length!==2)throw new Error;const[d,p]=o;if(!p)throw new Error;const m=Number(p);if(`${m}`!==p)throw new Error;if(m<0||m>128)throw new Error;new URL(`http://[${d}]`)}catch{s.issues.push({code:"invalid_format",format:"cidrv6",input:s.value,inst:e,continue:!r.abort})}}});function f6(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const _fe=at("$ZodBase64",(e,r)=>{r.pattern??(r.pattern=Bpe),$r.init(e,r),e._zod.bag.contentEncoding="base64",e._zod.check=s=>{f6(s.value)||s.issues.push({code:"invalid_format",format:"base64",input:s.value,inst:e,continue:!r.abort})}});function $fe(e){if(!l6.test(e))return!1;const r=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),s=r.padEnd(Math.ceil(r.length/4)*4,"=");return f6(s)}const Nfe=at("$ZodBase64URL",(e,r)=>{r.pattern??(r.pattern=l6),$r.init(e,r),e._zod.bag.contentEncoding="base64url",e._zod.check=s=>{$fe(s.value)||s.issues.push({code:"invalid_format",format:"base64url",input:s.value,inst:e,continue:!r.abort})}}),Dfe=at("$ZodE164",(e,r)=>{r.pattern??(r.pattern=Upe),$r.init(e,r)});function Pfe(e,r=null){try{const s=e.split(".");if(s.length!==3)return!1;const[o]=s;if(!o)return!1;const d=JSON.parse(atob(o));return!("typ"in d&&d?.typ!=="JWT"||!d.alg||r&&(!("alg"in d)||d.alg!==r))}catch{return!1}}const Mfe=at("$ZodJWT",(e,r)=>{$r.init(e,r),e._zod.check=s=>{Pfe(s.value,r.alg)||s.issues.push({code:"invalid_format",format:"jwt",input:s.value,inst:e,continue:!r.abort})}}),m6=at("$ZodNumber",(e,r)=>{Gr.init(e,r),e._zod.pattern=e._zod.bag.pattern??Ype,e._zod.parse=(s,o)=>{if(r.coerce)try{s.value=Number(s.value)}catch{}const d=s.value;if(typeof d=="number"&&!Number.isNaN(d)&&Number.isFinite(d))return s;const p=typeof d=="number"?Number.isNaN(d)?"NaN":Number.isFinite(d)?void 0:"Infinity":void 0;return s.issues.push({expected:"number",code:"invalid_type",input:d,inst:e,...p?{received:p}:{}}),s}}),Ife=at("$ZodNumberFormat",(e,r)=>{Qpe.init(e,r),m6.init(e,r)}),Lfe=at("$ZodAny",(e,r)=>{Gr.init(e,r),e._zod.parse=s=>s}),zfe=at("$ZodUnknown",(e,r)=>{Gr.init(e,r),e._zod.parse=s=>s}),Ffe=at("$ZodNever",(e,r)=>{Gr.init(e,r),e._zod.parse=(s,o)=>(s.issues.push({expected:"never",code:"invalid_type",input:s.value,inst:e}),s)});function a3(e,r,s){e.issues.length&&r.issues.push(...a6(s,e.issues)),r.value[s]=e.value}const qfe=at("$ZodArray",(e,r)=>{Gr.init(e,r),e._zod.parse=(s,o)=>{const d=s.value;if(!Array.isArray(d))return s.issues.push({expected:"array",code:"invalid_type",input:d,inst:e}),s;s.value=Array(d.length);const p=[];for(let m=0;ma3(S,s,m))):a3(b,s,m)}return p.length?Promise.all(p).then(()=>s):s}});function eC(e,r,s,o){e.issues.length&&r.issues.push(...a6(s,e.issues)),e.value===void 0?s in o&&(r.value[s]=void 0):r.value[s]=e.value}function g6(e){const r=Object.keys(e.shape);for(const o of r)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);const s=spe(e.shape);return{...e,keys:r,keySet:new Set(r),numKeys:r.length,optionalKeys:new Set(s)}}function y6(e,r,s,o,d,p){const m=[],g=d.keySet,b=d.catchall._zod,S=b.def.type;for(const j in r){if(g.has(j))continue;if(S==="never"){m.push(j);continue}const A=b.run({value:r[j],issues:[]},o);A instanceof Promise?e.push(A.then(k=>eC(k,s,j,r))):eC(A,s,j,r)}return m.length&&s.issues.push({code:"unrecognized_keys",keys:m,input:r,inst:p}),e.length?Promise.all(e).then(()=>s):s}const Bfe=at("$ZodObject",(e,r)=>{if(Gr.init(e,r),!Object.getOwnPropertyDescriptor(r,"shape")?.get){const g=r.shape;Object.defineProperty(r,"shape",{get:()=>{const b={...g};return Object.defineProperty(r,"shape",{value:b}),b}})}const o=J2(()=>g6(r));Sr(e._zod,"propValues",()=>{const g=r.shape,b={};for(const S in g){const j=g[S]._zod;if(j.values){b[S]??(b[S]=new Set);for(const A of j.values)b[S].add(A)}}return b});const d=Qj,p=r.catchall;let m;e._zod.parse=(g,b)=>{m??(m=o.value);const S=g.value;if(!d(S))return g.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),g;g.value={};const j=[],A=m.shape;for(const k of m.keys){const M=A[k]._zod.run({value:S[k],issues:[]},b);M instanceof Promise?j.push(M.then(I=>eC(I,g,k,S))):eC(M,g,k,S)}return p?y6(j,S,g,b,o.value,e):j.length?Promise.all(j).then(()=>g):g}}),Ufe=at("$ZodObjectJIT",(e,r)=>{Bfe.init(e,r);const s=e._zod.parse,o=J2(()=>g6(r)),d=k=>{const T=new ufe(["shape","payload","ctx"]),M=o.value,I=X=>{const L=s3(X);return`shape[${L}]._zod.run({ value: input[${L}], issues: [] }, ctx)`};T.write("const input = payload.value;");const q=Object.create(null);let G=0;for(const X of M.keys)q[X]=`key_${G++}`;T.write("const newResult = {};");for(const X of M.keys){const L=q[X],ee=s3(X);T.write(`const ${L} = ${I(X)};`),T.write(` + if (${L}.issues.length) { + payload.issues = payload.issues.concat(${L}.issues.map(iss => ({ ...iss, path: iss.path ? [${ee}, ...iss.path] : [${ee}] }))); } - if (${z}.value === undefined) { + if (${L}.value === undefined) { if (${ee} in input) { newResult[${ee}] = undefined; } } else { - newResult[${ee}] = ${z}.value; + newResult[${ee}] = ${L}.value; } - `)}T.write("payload.value = newResult;"),T.write("return payload;");const K=T.compile();return(X,z)=>K(k,X,z)};let p;const m=Qj,g=!n6.jitless,S=g&&epe.value,E=r.catchall;let A;e._zod.parse=(k,T)=>{A??(A=o.value);const M=k.value;return m(M)?g&&S&&T?.async===!1&&T.jitless!==!0?(p||(p=d(r.shape)),k=p(k,T),E?g6([],M,k,T,A,e):k):s(k,T):(k.issues.push({expected:"object",code:"invalid_type",input:M,inst:e}),k)}});function a3(e,r,s,o){for(const p of e)if(p.issues.length===0)return r.value=p.value,r;const d=e.filter(p=>!dg(p));return d.length===1?(r.value=d[0].value,d[0]):(r.issues.push({code:"invalid_union",input:r.value,inst:s,errors:e.map(p=>p.issues.map(m=>_p(m,o,Tp())))}),r)}const Ufe=at("$ZodUnion",(e,r)=>{Gr.init(e,r),Sr(e._zod,"optin",()=>r.options.some(d=>d._zod.optin==="optional")?"optional":void 0),Sr(e._zod,"optout",()=>r.options.some(d=>d._zod.optout==="optional")?"optional":void 0),Sr(e._zod,"values",()=>{if(r.options.every(d=>d._zod.values))return new Set(r.options.flatMap(d=>Array.from(d._zod.values)))}),Sr(e._zod,"pattern",()=>{if(r.options.every(d=>d._zod.pattern)){const d=r.options.map(p=>p._zod.pattern);return new RegExp(`^(${d.map(p=>Q2(p.source)).join("|")})$`)}});const s=r.options.length===1,o=r.options[0]._zod.run;e._zod.parse=(d,p)=>{if(s)return o(d,p);let m=!1;const g=[];for(const b of r.options){const S=b._zod.run({value:d.value,issues:[]},p);if(S instanceof Promise)g.push(S),m=!0;else{if(S.issues.length===0)return S;g.push(S)}}return m?Promise.all(g).then(b=>a3(b,d,e,p)):a3(g,d,e,p)}}),Kfe=at("$ZodIntersection",(e,r)=>{Gr.init(e,r),e._zod.parse=(s,o)=>{const d=s.value,p=r.left._zod.run({value:d,issues:[]},o),m=r.right._zod.run({value:d,issues:[]},o);return p instanceof Promise||m instanceof Promise?Promise.all([p,m]).then(([b,S])=>o3(s,b,S)):o3(s,p,m)}});function m_(e,r){if(e===r)return{valid:!0,data:e};if(e instanceof Date&&r instanceof Date&&+e==+r)return{valid:!0,data:e};if(Xb(e)&&Xb(r)){const s=Object.keys(r),o=Object.keys(e).filter(p=>s.indexOf(p)!==-1),d={...e,...r};for(const p of o){const m=m_(e[p],r[p]);if(!m.valid)return{valid:!1,mergeErrorPath:[p,...m.mergeErrorPath]};d[p]=m.data}return{valid:!0,data:d}}if(Array.isArray(e)&&Array.isArray(r)){if(e.length!==r.length)return{valid:!1,mergeErrorPath:[]};const s=[];for(let o=0;o{Gr.init(e,r);const s=Jhe(r.entries),o=new Set(s);e._zod.values=o,e._zod.pattern=new RegExp(`^(${s.filter(d=>tpe.has(typeof d)).map(d=>typeof d=="string"?Eg(d):d.toString()).join("|")})$`),e._zod.parse=(d,p)=>{const m=d.value;return o.has(m)||d.issues.push({code:"invalid_value",values:s,input:m,inst:e}),d}}),Hfe=at("$ZodLiteral",(e,r)=>{if(Gr.init(e,r),r.values.length===0)throw new Error("Cannot create literal schema with no valid values");e._zod.values=new Set(r.values),e._zod.pattern=new RegExp(`^(${r.values.map(s=>typeof s=="string"?Eg(s):s?Eg(s.toString()):String(s)).join("|")})$`),e._zod.parse=(s,o)=>{const d=s.value;return e._zod.values.has(d)||s.issues.push({code:"invalid_value",values:r.values,input:d,inst:e}),s}}),Gfe=at("$ZodTransform",(e,r)=>{Gr.init(e,r),e._zod.parse=(s,o)=>{if(o.direction==="backward")throw new t6(e.constructor.name);const d=r.transform(s.value,s);if(o.async)return(d instanceof Promise?d:Promise.resolve(d)).then(m=>(s.value=m,s));if(d instanceof Promise)throw new gg;return s.value=d,s}});function l3(e,r){return e.issues.length&&r===void 0?{issues:[],value:void 0}:e}const Xfe=at("$ZodOptional",(e,r)=>{Gr.init(e,r),e._zod.optin="optional",e._zod.optout="optional",Sr(e._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,void 0]):void 0),Sr(e._zod,"pattern",()=>{const s=r.innerType._zod.pattern;return s?new RegExp(`^(${Q2(s.source)})?$`):void 0}),e._zod.parse=(s,o)=>{if(r.innerType._zod.optin==="optional"){const d=r.innerType._zod.run(s,o);return d instanceof Promise?d.then(p=>l3(p,s.value)):l3(d,s.value)}return s.value===void 0?s:r.innerType._zod.run(s,o)}}),Yfe=at("$ZodNullable",(e,r)=>{Gr.init(e,r),Sr(e._zod,"optin",()=>r.innerType._zod.optin),Sr(e._zod,"optout",()=>r.innerType._zod.optout),Sr(e._zod,"pattern",()=>{const s=r.innerType._zod.pattern;return s?new RegExp(`^(${Q2(s.source)}|null)$`):void 0}),Sr(e._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,null]):void 0),e._zod.parse=(s,o)=>s.value===null?s:r.innerType._zod.run(s,o)}),Zfe=at("$ZodDefault",(e,r)=>{Gr.init(e,r),e._zod.optin="optional",Sr(e._zod,"values",()=>r.innerType._zod.values),e._zod.parse=(s,o)=>{if(o.direction==="backward")return r.innerType._zod.run(s,o);if(s.value===void 0)return s.value=r.defaultValue,s;const d=r.innerType._zod.run(s,o);return d instanceof Promise?d.then(p=>c3(p,r)):c3(d,r)}});function c3(e,r){return e.value===void 0&&(e.value=r.defaultValue),e}const Wfe=at("$ZodPrefault",(e,r)=>{Gr.init(e,r),e._zod.optin="optional",Sr(e._zod,"values",()=>r.innerType._zod.values),e._zod.parse=(s,o)=>(o.direction==="backward"||s.value===void 0&&(s.value=r.defaultValue),r.innerType._zod.run(s,o))}),Jfe=at("$ZodNonOptional",(e,r)=>{Gr.init(e,r),Sr(e._zod,"values",()=>{const s=r.innerType._zod.values;return s?new Set([...s].filter(o=>o!==void 0)):void 0}),e._zod.parse=(s,o)=>{const d=r.innerType._zod.run(s,o);return d instanceof Promise?d.then(p=>u3(p,e)):u3(d,e)}});function u3(e,r){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:r}),e}const Qfe=at("$ZodCatch",(e,r)=>{Gr.init(e,r),Sr(e._zod,"optin",()=>r.innerType._zod.optin),Sr(e._zod,"optout",()=>r.innerType._zod.optout),Sr(e._zod,"values",()=>r.innerType._zod.values),e._zod.parse=(s,o)=>{if(o.direction==="backward")return r.innerType._zod.run(s,o);const d=r.innerType._zod.run(s,o);return d instanceof Promise?d.then(p=>(s.value=p.value,p.issues.length&&(s.value=r.catchValue({...s,error:{issues:p.issues.map(m=>_p(m,o,Tp()))},input:s.value}),s.issues=[]),s)):(s.value=d.value,d.issues.length&&(s.value=r.catchValue({...s,error:{issues:d.issues.map(p=>_p(p,o,Tp()))},input:s.value}),s.issues=[]),s)}}),eme=at("$ZodPipe",(e,r)=>{Gr.init(e,r),Sr(e._zod,"values",()=>r.in._zod.values),Sr(e._zod,"optin",()=>r.in._zod.optin),Sr(e._zod,"optout",()=>r.out._zod.optout),Sr(e._zod,"propValues",()=>r.in._zod.propValues),e._zod.parse=(s,o)=>{if(o.direction==="backward"){const p=r.out._zod.run(s,o);return p instanceof Promise?p.then(m=>uj(m,r.in,o)):uj(p,r.in,o)}const d=r.in._zod.run(s,o);return d instanceof Promise?d.then(p=>uj(p,r.out,o)):uj(d,r.out,o)}});function uj(e,r,s){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:e.value,issues:e.issues},s)}const tme=at("$ZodReadonly",(e,r)=>{Gr.init(e,r),Sr(e._zod,"propValues",()=>r.innerType._zod.propValues),Sr(e._zod,"values",()=>r.innerType._zod.values),Sr(e._zod,"optin",()=>r.innerType._zod.optin),Sr(e._zod,"optout",()=>r.innerType._zod.optout),e._zod.parse=(s,o)=>{if(o.direction==="backward")return r.innerType._zod.run(s,o);const d=r.innerType._zod.run(s,o);return d instanceof Promise?d.then(d3):d3(d)}});function d3(e){return e.value=Object.freeze(e.value),e}const nme=at("$ZodCustom",(e,r)=>{pa.init(e,r),Gr.init(e,r),e._zod.parse=(s,o)=>s,e._zod.check=s=>{const o=s.value,d=r.fn(o);if(d instanceof Promise)return d.then(p=>h3(p,s,o,e));h3(d,s,o,e)}});function h3(e,r,s,o){if(!e){const d={code:"custom",input:s,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(d.params=o._zod.def.params),r.issues.push(Yb(d))}}class rme{constructor(){this._map=new WeakMap,this._idmap=new Map}add(r,...s){const o=s[0];if(this._map.set(r,o),o&&typeof o=="object"&&"id"in o){if(this._idmap.has(o.id))throw new Error(`ID ${o.id} already exists in the registry`);this._idmap.set(o.id,r)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(r){const s=this._map.get(r);return s&&typeof s=="object"&&"id"in s&&this._idmap.delete(s.id),this._map.delete(r),this}get(r){const s=r._zod.parent;if(s){const o={...this.get(s)??{}};delete o.id;const d={...o,...this._map.get(r)};return Object.keys(d).length?d:void 0}return this._map.get(r)}has(r){return this._map.has(r)}}function sme(){return new rme}const dj=sme();function ime(e,r){return new e({type:"string",...Yt(r)})}function ame(e,r){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Yt(r)})}function p3(e,r){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Yt(r)})}function y6(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Yt(r)})}function ome(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Yt(r)})}function lme(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Yt(r)})}function cme(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Yt(r)})}function ume(e,r){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Yt(r)})}function dme(e,r){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Yt(r)})}function hme(e,r){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Yt(r)})}function pme(e,r){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Yt(r)})}function fme(e,r){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Yt(r)})}function mme(e,r){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Yt(r)})}function gme(e,r){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Yt(r)})}function yme(e,r){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Yt(r)})}function vme(e,r){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Yt(r)})}function xme(e,r){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Yt(r)})}function bme(e,r){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Yt(r)})}function wme(e,r){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Yt(r)})}function Sme(e,r){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Yt(r)})}function Eme(e,r){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Yt(r)})}function jme(e,r){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Yt(r)})}function Cme(e,r){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Yt(r)})}function Ame(e,r){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Yt(r)})}function Ome(e,r){return new e({type:"string",format:"date",check:"string_format",...Yt(r)})}function kme(e,r){return new e({type:"string",format:"time",check:"string_format",precision:null,...Yt(r)})}function Rme(e,r){return new e({type:"string",format:"duration",check:"string_format",...Yt(r)})}function Tme(e,r){return new e({type:"number",checks:[],...Yt(r)})}function _me(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Yt(r)})}function $me(e){return new e({type:"any"})}function Nme(e){return new e({type:"unknown"})}function Dme(e,r){return new e({type:"never",...Yt(r)})}function f3(e,r){return new d6({check:"less_than",...Yt(r),value:e,inclusive:!1})}function fT(e,r){return new d6({check:"less_than",...Yt(r),value:e,inclusive:!0})}function m3(e,r){return new h6({check:"greater_than",...Yt(r),value:e,inclusive:!1})}function mT(e,r){return new h6({check:"greater_than",...Yt(r),value:e,inclusive:!0})}function g3(e,r){return new Wpe({check:"multiple_of",...Yt(r),value:e})}function v6(e,r){return new Qpe({check:"max_length",...Yt(r),maximum:e})}function tC(e,r){return new efe({check:"min_length",...Yt(r),minimum:e})}function x6(e,r){return new tfe({check:"length_equals",...Yt(r),length:e})}function Pme(e,r){return new nfe({check:"string_format",format:"regex",...Yt(r),pattern:e})}function Mme(e){return new rfe({check:"string_format",format:"lowercase",...Yt(e)})}function Ime(e){return new sfe({check:"string_format",format:"uppercase",...Yt(e)})}function zme(e,r){return new ife({check:"string_format",format:"includes",...Yt(r),includes:e})}function Lme(e,r){return new afe({check:"string_format",format:"starts_with",...Yt(r),prefix:e})}function Fme(e,r){return new ofe({check:"string_format",format:"ends_with",...Yt(r),suffix:e})}function yw(e){return new lfe({check:"overwrite",tx:e})}function qme(e){return yw(r=>r.normalize(e))}function Bme(){return yw(e=>e.trim())}function Ume(){return yw(e=>e.toLowerCase())}function Kme(){return yw(e=>e.toUpperCase())}function Vme(e,r,s){return new e({type:"array",element:r,...Yt(s)})}function Hme(e,r,s){return new e({type:"custom",check:"custom",fn:r,...Yt(s)})}function Gme(e){const r=Xme(s=>(s.addIssue=o=>{if(typeof o=="string")s.issues.push(Yb(o,s.value,r._zod.def));else{const d=o;d.fatal&&(d.continue=!1),d.code??(d.code="custom"),d.input??(d.input=s.value),d.inst??(d.inst=r),d.continue??(d.continue=!r._zod.def.abort),s.issues.push(Yb(d))}},e(s.value,s)));return r}function Xme(e,r){const s=new pa({check:"custom",...Yt(r)});return s._zod.check=e,s}function y3(e,r){try{var s=e()}catch(o){return r(o)}return s&&s.then?s.then(void 0,r):s}function Yme(e,r){for(var s={};e.length;){var o=e[0],d=o.code,p=o.message,m=o.path.join(".");if(!s[m])if("unionErrors"in o){var g=o.unionErrors[0].errors[0];s[m]={message:g.message,type:g.code}}else s[m]={message:p,type:d};if("unionErrors"in o&&o.unionErrors.forEach(function(E){return E.errors.forEach(function(A){return e.push(A)})}),r){var b=s[m].types,S=b&&b[o.code];s[m]=X2(m,r,s,d,S?[].concat(S,o.message):o.message)}e.shift()}return s}function Zme(e,r){for(var s={};e.length;){var o=e[0],d=o.code,p=o.message,m=o.path.join(".");if(!s[m])if(o.code==="invalid_union"&&o.errors.length>0){var g=o.errors[0][0];s[m]={message:g.message,type:g.code}}else s[m]={message:p,type:d};if(o.code==="invalid_union"&&o.errors.forEach(function(E){return E.forEach(function(A){return e.push(A)})}),r){var b=s[m].types,S=b&&b[o.code];s[m]=X2(m,r,s,d,S?[].concat(S,o.message):o.message)}e.shift()}return s}function gr(e,r,s){if(s===void 0&&(s={}),(function(o){return"_def"in o&&typeof o._def=="object"&&"typeName"in o._def})(e))return function(o,d,p){try{return Promise.resolve(y3(function(){return Promise.resolve(e[s.mode==="sync"?"parse":"parseAsync"](o,r)).then(function(m){return p.shouldUseNativeValidation&&p_({},p),{errors:{},values:s.raw?Object.assign({},o):m}})},function(m){if((function(g){return Array.isArray(g?.issues)})(m))return{values:{},errors:e3(Yme(m.errors,!p.shouldUseNativeValidation&&p.criteriaMode==="all"),p)};throw m}))}catch(m){return Promise.reject(m)}};if((function(o){return"_zod"in o&&typeof o._zod=="object"})(e))return function(o,d,p){try{return Promise.resolve(y3(function(){return Promise.resolve((s.mode==="sync"?ppe:fpe)(e,o,r)).then(function(m){return p.shouldUseNativeValidation&&p_({},p),{errors:{},values:s.raw?Object.assign({},o):m}})},function(m){if((function(g){return g instanceof t$})(m))return{values:{},errors:e3(Zme(m.issues,!p.shouldUseNativeValidation&&p.criteriaMode==="all"),p)};throw m}))}catch(m){return Promise.reject(m)}};throw new Error("Invalid input: not a Zod schema")}const Wme=at("ZodISODateTime",(e,r)=>{Sfe.init(e,r),Lr.init(e,r)});function Jme(e){return Ame(Wme,e)}const Qme=at("ZodISODate",(e,r)=>{Efe.init(e,r),Lr.init(e,r)});function ege(e){return Ome(Qme,e)}const tge=at("ZodISOTime",(e,r)=>{jfe.init(e,r),Lr.init(e,r)});function nge(e){return kme(tge,e)}const rge=at("ZodISODuration",(e,r)=>{Cfe.init(e,r),Lr.init(e,r)});function sge(e){return Rme(rge,e)}const ige=(e,r)=>{t$.init(e,r),e.name="ZodError",Object.defineProperties(e,{format:{value:s=>hpe(e,s)},flatten:{value:s=>dpe(e,s)},addIssue:{value:s=>{e.issues.push(s),e.message=JSON.stringify(e.issues,f_,2)}},addIssues:{value:s=>{e.issues.push(...s),e.message=JSON.stringify(e.issues,f_,2)}},isEmpty:{get(){return e.issues.length===0}}})},uo=at("ZodError",ige,{Parent:Error}),age=UC(uo),oge=KC(uo),lge=VC(uo),cge=HC(uo),uge=ype(uo),dge=vpe(uo),hge=xpe(uo),pge=bpe(uo),fge=wpe(uo),mge=Spe(uo),gge=Epe(uo),yge=jpe(uo),ss=at("ZodType",(e,r)=>(Gr.init(e,r),e.def=r,e.type=r.type,Object.defineProperty(e,"_def",{value:r}),e.check=(...s)=>e.clone(Pp(r,{checks:[...r.checks??[],...s.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]})),e.clone=(s,o)=>Zd(e,s,o),e.brand=()=>e,e.register=((s,o)=>(s.add(e,o),e)),e.parse=(s,o)=>age(e,s,o,{callee:e.parse}),e.safeParse=(s,o)=>lge(e,s,o),e.parseAsync=async(s,o)=>oge(e,s,o,{callee:e.parseAsync}),e.safeParseAsync=async(s,o)=>cge(e,s,o),e.spa=e.safeParseAsync,e.encode=(s,o)=>uge(e,s,o),e.decode=(s,o)=>dge(e,s,o),e.encodeAsync=async(s,o)=>hge(e,s,o),e.decodeAsync=async(s,o)=>pge(e,s,o),e.safeEncode=(s,o)=>fge(e,s,o),e.safeDecode=(s,o)=>mge(e,s,o),e.safeEncodeAsync=async(s,o)=>gge(e,s,o),e.safeDecodeAsync=async(s,o)=>yge(e,s,o),e.refine=(s,o)=>e.check(lye(s,o)),e.superRefine=s=>e.check(cye(s)),e.overwrite=s=>e.check(yw(s)),e.optional=()=>S3(e),e.nullable=()=>E3(e),e.nullish=()=>S3(E3(e)),e.nonoptional=s=>tye(e,s),e.array=()=>Bge(e),e.or=s=>E6([e,s]),e.and=s=>Hge(e,s),e.transform=s=>j3(e,Yge(s)),e.default=s=>Jge(e,s),e.prefault=s=>eye(e,s),e.catch=s=>rye(e,s),e.pipe=s=>j3(e,s),e.readonly=()=>aye(e),e.describe=s=>{const o=e.clone();return dj.add(o,{description:s}),o},Object.defineProperty(e,"description",{get(){return dj.get(e)?.description},configurable:!0}),e.meta=(...s)=>{if(s.length===0)return dj.get(e);const o=e.clone();return dj.add(o,s[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),b6=at("_ZodString",(e,r)=>{n$.init(e,r),ss.init(e,r);const s=e._zod.bag;e.format=s.format??null,e.minLength=s.minimum??null,e.maxLength=s.maximum??null,e.regex=(...o)=>e.check(Pme(...o)),e.includes=(...o)=>e.check(zme(...o)),e.startsWith=(...o)=>e.check(Lme(...o)),e.endsWith=(...o)=>e.check(Fme(...o)),e.min=(...o)=>e.check(tC(...o)),e.max=(...o)=>e.check(v6(...o)),e.length=(...o)=>e.check(x6(...o)),e.nonempty=(...o)=>e.check(tC(1,...o)),e.lowercase=o=>e.check(Mme(o)),e.uppercase=o=>e.check(Ime(o)),e.trim=()=>e.check(Bme()),e.normalize=(...o)=>e.check(qme(...o)),e.toLowerCase=()=>e.check(Ume()),e.toUpperCase=()=>e.check(Kme())}),vge=at("ZodString",(e,r)=>{n$.init(e,r),b6.init(e,r),e.email=s=>e.check(ame(xge,s)),e.url=s=>e.check(ume(bge,s)),e.jwt=s=>e.check(Cme(Pge,s)),e.emoji=s=>e.check(dme(wge,s)),e.guid=s=>e.check(p3(v3,s)),e.uuid=s=>e.check(y6(Eb,s)),e.uuidv4=s=>e.check(ome(Eb,s)),e.uuidv6=s=>e.check(lme(Eb,s)),e.uuidv7=s=>e.check(cme(Eb,s)),e.nanoid=s=>e.check(hme(Sge,s)),e.guid=s=>e.check(p3(v3,s)),e.cuid=s=>e.check(pme(Ege,s)),e.cuid2=s=>e.check(fme(jge,s)),e.ulid=s=>e.check(mme(Cge,s)),e.base64=s=>e.check(Sme($ge,s)),e.base64url=s=>e.check(Eme(Nge,s)),e.xid=s=>e.check(gme(Age,s)),e.ksuid=s=>e.check(yme(Oge,s)),e.ipv4=s=>e.check(vme(kge,s)),e.ipv6=s=>e.check(xme(Rge,s)),e.cidrv4=s=>e.check(bme(Tge,s)),e.cidrv6=s=>e.check(wme(_ge,s)),e.e164=s=>e.check(jme(Dge,s)),e.datetime=s=>e.check(Jme(s)),e.date=s=>e.check(ege(s)),e.time=s=>e.check(nge(s)),e.duration=s=>e.check(sge(s))});function zn(e){return ime(vge,e)}const Lr=at("ZodStringFormat",(e,r)=>{$r.init(e,r),b6.init(e,r)}),xge=at("ZodEmail",(e,r)=>{pfe.init(e,r),Lr.init(e,r)}),v3=at("ZodGUID",(e,r)=>{dfe.init(e,r),Lr.init(e,r)}),Eb=at("ZodUUID",(e,r)=>{hfe.init(e,r),Lr.init(e,r)});function w6(e){return y6(Eb,e)}const bge=at("ZodURL",(e,r)=>{ffe.init(e,r),Lr.init(e,r)}),wge=at("ZodEmoji",(e,r)=>{mfe.init(e,r),Lr.init(e,r)}),Sge=at("ZodNanoID",(e,r)=>{gfe.init(e,r),Lr.init(e,r)}),Ege=at("ZodCUID",(e,r)=>{yfe.init(e,r),Lr.init(e,r)}),jge=at("ZodCUID2",(e,r)=>{vfe.init(e,r),Lr.init(e,r)}),Cge=at("ZodULID",(e,r)=>{xfe.init(e,r),Lr.init(e,r)}),Age=at("ZodXID",(e,r)=>{bfe.init(e,r),Lr.init(e,r)}),Oge=at("ZodKSUID",(e,r)=>{wfe.init(e,r),Lr.init(e,r)}),kge=at("ZodIPv4",(e,r)=>{Afe.init(e,r),Lr.init(e,r)}),Rge=at("ZodIPv6",(e,r)=>{Ofe.init(e,r),Lr.init(e,r)}),Tge=at("ZodCIDRv4",(e,r)=>{kfe.init(e,r),Lr.init(e,r)}),_ge=at("ZodCIDRv6",(e,r)=>{Rfe.init(e,r),Lr.init(e,r)}),$ge=at("ZodBase64",(e,r)=>{Tfe.init(e,r),Lr.init(e,r)}),Nge=at("ZodBase64URL",(e,r)=>{$fe.init(e,r),Lr.init(e,r)}),Dge=at("ZodE164",(e,r)=>{Nfe.init(e,r),Lr.init(e,r)}),Pge=at("ZodJWT",(e,r)=>{Pfe.init(e,r),Lr.init(e,r)}),S6=at("ZodNumber",(e,r)=>{f6.init(e,r),ss.init(e,r),e.gt=(o,d)=>e.check(m3(o,d)),e.gte=(o,d)=>e.check(mT(o,d)),e.min=(o,d)=>e.check(mT(o,d)),e.lt=(o,d)=>e.check(f3(o,d)),e.lte=(o,d)=>e.check(fT(o,d)),e.max=(o,d)=>e.check(fT(o,d)),e.int=o=>e.check(x3(o)),e.safe=o=>e.check(x3(o)),e.positive=o=>e.check(m3(0,o)),e.nonnegative=o=>e.check(mT(0,o)),e.negative=o=>e.check(f3(0,o)),e.nonpositive=o=>e.check(fT(0,o)),e.multipleOf=(o,d)=>e.check(g3(o,d)),e.step=(o,d)=>e.check(g3(o,d)),e.finite=()=>e;const s=e._zod.bag;e.minValue=Math.max(s.minimum??Number.NEGATIVE_INFINITY,s.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(s.maximum??Number.POSITIVE_INFINITY,s.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(s.format??"").includes("int")||Number.isSafeInteger(s.multipleOf??.5),e.isFinite=!0,e.format=s.format??null});function Zb(e){return Tme(S6,e)}const Mge=at("ZodNumberFormat",(e,r)=>{Mfe.init(e,r),S6.init(e,r)});function x3(e){return _me(Mge,e)}const Ige=at("ZodAny",(e,r)=>{Ife.init(e,r),ss.init(e,r)});function b3(){return $me(Ige)}const zge=at("ZodUnknown",(e,r)=>{zfe.init(e,r),ss.init(e,r)});function w3(){return Nme(zge)}const Lge=at("ZodNever",(e,r)=>{Lfe.init(e,r),ss.init(e,r)});function Fge(e){return Dme(Lge,e)}const qge=at("ZodArray",(e,r)=>{Ffe.init(e,r),ss.init(e,r),e.element=r.element,e.min=(s,o)=>e.check(tC(s,o)),e.nonempty=s=>e.check(tC(1,s)),e.max=(s,o)=>e.check(v6(s,o)),e.length=(s,o)=>e.check(x6(s,o)),e.unwrap=()=>e.element});function Bge(e,r){return Vme(qge,e,r)}const Uge=at("ZodObject",(e,r)=>{Bfe.init(e,r),ss.init(e,r),Sr(e,"shape",()=>r.shape),e.keyof=()=>Da(Object.keys(e._zod.def.shape)),e.catchall=s=>e.clone({...e._zod.def,catchall:s}),e.passthrough=()=>e.clone({...e._zod.def,catchall:w3()}),e.loose=()=>e.clone({...e._zod.def,catchall:w3()}),e.strict=()=>e.clone({...e._zod.def,catchall:Fge()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=s=>ape(e,s),e.safeExtend=s=>ope(e,s),e.merge=s=>lpe(e,s),e.pick=s=>spe(e,s),e.omit=s=>ipe(e,s),e.partial=(...s)=>cpe(j6,e,s[0]),e.required=(...s)=>upe(C6,e,s[0])});function Xs(e,r){const s={type:"object",shape:e??{},...Yt(r)};return new Uge(s)}const Kge=at("ZodUnion",(e,r)=>{Ufe.init(e,r),ss.init(e,r),e.options=r.options});function E6(e,r){return new Kge({type:"union",options:e,...Yt(r)})}const Vge=at("ZodIntersection",(e,r)=>{Kfe.init(e,r),ss.init(e,r)});function Hge(e,r){return new Vge({type:"intersection",left:e,right:r})}const g_=at("ZodEnum",(e,r)=>{Vfe.init(e,r),ss.init(e,r),e.enum=r.entries,e.options=Object.values(r.entries);const s=new Set(Object.keys(r.entries));e.extract=(o,d)=>{const p={};for(const m of o)if(s.has(m))p[m]=r.entries[m];else throw new Error(`Key ${m} not found in enum`);return new g_({...r,checks:[],...Yt(d),entries:p})},e.exclude=(o,d)=>{const p={...r.entries};for(const m of o)if(s.has(m))delete p[m];else throw new Error(`Key ${m} not found in enum`);return new g_({...r,checks:[],...Yt(d),entries:p})}});function Da(e,r){const s=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new g_({type:"enum",entries:s,...Yt(r)})}const Gge=at("ZodLiteral",(e,r)=>{Hfe.init(e,r),ss.init(e,r),e.values=new Set(r.values),Object.defineProperty(e,"value",{get(){if(r.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return r.values[0]}})});function Wb(e,r){return new Gge({type:"literal",values:Array.isArray(e)?e:[e],...Yt(r)})}const Xge=at("ZodTransform",(e,r)=>{Gfe.init(e,r),ss.init(e,r),e._zod.parse=(s,o)=>{if(o.direction==="backward")throw new t6(e.constructor.name);s.addIssue=p=>{if(typeof p=="string")s.issues.push(Yb(p,s.value,r));else{const m=p;m.fatal&&(m.continue=!1),m.code??(m.code="custom"),m.input??(m.input=s.value),m.inst??(m.inst=e),s.issues.push(Yb(m))}};const d=r.transform(s.value,s);return d instanceof Promise?d.then(p=>(s.value=p,s)):(s.value=d,s)}});function Yge(e){return new Xge({type:"transform",transform:e})}const j6=at("ZodOptional",(e,r)=>{Xfe.init(e,r),ss.init(e,r),e.unwrap=()=>e._zod.def.innerType});function S3(e){return new j6({type:"optional",innerType:e})}const Zge=at("ZodNullable",(e,r)=>{Yfe.init(e,r),ss.init(e,r),e.unwrap=()=>e._zod.def.innerType});function E3(e){return new Zge({type:"nullable",innerType:e})}const Wge=at("ZodDefault",(e,r)=>{Zfe.init(e,r),ss.init(e,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Jge(e,r){return new Wge({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():s6(r)}})}const Qge=at("ZodPrefault",(e,r)=>{Wfe.init(e,r),ss.init(e,r),e.unwrap=()=>e._zod.def.innerType});function eye(e,r){return new Qge({type:"prefault",innerType:e,get defaultValue(){return typeof r=="function"?r():s6(r)}})}const C6=at("ZodNonOptional",(e,r)=>{Jfe.init(e,r),ss.init(e,r),e.unwrap=()=>e._zod.def.innerType});function tye(e,r){return new C6({type:"nonoptional",innerType:e,...Yt(r)})}const nye=at("ZodCatch",(e,r)=>{Qfe.init(e,r),ss.init(e,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function rye(e,r){return new nye({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}const sye=at("ZodPipe",(e,r)=>{eme.init(e,r),ss.init(e,r),e.in=r.in,e.out=r.out});function j3(e,r){return new sye({type:"pipe",in:e,out:r})}const iye=at("ZodReadonly",(e,r)=>{tme.init(e,r),ss.init(e,r),e.unwrap=()=>e._zod.def.innerType});function aye(e){return new iye({type:"readonly",innerType:e})}const oye=at("ZodCustom",(e,r)=>{nme.init(e,r),ss.init(e,r)});function lye(e,r={}){return Hme(oye,e,r)}function cye(e){return Gme(e)}const Dd={custom:"custom"};var uye=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],dye=uye.reduce((e,r)=>{const s=tw(`Primitive.${r}`),o=R.forwardRef((d,p)=>{const{asChild:m,...g}=d,b=m?s:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(b,{...g,ref:p})});return o.displayName=`Primitive.${r}`,{...e,[r]:o}},{}),hye="Label",A6=R.forwardRef((e,r)=>u.jsx(dye.label,{...e,ref:r,onMouseDown:s=>{s.target.closest("button, input, select, textarea")||(e.onMouseDown?.(s),!s.defaultPrevented&&s.detail>1&&s.preventDefault())}}));A6.displayName=hye;var pye=A6;function xi({className:e,...r}){return u.jsx(pye,{"data-slot":"label",className:ht("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...r})}const yr=Phe,O6=R.createContext({}),yt=({...e})=>u.jsx(O6.Provider,{value:{name:e.name},children:u.jsx(Go,{...e})}),r$=()=>{const e=R.useContext(O6),r=R.useContext(k6),{getFieldState:s}=qC(),o=XF({name:e.name}),d=s(e.name,o);if(!e)throw new Error("useFormField should be used within ");const{id:p}=r;return{id:p,name:e.name,formItemId:`${p}-form-item`,formDescriptionId:`${p}-form-item-description`,formMessageId:`${p}-form-item-message`,...d}},k6=R.createContext({});function lt({className:e,...r}){const s=R.useId();return u.jsx(k6.Provider,{value:{id:s},children:u.jsx("div",{"data-slot":"form-item",className:ht("grid gap-2",e),...r})})}function ct({className:e,...r}){const{error:s,formItemId:o}=r$();return u.jsx(xi,{"data-slot":"form-label","data-error":!!s,className:ht("data-[error=true]:text-destructive",e),htmlFor:o,...r})}function wt({...e}){const{error:r,formItemId:s,formDescriptionId:o,formMessageId:d}=r$();return u.jsx(Cg,{"data-slot":"form-control",id:s,"aria-describedby":r?`${o} ${d}`:`${o}`,"aria-invalid":!!r,...e})}function mt({className:e,...r}){const{error:s,formMessageId:o}=r$(),d=s?String(s?.message??""):r.children;return d?u.jsx("p",{"data-slot":"form-message",id:o,className:ht("text-destructive text-sm",e),...r,children:d}):null}function Fi({className:e,...r}){return u.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:u.jsx("table",{"data-slot":"table",className:ht("w-full caption-bottom text-sm",e),...r})})}function qi({className:e,...r}){return u.jsx("thead",{"data-slot":"table-header",className:ht("[&_tr]:border-b",e),...r})}function Bi({className:e,...r}){return u.jsx("tbody",{"data-slot":"table-body",className:ht("[&_tr:last-child]:border-0",e),...r})}function an({className:e,...r}){return u.jsx("tr",{"data-slot":"table-row",className:ht("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...r})}function At({className:e,...r}){return u.jsx("th",{"data-slot":"table-head",className:ht("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...r})}function vt({className:e,...r}){return u.jsx("td",{"data-slot":"table-cell",className:ht("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...r})}function fye({className:e,...r}){return u.jsx("caption",{"data-slot":"table-caption",className:ht("text-muted-foreground mt-4 text-sm",e),...r})}const R6=Xs({key:zn().trim().min(1,"Key is required").max(120,"Max 120 chars"),value:zn().trim().optional()}),mye=R6.partial();function gye({t:e}){const r=`${e.key}${e.value?`=${e.value}`:""}`;return u.jsxs(rs,{variant:"secondary",className:"font-mono text-xs",children:[u.jsx(gC,{className:"mr-1 h-3 w-3"}),r]})}const yye=()=>{const[e,r]=R.useState(""),[s,o]=R.useState(!1),[d,p]=R.useState(!1),[m,g]=R.useState(null),[b,S]=R.useState(null),E=Hs(),A=rr({queryKey:["annotations"],queryFn:()=>Sb.listAnnotations()}),k=mr({resolver:gr(R6),defaultValues:{key:"",value:""}}),T=nn({mutationFn:z=>Sb.createAnnotation(z),onSuccess:async()=>{await E.invalidateQueries({queryKey:["annotations"]}),k.reset(),o(!1),Ze.success("Annotation Created Successfully.")},onError:z=>{Ze.error(z.message??"There was an error while creating Annotation")}}),M=z=>{T.mutate(z)},I=mr({resolver:gr(mye),defaultValues:{}}),q=nn({mutationFn:({id:z,values:ee})=>Sb.updateAnnotation(z,ee),onSuccess:async()=>{await E.invalidateQueries({queryKey:["annotations"]}),I.reset(),p(!1),Ze.success("Annotation Updated Successfully.")},onError:z=>{Ze.error(z.message??"There was an error while updating Annotation")}}),G=z=>{S(z.id),I.reset({key:z.key,value:z.value}),p(!0)},K=nn({mutationFn:z=>Sb.deleteAnnotation(z),onSuccess:async()=>{await E.invalidateQueries({queryKey:["annotations"]}),g(null),Ze.success("Annotation Deleted Successfully.")},onError:z=>{Ze.error(z.message??"There was an error while deleting Annotation")}}),X=R.useMemo(()=>{const z=A.data??[],ee=e.trim().toLowerCase();return ee?z.filter(oe=>oe.key?.toLowerCase().includes(ee)||oe.value?.toLowerCase().includes(ee)):z},[e,A.data]);return A.isLoading?u.jsx("div",{className:"p-6",children:"Loading annotations…"}):A.error?u.jsxs("div",{className:"p-6 text-red-500",children:["Error loading annotations.",u.jsx("pre",{children:JSON.stringify(A,null,2)})]}):u.jsxs("div",{className:"space-y-4 p-6",children:[u.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[u.jsx("h1",{className:"mb-4 text-2xl font-bold",children:"Annotations"}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsxs("div",{className:"relative",children:[u.jsx(Pa,{className:"absolute top-2.5 left-2 h-4 w-4 opacity-60"}),u.jsx(xt,{value:e,onChange:z=>r(z.target.value),placeholder:"Search annotations",className:"w-64 pl-8"})]}),u.jsxs(fn,{open:s,onOpenChange:o,children:[u.jsx(Li,{asChild:!0,children:u.jsxs(Fe,{onClick:()=>o(!0),children:[u.jsx(lo,{className:"mr-2 h-4 w-4"}),"Create Annotation"]})}),u.jsxs(mn,{className:"sm:max-w-lg",children:[u.jsx(gn,{children:u.jsx(yn,{children:"Create Label"})}),u.jsx(yr,{...k,children:u.jsxs("form",{className:"space-y-4",onSubmit:k.handleSubmit(M),children:[u.jsx(yt,{control:k.control,name:"key",render:({field:z})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Key"}),u.jsx(wt,{children:u.jsx(xt,{placeholder:"environment",...z})}),u.jsx(mt,{})]})}),u.jsx(yt,{control:k.control,name:"value",render:({field:z})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Value"}),u.jsx(wt,{children:u.jsx(xt,{placeholder:"dev",...z})}),u.jsx(mt,{})]})}),u.jsxs(Sn,{className:"gap-2",children:[u.jsx(Fe,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),u.jsx(Fe,{type:"submit",disabled:k.formState.isSubmitting,children:k.formState.isSubmitting?"Creating…":"Create"})]})]})})]})]})]})]}),u.jsx("div",{className:"bg-background overflow-hidden rounded-2xl border shadow-sm",children:u.jsx("div",{className:"overflow-x-auto",children:u.jsxs(Fi,{children:[u.jsx(qi,{children:u.jsxs(an,{children:[u.jsx(At,{children:"Key"}),u.jsx(At,{children:"Value"}),u.jsx(At,{children:"Annotation"}),u.jsx(At,{className:"w-[180px] text-right",children:"Actions"})]})}),u.jsxs(Bi,{children:[X.map(z=>u.jsxs(an,{children:[u.jsx(vt,{children:z.key}),u.jsx(vt,{children:z.value}),u.jsx(vt,{children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(gye,{t:z}),u.jsx("code",{className:"text-muted-foreground text-xs",children:el(z.id,6)})]})}),u.jsx(vt,{children:u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsxs(Fe,{variant:"outline",size:"sm",onClick:()=>G(z),children:[u.jsx(pu,{className:"mr-2 h-4 w-4"})," Edit"]}),u.jsx(Fe,{variant:"destructive",size:"sm",onClick:()=>g(z.id),disabled:K.isPending&&m===z.id,children:K.isPending&&m===z.id?"Deleting…":"Delete"})]})})]},z.id)),X.length===0&&u.jsx(an,{children:u.jsxs(vt,{colSpan:4,className:"text-muted-foreground py-10 text-center",children:[u.jsx(ew,{className:"mx-auto mb-2 h-6 w-6 opacity-60"}),"No labels match your search."]})})]})]})})}),u.jsx(fn,{open:d,onOpenChange:p,children:u.jsxs(mn,{className:"sm:max-w-lg",children:[u.jsx(gn,{children:u.jsx(yn,{children:"Edit Annotation"})}),u.jsx(yr,{...I,children:u.jsxs("form",{className:"space-y-4",onSubmit:I.handleSubmit(z=>{b&&q.mutate({id:b,values:z})}),children:[u.jsx(yt,{control:I.control,name:"key",render:({field:z})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Key"}),u.jsx(wt,{children:u.jsx(xt,{placeholder:"dedicated",...z})}),u.jsx(mt,{})]})}),u.jsx(yt,{control:I.control,name:"value",render:({field:z})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Value (optional)"}),u.jsx(wt,{children:u.jsx(xt,{placeholder:"gpu",...z})}),u.jsx(mt,{})]})}),u.jsxs(Sn,{className:"gap-2",children:[u.jsx(Fe,{type:"button",variant:"outline",onClick:()=>p(!1),children:"Cancel"}),u.jsx(Fe,{type:"submit",disabled:q.isPending,children:q.isPending?"Saving…":"Save changes"})]})]})})]})}),u.jsx(fn,{open:!!m,onOpenChange:z=>!z&&g(null),children:u.jsxs(mn,{className:"sm:max-w-md",children:[u.jsx(gn,{children:u.jsx(yn,{children:"Delete annotation"})}),u.jsx("p",{className:"text-muted-foreground text-sm",children:"This action cannot be undone. Are you sure you want to delete this annotation?"}),u.jsxs(Sn,{className:"gap-2",children:[u.jsx(Fe,{variant:"outline",onClick:()=>g(null),children:"Cancel"}),u.jsx(Fe,{variant:"destructive",onClick:()=>m&&K.mutate(m),disabled:K.isPending,children:K.isPending?"Deleting…":"Delete"})]})]})})]})},Ss=ote(),Es={listClusters:e=>ut(async()=>await Ss.listClusters(e?{q:e}:{})),getCluster:e=>ut(async()=>await Ss.getCluster({clusterID:e})),createCluster:e=>ut(async()=>await Ss.createCluster({dtoCreateClusterRequest:e})),updateCluster:(e,r)=>ut(async()=>await Ss.updateCluster({clusterID:e,dtoUpdateClusterRequest:r})),deleteCluster:e=>ut(async()=>await Ss.deleteCluster({clusterID:e})),setKubeconfig:(e,r)=>ut(async()=>await Ss.setClusterKubeconfig({clusterID:e,dtoSetKubeconfigRequest:r})),clearKubeconfig:e=>ut(async()=>await Ss.clearClusterKubeconfig({clusterID:e})),attachCaptainDomain:(e,r)=>ut(async()=>await Ss.attachCaptainDomain({clusterID:e,dtoAttachCaptainDomainRequest:r})),detachCaptainDomain:e=>ut(async()=>await Ss.detachCaptainDomain({clusterID:e})),attachControlPlaneRecordSet:(e,r)=>ut(async()=>await Ss.attachControlPlaneRecordSet({clusterID:e,dtoAttachRecordSetRequest:r})),detachControlPlaneRecordSet:e=>ut(async()=>await Ss.detachControlPlaneRecordSet({clusterID:e})),attachAppsLoadBalancer:(e,r)=>ut(async()=>await Ss.attachAppsLoadBalancer({clusterID:e,dtoAttachLoadBalancerRequest:r})),detachAppsLoadBalancer:e=>ut(async()=>await Ss.detachAppsLoadBalancer({clusterID:e})),attachGlueOpsLoadBalancer:(e,r)=>ut(async()=>await Ss.attachGlueOpsLoadBalancer({clusterID:e,dtoAttachLoadBalancerRequest:r})),detachGlueOpsLoadBalancer:e=>ut(async()=>await Ss.detachGlueOpsLoadBalancer({clusterID:e})),attachBastion:(e,r)=>ut(async()=>await Ss.attachBastionServer({clusterID:e,dtoAttachBastionRequest:r})),detachBastion:e=>ut(async()=>await Ss.detachBastionServer({clusterID:e})),attachNodePool:(e,r)=>ut(async()=>await Ss.attachNodePool({clusterID:e,dtoAttachNodePoolRequest:{node_pool_id:r}})),detachNodePool:(e,r)=>ut(async()=>await Ss.detachNodePool({clusterID:e,nodePoolID:r}))},uu=ite(),tc={listDomains:()=>ut(async()=>await uu.listDomains()),getDomain:e=>ut(async()=>await uu.getDomain({id:e})),createDomain:async e=>ut(async()=>await uu.createDomain({dtoCreateDomainRequest:e})),updateDomain:async(e,r)=>ut(async()=>await uu.updateDomain({id:e,dtoUpdateDomainRequest:r})),deleteDomain:async e=>ut(async()=>await uu.deleteDomain({id:e})),listRecordSetsByDomain:async e=>ut(async()=>await uu.listRecordSets({domainId:e})),createRecordSetsByDomain:async(e,r)=>ut(async()=>await uu.createRecordSet({domainId:e,dtoCreateRecordSetRequest:r})),updateRecordSetsByDomain:async(e,r)=>ut(async()=>await uu.updateRecordSet({id:e,dtoUpdateRecordSetRequest:r})),deleteRecordSetsByDomain:async e=>ut(async()=>await uu.deleteRecordSet({id:e}))},lb=ate(),jb={listLoadBalancers:()=>ut(async()=>await lb.listLoadBalancers()),getLoadBalancer:e=>ut(async()=>await lb.getLoadBalancers({id:e})),createLoadBalancer:e=>ut(async()=>await lb.createLoadBalancer({dtoCreateLoadBalancerRequest:e})),updateLoadBalancer:(e,r)=>ut(async()=>await lb.updateLoadBalancer({id:e,dtoUpdateLoadBalancerRequest:r})),deleteLoadBalancer:e=>ut(async()=>await lb.deleteLoadBalancer({id:e}))},Bs=rte(),vye=(e,r)=>e?e===r:!0,ka={listNodePools:()=>ut(async()=>await Bs.listNodePools({})),createNodePool:e=>ut(async()=>await Bs.createNodePool({dtoCreateNodePoolRequest:e})),getNodePool:e=>ut(async()=>await Bs.getNodePool({id:e})),deleteNodePool:e=>ut(async()=>{await Bs.deleteNodePool({id:e})}),updateNodePool:(e,r)=>ut(async()=>await Bs.updateNodePool({id:e,dtoUpdateNodePoolRequest:r})),listNodePoolServers:e=>ut(async()=>await Bs.listNodePoolServers({id:e})),attachNodePoolServer:(e,r)=>ut(async()=>await Bs.attachNodePoolServers({id:e,dtoAttachServersRequest:r})),detachNodePoolServers:(e,r)=>ut(async()=>await Bs.detachNodePoolServer({id:e,serverId:r})),listNodePoolTaints:e=>ut(async()=>await Bs.listNodePoolTaints({id:e})),attachNodePoolTaints:(e,r)=>ut(async()=>await Bs.attachNodePoolTaints({id:e,dtoAttachTaintsRequest:r})),detachNodePoolTaints:(e,r)=>ut(async()=>await Bs.detachNodePoolTaint({id:e,taintId:r})),listNodePoolLabels:e=>ut(async()=>await Bs.listNodePoolLabels({id:e})),attachNodePoolLabels:(e,r)=>ut(async()=>await Bs.attachNodePoolLabels({id:e,dtoAttachLabelsRequest:r})),detachNodePoolLabels:(e,r)=>ut(async()=>await Bs.detachNodePoolLabel({id:e,labelId:r})),listNodePoolAnnotations:e=>ut(async()=>await Bs.listNodePoolAnnotations({id:e})),attachNodePoolAnnotations:(e,r)=>ut(async()=>await Bs.attachNodePoolAnnotations({id:e,dtoAttachAnnotationsRequest:r})),detachNodePoolAnnotations:(e,r)=>ut(async()=>await Bs.detachNodePoolAnnotation({id:e,annotationId:r}))},cb=Jee(),hg={listServers:()=>ut(async()=>await cb.listServers()),createServer:e=>ut(async()=>await cb.createServer({dtoCreateServerRequest:e})),getServer:e=>ut(async()=>await cb.getServer({id:e})),updateServer:(e,r)=>ut(async()=>await cb.updateServer({id:e,dtoUpdateServerRequest:r})),deleteServer:e=>ut(async()=>{await cb.deleteServer({id:e})})};function C3(e,[r,s]){return Math.min(s,Math.max(r,e))}function A3(e){const r=xye(e),s=R.forwardRef((o,d)=>{const{children:p,...m}=o,g=R.Children.toArray(p),b=g.find(wye);if(b){const S=b.props.children,E=g.map(A=>A===b?R.Children.count(S)>1?R.Children.only(null):R.isValidElement(S)?S.props.children:null:A);return u.jsx(r,{...m,ref:d,children:R.isValidElement(S)?R.cloneElement(S,void 0,E):null})}return u.jsx(r,{...m,ref:d,children:p})});return s.displayName=`${e}.Slot`,s}function xye(e){const r=R.forwardRef((s,o)=>{const{children:d,...p}=s;if(R.isValidElement(d)){const m=Eye(d),g=Sye(p,d.props);return d.type!==R.Fragment&&(g.ref=o?zi(o,m):m),R.cloneElement(d,g)}return R.Children.count(d)>1?R.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var bye=Symbol("radix.slottable");function wye(e){return R.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===bye}function Sye(e,r){const s={...r};for(const o in r){const d=e[o],p=r[o];/^on[A-Z]/.test(o)?d&&p?s[o]=(...g)=>{const b=p(...g);return d(...g),b}:d&&(s[o]=d):o==="style"?s[o]={...d,...p}:o==="className"&&(s[o]=[d,p].filter(Boolean).join(" "))}return{...e,...s}}function Eye(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning;return s?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}function s$(e){const r=e+"CollectionProvider",[s,o]=al(r),[d,p]=s(r,{collectionRef:{current:null},itemMap:new Map}),m=I=>{const{scope:q,children:G}=I,K=Je.useRef(null),X=Je.useRef(new Map).current;return u.jsx(d,{scope:q,itemMap:X,collectionRef:K,children:G})};m.displayName=r;const g=e+"CollectionSlot",b=A3(g),S=Je.forwardRef((I,q)=>{const{scope:G,children:K}=I,X=p(g,G),z=Ln(q,X.collectionRef);return u.jsx(b,{ref:z,children:K})});S.displayName=g;const E=e+"CollectionItemSlot",A="data-radix-collection-item",k=A3(E),T=Je.forwardRef((I,q)=>{const{scope:G,children:K,...X}=I,z=Je.useRef(null),ee=Ln(q,z),oe=p(E,G);return Je.useEffect(()=>(oe.itemMap.set(z,{ref:z,...X}),()=>void oe.itemMap.delete(z))),u.jsx(k,{[A]:"",ref:ee,children:K})});T.displayName=E;function M(I){const q=p(e+"CollectionConsumer",I);return Je.useCallback(()=>{const K=q.collectionRef.current;if(!K)return[];const X=Array.from(K.querySelectorAll(`[${A}]`));return Array.from(q.itemMap.values()).sort((oe,Q)=>X.indexOf(oe.ref.current)-X.indexOf(Q.ref.current))},[q.collectionRef,q.itemMap])}return[{Provider:m,Slot:S,ItemSlot:T},M,o]}var jye=R.createContext(void 0);function i$(e){const r=R.useContext(jye);return e||r||"ltr"}function Cye(e){const r=Aye(e),s=R.forwardRef((o,d)=>{const{children:p,...m}=o,g=R.Children.toArray(p),b=g.find(kye);if(b){const S=b.props.children,E=g.map(A=>A===b?R.Children.count(S)>1?R.Children.only(null):R.isValidElement(S)?S.props.children:null:A);return u.jsx(r,{...m,ref:d,children:R.isValidElement(S)?R.cloneElement(S,void 0,E):null})}return u.jsx(r,{...m,ref:d,children:p})});return s.displayName=`${e}.Slot`,s}function Aye(e){const r=R.forwardRef((s,o)=>{const{children:d,...p}=s;if(R.isValidElement(d)){const m=Tye(d),g=Rye(p,d.props);return d.type!==R.Fragment&&(g.ref=o?zi(o,m):m),R.cloneElement(d,g)}return R.Children.count(d)>1?R.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var Oye=Symbol("radix.slottable");function kye(e){return R.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Oye}function Rye(e,r){const s={...r};for(const o in r){const d=e[o],p=r[o];/^on[A-Z]/.test(o)?d&&p?s[o]=(...g)=>{const b=p(...g);return d(...g),b}:d&&(s[o]=d):o==="style"?s[o]={...d,...p}:o==="className"&&(s[o]=[d,p].filter(Boolean).join(" "))}return{...e,...s}}function Tye(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning;return s?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}function T6(e){const r=R.useRef({value:e,previous:e});return R.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}var _ye=[" ","Enter","ArrowUp","ArrowDown"],$ye=[" ","Enter"],$p="Select",[XC,YC,Nye]=s$($p),[Mg]=al($p,[Nye,Hd]),ZC=Hd(),[Dye,Wd]=Mg($p),[Pye,Mye]=Mg($p),_6=e=>{const{__scopeSelect:r,children:s,open:o,defaultOpen:d,onOpenChange:p,value:m,defaultValue:g,onValueChange:b,dir:S,name:E,autoComplete:A,disabled:k,required:T,form:M}=e,I=ZC(r),[q,G]=R.useState(null),[K,X]=R.useState(null),[z,ee]=R.useState(!1),oe=i$(S),[Q,ne]=qd({prop:o,defaultProp:d??!1,onChange:p,caller:$p}),[de,Ce]=qd({prop:m,defaultProp:g,onChange:b,caller:$p}),xe=R.useRef(null),le=q?M||!!q.closest("form"):!0,[be,je]=R.useState(new Set),Ke=Array.from(be).map(ce=>ce.props.value).join(";");return u.jsx(SC,{...I,children:u.jsxs(Dye,{required:T,scope:r,trigger:q,onTriggerChange:G,valueNode:K,onValueNodeChange:X,valueNodeHasChildren:z,onValueNodeHasChildrenChange:ee,contentId:Vs(),value:de,onValueChange:Ce,open:Q,onOpenChange:ne,dir:oe,triggerPointerDownPosRef:xe,disabled:k,children:[u.jsx(XC.Provider,{scope:r,children:u.jsx(Pye,{scope:e.__scopeSelect,onNativeOptionAdd:R.useCallback(ce=>{je(re=>new Set(re).add(ce))},[]),onNativeOptionRemove:R.useCallback(ce=>{je(re=>{const ue=new Set(re);return ue.delete(ce),ue})},[]),children:s})}),le?u.jsxs(Q6,{"aria-hidden":!0,required:T,tabIndex:-1,name:E,autoComplete:A,value:de,onChange:ce=>Ce(ce.target.value),disabled:k,form:M,children:[de===void 0?u.jsx("option",{value:""}):null,Array.from(be)]},Ke):null]})})};_6.displayName=$p;var $6="SelectTrigger",N6=R.forwardRef((e,r)=>{const{__scopeSelect:s,disabled:o=!1,...d}=e,p=ZC(s),m=Wd($6,s),g=m.disabled||o,b=Ln(r,m.onTriggerChange),S=YC(s),E=R.useRef("touch"),[A,k,T]=tq(I=>{const q=S().filter(X=>!X.disabled),G=q.find(X=>X.value===m.value),K=nq(q,I,G);K!==void 0&&m.onValueChange(K.value)}),M=I=>{g||(m.onOpenChange(!0),T()),I&&(m.triggerPointerDownPosRef.current={x:Math.round(I.pageX),y:Math.round(I.pageY)})};return u.jsx(rw,{asChild:!0,...p,children:u.jsx(Cn.button,{type:"button",role:"combobox","aria-controls":m.contentId,"aria-expanded":m.open,"aria-required":m.required,"aria-autocomplete":"none",dir:m.dir,"data-state":m.open?"open":"closed",disabled:g,"data-disabled":g?"":void 0,"data-placeholder":eq(m.value)?"":void 0,...d,ref:b,onClick:$t(d.onClick,I=>{I.currentTarget.focus(),E.current!=="mouse"&&M(I)}),onPointerDown:$t(d.onPointerDown,I=>{E.current=I.pointerType;const q=I.target;q.hasPointerCapture(I.pointerId)&&q.releasePointerCapture(I.pointerId),I.button===0&&I.ctrlKey===!1&&I.pointerType==="mouse"&&(M(I),I.preventDefault())}),onKeyDown:$t(d.onKeyDown,I=>{const q=A.current!=="";!(I.ctrlKey||I.altKey||I.metaKey)&&I.key.length===1&&k(I.key),!(q&&I.key===" ")&&_ye.includes(I.key)&&(M(),I.preventDefault())})})})});N6.displayName=$6;var D6="SelectValue",P6=R.forwardRef((e,r)=>{const{__scopeSelect:s,className:o,style:d,children:p,placeholder:m="",...g}=e,b=Wd(D6,s),{onValueNodeHasChildrenChange:S}=b,E=p!==void 0,A=Ln(r,b.onValueNodeChange);return As(()=>{S(E)},[S,E]),u.jsx(Cn.span,{...g,ref:A,style:{pointerEvents:"none"},children:eq(b.value)?u.jsx(u.Fragment,{children:m}):p})});P6.displayName=D6;var Iye="SelectIcon",M6=R.forwardRef((e,r)=>{const{__scopeSelect:s,children:o,...d}=e;return u.jsx(Cn.span,{"aria-hidden":!0,...d,ref:r,children:o||"▼"})});M6.displayName=Iye;var zye="SelectPortal",I6=e=>u.jsx(_g,{asChild:!0,...e});I6.displayName=zye;var Np="SelectContent",z6=R.forwardRef((e,r)=>{const s=Wd(Np,e.__scopeSelect),[o,d]=R.useState();if(As(()=>{d(new DocumentFragment)},[]),!s.open){const p=o;return p?mC.createPortal(u.jsx(L6,{scope:e.__scopeSelect,children:u.jsx(XC.Slot,{scope:e.__scopeSelect,children:u.jsx("div",{children:e.children})})}),p):null}return u.jsx(F6,{...e,ref:r})});z6.displayName=Np;var Yo=10,[L6,Jd]=Mg(Np),Lye="SelectContentImpl",Fye=Cye("SelectContent.RemoveScroll"),F6=R.forwardRef((e,r)=>{const{__scopeSelect:s,position:o="item-aligned",onCloseAutoFocus:d,onEscapeKeyDown:p,onPointerDownOutside:m,side:g,sideOffset:b,align:S,alignOffset:E,arrowPadding:A,collisionBoundary:k,collisionPadding:T,sticky:M,hideWhenDetached:I,avoidCollisions:q,...G}=e,K=Wd(Np,s),[X,z]=R.useState(null),[ee,oe]=R.useState(null),Q=Ln(r,ze=>z(ze)),[ne,de]=R.useState(null),[Ce,xe]=R.useState(null),le=YC(s),[be,je]=R.useState(!1),Ke=R.useRef(!1);R.useEffect(()=>{if(X)return RC(X)},[X]),OC();const ce=R.useCallback(ze=>{const[tt,...ft]=le().map(kt=>kt.ref.current),[Ot]=ft.slice(-1),Ft=document.activeElement;for(const kt of ze)if(kt===Ft||(kt?.scrollIntoView({block:"nearest"}),kt===tt&&ee&&(ee.scrollTop=0),kt===Ot&&ee&&(ee.scrollTop=ee.scrollHeight),kt?.focus(),document.activeElement!==Ft))return},[le,ee]),re=R.useCallback(()=>ce([ne,X]),[ce,ne,X]);R.useEffect(()=>{be&&re()},[be,re]);const{onOpenChange:ue,triggerPointerDownPosRef:_e}=K;R.useEffect(()=>{if(X){let ze={x:0,y:0};const tt=Ot=>{ze={x:Math.abs(Math.round(Ot.pageX)-(_e.current?.x??0)),y:Math.abs(Math.round(Ot.pageY)-(_e.current?.y??0))}},ft=Ot=>{ze.x<=10&&ze.y<=10?Ot.preventDefault():X.contains(Ot.target)||ue(!1),document.removeEventListener("pointermove",tt),_e.current=null};return _e.current!==null&&(document.addEventListener("pointermove",tt),document.addEventListener("pointerup",ft,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",tt),document.removeEventListener("pointerup",ft,{capture:!0})}}},[X,ue,_e]),R.useEffect(()=>{const ze=()=>ue(!1);return window.addEventListener("blur",ze),window.addEventListener("resize",ze),()=>{window.removeEventListener("blur",ze),window.removeEventListener("resize",ze)}},[ue]);const[fe,He]=tq(ze=>{const tt=le().filter(Ft=>!Ft.disabled),ft=tt.find(Ft=>Ft.ref.current===document.activeElement),Ot=nq(tt,ze,ft);Ot&&setTimeout(()=>Ot.ref.current.focus())}),Oe=R.useCallback((ze,tt,ft)=>{const Ot=!Ke.current&&!ft;(K.value!==void 0&&K.value===tt||Ot)&&(de(ze),Ot&&(Ke.current=!0))},[K.value]),ke=R.useCallback(()=>X?.focus(),[X]),Ve=R.useCallback((ze,tt,ft)=>{const Ot=!Ke.current&&!ft;(K.value!==void 0&&K.value===tt||Ot)&&xe(ze)},[K.value]),ie=o==="popper"?y_:q6,Ne=ie===y_?{side:g,sideOffset:b,align:S,alignOffset:E,arrowPadding:A,collisionBoundary:k,collisionPadding:T,sticky:M,hideWhenDetached:I,avoidCollisions:q}:{};return u.jsx(L6,{scope:s,content:X,viewport:ee,onViewportChange:oe,itemRefCallback:Oe,selectedItem:ne,onItemLeave:ke,itemTextRefCallback:Ve,focusSelectedItem:re,selectedItemText:Ce,position:o,isPositioned:be,searchRef:fe,children:u.jsx(lw,{as:Fye,allowPinchZoom:!0,children:u.jsx(ow,{asChild:!0,trapped:K.open,onMountAutoFocus:ze=>{ze.preventDefault()},onUnmountAutoFocus:$t(d,ze=>{K.trigger?.focus({preventScroll:!0}),ze.preventDefault()}),children:u.jsx(kg,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:p,onPointerDownOutside:m,onFocusOutside:ze=>ze.preventDefault(),onDismiss:()=>K.onOpenChange(!1),children:u.jsx(ie,{role:"listbox",id:K.contentId,"data-state":K.open?"open":"closed",dir:K.dir,onContextMenu:ze=>ze.preventDefault(),...G,...Ne,onPlaced:()=>je(!0),ref:Q,style:{display:"flex",flexDirection:"column",outline:"none",...G.style},onKeyDown:$t(G.onKeyDown,ze=>{const tt=ze.ctrlKey||ze.altKey||ze.metaKey;if(ze.key==="Tab"&&ze.preventDefault(),!tt&&ze.key.length===1&&He(ze.key),["ArrowUp","ArrowDown","Home","End"].includes(ze.key)){let Ot=le().filter(Ft=>!Ft.disabled).map(Ft=>Ft.ref.current);if(["ArrowUp","End"].includes(ze.key)&&(Ot=Ot.slice().reverse()),["ArrowUp","ArrowDown"].includes(ze.key)){const Ft=ze.target,kt=Ot.indexOf(Ft);Ot=Ot.slice(kt+1)}setTimeout(()=>ce(Ot)),ze.preventDefault()}})})})})})})});F6.displayName=Lye;var qye="SelectItemAlignedPosition",q6=R.forwardRef((e,r)=>{const{__scopeSelect:s,onPlaced:o,...d}=e,p=Wd(Np,s),m=Jd(Np,s),[g,b]=R.useState(null),[S,E]=R.useState(null),A=Ln(r,Q=>E(Q)),k=YC(s),T=R.useRef(!1),M=R.useRef(!0),{viewport:I,selectedItem:q,selectedItemText:G,focusSelectedItem:K}=m,X=R.useCallback(()=>{if(p.trigger&&p.valueNode&&g&&S&&I&&q&&G){const Q=p.trigger.getBoundingClientRect(),ne=S.getBoundingClientRect(),de=p.valueNode.getBoundingClientRect(),Ce=G.getBoundingClientRect();if(p.dir!=="rtl"){const Ft=Ce.left-ne.left,kt=de.left-Ft,Jt=Q.left-kt,Le=Q.width+Jt,Lt=Math.max(Le,ne.width),Rt=window.innerWidth-Yo,V=C3(kt,[Yo,Math.max(Yo,Rt-Lt)]);g.style.minWidth=Le+"px",g.style.left=V+"px"}else{const Ft=ne.right-Ce.right,kt=window.innerWidth-de.right-Ft,Jt=window.innerWidth-Q.right-kt,Le=Q.width+Jt,Lt=Math.max(Le,ne.width),Rt=window.innerWidth-Yo,V=C3(kt,[Yo,Math.max(Yo,Rt-Lt)]);g.style.minWidth=Le+"px",g.style.right=V+"px"}const xe=k(),le=window.innerHeight-Yo*2,be=I.scrollHeight,je=window.getComputedStyle(S),Ke=parseInt(je.borderTopWidth,10),ce=parseInt(je.paddingTop,10),re=parseInt(je.borderBottomWidth,10),ue=parseInt(je.paddingBottom,10),_e=Ke+ce+be+ue+re,fe=Math.min(q.offsetHeight*5,_e),He=window.getComputedStyle(I),Oe=parseInt(He.paddingTop,10),ke=parseInt(He.paddingBottom,10),Ve=Q.top+Q.height/2-Yo,ie=le-Ve,Ne=q.offsetHeight/2,ze=q.offsetTop+Ne,tt=Ke+ce+ze,ft=_e-tt;if(tt<=Ve){const Ft=xe.length>0&&q===xe[xe.length-1].ref.current;g.style.bottom="0px";const kt=S.clientHeight-I.offsetTop-I.offsetHeight,Jt=Math.max(ie,Ne+(Ft?ke:0)+kt+re),Le=tt+Jt;g.style.height=Le+"px"}else{const Ft=xe.length>0&&q===xe[0].ref.current;g.style.top="0px";const Jt=Math.max(Ve,Ke+I.offsetTop+(Ft?Oe:0)+Ne)+ft;g.style.height=Jt+"px",I.scrollTop=tt-Ve+I.offsetTop}g.style.margin=`${Yo}px 0`,g.style.minHeight=fe+"px",g.style.maxHeight=le+"px",o?.(),requestAnimationFrame(()=>T.current=!0)}},[k,p.trigger,p.valueNode,g,S,I,q,G,p.dir,o]);As(()=>X(),[X]);const[z,ee]=R.useState();As(()=>{S&&ee(window.getComputedStyle(S).zIndex)},[S]);const oe=R.useCallback(Q=>{Q&&M.current===!0&&(X(),K?.(),M.current=!1)},[X,K]);return u.jsx(Uye,{scope:s,contentWrapper:g,shouldExpandOnScrollRef:T,onScrollButtonChange:oe,children:u.jsx("div",{ref:b,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:z},children:u.jsx(Cn.div,{...d,ref:A,style:{boxSizing:"border-box",maxHeight:"100%",...d.style}})})})});q6.displayName=qye;var Bye="SelectPopperPosition",y_=R.forwardRef((e,r)=>{const{__scopeSelect:s,align:o="start",collisionPadding:d=Yo,...p}=e,m=ZC(s);return u.jsx(EC,{...m,...p,ref:r,align:o,collisionPadding:d,style:{boxSizing:"border-box",...p.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)"}})});y_.displayName=Bye;var[Uye,a$]=Mg(Np,{}),v_="SelectViewport",B6=R.forwardRef((e,r)=>{const{__scopeSelect:s,nonce:o,...d}=e,p=Jd(v_,s),m=a$(v_,s),g=Ln(r,p.onViewportChange),b=R.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:o}),u.jsx(XC.Slot,{scope:s,children:u.jsx(Cn.div,{"data-radix-select-viewport":"",role:"presentation",...d,ref:g,style:{position:"relative",flex:1,overflow:"hidden auto",...d.style},onScroll:$t(d.onScroll,S=>{const E=S.currentTarget,{contentWrapper:A,shouldExpandOnScrollRef:k}=m;if(k?.current&&A){const T=Math.abs(b.current-E.scrollTop);if(T>0){const M=window.innerHeight-Yo*2,I=parseFloat(A.style.minHeight),q=parseFloat(A.style.height),G=Math.max(I,q);if(G0?z:0,A.style.justifyContent="flex-end")}}}b.current=E.scrollTop})})})]})});B6.displayName=v_;var U6="SelectGroup",[Kye,Vye]=Mg(U6),Hye=R.forwardRef((e,r)=>{const{__scopeSelect:s,...o}=e,d=Vs();return u.jsx(Kye,{scope:s,id:d,children:u.jsx(Cn.div,{role:"group","aria-labelledby":d,...o,ref:r})})});Hye.displayName=U6;var K6="SelectLabel",Gye=R.forwardRef((e,r)=>{const{__scopeSelect:s,...o}=e,d=Vye(K6,s);return u.jsx(Cn.div,{id:d.id,...o,ref:r})});Gye.displayName=K6;var nC="SelectItem",[Xye,V6]=Mg(nC),H6=R.forwardRef((e,r)=>{const{__scopeSelect:s,value:o,disabled:d=!1,textValue:p,...m}=e,g=Wd(nC,s),b=Jd(nC,s),S=g.value===o,[E,A]=R.useState(p??""),[k,T]=R.useState(!1),M=Ln(r,K=>b.itemRefCallback?.(K,o,d)),I=Vs(),q=R.useRef("touch"),G=()=>{d||(g.onValueChange(o),g.onOpenChange(!1))};if(o==="")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(Xye,{scope:s,value:o,disabled:d,textId:I,isSelected:S,onItemTextChange:R.useCallback(K=>{A(X=>X||(K?.textContent??"").trim())},[]),children:u.jsx(XC.ItemSlot,{scope:s,value:o,disabled:d,textValue:E,children:u.jsx(Cn.div,{role:"option","aria-labelledby":I,"data-highlighted":k?"":void 0,"aria-selected":S&&k,"data-state":S?"checked":"unchecked","aria-disabled":d||void 0,"data-disabled":d?"":void 0,tabIndex:d?void 0:-1,...m,ref:M,onFocus:$t(m.onFocus,()=>T(!0)),onBlur:$t(m.onBlur,()=>T(!1)),onClick:$t(m.onClick,()=>{q.current!=="mouse"&&G()}),onPointerUp:$t(m.onPointerUp,()=>{q.current==="mouse"&&G()}),onPointerDown:$t(m.onPointerDown,K=>{q.current=K.pointerType}),onPointerMove:$t(m.onPointerMove,K=>{q.current=K.pointerType,d?b.onItemLeave?.():q.current==="mouse"&&K.currentTarget.focus({preventScroll:!0})}),onPointerLeave:$t(m.onPointerLeave,K=>{K.currentTarget===document.activeElement&&b.onItemLeave?.()}),onKeyDown:$t(m.onKeyDown,K=>{b.searchRef?.current!==""&&K.key===" "||($ye.includes(K.key)&&G(),K.key===" "&&K.preventDefault())})})})})});H6.displayName=nC;var Cb="SelectItemText",G6=R.forwardRef((e,r)=>{const{__scopeSelect:s,className:o,style:d,...p}=e,m=Wd(Cb,s),g=Jd(Cb,s),b=V6(Cb,s),S=Mye(Cb,s),[E,A]=R.useState(null),k=Ln(r,G=>A(G),b.onItemTextChange,G=>g.itemTextRefCallback?.(G,b.value,b.disabled)),T=E?.textContent,M=R.useMemo(()=>u.jsx("option",{value:b.value,disabled:b.disabled,children:T},b.value),[b.disabled,b.value,T]),{onNativeOptionAdd:I,onNativeOptionRemove:q}=S;return As(()=>(I(M),()=>q(M)),[I,q,M]),u.jsxs(u.Fragment,{children:[u.jsx(Cn.span,{id:b.textId,...p,ref:k}),b.isSelected&&m.valueNode&&!m.valueNodeHasChildren?mC.createPortal(p.children,m.valueNode):null]})});G6.displayName=Cb;var X6="SelectItemIndicator",Y6=R.forwardRef((e,r)=>{const{__scopeSelect:s,...o}=e;return V6(X6,s).isSelected?u.jsx(Cn.span,{"aria-hidden":!0,...o,ref:r}):null});Y6.displayName=X6;var x_="SelectScrollUpButton",Z6=R.forwardRef((e,r)=>{const s=Jd(x_,e.__scopeSelect),o=a$(x_,e.__scopeSelect),[d,p]=R.useState(!1),m=Ln(r,o.onScrollButtonChange);return As(()=>{if(s.viewport&&s.isPositioned){let g=function(){const S=b.scrollTop>0;p(S)};const b=s.viewport;return g(),b.addEventListener("scroll",g),()=>b.removeEventListener("scroll",g)}},[s.viewport,s.isPositioned]),d?u.jsx(J6,{...e,ref:m,onAutoScroll:()=>{const{viewport:g,selectedItem:b}=s;g&&b&&(g.scrollTop=g.scrollTop-b.offsetHeight)}}):null});Z6.displayName=x_;var b_="SelectScrollDownButton",W6=R.forwardRef((e,r)=>{const s=Jd(b_,e.__scopeSelect),o=a$(b_,e.__scopeSelect),[d,p]=R.useState(!1),m=Ln(r,o.onScrollButtonChange);return As(()=>{if(s.viewport&&s.isPositioned){let g=function(){const S=b.scrollHeight-b.clientHeight,E=Math.ceil(b.scrollTop)b.removeEventListener("scroll",g)}},[s.viewport,s.isPositioned]),d?u.jsx(J6,{...e,ref:m,onAutoScroll:()=>{const{viewport:g,selectedItem:b}=s;g&&b&&(g.scrollTop=g.scrollTop+b.offsetHeight)}}):null});W6.displayName=b_;var J6=R.forwardRef((e,r)=>{const{__scopeSelect:s,onAutoScroll:o,...d}=e,p=Jd("SelectScrollButton",s),m=R.useRef(null),g=YC(s),b=R.useCallback(()=>{m.current!==null&&(window.clearInterval(m.current),m.current=null)},[]);return R.useEffect(()=>()=>b(),[b]),As(()=>{g().find(E=>E.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[g]),u.jsx(Cn.div,{"aria-hidden":!0,...d,ref:r,style:{flexShrink:0,...d.style},onPointerDown:$t(d.onPointerDown,()=>{m.current===null&&(m.current=window.setInterval(o,50))}),onPointerMove:$t(d.onPointerMove,()=>{p.onItemLeave?.(),m.current===null&&(m.current=window.setInterval(o,50))}),onPointerLeave:$t(d.onPointerLeave,()=>{b()})})}),Yye="SelectSeparator",Zye=R.forwardRef((e,r)=>{const{__scopeSelect:s,...o}=e;return u.jsx(Cn.div,{"aria-hidden":!0,...o,ref:r})});Zye.displayName=Yye;var w_="SelectArrow",Wye=R.forwardRef((e,r)=>{const{__scopeSelect:s,...o}=e,d=ZC(s),p=Wd(w_,s),m=Jd(w_,s);return p.open&&m.position==="popper"?u.jsx(jC,{...d,...o,ref:r}):null});Wye.displayName=w_;var Jye="SelectBubbleInput",Q6=R.forwardRef(({__scopeSelect:e,value:r,...s},o)=>{const d=R.useRef(null),p=Ln(o,d),m=T6(r);return R.useEffect(()=>{const g=d.current;if(!g)return;const b=window.HTMLSelectElement.prototype,E=Object.getOwnPropertyDescriptor(b,"value").set;if(m!==r&&E){const A=new Event("change",{bubbles:!0});E.call(g,r),g.dispatchEvent(A)}},[m,r]),u.jsx(Cn.select,{...s,style:{...tL,...s.style},ref:p,defaultValue:r})});Q6.displayName=Jye;function eq(e){return e===""||e===void 0}function tq(e){const r=tl(e),s=R.useRef(""),o=R.useRef(0),d=R.useCallback(m=>{const g=s.current+m;r(g),(function b(S){s.current=S,window.clearTimeout(o.current),S!==""&&(o.current=window.setTimeout(()=>b(""),1e3))})(g)},[r]),p=R.useCallback(()=>{s.current="",window.clearTimeout(o.current)},[]);return R.useEffect(()=>()=>window.clearTimeout(o.current),[]),[s,d,p]}function nq(e,r,s){const d=r.length>1&&Array.from(r).every(S=>S===r[0])?r[0]:r,p=s?e.indexOf(s):-1;let m=Qye(e,Math.max(p,0));d.length===1&&(m=m.filter(S=>S!==s));const b=m.find(S=>S.textValue.toLowerCase().startsWith(d.toLowerCase()));return b!==s?b:void 0}function Qye(e,r){return e.map((s,o)=>e[(r+o)%e.length])}var eve=_6,tve=N6,nve=P6,rve=M6,sve=I6,ive=z6,ave=B6,ove=H6,lve=G6,cve=Y6,uve=Z6,dve=W6;function Rn({...e}){return u.jsx(eve,{"data-slot":"select",...e})}function Tn({...e}){return u.jsx(nve,{"data-slot":"select-value",...e})}function _n({className:e,size:r="default",children:s,...o}){return u.jsxs(tve,{"data-slot":"select-trigger","data-size":r,className:ht("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...o,children:[s,u.jsx(rve,{asChild:!0,children:u.jsx(az,{className:"size-4 opacity-50"})})]})}function $n({className:e,children:r,position:s="popper",align:o="center",...d}){return u.jsx(sve,{children:u.jsxs(ive,{"data-slot":"select-content",className:ht("bg-popover text-popover-foreground 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",s==="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:s,align:o,...d,children:[u.jsx(hve,{}),u.jsx(ave,{className:ht("p-1",s==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:r}),u.jsx(pve,{})]})})}function jt({className:e,children:r,...s}){return u.jsxs(ove,{"data-slot":"select-item",className:ht("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...s,children:[u.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:u.jsx(cve,{children:u.jsx(iz,{className:"size-4"})})}),u.jsx(lve,{children:r})]})}function hve({className:e,...r}){return u.jsx(uve,{"data-slot":"select-scroll-up-button",className:ht("flex cursor-default items-center justify-center py-1",e),...r,children:u.jsx(EZ,{className:"size-4"})})}function pve({className:e,...r}){return u.jsx(dve,{"data-slot":"select-scroll-down-button",className:ht("flex cursor-default items-center justify-center py-1",e),...r,children:u.jsx(az,{className:"size-4"})})}function hu({className:e,...r}){return u.jsx("textarea",{"data-slot":"textarea",className:ht("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...r})}const rq=Xs({name:zn().trim().min(1,"Name is required").max(120,"Max 120 chars"),provider:zn().trim().min(1,"Provider is required").max(120,"Max 120 chars"),region:zn().trim().min(1,"Region is required").max(120,"Max 120 chars")}),fve=rq.partial();function mve({status:e}){const r=(e??"").toLowerCase();return r?r==="ready"?u.jsxs(rs,{variant:"default",className:"flex items-center gap-1 text-xs",children:[u.jsx(I_,{className:"h-3 w-3"}),"ready"]}):r==="failed"?u.jsxs(rs,{variant:"destructive",className:"flex items-center gap-1 text-xs",children:[u.jsx(kM,{className:"h-3 w-3"}),"failed"]}):r==="provisioning"||r==="pending"||r==="pre_pending"?u.jsxs(rs,{variant:"secondary",className:"flex items-center gap-1 text-xs",children:[u.jsx(Ds,{className:"h-3 w-3 animate-spin"}),r.replace("_"," ")]}):r==="incomplete"?u.jsxs(rs,{variant:"outline",className:"flex items-center gap-1 text-xs",children:[u.jsx(kM,{className:"h-3 w-3"}),"incomplete"]}):u.jsx(rs,{variant:"outline",className:"text-xs",children:r}):u.jsx(rs,{variant:"outline",className:"text-xs",children:"unknown"})}function gve({c:e}){return u.jsxs("div",{className:"flex flex-col gap-1 text-xs text-muted-foreground",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.provider&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(zZ,{className:"h-3 w-3"}),e.provider]}),e.region&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(rW,{className:"h-3 w-3"}),e.region]})]}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2 font-mono",children:[e.random_token&&u.jsxs("span",{children:["token: ",u.jsx("span",{className:"ml-1",children:el(e.random_token,8)})]}),e.certificate_key&&u.jsxs("span",{children:["cert: ",u.jsx("span",{className:"ml-1",children:el(e.certificate_key,8)})]})]})]})}const yve=()=>{const[e,r]=R.useState(""),[s,o]=R.useState(!1),[d,p]=R.useState(!1),[m,g]=R.useState(null),[b,S]=R.useState(null),[E,A]=R.useState(null),[k,T]=R.useState(""),[M,I]=R.useState(""),[q,G]=R.useState(""),[K,X]=R.useState(""),[z,ee]=R.useState(""),[oe,Q]=R.useState(""),[ne,de]=R.useState(""),[Ce,xe]=R.useState(null),le=W=>Ce===W,be=Hs(),je=rr({queryKey:["clusters"],queryFn:()=>Es.listClusters()}),Ke=rr({queryKey:["load-balancers"],queryFn:()=>jb.listLoadBalancers()}),ce=rr({queryKey:["domains"],queryFn:()=>tc.listDomains()}),re=rr({queryKey:["record-sets",k],enabled:!!k,queryFn:()=>tc.listRecordSetsByDomain(k)}),ue=rr({queryKey:["servers"],queryFn:()=>hg.listServers()}),_e=rr({queryKey:["node-pools"],queryFn:()=>ka.listNodePools()}),fe=mr({resolver:gr(rq),defaultValues:{name:"",provider:"",region:""}}),He=nn({mutationFn:W=>Es.createCluster(W),onSuccess:async()=>{await be.invalidateQueries({queryKey:["clusters"]}),fe.reset(),o(!1),Ze.success("Cluster created successfully.")},onError:W=>{Ze.error(W?.message??"There was an error while creating the cluster")}}),Oe=W=>{He.mutate(W)},ke=mr({resolver:gr(fve),defaultValues:{}}),Ve=nn({mutationFn:({id:W,values:we})=>Es.updateCluster(W,we),onSuccess:async()=>{await be.invalidateQueries({queryKey:["clusters"]}),ke.reset(),p(!1),Ze.success("Cluster updated successfully.")},onError:W=>{Ze.error(W?.message??"There was an error while updating the cluster")}}),ie=W=>{W.id&&(S(W.id),ke.reset({name:W.name??"",provider:W.provider??"",region:W.region??""}),p(!0))},Ne=nn({mutationFn:W=>Es.deleteCluster(W),onSuccess:async()=>{await be.invalidateQueries({queryKey:["clusters"]}),g(null),Ze.success("Cluster deleted successfully.")},onError:W=>{Ze.error(W?.message??"There was an error while deleting the cluster")}}),ze=R.useMemo(()=>{const W=je.data??[],we=e.trim().toLowerCase();return we?W.filter(Re=>Re.name?.toLowerCase().includes(we)||Re.provider?.toLowerCase().includes(we)||Re.region?.toLowerCase().includes(we)||Re.status?.toLowerCase().includes(we)):W},[e,je.data]);R.useEffect(()=>{if(!E){T(""),I(""),G(""),X(""),ee(""),Q(""),de("");return}E.captain_domain?.id&&T(E.captain_domain.id),E.control_plane_record_set?.id&&I(E.control_plane_record_set.id),E.apps_load_balancer?.id&&G(E.apps_load_balancer.id),E.glueops_load_balancer?.id&&X(E.glueops_load_balancer.id),E.bastion_server?.id&&ee(E.bastion_server.id)},[E]);async function tt(){if(E?.id)try{const W=await Es.getCluster(E.id);A(W),await be.invalidateQueries({queryKey:["clusters"]})}catch{}}async function ft(){if(E?.id){if(!k){Ze.error("Domain is required");return}xe("captain");try{await Es.attachCaptainDomain(E.id,{domain_id:k}),Ze.success("Captain domain attached."),await tt()}catch(W){Ze.error(W?.message??"Failed to attach captain domain.")}finally{xe(null)}}}async function Ot(){if(E?.id){xe("captain");try{await Es.detachCaptainDomain(E.id),Ze.success("Captain domain detached."),await tt()}catch(W){Ze.error(W?.message??"Failed to detach captain domain.")}finally{xe(null)}}}async function Ft(){if(E?.id){if(!M){Ze.error("Record set is required");return}xe("recordset");try{await Es.attachControlPlaneRecordSet(E.id,{record_set_id:M}),Ze.success("Control plane record set attached."),await tt()}catch(W){Ze.error(W?.message??"Failed to attach record set.")}finally{xe(null)}}}async function kt(){if(E?.id){xe("recordset");try{await Es.detachControlPlaneRecordSet(E.id),Ze.success("Control plane record set detached."),await tt()}catch(W){Ze.error(W?.message??"Failed to detach record set.")}finally{xe(null)}}}async function Jt(){if(E?.id){if(!q){Ze.error("Load balancer is required");return}xe("apps-lb");try{await Es.attachAppsLoadBalancer(E.id,{load_balancer_id:q}),Ze.success("Apps load balancer attached."),await tt()}catch(W){Ze.error(W?.message??"Failed to attach apps load balancer.")}finally{xe(null)}}}async function Le(){if(E?.id){xe("apps-lb");try{await Es.detachAppsLoadBalancer(E.id),Ze.success("Apps load balancer detached."),await tt()}catch(W){Ze.error(W?.message??"Failed to detach apps load balancer.")}finally{xe(null)}}}async function Lt(){if(E?.id){if(!K){Ze.error("Load balancer is required");return}xe("glueops-lb");try{await Es.attachGlueOpsLoadBalancer(E.id,{load_balancer_id:K}),Ze.success("GlueOps load balancer attached."),await tt()}catch(W){Ze.error(W?.message??"Failed to attach GlueOps load balancer.")}finally{xe(null)}}}async function Rt(){if(E?.id){xe("glueops-lb");try{await Es.detachGlueOpsLoadBalancer(E.id),Ze.success("GlueOps load balancer detached."),await tt()}catch(W){Ze.error(W?.message??"Failed to detach GlueOps load balancer.")}finally{xe(null)}}}async function V(){if(E?.id){if(!z){Ze.error("Server is required");return}xe("bastion");try{await Es.attachBastion(E.id,{server_id:z}),Ze.success("Bastion server attached."),await tt()}catch(W){Ze.error(W?.message??"Failed to attach bastion server.")}finally{xe(null)}}}async function Nn(){if(E?.id){xe("bastion");try{await Es.detachBastion(E.id),Ze.success("Bastion server detached."),await tt()}catch(W){Ze.error(W?.message??"Failed to detach bastion server.")}finally{xe(null)}}}async function cn(){if(E?.id){if(!oe){Ze.error("Node pool is required");return}xe("nodepool");try{await Es.attachNodePool(E.id,oe),Ze.success("Node pool attached."),Q(""),await tt()}catch(W){Ze.error(W?.message??"Failed to attach node pool.")}finally{xe(null)}}}async function ve(W){if(E?.id){xe("nodepool");try{await Es.detachNodePool(E.id,W),Ze.success("Node pool detached."),await tt()}catch(we){Ze.error(we?.message??"Failed to detach node pool.")}finally{xe(null)}}}async function De(){if(E?.id){if(!ne.trim()){Ze.error("Kubeconfig is required");return}xe("kubeconfig");try{await Es.setKubeconfig(E.id,{kubeconfig:ne}),Ze.success("Kubeconfig updated."),de(""),await tt()}catch(W){Ze.error(W?.message??"Failed to set kubeconfig.")}finally{xe(null)}}}async function Ge(){if(E?.id){xe("kubeconfig");try{await Es.clearKubeconfig(E.id),Ze.success("Kubeconfig cleared."),await tt()}catch(W){Ze.error(W?.message??"Failed to clear kubeconfig.")}finally{xe(null)}}}if(je.isLoading)return u.jsx("div",{className:"p-6",children:"Loading clusters…"});if(je.error)return u.jsx("div",{className:"p-6 text-red-500",children:"Error loading clusters."});const D=Ke.data??[],L=D.filter(W=>W.kind==="public"),H=D.filter(W=>W.kind==="glueops");return u.jsxs("div",{className:"space-y-4 p-6",children:[u.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[u.jsx("h1",{className:"mb-4 text-2xl font-bold",children:"Clusters"}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsxs("div",{className:"relative",children:[u.jsx(Pa,{className:"absolute top-2.5 left-2 h-4 w-4 opacity-60"}),u.jsx(xt,{value:e,onChange:W=>r(W.target.value),placeholder:"Search clusters",className:"w-64 pl-8"})]}),u.jsxs(fn,{open:s,onOpenChange:o,children:[u.jsx(Li,{asChild:!0,children:u.jsxs(Fe,{onClick:()=>o(!0),children:[u.jsx(lo,{className:"mr-2 h-4 w-4"}),"Create Cluster"]})}),u.jsxs(mn,{className:"sm:max-w-lg",children:[u.jsx(gn,{children:u.jsx(yn,{children:"Create Cluster"})}),u.jsx(yr,{...fe,children:u.jsxs("form",{className:"space-y-4",onSubmit:fe.handleSubmit(Oe),children:[u.jsx(yt,{control:fe.control,name:"name",render:({field:W})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Name"}),u.jsx(wt,{children:u.jsx(xt,{placeholder:"prod-cluster-eu-west-1",...W})}),u.jsx(mt,{})]})}),u.jsx(yt,{control:fe.control,name:"provider",render:({field:W})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Provider"}),u.jsx(wt,{children:u.jsx(xt,{placeholder:"aws / hetzner / baremetal",...W})}),u.jsx(mt,{})]})}),u.jsx(yt,{control:fe.control,name:"region",render:({field:W})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Region"}),u.jsx(wt,{children:u.jsx(xt,{placeholder:"eu-west-1",...W})}),u.jsx(mt,{})]})}),u.jsxs(Sn,{className:"gap-2",children:[u.jsx(Fe,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),u.jsx(Fe,{type:"submit",disabled:He.isPending,children:He.isPending?"Creating…":"Create"})]})]})})]})]})]})]}),u.jsx("div",{className:"bg-background overflow-hidden rounded-2xl border shadow-sm",children:u.jsx("div",{className:"overflow-x-auto",children:u.jsxs(Fi,{children:[u.jsx(qi,{children:u.jsxs(an,{children:[u.jsx(At,{children:"Name"}),u.jsx(At,{children:"Provider"}),u.jsx(At,{children:"Region"}),u.jsx(At,{children:"Status"}),u.jsx(At,{children:"Summary"}),u.jsx(At,{className:"w-[320px] text-right",children:"Actions"})]})}),u.jsxs(Bi,{children:[ze.map(W=>u.jsxs(an,{children:[u.jsx(vt,{className:"font-medium",children:W.name}),u.jsx(vt,{children:W.provider}),u.jsx(vt,{children:W.region}),u.jsxs(vt,{children:[u.jsx(mve,{status:W.status}),W.last_error&&u.jsx("div",{className:"mt-1 text-xs text-red-500",children:el(W.last_error,80)})]}),u.jsxs(vt,{children:[u.jsx(gve,{c:W}),W.id&&u.jsx("code",{className:"text-muted-foreground mt-1 block text-xs",children:el(W.id,6)})]}),u.jsx(vt,{children:u.jsxs("div",{className:"flex flex-wrap justify-end gap-2",children:[u.jsxs(Fe,{variant:"ghost",size:"sm",onClick:()=>A(W),children:[u.jsx(_W,{className:"mr-1 h-4 w-4"})," Configure"]}),u.jsxs(Fe,{variant:"outline",size:"sm",onClick:()=>ie(W),children:[u.jsx(pu,{className:"mr-2 h-4 w-4"})," Edit"]}),u.jsx(Fe,{variant:"destructive",size:"sm",onClick:()=>W.id&&g(W.id),disabled:Ne.isPending&&m===W.id,children:Ne.isPending&&m===W.id?"Deleting…":"Delete"})]})})]},W.id)),ze.length===0&&u.jsx(an,{children:u.jsxs(vt,{colSpan:6,className:"text-muted-foreground py-10 text-center",children:[u.jsx(ew,{className:"mx-auto mb-2 h-6 w-6 opacity-60"}),"No clusters match your search."]})})]})]})})}),u.jsx(fn,{open:d,onOpenChange:p,children:u.jsxs(mn,{className:"sm:max-w-lg",children:[u.jsx(gn,{children:u.jsx(yn,{children:"Edit Cluster"})}),u.jsx(yr,{...ke,children:u.jsxs("form",{className:"space-y-4",onSubmit:ke.handleSubmit(W=>{b&&Ve.mutate({id:b,values:W})}),children:[u.jsx(yt,{control:ke.control,name:"name",render:({field:W})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Name"}),u.jsx(wt,{children:u.jsx(xt,{placeholder:"prod-cluster-eu-west-1",...W})}),u.jsx(mt,{})]})}),u.jsx(yt,{control:ke.control,name:"provider",render:({field:W})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Provider"}),u.jsx(wt,{children:u.jsx(xt,{placeholder:"aws / hetzner / baremetal",...W})}),u.jsx(mt,{})]})}),u.jsx(yt,{control:ke.control,name:"region",render:({field:W})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Region"}),u.jsx(wt,{children:u.jsx(xt,{placeholder:"eu-west-1",...W})}),u.jsx(mt,{})]})}),u.jsxs(Sn,{className:"gap-2",children:[u.jsx(Fe,{type:"button",variant:"outline",onClick:()=>p(!1),children:"Cancel"}),u.jsx(Fe,{type:"submit",disabled:Ve.isPending,children:Ve.isPending?"Saving…":"Save changes"})]})]})})]})}),u.jsx(fn,{open:!!E,onOpenChange:W=>!W&&A(null),children:u.jsxs(mn,{className:"max-h-[90vh] w-full max-w-3xl overflow-y-auto",children:[u.jsx(gn,{children:u.jsxs(yn,{children:["Configure Cluster",E?.name?`: ${E.name}`:""]})}),E&&u.jsxs("div",{className:"space-y-6 py-2",children:[u.jsxs("section",{className:"space-y-2 rounded-xl border p-4",children:[u.jsx("div",{className:"flex items-center justify-between gap-2",children:u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(KZ,{className:"h-4 w-4"}),u.jsx("h3",{className:"font-semibold text-sm",children:"Kubeconfig"})]}),u.jsx("p",{className:"text-muted-foreground text-xs",children:"Paste the kubeconfig for this cluster. It will be stored encrypted and never returned by the API."})]})}),u.jsx(hu,{value:ne,onChange:W=>de(W.target.value),rows:6,placeholder:`apiVersion: v1 + `)}T.write("payload.value = newResult;"),T.write("return payload;");const K=T.compile();return(X,L)=>K(k,X,L)};let p;const m=Qj,g=!r6.jitless,S=g&&npe.value,j=r.catchall;let A;e._zod.parse=(k,T)=>{A??(A=o.value);const M=k.value;return m(M)?g&&S&&T?.async===!1&&T.jitless!==!0?(p||(p=d(r.shape)),k=p(k,T),j?y6([],M,k,T,A,e):k):s(k,T):(k.issues.push({expected:"object",code:"invalid_type",input:M,inst:e}),k)}});function o3(e,r,s,o){for(const p of e)if(p.issues.length===0)return r.value=p.value,r;const d=e.filter(p=>!dg(p));return d.length===1?(r.value=d[0].value,d[0]):(r.issues.push({code:"invalid_union",input:r.value,inst:s,errors:e.map(p=>p.issues.map(m=>_p(m,o,Tp())))}),r)}const Kfe=at("$ZodUnion",(e,r)=>{Gr.init(e,r),Sr(e._zod,"optin",()=>r.options.some(d=>d._zod.optin==="optional")?"optional":void 0),Sr(e._zod,"optout",()=>r.options.some(d=>d._zod.optout==="optional")?"optional":void 0),Sr(e._zod,"values",()=>{if(r.options.every(d=>d._zod.values))return new Set(r.options.flatMap(d=>Array.from(d._zod.values)))}),Sr(e._zod,"pattern",()=>{if(r.options.every(d=>d._zod.pattern)){const d=r.options.map(p=>p._zod.pattern);return new RegExp(`^(${d.map(p=>e$(p.source)).join("|")})$`)}});const s=r.options.length===1,o=r.options[0]._zod.run;e._zod.parse=(d,p)=>{if(s)return o(d,p);let m=!1;const g=[];for(const b of r.options){const S=b._zod.run({value:d.value,issues:[]},p);if(S instanceof Promise)g.push(S),m=!0;else{if(S.issues.length===0)return S;g.push(S)}}return m?Promise.all(g).then(b=>o3(b,d,e,p)):o3(g,d,e,p)}}),Vfe=at("$ZodIntersection",(e,r)=>{Gr.init(e,r),e._zod.parse=(s,o)=>{const d=s.value,p=r.left._zod.run({value:d,issues:[]},o),m=r.right._zod.run({value:d,issues:[]},o);return p instanceof Promise||m instanceof Promise?Promise.all([p,m]).then(([b,S])=>l3(s,b,S)):l3(s,p,m)}});function g_(e,r){if(e===r)return{valid:!0,data:e};if(e instanceof Date&&r instanceof Date&&+e==+r)return{valid:!0,data:e};if(Gb(e)&&Gb(r)){const s=Object.keys(r),o=Object.keys(e).filter(p=>s.indexOf(p)!==-1),d={...e,...r};for(const p of o){const m=g_(e[p],r[p]);if(!m.valid)return{valid:!1,mergeErrorPath:[p,...m.mergeErrorPath]};d[p]=m.data}return{valid:!0,data:d}}if(Array.isArray(e)&&Array.isArray(r)){if(e.length!==r.length)return{valid:!1,mergeErrorPath:[]};const s=[];for(let o=0;o{Gr.init(e,r);const s=Qhe(r.entries),o=new Set(s);e._zod.values=o,e._zod.pattern=new RegExp(`^(${s.filter(d=>rpe.has(typeof d)).map(d=>typeof d=="string"?Eg(d):d.toString()).join("|")})$`),e._zod.parse=(d,p)=>{const m=d.value;return o.has(m)||d.issues.push({code:"invalid_value",values:s,input:m,inst:e}),d}}),Gfe=at("$ZodLiteral",(e,r)=>{if(Gr.init(e,r),r.values.length===0)throw new Error("Cannot create literal schema with no valid values");const s=new Set(r.values);e._zod.values=s,e._zod.pattern=new RegExp(`^(${r.values.map(o=>typeof o=="string"?Eg(o):o?Eg(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,d)=>{const p=o.value;return s.has(p)||o.issues.push({code:"invalid_value",values:r.values,input:p,inst:e}),o}}),Xfe=at("$ZodTransform",(e,r)=>{Gr.init(e,r),e._zod.parse=(s,o)=>{if(o.direction==="backward")throw new n6(e.constructor.name);const d=r.transform(s.value,s);if(o.async)return(d instanceof Promise?d:Promise.resolve(d)).then(m=>(s.value=m,s));if(d instanceof Promise)throw new gg;return s.value=d,s}});function c3(e,r){return e.issues.length&&r===void 0?{issues:[],value:void 0}:e}const Yfe=at("$ZodOptional",(e,r)=>{Gr.init(e,r),e._zod.optin="optional",e._zod.optout="optional",Sr(e._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,void 0]):void 0),Sr(e._zod,"pattern",()=>{const s=r.innerType._zod.pattern;return s?new RegExp(`^(${e$(s.source)})?$`):void 0}),e._zod.parse=(s,o)=>{if(r.innerType._zod.optin==="optional"){const d=r.innerType._zod.run(s,o);return d instanceof Promise?d.then(p=>c3(p,s.value)):c3(d,s.value)}return s.value===void 0?s:r.innerType._zod.run(s,o)}}),Zfe=at("$ZodNullable",(e,r)=>{Gr.init(e,r),Sr(e._zod,"optin",()=>r.innerType._zod.optin),Sr(e._zod,"optout",()=>r.innerType._zod.optout),Sr(e._zod,"pattern",()=>{const s=r.innerType._zod.pattern;return s?new RegExp(`^(${e$(s.source)}|null)$`):void 0}),Sr(e._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,null]):void 0),e._zod.parse=(s,o)=>s.value===null?s:r.innerType._zod.run(s,o)}),Wfe=at("$ZodDefault",(e,r)=>{Gr.init(e,r),e._zod.optin="optional",Sr(e._zod,"values",()=>r.innerType._zod.values),e._zod.parse=(s,o)=>{if(o.direction==="backward")return r.innerType._zod.run(s,o);if(s.value===void 0)return s.value=r.defaultValue,s;const d=r.innerType._zod.run(s,o);return d instanceof Promise?d.then(p=>u3(p,r)):u3(d,r)}});function u3(e,r){return e.value===void 0&&(e.value=r.defaultValue),e}const Jfe=at("$ZodPrefault",(e,r)=>{Gr.init(e,r),e._zod.optin="optional",Sr(e._zod,"values",()=>r.innerType._zod.values),e._zod.parse=(s,o)=>(o.direction==="backward"||s.value===void 0&&(s.value=r.defaultValue),r.innerType._zod.run(s,o))}),Qfe=at("$ZodNonOptional",(e,r)=>{Gr.init(e,r),Sr(e._zod,"values",()=>{const s=r.innerType._zod.values;return s?new Set([...s].filter(o=>o!==void 0)):void 0}),e._zod.parse=(s,o)=>{const d=r.innerType._zod.run(s,o);return d instanceof Promise?d.then(p=>d3(p,e)):d3(d,e)}});function d3(e,r){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:r}),e}const eme=at("$ZodCatch",(e,r)=>{Gr.init(e,r),Sr(e._zod,"optin",()=>r.innerType._zod.optin),Sr(e._zod,"optout",()=>r.innerType._zod.optout),Sr(e._zod,"values",()=>r.innerType._zod.values),e._zod.parse=(s,o)=>{if(o.direction==="backward")return r.innerType._zod.run(s,o);const d=r.innerType._zod.run(s,o);return d instanceof Promise?d.then(p=>(s.value=p.value,p.issues.length&&(s.value=r.catchValue({...s,error:{issues:p.issues.map(m=>_p(m,o,Tp()))},input:s.value}),s.issues=[]),s)):(s.value=d.value,d.issues.length&&(s.value=r.catchValue({...s,error:{issues:d.issues.map(p=>_p(p,o,Tp()))},input:s.value}),s.issues=[]),s)}}),tme=at("$ZodPipe",(e,r)=>{Gr.init(e,r),Sr(e._zod,"values",()=>r.in._zod.values),Sr(e._zod,"optin",()=>r.in._zod.optin),Sr(e._zod,"optout",()=>r.out._zod.optout),Sr(e._zod,"propValues",()=>r.in._zod.propValues),e._zod.parse=(s,o)=>{if(o.direction==="backward"){const p=r.out._zod.run(s,o);return p instanceof Promise?p.then(m=>lj(m,r.in,o)):lj(p,r.in,o)}const d=r.in._zod.run(s,o);return d instanceof Promise?d.then(p=>lj(p,r.out,o)):lj(d,r.out,o)}});function lj(e,r,s){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:e.value,issues:e.issues},s)}const nme=at("$ZodReadonly",(e,r)=>{Gr.init(e,r),Sr(e._zod,"propValues",()=>r.innerType._zod.propValues),Sr(e._zod,"values",()=>r.innerType._zod.values),Sr(e._zod,"optin",()=>r.innerType?._zod?.optin),Sr(e._zod,"optout",()=>r.innerType?._zod?.optout),e._zod.parse=(s,o)=>{if(o.direction==="backward")return r.innerType._zod.run(s,o);const d=r.innerType._zod.run(s,o);return d instanceof Promise?d.then(h3):h3(d)}});function h3(e){return e.value=Object.freeze(e.value),e}const rme=at("$ZodCustom",(e,r)=>{pa.init(e,r),Gr.init(e,r),e._zod.parse=(s,o)=>s,e._zod.check=s=>{const o=s.value,d=r.fn(o);if(d instanceof Promise)return d.then(p=>p3(p,s,o,e));p3(d,s,o,e)}});function p3(e,r,s,o){if(!e){const d={code:"custom",input:s,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(d.params=o._zod.def.params),r.issues.push(Xb(d))}}var f3;class sme{constructor(){this._map=new WeakMap,this._idmap=new Map}add(r,...s){const o=s[0];if(this._map.set(r,o),o&&typeof o=="object"&&"id"in o){if(this._idmap.has(o.id))throw new Error(`ID ${o.id} already exists in the registry`);this._idmap.set(o.id,r)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(r){const s=this._map.get(r);return s&&typeof s=="object"&&"id"in s&&this._idmap.delete(s.id),this._map.delete(r),this}get(r){const s=r._zod.parent;if(s){const o={...this.get(s)??{}};delete o.id;const d={...o,...this._map.get(r)};return Object.keys(d).length?d:void 0}return this._map.get(r)}has(r){return this._map.has(r)}}function ime(){return new sme}(f3=globalThis).__zod_globalRegistry??(f3.__zod_globalRegistry=ime());const cj=globalThis.__zod_globalRegistry;function ame(e,r){return new e({type:"string",...Yt(r)})}function ome(e,r){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Yt(r)})}function m3(e,r){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Yt(r)})}function v6(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Yt(r)})}function lme(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Yt(r)})}function cme(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Yt(r)})}function ume(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Yt(r)})}function dme(e,r){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Yt(r)})}function hme(e,r){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Yt(r)})}function pme(e,r){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Yt(r)})}function fme(e,r){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Yt(r)})}function mme(e,r){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Yt(r)})}function gme(e,r){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Yt(r)})}function yme(e,r){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Yt(r)})}function vme(e,r){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Yt(r)})}function xme(e,r){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Yt(r)})}function bme(e,r){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Yt(r)})}function wme(e,r){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Yt(r)})}function Sme(e,r){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Yt(r)})}function Eme(e,r){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Yt(r)})}function jme(e,r){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Yt(r)})}function Cme(e,r){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Yt(r)})}function Ame(e,r){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Yt(r)})}function Ome(e,r){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Yt(r)})}function kme(e,r){return new e({type:"string",format:"date",check:"string_format",...Yt(r)})}function Rme(e,r){return new e({type:"string",format:"time",check:"string_format",precision:null,...Yt(r)})}function Tme(e,r){return new e({type:"string",format:"duration",check:"string_format",...Yt(r)})}function _me(e,r){return new e({type:"number",checks:[],...Yt(r)})}function $me(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Yt(r)})}function Nme(e){return new e({type:"any"})}function Dme(e){return new e({type:"unknown"})}function Pme(e,r){return new e({type:"never",...Yt(r)})}function g3(e,r){return new h6({check:"less_than",...Yt(r),value:e,inclusive:!1})}function fT(e,r){return new h6({check:"less_than",...Yt(r),value:e,inclusive:!0})}function y3(e,r){return new p6({check:"greater_than",...Yt(r),value:e,inclusive:!1})}function mT(e,r){return new p6({check:"greater_than",...Yt(r),value:e,inclusive:!0})}function v3(e,r){return new Jpe({check:"multiple_of",...Yt(r),value:e})}function x6(e,r){return new efe({check:"max_length",...Yt(r),maximum:e})}function tC(e,r){return new tfe({check:"min_length",...Yt(r),minimum:e})}function b6(e,r){return new nfe({check:"length_equals",...Yt(r),length:e})}function Mme(e,r){return new rfe({check:"string_format",format:"regex",...Yt(r),pattern:e})}function Ime(e){return new sfe({check:"string_format",format:"lowercase",...Yt(e)})}function Lme(e){return new ife({check:"string_format",format:"uppercase",...Yt(e)})}function zme(e,r){return new afe({check:"string_format",format:"includes",...Yt(r),includes:e})}function Fme(e,r){return new ofe({check:"string_format",format:"starts_with",...Yt(r),prefix:e})}function qme(e,r){return new lfe({check:"string_format",format:"ends_with",...Yt(r),suffix:e})}function Mg(e){return new cfe({check:"overwrite",tx:e})}function Bme(e){return Mg(r=>r.normalize(e))}function Ume(){return Mg(e=>e.trim())}function Kme(){return Mg(e=>e.toLowerCase())}function Vme(){return Mg(e=>e.toUpperCase())}function Hme(){return Mg(e=>tpe(e))}function Gme(e,r,s){return new e({type:"array",element:r,...Yt(s)})}function Xme(e,r,s){return new e({type:"custom",check:"custom",fn:r,...Yt(s)})}function Yme(e){const r=Zme(s=>(s.addIssue=o=>{if(typeof o=="string")s.issues.push(Xb(o,s.value,r._zod.def));else{const d=o;d.fatal&&(d.continue=!1),d.code??(d.code="custom"),d.input??(d.input=s.value),d.inst??(d.inst=r),d.continue??(d.continue=!r._zod.def.abort),s.issues.push(Xb(d))}},e(s.value,s)));return r}function Zme(e,r){const s=new pa({check:"custom",...Yt(r)});return s._zod.check=e,s}function x3(e,r){try{var s=e()}catch(o){return r(o)}return s&&s.then?s.then(void 0,r):s}function Wme(e,r){for(var s={};e.length;){var o=e[0],d=o.code,p=o.message,m=o.path.join(".");if(!s[m])if("unionErrors"in o){var g=o.unionErrors[0].errors[0];s[m]={message:g.message,type:g.code}}else s[m]={message:p,type:d};if("unionErrors"in o&&o.unionErrors.forEach(function(j){return j.errors.forEach(function(A){return e.push(A)})}),r){var b=s[m].types,S=b&&b[o.code];s[m]=Y2(m,r,s,d,S?[].concat(S,o.message):o.message)}e.shift()}return s}function Jme(e,r){for(var s={};e.length;){var o=e[0],d=o.code,p=o.message,m=o.path.join(".");if(!s[m])if(o.code==="invalid_union"&&o.errors.length>0){var g=o.errors[0][0];s[m]={message:g.message,type:g.code}}else s[m]={message:p,type:d};if(o.code==="invalid_union"&&o.errors.forEach(function(j){return j.forEach(function(A){return e.push(A)})}),r){var b=s[m].types,S=b&&b[o.code];s[m]=Y2(m,r,s,d,S?[].concat(S,o.message):o.message)}e.shift()}return s}function gr(e,r,s){if(s===void 0&&(s={}),(function(o){return"_def"in o&&typeof o._def=="object"&&"typeName"in o._def})(e))return function(o,d,p){try{return Promise.resolve(x3(function(){return Promise.resolve(e[s.mode==="sync"?"parse":"parseAsync"](o,r)).then(function(m){return p.shouldUseNativeValidation&&f_({},p),{errors:{},values:s.raw?Object.assign({},o):m}})},function(m){if((function(g){return Array.isArray(g?.issues)})(m))return{values:{},errors:t3(Wme(m.errors,!p.shouldUseNativeValidation&&p.criteriaMode==="all"),p)};throw m}))}catch(m){return Promise.reject(m)}};if((function(o){return"_zod"in o&&typeof o._zod=="object"})(e))return function(o,d,p){try{return Promise.resolve(x3(function(){return Promise.resolve((s.mode==="sync"?mpe:gpe)(e,o,r)).then(function(m){return p.shouldUseNativeValidation&&f_({},p),{errors:{},values:s.raw?Object.assign({},o):m}})},function(m){if((function(g){return g instanceof n$})(m))return{values:{},errors:t3(Jme(m.issues,!p.shouldUseNativeValidation&&p.criteriaMode==="all"),p)};throw m}))}catch(m){return Promise.reject(m)}};throw new Error("Invalid input: not a Zod schema")}const Qme=at("ZodISODateTime",(e,r)=>{Efe.init(e,r),zr.init(e,r)});function ege(e){return Ome(Qme,e)}const tge=at("ZodISODate",(e,r)=>{jfe.init(e,r),zr.init(e,r)});function nge(e){return kme(tge,e)}const rge=at("ZodISOTime",(e,r)=>{Cfe.init(e,r),zr.init(e,r)});function sge(e){return Rme(rge,e)}const ige=at("ZodISODuration",(e,r)=>{Afe.init(e,r),zr.init(e,r)});function age(e){return Tme(ige,e)}const oge=(e,r)=>{n$.init(e,r),e.name="ZodError",Object.defineProperties(e,{format:{value:s=>fpe(e,s)},flatten:{value:s=>ppe(e,s)},addIssue:{value:s=>{e.issues.push(s),e.message=JSON.stringify(e.issues,m_,2)}},addIssues:{value:s=>{e.issues.push(...s),e.message=JSON.stringify(e.issues,m_,2)}},isEmpty:{get(){return e.issues.length===0}}})},co=at("ZodError",oge,{Parent:Error}),lge=UC(co),cge=KC(co),uge=VC(co),dge=HC(co),hge=xpe(co),pge=bpe(co),fge=wpe(co),mge=Spe(co),gge=Epe(co),yge=jpe(co),vge=Cpe(co),xge=Ape(co),rs=at("ZodType",(e,r)=>(Gr.init(e,r),e.def=r,e.type=r.type,Object.defineProperty(e,"_def",{value:r}),e.check=(...s)=>e.clone(Pp(r,{checks:[...r.checks??[],...s.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]})),e.clone=(s,o)=>Zd(e,s,o),e.brand=()=>e,e.register=((s,o)=>(s.add(e,o),e)),e.parse=(s,o)=>lge(e,s,o,{callee:e.parse}),e.safeParse=(s,o)=>uge(e,s,o),e.parseAsync=async(s,o)=>cge(e,s,o,{callee:e.parseAsync}),e.safeParseAsync=async(s,o)=>dge(e,s,o),e.spa=e.safeParseAsync,e.encode=(s,o)=>hge(e,s,o),e.decode=(s,o)=>pge(e,s,o),e.encodeAsync=async(s,o)=>fge(e,s,o),e.decodeAsync=async(s,o)=>mge(e,s,o),e.safeEncode=(s,o)=>gge(e,s,o),e.safeDecode=(s,o)=>yge(e,s,o),e.safeEncodeAsync=async(s,o)=>vge(e,s,o),e.safeDecodeAsync=async(s,o)=>xge(e,s,o),e.refine=(s,o)=>e.check(uye(s,o)),e.superRefine=s=>e.check(dye(s)),e.overwrite=s=>e.check(Mg(s)),e.optional=()=>j3(e),e.nullable=()=>C3(e),e.nullish=()=>j3(C3(e)),e.nonoptional=s=>rye(e,s),e.array=()=>Kge(e),e.or=s=>j6([e,s]),e.and=s=>Xge(e,s),e.transform=s=>A3(e,Wge(s)),e.default=s=>eye(e,s),e.prefault=s=>nye(e,s),e.catch=s=>iye(e,s),e.pipe=s=>A3(e,s),e.readonly=()=>lye(e),e.describe=s=>{const o=e.clone();return cj.add(o,{description:s}),o},Object.defineProperty(e,"description",{get(){return cj.get(e)?.description},configurable:!0}),e.meta=(...s)=>{if(s.length===0)return cj.get(e);const o=e.clone();return cj.add(o,s[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),w6=at("_ZodString",(e,r)=>{r$.init(e,r),rs.init(e,r);const s=e._zod.bag;e.format=s.format??null,e.minLength=s.minimum??null,e.maxLength=s.maximum??null,e.regex=(...o)=>e.check(Mme(...o)),e.includes=(...o)=>e.check(zme(...o)),e.startsWith=(...o)=>e.check(Fme(...o)),e.endsWith=(...o)=>e.check(qme(...o)),e.min=(...o)=>e.check(tC(...o)),e.max=(...o)=>e.check(x6(...o)),e.length=(...o)=>e.check(b6(...o)),e.nonempty=(...o)=>e.check(tC(1,...o)),e.lowercase=o=>e.check(Ime(o)),e.uppercase=o=>e.check(Lme(o)),e.trim=()=>e.check(Ume()),e.normalize=(...o)=>e.check(Bme(...o)),e.toLowerCase=()=>e.check(Kme()),e.toUpperCase=()=>e.check(Vme()),e.slugify=()=>e.check(Hme())}),bge=at("ZodString",(e,r)=>{r$.init(e,r),w6.init(e,r),e.email=s=>e.check(ome(wge,s)),e.url=s=>e.check(dme(Sge,s)),e.jwt=s=>e.check(Ame(Ige,s)),e.emoji=s=>e.check(hme(Ege,s)),e.guid=s=>e.check(m3(b3,s)),e.uuid=s=>e.check(v6(Eb,s)),e.uuidv4=s=>e.check(lme(Eb,s)),e.uuidv6=s=>e.check(cme(Eb,s)),e.uuidv7=s=>e.check(ume(Eb,s)),e.nanoid=s=>e.check(pme(jge,s)),e.guid=s=>e.check(m3(b3,s)),e.cuid=s=>e.check(fme(Cge,s)),e.cuid2=s=>e.check(mme(Age,s)),e.ulid=s=>e.check(gme(Oge,s)),e.base64=s=>e.check(Eme(Dge,s)),e.base64url=s=>e.check(jme(Pge,s)),e.xid=s=>e.check(yme(kge,s)),e.ksuid=s=>e.check(vme(Rge,s)),e.ipv4=s=>e.check(xme(Tge,s)),e.ipv6=s=>e.check(bme(_ge,s)),e.cidrv4=s=>e.check(wme($ge,s)),e.cidrv6=s=>e.check(Sme(Nge,s)),e.e164=s=>e.check(Cme(Mge,s)),e.datetime=s=>e.check(ege(s)),e.date=s=>e.check(nge(s)),e.time=s=>e.check(sge(s)),e.duration=s=>e.check(age(s))});function Ln(e){return ame(bge,e)}const zr=at("ZodStringFormat",(e,r)=>{$r.init(e,r),w6.init(e,r)}),wge=at("ZodEmail",(e,r)=>{ffe.init(e,r),zr.init(e,r)}),b3=at("ZodGUID",(e,r)=>{hfe.init(e,r),zr.init(e,r)}),Eb=at("ZodUUID",(e,r)=>{pfe.init(e,r),zr.init(e,r)});function S6(e){return v6(Eb,e)}const Sge=at("ZodURL",(e,r)=>{mfe.init(e,r),zr.init(e,r)}),Ege=at("ZodEmoji",(e,r)=>{gfe.init(e,r),zr.init(e,r)}),jge=at("ZodNanoID",(e,r)=>{yfe.init(e,r),zr.init(e,r)}),Cge=at("ZodCUID",(e,r)=>{vfe.init(e,r),zr.init(e,r)}),Age=at("ZodCUID2",(e,r)=>{xfe.init(e,r),zr.init(e,r)}),Oge=at("ZodULID",(e,r)=>{bfe.init(e,r),zr.init(e,r)}),kge=at("ZodXID",(e,r)=>{wfe.init(e,r),zr.init(e,r)}),Rge=at("ZodKSUID",(e,r)=>{Sfe.init(e,r),zr.init(e,r)}),Tge=at("ZodIPv4",(e,r)=>{Ofe.init(e,r),zr.init(e,r)}),_ge=at("ZodIPv6",(e,r)=>{kfe.init(e,r),zr.init(e,r)}),$ge=at("ZodCIDRv4",(e,r)=>{Rfe.init(e,r),zr.init(e,r)}),Nge=at("ZodCIDRv6",(e,r)=>{Tfe.init(e,r),zr.init(e,r)}),Dge=at("ZodBase64",(e,r)=>{_fe.init(e,r),zr.init(e,r)}),Pge=at("ZodBase64URL",(e,r)=>{Nfe.init(e,r),zr.init(e,r)}),Mge=at("ZodE164",(e,r)=>{Dfe.init(e,r),zr.init(e,r)}),Ige=at("ZodJWT",(e,r)=>{Mfe.init(e,r),zr.init(e,r)}),E6=at("ZodNumber",(e,r)=>{m6.init(e,r),rs.init(e,r),e.gt=(o,d)=>e.check(y3(o,d)),e.gte=(o,d)=>e.check(mT(o,d)),e.min=(o,d)=>e.check(mT(o,d)),e.lt=(o,d)=>e.check(g3(o,d)),e.lte=(o,d)=>e.check(fT(o,d)),e.max=(o,d)=>e.check(fT(o,d)),e.int=o=>e.check(w3(o)),e.safe=o=>e.check(w3(o)),e.positive=o=>e.check(y3(0,o)),e.nonnegative=o=>e.check(mT(0,o)),e.negative=o=>e.check(g3(0,o)),e.nonpositive=o=>e.check(fT(0,o)),e.multipleOf=(o,d)=>e.check(v3(o,d)),e.step=(o,d)=>e.check(v3(o,d)),e.finite=()=>e;const s=e._zod.bag;e.minValue=Math.max(s.minimum??Number.NEGATIVE_INFINITY,s.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(s.maximum??Number.POSITIVE_INFINITY,s.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(s.format??"").includes("int")||Number.isSafeInteger(s.multipleOf??.5),e.isFinite=!0,e.format=s.format??null});function Yb(e){return _me(E6,e)}const Lge=at("ZodNumberFormat",(e,r)=>{Ife.init(e,r),E6.init(e,r)});function w3(e){return $me(Lge,e)}const zge=at("ZodAny",(e,r)=>{Lfe.init(e,r),rs.init(e,r)});function S3(){return Nme(zge)}const Fge=at("ZodUnknown",(e,r)=>{zfe.init(e,r),rs.init(e,r)});function E3(){return Dme(Fge)}const qge=at("ZodNever",(e,r)=>{Ffe.init(e,r),rs.init(e,r)});function Bge(e){return Pme(qge,e)}const Uge=at("ZodArray",(e,r)=>{qfe.init(e,r),rs.init(e,r),e.element=r.element,e.min=(s,o)=>e.check(tC(s,o)),e.nonempty=s=>e.check(tC(1,s)),e.max=(s,o)=>e.check(x6(s,o)),e.length=(s,o)=>e.check(b6(s,o)),e.unwrap=()=>e.element});function Kge(e,r){return Gme(Uge,e,r)}const Vge=at("ZodObject",(e,r)=>{Ufe.init(e,r),rs.init(e,r),Sr(e,"shape",()=>r.shape),e.keyof=()=>Da(Object.keys(e._zod.def.shape)),e.catchall=s=>e.clone({...e._zod.def,catchall:s}),e.passthrough=()=>e.clone({...e._zod.def,catchall:E3()}),e.loose=()=>e.clone({...e._zod.def,catchall:E3()}),e.strict=()=>e.clone({...e._zod.def,catchall:Bge()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=s=>lpe(e,s),e.safeExtend=s=>cpe(e,s),e.merge=s=>upe(e,s),e.pick=s=>ape(e,s),e.omit=s=>ope(e,s),e.partial=(...s)=>dpe(C6,e,s[0]),e.required=(...s)=>hpe(A6,e,s[0])});function Xs(e,r){const s={type:"object",shape:e??{},...Yt(r)};return new Vge(s)}const Hge=at("ZodUnion",(e,r)=>{Kfe.init(e,r),rs.init(e,r),e.options=r.options});function j6(e,r){return new Hge({type:"union",options:e,...Yt(r)})}const Gge=at("ZodIntersection",(e,r)=>{Vfe.init(e,r),rs.init(e,r)});function Xge(e,r){return new Gge({type:"intersection",left:e,right:r})}const y_=at("ZodEnum",(e,r)=>{Hfe.init(e,r),rs.init(e,r),e.enum=r.entries,e.options=Object.values(r.entries);const s=new Set(Object.keys(r.entries));e.extract=(o,d)=>{const p={};for(const m of o)if(s.has(m))p[m]=r.entries[m];else throw new Error(`Key ${m} not found in enum`);return new y_({...r,checks:[],...Yt(d),entries:p})},e.exclude=(o,d)=>{const p={...r.entries};for(const m of o)if(s.has(m))delete p[m];else throw new Error(`Key ${m} not found in enum`);return new y_({...r,checks:[],...Yt(d),entries:p})}});function Da(e,r){const s=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new y_({type:"enum",entries:s,...Yt(r)})}const Yge=at("ZodLiteral",(e,r)=>{Gfe.init(e,r),rs.init(e,r),e.values=new Set(r.values),Object.defineProperty(e,"value",{get(){if(r.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return r.values[0]}})});function Zb(e,r){return new Yge({type:"literal",values:Array.isArray(e)?e:[e],...Yt(r)})}const Zge=at("ZodTransform",(e,r)=>{Xfe.init(e,r),rs.init(e,r),e._zod.parse=(s,o)=>{if(o.direction==="backward")throw new n6(e.constructor.name);s.addIssue=p=>{if(typeof p=="string")s.issues.push(Xb(p,s.value,r));else{const m=p;m.fatal&&(m.continue=!1),m.code??(m.code="custom"),m.input??(m.input=s.value),m.inst??(m.inst=e),s.issues.push(Xb(m))}};const d=r.transform(s.value,s);return d instanceof Promise?d.then(p=>(s.value=p,s)):(s.value=d,s)}});function Wge(e){return new Zge({type:"transform",transform:e})}const C6=at("ZodOptional",(e,r)=>{Yfe.init(e,r),rs.init(e,r),e.unwrap=()=>e._zod.def.innerType});function j3(e){return new C6({type:"optional",innerType:e})}const Jge=at("ZodNullable",(e,r)=>{Zfe.init(e,r),rs.init(e,r),e.unwrap=()=>e._zod.def.innerType});function C3(e){return new Jge({type:"nullable",innerType:e})}const Qge=at("ZodDefault",(e,r)=>{Wfe.init(e,r),rs.init(e,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function eye(e,r){return new Qge({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():i6(r)}})}const tye=at("ZodPrefault",(e,r)=>{Jfe.init(e,r),rs.init(e,r),e.unwrap=()=>e._zod.def.innerType});function nye(e,r){return new tye({type:"prefault",innerType:e,get defaultValue(){return typeof r=="function"?r():i6(r)}})}const A6=at("ZodNonOptional",(e,r)=>{Qfe.init(e,r),rs.init(e,r),e.unwrap=()=>e._zod.def.innerType});function rye(e,r){return new A6({type:"nonoptional",innerType:e,...Yt(r)})}const sye=at("ZodCatch",(e,r)=>{eme.init(e,r),rs.init(e,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function iye(e,r){return new sye({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}const aye=at("ZodPipe",(e,r)=>{tme.init(e,r),rs.init(e,r),e.in=r.in,e.out=r.out});function A3(e,r){return new aye({type:"pipe",in:e,out:r})}const oye=at("ZodReadonly",(e,r)=>{nme.init(e,r),rs.init(e,r),e.unwrap=()=>e._zod.def.innerType});function lye(e){return new oye({type:"readonly",innerType:e})}const cye=at("ZodCustom",(e,r)=>{rme.init(e,r),rs.init(e,r)});function uye(e,r={}){return Xme(cye,e,r)}function dye(e){return Yme(e)}const Dd={custom:"custom"};var hye=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],pye=hye.reduce((e,r)=>{const s=ew(`Primitive.${r}`),o=R.forwardRef((d,p)=>{const{asChild:m,...g}=d,b=m?s:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(b,{...g,ref:p})});return o.displayName=`Primitive.${r}`,{...e,[r]:o}},{}),fye="Label",O6=R.forwardRef((e,r)=>u.jsx(pye.label,{...e,ref:r,onMouseDown:s=>{s.target.closest("button, input, select, textarea")||(e.onMouseDown?.(s),!s.defaultPrevented&&s.detail>1&&s.preventDefault())}}));O6.displayName=fye;var mye=O6;function xi({className:e,...r}){return u.jsx(mye,{"data-slot":"label",className:ht("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...r})}const yr=Mhe,k6=R.createContext({}),yt=({...e})=>u.jsx(k6.Provider,{value:{name:e.name},children:u.jsx(Go,{...e})}),s$=()=>{const e=R.useContext(k6),r=R.useContext(R6),{getFieldState:s}=qC(),o=YF({name:e.name}),d=s(e.name,o);if(!e)throw new Error("useFormField should be used within ");const{id:p}=r;return{id:p,name:e.name,formItemId:`${p}-form-item`,formDescriptionId:`${p}-form-item-description`,formMessageId:`${p}-form-item-message`,...d}},R6=R.createContext({});function lt({className:e,...r}){const s=R.useId();return u.jsx(R6.Provider,{value:{id:s},children:u.jsx("div",{"data-slot":"form-item",className:ht("grid gap-2",e),...r})})}function ct({className:e,...r}){const{error:s,formItemId:o}=s$();return u.jsx(xi,{"data-slot":"form-label","data-error":!!s,className:ht("data-[error=true]:text-destructive",e),htmlFor:o,...r})}function wt({...e}){const{error:r,formItemId:s,formDescriptionId:o,formMessageId:d}=s$();return u.jsx(Cg,{"data-slot":"form-control",id:s,"aria-describedby":r?`${o} ${d}`:`${o}`,"aria-invalid":!!r,...e})}function mt({className:e,...r}){const{error:s,formMessageId:o}=s$(),d=s?String(s?.message??""):r.children;return d?u.jsx("p",{"data-slot":"form-message",id:o,className:ht("text-destructive text-sm",e),...r,children:d}):null}function Fi({className:e,...r}){return u.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:u.jsx("table",{"data-slot":"table",className:ht("w-full caption-bottom text-sm",e),...r})})}function qi({className:e,...r}){return u.jsx("thead",{"data-slot":"table-header",className:ht("[&_tr]:border-b",e),...r})}function Bi({className:e,...r}){return u.jsx("tbody",{"data-slot":"table-body",className:ht("[&_tr:last-child]:border-0",e),...r})}function an({className:e,...r}){return u.jsx("tr",{"data-slot":"table-row",className:ht("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...r})}function At({className:e,...r}){return u.jsx("th",{"data-slot":"table-head",className:ht("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...r})}function vt({className:e,...r}){return u.jsx("td",{"data-slot":"table-cell",className:ht("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...r})}function gye({className:e,...r}){return u.jsx("caption",{"data-slot":"table-caption",className:ht("text-muted-foreground mt-4 text-sm",e),...r})}const T6=Xs({key:Ln().trim().min(1,"Key is required").max(120,"Max 120 chars"),value:Ln().trim().optional()}),yye=T6.partial();function vye({t:e}){const r=`${e.key}${e.value?`=${e.value}`:""}`;return u.jsxs(ns,{variant:"secondary",className:"font-mono text-xs",children:[u.jsx(gC,{className:"mr-1 h-3 w-3"}),r]})}const xye=()=>{const[e,r]=R.useState(""),[s,o]=R.useState(!1),[d,p]=R.useState(!1),[m,g]=R.useState(null),[b,S]=R.useState(null),j=Hs(),A=rr({queryKey:["annotations"],queryFn:()=>Sb.listAnnotations()}),k=mr({resolver:gr(T6),defaultValues:{key:"",value:""}}),T=nn({mutationFn:L=>Sb.createAnnotation(L),onSuccess:async()=>{await j.invalidateQueries({queryKey:["annotations"]}),k.reset(),o(!1),Ze.success("Annotation Created Successfully.")},onError:L=>{Ze.error(L.message??"There was an error while creating Annotation")}}),M=L=>{T.mutate(L)},I=mr({resolver:gr(yye),defaultValues:{}}),q=nn({mutationFn:({id:L,values:ee})=>Sb.updateAnnotation(L,ee),onSuccess:async()=>{await j.invalidateQueries({queryKey:["annotations"]}),I.reset(),p(!1),Ze.success("Annotation Updated Successfully.")},onError:L=>{Ze.error(L.message??"There was an error while updating Annotation")}}),G=L=>{S(L.id),I.reset({key:L.key,value:L.value}),p(!0)},K=nn({mutationFn:L=>Sb.deleteAnnotation(L),onSuccess:async()=>{await j.invalidateQueries({queryKey:["annotations"]}),g(null),Ze.success("Annotation Deleted Successfully.")},onError:L=>{Ze.error(L.message??"There was an error while deleting Annotation")}}),X=R.useMemo(()=>{const L=A.data??[],ee=e.trim().toLowerCase();return ee?L.filter(oe=>oe.key?.toLowerCase().includes(ee)||oe.value?.toLowerCase().includes(ee)):L},[e,A.data]);return A.isLoading?u.jsx("div",{className:"p-6",children:"Loading annotations…"}):A.error?u.jsxs("div",{className:"p-6 text-red-500",children:["Error loading annotations.",u.jsx("pre",{children:JSON.stringify(A,null,2)})]}):u.jsxs("div",{className:"space-y-4 p-6",children:[u.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[u.jsx("h1",{className:"mb-4 text-2xl font-bold",children:"Annotations"}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsxs("div",{className:"relative",children:[u.jsx(Pa,{className:"absolute top-2.5 left-2 h-4 w-4 opacity-60"}),u.jsx(xt,{value:e,onChange:L=>r(L.target.value),placeholder:"Search annotations",className:"w-64 pl-8"})]}),u.jsxs(fn,{open:s,onOpenChange:o,children:[u.jsx(zi,{asChild:!0,children:u.jsxs(Fe,{onClick:()=>o(!0),children:[u.jsx(oo,{className:"mr-2 h-4 w-4"}),"Create Annotation"]})}),u.jsxs(mn,{className:"sm:max-w-lg",children:[u.jsx(gn,{children:u.jsx(yn,{children:"Create Label"})}),u.jsx(yr,{...k,children:u.jsxs("form",{className:"space-y-4",onSubmit:k.handleSubmit(M),children:[u.jsx(yt,{control:k.control,name:"key",render:({field:L})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Key"}),u.jsx(wt,{children:u.jsx(xt,{placeholder:"environment",...L})}),u.jsx(mt,{})]})}),u.jsx(yt,{control:k.control,name:"value",render:({field:L})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Value"}),u.jsx(wt,{children:u.jsx(xt,{placeholder:"dev",...L})}),u.jsx(mt,{})]})}),u.jsxs(Sn,{className:"gap-2",children:[u.jsx(Fe,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),u.jsx(Fe,{type:"submit",disabled:k.formState.isSubmitting,children:k.formState.isSubmitting?"Creating…":"Create"})]})]})})]})]})]})]}),u.jsx("div",{className:"bg-background overflow-hidden rounded-2xl border shadow-sm",children:u.jsx("div",{className:"overflow-x-auto",children:u.jsxs(Fi,{children:[u.jsx(qi,{children:u.jsxs(an,{children:[u.jsx(At,{children:"Key"}),u.jsx(At,{children:"Value"}),u.jsx(At,{children:"Annotation"}),u.jsx(At,{className:"w-[180px] text-right",children:"Actions"})]})}),u.jsxs(Bi,{children:[X.map(L=>u.jsxs(an,{children:[u.jsx(vt,{children:L.key}),u.jsx(vt,{children:L.value}),u.jsx(vt,{children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(vye,{t:L}),u.jsx("code",{className:"text-muted-foreground text-xs",children:el(L.id,6)})]})}),u.jsx(vt,{children:u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsxs(Fe,{variant:"outline",size:"sm",onClick:()=>G(L),children:[u.jsx(pu,{className:"mr-2 h-4 w-4"})," Edit"]}),u.jsx(Fe,{variant:"destructive",size:"sm",onClick:()=>g(L.id),disabled:K.isPending&&m===L.id,children:K.isPending&&m===L.id?"Deleting…":"Delete"})]})})]},L.id)),X.length===0&&u.jsx(an,{children:u.jsxs(vt,{colSpan:4,className:"text-muted-foreground py-10 text-center",children:[u.jsx(Qb,{className:"mx-auto mb-2 h-6 w-6 opacity-60"}),"No labels match your search."]})})]})]})})}),u.jsx(fn,{open:d,onOpenChange:p,children:u.jsxs(mn,{className:"sm:max-w-lg",children:[u.jsx(gn,{children:u.jsx(yn,{children:"Edit Annotation"})}),u.jsx(yr,{...I,children:u.jsxs("form",{className:"space-y-4",onSubmit:I.handleSubmit(L=>{b&&q.mutate({id:b,values:L})}),children:[u.jsx(yt,{control:I.control,name:"key",render:({field:L})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Key"}),u.jsx(wt,{children:u.jsx(xt,{placeholder:"dedicated",...L})}),u.jsx(mt,{})]})}),u.jsx(yt,{control:I.control,name:"value",render:({field:L})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Value (optional)"}),u.jsx(wt,{children:u.jsx(xt,{placeholder:"gpu",...L})}),u.jsx(mt,{})]})}),u.jsxs(Sn,{className:"gap-2",children:[u.jsx(Fe,{type:"button",variant:"outline",onClick:()=>p(!1),children:"Cancel"}),u.jsx(Fe,{type:"submit",disabled:q.isPending,children:q.isPending?"Saving…":"Save changes"})]})]})})]})}),u.jsx(fn,{open:!!m,onOpenChange:L=>!L&&g(null),children:u.jsxs(mn,{className:"sm:max-w-md",children:[u.jsx(gn,{children:u.jsx(yn,{children:"Delete annotation"})}),u.jsx("p",{className:"text-muted-foreground text-sm",children:"This action cannot be undone. Are you sure you want to delete this annotation?"}),u.jsxs(Sn,{className:"gap-2",children:[u.jsx(Fe,{variant:"outline",onClick:()=>g(null),children:"Cancel"}),u.jsx(Fe,{variant:"destructive",onClick:()=>m&&K.mutate(m),disabled:K.isPending,children:K.isPending?"Deleting…":"Delete"})]})]})})]})},ws=lte(),Ss={listClusters:e=>ut(async()=>await ws.listClusters(e?{q:e}:{})),getCluster:e=>ut(async()=>await ws.getCluster({clusterID:e})),createCluster:e=>ut(async()=>await ws.createCluster({dtoCreateClusterRequest:e})),updateCluster:(e,r)=>ut(async()=>await ws.updateCluster({clusterID:e,dtoUpdateClusterRequest:r})),deleteCluster:e=>ut(async()=>await ws.deleteCluster({clusterID:e})),setKubeconfig:(e,r)=>ut(async()=>await ws.setClusterKubeconfig({clusterID:e,dtoSetKubeconfigRequest:r})),clearKubeconfig:e=>ut(async()=>await ws.clearClusterKubeconfig({clusterID:e})),attachCaptainDomain:(e,r)=>ut(async()=>await ws.attachCaptainDomain({clusterID:e,dtoAttachCaptainDomainRequest:r})),detachCaptainDomain:e=>ut(async()=>await ws.detachCaptainDomain({clusterID:e})),attachControlPlaneRecordSet:(e,r)=>ut(async()=>await ws.attachControlPlaneRecordSet({clusterID:e,dtoAttachRecordSetRequest:r})),detachControlPlaneRecordSet:e=>ut(async()=>await ws.detachControlPlaneRecordSet({clusterID:e})),attachAppsLoadBalancer:(e,r)=>ut(async()=>await ws.attachAppsLoadBalancer({clusterID:e,dtoAttachLoadBalancerRequest:r})),detachAppsLoadBalancer:e=>ut(async()=>await ws.detachAppsLoadBalancer({clusterID:e})),attachGlueOpsLoadBalancer:(e,r)=>ut(async()=>await ws.attachGlueOpsLoadBalancer({clusterID:e,dtoAttachLoadBalancerRequest:r})),detachGlueOpsLoadBalancer:e=>ut(async()=>await ws.detachGlueOpsLoadBalancer({clusterID:e})),attachBastion:(e,r)=>ut(async()=>await ws.attachBastionServer({clusterID:e,dtoAttachBastionRequest:r})),detachBastion:e=>ut(async()=>await ws.detachBastionServer({clusterID:e})),attachNodePool:(e,r)=>ut(async()=>await ws.attachNodePool({clusterID:e,dtoAttachNodePoolRequest:{node_pool_id:r}})),detachNodePool:(e,r)=>ut(async()=>await ws.detachNodePool({clusterID:e,nodePoolID:r}))},uu=ate(),tc={listDomains:()=>ut(async()=>await uu.listDomains()),getDomain:e=>ut(async()=>await uu.getDomain({id:e})),createDomain:async e=>ut(async()=>await uu.createDomain({dtoCreateDomainRequest:e})),updateDomain:async(e,r)=>ut(async()=>await uu.updateDomain({id:e,dtoUpdateDomainRequest:r})),deleteDomain:async e=>ut(async()=>await uu.deleteDomain({id:e})),listRecordSetsByDomain:async e=>ut(async()=>await uu.listRecordSets({domainId:e})),createRecordSetsByDomain:async(e,r)=>ut(async()=>await uu.createRecordSet({domainId:e,dtoCreateRecordSetRequest:r})),updateRecordSetsByDomain:async(e,r)=>ut(async()=>await uu.updateRecordSet({id:e,dtoUpdateRecordSetRequest:r})),deleteRecordSetsByDomain:async e=>ut(async()=>await uu.deleteRecordSet({id:e}))},cb=ote(),jb={listLoadBalancers:()=>ut(async()=>await cb.listLoadBalancers()),getLoadBalancer:e=>ut(async()=>await cb.getLoadBalancers({id:e})),createLoadBalancer:e=>ut(async()=>await cb.createLoadBalancer({dtoCreateLoadBalancerRequest:e})),updateLoadBalancer:(e,r)=>ut(async()=>await cb.updateLoadBalancer({id:e,dtoUpdateLoadBalancerRequest:r})),deleteLoadBalancer:e=>ut(async()=>await cb.deleteLoadBalancer({id:e}))},Bs=ste(),bye=(e,r)=>e?e===r:!0,ka={listNodePools:()=>ut(async()=>await Bs.listNodePools({})),createNodePool:e=>ut(async()=>await Bs.createNodePool({dtoCreateNodePoolRequest:e})),getNodePool:e=>ut(async()=>await Bs.getNodePool({id:e})),deleteNodePool:e=>ut(async()=>{await Bs.deleteNodePool({id:e})}),updateNodePool:(e,r)=>ut(async()=>await Bs.updateNodePool({id:e,dtoUpdateNodePoolRequest:r})),listNodePoolServers:e=>ut(async()=>await Bs.listNodePoolServers({id:e})),attachNodePoolServer:(e,r)=>ut(async()=>await Bs.attachNodePoolServers({id:e,dtoAttachServersRequest:r})),detachNodePoolServers:(e,r)=>ut(async()=>await Bs.detachNodePoolServer({id:e,serverId:r})),listNodePoolTaints:e=>ut(async()=>await Bs.listNodePoolTaints({id:e})),attachNodePoolTaints:(e,r)=>ut(async()=>await Bs.attachNodePoolTaints({id:e,dtoAttachTaintsRequest:r})),detachNodePoolTaints:(e,r)=>ut(async()=>await Bs.detachNodePoolTaint({id:e,taintId:r})),listNodePoolLabels:e=>ut(async()=>await Bs.listNodePoolLabels({id:e})),attachNodePoolLabels:(e,r)=>ut(async()=>await Bs.attachNodePoolLabels({id:e,dtoAttachLabelsRequest:r})),detachNodePoolLabels:(e,r)=>ut(async()=>await Bs.detachNodePoolLabel({id:e,labelId:r})),listNodePoolAnnotations:e=>ut(async()=>await Bs.listNodePoolAnnotations({id:e})),attachNodePoolAnnotations:(e,r)=>ut(async()=>await Bs.attachNodePoolAnnotations({id:e,dtoAttachAnnotationsRequest:r})),detachNodePoolAnnotations:(e,r)=>ut(async()=>await Bs.detachNodePoolAnnotation({id:e,annotationId:r}))},ub=Qee(),hg={listServers:()=>ut(async()=>await ub.listServers()),createServer:e=>ut(async()=>await ub.createServer({dtoCreateServerRequest:e})),getServer:e=>ut(async()=>await ub.getServer({id:e})),updateServer:(e,r)=>ut(async()=>await ub.updateServer({id:e,dtoUpdateServerRequest:r})),deleteServer:e=>ut(async()=>{await ub.deleteServer({id:e})})};function O3(e,[r,s]){return Math.min(s,Math.max(r,e))}function k3(e){const r=wye(e),s=R.forwardRef((o,d)=>{const{children:p,...m}=o,g=R.Children.toArray(p),b=g.find(Eye);if(b){const S=b.props.children,j=g.map(A=>A===b?R.Children.count(S)>1?R.Children.only(null):R.isValidElement(S)?S.props.children:null:A);return u.jsx(r,{...m,ref:d,children:R.isValidElement(S)?R.cloneElement(S,void 0,j):null})}return u.jsx(r,{...m,ref:d,children:p})});return s.displayName=`${e}.Slot`,s}function wye(e){const r=R.forwardRef((s,o)=>{const{children:d,...p}=s;if(R.isValidElement(d)){const m=Cye(d),g=jye(p,d.props);return d.type!==R.Fragment&&(g.ref=o?Li(o,m):m),R.cloneElement(d,g)}return R.Children.count(d)>1?R.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var Sye=Symbol("radix.slottable");function Eye(e){return R.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Sye}function jye(e,r){const s={...r};for(const o in r){const d=e[o],p=r[o];/^on[A-Z]/.test(o)?d&&p?s[o]=(...g)=>{const b=p(...g);return d(...g),b}:d&&(s[o]=d):o==="style"?s[o]={...d,...p}:o==="className"&&(s[o]=[d,p].filter(Boolean).join(" "))}return{...e,...s}}function Cye(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning;return s?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}function i$(e){const r=e+"CollectionProvider",[s,o]=al(r),[d,p]=s(r,{collectionRef:{current:null},itemMap:new Map}),m=I=>{const{scope:q,children:G}=I,K=Je.useRef(null),X=Je.useRef(new Map).current;return u.jsx(d,{scope:q,itemMap:X,collectionRef:K,children:G})};m.displayName=r;const g=e+"CollectionSlot",b=k3(g),S=Je.forwardRef((I,q)=>{const{scope:G,children:K}=I,X=p(g,G),L=zn(q,X.collectionRef);return u.jsx(b,{ref:L,children:K})});S.displayName=g;const j=e+"CollectionItemSlot",A="data-radix-collection-item",k=k3(j),T=Je.forwardRef((I,q)=>{const{scope:G,children:K,...X}=I,L=Je.useRef(null),ee=zn(q,L),oe=p(j,G);return Je.useEffect(()=>(oe.itemMap.set(L,{ref:L,...X}),()=>void oe.itemMap.delete(L))),u.jsx(k,{[A]:"",ref:ee,children:K})});T.displayName=j;function M(I){const q=p(e+"CollectionConsumer",I);return Je.useCallback(()=>{const K=q.collectionRef.current;if(!K)return[];const X=Array.from(K.querySelectorAll(`[${A}]`));return Array.from(q.itemMap.values()).sort((oe,Q)=>X.indexOf(oe.ref.current)-X.indexOf(Q.ref.current))},[q.collectionRef,q.itemMap])}return[{Provider:m,Slot:S,ItemSlot:T},M,o]}var Aye=R.createContext(void 0);function a$(e){const r=R.useContext(Aye);return e||r||"ltr"}function Oye(e){const r=kye(e),s=R.forwardRef((o,d)=>{const{children:p,...m}=o,g=R.Children.toArray(p),b=g.find(Tye);if(b){const S=b.props.children,j=g.map(A=>A===b?R.Children.count(S)>1?R.Children.only(null):R.isValidElement(S)?S.props.children:null:A);return u.jsx(r,{...m,ref:d,children:R.isValidElement(S)?R.cloneElement(S,void 0,j):null})}return u.jsx(r,{...m,ref:d,children:p})});return s.displayName=`${e}.Slot`,s}function kye(e){const r=R.forwardRef((s,o)=>{const{children:d,...p}=s;if(R.isValidElement(d)){const m=$ye(d),g=_ye(p,d.props);return d.type!==R.Fragment&&(g.ref=o?Li(o,m):m),R.cloneElement(d,g)}return R.Children.count(d)>1?R.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var Rye=Symbol("radix.slottable");function Tye(e){return R.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Rye}function _ye(e,r){const s={...r};for(const o in r){const d=e[o],p=r[o];/^on[A-Z]/.test(o)?d&&p?s[o]=(...g)=>{const b=p(...g);return d(...g),b}:d&&(s[o]=d):o==="style"?s[o]={...d,...p}:o==="className"&&(s[o]=[d,p].filter(Boolean).join(" "))}return{...e,...s}}function $ye(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning;return s?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}function _6(e){const r=R.useRef({value:e,previous:e});return R.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}var Nye=[" ","Enter","ArrowUp","ArrowDown"],Dye=[" ","Enter"],$p="Select",[XC,YC,Pye]=i$($p),[Ig]=al($p,[Pye,Hd]),ZC=Hd(),[Mye,Wd]=Ig($p),[Iye,Lye]=Ig($p),$6=e=>{const{__scopeSelect:r,children:s,open:o,defaultOpen:d,onOpenChange:p,value:m,defaultValue:g,onValueChange:b,dir:S,name:j,autoComplete:A,disabled:k,required:T,form:M}=e,I=ZC(r),[q,G]=R.useState(null),[K,X]=R.useState(null),[L,ee]=R.useState(!1),oe=a$(S),[Q,ne]=qd({prop:o,defaultProp:d??!1,onChange:p,caller:$p}),[de,je]=qd({prop:m,defaultProp:g,onChange:b,caller:$p}),ve=R.useRef(null),le=q?M||!!q.closest("form"):!0,[be,Ce]=R.useState(new Set),Ke=Array.from(be).map(ce=>ce.props.value).join(";");return u.jsx(SC,{...I,children:u.jsxs(Mye,{required:T,scope:r,trigger:q,onTriggerChange:G,valueNode:K,onValueNodeChange:X,valueNodeHasChildren:L,onValueNodeHasChildrenChange:ee,contentId:Vs(),value:de,onValueChange:je,open:Q,onOpenChange:ne,dir:oe,triggerPointerDownPosRef:ve,disabled:k,children:[u.jsx(XC.Provider,{scope:r,children:u.jsx(Iye,{scope:e.__scopeSelect,onNativeOptionAdd:R.useCallback(ce=>{Ce(re=>new Set(re).add(ce))},[]),onNativeOptionRemove:R.useCallback(ce=>{Ce(re=>{const ue=new Set(re);return ue.delete(ce),ue})},[]),children:s})}),le?u.jsxs(eq,{"aria-hidden":!0,required:T,tabIndex:-1,name:j,autoComplete:A,value:de,onChange:ce=>je(ce.target.value),disabled:k,form:M,children:[de===void 0?u.jsx("option",{value:""}):null,Array.from(be)]},Ke):null]})})};$6.displayName=$p;var N6="SelectTrigger",D6=R.forwardRef((e,r)=>{const{__scopeSelect:s,disabled:o=!1,...d}=e,p=ZC(s),m=Wd(N6,s),g=m.disabled||o,b=zn(r,m.onTriggerChange),S=YC(s),j=R.useRef("touch"),[A,k,T]=nq(I=>{const q=S().filter(X=>!X.disabled),G=q.find(X=>X.value===m.value),K=rq(q,I,G);K!==void 0&&m.onValueChange(K.value)}),M=I=>{g||(m.onOpenChange(!0),T()),I&&(m.triggerPointerDownPosRef.current={x:Math.round(I.pageX),y:Math.round(I.pageY)})};return u.jsx(nw,{asChild:!0,...p,children:u.jsx(Cn.button,{type:"button",role:"combobox","aria-controls":m.contentId,"aria-expanded":m.open,"aria-required":m.required,"aria-autocomplete":"none",dir:m.dir,"data-state":m.open?"open":"closed",disabled:g,"data-disabled":g?"":void 0,"data-placeholder":tq(m.value)?"":void 0,...d,ref:b,onClick:$t(d.onClick,I=>{I.currentTarget.focus(),j.current!=="mouse"&&M(I)}),onPointerDown:$t(d.onPointerDown,I=>{j.current=I.pointerType;const q=I.target;q.hasPointerCapture(I.pointerId)&&q.releasePointerCapture(I.pointerId),I.button===0&&I.ctrlKey===!1&&I.pointerType==="mouse"&&(M(I),I.preventDefault())}),onKeyDown:$t(d.onKeyDown,I=>{const q=A.current!=="";!(I.ctrlKey||I.altKey||I.metaKey)&&I.key.length===1&&k(I.key),!(q&&I.key===" ")&&Nye.includes(I.key)&&(M(),I.preventDefault())})})})});D6.displayName=N6;var P6="SelectValue",M6=R.forwardRef((e,r)=>{const{__scopeSelect:s,className:o,style:d,children:p,placeholder:m="",...g}=e,b=Wd(P6,s),{onValueNodeHasChildrenChange:S}=b,j=p!==void 0,A=zn(r,b.onValueNodeChange);return As(()=>{S(j)},[S,j]),u.jsx(Cn.span,{...g,ref:A,style:{pointerEvents:"none"},children:tq(b.value)?u.jsx(u.Fragment,{children:m}):p})});M6.displayName=P6;var zye="SelectIcon",I6=R.forwardRef((e,r)=>{const{__scopeSelect:s,children:o,...d}=e;return u.jsx(Cn.span,{"aria-hidden":!0,...d,ref:r,children:o||"▼"})});I6.displayName=zye;var Fye="SelectPortal",L6=e=>u.jsx(_g,{asChild:!0,...e});L6.displayName=Fye;var Np="SelectContent",z6=R.forwardRef((e,r)=>{const s=Wd(Np,e.__scopeSelect),[o,d]=R.useState();if(As(()=>{d(new DocumentFragment)},[]),!s.open){const p=o;return p?mC.createPortal(u.jsx(F6,{scope:e.__scopeSelect,children:u.jsx(XC.Slot,{scope:e.__scopeSelect,children:u.jsx("div",{children:e.children})})}),p):null}return u.jsx(q6,{...e,ref:r})});z6.displayName=Np;var Yo=10,[F6,Jd]=Ig(Np),qye="SelectContentImpl",Bye=Oye("SelectContent.RemoveScroll"),q6=R.forwardRef((e,r)=>{const{__scopeSelect:s,position:o="item-aligned",onCloseAutoFocus:d,onEscapeKeyDown:p,onPointerDownOutside:m,side:g,sideOffset:b,align:S,alignOffset:j,arrowPadding:A,collisionBoundary:k,collisionPadding:T,sticky:M,hideWhenDetached:I,avoidCollisions:q,...G}=e,K=Wd(Np,s),[X,L]=R.useState(null),[ee,oe]=R.useState(null),Q=zn(r,Le=>L(Le)),[ne,de]=R.useState(null),[je,ve]=R.useState(null),le=YC(s),[be,Ce]=R.useState(!1),Ke=R.useRef(!1);R.useEffect(()=>{if(X)return RC(X)},[X]),OC();const ce=R.useCallback(Le=>{const[tt,...ft]=le().map(kt=>kt.ref.current),[Ot]=ft.slice(-1),Ft=document.activeElement;for(const kt of Le)if(kt===Ft||(kt?.scrollIntoView({block:"nearest"}),kt===tt&&ee&&(ee.scrollTop=0),kt===Ot&&ee&&(ee.scrollTop=ee.scrollHeight),kt?.focus(),document.activeElement!==Ft))return},[le,ee]),re=R.useCallback(()=>ce([ne,X]),[ce,ne,X]);R.useEffect(()=>{be&&re()},[be,re]);const{onOpenChange:ue,triggerPointerDownPosRef:_e}=K;R.useEffect(()=>{if(X){let Le={x:0,y:0};const tt=Ot=>{Le={x:Math.abs(Math.round(Ot.pageX)-(_e.current?.x??0)),y:Math.abs(Math.round(Ot.pageY)-(_e.current?.y??0))}},ft=Ot=>{Le.x<=10&&Le.y<=10?Ot.preventDefault():X.contains(Ot.target)||ue(!1),document.removeEventListener("pointermove",tt),_e.current=null};return _e.current!==null&&(document.addEventListener("pointermove",tt),document.addEventListener("pointerup",ft,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",tt),document.removeEventListener("pointerup",ft,{capture:!0})}}},[X,ue,_e]),R.useEffect(()=>{const Le=()=>ue(!1);return window.addEventListener("blur",Le),window.addEventListener("resize",Le),()=>{window.removeEventListener("blur",Le),window.removeEventListener("resize",Le)}},[ue]);const[fe,He]=nq(Le=>{const tt=le().filter(Ft=>!Ft.disabled),ft=tt.find(Ft=>Ft.ref.current===document.activeElement),Ot=rq(tt,Le,ft);Ot&&setTimeout(()=>Ot.ref.current.focus())}),Oe=R.useCallback((Le,tt,ft)=>{const Ot=!Ke.current&&!ft;(K.value!==void 0&&K.value===tt||Ot)&&(de(Le),Ot&&(Ke.current=!0))},[K.value]),ke=R.useCallback(()=>X?.focus(),[X]),Ve=R.useCallback((Le,tt,ft)=>{const Ot=!Ke.current&&!ft;(K.value!==void 0&&K.value===tt||Ot)&&ve(Le)},[K.value]),ie=o==="popper"?v_:B6,De=ie===v_?{side:g,sideOffset:b,align:S,alignOffset:j,arrowPadding:A,collisionBoundary:k,collisionPadding:T,sticky:M,hideWhenDetached:I,avoidCollisions:q}:{};return u.jsx(F6,{scope:s,content:X,viewport:ee,onViewportChange:oe,itemRefCallback:Oe,selectedItem:ne,onItemLeave:ke,itemTextRefCallback:Ve,focusSelectedItem:re,selectedItemText:je,position:o,isPositioned:be,searchRef:fe,children:u.jsx(ow,{as:Bye,allowPinchZoom:!0,children:u.jsx(aw,{asChild:!0,trapped:K.open,onMountAutoFocus:Le=>{Le.preventDefault()},onUnmountAutoFocus:$t(d,Le=>{K.trigger?.focus({preventScroll:!0}),Le.preventDefault()}),children:u.jsx(kg,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:p,onPointerDownOutside:m,onFocusOutside:Le=>Le.preventDefault(),onDismiss:()=>K.onOpenChange(!1),children:u.jsx(ie,{role:"listbox",id:K.contentId,"data-state":K.open?"open":"closed",dir:K.dir,onContextMenu:Le=>Le.preventDefault(),...G,...De,onPlaced:()=>Ce(!0),ref:Q,style:{display:"flex",flexDirection:"column",outline:"none",...G.style},onKeyDown:$t(G.onKeyDown,Le=>{const tt=Le.ctrlKey||Le.altKey||Le.metaKey;if(Le.key==="Tab"&&Le.preventDefault(),!tt&&Le.key.length===1&&He(Le.key),["ArrowUp","ArrowDown","Home","End"].includes(Le.key)){let Ot=le().filter(Ft=>!Ft.disabled).map(Ft=>Ft.ref.current);if(["ArrowUp","End"].includes(Le.key)&&(Ot=Ot.slice().reverse()),["ArrowUp","ArrowDown"].includes(Le.key)){const Ft=Le.target,kt=Ot.indexOf(Ft);Ot=Ot.slice(kt+1)}setTimeout(()=>ce(Ot)),Le.preventDefault()}})})})})})})});q6.displayName=qye;var Uye="SelectItemAlignedPosition",B6=R.forwardRef((e,r)=>{const{__scopeSelect:s,onPlaced:o,...d}=e,p=Wd(Np,s),m=Jd(Np,s),[g,b]=R.useState(null),[S,j]=R.useState(null),A=zn(r,Q=>j(Q)),k=YC(s),T=R.useRef(!1),M=R.useRef(!0),{viewport:I,selectedItem:q,selectedItemText:G,focusSelectedItem:K}=m,X=R.useCallback(()=>{if(p.trigger&&p.valueNode&&g&&S&&I&&q&&G){const Q=p.trigger.getBoundingClientRect(),ne=S.getBoundingClientRect(),de=p.valueNode.getBoundingClientRect(),je=G.getBoundingClientRect();if(p.dir!=="rtl"){const Ft=je.left-ne.left,kt=de.left-Ft,Jt=Q.left-kt,ze=Q.width+Jt,zt=Math.max(ze,ne.width),Rt=window.innerWidth-Yo,V=O3(kt,[Yo,Math.max(Yo,Rt-zt)]);g.style.minWidth=ze+"px",g.style.left=V+"px"}else{const Ft=ne.right-je.right,kt=window.innerWidth-de.right-Ft,Jt=window.innerWidth-Q.right-kt,ze=Q.width+Jt,zt=Math.max(ze,ne.width),Rt=window.innerWidth-Yo,V=O3(kt,[Yo,Math.max(Yo,Rt-zt)]);g.style.minWidth=ze+"px",g.style.right=V+"px"}const ve=k(),le=window.innerHeight-Yo*2,be=I.scrollHeight,Ce=window.getComputedStyle(S),Ke=parseInt(Ce.borderTopWidth,10),ce=parseInt(Ce.paddingTop,10),re=parseInt(Ce.borderBottomWidth,10),ue=parseInt(Ce.paddingBottom,10),_e=Ke+ce+be+ue+re,fe=Math.min(q.offsetHeight*5,_e),He=window.getComputedStyle(I),Oe=parseInt(He.paddingTop,10),ke=parseInt(He.paddingBottom,10),Ve=Q.top+Q.height/2-Yo,ie=le-Ve,De=q.offsetHeight/2,Le=q.offsetTop+De,tt=Ke+ce+Le,ft=_e-tt;if(tt<=Ve){const Ft=ve.length>0&&q===ve[ve.length-1].ref.current;g.style.bottom="0px";const kt=S.clientHeight-I.offsetTop-I.offsetHeight,Jt=Math.max(ie,De+(Ft?ke:0)+kt+re),ze=tt+Jt;g.style.height=ze+"px"}else{const Ft=ve.length>0&&q===ve[0].ref.current;g.style.top="0px";const Jt=Math.max(Ve,Ke+I.offsetTop+(Ft?Oe:0)+De)+ft;g.style.height=Jt+"px",I.scrollTop=tt-Ve+I.offsetTop}g.style.margin=`${Yo}px 0`,g.style.minHeight=fe+"px",g.style.maxHeight=le+"px",o?.(),requestAnimationFrame(()=>T.current=!0)}},[k,p.trigger,p.valueNode,g,S,I,q,G,p.dir,o]);As(()=>X(),[X]);const[L,ee]=R.useState();As(()=>{S&&ee(window.getComputedStyle(S).zIndex)},[S]);const oe=R.useCallback(Q=>{Q&&M.current===!0&&(X(),K?.(),M.current=!1)},[X,K]);return u.jsx(Vye,{scope:s,contentWrapper:g,shouldExpandOnScrollRef:T,onScrollButtonChange:oe,children:u.jsx("div",{ref:b,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:L},children:u.jsx(Cn.div,{...d,ref:A,style:{boxSizing:"border-box",maxHeight:"100%",...d.style}})})})});B6.displayName=Uye;var Kye="SelectPopperPosition",v_=R.forwardRef((e,r)=>{const{__scopeSelect:s,align:o="start",collisionPadding:d=Yo,...p}=e,m=ZC(s);return u.jsx(EC,{...m,...p,ref:r,align:o,collisionPadding:d,style:{boxSizing:"border-box",...p.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)"}})});v_.displayName=Kye;var[Vye,o$]=Ig(Np,{}),x_="SelectViewport",U6=R.forwardRef((e,r)=>{const{__scopeSelect:s,nonce:o,...d}=e,p=Jd(x_,s),m=o$(x_,s),g=zn(r,p.onViewportChange),b=R.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:o}),u.jsx(XC.Slot,{scope:s,children:u.jsx(Cn.div,{"data-radix-select-viewport":"",role:"presentation",...d,ref:g,style:{position:"relative",flex:1,overflow:"hidden auto",...d.style},onScroll:$t(d.onScroll,S=>{const j=S.currentTarget,{contentWrapper:A,shouldExpandOnScrollRef:k}=m;if(k?.current&&A){const T=Math.abs(b.current-j.scrollTop);if(T>0){const M=window.innerHeight-Yo*2,I=parseFloat(A.style.minHeight),q=parseFloat(A.style.height),G=Math.max(I,q);if(G0?L:0,A.style.justifyContent="flex-end")}}}b.current=j.scrollTop})})})]})});U6.displayName=x_;var K6="SelectGroup",[Hye,Gye]=Ig(K6),Xye=R.forwardRef((e,r)=>{const{__scopeSelect:s,...o}=e,d=Vs();return u.jsx(Hye,{scope:s,id:d,children:u.jsx(Cn.div,{role:"group","aria-labelledby":d,...o,ref:r})})});Xye.displayName=K6;var V6="SelectLabel",Yye=R.forwardRef((e,r)=>{const{__scopeSelect:s,...o}=e,d=Gye(V6,s);return u.jsx(Cn.div,{id:d.id,...o,ref:r})});Yye.displayName=V6;var nC="SelectItem",[Zye,H6]=Ig(nC),G6=R.forwardRef((e,r)=>{const{__scopeSelect:s,value:o,disabled:d=!1,textValue:p,...m}=e,g=Wd(nC,s),b=Jd(nC,s),S=g.value===o,[j,A]=R.useState(p??""),[k,T]=R.useState(!1),M=zn(r,K=>b.itemRefCallback?.(K,o,d)),I=Vs(),q=R.useRef("touch"),G=()=>{d||(g.onValueChange(o),g.onOpenChange(!1))};if(o==="")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(Zye,{scope:s,value:o,disabled:d,textId:I,isSelected:S,onItemTextChange:R.useCallback(K=>{A(X=>X||(K?.textContent??"").trim())},[]),children:u.jsx(XC.ItemSlot,{scope:s,value:o,disabled:d,textValue:j,children:u.jsx(Cn.div,{role:"option","aria-labelledby":I,"data-highlighted":k?"":void 0,"aria-selected":S&&k,"data-state":S?"checked":"unchecked","aria-disabled":d||void 0,"data-disabled":d?"":void 0,tabIndex:d?void 0:-1,...m,ref:M,onFocus:$t(m.onFocus,()=>T(!0)),onBlur:$t(m.onBlur,()=>T(!1)),onClick:$t(m.onClick,()=>{q.current!=="mouse"&&G()}),onPointerUp:$t(m.onPointerUp,()=>{q.current==="mouse"&&G()}),onPointerDown:$t(m.onPointerDown,K=>{q.current=K.pointerType}),onPointerMove:$t(m.onPointerMove,K=>{q.current=K.pointerType,d?b.onItemLeave?.():q.current==="mouse"&&K.currentTarget.focus({preventScroll:!0})}),onPointerLeave:$t(m.onPointerLeave,K=>{K.currentTarget===document.activeElement&&b.onItemLeave?.()}),onKeyDown:$t(m.onKeyDown,K=>{b.searchRef?.current!==""&&K.key===" "||(Dye.includes(K.key)&&G(),K.key===" "&&K.preventDefault())})})})})});G6.displayName=nC;var Cb="SelectItemText",X6=R.forwardRef((e,r)=>{const{__scopeSelect:s,className:o,style:d,...p}=e,m=Wd(Cb,s),g=Jd(Cb,s),b=H6(Cb,s),S=Lye(Cb,s),[j,A]=R.useState(null),k=zn(r,G=>A(G),b.onItemTextChange,G=>g.itemTextRefCallback?.(G,b.value,b.disabled)),T=j?.textContent,M=R.useMemo(()=>u.jsx("option",{value:b.value,disabled:b.disabled,children:T},b.value),[b.disabled,b.value,T]),{onNativeOptionAdd:I,onNativeOptionRemove:q}=S;return As(()=>(I(M),()=>q(M)),[I,q,M]),u.jsxs(u.Fragment,{children:[u.jsx(Cn.span,{id:b.textId,...p,ref:k}),b.isSelected&&m.valueNode&&!m.valueNodeHasChildren?mC.createPortal(p.children,m.valueNode):null]})});X6.displayName=Cb;var Y6="SelectItemIndicator",Z6=R.forwardRef((e,r)=>{const{__scopeSelect:s,...o}=e;return H6(Y6,s).isSelected?u.jsx(Cn.span,{"aria-hidden":!0,...o,ref:r}):null});Z6.displayName=Y6;var b_="SelectScrollUpButton",W6=R.forwardRef((e,r)=>{const s=Jd(b_,e.__scopeSelect),o=o$(b_,e.__scopeSelect),[d,p]=R.useState(!1),m=zn(r,o.onScrollButtonChange);return As(()=>{if(s.viewport&&s.isPositioned){let g=function(){const S=b.scrollTop>0;p(S)};const b=s.viewport;return g(),b.addEventListener("scroll",g),()=>b.removeEventListener("scroll",g)}},[s.viewport,s.isPositioned]),d?u.jsx(Q6,{...e,ref:m,onAutoScroll:()=>{const{viewport:g,selectedItem:b}=s;g&&b&&(g.scrollTop=g.scrollTop-b.offsetHeight)}}):null});W6.displayName=b_;var w_="SelectScrollDownButton",J6=R.forwardRef((e,r)=>{const s=Jd(w_,e.__scopeSelect),o=o$(w_,e.__scopeSelect),[d,p]=R.useState(!1),m=zn(r,o.onScrollButtonChange);return As(()=>{if(s.viewport&&s.isPositioned){let g=function(){const S=b.scrollHeight-b.clientHeight,j=Math.ceil(b.scrollTop)b.removeEventListener("scroll",g)}},[s.viewport,s.isPositioned]),d?u.jsx(Q6,{...e,ref:m,onAutoScroll:()=>{const{viewport:g,selectedItem:b}=s;g&&b&&(g.scrollTop=g.scrollTop+b.offsetHeight)}}):null});J6.displayName=w_;var Q6=R.forwardRef((e,r)=>{const{__scopeSelect:s,onAutoScroll:o,...d}=e,p=Jd("SelectScrollButton",s),m=R.useRef(null),g=YC(s),b=R.useCallback(()=>{m.current!==null&&(window.clearInterval(m.current),m.current=null)},[]);return R.useEffect(()=>()=>b(),[b]),As(()=>{g().find(j=>j.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[g]),u.jsx(Cn.div,{"aria-hidden":!0,...d,ref:r,style:{flexShrink:0,...d.style},onPointerDown:$t(d.onPointerDown,()=>{m.current===null&&(m.current=window.setInterval(o,50))}),onPointerMove:$t(d.onPointerMove,()=>{p.onItemLeave?.(),m.current===null&&(m.current=window.setInterval(o,50))}),onPointerLeave:$t(d.onPointerLeave,()=>{b()})})}),Wye="SelectSeparator",Jye=R.forwardRef((e,r)=>{const{__scopeSelect:s,...o}=e;return u.jsx(Cn.div,{"aria-hidden":!0,...o,ref:r})});Jye.displayName=Wye;var S_="SelectArrow",Qye=R.forwardRef((e,r)=>{const{__scopeSelect:s,...o}=e,d=ZC(s),p=Wd(S_,s),m=Jd(S_,s);return p.open&&m.position==="popper"?u.jsx(jC,{...d,...o,ref:r}):null});Qye.displayName=S_;var eve="SelectBubbleInput",eq=R.forwardRef(({__scopeSelect:e,value:r,...s},o)=>{const d=R.useRef(null),p=zn(o,d),m=_6(r);return R.useEffect(()=>{const g=d.current;if(!g)return;const b=window.HTMLSelectElement.prototype,j=Object.getOwnPropertyDescriptor(b,"value").set;if(m!==r&&j){const A=new Event("change",{bubbles:!0});j.call(g,r),g.dispatchEvent(A)}},[m,r]),u.jsx(Cn.select,{...s,style:{...nz,...s.style},ref:p,defaultValue:r})});eq.displayName=eve;function tq(e){return e===""||e===void 0}function nq(e){const r=tl(e),s=R.useRef(""),o=R.useRef(0),d=R.useCallback(m=>{const g=s.current+m;r(g),(function b(S){s.current=S,window.clearTimeout(o.current),S!==""&&(o.current=window.setTimeout(()=>b(""),1e3))})(g)},[r]),p=R.useCallback(()=>{s.current="",window.clearTimeout(o.current)},[]);return R.useEffect(()=>()=>window.clearTimeout(o.current),[]),[s,d,p]}function rq(e,r,s){const d=r.length>1&&Array.from(r).every(S=>S===r[0])?r[0]:r,p=s?e.indexOf(s):-1;let m=tve(e,Math.max(p,0));d.length===1&&(m=m.filter(S=>S!==s));const b=m.find(S=>S.textValue.toLowerCase().startsWith(d.toLowerCase()));return b!==s?b:void 0}function tve(e,r){return e.map((s,o)=>e[(r+o)%e.length])}var nve=$6,rve=D6,sve=M6,ive=I6,ave=L6,ove=z6,lve=U6,cve=G6,uve=X6,dve=Z6,hve=W6,pve=J6;function Rn({...e}){return u.jsx(nve,{"data-slot":"select",...e})}function Tn({...e}){return u.jsx(sve,{"data-slot":"select-value",...e})}function _n({className:e,size:r="default",children:s,...o}){return u.jsxs(rve,{"data-slot":"select-trigger","data-size":r,className:ht("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...o,children:[s,u.jsx(ive,{asChild:!0,children:u.jsx(oL,{className:"size-4 opacity-50"})})]})}function $n({className:e,children:r,position:s="popper",align:o="center",...d}){return u.jsx(ave,{children:u.jsxs(ove,{"data-slot":"select-content",className:ht("bg-popover text-popover-foreground 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",s==="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:s,align:o,...d,children:[u.jsx(fve,{}),u.jsx(lve,{className:ht("p-1",s==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:r}),u.jsx(mve,{})]})})}function jt({className:e,children:r,...s}){return u.jsxs(cve,{"data-slot":"select-item",className:ht("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...s,children:[u.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:u.jsx(dve,{children:u.jsx(aL,{className:"size-4"})})}),u.jsx(uve,{children:r})]})}function fve({className:e,...r}){return u.jsx(hve,{"data-slot":"select-scroll-up-button",className:ht("flex cursor-default items-center justify-center py-1",e),...r,children:u.jsx(jZ,{className:"size-4"})})}function mve({className:e,...r}){return u.jsx(pve,{"data-slot":"select-scroll-down-button",className:ht("flex cursor-default items-center justify-center py-1",e),...r,children:u.jsx(oL,{className:"size-4"})})}function hu({className:e,...r}){return u.jsx("textarea",{"data-slot":"textarea",className:ht("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...r})}const sq=Xs({name:Ln().trim().min(1,"Name is required").max(120,"Max 120 chars"),cluster_provider:Ln().trim().min(1,"Provider is required").max(120,"Max 120 chars"),region:Ln().trim().min(1,"Region is required").max(120,"Max 120 chars")}),gve=sq.partial();function yve({status:e}){const r=(e??"").toLowerCase();return r?r==="ready"?u.jsxs(ns,{variant:"default",className:"flex items-center gap-1 text-xs",children:[u.jsx(L_,{className:"h-3 w-3"}),"ready"]}):r==="failed"?u.jsxs(ns,{variant:"destructive",className:"flex items-center gap-1 text-xs",children:[u.jsx(RM,{className:"h-3 w-3"}),"failed"]}):r==="provisioning"||r==="pending"||r==="pre_pending"?u.jsxs(ns,{variant:"secondary",className:"flex items-center gap-1 text-xs",children:[u.jsx(Ds,{className:"h-3 w-3 animate-spin"}),r.replace("_"," ")]}):r==="incomplete"?u.jsxs(ns,{variant:"outline",className:"flex items-center gap-1 text-xs",children:[u.jsx(RM,{className:"h-3 w-3"}),"incomplete"]}):u.jsx(ns,{variant:"outline",className:"text-xs",children:r}):u.jsx(ns,{variant:"outline",className:"text-xs",children:"unknown"})}function vve({c:e}){return u.jsxs("div",{className:"text-muted-foreground flex flex-col gap-1 text-xs",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.cluster_provider&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(zZ,{className:"h-3 w-3"}),e.cluster_provider]}),e.region&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(sW,{className:"h-3 w-3"}),e.region]})]}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2 font-mono",children:[e.random_token&&u.jsxs("span",{children:["token: ",u.jsx("span",{className:"ml-1",children:el(e.random_token,8)})]}),e.certificate_key&&u.jsxs("span",{children:["cert: ",u.jsx("span",{className:"ml-1",children:el(e.certificate_key,8)})]})]})]})}const xve=()=>{const[e,r]=R.useState(""),[s,o]=R.useState(!1),[d,p]=R.useState(!1),[m,g]=R.useState(null),[b,S]=R.useState(null),[j,A]=R.useState(null),[k,T]=R.useState(""),[M,I]=R.useState(""),[q,G]=R.useState(""),[K,X]=R.useState(""),[L,ee]=R.useState(""),[oe,Q]=R.useState(""),[ne,de]=R.useState(""),[je,ve]=R.useState(null),le=W=>je===W,be=Hs(),Ce=rr({queryKey:["clusters"],queryFn:()=>Ss.listClusters()}),Ke=rr({queryKey:["load-balancers"],queryFn:()=>jb.listLoadBalancers()}),ce=rr({queryKey:["domains"],queryFn:()=>tc.listDomains()}),re=rr({queryKey:["record-sets",k],enabled:!!k,queryFn:()=>tc.listRecordSetsByDomain(k)}),ue=rr({queryKey:["servers"],queryFn:()=>hg.listServers()}),_e=rr({queryKey:["node-pools"],queryFn:()=>ka.listNodePools()}),fe=mr({resolver:gr(sq),defaultValues:{name:"",cluster_provider:"",region:""}}),He=nn({mutationFn:W=>Ss.createCluster(W),onSuccess:async()=>{await be.invalidateQueries({queryKey:["clusters"]}),fe.reset(),o(!1),Ze.success("Cluster created successfully.")},onError:W=>{Ze.error(W?.message??"There was an error while creating the cluster")}}),Oe=W=>{He.mutate(W)},ke=mr({resolver:gr(gve),defaultValues:{}}),Ve=nn({mutationFn:({id:W,values:we})=>Ss.updateCluster(W,we),onSuccess:async()=>{await be.invalidateQueries({queryKey:["clusters"]}),ke.reset(),p(!1),Ze.success("Cluster updated successfully.")},onError:W=>{Ze.error(W?.message??"There was an error while updating the cluster")}}),ie=W=>{W.id&&(S(W.id),ke.reset({name:W.name??"",cluster_provider:W.cluster_provider??"",region:W.region??""}),p(!0))},De=nn({mutationFn:W=>Ss.deleteCluster(W),onSuccess:async()=>{await be.invalidateQueries({queryKey:["clusters"]}),g(null),Ze.success("Cluster deleted successfully.")},onError:W=>{Ze.error(W?.message??"There was an error while deleting the cluster")}}),Le=R.useMemo(()=>{const W=Ce.data??[],we=e.trim().toLowerCase();return we?W.filter(Re=>Re.name?.toLowerCase().includes(we)||Re.cluster_provider?.toLowerCase().includes(we)||Re.region?.toLowerCase().includes(we)||Re.status?.toLowerCase().includes(we)):W},[e,Ce.data]);R.useEffect(()=>{if(!j){T(""),I(""),G(""),X(""),ee(""),Q(""),de("");return}j.captain_domain?.id&&T(j.captain_domain.id),j.control_plane_record_set?.id&&I(j.control_plane_record_set.id),j.apps_load_balancer?.id&&G(j.apps_load_balancer.id),j.glueops_load_balancer?.id&&X(j.glueops_load_balancer.id),j.bastion_server?.id&&ee(j.bastion_server.id)},[j]);async function tt(){if(j?.id)try{const W=await Ss.getCluster(j.id);A(W),await be.invalidateQueries({queryKey:["clusters"]})}catch{}}async function ft(){if(j?.id){if(!k){Ze.error("Domain is required");return}ve("captain");try{await Ss.attachCaptainDomain(j.id,{domain_id:k}),Ze.success("Captain domain attached."),await tt()}catch(W){Ze.error(W?.message??"Failed to attach captain domain.")}finally{ve(null)}}}async function Ot(){if(j?.id){ve("captain");try{await Ss.detachCaptainDomain(j.id),Ze.success("Captain domain detached."),await tt()}catch(W){Ze.error(W?.message??"Failed to detach captain domain.")}finally{ve(null)}}}async function Ft(){if(j?.id){if(!M){Ze.error("Record set is required");return}ve("recordset");try{await Ss.attachControlPlaneRecordSet(j.id,{record_set_id:M}),Ze.success("Control plane record set attached."),await tt()}catch(W){Ze.error(W?.message??"Failed to attach record set.")}finally{ve(null)}}}async function kt(){if(j?.id){ve("recordset");try{await Ss.detachControlPlaneRecordSet(j.id),Ze.success("Control plane record set detached."),await tt()}catch(W){Ze.error(W?.message??"Failed to detach record set.")}finally{ve(null)}}}async function Jt(){if(j?.id){if(!q){Ze.error("Load balancer is required");return}ve("apps-lb");try{await Ss.attachAppsLoadBalancer(j.id,{load_balancer_id:q}),Ze.success("Apps load balancer attached."),await tt()}catch(W){Ze.error(W?.message??"Failed to attach apps load balancer.")}finally{ve(null)}}}async function ze(){if(j?.id){ve("apps-lb");try{await Ss.detachAppsLoadBalancer(j.id),Ze.success("Apps load balancer detached."),await tt()}catch(W){Ze.error(W?.message??"Failed to detach apps load balancer.")}finally{ve(null)}}}async function zt(){if(j?.id){if(!K){Ze.error("Load balancer is required");return}ve("glueops-lb");try{await Ss.attachGlueOpsLoadBalancer(j.id,{load_balancer_id:K}),Ze.success("GlueOps load balancer attached."),await tt()}catch(W){Ze.error(W?.message??"Failed to attach GlueOps load balancer.")}finally{ve(null)}}}async function Rt(){if(j?.id){ve("glueops-lb");try{await Ss.detachGlueOpsLoadBalancer(j.id),Ze.success("GlueOps load balancer detached."),await tt()}catch(W){Ze.error(W?.message??"Failed to detach GlueOps load balancer.")}finally{ve(null)}}}async function V(){if(j?.id){if(!L){Ze.error("Server is required");return}ve("bastion");try{await Ss.attachBastion(j.id,{server_id:L}),Ze.success("Bastion server attached."),await tt()}catch(W){Ze.error(W?.message??"Failed to attach bastion server.")}finally{ve(null)}}}async function Nn(){if(j?.id){ve("bastion");try{await Ss.detachBastion(j.id),Ze.success("Bastion server detached."),await tt()}catch(W){Ze.error(W?.message??"Failed to detach bastion server.")}finally{ve(null)}}}async function cn(){if(j?.id){if(!oe){Ze.error("Node pool is required");return}ve("nodepool");try{await Ss.attachNodePool(j.id,oe),Ze.success("Node pool attached."),Q(""),await tt()}catch(W){Ze.error(W?.message??"Failed to attach node pool.")}finally{ve(null)}}}async function xe(W){if(j?.id){ve("nodepool");try{await Ss.detachNodePool(j.id,W),Ze.success("Node pool detached."),await tt()}catch(we){Ze.error(we?.message??"Failed to detach node pool.")}finally{ve(null)}}}async function Ne(){if(j?.id){if(!ne.trim()){Ze.error("Kubeconfig is required");return}ve("kubeconfig");try{await Ss.setKubeconfig(j.id,{kubeconfig:ne}),Ze.success("Kubeconfig updated."),de(""),await tt()}catch(W){Ze.error(W?.message??"Failed to set kubeconfig.")}finally{ve(null)}}}async function Ge(){if(j?.id){ve("kubeconfig");try{await Ss.clearKubeconfig(j.id),Ze.success("Kubeconfig cleared."),await tt()}catch(W){Ze.error(W?.message??"Failed to clear kubeconfig.")}finally{ve(null)}}}if(Ce.isLoading)return u.jsx("div",{className:"p-6",children:"Loading clusters…"});if(Ce.error)return u.jsx("div",{className:"p-6 text-red-500",children:"Error loading clusters."});const D=Ke.data??[],z=D.filter(W=>W.kind==="public"),H=D.filter(W=>W.kind==="glueops");return u.jsxs("div",{className:"space-y-4 p-6",children:[u.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[u.jsx("h1",{className:"mb-4 text-2xl font-bold",children:"Clusters"}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsxs("div",{className:"relative",children:[u.jsx(Pa,{className:"absolute top-2.5 left-2 h-4 w-4 opacity-60"}),u.jsx(xt,{value:e,onChange:W=>r(W.target.value),placeholder:"Search clusters",className:"w-64 pl-8"})]}),u.jsxs(fn,{open:s,onOpenChange:o,children:[u.jsx(zi,{asChild:!0,children:u.jsxs(Fe,{onClick:()=>o(!0),children:[u.jsx(oo,{className:"mr-2 h-4 w-4"}),"Create Cluster"]})}),u.jsxs(mn,{className:"sm:max-w-lg",children:[u.jsx(gn,{children:u.jsx(yn,{children:"Create Cluster"})}),u.jsx(yr,{...fe,children:u.jsxs("form",{className:"space-y-4",onSubmit:fe.handleSubmit(Oe),children:[u.jsx(yt,{control:fe.control,name:"name",render:({field:W})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Name"}),u.jsx(wt,{children:u.jsx(xt,{placeholder:"prod-cluster-eu-west-1",...W})}),u.jsx(mt,{})]})}),u.jsx(yt,{control:fe.control,name:"cluster_provider",render:({field:W})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Provider"}),u.jsx(wt,{children:u.jsx(xt,{placeholder:"aws / hetzner / baremetal",...W})}),u.jsx(mt,{})]})}),u.jsx(yt,{control:fe.control,name:"region",render:({field:W})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Region"}),u.jsx(wt,{children:u.jsx(xt,{placeholder:"eu-west-1",...W})}),u.jsx(mt,{})]})}),u.jsxs(Sn,{className:"gap-2",children:[u.jsx(Fe,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),u.jsx(Fe,{type:"submit",disabled:He.isPending,children:He.isPending?"Creating…":"Create"})]})]})})]})]})]})]}),u.jsx("div",{className:"bg-background overflow-hidden rounded-2xl border shadow-sm",children:u.jsx("div",{className:"overflow-x-auto",children:u.jsxs(Fi,{children:[u.jsx(qi,{children:u.jsxs(an,{children:[u.jsx(At,{children:"Name"}),u.jsx(At,{children:"Provider"}),u.jsx(At,{children:"Region"}),u.jsx(At,{children:"Status"}),u.jsx(At,{children:"Summary"}),u.jsx(At,{className:"w-[320px] text-right",children:"Actions"})]})}),u.jsxs(Bi,{children:[Le.map(W=>u.jsxs(an,{children:[u.jsx(vt,{className:"font-medium",children:W.name}),u.jsx(vt,{children:W.cluster_provider}),u.jsx(vt,{children:W.region}),u.jsxs(vt,{children:[u.jsx(yve,{status:W.status}),W.last_error&&u.jsx("div",{className:"mt-1 text-xs text-red-500",children:el(W.last_error,80)})]}),u.jsxs(vt,{children:[u.jsx(vve,{c:W}),W.id&&u.jsx("code",{className:"text-muted-foreground mt-1 block text-xs",children:el(W.id,6)})]}),u.jsx(vt,{children:u.jsxs("div",{className:"flex flex-wrap justify-end gap-2",children:[u.jsxs(Fe,{variant:"ghost",size:"sm",onClick:()=>A(W),children:[u.jsx($W,{className:"mr-1 h-4 w-4"})," Configure"]}),u.jsxs(Fe,{variant:"outline",size:"sm",onClick:()=>ie(W),children:[u.jsx(pu,{className:"mr-2 h-4 w-4"})," Edit"]}),u.jsx(Fe,{variant:"destructive",size:"sm",onClick:()=>W.id&&g(W.id),disabled:De.isPending&&m===W.id,children:De.isPending&&m===W.id?"Deleting…":"Delete"})]})})]},W.id)),Le.length===0&&u.jsx(an,{children:u.jsxs(vt,{colSpan:6,className:"text-muted-foreground py-10 text-center",children:[u.jsx(Qb,{className:"mx-auto mb-2 h-6 w-6 opacity-60"}),"No clusters match your search."]})})]})]})})}),u.jsx(fn,{open:d,onOpenChange:p,children:u.jsxs(mn,{className:"sm:max-w-lg",children:[u.jsx(gn,{children:u.jsx(yn,{children:"Edit Cluster"})}),u.jsx(yr,{...ke,children:u.jsxs("form",{className:"space-y-4",onSubmit:ke.handleSubmit(W=>{b&&Ve.mutate({id:b,values:W})}),children:[u.jsx(yt,{control:ke.control,name:"name",render:({field:W})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Name"}),u.jsx(wt,{children:u.jsx(xt,{placeholder:"prod-cluster-eu-west-1",...W})}),u.jsx(mt,{})]})}),u.jsx(yt,{control:ke.control,name:"cluster_provider",render:({field:W})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Provider"}),u.jsx(wt,{children:u.jsx(xt,{placeholder:"aws / hetzner / baremetal",...W})}),u.jsx(mt,{})]})}),u.jsx(yt,{control:ke.control,name:"region",render:({field:W})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Region"}),u.jsx(wt,{children:u.jsx(xt,{placeholder:"eu-west-1",...W})}),u.jsx(mt,{})]})}),u.jsxs(Sn,{className:"gap-2",children:[u.jsx(Fe,{type:"button",variant:"outline",onClick:()=>p(!1),children:"Cancel"}),u.jsx(Fe,{type:"submit",disabled:Ve.isPending,children:Ve.isPending?"Saving…":"Save changes"})]})]})})]})}),u.jsx(fn,{open:!!j,onOpenChange:W=>!W&&A(null),children:u.jsxs(mn,{className:"max-h-[90vh] w-full max-w-3xl overflow-y-auto",children:[u.jsx(gn,{children:u.jsxs(yn,{children:["Configure Cluster",j?.name?`: ${j.name}`:""]})}),j&&u.jsxs("div",{className:"space-y-6 py-2",children:[u.jsxs("section",{className:"space-y-2 rounded-xl border p-4",children:[u.jsx("div",{className:"flex items-center justify-between gap-2",children:u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(VZ,{className:"h-4 w-4"}),u.jsx("h3",{className:"text-sm font-semibold",children:"Kubeconfig"})]}),u.jsx("p",{className:"text-muted-foreground text-xs",children:"Paste the kubeconfig for this cluster. It will be stored encrypted and never returned by the API."})]})}),u.jsx(hu,{value:ne,onChange:W=>de(W.target.value),rows:6,placeholder:`apiVersion: v1 clusters: - - cluster: ...`,className:"font-mono text-xs"}),u.jsxs("div",{className:"flex flex-wrap gap-2",children:[u.jsx(Fe,{size:"sm",onClick:De,disabled:le("kubeconfig"),children:le("kubeconfig")?"Saving…":"Save kubeconfig"}),u.jsx(Fe,{size:"sm",variant:"outline",onClick:Ge,disabled:le("kubeconfig"),children:"Clear kubeconfig"})]})]}),u.jsxs("section",{className:"space-y-2 rounded-xl border p-4",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"font-semibold text-sm",children:"Captain Domain"}),u.jsx("p",{className:"text-muted-foreground text-xs",children:"Domain used for the AutoGlue captain endpoint."})]}),u.jsx("div",{className:"text-right text-xs",children:u.jsx("div",{className:"font-mono",children:E.captain_domain?E.captain_domain.domain_name:"Not attached"})})]}),u.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-end",children:[u.jsxs("div",{className:"flex-1",children:[u.jsx(xi,{className:"text-xs",children:"Domain"}),u.jsxs(Rn,{value:k,onValueChange:W=>{T(W),I("")},children:[u.jsx(_n,{className:"w-full",children:u.jsx(Tn,{placeholder:ce.isLoading?"Loading domains…":"Select domain"})}),u.jsx($n,{children:(ce.data??[]).map(W=>u.jsx(jt,{value:W.id,children:W.domain_name},W.id))})]}),u.jsx("p",{className:"text-muted-foreground mt-1 text-[11px]",children:"Once a domain is attached, control plane record sets for that domain will be available below."})]}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(Fe,{size:"sm",onClick:ft,disabled:le("captain")||ce.isLoading,children:le("captain")?"Attaching…":"Attach"}),u.jsx(Fe,{size:"sm",variant:"outline",onClick:Ot,disabled:le("captain")||!E.captain_domain,children:"Detach"})]})]})]}),k&&u.jsxs("section",{className:"space-y-2 rounded-xl border p-4",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"font-semibold text-sm",children:"Control Plane Record Set"}),u.jsx("p",{className:"text-muted-foreground text-xs",children:"DNS record set used for the cluster control plane endpoint."})]}),u.jsx("div",{className:"text-right text-xs",children:u.jsx("div",{className:"font-mono",children:E.control_plane_record_set?E.control_plane_record_set.name:"Not attached"})})]}),u.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-end",children:[u.jsxs("div",{className:"flex-1",children:[u.jsx(xi,{className:"text-xs",children:"Record Set"}),u.jsxs(Rn,{value:M,onValueChange:W=>I(W),children:[u.jsx(_n,{className:"w-full",children:u.jsx(Tn,{placeholder:re.isLoading?"Loading record sets…":"Select record set"})}),u.jsx($n,{children:(re.data??[]).map(W=>u.jsxs(jt,{value:W.id,children:[W.name," · ",W.type]},W.id))})]})]}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(Fe,{size:"sm",onClick:Ft,disabled:le("recordset")||re.isLoading,children:le("recordset")?"Attaching…":"Attach"}),u.jsx(Fe,{size:"sm",variant:"outline",onClick:kt,disabled:le("recordset")||!E.control_plane_record_set,children:"Detach"})]})]})]}),u.jsxs("section",{className:"space-y-2 rounded-xl border p-4",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"font-semibold text-sm",children:"Apps Load Balancer"}),u.jsx("p",{className:"text-muted-foreground text-xs",children:"Frontend load balancer for application traffic."})]}),u.jsx("div",{className:"text-right text-xs",children:u.jsx("div",{className:"font-mono",children:E.apps_load_balancer?E.apps_load_balancer.name:"Not attached"})})]}),u.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-end",children:[u.jsxs("div",{className:"flex-1",children:[u.jsx(xi,{className:"text-xs",children:"Apps Load Balancer"}),u.jsxs(Rn,{value:q,onValueChange:W=>G(W),children:[u.jsx(_n,{className:"w-full",children:u.jsx(Tn,{placeholder:Ke.isLoading?"Loading load balancers…":"Select apps LB"})}),u.jsx($n,{children:L.map(W=>u.jsxs(jt,{value:W.id,children:[W.name," · ",W.public_ip_address]},W.id))})]})]}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(Fe,{size:"sm",onClick:Jt,disabled:le("apps-lb")||Ke.isLoading,children:le("apps-lb")?"Attaching…":"Attach"}),u.jsx(Fe,{size:"sm",variant:"outline",onClick:Le,disabled:le("apps-lb")||!E.apps_load_balancer,children:"Detach"})]})]})]}),u.jsxs("section",{className:"space-y-2 rounded-xl border p-4",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"font-semibold text-sm",children:"GlueOps / Control-plane Load Balancer"}),u.jsx("p",{className:"text-muted-foreground text-xs",children:"Load balancer for GlueOps/control-plane traffic."})]}),u.jsx("div",{className:"text-right text-xs",children:u.jsx("div",{className:"font-mono",children:E.glueops_load_balancer?E.glueops_load_balancer.name:"Not attached"})})]}),u.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-end",children:[u.jsxs("div",{className:"flex-1",children:[u.jsx(xi,{className:"text-xs",children:"GlueOps Load Balancer"}),u.jsxs(Rn,{value:K,onValueChange:W=>X(W),children:[u.jsx(_n,{className:"w-full",children:u.jsx(Tn,{placeholder:Ke.isLoading?"Loading load balancers…":"Select GlueOps LB"})}),u.jsx($n,{children:H.map(W=>u.jsxs(jt,{value:W.id,children:[W.name," · ",W.private_ip_address]},W.id))})]})]}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(Fe,{size:"sm",onClick:Lt,disabled:le("glueops-lb")||Ke.isLoading,children:le("glueops-lb")?"Attaching…":"Attach"}),u.jsx(Fe,{size:"sm",variant:"outline",onClick:Rt,disabled:le("glueops-lb")||!E.glueops_load_balancer,children:"Detach"})]})]})]}),u.jsxs("section",{className:"space-y-2 rounded-xl border p-4",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(L_,{className:"h-4 w-4"}),u.jsx("h3",{className:"font-semibold text-sm",children:"Bastion Server"})]}),u.jsx("p",{className:"text-muted-foreground text-xs",children:"SSH bastion used to reach the cluster nodes."})]}),u.jsx("div",{className:"text-right text-xs",children:u.jsx("div",{className:"font-mono",children:E.bastion_server?E.bastion_server.hostname??E.bastion_server.id:"Not attached"})})]}),u.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-end",children:[u.jsxs("div",{className:"flex-1",children:[u.jsx(xi,{className:"text-xs",children:"Bastion Server"}),u.jsxs(Rn,{value:z,onValueChange:W=>ee(W),children:[u.jsx(_n,{className:"w-full",children:u.jsx(Tn,{placeholder:ue.isLoading?"Loading servers…":"Select server"})}),u.jsx($n,{children:(ue.data??[]).map(W=>u.jsxs(jt,{value:W.id,children:[W.hostname??W.id," · ",W.private_ip_address]},W.id))})]})]}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(Fe,{size:"sm",onClick:V,disabled:le("bastion")||ue.isLoading,children:le("bastion")?"Attaching…":"Attach"}),u.jsx(Fe,{size:"sm",variant:"outline",onClick:Nn,disabled:le("bastion")||!E.bastion_server,children:"Detach"})]})]})]}),u.jsxs("section",{className:"space-y-2 rounded-xl border p-4",children:[u.jsx("div",{className:"flex items-center justify-between gap-2",children:u.jsxs("div",{children:[u.jsx("h3",{className:"font-semibold text-sm",children:"Node Pools"}),u.jsx("p",{className:"text-muted-foreground text-xs",children:"Attach node pools to this cluster. Each node pool may have its own labels, taints, and backing servers."})]})}),u.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-end",children:[u.jsxs("div",{className:"flex-1",children:[u.jsx(xi,{className:"text-xs",children:"Available Node Pools"}),u.jsxs(Rn,{value:oe,onValueChange:W=>Q(W),children:[u.jsx(_n,{className:"w-full",children:u.jsx(Tn,{placeholder:_e.isLoading?"Loading node pools…":"Select node pool"})}),u.jsx($n,{children:(_e.data??[]).map(W=>u.jsxs(jt,{value:W.id,children:[W.name," · ",W.role]},W.id))})]})]}),u.jsx("div",{className:"flex gap-2",children:u.jsx(Fe,{size:"sm",onClick:cn,disabled:le("nodepool")||_e.isLoading,children:le("nodepool")?"Attaching…":"Attach"})})]}),u.jsxs("div",{className:"mt-3 space-y-1",children:[u.jsx(xi,{className:"text-xs",children:"Attached Node Pools"}),E.node_pools&&E.node_pools.length>0?u.jsx("div",{className:"divide-border mt-1 rounded-md border",children:E.node_pools.map(W=>u.jsxs("div",{className:"flex items-center justify-between gap-3 px-3 py-2 text-xs",children:[u.jsxs("div",{className:"flex flex-col",children:[u.jsx("span",{className:"font-medium",children:W.name}),u.jsxs("span",{className:"text-muted-foreground",children:["role: ",W.role," · servers: ",W.servers?.length??0]})]}),u.jsx(Fe,{size:"sm",variant:"outline",onClick:()=>W.id&&ve(W.id),disabled:le("nodepool"),children:"Detach"})]},W.id))}):u.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:"No node pools attached to this cluster yet."})]})]}),u.jsx(Sn,{className:"mt-2",children:u.jsx(Fe,{variant:"outline",onClick:()=>A(null),children:"Close"})})]})]})}),u.jsx(fn,{open:!!m,onOpenChange:W=>!W&&g(null),children:u.jsxs(mn,{className:"sm:max-w-md",children:[u.jsx(gn,{children:u.jsx(yn,{children:"Delete cluster"})}),u.jsx("p",{className:"text-muted-foreground text-sm",children:"This action cannot be undone. Are you sure you want to delete this cluster?"}),u.jsxs(Sn,{className:"gap-2",children:[u.jsx(Fe,{variant:"outline",onClick:()=>g(null),children:"Cancel"}),u.jsx(Fe,{variant:"destructive",onClick:()=>m&&Ne.mutate(m),disabled:Ne.isPending,children:Ne.isPending?"Deleting…":"Delete"})]})]})}),u.jsx("pre",{children:JSON.stringify(je.data,null,2)})]})},Ym=ste(),Qm={listCredentials:()=>ut(async()=>await Ym.listCredentials()),createCredential:async e=>ut(async()=>await Ym.createCredential({dtoCreateCredentialRequest:e})),getCredential:async e=>ut(async()=>await Ym.getCredential({id:e})),deleteCredential:async e=>ut(async()=>{await Ym.deleteCredential({id:e})}),updateCredential:async(e,r)=>ut(async()=>await Ym.updateCredential({id:e,dtoUpdateCredentialRequest:r})),revealCredential:async e=>ut(async()=>await Ym.revealCredential({id:e}))};var vve=Symbol("radix.slottable");function xve(e){const r=({children:s})=>u.jsx(u.Fragment,{children:s});return r.displayName=`${e}.Slottable`,r.__radixId=vve,r}var sq="AlertDialog",[bve]=al(sq,[AL]),vu=AL(),iq=e=>{const{__scopeAlertDialog:r,...s}=e,o=vu(r);return u.jsx(_C,{...o,...s,modal:!0})};iq.displayName=sq;var wve="AlertDialogTrigger",aq=R.forwardRef((e,r)=>{const{__scopeAlertDialog:s,...o}=e,d=vu(s);return u.jsx(BL,{...d,...o,ref:r})});aq.displayName=wve;var Sve="AlertDialogPortal",oq=e=>{const{__scopeAlertDialog:r,...s}=e,o=vu(r);return u.jsx($C,{...o,...s})};oq.displayName=Sve;var Eve="AlertDialogOverlay",lq=R.forwardRef((e,r)=>{const{__scopeAlertDialog:s,...o}=e,d=vu(s);return u.jsx(NC,{...d,...o,ref:r})});lq.displayName=Eve;var yg="AlertDialogContent",[jve,Cve]=bve(yg),Ave=xve("AlertDialogContent"),cq=R.forwardRef((e,r)=>{const{__scopeAlertDialog:s,children:o,...d}=e,p=vu(s),m=R.useRef(null),g=Ln(r,m),b=R.useRef(null);return u.jsx(aae,{contentName:yg,titleName:uq,docsSlug:"alert-dialog",children:u.jsx(jve,{scope:s,cancelRef:b,children:u.jsxs(DC,{role:"alertdialog",...p,...d,ref:g,onOpenAutoFocus:$t(d.onOpenAutoFocus,S=>{S.preventDefault(),b.current?.focus({preventScroll:!0})}),onPointerDownOutside:S=>S.preventDefault(),onInteractOutside:S=>S.preventDefault(),children:[u.jsx(Ave,{children:o}),u.jsx(kve,{contentRef:m})]})})})});cq.displayName=yg;var uq="AlertDialogTitle",dq=R.forwardRef((e,r)=>{const{__scopeAlertDialog:s,...o}=e,d=vu(s);return u.jsx(s2,{...d,...o,ref:r})});dq.displayName=uq;var hq="AlertDialogDescription",pq=R.forwardRef((e,r)=>{const{__scopeAlertDialog:s,...o}=e,d=vu(s);return u.jsx(i2,{...d,...o,ref:r})});pq.displayName=hq;var Ove="AlertDialogAction",fq=R.forwardRef((e,r)=>{const{__scopeAlertDialog:s,...o}=e,d=vu(s);return u.jsx(cw,{...d,...o,ref:r})});fq.displayName=Ove;var mq="AlertDialogCancel",gq=R.forwardRef((e,r)=>{const{__scopeAlertDialog:s,...o}=e,{cancelRef:d}=Cve(mq,s),p=vu(s),m=Ln(r,d);return u.jsx(cw,{...p,...o,ref:m})});gq.displayName=mq;var kve=({contentRef:e})=>{const r=`\`${yg}\` requires a description for the component to be accessible for screen reader users. + - cluster: ...`,className:"font-mono text-xs"}),u.jsxs("div",{className:"flex flex-wrap gap-2",children:[u.jsx(Fe,{size:"sm",onClick:Ne,disabled:le("kubeconfig"),children:le("kubeconfig")?"Saving…":"Save kubeconfig"}),u.jsx(Fe,{size:"sm",variant:"outline",onClick:Ge,disabled:le("kubeconfig"),children:"Clear kubeconfig"})]})]}),u.jsxs("section",{className:"space-y-2 rounded-xl border p-4",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"text-sm font-semibold",children:"Captain Domain"}),u.jsx("p",{className:"text-muted-foreground text-xs",children:"Domain used for the AutoGlue captain endpoint."})]}),u.jsx("div",{className:"text-right text-xs",children:u.jsx("div",{className:"font-mono",children:j.captain_domain?j.captain_domain.domain_name:"Not attached"})})]}),u.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-end",children:[u.jsxs("div",{className:"flex-1",children:[u.jsx(xi,{className:"text-xs",children:"Domain"}),u.jsxs(Rn,{value:k,onValueChange:W=>{T(W),I("")},children:[u.jsx(_n,{className:"w-full",children:u.jsx(Tn,{placeholder:ce.isLoading?"Loading domains…":"Select domain"})}),u.jsx($n,{children:(ce.data??[]).map(W=>u.jsx(jt,{value:W.id,children:W.domain_name},W.id))})]}),u.jsx("p",{className:"text-muted-foreground mt-1 text-[11px]",children:"Once a domain is attached, control plane record sets for that domain will be available below."})]}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(Fe,{size:"sm",onClick:ft,disabled:le("captain")||ce.isLoading,children:le("captain")?"Attaching…":"Attach"}),u.jsx(Fe,{size:"sm",variant:"outline",onClick:Ot,disabled:le("captain")||!j.captain_domain,children:"Detach"})]})]})]}),k&&u.jsxs("section",{className:"space-y-2 rounded-xl border p-4",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"text-sm font-semibold",children:"Control Plane Record Set"}),u.jsx("p",{className:"text-muted-foreground text-xs",children:"DNS record set used for the cluster control plane endpoint."})]}),u.jsx("div",{className:"text-right text-xs",children:u.jsx("div",{className:"font-mono",children:j.control_plane_record_set?j.control_plane_record_set.name:"Not attached"})})]}),u.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-end",children:[u.jsxs("div",{className:"flex-1",children:[u.jsx(xi,{className:"text-xs",children:"Record Set"}),u.jsxs(Rn,{value:M,onValueChange:W=>I(W),children:[u.jsx(_n,{className:"w-full",children:u.jsx(Tn,{placeholder:re.isLoading?"Loading record sets…":"Select record set"})}),u.jsx($n,{children:(re.data??[]).map(W=>u.jsxs(jt,{value:W.id,children:[W.name," · ",W.type]},W.id))})]})]}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(Fe,{size:"sm",onClick:Ft,disabled:le("recordset")||re.isLoading,children:le("recordset")?"Attaching…":"Attach"}),u.jsx(Fe,{size:"sm",variant:"outline",onClick:kt,disabled:le("recordset")||!j.control_plane_record_set,children:"Detach"})]})]})]}),u.jsxs("section",{className:"space-y-2 rounded-xl border p-4",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"text-sm font-semibold",children:"Apps Load Balancer"}),u.jsx("p",{className:"text-muted-foreground text-xs",children:"Frontend load balancer for application traffic."})]}),u.jsx("div",{className:"text-right text-xs",children:u.jsx("div",{className:"font-mono",children:j.apps_load_balancer?j.apps_load_balancer.name:"Not attached"})})]}),u.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-end",children:[u.jsxs("div",{className:"flex-1",children:[u.jsx(xi,{className:"text-xs",children:"Apps Load Balancer"}),u.jsxs(Rn,{value:q,onValueChange:W=>G(W),children:[u.jsx(_n,{className:"w-full",children:u.jsx(Tn,{placeholder:Ke.isLoading?"Loading load balancers…":"Select apps LB"})}),u.jsx($n,{children:z.map(W=>u.jsxs(jt,{value:W.id,children:[W.name," · ",W.public_ip_address]},W.id))})]})]}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(Fe,{size:"sm",onClick:Jt,disabled:le("apps-lb")||Ke.isLoading,children:le("apps-lb")?"Attaching…":"Attach"}),u.jsx(Fe,{size:"sm",variant:"outline",onClick:ze,disabled:le("apps-lb")||!j.apps_load_balancer,children:"Detach"})]})]})]}),u.jsxs("section",{className:"space-y-2 rounded-xl border p-4",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"text-sm font-semibold",children:"GlueOps / Control-plane Load Balancer"}),u.jsx("p",{className:"text-muted-foreground text-xs",children:"Load balancer for GlueOps/control-plane traffic."})]}),u.jsx("div",{className:"text-right text-xs",children:u.jsx("div",{className:"font-mono",children:j.glueops_load_balancer?j.glueops_load_balancer.name:"Not attached"})})]}),u.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-end",children:[u.jsxs("div",{className:"flex-1",children:[u.jsx(xi,{className:"text-xs",children:"GlueOps Load Balancer"}),u.jsxs(Rn,{value:K,onValueChange:W=>X(W),children:[u.jsx(_n,{className:"w-full",children:u.jsx(Tn,{placeholder:Ke.isLoading?"Loading load balancers…":"Select GlueOps LB"})}),u.jsx($n,{children:H.map(W=>u.jsxs(jt,{value:W.id,children:[W.name," · ",W.private_ip_address]},W.id))})]})]}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(Fe,{size:"sm",onClick:zt,disabled:le("glueops-lb")||Ke.isLoading,children:le("glueops-lb")?"Attaching…":"Attach"}),u.jsx(Fe,{size:"sm",variant:"outline",onClick:Rt,disabled:le("glueops-lb")||!j.glueops_load_balancer,children:"Detach"})]})]})]}),u.jsxs("section",{className:"space-y-2 rounded-xl border p-4",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(F_,{className:"h-4 w-4"}),u.jsx("h3",{className:"text-sm font-semibold",children:"Bastion Server"})]}),u.jsx("p",{className:"text-muted-foreground text-xs",children:"SSH bastion used to reach the cluster nodes."})]}),u.jsx("div",{className:"text-right text-xs",children:u.jsx("div",{className:"font-mono",children:j.bastion_server?j.bastion_server.hostname??j.bastion_server.id:"Not attached"})})]}),u.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-end",children:[u.jsxs("div",{className:"flex-1",children:[u.jsx(xi,{className:"text-xs",children:"Bastion Server"}),u.jsxs(Rn,{value:L,onValueChange:W=>ee(W),children:[u.jsx(_n,{className:"w-full",children:u.jsx(Tn,{placeholder:ue.isLoading?"Loading servers…":"Select server"})}),u.jsx($n,{children:(ue.data??[]).map(W=>u.jsxs(jt,{value:W.id,children:[W.hostname??W.id," · ",W.private_ip_address]},W.id))})]})]}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(Fe,{size:"sm",onClick:V,disabled:le("bastion")||ue.isLoading,children:le("bastion")?"Attaching…":"Attach"}),u.jsx(Fe,{size:"sm",variant:"outline",onClick:Nn,disabled:le("bastion")||!j.bastion_server,children:"Detach"})]})]})]}),u.jsxs("section",{className:"space-y-2 rounded-xl border p-4",children:[u.jsx("div",{className:"flex items-center justify-between gap-2",children:u.jsxs("div",{children:[u.jsx("h3",{className:"text-sm font-semibold",children:"Node Pools"}),u.jsx("p",{className:"text-muted-foreground text-xs",children:"Attach node pools to this cluster. Each node pool may have its own labels, taints, and backing servers."})]})}),u.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-end",children:[u.jsxs("div",{className:"flex-1",children:[u.jsx(xi,{className:"text-xs",children:"Available Node Pools"}),u.jsxs(Rn,{value:oe,onValueChange:W=>Q(W),children:[u.jsx(_n,{className:"w-full",children:u.jsx(Tn,{placeholder:_e.isLoading?"Loading node pools…":"Select node pool"})}),u.jsx($n,{children:(_e.data??[]).map(W=>u.jsxs(jt,{value:W.id,children:[W.name," · ",W.role]},W.id))})]})]}),u.jsx("div",{className:"flex gap-2",children:u.jsx(Fe,{size:"sm",onClick:cn,disabled:le("nodepool")||_e.isLoading,children:le("nodepool")?"Attaching…":"Attach"})})]}),u.jsxs("div",{className:"mt-3 space-y-1",children:[u.jsx(xi,{className:"text-xs",children:"Attached Node Pools"}),j.node_pools&&j.node_pools.length>0?u.jsx("div",{className:"divide-border mt-1 rounded-md border",children:j.node_pools.map(W=>u.jsxs("div",{className:"flex items-center justify-between gap-3 px-3 py-2 text-xs",children:[u.jsxs("div",{className:"flex flex-col",children:[u.jsx("span",{className:"font-medium",children:W.name}),u.jsxs("span",{className:"text-muted-foreground",children:["role: ",W.role," · servers: ",W.servers?.length??0]})]}),u.jsx(Fe,{size:"sm",variant:"outline",onClick:()=>W.id&&xe(W.id),disabled:le("nodepool"),children:"Detach"})]},W.id))}):u.jsx("p",{className:"text-muted-foreground mt-1 text-xs",children:"No node pools attached to this cluster yet."})]})]}),u.jsx(Sn,{className:"mt-2",children:u.jsx(Fe,{variant:"outline",onClick:()=>A(null),children:"Close"})})]})]})}),u.jsx(fn,{open:!!m,onOpenChange:W=>!W&&g(null),children:u.jsxs(mn,{className:"sm:max-w-md",children:[u.jsx(gn,{children:u.jsx(yn,{children:"Delete cluster"})}),u.jsx("p",{className:"text-muted-foreground text-sm",children:"This action cannot be undone. Are you sure you want to delete this cluster?"}),u.jsxs(Sn,{className:"gap-2",children:[u.jsx(Fe,{variant:"outline",onClick:()=>g(null),children:"Cancel"}),u.jsx(Fe,{variant:"destructive",onClick:()=>m&&De.mutate(m),disabled:De.isPending,children:De.isPending?"Deleting…":"Delete"})]})]})}),u.jsx("pre",{children:JSON.stringify(Ce.data,null,2)})]})},Ym=ite(),Qm={listCredentials:()=>ut(async()=>await Ym.listCredentials()),createCredential:async e=>ut(async()=>await Ym.createCredential({dtoCreateCredentialRequest:e})),getCredential:async e=>ut(async()=>await Ym.getCredential({id:e})),deleteCredential:async e=>ut(async()=>{await Ym.deleteCredential({id:e})}),updateCredential:async(e,r)=>ut(async()=>await Ym.updateCredential({id:e,dtoUpdateCredentialRequest:r})),revealCredential:async e=>ut(async()=>await Ym.revealCredential({id:e}))};var bve=Symbol("radix.slottable");function wve(e){const r=({children:s})=>u.jsx(u.Fragment,{children:s});return r.displayName=`${e}.Slottable`,r.__radixId=bve,r}var iq="AlertDialog",[Sve]=al(iq,[Oz]),vu=Oz(),aq=e=>{const{__scopeAlertDialog:r,...s}=e,o=vu(r);return u.jsx(_C,{...o,...s,modal:!0})};aq.displayName=iq;var Eve="AlertDialogTrigger",oq=R.forwardRef((e,r)=>{const{__scopeAlertDialog:s,...o}=e,d=vu(s);return u.jsx(Uz,{...d,...o,ref:r})});oq.displayName=Eve;var jve="AlertDialogPortal",lq=e=>{const{__scopeAlertDialog:r,...s}=e,o=vu(r);return u.jsx($C,{...o,...s})};lq.displayName=jve;var Cve="AlertDialogOverlay",cq=R.forwardRef((e,r)=>{const{__scopeAlertDialog:s,...o}=e,d=vu(s);return u.jsx(NC,{...d,...o,ref:r})});cq.displayName=Cve;var yg="AlertDialogContent",[Ave,Ove]=Sve(yg),kve=wve("AlertDialogContent"),uq=R.forwardRef((e,r)=>{const{__scopeAlertDialog:s,children:o,...d}=e,p=vu(s),m=R.useRef(null),g=zn(r,m),b=R.useRef(null);return u.jsx(oae,{contentName:yg,titleName:dq,docsSlug:"alert-dialog",children:u.jsx(Ave,{scope:s,cancelRef:b,children:u.jsxs(DC,{role:"alertdialog",...p,...d,ref:g,onOpenAutoFocus:$t(d.onOpenAutoFocus,S=>{S.preventDefault(),b.current?.focus({preventScroll:!0})}),onPointerDownOutside:S=>S.preventDefault(),onInteractOutside:S=>S.preventDefault(),children:[u.jsx(kve,{children:o}),u.jsx(Tve,{contentRef:m})]})})})});uq.displayName=yg;var dq="AlertDialogTitle",hq=R.forwardRef((e,r)=>{const{__scopeAlertDialog:s,...o}=e,d=vu(s);return u.jsx(i2,{...d,...o,ref:r})});hq.displayName=dq;var pq="AlertDialogDescription",fq=R.forwardRef((e,r)=>{const{__scopeAlertDialog:s,...o}=e,d=vu(s);return u.jsx(a2,{...d,...o,ref:r})});fq.displayName=pq;var Rve="AlertDialogAction",mq=R.forwardRef((e,r)=>{const{__scopeAlertDialog:s,...o}=e,d=vu(s);return u.jsx(lw,{...d,...o,ref:r})});mq.displayName=Rve;var gq="AlertDialogCancel",yq=R.forwardRef((e,r)=>{const{__scopeAlertDialog:s,...o}=e,{cancelRef:d}=Ove(gq,s),p=vu(s),m=zn(r,d);return u.jsx(lw,{...p,...o,ref:m})});yq.displayName=gq;var Tve=({contentRef:e})=>{const r=`\`${yg}\` requires a description for the component to be accessible for screen reader users. -You can add a description to the \`${yg}\` by passing a \`${hq}\` component as a child, which also benefits sighted users by adding visible context to the dialog. +You can add a description to the \`${yg}\` by passing a \`${pq}\` 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 \`${yg}\`. 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 R.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(r)},[r,e]),null},Rve=iq,Tve=aq,_ve=oq,$ve=lq,Nve=cq,Dve=fq,Pve=gq,Mve=dq,Ive=pq;function rC({...e}){return u.jsx(Rve,{"data-slot":"alert-dialog",...e})}function sC({...e}){return u.jsx(Tve,{"data-slot":"alert-dialog-trigger",...e})}function zve({...e}){return u.jsx(_ve,{"data-slot":"alert-dialog-portal",...e})}function Lve({className:e,...r}){return u.jsx($ve,{"data-slot":"alert-dialog-overlay",className:ht("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...r})}function iC({className:e,...r}){return u.jsxs(zve,{children:[u.jsx(Lve,{}),u.jsx(Nve,{"data-slot":"alert-dialog-content",className:ht("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...r})]})}function aC({className:e,...r}){return u.jsx("div",{"data-slot":"alert-dialog-header",className:ht("flex flex-col gap-2 text-center sm:text-left",e),...r})}function oC({className:e,...r}){return u.jsx("div",{"data-slot":"alert-dialog-footer",className:ht("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r})}function lC({className:e,...r}){return u.jsx(Mve,{"data-slot":"alert-dialog-title",className:ht("text-lg font-semibold",e),...r})}function cC({className:e,...r}){return u.jsx(Ive,{"data-slot":"alert-dialog-description",className:ht("text-muted-foreground text-sm",e),...r})}function uC({className:e,...r}){return u.jsx(Dve,{className:ht(K_(),e),...r})}function dC({className:e,...r}){return u.jsx(Pve,{className:ht(K_({variant:"outline"}),e),...r})}var gT="rovingFocusGroup.onEntryFocus",Fve={bubbles:!1,cancelable:!0},vw="RovingFocusGroup",[S_,yq,qve]=s$(vw),[Bve,vq]=al(vw,[qve]),[Uve,Kve]=Bve(vw),xq=R.forwardRef((e,r)=>u.jsx(S_.Provider,{scope:e.__scopeRovingFocusGroup,children:u.jsx(S_.Slot,{scope:e.__scopeRovingFocusGroup,children:u.jsx(Vve,{...e,ref:r})})}));xq.displayName=vw;var Vve=R.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:s,orientation:o,loop:d=!1,dir:p,currentTabStopId:m,defaultCurrentTabStopId:g,onCurrentTabStopIdChange:b,onEntryFocus:S,preventScrollOnEntryFocus:E=!1,...A}=e,k=R.useRef(null),T=Ln(r,k),M=i$(p),[I,q]=qd({prop:m,defaultProp:g??null,onChange:b,caller:vw}),[G,K]=R.useState(!1),X=tl(S),z=yq(s),ee=R.useRef(!1),[oe,Q]=R.useState(0);return R.useEffect(()=>{const ne=k.current;if(ne)return ne.addEventListener(gT,X),()=>ne.removeEventListener(gT,X)},[X]),u.jsx(Uve,{scope:s,orientation:o,dir:M,loop:d,currentTabStopId:I,onItemFocus:R.useCallback(ne=>q(ne),[q]),onItemShiftTab:R.useCallback(()=>K(!0),[]),onFocusableItemAdd:R.useCallback(()=>Q(ne=>ne+1),[]),onFocusableItemRemove:R.useCallback(()=>Q(ne=>ne-1),[]),children:u.jsx(Cn.div,{tabIndex:G||oe===0?-1:0,"data-orientation":o,...A,ref:T,style:{outline:"none",...e.style},onMouseDown:$t(e.onMouseDown,()=>{ee.current=!0}),onFocus:$t(e.onFocus,ne=>{const de=!ee.current;if(ne.target===ne.currentTarget&&de&&!G){const Ce=new CustomEvent(gT,Fve);if(ne.currentTarget.dispatchEvent(Ce),!Ce.defaultPrevented){const xe=z().filter(ce=>ce.focusable),le=xe.find(ce=>ce.active),be=xe.find(ce=>ce.id===I),Ke=[le,be,...xe].filter(Boolean).map(ce=>ce.ref.current);Sq(Ke,E)}}ee.current=!1}),onBlur:$t(e.onBlur,()=>K(!1))})})}),bq="RovingFocusGroupItem",wq=R.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:s,focusable:o=!0,active:d=!1,tabStopId:p,children:m,...g}=e,b=Vs(),S=p||b,E=Kve(bq,s),A=E.currentTabStopId===S,k=yq(s),{onFocusableItemAdd:T,onFocusableItemRemove:M,currentTabStopId:I}=E;return R.useEffect(()=>{if(o)return T(),()=>M()},[o,T,M]),u.jsx(S_.ItemSlot,{scope:s,id:S,focusable:o,active:d,children:u.jsx(Cn.span,{tabIndex:A?0:-1,"data-orientation":E.orientation,...g,ref:r,onMouseDown:$t(e.onMouseDown,q=>{o?E.onItemFocus(S):q.preventDefault()}),onFocus:$t(e.onFocus,()=>E.onItemFocus(S)),onKeyDown:$t(e.onKeyDown,q=>{if(q.key==="Tab"&&q.shiftKey){E.onItemShiftTab();return}if(q.target!==q.currentTarget)return;const G=Xve(q,E.orientation,E.dir);if(G!==void 0){if(q.metaKey||q.ctrlKey||q.altKey||q.shiftKey)return;q.preventDefault();let X=k().filter(z=>z.focusable).map(z=>z.ref.current);if(G==="last")X.reverse();else if(G==="prev"||G==="next"){G==="prev"&&X.reverse();const z=X.indexOf(q.currentTarget);X=E.loop?Yve(X,z+1):X.slice(z+1)}setTimeout(()=>Sq(X))}}),children:typeof m=="function"?m({isCurrentTabStop:A,hasTabStop:I!=null}):m})})});wq.displayName=bq;var Hve={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Gve(e,r){return r!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Xve(e,r,s){const o=Gve(e.key,s);if(!(r==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(r==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return Hve[o]}function Sq(e,r=!1){const s=document.activeElement;for(const o of e)if(o===s||(o.focus({preventScroll:r}),document.activeElement!==s))return}function Yve(e,r){return e.map((s,o)=>e[(r+o)%e.length])}var Zve=xq,Wve=wq;function Jve(e){const r=Qve(e),s=R.forwardRef((o,d)=>{const{children:p,...m}=o,g=R.Children.toArray(p),b=g.find(txe);if(b){const S=b.props.children,E=g.map(A=>A===b?R.Children.count(S)>1?R.Children.only(null):R.isValidElement(S)?S.props.children:null:A);return u.jsx(r,{...m,ref:d,children:R.isValidElement(S)?R.cloneElement(S,void 0,E):null})}return u.jsx(r,{...m,ref:d,children:p})});return s.displayName=`${e}.Slot`,s}function Qve(e){const r=R.forwardRef((s,o)=>{const{children:d,...p}=s;if(R.isValidElement(d)){const m=rxe(d),g=nxe(p,d.props);return d.type!==R.Fragment&&(g.ref=o?zi(o,m):m),R.cloneElement(d,g)}return R.Children.count(d)>1?R.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var exe=Symbol("radix.slottable");function txe(e){return R.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===exe}function nxe(e,r){const s={...r};for(const o in r){const d=e[o],p=r[o];/^on[A-Z]/.test(o)?d&&p?s[o]=(...g)=>{const b=p(...g);return d(...g),b}:d&&(s[o]=d):o==="style"?s[o]={...d,...p}:o==="className"&&(s[o]=[d,p].filter(Boolean).join(" "))}return{...e,...s}}function rxe(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning;return s?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var E_=["Enter"," "],sxe=["ArrowDown","PageUp","Home"],Eq=["ArrowUp","PageDown","End"],ixe=[...sxe,...Eq],axe={ltr:[...E_,"ArrowRight"],rtl:[...E_,"ArrowLeft"]},oxe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},xw="Menu",[Jb,lxe,cxe]=s$(xw),[Mp,jq]=al(xw,[cxe,Hd,vq]),WC=Hd(),Cq=vq(),[uxe,Ip]=Mp(xw),[dxe,bw]=Mp(xw),Aq=e=>{const{__scopeMenu:r,open:s=!1,children:o,dir:d,onOpenChange:p,modal:m=!0}=e,g=WC(r),[b,S]=R.useState(null),E=R.useRef(!1),A=tl(p),k=i$(d);return R.useEffect(()=>{const T=()=>{E.current=!0,document.addEventListener("pointerdown",M,{capture:!0,once:!0}),document.addEventListener("pointermove",M,{capture:!0,once:!0})},M=()=>E.current=!1;return document.addEventListener("keydown",T,{capture:!0}),()=>{document.removeEventListener("keydown",T,{capture:!0}),document.removeEventListener("pointerdown",M,{capture:!0}),document.removeEventListener("pointermove",M,{capture:!0})}},[]),u.jsx(SC,{...g,children:u.jsx(uxe,{scope:r,open:s,onOpenChange:A,content:b,onContentChange:S,children:u.jsx(dxe,{scope:r,onClose:R.useCallback(()=>A(!1),[A]),isUsingKeyboardRef:E,dir:k,modal:m,children:o})})})};Aq.displayName=xw;var hxe="MenuAnchor",o$=R.forwardRef((e,r)=>{const{__scopeMenu:s,...o}=e,d=WC(s);return u.jsx(rw,{...d,...o,ref:r})});o$.displayName=hxe;var l$="MenuPortal",[pxe,Oq]=Mp(l$,{forceMount:void 0}),kq=e=>{const{__scopeMenu:r,forceMount:s,children:o,container:d}=e,p=Ip(l$,r);return u.jsx(pxe,{scope:r,forceMount:s,children:u.jsx(co,{present:s||p.open,children:u.jsx(_g,{asChild:!0,container:d,children:o})})})};kq.displayName=l$;var ao="MenuContent",[fxe,c$]=Mp(ao),Rq=R.forwardRef((e,r)=>{const s=Oq(ao,e.__scopeMenu),{forceMount:o=s.forceMount,...d}=e,p=Ip(ao,e.__scopeMenu),m=bw(ao,e.__scopeMenu);return u.jsx(Jb.Provider,{scope:e.__scopeMenu,children:u.jsx(co,{present:o||p.open,children:u.jsx(Jb.Slot,{scope:e.__scopeMenu,children:m.modal?u.jsx(mxe,{...d,ref:r}):u.jsx(gxe,{...d,ref:r})})})})}),mxe=R.forwardRef((e,r)=>{const s=Ip(ao,e.__scopeMenu),o=R.useRef(null),d=Ln(r,o);return R.useEffect(()=>{const p=o.current;if(p)return RC(p)},[]),u.jsx(u$,{...e,ref:d,trapFocus:s.open,disableOutsidePointerEvents:s.open,disableOutsideScroll:!0,onFocusOutside:$t(e.onFocusOutside,p=>p.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>s.onOpenChange(!1)})}),gxe=R.forwardRef((e,r)=>{const s=Ip(ao,e.__scopeMenu);return u.jsx(u$,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>s.onOpenChange(!1)})}),yxe=Jve("MenuContent.ScrollLock"),u$=R.forwardRef((e,r)=>{const{__scopeMenu:s,loop:o=!1,trapFocus:d,onOpenAutoFocus:p,onCloseAutoFocus:m,disableOutsidePointerEvents:g,onEntryFocus:b,onEscapeKeyDown:S,onPointerDownOutside:E,onFocusOutside:A,onInteractOutside:k,onDismiss:T,disableOutsideScroll:M,...I}=e,q=Ip(ao,s),G=bw(ao,s),K=WC(s),X=Cq(s),z=lxe(s),[ee,oe]=R.useState(null),Q=R.useRef(null),ne=Ln(r,Q,q.onContentChange),de=R.useRef(0),Ce=R.useRef(""),xe=R.useRef(0),le=R.useRef(null),be=R.useRef("right"),je=R.useRef(0),Ke=M?lw:R.Fragment,ce=M?{as:yxe,allowPinchZoom:!0}:void 0,re=_e=>{const fe=Ce.current+_e,He=z().filter(ze=>!ze.disabled),Oe=document.activeElement,ke=He.find(ze=>ze.ref.current===Oe)?.textValue,Ve=He.map(ze=>ze.textValue),ie=Rxe(Ve,fe,ke),Ne=He.find(ze=>ze.textValue===ie)?.ref.current;(function ze(tt){Ce.current=tt,window.clearTimeout(de.current),tt!==""&&(de.current=window.setTimeout(()=>ze(""),1e3))})(fe),Ne&&setTimeout(()=>Ne.focus())};R.useEffect(()=>()=>window.clearTimeout(de.current),[]),OC();const ue=R.useCallback(_e=>be.current===le.current?.side&&_xe(_e,le.current?.area),[]);return u.jsx(fxe,{scope:s,searchRef:Ce,onItemEnter:R.useCallback(_e=>{ue(_e)&&_e.preventDefault()},[ue]),onItemLeave:R.useCallback(_e=>{ue(_e)||(Q.current?.focus(),oe(null))},[ue]),onTriggerLeave:R.useCallback(_e=>{ue(_e)&&_e.preventDefault()},[ue]),pointerGraceTimerRef:xe,onPointerGraceIntentChange:R.useCallback(_e=>{le.current=_e},[]),children:u.jsx(Ke,{...ce,children:u.jsx(ow,{asChild:!0,trapped:d,onMountAutoFocus:$t(p,_e=>{_e.preventDefault(),Q.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:m,children:u.jsx(kg,{asChild:!0,disableOutsidePointerEvents:g,onEscapeKeyDown:S,onPointerDownOutside:E,onFocusOutside:A,onInteractOutside:k,onDismiss:T,children:u.jsx(Zve,{asChild:!0,...X,dir:G.dir,orientation:"vertical",loop:o,currentTabStopId:ee,onCurrentTabStopIdChange:oe,onEntryFocus:$t(b,_e=>{G.isUsingKeyboardRef.current||_e.preventDefault()}),preventScrollOnEntryFocus:!0,children:u.jsx(EC,{role:"menu","aria-orientation":"vertical","data-state":Vq(q.open),"data-radix-menu-content":"",dir:G.dir,...K,...I,ref:ne,style:{outline:"none",...I.style},onKeyDown:$t(I.onKeyDown,_e=>{const He=_e.target.closest("[data-radix-menu-content]")===_e.currentTarget,Oe=_e.ctrlKey||_e.altKey||_e.metaKey,ke=_e.key.length===1;He&&(_e.key==="Tab"&&_e.preventDefault(),!Oe&&ke&&re(_e.key));const Ve=Q.current;if(_e.target!==Ve||!ixe.includes(_e.key))return;_e.preventDefault();const Ne=z().filter(ze=>!ze.disabled).map(ze=>ze.ref.current);Eq.includes(_e.key)&&Ne.reverse(),Oxe(Ne)}),onBlur:$t(e.onBlur,_e=>{_e.currentTarget.contains(_e.target)||(window.clearTimeout(de.current),Ce.current="")}),onPointerMove:$t(e.onPointerMove,Qb(_e=>{const fe=_e.target,He=je.current!==_e.clientX;if(_e.currentTarget.contains(fe)&&He){const Oe=_e.clientX>je.current?"right":"left";be.current=Oe,je.current=_e.clientX}}))})})})})})})});Rq.displayName=ao;var vxe="MenuGroup",d$=R.forwardRef((e,r)=>{const{__scopeMenu:s,...o}=e;return u.jsx(Cn.div,{role:"group",...o,ref:r})});d$.displayName=vxe;var xxe="MenuLabel",Tq=R.forwardRef((e,r)=>{const{__scopeMenu:s,...o}=e;return u.jsx(Cn.div,{...o,ref:r})});Tq.displayName=xxe;var hC="MenuItem",O3="menu.itemSelect",JC=R.forwardRef((e,r)=>{const{disabled:s=!1,onSelect:o,...d}=e,p=R.useRef(null),m=bw(hC,e.__scopeMenu),g=c$(hC,e.__scopeMenu),b=Ln(r,p),S=R.useRef(!1),E=()=>{const A=p.current;if(!s&&A){const k=new CustomEvent(O3,{bubbles:!0,cancelable:!0});A.addEventListener(O3,T=>o?.(T),{once:!0}),Tz(A,k),k.defaultPrevented?S.current=!1:m.onClose()}};return u.jsx(_q,{...d,ref:b,disabled:s,onClick:$t(e.onClick,E),onPointerDown:A=>{e.onPointerDown?.(A),S.current=!0},onPointerUp:$t(e.onPointerUp,A=>{S.current||A.currentTarget?.click()}),onKeyDown:$t(e.onKeyDown,A=>{const k=g.searchRef.current!=="";s||k&&A.key===" "||E_.includes(A.key)&&(A.currentTarget.click(),A.preventDefault())})})});JC.displayName=hC;var _q=R.forwardRef((e,r)=>{const{__scopeMenu:s,disabled:o=!1,textValue:d,...p}=e,m=c$(hC,s),g=Cq(s),b=R.useRef(null),S=Ln(r,b),[E,A]=R.useState(!1),[k,T]=R.useState("");return R.useEffect(()=>{const M=b.current;M&&T((M.textContent??"").trim())},[p.children]),u.jsx(Jb.ItemSlot,{scope:s,disabled:o,textValue:d??k,children:u.jsx(Wve,{asChild:!0,...g,focusable:!o,children:u.jsx(Cn.div,{role:"menuitem","data-highlighted":E?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...p,ref:S,onPointerMove:$t(e.onPointerMove,Qb(M=>{o?m.onItemLeave(M):(m.onItemEnter(M),M.defaultPrevented||M.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:$t(e.onPointerLeave,Qb(M=>m.onItemLeave(M))),onFocus:$t(e.onFocus,()=>A(!0)),onBlur:$t(e.onBlur,()=>A(!1))})})})}),bxe="MenuCheckboxItem",$q=R.forwardRef((e,r)=>{const{checked:s=!1,onCheckedChange:o,...d}=e;return u.jsx(Iq,{scope:e.__scopeMenu,checked:s,children:u.jsx(JC,{role:"menuitemcheckbox","aria-checked":pC(s)?"mixed":s,...d,ref:r,"data-state":p$(s),onSelect:$t(d.onSelect,()=>o?.(pC(s)?!0:!s),{checkForDefaultPrevented:!1})})})});$q.displayName=bxe;var Nq="MenuRadioGroup",[wxe,Sxe]=Mp(Nq,{value:void 0,onValueChange:()=>{}}),Dq=R.forwardRef((e,r)=>{const{value:s,onValueChange:o,...d}=e,p=tl(o);return u.jsx(wxe,{scope:e.__scopeMenu,value:s,onValueChange:p,children:u.jsx(d$,{...d,ref:r})})});Dq.displayName=Nq;var Pq="MenuRadioItem",Mq=R.forwardRef((e,r)=>{const{value:s,...o}=e,d=Sxe(Pq,e.__scopeMenu),p=s===d.value;return u.jsx(Iq,{scope:e.__scopeMenu,checked:p,children:u.jsx(JC,{role:"menuitemradio","aria-checked":p,...o,ref:r,"data-state":p$(p),onSelect:$t(o.onSelect,()=>d.onValueChange?.(s),{checkForDefaultPrevented:!1})})})});Mq.displayName=Pq;var h$="MenuItemIndicator",[Iq,Exe]=Mp(h$,{checked:!1}),zq=R.forwardRef((e,r)=>{const{__scopeMenu:s,forceMount:o,...d}=e,p=Exe(h$,s);return u.jsx(co,{present:o||pC(p.checked)||p.checked===!0,children:u.jsx(Cn.span,{...d,ref:r,"data-state":p$(p.checked)})})});zq.displayName=h$;var jxe="MenuSeparator",Lq=R.forwardRef((e,r)=>{const{__scopeMenu:s,...o}=e;return u.jsx(Cn.div,{role:"separator","aria-orientation":"horizontal",...o,ref:r})});Lq.displayName=jxe;var Cxe="MenuArrow",Fq=R.forwardRef((e,r)=>{const{__scopeMenu:s,...o}=e,d=WC(s);return u.jsx(jC,{...d,...o,ref:r})});Fq.displayName=Cxe;var Axe="MenuSub",[E0e,qq]=Mp(Axe),Ab="MenuSubTrigger",Bq=R.forwardRef((e,r)=>{const s=Ip(Ab,e.__scopeMenu),o=bw(Ab,e.__scopeMenu),d=qq(Ab,e.__scopeMenu),p=c$(Ab,e.__scopeMenu),m=R.useRef(null),{pointerGraceTimerRef:g,onPointerGraceIntentChange:b}=p,S={__scopeMenu:e.__scopeMenu},E=R.useCallback(()=>{m.current&&window.clearTimeout(m.current),m.current=null},[]);return R.useEffect(()=>E,[E]),R.useEffect(()=>{const A=g.current;return()=>{window.clearTimeout(A),b(null)}},[g,b]),u.jsx(o$,{asChild:!0,...S,children:u.jsx(_q,{id:d.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":d.contentId,"data-state":Vq(s.open),...e,ref:zi(r,d.onTriggerChange),onClick:A=>{e.onClick?.(A),!(e.disabled||A.defaultPrevented)&&(A.currentTarget.focus(),s.open||s.onOpenChange(!0))},onPointerMove:$t(e.onPointerMove,Qb(A=>{p.onItemEnter(A),!A.defaultPrevented&&!e.disabled&&!s.open&&!m.current&&(p.onPointerGraceIntentChange(null),m.current=window.setTimeout(()=>{s.onOpenChange(!0),E()},100))})),onPointerLeave:$t(e.onPointerLeave,Qb(A=>{E();const k=s.content?.getBoundingClientRect();if(k){const T=s.content?.dataset.side,M=T==="right",I=M?-5:5,q=k[M?"left":"right"],G=k[M?"right":"left"];p.onPointerGraceIntentChange({area:[{x:A.clientX+I,y:A.clientY},{x:q,y:k.top},{x:G,y:k.top},{x:G,y:k.bottom},{x:q,y:k.bottom}],side:T}),window.clearTimeout(g.current),g.current=window.setTimeout(()=>p.onPointerGraceIntentChange(null),300)}else{if(p.onTriggerLeave(A),A.defaultPrevented)return;p.onPointerGraceIntentChange(null)}})),onKeyDown:$t(e.onKeyDown,A=>{const k=p.searchRef.current!=="";e.disabled||k&&A.key===" "||axe[o.dir].includes(A.key)&&(s.onOpenChange(!0),s.content?.focus(),A.preventDefault())})})})});Bq.displayName=Ab;var Uq="MenuSubContent",Kq=R.forwardRef((e,r)=>{const s=Oq(ao,e.__scopeMenu),{forceMount:o=s.forceMount,...d}=e,p=Ip(ao,e.__scopeMenu),m=bw(ao,e.__scopeMenu),g=qq(Uq,e.__scopeMenu),b=R.useRef(null),S=Ln(r,b);return u.jsx(Jb.Provider,{scope:e.__scopeMenu,children:u.jsx(co,{present:o||p.open,children:u.jsx(Jb.Slot,{scope:e.__scopeMenu,children:u.jsx(u$,{id:g.contentId,"aria-labelledby":g.triggerId,...d,ref:S,align:"start",side:m.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:E=>{m.isUsingKeyboardRef.current&&b.current?.focus(),E.preventDefault()},onCloseAutoFocus:E=>E.preventDefault(),onFocusOutside:$t(e.onFocusOutside,E=>{E.target!==g.trigger&&p.onOpenChange(!1)}),onEscapeKeyDown:$t(e.onEscapeKeyDown,E=>{m.onClose(),E.preventDefault()}),onKeyDown:$t(e.onKeyDown,E=>{const A=E.currentTarget.contains(E.target),k=oxe[m.dir].includes(E.key);A&&k&&(p.onOpenChange(!1),g.trigger?.focus(),E.preventDefault())})})})})})});Kq.displayName=Uq;function Vq(e){return e?"open":"closed"}function pC(e){return e==="indeterminate"}function p$(e){return pC(e)?"indeterminate":e?"checked":"unchecked"}function Oxe(e){const r=document.activeElement;for(const s of e)if(s===r||(s.focus(),document.activeElement!==r))return}function kxe(e,r){return e.map((s,o)=>e[(r+o)%e.length])}function Rxe(e,r,s){const d=r.length>1&&Array.from(r).every(S=>S===r[0])?r[0]:r,p=s?e.indexOf(s):-1;let m=kxe(e,Math.max(p,0));d.length===1&&(m=m.filter(S=>S!==s));const b=m.find(S=>S.toLowerCase().startsWith(d.toLowerCase()));return b!==s?b:void 0}function Txe(e,r){const{x:s,y:o}=e;let d=!1;for(let p=0,m=r.length-1;po!=k>o&&s<(A-S)*(o-E)/(k-E)+S&&(d=!d)}return d}function _xe(e,r){if(!r)return!1;const s={x:e.clientX,y:e.clientY};return Txe(s,r)}function Qb(e){return r=>r.pointerType==="mouse"?e(r):void 0}var $xe=Aq,Nxe=o$,Dxe=kq,Pxe=Rq,Mxe=d$,Ixe=Tq,zxe=JC,Lxe=$q,Fxe=Dq,qxe=Mq,Bxe=zq,Uxe=Lq,Kxe=Fq,Vxe=Bq,Hxe=Kq,QC="DropdownMenu",[Gxe]=al(QC,[jq]),Ki=jq(),[Xxe,Hq]=Gxe(QC),Gq=e=>{const{__scopeDropdownMenu:r,children:s,dir:o,open:d,defaultOpen:p,onOpenChange:m,modal:g=!0}=e,b=Ki(r),S=R.useRef(null),[E,A]=qd({prop:d,defaultProp:p??!1,onChange:m,caller:QC});return u.jsx(Xxe,{scope:r,triggerId:Vs(),triggerRef:S,contentId:Vs(),open:E,onOpenChange:A,onOpenToggle:R.useCallback(()=>A(k=>!k),[A]),modal:g,children:u.jsx($xe,{...b,open:E,onOpenChange:A,dir:o,modal:g,children:s})})};Gq.displayName=QC;var Xq="DropdownMenuTrigger",Yq=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,disabled:o=!1,...d}=e,p=Hq(Xq,s),m=Ki(s);return u.jsx(Nxe,{asChild:!0,...m,children:u.jsx(Cn.button,{type:"button",id:p.triggerId,"aria-haspopup":"menu","aria-expanded":p.open,"aria-controls":p.open?p.contentId:void 0,"data-state":p.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...d,ref:zi(r,p.triggerRef),onPointerDown:$t(e.onPointerDown,g=>{!o&&g.button===0&&g.ctrlKey===!1&&(p.onOpenToggle(),p.open||g.preventDefault())}),onKeyDown:$t(e.onKeyDown,g=>{o||(["Enter"," "].includes(g.key)&&p.onOpenToggle(),g.key==="ArrowDown"&&p.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(g.key)&&g.preventDefault())})})})});Yq.displayName=Xq;var Yxe="DropdownMenuPortal",Zq=e=>{const{__scopeDropdownMenu:r,...s}=e,o=Ki(r);return u.jsx(Dxe,{...o,...s})};Zq.displayName=Yxe;var Wq="DropdownMenuContent",Jq=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,d=Hq(Wq,s),p=Ki(s),m=R.useRef(!1);return u.jsx(Pxe,{id:d.contentId,"aria-labelledby":d.triggerId,...p,...o,ref:r,onCloseAutoFocus:$t(e.onCloseAutoFocus,g=>{m.current||d.triggerRef.current?.focus(),m.current=!1,g.preventDefault()}),onInteractOutside:$t(e.onInteractOutside,g=>{const b=g.detail.originalEvent,S=b.button===0&&b.ctrlKey===!0,E=b.button===2||S;(!d.modal||E)&&(m.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)"}})});Jq.displayName=Wq;var Zxe="DropdownMenuGroup",Wxe=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,d=Ki(s);return u.jsx(Mxe,{...d,...o,ref:r})});Wxe.displayName=Zxe;var Jxe="DropdownMenuLabel",Qxe=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,d=Ki(s);return u.jsx(Ixe,{...d,...o,ref:r})});Qxe.displayName=Jxe;var ebe="DropdownMenuItem",Qq=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,d=Ki(s);return u.jsx(zxe,{...d,...o,ref:r})});Qq.displayName=ebe;var tbe="DropdownMenuCheckboxItem",nbe=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,d=Ki(s);return u.jsx(Lxe,{...d,...o,ref:r})});nbe.displayName=tbe;var rbe="DropdownMenuRadioGroup",sbe=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,d=Ki(s);return u.jsx(Fxe,{...d,...o,ref:r})});sbe.displayName=rbe;var ibe="DropdownMenuRadioItem",abe=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,d=Ki(s);return u.jsx(qxe,{...d,...o,ref:r})});abe.displayName=ibe;var obe="DropdownMenuItemIndicator",lbe=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,d=Ki(s);return u.jsx(Bxe,{...d,...o,ref:r})});lbe.displayName=obe;var cbe="DropdownMenuSeparator",ube=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,d=Ki(s);return u.jsx(Uxe,{...d,...o,ref:r})});ube.displayName=cbe;var dbe="DropdownMenuArrow",hbe=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,d=Ki(s);return u.jsx(Kxe,{...d,...o,ref:r})});hbe.displayName=dbe;var pbe="DropdownMenuSubTrigger",fbe=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,d=Ki(s);return u.jsx(Vxe,{...d,...o,ref:r})});fbe.displayName=pbe;var mbe="DropdownMenuSubContent",gbe=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,d=Ki(s);return u.jsx(Hxe,{...d,...o,ref:r,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)"}})});gbe.displayName=mbe;var ybe=Gq,vbe=Yq,xbe=Zq,bbe=Jq,wbe=Qq;function f$({...e}){return u.jsx(ybe,{"data-slot":"dropdown-menu",...e})}function m$({...e}){return u.jsx(vbe,{"data-slot":"dropdown-menu-trigger",...e})}function g$({className:e,sideOffset:r=4,...s}){return u.jsx(xbe,{children:u.jsx(bbe,{"data-slot":"dropdown-menu-content",sideOffset:r,className:ht("bg-popover text-popover-foreground 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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...s})})}function jp({className:e,inset:r,variant:s="default",...o}){return u.jsx(wbe,{"data-slot":"dropdown-menu-item","data-inset":r,"data-variant":s,className:ht("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...o})}var eA="Switch",[Sbe]=al(eA),[Ebe,jbe]=Sbe(eA),eB=R.forwardRef((e,r)=>{const{__scopeSwitch:s,name:o,checked:d,defaultChecked:p,required:m,disabled:g,value:b="on",onCheckedChange:S,form:E,...A}=e,[k,T]=R.useState(null),M=Ln(r,X=>T(X)),I=R.useRef(!1),q=k?E||!!k.closest("form"):!0,[G,K]=qd({prop:d,defaultProp:p??!1,onChange:S,caller:eA});return u.jsxs(Ebe,{scope:s,checked:G,disabled:g,children:[u.jsx(Cn.button,{type:"button",role:"switch","aria-checked":G,"aria-required":m,"data-state":sB(G),"data-disabled":g?"":void 0,disabled:g,value:b,...A,ref:M,onClick:$t(e.onClick,X=>{K(z=>!z),q&&(I.current=X.isPropagationStopped(),I.current||X.stopPropagation())})}),q&&u.jsx(rB,{control:k,bubbles:!I.current,name:o,value:b,checked:G,required:m,disabled:g,form:E,style:{transform:"translateX(-100%)"}})]})});eB.displayName=eA;var tB="SwitchThumb",nB=R.forwardRef((e,r)=>{const{__scopeSwitch:s,...o}=e,d=jbe(tB,s);return u.jsx(Cn.span,{"data-state":sB(d.checked),"data-disabled":d.disabled?"":void 0,...o,ref:r})});nB.displayName=tB;var Cbe="SwitchBubbleInput",rB=R.forwardRef(({__scopeSwitch:e,control:r,checked:s,bubbles:o=!0,...d},p)=>{const m=R.useRef(null),g=Ln(m,p),b=T6(s),S=Vz(r);return R.useEffect(()=>{const E=m.current;if(!E)return;const A=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(A,"checked").set;if(b!==s&&T){const M=new Event("click",{bubbles:o});T.call(E,s),E.dispatchEvent(M)}},[b,s,o]),u.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:s,...d,tabIndex:-1,ref:g,style:{...d.style,...S,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});rB.displayName=Cbe;function sB(e){return e?"checked":"unchecked"}var Abe=eB,Obe=nB;function k3({className:e,...r}){return u.jsx(Abe,{"data-slot":"switch",className:ht("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...r,children:u.jsx(Obe,{"data-slot":"switch-thumb",className:ht("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}const fC=["route53","s3","ec2","iam","rds","dynamodb"],jj=Xs({provider:Da(["aws","cloudflare","hetzner","digitalocean","generic"]),kind:Da(["aws_access_key","api_token","basic_auth","oauth2"]),schema_version:Zb().default(1),name:zn().min(1,"Name is required").max(100),scope_kind:Da(["provider","service","resource"]),scope_version:Zb().default(1),scope:b3(),account_id:zn().optional().or(Wb("")).transform(e=>e||void 0),region:zn().optional().or(Wb("")).transform(e=>e||void 0),secret:b3()}).superRefine((e,r)=>{if(e.provider==="aws"){if(e.scope_kind==="service"){const s=e.scope?.service;fC.includes(s)||r.addIssue({code:Dd.custom,path:["scope"],message:`For AWS service scope, "service" must be one of: ${fC.join(", ")}`})}if(e.scope_kind==="resource"){const s=e.scope?.arn;(typeof s!="string"||!s.startsWith("arn:"))&&r.addIssue({code:Dd.custom,path:["scope"],message:'For AWS resource scope, "arn" must start with "arn:"'})}if(e.kind==="aws_access_key"){const s=e.secret??{},o=s.access_key_id;(typeof o!="string"||!/^[A-Z0-9]{20}$/.test(o))&&r.addIssue({code:Dd.custom,path:["secret"],message:"access_key_id must be 20 chars (A-Z0-9)"}),(typeof s.secret_access_key!="string"||s.secret_access_key.length<10)&&r.addIssue({code:Dd.custom,path:["secret"],message:"secret_access_key is required"})}}if(e.kind==="api_token"&&((e.secret??{}).token||r.addIssue({code:Dd.custom,path:["secret"],message:"token is required"})),e.kind==="basic_auth"){const s=e.secret??{};(!s.username||!s.password)&&r.addIssue({code:Dd.custom,path:["secret"],message:"username and password are required"})}if(e.kind==="oauth2"){const s=e.secret??{};(!s.client_id||!s.client_secret||!s.refresh_token)&&r.addIssue({code:Dd.custom,path:["secret"],message:"client_id, client_secret, and refresh_token are required"})}e.scope_kind!=="provider"&&!e.scope&&r.addIssue({code:Dd.custom,path:["scope"],message:"scope is required"})}),yT=jj.partial().extend({name:zn().min(1,"Name is required").max(100).optional()});function Ql(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return""}}function hj(e){const r=e?.body??e?.response??e?.message;if(typeof r=="string")return r;try{const s=e?.response?.data?.message||e?.message;if(s)return String(s)}catch{return"Unknown error"}return"Unknown error"}function kbe({provider:e,scope_kind:r}){return e==="aws"&&r==="service"}function Rbe({provider:e,scope_kind:r}){return e==="aws"&&r==="resource"}function Tbe({scope_kind:e}){return e==="provider"}function R3(){return{provider:"aws",kind:"aws_access_key",schema_version:1,name:"",scope_kind:"provider",scope_version:1,scope:{},account_id:"",region:"",secret:{}}}function T3(e){return{provider:e.provider,kind:e.kind,schema_version:e.schema_version??1,name:e.name,scope_kind:e.scope_kind,scope_version:e.scope_version??1,scope:e.scope??{},account_id:e.account_id,region:e.region,secret:e.secret??{}}}function _3(e){const r={},s=["name","account_id","region","scope_kind","scope_version","scope","secret","provider","kind","schema_version"];for(const o of s)typeof e[o]<"u"&&e[o]!==""&&(r[o]=e[o]);return r}const _be=()=>{const[e,r]=R.useState(""),[s,o]=R.useState(!1),[d,p]=R.useState(!1),[m,g]=R.useState(!1),[b,S]=R.useState(null),[E,A]=R.useState(null),[k,T]=R.useState(!1),[M,I]=R.useState(!1),[q,G]=R.useState(!1),[K,X]=R.useState(null),[z,ee]=R.useState(!1),[oe,Q]=R.useState(null),ne=Hs(),de=rr({queryKey:["credentials"],queryFn:()=>Qm.listCredentials()}),Ce=nn({mutationFn:ie=>Qm.createCredential(T3(ie)),onSuccess:async()=>{await ne.invalidateQueries({queryKey:["credentials"]}),Ze.success("Credential created"),o(!1),je.reset(R3()),T(!1)},onError:ie=>{Ze.error("Failed to create credential",{description:hj(ie)})}}),xe=nn({mutationFn:ie=>Qm.updateCredential(ie.id,_3(ie.body)),onSuccess:async()=>{await ne.invalidateQueries({queryKey:["credentials"]}),Ze.success("Credential updated"),p(!1),A(null),I(!1)},onError:ie=>{Ze.error("Failed to update credential",{description:hj(ie)})}}),le=nn({mutationFn:ie=>Qm.deleteCredential(ie),onSuccess:async()=>{await ne.invalidateQueries({queryKey:["credentials"]}),Ze.success("Credential deleted")},onError:ie=>{Ze.error("Failed to delete credential",{description:hj(ie)})}}),be=nn({mutationFn:ie=>Qm.revealCredential(ie),onSuccess:ie=>{S(ie),g(!0)},onError:ie=>{Ze.error("Failed to reveal secret",{description:hj(ie)})}}),je=mr({resolver:gr(jj),defaultValues:R3(),mode:"onBlur"}),Ke=mr({resolver:gr(yT),defaultValues:{},mode:"onBlur"});function ce(ie){A(ie.id),Ke.reset({provider:ie.provider,kind:ie.kind,schema_version:ie.schema_version??1,name:ie.name,scope_kind:ie.scope_kind,scope_version:ie.scope_version??1,account_id:ie.account_id??"",region:ie.region??"",scope:ie.scope??(ie.scope_kind==="provider"?{}:void 0),secret:void 0}),I(!1),p(!0)}const re=R.useMemo(()=>{const ie=de.data??[];if(!e.trim())return ie;const Ne=e.toLowerCase();return ie.filter(ze=>[ze.name,ze.provider,ze.kind,ze.scope_kind,ze.account_id,ze.region,JSON.stringify(ze.scope??{})].filter(Boolean).map(tt=>String(tt).toLowerCase()).some(tt=>tt.includes(Ne)))},[de.data,e]);if(de.isLoading)return u.jsxs("div",{className:"flex items-center gap-2 p-6",children:[u.jsx(Ds,{className:"h-4 w-4 animate-spin"})," Loading credentials…"]});if(de.error)return u.jsxs("div",{className:"p-6 text-red-500",children:["Error loading credentials.",u.jsx("pre",{className:"mt-2 text-xs opacity-80",children:JSON.stringify(de.error,null,2)})]});const ue=je.watch("provider"),_e=je.watch("kind"),fe=je.watch("scope_kind"),He=ie=>je.setValue("scope",ie,{shouldDirty:!0,shouldValidate:!0}),Oe=ie=>je.setValue("secret",ie,{shouldDirty:!0,shouldValidate:!0});function ke(){if(!k){if(ue==="aws"&&_e==="aws_access_key"){const ie=je.getValues("secret")??{};Oe({access_key_id:ie.access_key_id??"",secret_access_key:ie.secret_access_key??""})}else if(_e==="api_token"){const ie=je.getValues("secret")??{};Oe({token:ie.token??""})}else if(_e==="basic_auth"){const ie=je.getValues("secret")??{};Oe({username:ie.username??"",password:ie.password??""})}else if(_e==="oauth2"){const ie=je.getValues("secret")??{};Oe({client_id:ie.client_id??"",client_secret:ie.client_secret??"",refresh_token:ie.refresh_token??""})}}}function Ve(ie){je.setValue("scope_kind",ie),ie==="provider"&&He({}),ie==="service"&&He({service:"route53"}),ie==="resource"&&He({arn:""})}return u.jsxs("div",{className:"space-y-4 p-6",children:[u.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[u.jsxs("div",{children:[u.jsx("h1",{className:"mb-1 text-2xl font-bold",children:"Credentials"}),u.jsx("p",{className:"text-muted-foreground text-sm",children:"Store provider credentials. Secrets are encrypted server-side; revealing is a one-time read."})]}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsxs("div",{className:"relative",children:[u.jsx(Pa,{className:"absolute top-2.5 left-2 h-4 w-4 opacity-60"}),u.jsx(xt,{value:e,onChange:ie=>r(ie.target.value),placeholder:"Search by name, provider, kind, scope…",className:"w-64 pl-8"})]}),u.jsxs(fn,{open:s,onOpenChange:o,children:[u.jsx(Li,{asChild:!0,children:u.jsxs(Fe,{onClick:()=>o(!0),children:[u.jsx(lo,{className:"mr-2 h-4 w-4"}),"Create Credential"]})}),u.jsxs(mn,{className:"sm:max-w-2xl",children:[u.jsx(gn,{children:u.jsx(yn,{children:"Create Credential"})}),u.jsx(yr,{...je,children:u.jsxs("form",{onSubmit:je.handleSubmit(ie=>{const Ne=jj.safeParse(ie);if(!Ne.success){Ze.error("Please fix validation errors");return}Ce.mutate(Ne.data)}),className:"space-y-5 pt-2",children:[u.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[u.jsx(yt,{control:je.control,name:"provider",render:({field:ie})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Provider"}),u.jsxs(Rn,{onValueChange:Ne=>{ie.onChange(Ne),ke()},defaultValue:ie.value,children:[u.jsx(wt,{children:u.jsx(_n,{children:u.jsx(Tn,{})})}),u.jsxs($n,{children:[u.jsx(jt,{value:"aws",children:"AWS"}),u.jsx(jt,{value:"cloudflare",children:"Cloudflare"}),u.jsx(jt,{value:"hetzner",children:"Hetzner"}),u.jsx(jt,{value:"digitalocean",children:"DigitalOcean"}),u.jsx(jt,{value:"generic",children:"Generic"})]})]}),u.jsx(mt,{})]})}),u.jsx(yt,{control:je.control,name:"kind",render:({field:ie})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Kind"}),u.jsxs(Rn,{onValueChange:Ne=>{ie.onChange(Ne),ke()},defaultValue:ie.value,children:[u.jsx(wt,{children:u.jsx(_n,{children:u.jsx(Tn,{})})}),u.jsxs($n,{children:[u.jsx(jt,{value:"aws_access_key",children:"AWS Access Key"}),u.jsx(jt,{value:"api_token",children:"API Token"}),u.jsx(jt,{value:"basic_auth",children:"Basic Auth"}),u.jsx(jt,{value:"oauth2",children:"OAuth2"})]})]}),u.jsx(mt,{})]})}),u.jsx(yt,{control:je.control,name:"scope_kind",render:({field:ie})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Scope Kind"}),u.jsxs(Rn,{onValueChange:Ne=>{Ve(Ne)},defaultValue:ie.value,children:[u.jsx(wt,{children:u.jsx(_n,{children:u.jsx(Tn,{})})}),u.jsxs($n,{children:[u.jsx(jt,{value:"provider",children:"Provider"}),u.jsx(jt,{value:"service",children:"Service"}),u.jsx(jt,{value:"resource",children:"Resource"})]})]}),u.jsx(mt,{})]})}),u.jsx(yt,{control:je.control,name:"name",render:({field:ie})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Name"}),u.jsx(xt,{...ie,placeholder:"My AWS Key"}),u.jsx(mt,{})]})}),u.jsx(yt,{control:je.control,name:"account_id",render:({field:ie})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Account ID (optional)"}),u.jsx(xt,{...ie,placeholder:"e.g. 123456789012"}),u.jsx(mt,{})]})}),u.jsx(yt,{control:je.control,name:"region",render:({field:ie})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Region (optional)"}),u.jsx(xt,{...ie,placeholder:"e.g. us-east-1"}),u.jsx(mt,{})]})})]}),!Tbe({scope_kind:fe})&&u.jsx(u.Fragment,{children:kbe({provider:ue,scope_kind:fe})?u.jsxs(lt,{children:[u.jsx(ct,{children:"Service"}),u.jsx(Go,{control:je.control,name:"scope",render:({field:ie})=>u.jsxs(Rn,{onValueChange:Ne=>ie.onChange({service:Ne}),value:ie.value?.service??"route53",children:[u.jsx(wt,{children:u.jsx(_n,{children:u.jsx(Tn,{placeholder:"Select an AWS service"})})}),u.jsx($n,{children:fC.map(Ne=>u.jsx(jt,{value:Ne,children:Ne.toUpperCase()},Ne))})]})}),u.jsxs("p",{className:"text-muted-foreground mt-1 text-xs",children:["Must be one of: ",fC.join(", "),"."]})]}):Rbe({provider:ue,scope_kind:fe})?u.jsxs(lt,{children:[u.jsx(ct,{children:"Resource ARN"}),u.jsx(Go,{control:je.control,name:"scope",render:({field:ie})=>u.jsx(xt,{value:ie.value?.arn??"",onChange:Ne=>ie.onChange({arn:Ne.target.value}),placeholder:"arn:aws:service:region:account:resource"})}),u.jsx(mt,{})]}):u.jsx(yt,{control:je.control,name:"scope",render:({field:ie})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Scope (JSON)"}),u.jsx(hu,{value:Ql(ie.value??{}),onChange:Ne=>{try{const ze=JSON.parse(Ne.target.value);ie.onChange(ze)}catch{ie.onChange(Ne.target.value)}},rows:3,placeholder:'{"service":"route53"} or {"arn":"arn:aws:..."}',className:"font-mono"}),u.jsx(mt,{})]})})}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(k3,{checked:k,onCheckedChange:ie=>{T(ie),ke()},id:"raw-secret-toggle"}),u.jsx("label",{htmlFor:"raw-secret-toggle",className:"text-sm",children:"Edit secret as raw JSON"})]}),k?u.jsx(yt,{control:je.control,name:"secret",render:({field:ie})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Secret (JSON)"}),u.jsx(hu,{value:Ql(ie.value??{}),onChange:Ne=>{try{ie.onChange(JSON.parse(Ne.target.value))}catch{ie.onChange(Ne.target.value)}},rows:6,placeholder:_e==="aws_access_key"?'{"access_key_id":"...","secret_access_key":"..."}':_e==="api_token"?'{"token":"..."}':_e==="basic_auth"?'{"username":"...","password":"..."}':'{"client_id":"...","client_secret":"...","refresh_token":"..."}',className:"font-mono"}),u.jsx(mt,{})]})}):u.jsxs(u.Fragment,{children:[ue==="aws"&&_e==="aws_access_key"&&u.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[u.jsxs(lt,{children:[u.jsx(ct,{children:"Access Key ID"}),u.jsx(Go,{control:je.control,name:"secret",render:({field:ie})=>u.jsx(xt,{value:(ie.value??{}).access_key_id??"",onChange:Ne=>Oe({...ie.value??{},access_key_id:Ne.target.value.trim()}),placeholder:"AKIA..."})})]}),u.jsxs(lt,{children:[u.jsx(ct,{children:"Secret Access Key"}),u.jsx(Go,{control:je.control,name:"secret",render:({field:ie})=>u.jsx(xt,{type:"password",value:(ie.value??{}).secret_access_key??"",onChange:Ne=>Oe({...ie.value??{},secret_access_key:Ne.target.value}),placeholder:"•••••••••••••••"})})]})]}),_e==="api_token"&&u.jsxs(lt,{children:[u.jsx(ct,{children:"API Token"}),u.jsx(Go,{control:je.control,name:"secret",render:({field:ie})=>u.jsx(xt,{value:(ie.value??{}).token??"",onChange:Ne=>Oe({...ie.value??{},token:Ne.target.value}),placeholder:"token..."})})]}),_e==="basic_auth"&&u.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[u.jsxs(lt,{children:[u.jsx(ct,{children:"Username"}),u.jsx(Go,{control:je.control,name:"secret",render:({field:ie})=>u.jsx(xt,{value:(ie.value??{}).username??"",onChange:Ne=>Oe({...ie.value??{},username:Ne.target.value})})})]}),u.jsxs(lt,{children:[u.jsx(ct,{children:"Password"}),u.jsx(Go,{control:je.control,name:"secret",render:({field:ie})=>u.jsx(xt,{type:"password",value:(ie.value??{}).password??"",onChange:Ne=>Oe({...ie.value??{},password:Ne.target.value})})})]})]}),_e==="oauth2"&&u.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[u.jsxs(lt,{children:[u.jsx(ct,{children:"Client ID"}),u.jsx(Go,{control:je.control,name:"secret",render:({field:ie})=>u.jsx(xt,{value:(ie.value??{}).client_id??"",onChange:Ne=>Oe({...ie.value??{},client_id:Ne.target.value})})})]}),u.jsxs(lt,{children:[u.jsx(ct,{children:"Client Secret"}),u.jsx(Go,{control:je.control,name:"secret",render:({field:ie})=>u.jsx(xt,{type:"password",value:(ie.value??{}).client_secret??"",onChange:Ne=>Oe({...ie.value??{},client_secret:Ne.target.value})})})]}),u.jsxs(lt,{children:[u.jsx(ct,{children:"Refresh Token"}),u.jsx(Go,{control:je.control,name:"secret",render:({field:ie})=>u.jsx(xt,{value:(ie.value??{}).refresh_token??"",onChange:Ne=>Oe({...ie.value??{},refresh_token:Ne.target.value})})})]})]})]}),u.jsxs(Sn,{className:"gap-2",children:[u.jsx(Fe,{type:"button",variant:"secondary",onClick:()=>{const ie=jj.safeParse(je.getValues());if(!ie.success){Ze.error("Fix validation errors before previewing");return}const Ne=T3(ie.data);X(Ne),G(!0)},children:"Preview request"}),u.jsx(Fe,{variant:"outline",type:"button",onClick:()=>o(!1),children:"Cancel"}),u.jsxs(Fe,{type:"submit",disabled:Ce.isPending,children:[Ce.isPending&&u.jsx(Ds,{className:"mr-2 h-4 w-4 animate-spin"}),"Create"]})]})]})})]})]})]})]}),u.jsx("div",{className:"overflow-x-auto rounded-xl border",children:u.jsxs("table",{className:"min-w-full text-sm",children:[u.jsx("thead",{className:"bg-muted/40 text-xs tracking-wide uppercase",children:u.jsxs("tr",{children:[u.jsx("th",{className:"w-[26%] px-4 py-2 text-left",children:"Name"}),u.jsx("th",{className:"px-4 py-2 text-left",children:"Provider"}),u.jsx("th",{className:"px-4 py-2 text-left",children:"Kind"}),u.jsx("th",{className:"px-4 py-2 text-left",children:"Scope"}),u.jsx("th",{className:"px-4 py-2 text-left",children:"Account"}),u.jsx("th",{className:"px-4 py-2 text-left",children:"Region"}),u.jsx("th",{className:"px-4 py-2 text-right",children:"Actions"})]})}),u.jsxs("tbody",{children:[re.map(ie=>u.jsxs("tr",{className:"border-t",children:[u.jsxs("td",{className:"px-4 py-2",children:[u.jsx("div",{className:"font-medium",children:ie.name}),u.jsxs("div",{className:"text-muted-foreground text-xs",children:[u.jsx("span",{className:"mr-1",children:"id:"}),u.jsxs("code",{className:"bg-muted rounded px-1",children:[ie.id.slice(0,8),"…"]})]})]}),u.jsx("td",{className:"px-4 py-2",children:ie.provider}),u.jsx("td",{className:"px-4 py-2",children:ie.kind}),u.jsx("td",{className:"px-4 py-2",children:u.jsx(rs,{variant:"secondary",children:ie.scope_kind})}),u.jsx("td",{className:"px-4 py-2",children:ie.account_id??"—"}),u.jsx("td",{className:"px-4 py-2",children:ie.region??"—"}),u.jsx("td",{className:"px-4 py-2",children:u.jsxs("div",{className:"flex items-center justify-end gap-2",children:[u.jsx(Fe,{size:"icon",variant:"ghost",title:"Reveal secret (one-time read)",onClick:()=>be.mutate(ie.id),children:u.jsx(kT,{className:"h-4 w-4"})}),u.jsx(Fe,{size:"icon",variant:"ghost",title:"Edit",onClick:()=>ce(ie),children:u.jsx(pu,{className:"h-4 w-4"})}),u.jsxs(rC,{children:[u.jsx(sC,{asChild:!0,children:u.jsx(Fe,{size:"icon",variant:"ghost",title:"Delete",children:u.jsx(zb,{className:"h-4 w-4"})})}),u.jsxs(iC,{children:[u.jsxs(aC,{children:[u.jsxs(lC,{children:["Delete “",ie.name,"”?"]}),u.jsx(cC,{children:"This will permanently remove the credential metadata. Secrets are not recoverable."})]}),u.jsxs(oC,{children:[u.jsx(dC,{disabled:le.isPending,children:"Cancel"}),u.jsxs(uC,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>le.mutate(ie.id),disabled:le.isPending,children:[le.isPending&&u.jsx(Ds,{className:"mr-2 inline h-4 w-4 animate-spin"}),"Delete"]})]})]})]}),u.jsxs(f$,{children:[u.jsx(m$,{asChild:!0,children:u.jsx(Fe,{size:"icon",variant:"ghost",children:u.jsx(z_,{className:"h-4 w-4"})})}),u.jsxs(g$,{align:"end",children:[u.jsx(jp,{onClick:()=>ce(ie),children:"Edit"}),u.jsx(jp,{onClick:()=>be.mutate(ie.id),children:"Reveal secret"}),u.jsx(jp,{className:"text-destructive",onClick:()=>le.mutate(ie.id),children:"Delete"})]})]})]})})]},ie.id)),re.length===0&&u.jsx("tr",{children:u.jsx("td",{colSpan:7,className:"px-4 py-12 text-center",children:u.jsxs("div",{className:"mx-auto max-w-md",children:[u.jsx("div",{className:"mb-2 flex items-center justify-center",children:u.jsx(Tj,{className:"text-muted-foreground h-5 w-5"})}),u.jsx("p",{className:"text-muted-foreground",children:"No credentials match your search."})]})})})]})]})}),u.jsx(fn,{open:d,onOpenChange:p,children:u.jsxs(mn,{className:"sm:max-w-2xl",children:[u.jsx(gn,{children:u.jsx(yn,{children:"Edit Credential"})}),u.jsx(yr,{...Ke,children:u.jsxs("form",{onSubmit:Ke.handleSubmit(ie=>{if(!E)return;const Ne=yT.safeParse(ie);if(!Ne.success){Ze.error("Please fix validation errors");return}xe.mutate({id:E,body:Ne.data})}),className:"space-y-5 pt-2",children:[u.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[u.jsx(yt,{control:Ke.control,name:"provider",render:({field:ie})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Provider"}),u.jsxs(Rn,{onValueChange:ie.onChange,value:ie.value,children:[u.jsx(wt,{children:u.jsx(_n,{children:u.jsx(Tn,{})})}),u.jsxs($n,{children:[u.jsx(jt,{value:"aws",children:"AWS"}),u.jsx(jt,{value:"cloudflare",children:"Cloudflare"}),u.jsx(jt,{value:"hetzner",children:"Hetzner"}),u.jsx(jt,{value:"digitalocean",children:"DigitalOcean"}),u.jsx(jt,{value:"generic",children:"Generic"})]})]}),u.jsx(mt,{})]})}),u.jsx(yt,{control:Ke.control,name:"kind",render:({field:ie})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Kind"}),u.jsxs(Rn,{onValueChange:ie.onChange,value:ie.value,children:[u.jsx(wt,{children:u.jsx(_n,{children:u.jsx(Tn,{})})}),u.jsxs($n,{children:[u.jsx(jt,{value:"aws_access_key",children:"AWS Access Key"}),u.jsx(jt,{value:"api_token",children:"API Token"}),u.jsx(jt,{value:"basic_auth",children:"Basic Auth"}),u.jsx(jt,{value:"oauth2",children:"OAuth2"})]})]}),u.jsx(mt,{})]})}),u.jsx(yt,{control:Ke.control,name:"scope_kind",render:({field:ie})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Scope Kind"}),u.jsxs(Rn,{onValueChange:ie.onChange,value:ie.value,children:[u.jsx(wt,{children:u.jsx(_n,{children:u.jsx(Tn,{})})}),u.jsxs($n,{children:[u.jsx(jt,{value:"provider",children:"Provider"}),u.jsx(jt,{value:"service",children:"Service"}),u.jsx(jt,{value:"resource",children:"Resource"})]})]}),u.jsx(mt,{})]})}),u.jsx(yt,{control:Ke.control,name:"name",render:({field:ie})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Name"}),u.jsx(xt,{...ie}),u.jsx(mt,{})]})}),u.jsx(yt,{control:Ke.control,name:"account_id",render:({field:ie})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Account ID"}),u.jsx(xt,{...ie,placeholder:"optional"}),u.jsx(mt,{})]})}),u.jsx(yt,{control:Ke.control,name:"region",render:({field:ie})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Region"}),u.jsx(xt,{...ie,placeholder:"optional"}),u.jsx(mt,{})]})})]}),u.jsx(yt,{control:Ke.control,name:"scope",render:({field:ie})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Scope (JSON)"}),u.jsx(hu,{value:Ql(ie.value??(Ke.getValues("scope_kind")==="provider"?{}:void 0)),onChange:Ne=>{try{ie.onChange(JSON.parse(Ne.target.value))}catch{ie.onChange(Ne.target.value)}},rows:3,className:"font-mono"}),u.jsx(mt,{})]})}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(k3,{checked:M,onCheckedChange:I,id:"raw-edit-secret-toggle"}),u.jsx("label",{htmlFor:"raw-edit-secret-toggle",className:"text-sm",children:"Rotate secret with raw JSON (leave empty to keep existing)"})]}),M&&u.jsx(yt,{control:Ke.control,name:"secret",render:({field:ie})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Rotate Secret (JSON)"}),u.jsx(hu,{value:typeof ie.value=="string"?ie.value:Ql(ie.value??{}),onChange:Ne=>{try{ie.onChange(JSON.parse(Ne.target.value))}catch{ie.onChange(Ne.target.value)}},rows:6,className:"font-mono",placeholder:'{"access_key_id":"...","secret_access_key":"..."}'}),u.jsx(mt,{})]})}),u.jsxs(Sn,{className:"gap-2",children:[u.jsx(Fe,{type:"button",variant:"secondary",onClick:()=>{const ie=yT.safeParse(Ke.getValues());if(!ie.success){Ze.error("Fix validation errors before previewing");return}const Ne=_3(ie.data);Q(Ne),ee(!0)},children:"Preview request"}),u.jsx(Fe,{variant:"outline",type:"button",onClick:()=>p(!1),children:"Cancel"}),u.jsxs(Fe,{type:"submit",disabled:xe.isPending,children:[xe.isPending&&u.jsx(Ds,{className:"mr-2 h-4 w-4 animate-spin"}),"Save changes"]})]})]})})]})}),u.jsx(fn,{open:m,onOpenChange:g,children:u.jsxs(mn,{className:"sm:max-w-xl",children:[u.jsx(gn,{children:u.jsxs(yn,{className:"flex items-center gap-2",children:[u.jsx(kT,{className:"h-4 w-4"})," Decrypted Secret"]})}),u.jsx("div",{className:"bg-muted/40 rounded-lg border p-3",children:u.jsx("pre",{className:"max-h-[50vh] overflow-auto text-xs leading-relaxed",children:Ql(b??{})})}),u.jsxs("div",{className:"text-muted-foreground flex items-center gap-2 text-xs",children:[u.jsx(Tj,{className:"h-3.5 w-3.5"}),"One-time read. Close this dialog to hide the secret."]}),u.jsxs(Sn,{children:[u.jsx(Fe,{variant:"outline",onClick:()=>{navigator.clipboard.writeText(Ql(b??{})),Ze.success("Copied to clipboard")},children:"Copy"}),u.jsx(Fe,{onClick:()=>g(!1),children:"Close"})]})]})}),u.jsx(fn,{open:q,onOpenChange:G,children:u.jsxs(mn,{className:"sm:max-w-2xl",children:[u.jsx(gn,{children:u.jsx(yn,{children:"Preview: POST /api/v1/credentials"})}),u.jsx("div",{className:"bg-muted/40 rounded-lg border p-3",children:u.jsx("pre",{className:"max-h-[50vh] overflow-auto text-xs leading-relaxed",children:Ql(K??{})})}),u.jsxs(Sn,{children:[u.jsx(Fe,{variant:"outline",onClick:()=>{navigator.clipboard.writeText(Ql(K??{})),Ze.success("Copied body")},children:"Copy body"}),u.jsx(Fe,{onClick:()=>G(!1),children:"Close"})]})]})}),u.jsx(fn,{open:z,onOpenChange:ee,children:u.jsxs(mn,{className:"sm:max-w-2xl",children:[u.jsx(gn,{children:u.jsx(yn,{children:"Preview: PATCH /api/v1/credentials/:id"})}),u.jsx("div",{className:"bg-muted/40 rounded-lg border p-3",children:u.jsx("pre",{className:"max-h-[50vh] overflow-auto text-xs leading-relaxed",children:Ql(oe??{})})}),u.jsxs(Sn,{children:[u.jsx(Fe,{variant:"outline",onClick:()=>{navigator.clipboard.writeText(Ql(oe??{})),Ze.success("Copied body")},children:"Copy body"}),u.jsx(Fe,{onClick:()=>ee(!1),children:"Close"})]})]})}),u.jsx("pre",{children:JSON.stringify(de.data,null,2)})]})};function ha({className:e,...r}){return u.jsx("div",{"data-slot":"card",className:ht("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...r})}function sl({className:e,...r}){return u.jsx("div",{"data-slot":"card-header",className:ht("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...r})}function il({className:e,...r}){return u.jsx("div",{"data-slot":"card-title",className:ht("leading-none font-semibold",e),...r})}function j_({className:e,...r}){return u.jsx("div",{"data-slot":"card-description",className:ht("text-muted-foreground text-sm",e),...r})}function oo({className:e,...r}){return u.jsx("div",{"data-slot":"card-content",className:ht("px-6",e),...r})}const $be=e=>{switch(e){case"ready":return u.jsx(I_,{className:"h-4 w-4 text-emerald-600"});case"provisioning":return u.jsx(Ds,{className:"h-4 w-4 animate-spin text-blue-600"});case"failed":return u.jsx(Tj,{className:"h-4 w-4 text-red-600"});default:return u.jsx(TZ,{className:"text-muted-foreground h-4 w-4"})}},vT=({s:e})=>u.jsxs(rs,{variant:e==="failed"?"destructive":e==="ready"?"default":"secondary",className:"gap-1",title:e,children:[$be(e),u.jsx("span",{className:"capitalize",children:e??"pending"})]}),C_=e=>e.split(",").map(r=>r.trim()).filter(Boolean),Nbe=e=>e&&e.length?e.join(","):"",A_=["A","AAAA","CNAME","TXT","MX","NS","SRV","CAA"],Dbe=e=>e.provider==="aws"&&e.scope_kind==="service"&&(()=>{const r=e.scope;try{return(typeof r=="string"?JSON.parse(r):r||{})?.service==="route53"}catch{return!1}})(),$3=e=>[e.name||"Unnamed",e.account_id,e.region].filter(Boolean).join(" · "),iB=Xs({domain_name:zn().min(1,"Domain is required").max(253).transform(e=>e.trim().replace(/\.$/,"").toLowerCase()),credential_id:zn().uuid("Pick a credential"),zone_id:zn().optional().or(Wb("")).transform(e=>e?e.trim():void 0)}),Pbe=iB.partial(),Mbe=E6([Zb(),zn().regex(/^\d+$/).transform(e=>Number(e))]).optional().refine(e=>e===void 0||e>=1&&e<=86400,{message:"TTL must be between 1 and 86400"}),aB=Xs({name:zn().min(1,"Name required").max(253).transform(e=>e.trim().replace(/\.$/,"").toLowerCase()),type:Da(A_),ttl:Mbe,valuesCsv:zn().optional()}).superRefine((e,r)=>{const s=C_(e.valuesCsv??"");s.length===0&&r.addIssue({code:"custom",message:"At least one value is required"}),e.type==="CNAME"&&s.length!==1&&r.addIssue({code:"custom",message:"CNAME requires exactly one value"})}),Ibe=aB.partial(),zbe=()=>{const[e,r]=R.useState(""),[s,o]=R.useState(null),[d,p]=R.useState(!1),[m,g]=R.useState(!1),[b,S]=R.useState(!1),[E,A]=R.useState(!1),[k,T]=R.useState(null),M=Hs(),I=rr({queryKey:["dns","domains"],queryFn:()=>tc.listDomains()}),q=rr({queryKey:["dns","records",s?.id],queryFn:async()=>s?await tc.listRecordSetsByDomain(s.id):[],enabled:!!s?.id}),G=rr({queryKey:["credentials","r53"],queryFn:()=>Qm.listCredentials()}),K=R.useMemo(()=>(G.data??[]).filter(Dbe),[G.data]);R.useEffect(()=>{(()=>{!s&&I.data&&I.data.length&&o(I.data[0])})()},[I.data,s]);const X=R.useMemo(()=>{const re=I.data??[];if(!e.trim())return re;const ue=e.toLowerCase();return re.filter(_e=>[_e.domain_name,_e.zone_id,_e.status,_e.domain_name].filter(Boolean).map(fe=>String(fe).toLowerCase()).some(fe=>fe.includes(ue)))},[I.data,e]),z=mr({resolver:gr(iB),defaultValues:{domain_name:"",credential_id:"",zone_id:""}}),ee=nn({mutationFn:re=>tc.createDomain(re),onSuccess:async re=>{Ze.success("Domain created"),p(!1),z.reset(),await M.invalidateQueries({queryKey:["dns","domains"]}),o(re)},onError:re=>Ze.error("Failed to create domain",{description:re?.message??"Unknown error"})}),oe=mr({resolver:gr(Pbe)}),Q=re=>{o(re),oe.reset({domain_name:re.domain_name,credential_id:re.credential_id,zone_id:re.zone_id||""}),g(!0)},ne=nn({mutationFn:re=>{if(!s)throw new Error("No domain selected");return tc.updateDomain(s.id,re)},onSuccess:async()=>{Ze.success("Domain updated"),g(!1),await M.invalidateQueries({queryKey:["dns","domains"]}),await M.invalidateQueries({queryKey:["dns","records",s?.id]})},onError:re=>Ze.error("Failed to update domain",{description:re?.message??"Unknown error"})}),de=nn({mutationFn:re=>tc.deleteDomain(re),onSuccess:async()=>{Ze.success("Domain deleted"),await M.invalidateQueries({queryKey:["dns","domains"]}),o(null)},onError:re=>Ze.error("Failed to delete domain",{description:re?.message??"Unknown error"})}),Ce=mr({resolver:gr(aB),defaultValues:{name:"",type:"A",ttl:300,valuesCsv:""}}),xe=re=>{const ue=re?.response?.data?.error||re?.message||"Unknown error";return ue.includes("ownership_conflict")?"Ownership conflict: this (name,type) exists but isn’t owned by autoglue.":ue.includes("already_exists")?"A record with this (name,type) already exists. Use Edit instead.":ue},le=nn({mutationFn:async re=>{if(!s)throw new Error("No domain selected");const ue={name:re.name,type:re.type,...re.ttl?{ttl:re.ttl}:{},values:C_(re.valuesCsv??"")};return tc.createRecordSetsByDomain(s.id,ue)},onSuccess:async()=>{Ze.success("Record set created"),S(!1),Ce.reset(),await M.invalidateQueries({queryKey:["dns","records",s?.id]})},onError:re=>Ze.error("Failed to create record set",{description:xe(re)})}),be=mr({resolver:gr(Ibe)}),je=re=>{T(re);const ue=re.values||[];be.reset({name:re.name,type:re.type,ttl:re.ttl?Number(re.ttl):void 0,valuesCsv:Nbe(ue)}),A(!0)},Ke=nn({mutationFn:async re=>{if(!k)throw new Error("No record selected");const ue={};return re.name!==void 0&&(ue.name=re.name),re.type!==void 0&&(ue.type=re.type),re.ttl!==void 0&&re.ttl!==null&&(ue.ttl=re.ttl),re.valuesCsv!==void 0&&(ue.values=C_(re.valuesCsv)),tc.updateRecordSetsByDomain(k.id,ue)},onSuccess:async()=>{Ze.success("Record set updated"),A(!1),T(null),await M.invalidateQueries({queryKey:["dns","records",s?.id]})},onError:re=>Ze.error("Failed to update record set",{description:xe(re)})}),ce=nn({mutationFn:re=>tc.deleteRecordSetsByDomain(re),onSuccess:async()=>{Ze.success("Record set deleted"),await M.invalidateQueries({queryKey:["dns","records",s?.id]})},onError:re=>Ze.error("Failed to delete record set",{description:re?.message??"Unknown error"})});return u.jsxs("div",{className:"space-y-5 p-6",children:[u.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[u.jsx("h1",{className:"text-2xl font-bold",children:"DNS"}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("div",{className:"relative",children:[u.jsx(Pa,{className:"absolute top-2.5 left-2 h-4 w-4 opacity-60"}),u.jsx(xt,{value:e,onChange:re=>r(re.target.value),placeholder:"Search domains…",className:"w-64 pl-8"})]}),u.jsxs(fn,{open:d,onOpenChange:p,children:[u.jsx(Li,{asChild:!0,children:u.jsxs(Fe,{onClick:()=>p(!0),children:[u.jsx(lo,{className:"mr-2 h-4 w-4"}),"Add Domain"]})}),u.jsxs(mn,{className:"sm:max-w-lg",children:[u.jsx(gn,{children:u.jsx(yn,{children:"Add Domain"})}),u.jsx(yr,{...z,children:u.jsxs("form",{className:"space-y-4 pt-2",onSubmit:z.handleSubmit(re=>ee.mutate(re)),children:[u.jsx(yt,{control:z.control,name:"domain_name",render:({field:re})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Domain"}),u.jsx(wt,{children:u.jsx(xt,{...re,placeholder:"example.com"})}),u.jsx(mt,{})]})}),u.jsx(yt,{control:z.control,name:"credential_id",render:({field:re})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Route53 Credential"}),u.jsxs(Rn,{onValueChange:re.onChange,value:re.value,disabled:G.isLoading||(K?.length??0)===0,children:[u.jsx(wt,{children:u.jsx(_n,{children:u.jsx(Tn,{placeholder:G.isLoading?"Loading…":(K?.length??0)===0?"No Route53 credentials found":"Select credential"})})}),u.jsx($n,{children:(K??[]).map(ue=>u.jsx(jt,{value:ue.id,children:$3(ue)},ue.id))})]}),G.error&&u.jsx("p",{className:"text-destructive text-xs",children:"Failed to load credentials."}),u.jsx(mt,{})]})}),u.jsx(yt,{control:z.control,name:"zone_id",render:({field:re})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Zone ID (optional)"}),u.jsx(wt,{children:u.jsx(xt,{...re,placeholder:"/hostedzone/Z123…"})}),u.jsx(mt,{})]})}),u.jsxs(Sn,{className:"gap-2",children:[u.jsx(Fe,{type:"button",variant:"outline",onClick:()=>p(!1),children:"Cancel"}),u.jsxs(Fe,{type:"submit",disabled:ee.isPending,children:[ee.isPending&&u.jsx(Ds,{className:"mr-2 h-4 w-4 animate-spin"}),"Create"]})]})]})})]})]})]})]}),u.jsx("div",{children:u.jsxs(ha,{className:"p-3 md:col-span-5",children:[u.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[u.jsx("div",{className:"text-sm font-semibold",children:"Domains"}),I.isFetching&&u.jsx(Ds,{className:"h-4 w-4 animate-spin"})]}),u.jsx("div",{className:"max-h-[60vh] overflow-auto rounded-md border",children:u.jsxs("table",{className:"min-w-full text-sm",children:[u.jsx("thead",{className:"bg-muted/40 text-xs tracking-wide uppercase",children:u.jsxs("tr",{children:[u.jsx("th",{className:"px-3 py-2 text-left",children:"Domain"}),u.jsx("th",{className:"px-3 py-2 text-left",children:"Zone"}),u.jsx("th",{className:"px-3 py-2 text-left",children:"Status"}),u.jsx("th",{className:"px-3 py-2 text-right",children:"Actions"})]})}),u.jsxs("tbody",{children:[(X??[]).map(re=>u.jsxs("tr",{className:`hover:bg-muted/30 border-t ${s?.id===re.id?"bg-muted/40":""}`,onClick:()=>o(re),children:[u.jsx("td",{className:"cursor-pointer px-3 py-2 font-medium",children:re.domain_name}),u.jsx("td",{className:"px-3 py-2",children:re.zone_id||"—"}),u.jsx("td",{className:"px-3 py-2",children:u.jsx(vT,{s:re.status})}),u.jsx("td",{className:"px-3 py-2",children:u.jsxs("div",{className:"flex items-center justify-end gap-2",children:[u.jsx(Fe,{size:"icon",variant:"ghost",onClick:()=>Q(re),children:u.jsx(pu,{className:"h-4 w-4"})}),u.jsxs(rC,{children:[u.jsx(sC,{asChild:!0,children:u.jsx(Fe,{size:"icon",variant:"ghost",onClick:ue=>ue.stopPropagation(),children:u.jsx(zb,{className:"h-4 w-4"})})}),u.jsxs(iC,{children:[u.jsxs(aC,{children:[u.jsxs(lC,{children:["Delete “",re.domain_name,"”?"]}),u.jsx(cC,{children:"This deletes the domain metadata. External DNS records are not touched."})]}),u.jsxs(oC,{children:[u.jsx(dC,{children:"Cancel"}),u.jsx(uC,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>de.mutate(re.id),children:"Delete"})]})]})]})]})})]},re.id)),(!X||X.length===0)&&u.jsx("tr",{children:u.jsx("td",{colSpan:4,className:"text-muted-foreground px-3 py-8 text-center",children:"No domains yet."})})]})]})})]})}),u.jsx("div",{children:u.jsxs(ha,{className:"p-3 md:col-span-7",children:[u.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[u.jsxs("div",{className:"text-sm font-semibold",children:["Records ",s?`— ${s.domain_name}`:""]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(vT,{s:s?.status}),u.jsxs(fn,{open:b,onOpenChange:S,children:[u.jsx(Li,{asChild:!0,children:u.jsxs(Fe,{disabled:!s,children:[u.jsx(lo,{className:"mr-2 h-4 w-4"}),"Add Record"]})}),u.jsxs(mn,{className:"sm:max-w-xl",children:[u.jsx(gn,{children:u.jsx(yn,{children:"Add Record"})}),u.jsx(yr,{...Ce,children:u.jsxs("form",{className:"space-y-4 pt-2",onSubmit:Ce.handleSubmit(re=>le.mutate(re)),children:[u.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[u.jsx(yt,{control:Ce.control,name:"name",render:({field:re})=>u.jsxs(lt,{className:"md:col-span-1",children:[u.jsx(ct,{children:"Name"}),u.jsx(wt,{children:u.jsx(xt,{...re,placeholder:"endpoint (or @)"})}),u.jsx(mt,{})]})}),u.jsx(yt,{control:Ce.control,name:"type",render:({field:re})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Type"}),u.jsxs(Rn,{onValueChange:re.onChange,defaultValue:re.value,children:[u.jsx(wt,{children:u.jsx(_n,{children:u.jsx(Tn,{})})}),u.jsx($n,{children:A_.map(ue=>u.jsx(jt,{value:ue,children:ue},ue))})]}),u.jsx(mt,{})]})}),u.jsx(yt,{control:Ce.control,name:"ttl",render:({field:re})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"TTL (sec, optional)"}),u.jsx(wt,{children:u.jsx(xt,{type:"number",value:re.value,onChange:ue=>re.onChange(ue.target.value===""?void 0:Number(ue.target.value)),placeholder:"300"})}),u.jsx(mt,{})]})})]}),u.jsx(yt,{control:Ce.control,name:"valuesCsv",render:({field:re})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Values (comma-separated)"}),u.jsx(wt,{children:u.jsx(hu,{...re,rows:3,placeholder:'e.g. 10.0.30.1, 10.0.30.2 or "v=spf1 ~all"',className:"font-mono"})}),u.jsx(mt,{})]})}),u.jsxs(Sn,{className:"gap-2",children:[u.jsx(Fe,{variant:"outline",type:"button",onClick:()=>S(!1),children:"Cancel"}),u.jsxs(Fe,{type:"submit",disabled:le.isPending,children:[le.isPending&&u.jsx(Ds,{className:"mr-2 h-4 w-4 animate-spin"}),"Create"]})]})]})})]})]})]})]}),u.jsxs("div",{className:"overflow-x-auto rounded-md border",children:[q.isLoading&&u.jsxs("div",{className:"flex items-center gap-2 p-4",children:[u.jsx(Ds,{className:"h-4 w-4 animate-spin"})," Loading records…"]}),!q.isLoading&&u.jsxs("table",{className:"min-w-full text-sm",children:[u.jsx("thead",{className:"bg-muted/40 text-xs tracking-wide uppercase",children:u.jsxs("tr",{children:[u.jsx("th",{className:"px-3 py-2 text-left",children:"Name"}),u.jsx("th",{className:"px-3 py-2 text-left",children:"Type"}),u.jsx("th",{className:"px-3 py-2 text-left",children:"TTL"}),u.jsx("th",{className:"px-3 py-2 text-left",children:"Values"}),u.jsx("th",{className:"px-3 py-2 text-left",children:"Status"}),u.jsx("th",{className:"px-3 py-2 text-left",children:"Owner"}),u.jsx("th",{className:"px-3 py-2 text-right",children:"Actions"})]})}),u.jsxs("tbody",{children:[(q.data??[]).map(re=>{const ue=re.values||[];return u.jsxs("tr",{className:"border-t",children:[u.jsx("td",{className:"px-3 py-2 font-medium",children:re.name||"@"}),u.jsx("td",{className:"px-3 py-2",children:re.type}),u.jsx("td",{className:"px-3 py-2",children:re.ttl??"—"}),u.jsx("td",{className:"px-3 py-2",children:u.jsx("div",{className:"max-w-[420px] truncate",title:(ue||[]).join(", "),children:(ue||[]).join(", ")})}),u.jsx("td",{className:"px-3 py-2",children:u.jsx(vT,{s:re.status})}),u.jsx("td",{className:"px-3 py-2",children:re.owner}),u.jsx("td",{className:"px-3 py-2",children:u.jsxs("div",{className:"flex items-center justify-end gap-2",children:[u.jsx(Fe,{size:"icon",variant:"ghost",onClick:()=>je(re),children:u.jsx(pu,{className:"h-4 w-4"})}),u.jsxs(rC,{children:[u.jsx(sC,{asChild:!0,children:u.jsx(Fe,{size:"icon",variant:"ghost",children:u.jsx(zb,{className:"h-4 w-4"})})}),u.jsxs(iC,{children:[u.jsxs(aC,{children:[u.jsxs(lC,{children:["Delete “",re.name||"@"," ",re.type,"”?"]}),u.jsx(cC,{children:"This removes the record set from your project. Your worker does not delete it from the DNS provider right now."})]}),u.jsxs(oC,{children:[u.jsx(dC,{children:"Cancel"}),u.jsx(uC,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>ce.mutate(re.id),children:"Delete"})]})]})]}),u.jsxs(f$,{children:[u.jsx(m$,{asChild:!0,children:u.jsx(Fe,{variant:"ghost",size:"icon",children:u.jsx(z_,{className:"h-4 w-4"})})}),u.jsxs(g$,{align:"end",children:[u.jsx(jp,{onClick:()=>je(re),children:"Edit"}),u.jsx(jp,{className:"text-destructive",onClick:()=>ce.mutate(re.id),children:"Delete"})]})]})]})})]},re.id)}),(!q.data||q.data.length===0)&&u.jsx("tr",{children:u.jsx("td",{colSpan:7,className:"text-muted-foreground px-3 py-8 text-center",children:s?"No records yet — add one.":"Select a domain to view records."})})]})]})]})]})}),u.jsx(fn,{open:m,onOpenChange:g,children:u.jsxs(mn,{className:"sm:max-w-lg",children:[u.jsx(gn,{children:u.jsx(yn,{children:"Edit Domain"})}),u.jsx(yr,{...oe,children:u.jsxs("form",{className:"space-y-4 pt-2",onSubmit:oe.handleSubmit(re=>ne.mutate(re)),children:[u.jsx(yt,{control:oe.control,name:"domain_name",render:({field:re})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Domain"}),u.jsx(wt,{children:u.jsx(xt,{...re,placeholder:"example.com"})}),u.jsx(mt,{})]})}),u.jsx(yt,{control:oe.control,name:"credential_id",render:({field:re})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Route53 Credential"}),u.jsxs(Rn,{onValueChange:re.onChange,value:re.value??"",disabled:G.isLoading||(K?.length??0)===0,children:[u.jsx(wt,{children:u.jsx(_n,{children:u.jsx(Tn,{placeholder:G.isLoading?"Loading…":(K?.length??0)===0?"No Route53 credentials found":"Select credential"})})}),u.jsx($n,{children:(K??[]).map(ue=>u.jsx(jt,{value:ue.id,children:$3(ue)},ue.id))})]}),G.error&&u.jsx("p",{className:"text-destructive text-xs",children:"Failed to load credentials."}),u.jsx(mt,{})]})}),u.jsx(yt,{control:oe.control,name:"zone_id",render:({field:re})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Zone ID"}),u.jsx(wt,{children:u.jsx(xt,{...re,placeholder:"/hostedzone/Z123…"})}),u.jsx(mt,{})]})}),u.jsxs(Sn,{className:"gap-2",children:[u.jsx(Fe,{variant:"outline",type:"button",onClick:()=>g(!1),children:"Cancel"}),u.jsxs(Fe,{type:"submit",disabled:ne.isPending,children:[ne.isPending&&u.jsx(Ds,{className:"mr-2 h-4 w-4 animate-spin"}),"Save Changes"]})]})]})})]})}),u.jsx(fn,{open:E,onOpenChange:A,children:u.jsxs(mn,{className:"sm:max-w-xl",children:[u.jsx(gn,{children:u.jsx(yn,{children:"Edit Record"})}),u.jsx(yr,{...be,children:u.jsxs("form",{className:"space-y-4 pt-2",onSubmit:be.handleSubmit(re=>Ke.mutate(re)),children:[u.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[u.jsx(yt,{control:be.control,name:"name",render:({field:re})=>u.jsxs(lt,{className:"md:col-span-1",children:[u.jsx(ct,{children:"Name"}),u.jsx(wt,{children:u.jsx(xt,{...re})}),u.jsx(mt,{})]})}),u.jsx(yt,{control:be.control,name:"type",render:({field:re})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Type"}),u.jsxs(Rn,{onValueChange:re.onChange,defaultValue:re.value,children:[u.jsx(wt,{children:u.jsx(_n,{children:u.jsx(Tn,{})})}),u.jsx($n,{children:A_.map(ue=>u.jsx(jt,{value:ue,children:ue},ue))})]}),u.jsx(mt,{})]})}),u.jsx(yt,{control:be.control,name:"ttl",render:({field:re})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"TTL (sec, optional)"}),u.jsx(wt,{children:u.jsx(xt,{type:"number",value:re.value,onChange:ue=>re.onChange(ue.target.value===""?void 0:Number(ue.target.value)),placeholder:"300"})}),u.jsx(mt,{})]})})]}),u.jsx(yt,{control:be.control,name:"valuesCsv",render:({field:re})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Values (comma-separated)"}),u.jsx(wt,{children:u.jsx(hu,{...re,rows:3,className:"font-mono"})}),u.jsx(mt,{})]})}),u.jsxs(Sn,{className:"gap-2",children:[u.jsx(Fe,{variant:"outline",type:"button",onClick:()=>A(!1),children:"Cancel"}),u.jsxs(Fe,{type:"submit",disabled:Ke.isPending,children:[Ke.isPending&&u.jsx(Ds,{className:"mr-2 h-4 w-4 animate-spin"}),"Save Changes"]})]})]})})]})})]})};var N3={};var D3;function Lbe(){return D3||(D3=1,(()=>{var e,r,s={557:(p,m,g)=>{const b=globalThis,S=b.ShadowRoot&&(b.ShadyCSS===void 0||b.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,E=Symbol(),A=new WeakMap;class k{constructor(n,i,l){if(this._$cssResult$=!0,l!==E)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=n,this.t=i}get styleSheet(){let n=this.o;const i=this.t;if(S&&n===void 0){const l=i!==void 0&&i.length===1;l&&(n=A.get(i)),n===void 0&&((this.o=n=new CSSStyleSheet).replaceSync(this.cssText),l&&A.set(i,n))}return n}toString(){return this.cssText}}const T=t=>new k(typeof t=="string"?t:t+"",void 0,E),M=(t,...n)=>{const i=t.length===1?t[0]:n.reduce(((l,h,v)=>l+(x=>{if(x._$cssResult$===!0)return x.cssText;if(typeof x=="number")return x;throw Error("Value passed to 'css' function must be a 'css' function result: "+x+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(h)+t[v+1]),t[0]);return new k(i,t,E)},I=(t,n)=>{if(S)t.adoptedStyleSheets=n.map((i=>i instanceof CSSStyleSheet?i:i.styleSheet));else for(const i of n){const l=document.createElement("style"),h=b.litNonce;h!==void 0&&l.setAttribute("nonce",h),l.textContent=i.cssText,t.appendChild(l)}},q=S?t=>t:t=>t instanceof CSSStyleSheet?(n=>{let i="";for(const l of n.cssRules)i+=l.cssText;return T(i)})(t):t,{is:G,defineProperty:K,getOwnPropertyDescriptor:X,getOwnPropertyNames:z,getOwnPropertySymbols:ee,getPrototypeOf:oe}=Object,Q=globalThis,ne=Q.trustedTypes,de=ne?ne.emptyScript:"",Ce=Q.reactiveElementPolyfillSupport,xe=(t,n)=>t,le={toAttribute(t,n){switch(n){case Boolean:t=t?de:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,n){let i=t;switch(n){case Boolean:i=t!==null;break;case Number:i=t===null?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch{i=null}}return i}},be=(t,n)=>!G(t,n),je={attribute:!0,type:String,converter:le,reflect:!1,hasChanged:be};Symbol.metadata??=Symbol("metadata"),Q.litPropertyMetadata??=new WeakMap;class Ke extends HTMLElement{static addInitializer(n){this._$Ei(),(this.l??=[]).push(n)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(n,i=je){if(i.state&&(i.attribute=!1),this._$Ei(),this.elementProperties.set(n,i),!i.noAccessor){const l=Symbol(),h=this.getPropertyDescriptor(n,l,i);h!==void 0&&K(this.prototype,n,h)}}static getPropertyDescriptor(n,i,l){const{get:h,set:v}=X(this.prototype,n)??{get(){return this[i]},set(x){this[i]=x}};return{get(){return h?.call(this)},set(x){const w=h?.call(this);v.call(this,x),this.requestUpdate(n,w,l)},configurable:!0,enumerable:!0}}static getPropertyOptions(n){return this.elementProperties.get(n)??je}static _$Ei(){if(this.hasOwnProperty(xe("elementProperties")))return;const n=oe(this);n.finalize(),n.l!==void 0&&(this.l=[...n.l]),this.elementProperties=new Map(n.elementProperties)}static finalize(){if(this.hasOwnProperty(xe("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(xe("properties"))){const i=this.properties,l=[...z(i),...ee(i)];for(const h of l)this.createProperty(h,i[h])}const n=this[Symbol.metadata];if(n!==null){const i=litPropertyMetadata.get(n);if(i!==void 0)for(const[l,h]of i)this.elementProperties.set(l,h)}this._$Eh=new Map;for(const[i,l]of this.elementProperties){const h=this._$Eu(i,l);h!==void 0&&this._$Eh.set(h,i)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(n){const i=[];if(Array.isArray(n)){const l=new Set(n.flat(1/0).reverse());for(const h of l)i.unshift(q(h))}else n!==void 0&&i.push(q(n));return i}static _$Eu(n,i){const l=i.attribute;return l===!1?void 0:typeof l=="string"?l:typeof n=="string"?n.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((n=>this.enableUpdating=n)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((n=>n(this)))}addController(n){(this._$EO??=new Set).add(n),this.renderRoot!==void 0&&this.isConnected&&n.hostConnected?.()}removeController(n){this._$EO?.delete(n)}_$E_(){const n=new Map,i=this.constructor.elementProperties;for(const l of i.keys())this.hasOwnProperty(l)&&(n.set(l,this[l]),delete this[l]);n.size>0&&(this._$Ep=n)}createRenderRoot(){const n=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return I(n,this.constructor.elementStyles),n}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((n=>n.hostConnected?.()))}enableUpdating(n){}disconnectedCallback(){this._$EO?.forEach((n=>n.hostDisconnected?.()))}attributeChangedCallback(n,i,l){this._$AK(n,l)}_$EC(n,i){const l=this.constructor.elementProperties.get(n),h=this.constructor._$Eu(n,l);if(h!==void 0&&l.reflect===!0){const v=(l.converter?.toAttribute!==void 0?l.converter:le).toAttribute(i,l.type);this._$Em=n,v==null?this.removeAttribute(h):this.setAttribute(h,v),this._$Em=null}}_$AK(n,i){const l=this.constructor,h=l._$Eh.get(n);if(h!==void 0&&this._$Em!==h){const v=l.getPropertyOptions(h),x=typeof v.converter=="function"?{fromAttribute:v.converter}:v.converter?.fromAttribute!==void 0?v.converter:le;this._$Em=h,this[h]=x.fromAttribute(i,v.type),this._$Em=null}}requestUpdate(n,i,l){if(n!==void 0){if(l??=this.constructor.getPropertyOptions(n),!(l.hasChanged??be)(this[n],i))return;this.P(n,i,l)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(n,i,l){this._$AL.has(n)||this._$AL.set(n,i),l.reflect===!0&&this._$Em!==n&&(this._$Ej??=new Set).add(n)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(i){Promise.reject(i)}const n=this.scheduleUpdate();return n!=null&&await n,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[h,v]of this._$Ep)this[h]=v;this._$Ep=void 0}const l=this.constructor.elementProperties;if(l.size>0)for(const[h,v]of l)v.wrapped!==!0||this._$AL.has(h)||this[h]===void 0||this.P(h,this[h],v)}let n=!1;const i=this._$AL;try{n=this.shouldUpdate(i),n?(this.willUpdate(i),this._$EO?.forEach((l=>l.hostUpdate?.())),this.update(i)):this._$EU()}catch(l){throw n=!1,this._$EU(),l}n&&this._$AE(i)}willUpdate(n){}_$AE(n){this._$EO?.forEach((i=>i.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(n)),this.updated(n)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(n){return!0}update(n){this._$Ej&&=this._$Ej.forEach((i=>this._$EC(i,this[i]))),this._$EU()}updated(n){}firstUpdated(n){}}Ke.elementStyles=[],Ke.shadowRootOptions={mode:"open"},Ke[xe("elementProperties")]=new Map,Ke[xe("finalized")]=new Map,Ce?.({ReactiveElement:Ke}),(Q.reactiveElementVersions??=[]).push("2.0.4");const ce=globalThis,re=ce.trustedTypes,ue=re?re.createPolicy("lit-html",{createHTML:t=>t}):void 0,_e="$lit$",fe=`lit$${Math.random().toFixed(9).slice(2)}$`,He="?"+fe,Oe=`<${He}>`,ke=document,Ve=()=>ke.createComment(""),ie=t=>t===null||typeof t!="object"&&typeof t!="function",Ne=Array.isArray,ze=t=>Ne(t)||typeof t?.[Symbol.iterator]=="function",tt=`[ +For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return R.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(r)},[r,e]),null},_ve=aq,$ve=oq,Nve=lq,Dve=cq,Pve=uq,Mve=mq,Ive=yq,Lve=hq,zve=fq;function rC({...e}){return u.jsx(_ve,{"data-slot":"alert-dialog",...e})}function sC({...e}){return u.jsx($ve,{"data-slot":"alert-dialog-trigger",...e})}function Fve({...e}){return u.jsx(Nve,{"data-slot":"alert-dialog-portal",...e})}function qve({className:e,...r}){return u.jsx(Dve,{"data-slot":"alert-dialog-overlay",className:ht("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...r})}function iC({className:e,...r}){return u.jsxs(Fve,{children:[u.jsx(qve,{}),u.jsx(Pve,{"data-slot":"alert-dialog-content",className:ht("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...r})]})}function aC({className:e,...r}){return u.jsx("div",{"data-slot":"alert-dialog-header",className:ht("flex flex-col gap-2 text-center sm:text-left",e),...r})}function oC({className:e,...r}){return u.jsx("div",{"data-slot":"alert-dialog-footer",className:ht("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r})}function lC({className:e,...r}){return u.jsx(Lve,{"data-slot":"alert-dialog-title",className:ht("text-lg font-semibold",e),...r})}function cC({className:e,...r}){return u.jsx(zve,{"data-slot":"alert-dialog-description",className:ht("text-muted-foreground text-sm",e),...r})}function uC({className:e,...r}){return u.jsx(Mve,{className:ht(V_(),e),...r})}function dC({className:e,...r}){return u.jsx(Ive,{className:ht(V_({variant:"outline"}),e),...r})}var gT="rovingFocusGroup.onEntryFocus",Bve={bubbles:!1,cancelable:!0},gw="RovingFocusGroup",[E_,vq,Uve]=i$(gw),[Kve,xq]=al(gw,[Uve]),[Vve,Hve]=Kve(gw),bq=R.forwardRef((e,r)=>u.jsx(E_.Provider,{scope:e.__scopeRovingFocusGroup,children:u.jsx(E_.Slot,{scope:e.__scopeRovingFocusGroup,children:u.jsx(Gve,{...e,ref:r})})}));bq.displayName=gw;var Gve=R.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:s,orientation:o,loop:d=!1,dir:p,currentTabStopId:m,defaultCurrentTabStopId:g,onCurrentTabStopIdChange:b,onEntryFocus:S,preventScrollOnEntryFocus:j=!1,...A}=e,k=R.useRef(null),T=zn(r,k),M=a$(p),[I,q]=qd({prop:m,defaultProp:g??null,onChange:b,caller:gw}),[G,K]=R.useState(!1),X=tl(S),L=vq(s),ee=R.useRef(!1),[oe,Q]=R.useState(0);return R.useEffect(()=>{const ne=k.current;if(ne)return ne.addEventListener(gT,X),()=>ne.removeEventListener(gT,X)},[X]),u.jsx(Vve,{scope:s,orientation:o,dir:M,loop:d,currentTabStopId:I,onItemFocus:R.useCallback(ne=>q(ne),[q]),onItemShiftTab:R.useCallback(()=>K(!0),[]),onFocusableItemAdd:R.useCallback(()=>Q(ne=>ne+1),[]),onFocusableItemRemove:R.useCallback(()=>Q(ne=>ne-1),[]),children:u.jsx(Cn.div,{tabIndex:G||oe===0?-1:0,"data-orientation":o,...A,ref:T,style:{outline:"none",...e.style},onMouseDown:$t(e.onMouseDown,()=>{ee.current=!0}),onFocus:$t(e.onFocus,ne=>{const de=!ee.current;if(ne.target===ne.currentTarget&&de&&!G){const je=new CustomEvent(gT,Bve);if(ne.currentTarget.dispatchEvent(je),!je.defaultPrevented){const ve=L().filter(ce=>ce.focusable),le=ve.find(ce=>ce.active),be=ve.find(ce=>ce.id===I),Ke=[le,be,...ve].filter(Boolean).map(ce=>ce.ref.current);Eq(Ke,j)}}ee.current=!1}),onBlur:$t(e.onBlur,()=>K(!1))})})}),wq="RovingFocusGroupItem",Sq=R.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:s,focusable:o=!0,active:d=!1,tabStopId:p,children:m,...g}=e,b=Vs(),S=p||b,j=Hve(wq,s),A=j.currentTabStopId===S,k=vq(s),{onFocusableItemAdd:T,onFocusableItemRemove:M,currentTabStopId:I}=j;return R.useEffect(()=>{if(o)return T(),()=>M()},[o,T,M]),u.jsx(E_.ItemSlot,{scope:s,id:S,focusable:o,active:d,children:u.jsx(Cn.span,{tabIndex:A?0:-1,"data-orientation":j.orientation,...g,ref:r,onMouseDown:$t(e.onMouseDown,q=>{o?j.onItemFocus(S):q.preventDefault()}),onFocus:$t(e.onFocus,()=>j.onItemFocus(S)),onKeyDown:$t(e.onKeyDown,q=>{if(q.key==="Tab"&&q.shiftKey){j.onItemShiftTab();return}if(q.target!==q.currentTarget)return;const G=Zve(q,j.orientation,j.dir);if(G!==void 0){if(q.metaKey||q.ctrlKey||q.altKey||q.shiftKey)return;q.preventDefault();let X=k().filter(L=>L.focusable).map(L=>L.ref.current);if(G==="last")X.reverse();else if(G==="prev"||G==="next"){G==="prev"&&X.reverse();const L=X.indexOf(q.currentTarget);X=j.loop?Wve(X,L+1):X.slice(L+1)}setTimeout(()=>Eq(X))}}),children:typeof m=="function"?m({isCurrentTabStop:A,hasTabStop:I!=null}):m})})});Sq.displayName=wq;var Xve={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Yve(e,r){return r!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Zve(e,r,s){const o=Yve(e.key,s);if(!(r==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(r==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return Xve[o]}function Eq(e,r=!1){const s=document.activeElement;for(const o of e)if(o===s||(o.focus({preventScroll:r}),document.activeElement!==s))return}function Wve(e,r){return e.map((s,o)=>e[(r+o)%e.length])}var Jve=bq,Qve=Sq;function exe(e){const r=txe(e),s=R.forwardRef((o,d)=>{const{children:p,...m}=o,g=R.Children.toArray(p),b=g.find(rxe);if(b){const S=b.props.children,j=g.map(A=>A===b?R.Children.count(S)>1?R.Children.only(null):R.isValidElement(S)?S.props.children:null:A);return u.jsx(r,{...m,ref:d,children:R.isValidElement(S)?R.cloneElement(S,void 0,j):null})}return u.jsx(r,{...m,ref:d,children:p})});return s.displayName=`${e}.Slot`,s}function txe(e){const r=R.forwardRef((s,o)=>{const{children:d,...p}=s;if(R.isValidElement(d)){const m=ixe(d),g=sxe(p,d.props);return d.type!==R.Fragment&&(g.ref=o?Li(o,m):m),R.cloneElement(d,g)}return R.Children.count(d)>1?R.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var nxe=Symbol("radix.slottable");function rxe(e){return R.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===nxe}function sxe(e,r){const s={...r};for(const o in r){const d=e[o],p=r[o];/^on[A-Z]/.test(o)?d&&p?s[o]=(...g)=>{const b=p(...g);return d(...g),b}:d&&(s[o]=d):o==="style"?s[o]={...d,...p}:o==="className"&&(s[o]=[d,p].filter(Boolean).join(" "))}return{...e,...s}}function ixe(e){let r=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning;return s?e.ref:(r=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=r&&"isReactWarning"in r&&r.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var j_=["Enter"," "],axe=["ArrowDown","PageUp","Home"],jq=["ArrowUp","PageDown","End"],oxe=[...axe,...jq],lxe={ltr:[...j_,"ArrowRight"],rtl:[...j_,"ArrowLeft"]},cxe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},yw="Menu",[Wb,uxe,dxe]=i$(yw),[Mp,Cq]=al(yw,[dxe,Hd,xq]),WC=Hd(),Aq=xq(),[hxe,Ip]=Mp(yw),[pxe,vw]=Mp(yw),Oq=e=>{const{__scopeMenu:r,open:s=!1,children:o,dir:d,onOpenChange:p,modal:m=!0}=e,g=WC(r),[b,S]=R.useState(null),j=R.useRef(!1),A=tl(p),k=a$(d);return R.useEffect(()=>{const T=()=>{j.current=!0,document.addEventListener("pointerdown",M,{capture:!0,once:!0}),document.addEventListener("pointermove",M,{capture:!0,once:!0})},M=()=>j.current=!1;return document.addEventListener("keydown",T,{capture:!0}),()=>{document.removeEventListener("keydown",T,{capture:!0}),document.removeEventListener("pointerdown",M,{capture:!0}),document.removeEventListener("pointermove",M,{capture:!0})}},[]),u.jsx(SC,{...g,children:u.jsx(hxe,{scope:r,open:s,onOpenChange:A,content:b,onContentChange:S,children:u.jsx(pxe,{scope:r,onClose:R.useCallback(()=>A(!1),[A]),isUsingKeyboardRef:j,dir:k,modal:m,children:o})})})};Oq.displayName=yw;var fxe="MenuAnchor",l$=R.forwardRef((e,r)=>{const{__scopeMenu:s,...o}=e,d=WC(s);return u.jsx(nw,{...d,...o,ref:r})});l$.displayName=fxe;var c$="MenuPortal",[mxe,kq]=Mp(c$,{forceMount:void 0}),Rq=e=>{const{__scopeMenu:r,forceMount:s,children:o,container:d}=e,p=Ip(c$,r);return u.jsx(mxe,{scope:r,forceMount:s,children:u.jsx(lo,{present:s||p.open,children:u.jsx(_g,{asChild:!0,container:d,children:o})})})};Rq.displayName=c$;var io="MenuContent",[gxe,u$]=Mp(io),Tq=R.forwardRef((e,r)=>{const s=kq(io,e.__scopeMenu),{forceMount:o=s.forceMount,...d}=e,p=Ip(io,e.__scopeMenu),m=vw(io,e.__scopeMenu);return u.jsx(Wb.Provider,{scope:e.__scopeMenu,children:u.jsx(lo,{present:o||p.open,children:u.jsx(Wb.Slot,{scope:e.__scopeMenu,children:m.modal?u.jsx(yxe,{...d,ref:r}):u.jsx(vxe,{...d,ref:r})})})})}),yxe=R.forwardRef((e,r)=>{const s=Ip(io,e.__scopeMenu),o=R.useRef(null),d=zn(r,o);return R.useEffect(()=>{const p=o.current;if(p)return RC(p)},[]),u.jsx(d$,{...e,ref:d,trapFocus:s.open,disableOutsidePointerEvents:s.open,disableOutsideScroll:!0,onFocusOutside:$t(e.onFocusOutside,p=>p.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>s.onOpenChange(!1)})}),vxe=R.forwardRef((e,r)=>{const s=Ip(io,e.__scopeMenu);return u.jsx(d$,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>s.onOpenChange(!1)})}),xxe=exe("MenuContent.ScrollLock"),d$=R.forwardRef((e,r)=>{const{__scopeMenu:s,loop:o=!1,trapFocus:d,onOpenAutoFocus:p,onCloseAutoFocus:m,disableOutsidePointerEvents:g,onEntryFocus:b,onEscapeKeyDown:S,onPointerDownOutside:j,onFocusOutside:A,onInteractOutside:k,onDismiss:T,disableOutsideScroll:M,...I}=e,q=Ip(io,s),G=vw(io,s),K=WC(s),X=Aq(s),L=uxe(s),[ee,oe]=R.useState(null),Q=R.useRef(null),ne=zn(r,Q,q.onContentChange),de=R.useRef(0),je=R.useRef(""),ve=R.useRef(0),le=R.useRef(null),be=R.useRef("right"),Ce=R.useRef(0),Ke=M?ow:R.Fragment,ce=M?{as:xxe,allowPinchZoom:!0}:void 0,re=_e=>{const fe=je.current+_e,He=L().filter(Le=>!Le.disabled),Oe=document.activeElement,ke=He.find(Le=>Le.ref.current===Oe)?.textValue,Ve=He.map(Le=>Le.textValue),ie=_xe(Ve,fe,ke),De=He.find(Le=>Le.textValue===ie)?.ref.current;(function Le(tt){je.current=tt,window.clearTimeout(de.current),tt!==""&&(de.current=window.setTimeout(()=>Le(""),1e3))})(fe),De&&setTimeout(()=>De.focus())};R.useEffect(()=>()=>window.clearTimeout(de.current),[]),OC();const ue=R.useCallback(_e=>be.current===le.current?.side&&Nxe(_e,le.current?.area),[]);return u.jsx(gxe,{scope:s,searchRef:je,onItemEnter:R.useCallback(_e=>{ue(_e)&&_e.preventDefault()},[ue]),onItemLeave:R.useCallback(_e=>{ue(_e)||(Q.current?.focus(),oe(null))},[ue]),onTriggerLeave:R.useCallback(_e=>{ue(_e)&&_e.preventDefault()},[ue]),pointerGraceTimerRef:ve,onPointerGraceIntentChange:R.useCallback(_e=>{le.current=_e},[]),children:u.jsx(Ke,{...ce,children:u.jsx(aw,{asChild:!0,trapped:d,onMountAutoFocus:$t(p,_e=>{_e.preventDefault(),Q.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:m,children:u.jsx(kg,{asChild:!0,disableOutsidePointerEvents:g,onEscapeKeyDown:S,onPointerDownOutside:j,onFocusOutside:A,onInteractOutside:k,onDismiss:T,children:u.jsx(Jve,{asChild:!0,...X,dir:G.dir,orientation:"vertical",loop:o,currentTabStopId:ee,onCurrentTabStopIdChange:oe,onEntryFocus:$t(b,_e=>{G.isUsingKeyboardRef.current||_e.preventDefault()}),preventScrollOnEntryFocus:!0,children:u.jsx(EC,{role:"menu","aria-orientation":"vertical","data-state":Hq(q.open),"data-radix-menu-content":"",dir:G.dir,...K,...I,ref:ne,style:{outline:"none",...I.style},onKeyDown:$t(I.onKeyDown,_e=>{const He=_e.target.closest("[data-radix-menu-content]")===_e.currentTarget,Oe=_e.ctrlKey||_e.altKey||_e.metaKey,ke=_e.key.length===1;He&&(_e.key==="Tab"&&_e.preventDefault(),!Oe&&ke&&re(_e.key));const Ve=Q.current;if(_e.target!==Ve||!oxe.includes(_e.key))return;_e.preventDefault();const De=L().filter(Le=>!Le.disabled).map(Le=>Le.ref.current);jq.includes(_e.key)&&De.reverse(),Rxe(De)}),onBlur:$t(e.onBlur,_e=>{_e.currentTarget.contains(_e.target)||(window.clearTimeout(de.current),je.current="")}),onPointerMove:$t(e.onPointerMove,Jb(_e=>{const fe=_e.target,He=Ce.current!==_e.clientX;if(_e.currentTarget.contains(fe)&&He){const Oe=_e.clientX>Ce.current?"right":"left";be.current=Oe,Ce.current=_e.clientX}}))})})})})})})});Tq.displayName=io;var bxe="MenuGroup",h$=R.forwardRef((e,r)=>{const{__scopeMenu:s,...o}=e;return u.jsx(Cn.div,{role:"group",...o,ref:r})});h$.displayName=bxe;var wxe="MenuLabel",_q=R.forwardRef((e,r)=>{const{__scopeMenu:s,...o}=e;return u.jsx(Cn.div,{...o,ref:r})});_q.displayName=wxe;var hC="MenuItem",R3="menu.itemSelect",JC=R.forwardRef((e,r)=>{const{disabled:s=!1,onSelect:o,...d}=e,p=R.useRef(null),m=vw(hC,e.__scopeMenu),g=u$(hC,e.__scopeMenu),b=zn(r,p),S=R.useRef(!1),j=()=>{const A=p.current;if(!s&&A){const k=new CustomEvent(R3,{bubbles:!0,cancelable:!0});A.addEventListener(R3,T=>o?.(T),{once:!0}),_L(A,k),k.defaultPrevented?S.current=!1:m.onClose()}};return u.jsx($q,{...d,ref:b,disabled:s,onClick:$t(e.onClick,j),onPointerDown:A=>{e.onPointerDown?.(A),S.current=!0},onPointerUp:$t(e.onPointerUp,A=>{S.current||A.currentTarget?.click()}),onKeyDown:$t(e.onKeyDown,A=>{const k=g.searchRef.current!=="";s||k&&A.key===" "||j_.includes(A.key)&&(A.currentTarget.click(),A.preventDefault())})})});JC.displayName=hC;var $q=R.forwardRef((e,r)=>{const{__scopeMenu:s,disabled:o=!1,textValue:d,...p}=e,m=u$(hC,s),g=Aq(s),b=R.useRef(null),S=zn(r,b),[j,A]=R.useState(!1),[k,T]=R.useState("");return R.useEffect(()=>{const M=b.current;M&&T((M.textContent??"").trim())},[p.children]),u.jsx(Wb.ItemSlot,{scope:s,disabled:o,textValue:d??k,children:u.jsx(Qve,{asChild:!0,...g,focusable:!o,children:u.jsx(Cn.div,{role:"menuitem","data-highlighted":j?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...p,ref:S,onPointerMove:$t(e.onPointerMove,Jb(M=>{o?m.onItemLeave(M):(m.onItemEnter(M),M.defaultPrevented||M.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:$t(e.onPointerLeave,Jb(M=>m.onItemLeave(M))),onFocus:$t(e.onFocus,()=>A(!0)),onBlur:$t(e.onBlur,()=>A(!1))})})})}),Sxe="MenuCheckboxItem",Nq=R.forwardRef((e,r)=>{const{checked:s=!1,onCheckedChange:o,...d}=e;return u.jsx(Lq,{scope:e.__scopeMenu,checked:s,children:u.jsx(JC,{role:"menuitemcheckbox","aria-checked":pC(s)?"mixed":s,...d,ref:r,"data-state":f$(s),onSelect:$t(d.onSelect,()=>o?.(pC(s)?!0:!s),{checkForDefaultPrevented:!1})})})});Nq.displayName=Sxe;var Dq="MenuRadioGroup",[Exe,jxe]=Mp(Dq,{value:void 0,onValueChange:()=>{}}),Pq=R.forwardRef((e,r)=>{const{value:s,onValueChange:o,...d}=e,p=tl(o);return u.jsx(Exe,{scope:e.__scopeMenu,value:s,onValueChange:p,children:u.jsx(h$,{...d,ref:r})})});Pq.displayName=Dq;var Mq="MenuRadioItem",Iq=R.forwardRef((e,r)=>{const{value:s,...o}=e,d=jxe(Mq,e.__scopeMenu),p=s===d.value;return u.jsx(Lq,{scope:e.__scopeMenu,checked:p,children:u.jsx(JC,{role:"menuitemradio","aria-checked":p,...o,ref:r,"data-state":f$(p),onSelect:$t(o.onSelect,()=>d.onValueChange?.(s),{checkForDefaultPrevented:!1})})})});Iq.displayName=Mq;var p$="MenuItemIndicator",[Lq,Cxe]=Mp(p$,{checked:!1}),zq=R.forwardRef((e,r)=>{const{__scopeMenu:s,forceMount:o,...d}=e,p=Cxe(p$,s);return u.jsx(lo,{present:o||pC(p.checked)||p.checked===!0,children:u.jsx(Cn.span,{...d,ref:r,"data-state":f$(p.checked)})})});zq.displayName=p$;var Axe="MenuSeparator",Fq=R.forwardRef((e,r)=>{const{__scopeMenu:s,...o}=e;return u.jsx(Cn.div,{role:"separator","aria-orientation":"horizontal",...o,ref:r})});Fq.displayName=Axe;var Oxe="MenuArrow",qq=R.forwardRef((e,r)=>{const{__scopeMenu:s,...o}=e,d=WC(s);return u.jsx(jC,{...d,...o,ref:r})});qq.displayName=Oxe;var kxe="MenuSub",[C0e,Bq]=Mp(kxe),Ab="MenuSubTrigger",Uq=R.forwardRef((e,r)=>{const s=Ip(Ab,e.__scopeMenu),o=vw(Ab,e.__scopeMenu),d=Bq(Ab,e.__scopeMenu),p=u$(Ab,e.__scopeMenu),m=R.useRef(null),{pointerGraceTimerRef:g,onPointerGraceIntentChange:b}=p,S={__scopeMenu:e.__scopeMenu},j=R.useCallback(()=>{m.current&&window.clearTimeout(m.current),m.current=null},[]);return R.useEffect(()=>j,[j]),R.useEffect(()=>{const A=g.current;return()=>{window.clearTimeout(A),b(null)}},[g,b]),u.jsx(l$,{asChild:!0,...S,children:u.jsx($q,{id:d.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":d.contentId,"data-state":Hq(s.open),...e,ref:Li(r,d.onTriggerChange),onClick:A=>{e.onClick?.(A),!(e.disabled||A.defaultPrevented)&&(A.currentTarget.focus(),s.open||s.onOpenChange(!0))},onPointerMove:$t(e.onPointerMove,Jb(A=>{p.onItemEnter(A),!A.defaultPrevented&&!e.disabled&&!s.open&&!m.current&&(p.onPointerGraceIntentChange(null),m.current=window.setTimeout(()=>{s.onOpenChange(!0),j()},100))})),onPointerLeave:$t(e.onPointerLeave,Jb(A=>{j();const k=s.content?.getBoundingClientRect();if(k){const T=s.content?.dataset.side,M=T==="right",I=M?-5:5,q=k[M?"left":"right"],G=k[M?"right":"left"];p.onPointerGraceIntentChange({area:[{x:A.clientX+I,y:A.clientY},{x:q,y:k.top},{x:G,y:k.top},{x:G,y:k.bottom},{x:q,y:k.bottom}],side:T}),window.clearTimeout(g.current),g.current=window.setTimeout(()=>p.onPointerGraceIntentChange(null),300)}else{if(p.onTriggerLeave(A),A.defaultPrevented)return;p.onPointerGraceIntentChange(null)}})),onKeyDown:$t(e.onKeyDown,A=>{const k=p.searchRef.current!=="";e.disabled||k&&A.key===" "||lxe[o.dir].includes(A.key)&&(s.onOpenChange(!0),s.content?.focus(),A.preventDefault())})})})});Uq.displayName=Ab;var Kq="MenuSubContent",Vq=R.forwardRef((e,r)=>{const s=kq(io,e.__scopeMenu),{forceMount:o=s.forceMount,...d}=e,p=Ip(io,e.__scopeMenu),m=vw(io,e.__scopeMenu),g=Bq(Kq,e.__scopeMenu),b=R.useRef(null),S=zn(r,b);return u.jsx(Wb.Provider,{scope:e.__scopeMenu,children:u.jsx(lo,{present:o||p.open,children:u.jsx(Wb.Slot,{scope:e.__scopeMenu,children:u.jsx(d$,{id:g.contentId,"aria-labelledby":g.triggerId,...d,ref:S,align:"start",side:m.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:j=>{m.isUsingKeyboardRef.current&&b.current?.focus(),j.preventDefault()},onCloseAutoFocus:j=>j.preventDefault(),onFocusOutside:$t(e.onFocusOutside,j=>{j.target!==g.trigger&&p.onOpenChange(!1)}),onEscapeKeyDown:$t(e.onEscapeKeyDown,j=>{m.onClose(),j.preventDefault()}),onKeyDown:$t(e.onKeyDown,j=>{const A=j.currentTarget.contains(j.target),k=cxe[m.dir].includes(j.key);A&&k&&(p.onOpenChange(!1),g.trigger?.focus(),j.preventDefault())})})})})})});Vq.displayName=Kq;function Hq(e){return e?"open":"closed"}function pC(e){return e==="indeterminate"}function f$(e){return pC(e)?"indeterminate":e?"checked":"unchecked"}function Rxe(e){const r=document.activeElement;for(const s of e)if(s===r||(s.focus(),document.activeElement!==r))return}function Txe(e,r){return e.map((s,o)=>e[(r+o)%e.length])}function _xe(e,r,s){const d=r.length>1&&Array.from(r).every(S=>S===r[0])?r[0]:r,p=s?e.indexOf(s):-1;let m=Txe(e,Math.max(p,0));d.length===1&&(m=m.filter(S=>S!==s));const b=m.find(S=>S.toLowerCase().startsWith(d.toLowerCase()));return b!==s?b:void 0}function $xe(e,r){const{x:s,y:o}=e;let d=!1;for(let p=0,m=r.length-1;po!=k>o&&s<(A-S)*(o-j)/(k-j)+S&&(d=!d)}return d}function Nxe(e,r){if(!r)return!1;const s={x:e.clientX,y:e.clientY};return $xe(s,r)}function Jb(e){return r=>r.pointerType==="mouse"?e(r):void 0}var Dxe=Oq,Pxe=l$,Mxe=Rq,Ixe=Tq,Lxe=h$,zxe=_q,Fxe=JC,qxe=Nq,Bxe=Pq,Uxe=Iq,Kxe=zq,Vxe=Fq,Hxe=qq,Gxe=Uq,Xxe=Vq,QC="DropdownMenu",[Yxe]=al(QC,[Cq]),Ki=Cq(),[Zxe,Gq]=Yxe(QC),Xq=e=>{const{__scopeDropdownMenu:r,children:s,dir:o,open:d,defaultOpen:p,onOpenChange:m,modal:g=!0}=e,b=Ki(r),S=R.useRef(null),[j,A]=qd({prop:d,defaultProp:p??!1,onChange:m,caller:QC});return u.jsx(Zxe,{scope:r,triggerId:Vs(),triggerRef:S,contentId:Vs(),open:j,onOpenChange:A,onOpenToggle:R.useCallback(()=>A(k=>!k),[A]),modal:g,children:u.jsx(Dxe,{...b,open:j,onOpenChange:A,dir:o,modal:g,children:s})})};Xq.displayName=QC;var Yq="DropdownMenuTrigger",Zq=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,disabled:o=!1,...d}=e,p=Gq(Yq,s),m=Ki(s);return u.jsx(Pxe,{asChild:!0,...m,children:u.jsx(Cn.button,{type:"button",id:p.triggerId,"aria-haspopup":"menu","aria-expanded":p.open,"aria-controls":p.open?p.contentId:void 0,"data-state":p.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...d,ref:Li(r,p.triggerRef),onPointerDown:$t(e.onPointerDown,g=>{!o&&g.button===0&&g.ctrlKey===!1&&(p.onOpenToggle(),p.open||g.preventDefault())}),onKeyDown:$t(e.onKeyDown,g=>{o||(["Enter"," "].includes(g.key)&&p.onOpenToggle(),g.key==="ArrowDown"&&p.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(g.key)&&g.preventDefault())})})})});Zq.displayName=Yq;var Wxe="DropdownMenuPortal",Wq=e=>{const{__scopeDropdownMenu:r,...s}=e,o=Ki(r);return u.jsx(Mxe,{...o,...s})};Wq.displayName=Wxe;var Jq="DropdownMenuContent",Qq=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,d=Gq(Jq,s),p=Ki(s),m=R.useRef(!1);return u.jsx(Ixe,{id:d.contentId,"aria-labelledby":d.triggerId,...p,...o,ref:r,onCloseAutoFocus:$t(e.onCloseAutoFocus,g=>{m.current||d.triggerRef.current?.focus(),m.current=!1,g.preventDefault()}),onInteractOutside:$t(e.onInteractOutside,g=>{const b=g.detail.originalEvent,S=b.button===0&&b.ctrlKey===!0,j=b.button===2||S;(!d.modal||j)&&(m.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)"}})});Qq.displayName=Jq;var Jxe="DropdownMenuGroup",Qxe=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,d=Ki(s);return u.jsx(Lxe,{...d,...o,ref:r})});Qxe.displayName=Jxe;var ebe="DropdownMenuLabel",tbe=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,d=Ki(s);return u.jsx(zxe,{...d,...o,ref:r})});tbe.displayName=ebe;var nbe="DropdownMenuItem",eB=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,d=Ki(s);return u.jsx(Fxe,{...d,...o,ref:r})});eB.displayName=nbe;var rbe="DropdownMenuCheckboxItem",sbe=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,d=Ki(s);return u.jsx(qxe,{...d,...o,ref:r})});sbe.displayName=rbe;var ibe="DropdownMenuRadioGroup",abe=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,d=Ki(s);return u.jsx(Bxe,{...d,...o,ref:r})});abe.displayName=ibe;var obe="DropdownMenuRadioItem",lbe=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,d=Ki(s);return u.jsx(Uxe,{...d,...o,ref:r})});lbe.displayName=obe;var cbe="DropdownMenuItemIndicator",ube=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,d=Ki(s);return u.jsx(Kxe,{...d,...o,ref:r})});ube.displayName=cbe;var dbe="DropdownMenuSeparator",hbe=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,d=Ki(s);return u.jsx(Vxe,{...d,...o,ref:r})});hbe.displayName=dbe;var pbe="DropdownMenuArrow",fbe=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,d=Ki(s);return u.jsx(Hxe,{...d,...o,ref:r})});fbe.displayName=pbe;var mbe="DropdownMenuSubTrigger",gbe=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,d=Ki(s);return u.jsx(Gxe,{...d,...o,ref:r})});gbe.displayName=mbe;var ybe="DropdownMenuSubContent",vbe=R.forwardRef((e,r)=>{const{__scopeDropdownMenu:s,...o}=e,d=Ki(s);return u.jsx(Xxe,{...d,...o,ref:r,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)"}})});vbe.displayName=ybe;var xbe=Xq,bbe=Zq,wbe=Wq,Sbe=Qq,Ebe=eB;function m$({...e}){return u.jsx(xbe,{"data-slot":"dropdown-menu",...e})}function g$({...e}){return u.jsx(bbe,{"data-slot":"dropdown-menu-trigger",...e})}function y$({className:e,sideOffset:r=4,...s}){return u.jsx(wbe,{children:u.jsx(Sbe,{"data-slot":"dropdown-menu-content",sideOffset:r,className:ht("bg-popover text-popover-foreground 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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...s})})}function jp({className:e,inset:r,variant:s="default",...o}){return u.jsx(Ebe,{"data-slot":"dropdown-menu-item","data-inset":r,"data-variant":s,className:ht("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...o})}var eA="Switch",[jbe]=al(eA),[Cbe,Abe]=jbe(eA),tB=R.forwardRef((e,r)=>{const{__scopeSwitch:s,name:o,checked:d,defaultChecked:p,required:m,disabled:g,value:b="on",onCheckedChange:S,form:j,...A}=e,[k,T]=R.useState(null),M=zn(r,X=>T(X)),I=R.useRef(!1),q=k?j||!!k.closest("form"):!0,[G,K]=qd({prop:d,defaultProp:p??!1,onChange:S,caller:eA});return u.jsxs(Cbe,{scope:s,checked:G,disabled:g,children:[u.jsx(Cn.button,{type:"button",role:"switch","aria-checked":G,"aria-required":m,"data-state":iB(G),"data-disabled":g?"":void 0,disabled:g,value:b,...A,ref:M,onClick:$t(e.onClick,X=>{K(L=>!L),q&&(I.current=X.isPropagationStopped(),I.current||X.stopPropagation())})}),q&&u.jsx(sB,{control:k,bubbles:!I.current,name:o,value:b,checked:G,required:m,disabled:g,form:j,style:{transform:"translateX(-100%)"}})]})});tB.displayName=eA;var nB="SwitchThumb",rB=R.forwardRef((e,r)=>{const{__scopeSwitch:s,...o}=e,d=Abe(nB,s);return u.jsx(Cn.span,{"data-state":iB(d.checked),"data-disabled":d.disabled?"":void 0,...o,ref:r})});rB.displayName=nB;var Obe="SwitchBubbleInput",sB=R.forwardRef(({__scopeSwitch:e,control:r,checked:s,bubbles:o=!0,...d},p)=>{const m=R.useRef(null),g=zn(m,p),b=_6(s),S=HL(r);return R.useEffect(()=>{const j=m.current;if(!j)return;const A=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(A,"checked").set;if(b!==s&&T){const M=new Event("click",{bubbles:o});T.call(j,s),j.dispatchEvent(M)}},[b,s,o]),u.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:s,...d,tabIndex:-1,ref:g,style:{...d.style,...S,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});sB.displayName=Obe;function iB(e){return e?"checked":"unchecked"}var kbe=tB,Rbe=rB;function T3({className:e,...r}){return u.jsx(kbe,{"data-slot":"switch",className:ht("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...r,children:u.jsx(Rbe,{"data-slot":"switch-thumb",className:ht("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}const fC=["route53","s3","ec2","iam","rds","dynamodb"],Ej=Xs({credential_provider:Da(["aws","cloudflare","hetzner","digitalocean","generic"]),kind:Da(["aws_access_key","api_token","basic_auth","oauth2"]),schema_version:Yb().default(1),name:Ln().min(1,"Name is required").max(100),scope_kind:Da(["provider","service","resource"]),scope_version:Yb().default(1),scope:S3(),account_id:Ln().optional().or(Zb("")).transform(e=>e||void 0),region:Ln().optional().or(Zb("")).transform(e=>e||void 0),secret:S3()}).superRefine((e,r)=>{if(e.credential_provider==="aws"){if(e.scope_kind==="service"){const s=e.scope?.service;fC.includes(s)||r.addIssue({code:Dd.custom,path:["scope"],message:`For AWS service scope, "service" must be one of: ${fC.join(", ")}`})}if(e.scope_kind==="resource"){const s=e.scope?.arn;(typeof s!="string"||!s.startsWith("arn:"))&&r.addIssue({code:Dd.custom,path:["scope"],message:'For AWS resource scope, "arn" must start with "arn:"'})}if(e.kind==="aws_access_key"){const s=e.secret??{},o=s.access_key_id;(typeof o!="string"||!/^[A-Z0-9]{20}$/.test(o))&&r.addIssue({code:Dd.custom,path:["secret"],message:"access_key_id must be 20 chars (A-Z0-9)"}),(typeof s.secret_access_key!="string"||s.secret_access_key.length<10)&&r.addIssue({code:Dd.custom,path:["secret"],message:"secret_access_key is required"})}}if(e.kind==="api_token"&&((e.secret??{}).token||r.addIssue({code:Dd.custom,path:["secret"],message:"token is required"})),e.kind==="basic_auth"){const s=e.secret??{};(!s.username||!s.password)&&r.addIssue({code:Dd.custom,path:["secret"],message:"username and password are required"})}if(e.kind==="oauth2"){const s=e.secret??{};(!s.client_id||!s.client_secret||!s.refresh_token)&&r.addIssue({code:Dd.custom,path:["secret"],message:"client_id, client_secret, and refresh_token are required"})}e.scope_kind!=="provider"&&!e.scope&&r.addIssue({code:Dd.custom,path:["scope"],message:"scope is required"})}),yT=Ej.partial().extend({name:Ln().min(1,"Name is required").max(100).optional()});function Ql(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return""}}function uj(e){const r=e?.body??e?.response??e?.message;if(typeof r=="string")return r;try{const s=e?.response?.data?.message||e?.message;if(s)return String(s)}catch{return"Unknown error"}return"Unknown error"}function Tbe({credential_provider:e,scope_kind:r}){return e==="aws"&&r==="service"}function _be({credential_provider:e,scope_kind:r}){return e==="aws"&&r==="resource"}function $be({scope_kind:e}){return e==="provider"}function _3(){return{credential_provider:"aws",kind:"aws_access_key",schema_version:1,name:"",scope_kind:"provider",scope_version:1,scope:{},account_id:"",region:"",secret:{}}}function $3(e){return{credential_provider:e.credential_provider,kind:e.kind,schema_version:e.schema_version??1,name:e.name,scope_kind:e.scope_kind,scope_version:e.scope_version??1,scope:e.scope??{},account_id:e.account_id,region:e.region,secret:e.secret??{}}}function N3(e){const r={},s=["name","account_id","region","scope_kind","scope_version","scope","secret","credential_provider","kind","schema_version"];for(const o of s)typeof e[o]<"u"&&e[o]!==""&&(r[o]=e[o]);return r}const Nbe=()=>{const[e,r]=R.useState(""),[s,o]=R.useState(!1),[d,p]=R.useState(!1),[m,g]=R.useState(!1),[b,S]=R.useState(null),[j,A]=R.useState(null),[k,T]=R.useState(!1),[M,I]=R.useState(!1),[q,G]=R.useState(!1),[K,X]=R.useState(null),[L,ee]=R.useState(!1),[oe,Q]=R.useState(null),ne=Hs(),de=rr({queryKey:["credentials"],queryFn:()=>Qm.listCredentials()}),je=nn({mutationFn:ie=>Qm.createCredential($3(ie)),onSuccess:async()=>{await ne.invalidateQueries({queryKey:["credentials"]}),Ze.success("Credential created"),o(!1),Ce.reset(_3()),T(!1)},onError:ie=>{Ze.error("Failed to create credential",{description:uj(ie)})}}),ve=nn({mutationFn:ie=>Qm.updateCredential(ie.id,N3(ie.body)),onSuccess:async()=>{await ne.invalidateQueries({queryKey:["credentials"]}),Ze.success("Credential updated"),p(!1),A(null),I(!1)},onError:ie=>{Ze.error("Failed to update credential",{description:uj(ie)})}}),le=nn({mutationFn:ie=>Qm.deleteCredential(ie),onSuccess:async()=>{await ne.invalidateQueries({queryKey:["credentials"]}),Ze.success("Credential deleted")},onError:ie=>{Ze.error("Failed to delete credential",{description:uj(ie)})}}),be=nn({mutationFn:ie=>Qm.revealCredential(ie),onSuccess:ie=>{S(ie),g(!0)},onError:ie=>{Ze.error("Failed to reveal secret",{description:uj(ie)})}}),Ce=mr({resolver:gr(Ej),defaultValues:_3(),mode:"onBlur"}),Ke=mr({resolver:gr(yT),defaultValues:{},mode:"onBlur"});function ce(ie){A(ie.id),Ke.reset({provider:ie.provider,kind:ie.kind,schema_version:ie.schema_version??1,name:ie.name,scope_kind:ie.scope_kind,scope_version:ie.scope_version??1,account_id:ie.account_id??"",region:ie.region??"",scope:ie.scope??(ie.scope_kind==="provider"?{}:void 0),secret:void 0}),I(!1),p(!0)}const re=R.useMemo(()=>{const ie=de.data??[];if(!e.trim())return ie;const De=e.toLowerCase();return ie.filter(Le=>[Le.name,Le.provider,Le.kind,Le.scope_kind,Le.account_id,Le.region,JSON.stringify(Le.scope??{})].filter(Boolean).map(tt=>String(tt).toLowerCase()).some(tt=>tt.includes(De)))},[de.data,e]);if(de.isLoading)return u.jsxs("div",{className:"flex items-center gap-2 p-6",children:[u.jsx(Ds,{className:"h-4 w-4 animate-spin"})," Loading credentials…"]});if(de.error)return u.jsxs("div",{className:"p-6 text-red-500",children:["Error loading credentials.",u.jsx("pre",{className:"mt-2 text-xs opacity-80",children:JSON.stringify(de.error,null,2)})]});const ue=Ce.watch("credential_provider"),_e=Ce.watch("kind"),fe=Ce.watch("scope_kind"),He=ie=>Ce.setValue("scope",ie,{shouldDirty:!0,shouldValidate:!0}),Oe=ie=>Ce.setValue("secret",ie,{shouldDirty:!0,shouldValidate:!0});function ke(){if(!k){if(ue==="aws"&&_e==="aws_access_key"){const ie=Ce.getValues("secret")??{};Oe({access_key_id:ie.access_key_id??"",secret_access_key:ie.secret_access_key??""})}else if(_e==="api_token"){const ie=Ce.getValues("secret")??{};Oe({token:ie.token??""})}else if(_e==="basic_auth"){const ie=Ce.getValues("secret")??{};Oe({username:ie.username??"",password:ie.password??""})}else if(_e==="oauth2"){const ie=Ce.getValues("secret")??{};Oe({client_id:ie.client_id??"",client_secret:ie.client_secret??"",refresh_token:ie.refresh_token??""})}}}function Ve(ie){Ce.setValue("scope_kind",ie),ie==="provider"&&He({}),ie==="service"&&He({service:"route53"}),ie==="resource"&&He({arn:""})}return u.jsxs("div",{className:"space-y-4 p-6",children:[u.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[u.jsxs("div",{children:[u.jsx("h1",{className:"mb-1 text-2xl font-bold",children:"Credentials"}),u.jsx("p",{className:"text-muted-foreground text-sm",children:"Store provider credentials. Secrets are encrypted server-side; revealing is a one-time read."})]}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsxs("div",{className:"relative",children:[u.jsx(Pa,{className:"absolute top-2.5 left-2 h-4 w-4 opacity-60"}),u.jsx(xt,{value:e,onChange:ie=>r(ie.target.value),placeholder:"Search by name, provider, kind, scope…",className:"w-64 pl-8"})]}),u.jsxs(fn,{open:s,onOpenChange:o,children:[u.jsx(zi,{asChild:!0,children:u.jsxs(Fe,{onClick:()=>o(!0),children:[u.jsx(oo,{className:"mr-2 h-4 w-4"}),"Create Credential"]})}),u.jsxs(mn,{className:"sm:max-w-2xl",children:[u.jsx(gn,{children:u.jsx(yn,{children:"Create Credential"})}),u.jsx(yr,{...Ce,children:u.jsxs("form",{onSubmit:Ce.handleSubmit(ie=>{const De=Ej.safeParse(ie);if(!De.success){Ze.error("Please fix validation errors");return}je.mutate(De.data)}),className:"space-y-5 pt-2",children:[u.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[u.jsx(yt,{control:Ce.control,name:"credential_provider",render:({field:ie})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Provider"}),u.jsxs(Rn,{onValueChange:De=>{ie.onChange(De),ke()},defaultValue:ie.value,children:[u.jsx(wt,{children:u.jsx(_n,{children:u.jsx(Tn,{})})}),u.jsxs($n,{children:[u.jsx(jt,{value:"aws",children:"AWS"}),u.jsx(jt,{value:"cloudflare",children:"Cloudflare"}),u.jsx(jt,{value:"hetzner",children:"Hetzner"}),u.jsx(jt,{value:"digitalocean",children:"DigitalOcean"}),u.jsx(jt,{value:"generic",children:"Generic"})]})]}),u.jsx(mt,{})]})}),u.jsx(yt,{control:Ce.control,name:"kind",render:({field:ie})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Kind"}),u.jsxs(Rn,{onValueChange:De=>{ie.onChange(De),ke()},defaultValue:ie.value,children:[u.jsx(wt,{children:u.jsx(_n,{children:u.jsx(Tn,{})})}),u.jsxs($n,{children:[u.jsx(jt,{value:"aws_access_key",children:"AWS Access Key"}),u.jsx(jt,{value:"api_token",children:"API Token"}),u.jsx(jt,{value:"basic_auth",children:"Basic Auth"}),u.jsx(jt,{value:"oauth2",children:"OAuth2"})]})]}),u.jsx(mt,{})]})}),u.jsx(yt,{control:Ce.control,name:"scope_kind",render:({field:ie})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Scope Kind"}),u.jsxs(Rn,{onValueChange:De=>{Ve(De)},defaultValue:ie.value,children:[u.jsx(wt,{children:u.jsx(_n,{children:u.jsx(Tn,{})})}),u.jsxs($n,{children:[u.jsx(jt,{value:"provider",children:"Provider"}),u.jsx(jt,{value:"service",children:"Service"}),u.jsx(jt,{value:"resource",children:"Resource"})]})]}),u.jsx(mt,{})]})}),u.jsx(yt,{control:Ce.control,name:"name",render:({field:ie})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Name"}),u.jsx(xt,{...ie,placeholder:"My AWS Key"}),u.jsx(mt,{})]})}),u.jsx(yt,{control:Ce.control,name:"account_id",render:({field:ie})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Account ID (optional)"}),u.jsx(xt,{...ie,placeholder:"e.g. 123456789012"}),u.jsx(mt,{})]})}),u.jsx(yt,{control:Ce.control,name:"region",render:({field:ie})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Region (optional)"}),u.jsx(xt,{...ie,placeholder:"e.g. us-east-1"}),u.jsx(mt,{})]})})]}),!$be({scope_kind:fe})&&u.jsx(u.Fragment,{children:Tbe({credential_provider:ue,scope_kind:fe})?u.jsxs(lt,{children:[u.jsx(ct,{children:"Service"}),u.jsx(Go,{control:Ce.control,name:"scope",render:({field:ie})=>u.jsxs(Rn,{onValueChange:De=>ie.onChange({service:De}),value:ie.value?.service??"route53",children:[u.jsx(wt,{children:u.jsx(_n,{children:u.jsx(Tn,{placeholder:"Select an AWS service"})})}),u.jsx($n,{children:fC.map(De=>u.jsx(jt,{value:De,children:De.toUpperCase()},De))})]})}),u.jsxs("p",{className:"text-muted-foreground mt-1 text-xs",children:["Must be one of: ",fC.join(", "),"."]})]}):_be({credential_provider:ue,scope_kind:fe})?u.jsxs(lt,{children:[u.jsx(ct,{children:"Resource ARN"}),u.jsx(Go,{control:Ce.control,name:"scope",render:({field:ie})=>u.jsx(xt,{value:ie.value?.arn??"",onChange:De=>ie.onChange({arn:De.target.value}),placeholder:"arn:aws:service:region:account:resource"})}),u.jsx(mt,{})]}):u.jsx(yt,{control:Ce.control,name:"scope",render:({field:ie})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Scope (JSON)"}),u.jsx(hu,{value:Ql(ie.value??{}),onChange:De=>{try{const Le=JSON.parse(De.target.value);ie.onChange(Le)}catch{ie.onChange(De.target.value)}},rows:3,placeholder:'{"service":"route53"} or {"arn":"arn:aws:..."}',className:"font-mono"}),u.jsx(mt,{})]})})}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(T3,{checked:k,onCheckedChange:ie=>{T(ie),ke()},id:"raw-secret-toggle"}),u.jsx("label",{htmlFor:"raw-secret-toggle",className:"text-sm",children:"Edit secret as raw JSON"})]}),k?u.jsx(yt,{control:Ce.control,name:"secret",render:({field:ie})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Secret (JSON)"}),u.jsx(hu,{value:Ql(ie.value??{}),onChange:De=>{try{ie.onChange(JSON.parse(De.target.value))}catch{ie.onChange(De.target.value)}},rows:6,placeholder:_e==="aws_access_key"?'{"access_key_id":"...","secret_access_key":"..."}':_e==="api_token"?'{"token":"..."}':_e==="basic_auth"?'{"username":"...","password":"..."}':'{"client_id":"...","client_secret":"...","refresh_token":"..."}',className:"font-mono"}),u.jsx(mt,{})]})}):u.jsxs(u.Fragment,{children:[ue==="aws"&&_e==="aws_access_key"&&u.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[u.jsxs(lt,{children:[u.jsx(ct,{children:"Access Key ID"}),u.jsx(Go,{control:Ce.control,name:"secret",render:({field:ie})=>u.jsx(xt,{value:(ie.value??{}).access_key_id??"",onChange:De=>Oe({...ie.value??{},access_key_id:De.target.value.trim()}),placeholder:"AKIA..."})})]}),u.jsxs(lt,{children:[u.jsx(ct,{children:"Secret Access Key"}),u.jsx(Go,{control:Ce.control,name:"secret",render:({field:ie})=>u.jsx(xt,{type:"password",value:(ie.value??{}).secret_access_key??"",onChange:De=>Oe({...ie.value??{},secret_access_key:De.target.value}),placeholder:"•••••••••••••••"})})]})]}),_e==="api_token"&&u.jsxs(lt,{children:[u.jsx(ct,{children:"API Token"}),u.jsx(Go,{control:Ce.control,name:"secret",render:({field:ie})=>u.jsx(xt,{value:(ie.value??{}).token??"",onChange:De=>Oe({...ie.value??{},token:De.target.value}),placeholder:"token..."})})]}),_e==="basic_auth"&&u.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[u.jsxs(lt,{children:[u.jsx(ct,{children:"Username"}),u.jsx(Go,{control:Ce.control,name:"secret",render:({field:ie})=>u.jsx(xt,{value:(ie.value??{}).username??"",onChange:De=>Oe({...ie.value??{},username:De.target.value})})})]}),u.jsxs(lt,{children:[u.jsx(ct,{children:"Password"}),u.jsx(Go,{control:Ce.control,name:"secret",render:({field:ie})=>u.jsx(xt,{type:"password",value:(ie.value??{}).password??"",onChange:De=>Oe({...ie.value??{},password:De.target.value})})})]})]}),_e==="oauth2"&&u.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[u.jsxs(lt,{children:[u.jsx(ct,{children:"Client ID"}),u.jsx(Go,{control:Ce.control,name:"secret",render:({field:ie})=>u.jsx(xt,{value:(ie.value??{}).client_id??"",onChange:De=>Oe({...ie.value??{},client_id:De.target.value})})})]}),u.jsxs(lt,{children:[u.jsx(ct,{children:"Client Secret"}),u.jsx(Go,{control:Ce.control,name:"secret",render:({field:ie})=>u.jsx(xt,{type:"password",value:(ie.value??{}).client_secret??"",onChange:De=>Oe({...ie.value??{},client_secret:De.target.value})})})]}),u.jsxs(lt,{children:[u.jsx(ct,{children:"Refresh Token"}),u.jsx(Go,{control:Ce.control,name:"secret",render:({field:ie})=>u.jsx(xt,{value:(ie.value??{}).refresh_token??"",onChange:De=>Oe({...ie.value??{},refresh_token:De.target.value})})})]})]})]}),u.jsxs(Sn,{className:"gap-2",children:[u.jsx(Fe,{type:"button",variant:"secondary",onClick:()=>{const ie=Ej.safeParse(Ce.getValues());if(!ie.success){Ze.error("Fix validation errors before previewing");return}const De=$3(ie.data);X(De),G(!0)},children:"Preview request"}),u.jsx(Fe,{variant:"outline",type:"button",onClick:()=>o(!1),children:"Cancel"}),u.jsxs(Fe,{type:"submit",disabled:je.isPending,children:[je.isPending&&u.jsx(Ds,{className:"mr-2 h-4 w-4 animate-spin"}),"Create"]})]})]})})]})]})]})]}),u.jsx("div",{className:"overflow-x-auto rounded-xl border",children:u.jsxs("table",{className:"min-w-full text-sm",children:[u.jsx("thead",{className:"bg-muted/40 text-xs tracking-wide uppercase",children:u.jsxs("tr",{children:[u.jsx("th",{className:"w-[26%] px-4 py-2 text-left",children:"Name"}),u.jsx("th",{className:"px-4 py-2 text-left",children:"Provider"}),u.jsx("th",{className:"px-4 py-2 text-left",children:"Kind"}),u.jsx("th",{className:"px-4 py-2 text-left",children:"Scope"}),u.jsx("th",{className:"px-4 py-2 text-left",children:"Account"}),u.jsx("th",{className:"px-4 py-2 text-left",children:"Region"}),u.jsx("th",{className:"px-4 py-2 text-right",children:"Actions"})]})}),u.jsxs("tbody",{children:[re.map(ie=>u.jsxs("tr",{className:"border-t",children:[u.jsxs("td",{className:"px-4 py-2",children:[u.jsx("div",{className:"font-medium",children:ie.name}),u.jsxs("div",{className:"text-muted-foreground text-xs",children:[u.jsx("span",{className:"mr-1",children:"id:"}),u.jsxs("code",{className:"bg-muted rounded px-1",children:[ie.id.slice(0,8),"…"]})]})]}),u.jsx("td",{className:"px-4 py-2",children:ie.provider}),u.jsx("td",{className:"px-4 py-2",children:ie.kind}),u.jsx("td",{className:"px-4 py-2",children:u.jsx(ns,{variant:"secondary",children:ie.scope_kind})}),u.jsx("td",{className:"px-4 py-2",children:ie.account_id??"—"}),u.jsx("td",{className:"px-4 py-2",children:ie.region??"—"}),u.jsx("td",{className:"px-4 py-2",children:u.jsxs("div",{className:"flex items-center justify-end gap-2",children:[u.jsx(Fe,{size:"icon",variant:"ghost",title:"Reveal secret (one-time read)",onClick:()=>be.mutate(ie.id),children:u.jsx(RT,{className:"h-4 w-4"})}),u.jsx(Fe,{size:"icon",variant:"ghost",title:"Edit",onClick:()=>ce(ie),children:u.jsx(pu,{className:"h-4 w-4"})}),u.jsxs(rC,{children:[u.jsx(sC,{asChild:!0,children:u.jsx(Fe,{size:"icon",variant:"ghost",title:"Delete",children:u.jsx(Ib,{className:"h-4 w-4"})})}),u.jsxs(iC,{children:[u.jsxs(aC,{children:[u.jsxs(lC,{children:["Delete “",ie.name,"”?"]}),u.jsx(cC,{children:"This will permanently remove the credential metadata. Secrets are not recoverable."})]}),u.jsxs(oC,{children:[u.jsx(dC,{disabled:le.isPending,children:"Cancel"}),u.jsxs(uC,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>le.mutate(ie.id),disabled:le.isPending,children:[le.isPending&&u.jsx(Ds,{className:"mr-2 inline h-4 w-4 animate-spin"}),"Delete"]})]})]})]}),u.jsxs(m$,{children:[u.jsx(g$,{asChild:!0,children:u.jsx(Fe,{size:"icon",variant:"ghost",children:u.jsx(z_,{className:"h-4 w-4"})})}),u.jsxs(y$,{align:"end",children:[u.jsx(jp,{onClick:()=>ce(ie),children:"Edit"}),u.jsx(jp,{onClick:()=>be.mutate(ie.id),children:"Reveal secret"}),u.jsx(jp,{className:"text-destructive",onClick:()=>le.mutate(ie.id),children:"Delete"})]})]})]})})]},ie.id)),re.length===0&&u.jsx("tr",{children:u.jsx("td",{colSpan:7,className:"px-4 py-12 text-center",children:u.jsxs("div",{className:"mx-auto max-w-md",children:[u.jsx("div",{className:"mb-2 flex items-center justify-center",children:u.jsx(Rj,{className:"text-muted-foreground h-5 w-5"})}),u.jsx("p",{className:"text-muted-foreground",children:"No credentials match your search."})]})})})]})]})}),u.jsx(fn,{open:d,onOpenChange:p,children:u.jsxs(mn,{className:"sm:max-w-2xl",children:[u.jsx(gn,{children:u.jsx(yn,{children:"Edit Credential"})}),u.jsx(yr,{...Ke,children:u.jsxs("form",{onSubmit:Ke.handleSubmit(ie=>{if(!j)return;const De=yT.safeParse(ie);if(!De.success){Ze.error("Please fix validation errors");return}ve.mutate({id:j,body:De.data})}),className:"space-y-5 pt-2",children:[u.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[u.jsx(yt,{control:Ke.control,name:"credential_provider",render:({field:ie})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Provider"}),u.jsxs(Rn,{onValueChange:ie.onChange,value:ie.value,children:[u.jsx(wt,{children:u.jsx(_n,{children:u.jsx(Tn,{})})}),u.jsxs($n,{children:[u.jsx(jt,{value:"aws",children:"AWS"}),u.jsx(jt,{value:"cloudflare",children:"Cloudflare"}),u.jsx(jt,{value:"hetzner",children:"Hetzner"}),u.jsx(jt,{value:"digitalocean",children:"DigitalOcean"}),u.jsx(jt,{value:"generic",children:"Generic"})]})]}),u.jsx(mt,{})]})}),u.jsx(yt,{control:Ke.control,name:"kind",render:({field:ie})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Kind"}),u.jsxs(Rn,{onValueChange:ie.onChange,value:ie.value,children:[u.jsx(wt,{children:u.jsx(_n,{children:u.jsx(Tn,{})})}),u.jsxs($n,{children:[u.jsx(jt,{value:"aws_access_key",children:"AWS Access Key"}),u.jsx(jt,{value:"api_token",children:"API Token"}),u.jsx(jt,{value:"basic_auth",children:"Basic Auth"}),u.jsx(jt,{value:"oauth2",children:"OAuth2"})]})]}),u.jsx(mt,{})]})}),u.jsx(yt,{control:Ke.control,name:"scope_kind",render:({field:ie})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Scope Kind"}),u.jsxs(Rn,{onValueChange:ie.onChange,value:ie.value,children:[u.jsx(wt,{children:u.jsx(_n,{children:u.jsx(Tn,{})})}),u.jsxs($n,{children:[u.jsx(jt,{value:"provider",children:"Provider"}),u.jsx(jt,{value:"service",children:"Service"}),u.jsx(jt,{value:"resource",children:"Resource"})]})]}),u.jsx(mt,{})]})}),u.jsx(yt,{control:Ke.control,name:"name",render:({field:ie})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Name"}),u.jsx(xt,{...ie}),u.jsx(mt,{})]})}),u.jsx(yt,{control:Ke.control,name:"account_id",render:({field:ie})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Account ID"}),u.jsx(xt,{...ie,placeholder:"optional"}),u.jsx(mt,{})]})}),u.jsx(yt,{control:Ke.control,name:"region",render:({field:ie})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Region"}),u.jsx(xt,{...ie,placeholder:"optional"}),u.jsx(mt,{})]})})]}),u.jsx(yt,{control:Ke.control,name:"scope",render:({field:ie})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Scope (JSON)"}),u.jsx(hu,{value:Ql(ie.value??(Ke.getValues("scope_kind")==="provider"?{}:void 0)),onChange:De=>{try{ie.onChange(JSON.parse(De.target.value))}catch{ie.onChange(De.target.value)}},rows:3,className:"font-mono"}),u.jsx(mt,{})]})}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(T3,{checked:M,onCheckedChange:I,id:"raw-edit-secret-toggle"}),u.jsx("label",{htmlFor:"raw-edit-secret-toggle",className:"text-sm",children:"Rotate secret with raw JSON (leave empty to keep existing)"})]}),M&&u.jsx(yt,{control:Ke.control,name:"secret",render:({field:ie})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Rotate Secret (JSON)"}),u.jsx(hu,{value:typeof ie.value=="string"?ie.value:Ql(ie.value??{}),onChange:De=>{try{ie.onChange(JSON.parse(De.target.value))}catch{ie.onChange(De.target.value)}},rows:6,className:"font-mono",placeholder:'{"access_key_id":"...","secret_access_key":"..."}'}),u.jsx(mt,{})]})}),u.jsxs(Sn,{className:"gap-2",children:[u.jsx(Fe,{type:"button",variant:"secondary",onClick:()=>{const ie=yT.safeParse(Ke.getValues());if(!ie.success){Ze.error("Fix validation errors before previewing");return}const De=N3(ie.data);Q(De),ee(!0)},children:"Preview request"}),u.jsx(Fe,{variant:"outline",type:"button",onClick:()=>p(!1),children:"Cancel"}),u.jsxs(Fe,{type:"submit",disabled:ve.isPending,children:[ve.isPending&&u.jsx(Ds,{className:"mr-2 h-4 w-4 animate-spin"}),"Save changes"]})]})]})})]})}),u.jsx(fn,{open:m,onOpenChange:g,children:u.jsxs(mn,{className:"sm:max-w-xl",children:[u.jsx(gn,{children:u.jsxs(yn,{className:"flex items-center gap-2",children:[u.jsx(RT,{className:"h-4 w-4"})," Decrypted Secret"]})}),u.jsx("div",{className:"bg-muted/40 rounded-lg border p-3",children:u.jsx("pre",{className:"max-h-[50vh] overflow-auto text-xs leading-relaxed",children:Ql(b??{})})}),u.jsxs("div",{className:"text-muted-foreground flex items-center gap-2 text-xs",children:[u.jsx(Rj,{className:"h-3.5 w-3.5"}),"One-time read. Close this dialog to hide the secret."]}),u.jsxs(Sn,{children:[u.jsx(Fe,{variant:"outline",onClick:()=>{navigator.clipboard.writeText(Ql(b??{})),Ze.success("Copied to clipboard")},children:"Copy"}),u.jsx(Fe,{onClick:()=>g(!1),children:"Close"})]})]})}),u.jsx(fn,{open:q,onOpenChange:G,children:u.jsxs(mn,{className:"sm:max-w-2xl",children:[u.jsx(gn,{children:u.jsx(yn,{children:"Preview: POST /api/v1/credentials"})}),u.jsx("div",{className:"bg-muted/40 rounded-lg border p-3",children:u.jsx("pre",{className:"max-h-[50vh] overflow-auto text-xs leading-relaxed",children:Ql(K??{})})}),u.jsxs(Sn,{children:[u.jsx(Fe,{variant:"outline",onClick:()=>{navigator.clipboard.writeText(Ql(K??{})),Ze.success("Copied body")},children:"Copy body"}),u.jsx(Fe,{onClick:()=>G(!1),children:"Close"})]})]})}),u.jsx(fn,{open:L,onOpenChange:ee,children:u.jsxs(mn,{className:"sm:max-w-2xl",children:[u.jsx(gn,{children:u.jsx(yn,{children:"Preview: PATCH /api/v1/credentials/:id"})}),u.jsx("div",{className:"bg-muted/40 rounded-lg border p-3",children:u.jsx("pre",{className:"max-h-[50vh] overflow-auto text-xs leading-relaxed",children:Ql(oe??{})})}),u.jsxs(Sn,{children:[u.jsx(Fe,{variant:"outline",onClick:()=>{navigator.clipboard.writeText(Ql(oe??{})),Ze.success("Copied body")},children:"Copy body"}),u.jsx(Fe,{onClick:()=>ee(!1),children:"Close"})]})]})})]})};function ha({className:e,...r}){return u.jsx("div",{"data-slot":"card",className:ht("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...r})}function sl({className:e,...r}){return u.jsx("div",{"data-slot":"card-header",className:ht("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...r})}function il({className:e,...r}){return u.jsx("div",{"data-slot":"card-title",className:ht("leading-none font-semibold",e),...r})}function C_({className:e,...r}){return u.jsx("div",{"data-slot":"card-description",className:ht("text-muted-foreground text-sm",e),...r})}function ao({className:e,...r}){return u.jsx("div",{"data-slot":"card-content",className:ht("px-6",e),...r})}const Dbe=e=>{switch(e){case"ready":return u.jsx(L_,{className:"h-4 w-4 text-emerald-600"});case"provisioning":return u.jsx(Ds,{className:"h-4 w-4 animate-spin text-blue-600"});case"failed":return u.jsx(Rj,{className:"h-4 w-4 text-red-600"});default:return u.jsx(_Z,{className:"text-muted-foreground h-4 w-4"})}},vT=({s:e})=>u.jsxs(ns,{variant:e==="failed"?"destructive":e==="ready"?"default":"secondary",className:"gap-1",title:e,children:[Dbe(e),u.jsx("span",{className:"capitalize",children:e??"pending"})]}),A_=e=>e.split(",").map(r=>r.trim()).filter(Boolean),Pbe=e=>e&&e.length?e.join(","):"",O_=["A","AAAA","CNAME","TXT","MX","NS","SRV","CAA"],Mbe=e=>e.credential_provider==="aws"&&e.scope_kind==="service"&&(()=>{const r=e.scope;try{return(typeof r=="string"?JSON.parse(r):r||{})?.service==="route53"}catch{return!1}})(),D3=e=>[e.name||"Unnamed",e.account_id,e.region].filter(Boolean).join(" · "),aB=Xs({domain_name:Ln().min(1,"Domain is required").max(253).transform(e=>e.trim().replace(/\.$/,"").toLowerCase()),credential_id:Ln().uuid("Pick a credential"),zone_id:Ln().optional().or(Zb("")).transform(e=>e?e.trim():void 0)}),Ibe=aB.partial(),Lbe=j6([Yb(),Ln().regex(/^\d+$/).transform(e=>Number(e))]).optional().refine(e=>e===void 0||e>=1&&e<=86400,{message:"TTL must be between 1 and 86400"}),oB=Xs({name:Ln().min(1,"Name required").max(253).transform(e=>e.trim().replace(/\.$/,"").toLowerCase()),type:Da(O_),ttl:Lbe,valuesCsv:Ln().optional()}).superRefine((e,r)=>{const s=A_(e.valuesCsv??"");s.length===0&&r.addIssue({code:"custom",message:"At least one value is required"}),e.type==="CNAME"&&s.length!==1&&r.addIssue({code:"custom",message:"CNAME requires exactly one value"})}),zbe=oB.partial(),Fbe=()=>{const[e,r]=R.useState(""),[s,o]=R.useState(null),[d,p]=R.useState(!1),[m,g]=R.useState(!1),[b,S]=R.useState(!1),[j,A]=R.useState(!1),[k,T]=R.useState(null),M=Hs(),I=rr({queryKey:["dns","domains"],queryFn:()=>tc.listDomains()}),q=rr({queryKey:["dns","records",s?.id],queryFn:async()=>s?await tc.listRecordSetsByDomain(s.id):[],enabled:!!s?.id}),G=rr({queryKey:["credentials","r53"],queryFn:()=>Qm.listCredentials()}),K=R.useMemo(()=>(G.data??[]).filter(Mbe),[G.data]);R.useEffect(()=>{(()=>{!s&&I.data&&I.data.length&&o(I.data[0])})()},[I.data,s]);const X=R.useMemo(()=>{const re=I.data??[];if(!e.trim())return re;const ue=e.toLowerCase();return re.filter(_e=>[_e.domain_name,_e.zone_id,_e.status,_e.domain_name].filter(Boolean).map(fe=>String(fe).toLowerCase()).some(fe=>fe.includes(ue)))},[I.data,e]),L=mr({resolver:gr(aB),defaultValues:{domain_name:"",credential_id:"",zone_id:""}}),ee=nn({mutationFn:re=>tc.createDomain(re),onSuccess:async re=>{Ze.success("Domain created"),p(!1),L.reset(),await M.invalidateQueries({queryKey:["dns","domains"]}),o(re)},onError:re=>Ze.error("Failed to create domain",{description:re?.message??"Unknown error"})}),oe=mr({resolver:gr(Ibe)}),Q=re=>{o(re),oe.reset({domain_name:re.domain_name,credential_id:re.credential_id,zone_id:re.zone_id||""}),g(!0)},ne=nn({mutationFn:re=>{if(!s)throw new Error("No domain selected");return tc.updateDomain(s.id,re)},onSuccess:async()=>{Ze.success("Domain updated"),g(!1),await M.invalidateQueries({queryKey:["dns","domains"]}),await M.invalidateQueries({queryKey:["dns","records",s?.id]})},onError:re=>Ze.error("Failed to update domain",{description:re?.message??"Unknown error"})}),de=nn({mutationFn:re=>tc.deleteDomain(re),onSuccess:async()=>{Ze.success("Domain deleted"),await M.invalidateQueries({queryKey:["dns","domains"]}),o(null)},onError:re=>Ze.error("Failed to delete domain",{description:re?.message??"Unknown error"})}),je=mr({resolver:gr(oB),defaultValues:{name:"",type:"A",ttl:300,valuesCsv:""}}),ve=re=>{const ue=re?.response?.data?.error||re?.message||"Unknown error";return ue.includes("ownership_conflict")?"Ownership conflict: this (name,type) exists but isn’t owned by autoglue.":ue.includes("already_exists")?"A record with this (name,type) already exists. Use Edit instead.":ue},le=nn({mutationFn:async re=>{if(!s)throw new Error("No domain selected");const ue={name:re.name,type:re.type,...re.ttl?{ttl:re.ttl}:{},values:A_(re.valuesCsv??"")};return tc.createRecordSetsByDomain(s.id,ue)},onSuccess:async()=>{Ze.success("Record set created"),S(!1),je.reset(),await M.invalidateQueries({queryKey:["dns","records",s?.id]})},onError:re=>Ze.error("Failed to create record set",{description:ve(re)})}),be=mr({resolver:gr(zbe)}),Ce=re=>{T(re);const ue=re.values||[];be.reset({name:re.name,type:re.type,ttl:re.ttl?Number(re.ttl):void 0,valuesCsv:Pbe(ue)}),A(!0)},Ke=nn({mutationFn:async re=>{if(!k)throw new Error("No record selected");const ue={};return re.name!==void 0&&(ue.name=re.name),re.type!==void 0&&(ue.type=re.type),re.ttl!==void 0&&re.ttl!==null&&(ue.ttl=re.ttl),re.valuesCsv!==void 0&&(ue.values=A_(re.valuesCsv)),tc.updateRecordSetsByDomain(k.id,ue)},onSuccess:async()=>{Ze.success("Record set updated"),A(!1),T(null),await M.invalidateQueries({queryKey:["dns","records",s?.id]})},onError:re=>Ze.error("Failed to update record set",{description:ve(re)})}),ce=nn({mutationFn:re=>tc.deleteRecordSetsByDomain(re),onSuccess:async()=>{Ze.success("Record set deleted"),await M.invalidateQueries({queryKey:["dns","records",s?.id]})},onError:re=>Ze.error("Failed to delete record set",{description:re?.message??"Unknown error"})});return u.jsxs("div",{className:"space-y-5 p-6",children:[u.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[u.jsx("h1",{className:"text-2xl font-bold",children:"DNS"}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("div",{className:"relative",children:[u.jsx(Pa,{className:"absolute top-2.5 left-2 h-4 w-4 opacity-60"}),u.jsx(xt,{value:e,onChange:re=>r(re.target.value),placeholder:"Search domains…",className:"w-64 pl-8"})]}),u.jsxs(fn,{open:d,onOpenChange:p,children:[u.jsx(zi,{asChild:!0,children:u.jsxs(Fe,{onClick:()=>p(!0),children:[u.jsx(oo,{className:"mr-2 h-4 w-4"}),"Add Domain"]})}),u.jsxs(mn,{className:"sm:max-w-lg",children:[u.jsx(gn,{children:u.jsx(yn,{children:"Add Domain"})}),u.jsx(yr,{...L,children:u.jsxs("form",{className:"space-y-4 pt-2",onSubmit:L.handleSubmit(re=>ee.mutate(re)),children:[u.jsx(yt,{control:L.control,name:"domain_name",render:({field:re})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Domain"}),u.jsx(wt,{children:u.jsx(xt,{...re,placeholder:"example.com"})}),u.jsx(mt,{})]})}),u.jsx(yt,{control:L.control,name:"credential_id",render:({field:re})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Route53 Credential"}),u.jsxs(Rn,{onValueChange:re.onChange,value:re.value,disabled:G.isLoading||(K?.length??0)===0,children:[u.jsx(wt,{children:u.jsx(_n,{children:u.jsx(Tn,{placeholder:G.isLoading?"Loading…":(K?.length??0)===0?"No Route53 credentials found":"Select credential"})})}),u.jsx($n,{children:(K??[]).map(ue=>u.jsx(jt,{value:ue.id,children:D3(ue)},ue.id))})]}),G.error&&u.jsx("p",{className:"text-destructive text-xs",children:"Failed to load credentials."}),u.jsx(mt,{})]})}),u.jsx(yt,{control:L.control,name:"zone_id",render:({field:re})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Zone ID (optional)"}),u.jsx(wt,{children:u.jsx(xt,{...re,placeholder:"/hostedzone/Z123…"})}),u.jsx(mt,{})]})}),u.jsxs(Sn,{className:"gap-2",children:[u.jsx(Fe,{type:"button",variant:"outline",onClick:()=>p(!1),children:"Cancel"}),u.jsxs(Fe,{type:"submit",disabled:ee.isPending,children:[ee.isPending&&u.jsx(Ds,{className:"mr-2 h-4 w-4 animate-spin"}),"Create"]})]})]})})]})]})]})]}),u.jsx("div",{children:u.jsxs(ha,{className:"p-3 md:col-span-5",children:[u.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[u.jsx("div",{className:"text-sm font-semibold",children:"Domains"}),I.isFetching&&u.jsx(Ds,{className:"h-4 w-4 animate-spin"})]}),u.jsx("div",{className:"max-h-[60vh] overflow-auto rounded-md border",children:u.jsxs("table",{className:"min-w-full text-sm",children:[u.jsx("thead",{className:"bg-muted/40 text-xs tracking-wide uppercase",children:u.jsxs("tr",{children:[u.jsx("th",{className:"px-3 py-2 text-left",children:"Domain"}),u.jsx("th",{className:"px-3 py-2 text-left",children:"Zone"}),u.jsx("th",{className:"px-3 py-2 text-left",children:"Status"}),u.jsx("th",{className:"px-3 py-2 text-right",children:"Actions"})]})}),u.jsxs("tbody",{children:[(X??[]).map(re=>u.jsxs("tr",{className:`hover:bg-muted/30 border-t ${s?.id===re.id?"bg-muted/40":""}`,onClick:()=>o(re),children:[u.jsx("td",{className:"cursor-pointer px-3 py-2 font-medium",children:re.domain_name}),u.jsx("td",{className:"px-3 py-2",children:re.zone_id||"—"}),u.jsx("td",{className:"px-3 py-2",children:u.jsx(vT,{s:re.status})}),u.jsx("td",{className:"px-3 py-2",children:u.jsxs("div",{className:"flex items-center justify-end gap-2",children:[u.jsx(Fe,{size:"icon",variant:"ghost",onClick:()=>Q(re),children:u.jsx(pu,{className:"h-4 w-4"})}),u.jsxs(rC,{children:[u.jsx(sC,{asChild:!0,children:u.jsx(Fe,{size:"icon",variant:"ghost",onClick:ue=>ue.stopPropagation(),children:u.jsx(Ib,{className:"h-4 w-4"})})}),u.jsxs(iC,{children:[u.jsxs(aC,{children:[u.jsxs(lC,{children:["Delete “",re.domain_name,"”?"]}),u.jsx(cC,{children:"This deletes the domain metadata. External DNS records are not touched."})]}),u.jsxs(oC,{children:[u.jsx(dC,{children:"Cancel"}),u.jsx(uC,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>de.mutate(re.id),children:"Delete"})]})]})]})]})})]},re.id)),(!X||X.length===0)&&u.jsx("tr",{children:u.jsx("td",{colSpan:4,className:"text-muted-foreground px-3 py-8 text-center",children:"No domains yet."})})]})]})})]})}),u.jsx("div",{children:u.jsxs(ha,{className:"p-3 md:col-span-7",children:[u.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[u.jsxs("div",{className:"text-sm font-semibold",children:["Records ",s?`— ${s.domain_name}`:""]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(vT,{s:s?.status}),u.jsxs(fn,{open:b,onOpenChange:S,children:[u.jsx(zi,{asChild:!0,children:u.jsxs(Fe,{disabled:!s,children:[u.jsx(oo,{className:"mr-2 h-4 w-4"}),"Add Record"]})}),u.jsxs(mn,{className:"sm:max-w-xl",children:[u.jsx(gn,{children:u.jsx(yn,{children:"Add Record"})}),u.jsx(yr,{...je,children:u.jsxs("form",{className:"space-y-4 pt-2",onSubmit:je.handleSubmit(re=>le.mutate(re)),children:[u.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[u.jsx(yt,{control:je.control,name:"name",render:({field:re})=>u.jsxs(lt,{className:"md:col-span-1",children:[u.jsx(ct,{children:"Name"}),u.jsx(wt,{children:u.jsx(xt,{...re,placeholder:"endpoint (or @)"})}),u.jsx(mt,{})]})}),u.jsx(yt,{control:je.control,name:"type",render:({field:re})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Type"}),u.jsxs(Rn,{onValueChange:re.onChange,defaultValue:re.value,children:[u.jsx(wt,{children:u.jsx(_n,{children:u.jsx(Tn,{})})}),u.jsx($n,{children:O_.map(ue=>u.jsx(jt,{value:ue,children:ue},ue))})]}),u.jsx(mt,{})]})}),u.jsx(yt,{control:je.control,name:"ttl",render:({field:re})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"TTL (sec, optional)"}),u.jsx(wt,{children:u.jsx(xt,{type:"number",value:re.value,onChange:ue=>re.onChange(ue.target.value===""?void 0:Number(ue.target.value)),placeholder:"300"})}),u.jsx(mt,{})]})})]}),u.jsx(yt,{control:je.control,name:"valuesCsv",render:({field:re})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Values (comma-separated)"}),u.jsx(wt,{children:u.jsx(hu,{...re,rows:3,placeholder:'e.g. 10.0.30.1, 10.0.30.2 or "v=spf1 ~all"',className:"font-mono"})}),u.jsx(mt,{})]})}),u.jsxs(Sn,{className:"gap-2",children:[u.jsx(Fe,{variant:"outline",type:"button",onClick:()=>S(!1),children:"Cancel"}),u.jsxs(Fe,{type:"submit",disabled:le.isPending,children:[le.isPending&&u.jsx(Ds,{className:"mr-2 h-4 w-4 animate-spin"}),"Create"]})]})]})})]})]})]})]}),u.jsxs("div",{className:"overflow-x-auto rounded-md border",children:[q.isLoading&&u.jsxs("div",{className:"flex items-center gap-2 p-4",children:[u.jsx(Ds,{className:"h-4 w-4 animate-spin"})," Loading records…"]}),!q.isLoading&&u.jsxs("table",{className:"min-w-full text-sm",children:[u.jsx("thead",{className:"bg-muted/40 text-xs tracking-wide uppercase",children:u.jsxs("tr",{children:[u.jsx("th",{className:"px-3 py-2 text-left",children:"Name"}),u.jsx("th",{className:"px-3 py-2 text-left",children:"Type"}),u.jsx("th",{className:"px-3 py-2 text-left",children:"TTL"}),u.jsx("th",{className:"px-3 py-2 text-left",children:"Values"}),u.jsx("th",{className:"px-3 py-2 text-left",children:"Status"}),u.jsx("th",{className:"px-3 py-2 text-left",children:"Owner"}),u.jsx("th",{className:"px-3 py-2 text-right",children:"Actions"})]})}),u.jsxs("tbody",{children:[(q.data??[]).map(re=>{const ue=re.values||[];return u.jsxs("tr",{className:"border-t",children:[u.jsx("td",{className:"px-3 py-2 font-medium",children:re.name||"@"}),u.jsx("td",{className:"px-3 py-2",children:re.type}),u.jsx("td",{className:"px-3 py-2",children:re.ttl??"—"}),u.jsx("td",{className:"px-3 py-2",children:u.jsx("div",{className:"max-w-[420px] truncate",title:(ue||[]).join(", "),children:(ue||[]).join(", ")})}),u.jsx("td",{className:"px-3 py-2",children:u.jsx(vT,{s:re.status})}),u.jsx("td",{className:"px-3 py-2",children:re.owner}),u.jsx("td",{className:"px-3 py-2",children:u.jsxs("div",{className:"flex items-center justify-end gap-2",children:[u.jsx(Fe,{size:"icon",variant:"ghost",onClick:()=>Ce(re),children:u.jsx(pu,{className:"h-4 w-4"})}),u.jsxs(rC,{children:[u.jsx(sC,{asChild:!0,children:u.jsx(Fe,{size:"icon",variant:"ghost",children:u.jsx(Ib,{className:"h-4 w-4"})})}),u.jsxs(iC,{children:[u.jsxs(aC,{children:[u.jsxs(lC,{children:["Delete “",re.name||"@"," ",re.type,"”?"]}),u.jsx(cC,{children:"This removes the record set from your project. Your worker does not delete it from the DNS provider right now."})]}),u.jsxs(oC,{children:[u.jsx(dC,{children:"Cancel"}),u.jsx(uC,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>ce.mutate(re.id),children:"Delete"})]})]})]}),u.jsxs(m$,{children:[u.jsx(g$,{asChild:!0,children:u.jsx(Fe,{variant:"ghost",size:"icon",children:u.jsx(z_,{className:"h-4 w-4"})})}),u.jsxs(y$,{align:"end",children:[u.jsx(jp,{onClick:()=>Ce(re),children:"Edit"}),u.jsx(jp,{className:"text-destructive",onClick:()=>ce.mutate(re.id),children:"Delete"})]})]})]})})]},re.id)}),(!q.data||q.data.length===0)&&u.jsx("tr",{children:u.jsx("td",{colSpan:7,className:"text-muted-foreground px-3 py-8 text-center",children:s?"No records yet — add one.":"Select a domain to view records."})})]})]})]})]})}),u.jsx(fn,{open:m,onOpenChange:g,children:u.jsxs(mn,{className:"sm:max-w-lg",children:[u.jsx(gn,{children:u.jsx(yn,{children:"Edit Domain"})}),u.jsx(yr,{...oe,children:u.jsxs("form",{className:"space-y-4 pt-2",onSubmit:oe.handleSubmit(re=>ne.mutate(re)),children:[u.jsx(yt,{control:oe.control,name:"domain_name",render:({field:re})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Domain"}),u.jsx(wt,{children:u.jsx(xt,{...re,placeholder:"example.com"})}),u.jsx(mt,{})]})}),u.jsx(yt,{control:oe.control,name:"credential_id",render:({field:re})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Route53 Credential"}),u.jsxs(Rn,{onValueChange:re.onChange,value:re.value??"",disabled:G.isLoading||(K?.length??0)===0,children:[u.jsx(wt,{children:u.jsx(_n,{children:u.jsx(Tn,{placeholder:G.isLoading?"Loading…":(K?.length??0)===0?"No Route53 credentials found":"Select credential"})})}),u.jsx($n,{children:(K??[]).map(ue=>u.jsx(jt,{value:ue.id,children:D3(ue)},ue.id))})]}),G.error&&u.jsx("p",{className:"text-destructive text-xs",children:"Failed to load credentials."}),u.jsx(mt,{})]})}),u.jsx(yt,{control:oe.control,name:"zone_id",render:({field:re})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Zone ID"}),u.jsx(wt,{children:u.jsx(xt,{...re,placeholder:"/hostedzone/Z123…"})}),u.jsx(mt,{})]})}),u.jsxs(Sn,{className:"gap-2",children:[u.jsx(Fe,{variant:"outline",type:"button",onClick:()=>g(!1),children:"Cancel"}),u.jsxs(Fe,{type:"submit",disabled:ne.isPending,children:[ne.isPending&&u.jsx(Ds,{className:"mr-2 h-4 w-4 animate-spin"}),"Save Changes"]})]})]})})]})}),u.jsx(fn,{open:j,onOpenChange:A,children:u.jsxs(mn,{className:"sm:max-w-xl",children:[u.jsx(gn,{children:u.jsx(yn,{children:"Edit Record"})}),u.jsx(yr,{...be,children:u.jsxs("form",{className:"space-y-4 pt-2",onSubmit:be.handleSubmit(re=>Ke.mutate(re)),children:[u.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[u.jsx(yt,{control:be.control,name:"name",render:({field:re})=>u.jsxs(lt,{className:"md:col-span-1",children:[u.jsx(ct,{children:"Name"}),u.jsx(wt,{children:u.jsx(xt,{...re})}),u.jsx(mt,{})]})}),u.jsx(yt,{control:be.control,name:"type",render:({field:re})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Type"}),u.jsxs(Rn,{onValueChange:re.onChange,defaultValue:re.value,children:[u.jsx(wt,{children:u.jsx(_n,{children:u.jsx(Tn,{})})}),u.jsx($n,{children:O_.map(ue=>u.jsx(jt,{value:ue,children:ue},ue))})]}),u.jsx(mt,{})]})}),u.jsx(yt,{control:be.control,name:"ttl",render:({field:re})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"TTL (sec, optional)"}),u.jsx(wt,{children:u.jsx(xt,{type:"number",value:re.value,onChange:ue=>re.onChange(ue.target.value===""?void 0:Number(ue.target.value)),placeholder:"300"})}),u.jsx(mt,{})]})})]}),u.jsx(yt,{control:be.control,name:"valuesCsv",render:({field:re})=>u.jsxs(lt,{children:[u.jsx(ct,{children:"Values (comma-separated)"}),u.jsx(wt,{children:u.jsx(hu,{...re,rows:3,className:"font-mono"})}),u.jsx(mt,{})]})}),u.jsxs(Sn,{className:"gap-2",children:[u.jsx(Fe,{variant:"outline",type:"button",onClick:()=>A(!1),children:"Cancel"}),u.jsxs(Fe,{type:"submit",disabled:Ke.isPending,children:[Ke.isPending&&u.jsx(Ds,{className:"mr-2 h-4 w-4 animate-spin"}),"Save Changes"]})]})]})})]})})]})};var P3={};var M3;function qbe(){return M3||(M3=1,(()=>{var e,r,s={557:(p,m,g)=>{const b=globalThis,S=b.ShadowRoot&&(b.ShadyCSS===void 0||b.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,j=Symbol(),A=new WeakMap;class k{constructor(n,i,l){if(this._$cssResult$=!0,l!==j)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=n,this.t=i}get styleSheet(){let n=this.o;const i=this.t;if(S&&n===void 0){const l=i!==void 0&&i.length===1;l&&(n=A.get(i)),n===void 0&&((this.o=n=new CSSStyleSheet).replaceSync(this.cssText),l&&A.set(i,n))}return n}toString(){return this.cssText}}const T=t=>new k(typeof t=="string"?t:t+"",void 0,j),M=(t,...n)=>{const i=t.length===1?t[0]:n.reduce(((l,h,v)=>l+(x=>{if(x._$cssResult$===!0)return x.cssText;if(typeof x=="number")return x;throw Error("Value passed to 'css' function must be a 'css' function result: "+x+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(h)+t[v+1]),t[0]);return new k(i,t,j)},I=(t,n)=>{if(S)t.adoptedStyleSheets=n.map((i=>i instanceof CSSStyleSheet?i:i.styleSheet));else for(const i of n){const l=document.createElement("style"),h=b.litNonce;h!==void 0&&l.setAttribute("nonce",h),l.textContent=i.cssText,t.appendChild(l)}},q=S?t=>t:t=>t instanceof CSSStyleSheet?(n=>{let i="";for(const l of n.cssRules)i+=l.cssText;return T(i)})(t):t,{is:G,defineProperty:K,getOwnPropertyDescriptor:X,getOwnPropertyNames:L,getOwnPropertySymbols:ee,getPrototypeOf:oe}=Object,Q=globalThis,ne=Q.trustedTypes,de=ne?ne.emptyScript:"",je=Q.reactiveElementPolyfillSupport,ve=(t,n)=>t,le={toAttribute(t,n){switch(n){case Boolean:t=t?de:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,n){let i=t;switch(n){case Boolean:i=t!==null;break;case Number:i=t===null?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch{i=null}}return i}},be=(t,n)=>!G(t,n),Ce={attribute:!0,type:String,converter:le,reflect:!1,hasChanged:be};Symbol.metadata??=Symbol("metadata"),Q.litPropertyMetadata??=new WeakMap;class Ke extends HTMLElement{static addInitializer(n){this._$Ei(),(this.l??=[]).push(n)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(n,i=Ce){if(i.state&&(i.attribute=!1),this._$Ei(),this.elementProperties.set(n,i),!i.noAccessor){const l=Symbol(),h=this.getPropertyDescriptor(n,l,i);h!==void 0&&K(this.prototype,n,h)}}static getPropertyDescriptor(n,i,l){const{get:h,set:v}=X(this.prototype,n)??{get(){return this[i]},set(x){this[i]=x}};return{get(){return h?.call(this)},set(x){const w=h?.call(this);v.call(this,x),this.requestUpdate(n,w,l)},configurable:!0,enumerable:!0}}static getPropertyOptions(n){return this.elementProperties.get(n)??Ce}static _$Ei(){if(this.hasOwnProperty(ve("elementProperties")))return;const n=oe(this);n.finalize(),n.l!==void 0&&(this.l=[...n.l]),this.elementProperties=new Map(n.elementProperties)}static finalize(){if(this.hasOwnProperty(ve("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ve("properties"))){const i=this.properties,l=[...L(i),...ee(i)];for(const h of l)this.createProperty(h,i[h])}const n=this[Symbol.metadata];if(n!==null){const i=litPropertyMetadata.get(n);if(i!==void 0)for(const[l,h]of i)this.elementProperties.set(l,h)}this._$Eh=new Map;for(const[i,l]of this.elementProperties){const h=this._$Eu(i,l);h!==void 0&&this._$Eh.set(h,i)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(n){const i=[];if(Array.isArray(n)){const l=new Set(n.flat(1/0).reverse());for(const h of l)i.unshift(q(h))}else n!==void 0&&i.push(q(n));return i}static _$Eu(n,i){const l=i.attribute;return l===!1?void 0:typeof l=="string"?l:typeof n=="string"?n.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((n=>this.enableUpdating=n)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((n=>n(this)))}addController(n){(this._$EO??=new Set).add(n),this.renderRoot!==void 0&&this.isConnected&&n.hostConnected?.()}removeController(n){this._$EO?.delete(n)}_$E_(){const n=new Map,i=this.constructor.elementProperties;for(const l of i.keys())this.hasOwnProperty(l)&&(n.set(l,this[l]),delete this[l]);n.size>0&&(this._$Ep=n)}createRenderRoot(){const n=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return I(n,this.constructor.elementStyles),n}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((n=>n.hostConnected?.()))}enableUpdating(n){}disconnectedCallback(){this._$EO?.forEach((n=>n.hostDisconnected?.()))}attributeChangedCallback(n,i,l){this._$AK(n,l)}_$EC(n,i){const l=this.constructor.elementProperties.get(n),h=this.constructor._$Eu(n,l);if(h!==void 0&&l.reflect===!0){const v=(l.converter?.toAttribute!==void 0?l.converter:le).toAttribute(i,l.type);this._$Em=n,v==null?this.removeAttribute(h):this.setAttribute(h,v),this._$Em=null}}_$AK(n,i){const l=this.constructor,h=l._$Eh.get(n);if(h!==void 0&&this._$Em!==h){const v=l.getPropertyOptions(h),x=typeof v.converter=="function"?{fromAttribute:v.converter}:v.converter?.fromAttribute!==void 0?v.converter:le;this._$Em=h,this[h]=x.fromAttribute(i,v.type),this._$Em=null}}requestUpdate(n,i,l){if(n!==void 0){if(l??=this.constructor.getPropertyOptions(n),!(l.hasChanged??be)(this[n],i))return;this.P(n,i,l)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(n,i,l){this._$AL.has(n)||this._$AL.set(n,i),l.reflect===!0&&this._$Em!==n&&(this._$Ej??=new Set).add(n)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(i){Promise.reject(i)}const n=this.scheduleUpdate();return n!=null&&await n,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[h,v]of this._$Ep)this[h]=v;this._$Ep=void 0}const l=this.constructor.elementProperties;if(l.size>0)for(const[h,v]of l)v.wrapped!==!0||this._$AL.has(h)||this[h]===void 0||this.P(h,this[h],v)}let n=!1;const i=this._$AL;try{n=this.shouldUpdate(i),n?(this.willUpdate(i),this._$EO?.forEach((l=>l.hostUpdate?.())),this.update(i)):this._$EU()}catch(l){throw n=!1,this._$EU(),l}n&&this._$AE(i)}willUpdate(n){}_$AE(n){this._$EO?.forEach((i=>i.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(n)),this.updated(n)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(n){return!0}update(n){this._$Ej&&=this._$Ej.forEach((i=>this._$EC(i,this[i]))),this._$EU()}updated(n){}firstUpdated(n){}}Ke.elementStyles=[],Ke.shadowRootOptions={mode:"open"},Ke[ve("elementProperties")]=new Map,Ke[ve("finalized")]=new Map,je?.({ReactiveElement:Ke}),(Q.reactiveElementVersions??=[]).push("2.0.4");const ce=globalThis,re=ce.trustedTypes,ue=re?re.createPolicy("lit-html",{createHTML:t=>t}):void 0,_e="$lit$",fe=`lit$${Math.random().toFixed(9).slice(2)}$`,He="?"+fe,Oe=`<${He}>`,ke=document,Ve=()=>ke.createComment(""),ie=t=>t===null||typeof t!="object"&&typeof t!="function",De=Array.isArray,Le=t=>De(t)||typeof t?.[Symbol.iterator]=="function",tt=`[ \f\r]`,ft=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ot=/-->/g,Ft=/>/g,kt=RegExp(`>|${tt}(?:([^\\s"'>=/]+)(${tt}*=${tt}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`,"g"),Jt=/'/g,Le=/"/g,Lt=/^(?:script|style|textarea|title)$/i,Rt=t=>(n,...i)=>({_$litType$:t,strings:n,values:i}),V=Rt(1),Nn=Symbol.for("lit-noChange"),cn=Symbol.for("lit-nothing"),ve=new WeakMap,De=ke.createTreeWalker(ke,129);function Ge(t,n){if(!Ne(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return ue!==void 0?ue.createHTML(n):n}const D=(t,n)=>{const i=t.length-1,l=[];let h,v=n===2?"":n===3?"":"",x=ft;for(let w=0;w"?(x=h??ft,_=-1):N[1]===void 0?_=-2:(_=x.lastIndex-N[2].length,$=N[1],x=N[3]===void 0?kt:N[3]==='"'?Le:Jt):x===Le||x===Jt?x=kt:x===Ot||x===Ft?x=ft:(x=kt,h=void 0);const U=x===kt&&t[w+1].startsWith("/>")?" ":"";v+=x===ft?C+Oe:_>=0?(l.push($),C.slice(0,_)+_e+C.slice(_)+fe+U):C+fe+(_===-2?w:U)}return[Ge(t,v+(t[i]||"")+(n===2?"":n===3?"":"")),l]};class L{constructor({strings:n,_$litType$:i},l){let h;this.parts=[];let v=0,x=0;const w=n.length-1,C=this.parts,[$,N]=D(n,i);if(this.el=L.createElement($,l),De.currentNode=this.el.content,i===2||i===3){const _=this.el.content.firstChild;_.replaceWith(..._.childNodes)}for(;(h=De.nextNode())!==null&&C.length0){h.textContent=re?re.emptyScript:"";for(let U=0;U2||l[0]!==""||l[1]!==""?(this._$AH=Array(l.length-1).fill(new String),this.strings=l):this._$AH=cn}_$AI(n,i=this,l,h){const v=this.strings;let x=!1;if(v===void 0)n=H(this,n,i,0),x=!ie(n)||n!==this._$AH&&n!==Nn,x&&(this._$AH=n);else{const w=n;let C,$;for(n=v[0],C=0;C{const x=v?.renderBefore??h;let w=x._$litPart$;if(w===void 0){const C=v?.renderBefore??null;x._$litPart$=w=new we(h.insertBefore(Ve(),C),C,void 0,v??{})}return w._$AI(l),w})(i,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return Nn}}Ht._$litElement$=!0,Ht.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:Ht});const wi=globalThis.litElementPolyfillSupport;wi?.({LitElement:Ht});function Xr(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}(globalThis.litElementVersions??=[]).push("4.1.0");let fa={async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const ho=/[&<>"']/,Ma=new RegExp(ho.source,"g"),cc=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,xu=new RegExp(cc.source,"g"),uc={"&":"&","<":"<",">":">",'"':""","'":"'"},ma=t=>uc[t];function zt(t,n){if(n){if(ho.test(t))return t.replace(Ma,ma)}else if(cc.test(t))return t.replace(xu,ma);return t}const vr=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function Yr(t){return t.replace(vr,((n,i)=>(i=i.toLowerCase())==="colon"?":":i.charAt(0)==="#"?i.charAt(1)==="x"?String.fromCharCode(parseInt(i.substring(2),16)):String.fromCharCode(+i.substring(1)):""))}const Os=/(^|[^\[])\^/g;function Dn(t,n){t=typeof t=="string"?t:t.source,n=n||"";const i={replace:(l,h)=>(h=(h=h.source||h).replace(Os,"$1"),t=t.replace(l,h),i),getRegex:()=>new RegExp(t,n)};return i}const Er=/[^\w:]/g,Ys=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function ll(t,n,i){if(t){let l;try{l=decodeURIComponent(Yr(i)).replace(Er,"").toLowerCase()}catch{return null}if(l.indexOf("javascript:")===0||l.indexOf("vbscript:")===0||l.indexOf("data:")===0)return null}n&&!Ys.test(i)&&(i=(function(l,h){ys[" "+l]||(Zs.test(l)?ys[" "+l]=l+"/":ys[" "+l]=ya(l,"/",!0)),l=ys[" "+l];const v=l.indexOf(":")===-1;return h.substring(0,2)==="//"?v?h:l.replace(bu,"$1")+h:h.charAt(0)==="/"?v?h:l.replace(ga,"$1")+h:l+h})(n,i));try{i=encodeURI(i).replace(/%25/g,"%")}catch{return null}return i}const ys={},Zs=/^[^:]+:\/*[^/]*$/,bu=/^([^:]+:)[\s\S]*$/,ga=/^([^:]+:\/*[^/]*)[\s\S]*$/,wu={exec:function(){}};function Ig(t,n){const i=t.replace(/\|/g,((h,v,x)=>{let w=!1,C=v;for(;--C>=0&&x[C]==="\\";)w=!w;return w?"|":" |"})).split(/ \|/);let l=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),i.length>n)i.splice(n);else for(;i.length1;)1&n&&(i+=t),n>>=1,t+=t;return i+t}function Ps(t,n,i,l){const h=n.href,v=n.title?zt(n.title):null,x=t[1].replace(/\\([\[\]])/g,"$1");if(t[0].charAt(0)!=="!"){l.state.inLink=!0;const w={type:"link",raw:i,href:h,title:v,text:x,tokens:l.inlineTokens(x)};return l.state.inLink=!1,w}return{type:"image",raw:i,href:h,title:v,text:zt(x)}}class cl{constructor(n){this.options=n||fa}space(n){const i=this.rules.block.newline.exec(n);if(i&&i[0].length>0)return{type:"space",raw:i[0]}}code(n){const i=this.rules.block.code.exec(n);if(i){const l=i[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:i[0],codeBlockStyle:"indented",text:this.options.pedantic?l:ya(l,` +\f\r"'\`<>=]|("|')|))|$)`,"g"),Jt=/'/g,ze=/"/g,zt=/^(?:script|style|textarea|title)$/i,Rt=t=>(n,...i)=>({_$litType$:t,strings:n,values:i}),V=Rt(1),Nn=Symbol.for("lit-noChange"),cn=Symbol.for("lit-nothing"),xe=new WeakMap,Ne=ke.createTreeWalker(ke,129);function Ge(t,n){if(!De(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return ue!==void 0?ue.createHTML(n):n}const D=(t,n)=>{const i=t.length-1,l=[];let h,v=n===2?"":n===3?"":"",x=ft;for(let w=0;w"?(x=h??ft,_=-1):N[1]===void 0?_=-2:(_=x.lastIndex-N[2].length,$=N[1],x=N[3]===void 0?kt:N[3]==='"'?ze:Jt):x===ze||x===Jt?x=kt:x===Ot||x===Ft?x=ft:(x=kt,h=void 0);const U=x===kt&&t[w+1].startsWith("/>")?" ":"";v+=x===ft?C+Oe:_>=0?(l.push($),C.slice(0,_)+_e+C.slice(_)+fe+U):C+fe+(_===-2?w:U)}return[Ge(t,v+(t[i]||"")+(n===2?"":n===3?"":"")),l]};class z{constructor({strings:n,_$litType$:i},l){let h;this.parts=[];let v=0,x=0;const w=n.length-1,C=this.parts,[$,N]=D(n,i);if(this.el=z.createElement($,l),Ne.currentNode=this.el.content,i===2||i===3){const _=this.el.content.firstChild;_.replaceWith(..._.childNodes)}for(;(h=Ne.nextNode())!==null&&C.length0){h.textContent=re?re.emptyScript:"";for(let U=0;U2||l[0]!==""||l[1]!==""?(this._$AH=Array(l.length-1).fill(new String),this.strings=l):this._$AH=cn}_$AI(n,i=this,l,h){const v=this.strings;let x=!1;if(v===void 0)n=H(this,n,i,0),x=!ie(n)||n!==this._$AH&&n!==Nn,x&&(this._$AH=n);else{const w=n;let C,$;for(n=v[0],C=0;C{const x=v?.renderBefore??h;let w=x._$litPart$;if(w===void 0){const C=v?.renderBefore??null;x._$litPart$=w=new we(h.insertBefore(Ve(),C),C,void 0,v??{})}return w._$AI(l),w})(i,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this.o?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this.o?.setConnected(!1)}render(){return Nn}}Ht._$litElement$=!0,Ht.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:Ht});const wi=globalThis.litElementPolyfillSupport;wi?.({LitElement:Ht});function Xr(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}(globalThis.litElementVersions??=[]).push("4.1.0");let fa={async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const uo=/[&<>"']/,Ma=new RegExp(uo.source,"g"),cc=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,xu=new RegExp(cc.source,"g"),uc={"&":"&","<":"<",">":">",'"':""","'":"'"},ma=t=>uc[t];function Lt(t,n){if(n){if(uo.test(t))return t.replace(Ma,ma)}else if(cc.test(t))return t.replace(xu,ma);return t}const vr=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function Yr(t){return t.replace(vr,((n,i)=>(i=i.toLowerCase())==="colon"?":":i.charAt(0)==="#"?i.charAt(1)==="x"?String.fromCharCode(parseInt(i.substring(2),16)):String.fromCharCode(+i.substring(1)):""))}const Os=/(^|[^\[])\^/g;function Dn(t,n){t=typeof t=="string"?t:t.source,n=n||"";const i={replace:(l,h)=>(h=(h=h.source||h).replace(Os,"$1"),t=t.replace(l,h),i),getRegex:()=>new RegExp(t,n)};return i}const Er=/[^\w:]/g,Ys=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function ll(t,n,i){if(t){let l;try{l=decodeURIComponent(Yr(i)).replace(Er,"").toLowerCase()}catch{return null}if(l.indexOf("javascript:")===0||l.indexOf("vbscript:")===0||l.indexOf("data:")===0)return null}n&&!Ys.test(i)&&(i=(function(l,h){gs[" "+l]||(Zs.test(l)?gs[" "+l]=l+"/":gs[" "+l]=ya(l,"/",!0)),l=gs[" "+l];const v=l.indexOf(":")===-1;return h.substring(0,2)==="//"?v?h:l.replace(bu,"$1")+h:h.charAt(0)==="/"?v?h:l.replace(ga,"$1")+h:l+h})(n,i));try{i=encodeURI(i).replace(/%25/g,"%")}catch{return null}return i}const gs={},Zs=/^[^:]+:\/*[^/]*$/,bu=/^([^:]+:)[\s\S]*$/,ga=/^([^:]+:\/*[^/]*)[\s\S]*$/,wu={exec:function(){}};function Lg(t,n){const i=t.replace(/\|/g,((h,v,x)=>{let w=!1,C=v;for(;--C>=0&&x[C]==="\\";)w=!w;return w?"|":" |"})).split(/ \|/);let l=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),i.length>n)i.splice(n);else for(;i.length1;)1&n&&(i+=t),n>>=1,t+=t;return i+t}function Ps(t,n,i,l){const h=n.href,v=n.title?Lt(n.title):null,x=t[1].replace(/\\([\[\]])/g,"$1");if(t[0].charAt(0)!=="!"){l.state.inLink=!0;const w={type:"link",raw:i,href:h,title:v,text:x,tokens:l.inlineTokens(x)};return l.state.inLink=!1,w}return{type:"image",raw:i,href:h,title:v,text:Lt(x)}}class cl{constructor(n){this.options=n||fa}space(n){const i=this.rules.block.newline.exec(n);if(i&&i[0].length>0)return{type:"space",raw:i[0]}}code(n){const i=this.rules.block.code.exec(n);if(i){const l=i[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:i[0],codeBlockStyle:"indented",text:this.options.pedantic?l:ya(l,` `)}}}fences(n){const i=this.rules.block.fences.exec(n);if(i){const l=i[0],h=(function(v,x){const w=v.match(/^(\s+)(?:```)/);if(w===null)return x;const C=w[1];return x.split(` `).map(($=>{const N=$.match(/^\s+/);if(N===null)return $;const[_]=N;return _.length>=C.length?$.slice(C.length):$})).join(` `)})(l,i[3]||"");return{type:"code",raw:l,lang:i[2]?i[2].trim().replace(this.rules.inline._escapes,"$1"):i[2],text:h}}}heading(n){const i=this.rules.block.heading.exec(n);if(i){let l=i[2].trim();if(/#$/.test(l)){const h=ya(l,"#");this.options.pedantic?l=h.trim():h&&!/ $/.test(h)||(l=h.trim())}return{type:"heading",raw:i[0],depth:i[1].length,text:l,tokens:this.lexer.inline(l)}}}hr(n){const i=this.rules.block.hr.exec(n);if(i)return{type:"hr",raw:i[0]}}blockquote(n){const i=this.rules.block.blockquote.exec(n);if(i){const l=i[0].replace(/^ *>[ \t]?/gm,""),h=this.lexer.state.top;this.lexer.state.top=!0;const v=this.lexer.blockTokens(l);return this.lexer.state.top=h,{type:"blockquote",raw:i[0],tokens:v,text:l}}}list(n){let i=this.rules.block.list.exec(n);if(i){let l,h,v,x,w,C,$,N,_,F,U,J,Y=i[1].trim();const Z=Y.length>1,P={type:"list",raw:"",ordered:Z,start:Z?+Y.slice(0,-1):"",loose:!1,items:[]};Y=Z?`\\d{1,9}\\${Y.slice(-1)}`:`\\${Y}`,this.options.pedantic&&(Y=Z?Y:"[*+-]");const se=new RegExp(`^( {0,3}${Y})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;n&&(J=!1,i=se.exec(n))&&!this.rules.block.hr.test(n);){if(l=i[0],n=n.substring(l.length),N=i[2].split(` @@ -89,9 +89,9 @@ For more information, see https://radix-ui.com/primitives/docs/components/alert- `,1)[0],_=F,this.options.pedantic&&(_=_.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!pe.test(_))&&!Te.test(_)&&!he.test(_)&&!ge.test(n);){if(_.search(/[^ ]/)>=x||!_.trim())U+=` `+_.slice(x);else{if(C||N.search(/[^ ]/)>=4||pe.test(N)||Te.test(N)||ge.test(N))break;U+=` `+_}C||_.trim()||(C=!0),l+=F+` -`,n=n.substring(F.length+1),N=_.slice(x)}}P.loose||($?P.loose=!0:/\n *\n *$/.test(l)&&($=!0)),this.options.gfm&&(h=/^\[[ xX]\] /.exec(U),h&&(v=h[0]!=="[ ] ",U=U.replace(/^\[[ xX]\] +/,""))),P.items.push({type:"list_item",raw:l,task:!!h,checked:v,loose:!1,text:U}),P.raw+=l}P.items[P.items.length-1].raw=l.trimRight(),P.items[P.items.length-1].text=U.trimRight(),P.raw=P.raw.trimRight();const ae=P.items.length;for(w=0;wpe.type==="space")),ge=he.length>0&&he.some((pe=>/\n.*\n/.test(pe.raw)));P.loose=ge}if(P.loose)for(w=0;w$/,"$1").replace(this.rules.inline._escapes,"$1"):"",v=i[3]?i[3].substring(1,i[3].length-1).replace(this.rules.inline._escapes,"$1"):i[3];return{type:"def",tag:l,raw:i[0],href:h,title:v}}}table(n){const i=this.rules.block.table.exec(n);if(i){const l={type:"table",header:Ig(i[1]).map((h=>({text:h}))),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:i[3]&&i[3].trim()?i[3].replace(/\n[ \t]*$/,"").split(` -`):[]};if(l.header.length===l.align.length){l.raw=i[0];let h,v,x,w,C=l.align.length;for(h=0;h({text:$})));for(C=l.header.length,v=0;v/i.test(i[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(i[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(i[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:i[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):zt(i[0]):i[0]}}link(n){const i=this.rules.inline.link.exec(n);if(i){const l=i[2].trim();if(!this.options.pedantic&&/^$/.test(l))return;const x=ya(l.slice(0,-1),"\\");if((l.length-x.length)%2==0)return}else{const x=(function(w,C){if(w.indexOf(C[1])===-1)return-1;const $=w.length;let N=0,_=0;for(;_<$;_++)if(w[_]==="\\")_++;else if(w[_]===C[0])N++;else if(w[_]===C[1]&&(N--,N<0))return _;return-1})(i[2],"()");if(x>-1){const w=(i[0].indexOf("!")===0?5:4)+i[1].length+x;i[2]=i[2].substring(0,x),i[0]=i[0].substring(0,w).trim(),i[3]=""}}let h=i[2],v="";if(this.options.pedantic){const x=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(h);x&&(h=x[1],v=x[3])}else v=i[3]?i[3].slice(1,-1):"";return h=h.trim(),/^$/.test(l)?h.slice(1):h.slice(1,-1)),Ps(i,{href:h&&h.replace(this.rules.inline._escapes,"$1"),title:v&&v.replace(this.rules.inline._escapes,"$1")},i[0],this.lexer)}}reflink(n,i){let l;if((l=this.rules.inline.reflink.exec(n))||(l=this.rules.inline.nolink.exec(n))){let h=(l[2]||l[1]).replace(/\s+/g," ");if(h=i[h.toLowerCase()],!h){const v=l[0].charAt(0);return{type:"text",raw:v,text:v}}return Ps(l,h,l[0],this.lexer)}}emStrong(n,i,l=""){let h=this.rules.inline.emStrong.lDelim.exec(n);if(!h||h[3]&&l.match(/[\p{L}\p{N}]/u))return;const v=h[1]||h[2]||"";if(!v||v&&(l===""||this.rules.inline.punctuation.exec(l))){const x=h[0].length-1;let w,C,$=x,N=0;const _=h[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(_.lastIndex=0,i=i.slice(-1*n.length+x);(h=_.exec(i))!=null;){if(w=h[1]||h[2]||h[3]||h[4]||h[5]||h[6],!w)continue;if(C=w.length,h[3]||h[4]){$+=C;continue}if((h[5]||h[6])&&x%3&&!((x+C)%3)){N+=C;continue}if($-=C,$>0)continue;C=Math.min(C,C+$+N);const F=n.slice(0,x+h.index+(h[0].length-w.length)+C);if(Math.min(x,C)%2){const J=F.slice(1,-1);return{type:"em",raw:F,text:J,tokens:this.lexer.inlineTokens(J)}}const U=F.slice(2,-2);return{type:"strong",raw:F,text:U,tokens:this.lexer.inlineTokens(U)}}}}codespan(n){const i=this.rules.inline.code.exec(n);if(i){let l=i[2].replace(/\n/g," ");const h=/[^ ]/.test(l),v=/^ /.test(l)&&/ $/.test(l);return h&&v&&(l=l.substring(1,l.length-1)),l=zt(l,!0),{type:"codespan",raw:i[0],text:l}}}br(n){const i=this.rules.inline.br.exec(n);if(i)return{type:"br",raw:i[0]}}del(n){const i=this.rules.inline.del.exec(n);if(i)return{type:"del",raw:i[0],text:i[2],tokens:this.lexer.inlineTokens(i[2])}}autolink(n,i){const l=this.rules.inline.autolink.exec(n);if(l){let h,v;return l[2]==="@"?(h=zt(this.options.mangle?i(l[1]):l[1]),v="mailto:"+h):(h=zt(l[1]),v=h),{type:"link",raw:l[0],text:h,href:v,tokens:[{type:"text",raw:h,text:h}]}}}url(n,i){let l;if(l=this.rules.inline.url.exec(n)){let h,v;if(l[2]==="@")h=zt(this.options.mangle?i(l[0]):l[0]),v="mailto:"+h;else{let x;do x=l[0],l[0]=this.rules.inline._backpedal.exec(l[0])[0];while(x!==l[0]);h=zt(l[0]),v=l[1]==="www."?"http://"+l[0]:l[0]}return{type:"link",raw:l[0],text:h,href:v,tokens:[{type:"text",raw:h,text:h}]}}}inlineText(n,i){const l=this.rules.inline.text.exec(n);if(l){let h;return h=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(l[0]):zt(l[0]):l[0]:zt(this.options.smartypants?i(l[0]):l[0]),{type:"text",raw:l[0],text:h}}}}const Gt={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:wu,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};Gt.def=Dn(Gt.def).replace("label",Gt._label).replace("title",Gt._title).getRegex(),Gt.bullet=/(?:[*+-]|\d{1,9}[.)])/,Gt.listItemStart=Dn(/^( *)(bull) */).replace("bull",Gt.bullet).getRegex(),Gt.list=Dn(Gt.list).replace(/bull/g,Gt.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Gt.def.source+")").getRegex(),Gt._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Gt._comment=/|$)/,Gt.html=Dn(Gt.html,"i").replace("comment",Gt._comment).replace("tag",Gt._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Gt.paragraph=Dn(Gt._paragraph).replace("hr",Gt.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Gt._tag).getRegex(),Gt.blockquote=Dn(Gt.blockquote).replace("paragraph",Gt.paragraph).getRegex(),Gt.normal={...Gt},Gt.gfm={...Gt.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},Gt.gfm.table=Dn(Gt.gfm.table).replace("hr",Gt.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Gt._tag).getRegex(),Gt.gfm.paragraph=Dn(Gt._paragraph).replace("hr",Gt.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",Gt.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Gt._tag).getRegex(),Gt.pedantic={...Gt.normal,html:Dn(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Gt._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:wu,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Dn(Gt.normal._paragraph).replace("hr",Gt.hr).replace("heading",` *#{1,6} *[^ +`,n=n.substring(F.length+1),N=_.slice(x)}}P.loose||($?P.loose=!0:/\n *\n *$/.test(l)&&($=!0)),this.options.gfm&&(h=/^\[[ xX]\] /.exec(U),h&&(v=h[0]!=="[ ] ",U=U.replace(/^\[[ xX]\] +/,""))),P.items.push({type:"list_item",raw:l,task:!!h,checked:v,loose:!1,text:U}),P.raw+=l}P.items[P.items.length-1].raw=l.trimRight(),P.items[P.items.length-1].text=U.trimRight(),P.raw=P.raw.trimRight();const ae=P.items.length;for(w=0;wpe.type==="space")),ge=he.length>0&&he.some((pe=>/\n.*\n/.test(pe.raw)));P.loose=ge}if(P.loose)for(w=0;w$/,"$1").replace(this.rules.inline._escapes,"$1"):"",v=i[3]?i[3].substring(1,i[3].length-1).replace(this.rules.inline._escapes,"$1"):i[3];return{type:"def",tag:l,raw:i[0],href:h,title:v}}}table(n){const i=this.rules.block.table.exec(n);if(i){const l={type:"table",header:Lg(i[1]).map((h=>({text:h}))),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:i[3]&&i[3].trim()?i[3].replace(/\n[ \t]*$/,"").split(` +`):[]};if(l.header.length===l.align.length){l.raw=i[0];let h,v,x,w,C=l.align.length;for(h=0;h({text:$})));for(C=l.header.length,v=0;v/i.test(i[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(i[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(i[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:i[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):Lt(i[0]):i[0]}}link(n){const i=this.rules.inline.link.exec(n);if(i){const l=i[2].trim();if(!this.options.pedantic&&/^$/.test(l))return;const x=ya(l.slice(0,-1),"\\");if((l.length-x.length)%2==0)return}else{const x=(function(w,C){if(w.indexOf(C[1])===-1)return-1;const $=w.length;let N=0,_=0;for(;_<$;_++)if(w[_]==="\\")_++;else if(w[_]===C[0])N++;else if(w[_]===C[1]&&(N--,N<0))return _;return-1})(i[2],"()");if(x>-1){const w=(i[0].indexOf("!")===0?5:4)+i[1].length+x;i[2]=i[2].substring(0,x),i[0]=i[0].substring(0,w).trim(),i[3]=""}}let h=i[2],v="";if(this.options.pedantic){const x=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(h);x&&(h=x[1],v=x[3])}else v=i[3]?i[3].slice(1,-1):"";return h=h.trim(),/^$/.test(l)?h.slice(1):h.slice(1,-1)),Ps(i,{href:h&&h.replace(this.rules.inline._escapes,"$1"),title:v&&v.replace(this.rules.inline._escapes,"$1")},i[0],this.lexer)}}reflink(n,i){let l;if((l=this.rules.inline.reflink.exec(n))||(l=this.rules.inline.nolink.exec(n))){let h=(l[2]||l[1]).replace(/\s+/g," ");if(h=i[h.toLowerCase()],!h){const v=l[0].charAt(0);return{type:"text",raw:v,text:v}}return Ps(l,h,l[0],this.lexer)}}emStrong(n,i,l=""){let h=this.rules.inline.emStrong.lDelim.exec(n);if(!h||h[3]&&l.match(/[\p{L}\p{N}]/u))return;const v=h[1]||h[2]||"";if(!v||v&&(l===""||this.rules.inline.punctuation.exec(l))){const x=h[0].length-1;let w,C,$=x,N=0;const _=h[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(_.lastIndex=0,i=i.slice(-1*n.length+x);(h=_.exec(i))!=null;){if(w=h[1]||h[2]||h[3]||h[4]||h[5]||h[6],!w)continue;if(C=w.length,h[3]||h[4]){$+=C;continue}if((h[5]||h[6])&&x%3&&!((x+C)%3)){N+=C;continue}if($-=C,$>0)continue;C=Math.min(C,C+$+N);const F=n.slice(0,x+h.index+(h[0].length-w.length)+C);if(Math.min(x,C)%2){const J=F.slice(1,-1);return{type:"em",raw:F,text:J,tokens:this.lexer.inlineTokens(J)}}const U=F.slice(2,-2);return{type:"strong",raw:F,text:U,tokens:this.lexer.inlineTokens(U)}}}}codespan(n){const i=this.rules.inline.code.exec(n);if(i){let l=i[2].replace(/\n/g," ");const h=/[^ ]/.test(l),v=/^ /.test(l)&&/ $/.test(l);return h&&v&&(l=l.substring(1,l.length-1)),l=Lt(l,!0),{type:"codespan",raw:i[0],text:l}}}br(n){const i=this.rules.inline.br.exec(n);if(i)return{type:"br",raw:i[0]}}del(n){const i=this.rules.inline.del.exec(n);if(i)return{type:"del",raw:i[0],text:i[2],tokens:this.lexer.inlineTokens(i[2])}}autolink(n,i){const l=this.rules.inline.autolink.exec(n);if(l){let h,v;return l[2]==="@"?(h=Lt(this.options.mangle?i(l[1]):l[1]),v="mailto:"+h):(h=Lt(l[1]),v=h),{type:"link",raw:l[0],text:h,href:v,tokens:[{type:"text",raw:h,text:h}]}}}url(n,i){let l;if(l=this.rules.inline.url.exec(n)){let h,v;if(l[2]==="@")h=Lt(this.options.mangle?i(l[0]):l[0]),v="mailto:"+h;else{let x;do x=l[0],l[0]=this.rules.inline._backpedal.exec(l[0])[0];while(x!==l[0]);h=Lt(l[0]),v=l[1]==="www."?"http://"+l[0]:l[0]}return{type:"link",raw:l[0],text:h,href:v,tokens:[{type:"text",raw:h,text:h}]}}}inlineText(n,i){const l=this.rules.inline.text.exec(n);if(l){let h;return h=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(l[0]):Lt(l[0]):l[0]:Lt(this.options.smartypants?i(l[0]):l[0]),{type:"text",raw:l[0],text:h}}}}const Gt={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:wu,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};Gt.def=Dn(Gt.def).replace("label",Gt._label).replace("title",Gt._title).getRegex(),Gt.bullet=/(?:[*+-]|\d{1,9}[.)])/,Gt.listItemStart=Dn(/^( *)(bull) */).replace("bull",Gt.bullet).getRegex(),Gt.list=Dn(Gt.list).replace(/bull/g,Gt.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Gt.def.source+")").getRegex(),Gt._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Gt._comment=/|$)/,Gt.html=Dn(Gt.html,"i").replace("comment",Gt._comment).replace("tag",Gt._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Gt.paragraph=Dn(Gt._paragraph).replace("hr",Gt.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Gt._tag).getRegex(),Gt.blockquote=Dn(Gt.blockquote).replace("paragraph",Gt.paragraph).getRegex(),Gt.normal={...Gt},Gt.gfm={...Gt.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},Gt.gfm.table=Dn(Gt.gfm.table).replace("hr",Gt.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Gt._tag).getRegex(),Gt.gfm.paragraph=Dn(Gt._paragraph).replace("hr",Gt.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",Gt.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Gt._tag).getRegex(),Gt.pedantic={...Gt.normal,html:Dn(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Gt._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:wu,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Dn(Gt.normal._paragraph).replace("hr",Gt.hr).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",Gt.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const Nt={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:wu,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:wu,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\.5&&(i="x"+i.toString(16)),l+="&#"+i+";";return l}Nt._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Nt.punctuation=Dn(Nt.punctuation).replace(/punctuation/g,Nt._punctuation).getRegex(),Nt.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Nt.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g,Nt._comment=Dn(Gt._comment).replace("(?:-->|$)","-->").getRegex(),Nt.emStrong.lDelim=Dn(Nt.emStrong.lDelim).replace(/punct/g,Nt._punctuation).getRegex(),Nt.emStrong.rDelimAst=Dn(Nt.emStrong.rDelimAst,"g").replace(/punct/g,Nt._punctuation).getRegex(),Nt.emStrong.rDelimUnd=Dn(Nt.emStrong.rDelimUnd,"g").replace(/punct/g,Nt._punctuation).getRegex(),Nt._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Nt._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Nt._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Nt.autolink=Dn(Nt.autolink).replace("scheme",Nt._scheme).replace("email",Nt._email).getRegex(),Nt._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Nt.tag=Dn(Nt.tag).replace("comment",Nt._comment).replace("attribute",Nt._attribute).getRegex(),Nt._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Nt._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Nt._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Nt.link=Dn(Nt.link).replace("label",Nt._label).replace("href",Nt._href).replace("title",Nt._title).getRegex(),Nt.reflink=Dn(Nt.reflink).replace("label",Nt._label).replace("ref",Gt._label).getRegex(),Nt.nolink=Dn(Nt.nolink).replace("ref",Gt._label).getRegex(),Nt.reflinkSearch=Dn(Nt.reflinkSearch,"g").replace("reflink",Nt.reflink).replace("nolink",Nt.nolink).getRegex(),Nt.normal={...Nt},Nt.pedantic={...Nt.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Dn(/^!?\[(label)\]\((.*?)\)/).replace("label",Nt._label).getRegex(),reflink:Dn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Nt._label).getRegex()},Nt.gfm={...Nt.normal,escape:Dn(Nt.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\C+" ".repeat($.length)));n;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((w=>!!(l=w.call({lexer:this},n,i))&&(n=n.substring(l.raw.length),i.push(l),!0)))))if(l=this.tokenizer.space(n))n=n.substring(l.raw.length),l.raw.length===1&&i.length>0?i[i.length-1].raw+=` `:i.push(l);else if(l=this.tokenizer.code(n))n=n.substring(l.raw.length),h=i[i.length-1],!h||h.type!=="paragraph"&&h.type!=="text"?i.push(l):(h.raw+=` @@ -102,9 +102,9 @@ For more information, see https://radix-ui.com/primitives/docs/components/alert- `+l.raw,h.text+=` `+l.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=h.text):i.push(l),x=v.length!==n.length,n=n.substring(l.raw.length);else if(l=this.tokenizer.text(n))n=n.substring(l.raw.length),h=i[i.length-1],h&&h.type==="text"?(h.raw+=` `+l.raw,h.text+=` -`+l.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=h.text):i.push(l);else if(n){const w="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(w);break}throw new Error(w)}}return this.state.top=!0,i}inline(n,i=[]){return this.inlineQueue.push({src:n,tokens:i}),i}inlineTokens(n,i=[]){let l,h,v,x,w,C,$=n;if(this.tokens.links){const N=Object.keys(this.tokens.links);if(N.length>0)for(;(x=this.tokenizer.rules.inline.reflinkSearch.exec($))!=null;)N.includes(x[0].slice(x[0].lastIndexOf("[")+1,-1))&&($=$.slice(0,x.index)+"["+is("a",x[0].length-2)+"]"+$.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(x=this.tokenizer.rules.inline.blockSkip.exec($))!=null;)$=$.slice(0,x.index)+"["+is("a",x[0].length-2)+"]"+$.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(x=this.tokenizer.rules.inline.escapedEmSt.exec($))!=null;)$=$.slice(0,x.index+x[0].length-2)+"++"+$.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;n;)if(w||(C=""),w=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((N=>!!(l=N.call({lexer:this},n,i))&&(n=n.substring(l.raw.length),i.push(l),!0)))))if(l=this.tokenizer.escape(n))n=n.substring(l.raw.length),i.push(l);else if(l=this.tokenizer.tag(n))n=n.substring(l.raw.length),h=i[i.length-1],h&&l.type==="text"&&h.type==="text"?(h.raw+=l.raw,h.text+=l.text):i.push(l);else if(l=this.tokenizer.link(n))n=n.substring(l.raw.length),i.push(l);else if(l=this.tokenizer.reflink(n,this.tokens.links))n=n.substring(l.raw.length),h=i[i.length-1],h&&l.type==="text"&&h.type==="text"?(h.raw+=l.raw,h.text+=l.text):i.push(l);else if(l=this.tokenizer.emStrong(n,$,C))n=n.substring(l.raw.length),i.push(l);else if(l=this.tokenizer.codespan(n))n=n.substring(l.raw.length),i.push(l);else if(l=this.tokenizer.br(n))n=n.substring(l.raw.length),i.push(l);else if(l=this.tokenizer.del(n))n=n.substring(l.raw.length),i.push(l);else if(l=this.tokenizer.autolink(n,zg))n=n.substring(l.raw.length),i.push(l);else if(this.state.inLink||!(l=this.tokenizer.url(n,zg))){if(v=n,this.options.extensions&&this.options.extensions.startInline){let N=1/0;const _=n.slice(1);let F;this.options.extensions.startInline.forEach((function(U){F=U.call({lexer:this},_),typeof F=="number"&&F>=0&&(N=Math.min(N,F))})),N<1/0&&N>=0&&(v=n.substring(0,N+1))}if(l=this.tokenizer.inlineText(v,tA))n=n.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(C=l.raw.slice(-1)),w=!0,h=i[i.length-1],h&&h.type==="text"?(h.raw+=l.raw,h.text+=l.text):i.push(l);else if(n){const N="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(N);break}throw new Error(N)}}else n=n.substring(l.raw.length),i.push(l);return i}}class Qd{constructor(n){this.options=n||fa}code(n,i,l){const h=(i||"").match(/\S*/)[0];if(this.options.highlight){const v=this.options.highlight(n,h);v!=null&&v!==n&&(l=!0,n=v)}return n=n.replace(/\n$/,"")+` -`,h?'
'+(l?n:zt(n,!0))+`
-`:"
"+(l?n:zt(n,!0))+`
+`+l.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=h.text):i.push(l);else if(n){const w="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(w);break}throw new Error(w)}}return this.state.top=!0,i}inline(n,i=[]){return this.inlineQueue.push({src:n,tokens:i}),i}inlineTokens(n,i=[]){let l,h,v,x,w,C,$=n;if(this.tokens.links){const N=Object.keys(this.tokens.links);if(N.length>0)for(;(x=this.tokenizer.rules.inline.reflinkSearch.exec($))!=null;)N.includes(x[0].slice(x[0].lastIndexOf("[")+1,-1))&&($=$.slice(0,x.index)+"["+ss("a",x[0].length-2)+"]"+$.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(x=this.tokenizer.rules.inline.blockSkip.exec($))!=null;)$=$.slice(0,x.index)+"["+ss("a",x[0].length-2)+"]"+$.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(x=this.tokenizer.rules.inline.escapedEmSt.exec($))!=null;)$=$.slice(0,x.index+x[0].length-2)+"++"+$.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;n;)if(w||(C=""),w=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((N=>!!(l=N.call({lexer:this},n,i))&&(n=n.substring(l.raw.length),i.push(l),!0)))))if(l=this.tokenizer.escape(n))n=n.substring(l.raw.length),i.push(l);else if(l=this.tokenizer.tag(n))n=n.substring(l.raw.length),h=i[i.length-1],h&&l.type==="text"&&h.type==="text"?(h.raw+=l.raw,h.text+=l.text):i.push(l);else if(l=this.tokenizer.link(n))n=n.substring(l.raw.length),i.push(l);else if(l=this.tokenizer.reflink(n,this.tokens.links))n=n.substring(l.raw.length),h=i[i.length-1],h&&l.type==="text"&&h.type==="text"?(h.raw+=l.raw,h.text+=l.text):i.push(l);else if(l=this.tokenizer.emStrong(n,$,C))n=n.substring(l.raw.length),i.push(l);else if(l=this.tokenizer.codespan(n))n=n.substring(l.raw.length),i.push(l);else if(l=this.tokenizer.br(n))n=n.substring(l.raw.length),i.push(l);else if(l=this.tokenizer.del(n))n=n.substring(l.raw.length),i.push(l);else if(l=this.tokenizer.autolink(n,zg))n=n.substring(l.raw.length),i.push(l);else if(this.state.inLink||!(l=this.tokenizer.url(n,zg))){if(v=n,this.options.extensions&&this.options.extensions.startInline){let N=1/0;const _=n.slice(1);let F;this.options.extensions.startInline.forEach((function(U){F=U.call({lexer:this},_),typeof F=="number"&&F>=0&&(N=Math.min(N,F))})),N<1/0&&N>=0&&(v=n.substring(0,N+1))}if(l=this.tokenizer.inlineText(v,tA))n=n.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(C=l.raw.slice(-1)),w=!0,h=i[i.length-1],h&&h.type==="text"?(h.raw+=l.raw,h.text+=l.text):i.push(l);else if(n){const N="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(N);break}throw new Error(N)}}else n=n.substring(l.raw.length),i.push(l);return i}}class Qd{constructor(n){this.options=n||fa}code(n,i,l){const h=(i||"").match(/\S*/)[0];if(this.options.highlight){const v=this.options.highlight(n,h);v!=null&&v!==n&&(l=!0,n=v)}return n=n.replace(/\n$/,"")+` +`,h?'
'+(l?n:Lt(n,!0))+`
+`:"
"+(l?n:Lt(n,!0))+`
`}blockquote(n){return`
${n}
`}html(n){return n}heading(n,i,l,h){return this.options.headerIds?`${n} @@ -124,7 +124,7 @@ ${n} `}tablecell(n,i){const l=i.header?"th":"td";return(i.align?`<${l} align="${i.align}">`:`<${l}>`)+n+` `}strong(n){return`${n}`}em(n){return`${n}`}codespan(n){return`${n}`}br(){return this.options.xhtml?"
":"
"}del(n){return`${n}`}link(n,i,l){if((n=ll(this.options.sanitize,this.options.baseUrl,n))===null)return l;let h='",h}image(n,i,l){if((n=ll(this.options.sanitize,this.options.baseUrl,n))===null)return l;let h=`${l}":">",h}text(n){return n}}class dc{strong(n){return n}em(n){return n}codespan(n){return n}del(n){return n}html(n){return n}text(n){return n}link(n,i,l){return""+l}image(n,i,l){return""+l}br(){return""}}class hc{constructor(){this.seen={}}serialize(n){return n.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(n,i){let l=n,h=0;if(this.seen.hasOwnProperty(l)){h=this.seen[n];do h++,l=n+"-"+h;while(this.seen.hasOwnProperty(l))}return i||(this.seen[n]=h,this.seen[l]=0),l}slug(n,i={}){const l=this.serialize(n);return this.getNextSafeSlug(l,i.dryrun)}}class Hi{constructor(n){this.options=n||fa,this.options.renderer=this.options.renderer||new Qd,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new dc,this.slugger=new hc}static parse(n,i){return new Hi(i).parse(n)}static parseInline(n,i){return new Hi(i).parseInline(n)}parse(n,i=!0){let l,h,v,x,w,C,$,N,_,F,U,J,Y,Z,P,se,ae,he,ge,pe="";const Te=n.length;for(l=0;l0&&P.tokens[0].type==="paragraph"?(P.tokens[0].text=he+" "+P.tokens[0].text,P.tokens[0].tokens&&P.tokens[0].tokens.length>0&&P.tokens[0].tokens[0].type==="text"&&(P.tokens[0].tokens[0].text=he+" "+P.tokens[0].tokens[0].text)):P.tokens.unshift({type:"text",text:he}):Z+=he),Z+=this.parse(P.tokens,Y),_+=this.renderer.listitem(Z,ae,se);pe+=this.renderer.list(_,U,J);continue;case"html":pe+=this.renderer.html(F.text);continue;case"paragraph":pe+=this.renderer.paragraph(this.parseInline(F.tokens));continue;case"text":for(_=F.tokens?this.parseInline(F.tokens):F.text;l+1{typeof l=="function"&&(h=l,l=null);const v={...l},x=(function(w,C,$){return N=>{if(N.message+=` -Please report this to https://github.com/markedjs/marked.`,w){const _="

An error occurred:

"+zt(N.message+"",!0)+"
";return C?Promise.resolve(_):$?void $(null,_):_}if(C)return Promise.reject(N);if(!$)throw N;$(N)}})((l={...dt.defaults,...v}).silent,l.async,h);if(i==null)return x(new Error("marked(): input parameter is undefined or null"));if(typeof i!="string")return x(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(i)+", string expected"));if((function(w){w&&w.sanitize&&!w.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")})(l),l.hooks&&(l.hooks.options=l),h){const w=l.highlight;let C;try{l.hooks&&(i=l.hooks.preprocess(i)),C=t(i,l)}catch(_){return x(_)}const $=function(_){let F;if(!_)try{l.walkTokens&&dt.walkTokens(C,l.walkTokens),F=n(C,l),l.hooks&&(F=l.hooks.postprocess(F))}catch(U){_=U}return l.highlight=w,_?x(_):h(null,F)};if(!w||w.length<3||(delete l.highlight,!C.length))return $();let N=0;return dt.walkTokens(C,(function(_){_.type==="code"&&(N++,setTimeout((()=>{w(_.text,_.lang,(function(F,U){if(F)return $(F);U!=null&&U!==_.text&&(_.text=U,_.escaped=!0),N--,N===0&&$()}))}),0))})),void(N===0&&$())}if(l.async)return Promise.resolve(l.hooks?l.hooks.preprocess(i):i).then((w=>t(w,l))).then((w=>l.walkTokens?Promise.all(dt.walkTokens(w,l.walkTokens)).then((()=>w)):w)).then((w=>n(w,l))).then((w=>l.hooks?l.hooks.postprocess(w):w)).catch(x);try{l.hooks&&(i=l.hooks.preprocess(i));const w=t(i,l);l.walkTokens&&dt.walkTokens(w,l.walkTokens);let C=n(w,l);return l.hooks&&(C=l.hooks.postprocess(C)),C}catch(w){return x(w)}}}function dt(t,n,i){return Zr(Vi.lex,Hi.parse)(t,n,i)}dt.options=dt.setOptions=function(t){var n;return dt.defaults={...dt.defaults,...t},n=dt.defaults,fa=n,dt},dt.getDefaults=Xr,dt.defaults=fa,dt.use=function(...t){const n=dt.defaults.extensions||{renderers:{},childTokens:{}};t.forEach((i=>{const l={...i};if(l.async=dt.defaults.async||l.async||!1,i.extensions&&(i.extensions.forEach((h=>{if(!h.name)throw new Error("extension name required");if(h.renderer){const v=n.renderers[h.name];n.renderers[h.name]=v?function(...x){let w=h.renderer.apply(this,x);return w===!1&&(w=v.apply(this,x)),w}:h.renderer}if(h.tokenizer){if(!h.level||h.level!=="block"&&h.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");n[h.level]?n[h.level].unshift(h.tokenizer):n[h.level]=[h.tokenizer],h.start&&(h.level==="block"?n.startBlock?n.startBlock.push(h.start):n.startBlock=[h.start]:h.level==="inline"&&(n.startInline?n.startInline.push(h.start):n.startInline=[h.start]))}h.childTokens&&(n.childTokens[h.name]=h.childTokens)})),l.extensions=n),i.renderer){const h=dt.defaults.renderer||new Qd;for(const v in i.renderer){const x=h[v];h[v]=(...w)=>{let C=i.renderer[v].apply(h,w);return C===!1&&(C=x.apply(h,w)),C}}l.renderer=h}if(i.tokenizer){const h=dt.defaults.tokenizer||new cl;for(const v in i.tokenizer){const x=h[v];h[v]=(...w)=>{let C=i.tokenizer[v].apply(h,w);return C===!1&&(C=x.apply(h,w)),C}}l.tokenizer=h}if(i.hooks){const h=dt.defaults.hooks||new ul;for(const v in i.hooks){const x=h[v];ul.passThroughHooks.has(v)?h[v]=w=>{if(dt.defaults.async)return Promise.resolve(i.hooks[v].call(h,w)).then(($=>x.call(h,$)));const C=i.hooks[v].call(h,w);return x.call(h,C)}:h[v]=(...w)=>{let C=i.hooks[v].apply(h,w);return C===!1&&(C=x.apply(h,w)),C}}l.hooks=h}if(i.walkTokens){const h=dt.defaults.walkTokens;l.walkTokens=function(v){let x=[];return x.push(i.walkTokens.call(this,v)),h&&(x=x.concat(h.call(this,v))),x}}dt.setOptions(l)}))},dt.walkTokens=function(t,n){let i=[];for(const l of t)switch(i=i.concat(n.call(dt,l)),l.type){case"table":for(const h of l.header)i=i.concat(dt.walkTokens(h.tokens,n));for(const h of l.rows)for(const v of h)i=i.concat(dt.walkTokens(v.tokens,n));break;case"list":i=i.concat(dt.walkTokens(l.items,n));break;default:dt.defaults.extensions&&dt.defaults.extensions.childTokens&&dt.defaults.extensions.childTokens[l.type]?dt.defaults.extensions.childTokens[l.type].forEach((function(h){i=i.concat(dt.walkTokens(l[h],n))})):l.tokens&&(i=i.concat(dt.walkTokens(l.tokens,n)))}return i},dt.parseInline=Zr(Vi.lexInline,Hi.parseInline),dt.Parser=Hi,dt.parser=Hi.parse,dt.Renderer=Qd,dt.TextRenderer=dc,dt.Lexer=Vi,dt.lexer=Vi.lex,dt.Tokenizer=cl,dt.Slugger=hc,dt.Hooks=ul,dt.parse=dt,dt.options,dt.setOptions,dt.use,dt.walkTokens,dt.parseInline,Hi.parse,Vi.lex;var ww=g(848),sr=g.n(ww);g(113),g(83),g(378),g(976),g(514),g(22),g(342),g(784),g(651);const Si=M` +Please report this to https://github.com/markedjs/marked.`,w){const _="

An error occurred:

"+Lt(N.message+"",!0)+"
";return C?Promise.resolve(_):$?void $(null,_):_}if(C)return Promise.reject(N);if(!$)throw N;$(N)}})((l={...dt.defaults,...v}).silent,l.async,h);if(i==null)return x(new Error("marked(): input parameter is undefined or null"));if(typeof i!="string")return x(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(i)+", string expected"));if((function(w){w&&w.sanitize&&!w.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")})(l),l.hooks&&(l.hooks.options=l),h){const w=l.highlight;let C;try{l.hooks&&(i=l.hooks.preprocess(i)),C=t(i,l)}catch(_){return x(_)}const $=function(_){let F;if(!_)try{l.walkTokens&&dt.walkTokens(C,l.walkTokens),F=n(C,l),l.hooks&&(F=l.hooks.postprocess(F))}catch(U){_=U}return l.highlight=w,_?x(_):h(null,F)};if(!w||w.length<3||(delete l.highlight,!C.length))return $();let N=0;return dt.walkTokens(C,(function(_){_.type==="code"&&(N++,setTimeout((()=>{w(_.text,_.lang,(function(F,U){if(F)return $(F);U!=null&&U!==_.text&&(_.text=U,_.escaped=!0),N--,N===0&&$()}))}),0))})),void(N===0&&$())}if(l.async)return Promise.resolve(l.hooks?l.hooks.preprocess(i):i).then((w=>t(w,l))).then((w=>l.walkTokens?Promise.all(dt.walkTokens(w,l.walkTokens)).then((()=>w)):w)).then((w=>n(w,l))).then((w=>l.hooks?l.hooks.postprocess(w):w)).catch(x);try{l.hooks&&(i=l.hooks.preprocess(i));const w=t(i,l);l.walkTokens&&dt.walkTokens(w,l.walkTokens);let C=n(w,l);return l.hooks&&(C=l.hooks.postprocess(C)),C}catch(w){return x(w)}}}function dt(t,n,i){return Zr(Vi.lex,Hi.parse)(t,n,i)}dt.options=dt.setOptions=function(t){var n;return dt.defaults={...dt.defaults,...t},n=dt.defaults,fa=n,dt},dt.getDefaults=Xr,dt.defaults=fa,dt.use=function(...t){const n=dt.defaults.extensions||{renderers:{},childTokens:{}};t.forEach((i=>{const l={...i};if(l.async=dt.defaults.async||l.async||!1,i.extensions&&(i.extensions.forEach((h=>{if(!h.name)throw new Error("extension name required");if(h.renderer){const v=n.renderers[h.name];n.renderers[h.name]=v?function(...x){let w=h.renderer.apply(this,x);return w===!1&&(w=v.apply(this,x)),w}:h.renderer}if(h.tokenizer){if(!h.level||h.level!=="block"&&h.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");n[h.level]?n[h.level].unshift(h.tokenizer):n[h.level]=[h.tokenizer],h.start&&(h.level==="block"?n.startBlock?n.startBlock.push(h.start):n.startBlock=[h.start]:h.level==="inline"&&(n.startInline?n.startInline.push(h.start):n.startInline=[h.start]))}h.childTokens&&(n.childTokens[h.name]=h.childTokens)})),l.extensions=n),i.renderer){const h=dt.defaults.renderer||new Qd;for(const v in i.renderer){const x=h[v];h[v]=(...w)=>{let C=i.renderer[v].apply(h,w);return C===!1&&(C=x.apply(h,w)),C}}l.renderer=h}if(i.tokenizer){const h=dt.defaults.tokenizer||new cl;for(const v in i.tokenizer){const x=h[v];h[v]=(...w)=>{let C=i.tokenizer[v].apply(h,w);return C===!1&&(C=x.apply(h,w)),C}}l.tokenizer=h}if(i.hooks){const h=dt.defaults.hooks||new ul;for(const v in i.hooks){const x=h[v];ul.passThroughHooks.has(v)?h[v]=w=>{if(dt.defaults.async)return Promise.resolve(i.hooks[v].call(h,w)).then(($=>x.call(h,$)));const C=i.hooks[v].call(h,w);return x.call(h,C)}:h[v]=(...w)=>{let C=i.hooks[v].apply(h,w);return C===!1&&(C=x.apply(h,w)),C}}l.hooks=h}if(i.walkTokens){const h=dt.defaults.walkTokens;l.walkTokens=function(v){let x=[];return x.push(i.walkTokens.call(this,v)),h&&(x=x.concat(h.call(this,v))),x}}dt.setOptions(l)}))},dt.walkTokens=function(t,n){let i=[];for(const l of t)switch(i=i.concat(n.call(dt,l)),l.type){case"table":for(const h of l.header)i=i.concat(dt.walkTokens(h.tokens,n));for(const h of l.rows)for(const v of h)i=i.concat(dt.walkTokens(v.tokens,n));break;case"list":i=i.concat(dt.walkTokens(l.items,n));break;default:dt.defaults.extensions&&dt.defaults.extensions.childTokens&&dt.defaults.extensions.childTokens[l.type]?dt.defaults.extensions.childTokens[l.type].forEach((function(h){i=i.concat(dt.walkTokens(l[h],n))})):l.tokens&&(i=i.concat(dt.walkTokens(l.tokens,n)))}return i},dt.parseInline=Zr(Vi.lexInline,Hi.parseInline),dt.Parser=Hi,dt.parser=Hi.parse,dt.Renderer=Qd,dt.TextRenderer=dc,dt.Lexer=Vi,dt.lexer=Vi.lex,dt.Tokenizer=cl,dt.Slugger=hc,dt.Hooks=ul,dt.parse=dt,dt.options,dt.setOptions,dt.use,dt.walkTokens,dt.parseInline,Hi.parse,Vi.lex;var xw=g(848),sr=g.n(xw);g(113),g(83),g(378),g(976),g(514),g(22),g(342),g(784),g(651);const Si=M` .hover-bg:hover { background: var(--bg3); } @@ -659,7 +659,7 @@ input[type="checkbox"]:checked:after { vertical-align: middle; margin: 12px 0 4px 0; } -`,Lg=M` +`,Fg=M` :host { container-type: inline-size; } @@ -1219,43 +1219,43 @@ pre[class*="language-"] { } `,fc=M` -`,eh=/[\s#:?&={}]/g,po="_rapidoc_api_key";function Cu(t){return new Promise((n=>setTimeout(n,t)))}function hl(t,n){const i=n.target,l=document.createElement("textarea");l.value=t,l.style.position="fixed",document.body.appendChild(l),l.focus(),l.select();try{document.execCommand("copy"),i.innerText="Copied",setTimeout((()=>{i.innerText="Copy"}),5e3)}catch(h){console.error("Unable to copy",h)}document.body.removeChild(l)}function th(t,n,i=""){return`${n.method} ${n.path} ${n.summary||""} ${n.description||""} ${n.operationId||""} ${i}`.toLowerCase().includes(t.toLowerCase())}function Js(t,n=new Set){return t&&Object.keys(t).forEach((i=>{var l;if(n.add(i),t[i].properties)Js(t[i].properties,n);else if((l=t[i].items)!==null&&l!==void 0&&l.properties){var h;Js((h=t[i].items)===null||h===void 0?void 0:h.properties,n)}})),n}function zp(t,n){if(t){const i=document.createElement("a");document.body.appendChild(i),i.style="display: none",i.href=t,i.download=n,i.click(),i.remove()}}function Fg(t){if(t){const n=document.createElement("a");document.body.appendChild(n),n.style="display: none",n.href=t,n.target="_blank",n.click(),n.remove()}}const Lp=Object.freeze({url:"/"}),{fetch:Au,Response:Sw,Headers:Ew,Request:Ou,FormData:nA,File:jw,Blob:Cw}=globalThis;function nh(t,n){return n||typeof navigator>"u"||(n=navigator),n&&n.product==="ReactNative"?!(!t||typeof t!="object"||typeof t.uri!="string"):typeof File<"u"&&t instanceof File||typeof Blob<"u"&&t instanceof Blob||!!ArrayBuffer.isView(t)||t!==null&&typeof t=="object"&&typeof t.pipe=="function"}function Aw(t,n){return Array.isArray(t)&&t.some((i=>nh(i,n)))}globalThis.fetch===void 0&&(globalThis.fetch=Au),globalThis.Headers===void 0&&(globalThis.Headers=Ew),globalThis.Request===void 0&&(globalThis.Request=Ou),globalThis.Response===void 0&&(globalThis.Response=Sw),globalThis.FormData===void 0&&(globalThis.FormData=nA),globalThis.File===void 0&&(globalThis.File=jw),globalThis.Blob===void 0&&(globalThis.Blob=Cw);class qg extends File{constructor(n,i="",l={}){super([n],i,l),this.data=n}valueOf(){return this.data}toString(){return this.valueOf()}}function rh(t,n="reserved"){return[...t].map((i=>{if((h=>/^[a-z0-9\-._~]+$/i.test(h))(i)||(h=>":/?#[]@!$&'()*+,;=".indexOf(h)>-1)(i)&&n==="unsafe")return i;const l=new TextEncoder;return Array.from(l.encode(i)).map((h=>`0${h.toString(16).toUpperCase()}`.slice(-2))).map((h=>`%${h}`)).join("")})).join("")}function xa(t){const{value:n}=t;return Array.isArray(n)?(function({key:i,value:l,style:h,explode:v,escape:x}){if(h==="simple")return l.map((w=>as(w,x))).join(",");if(h==="label")return`.${l.map((w=>as(w,x))).join(".")}`;if(h==="matrix")return l.map((w=>as(w,x))).reduce(((w,C)=>!w||v?`${w||""};${i}=${C}`:`${w},${C}`),"");if(h==="form"){const w=v?`&${i}=`:",";return l.map((C=>as(C,x))).join(w)}if(h==="spaceDelimited"){const w=v?`${i}=`:"";return l.map((C=>as(C,x))).join(` ${w}`)}if(h==="pipeDelimited"){const w=v?`${i}=`:"";return l.map((C=>as(C,x))).join(`|${w}`)}})(t):typeof n=="object"?(function({key:i,value:l,style:h,explode:v,escape:x}){const w=Object.keys(l);return h==="simple"?w.reduce(((C,$)=>{const N=as(l[$],x);return`${C?`${C},`:""}${$}${v?"=":","}${N}`}),""):h==="label"?w.reduce(((C,$)=>{const N=as(l[$],x);return`${C?`${C}.`:"."}${$}${v?"=":"."}${N}`}),""):h==="matrix"&&v?w.reduce(((C,$)=>`${C?`${C};`:";"}${$}=${as(l[$],x)}`),""):h==="matrix"?w.reduce(((C,$)=>{const N=as(l[$],x);return`${C?`${C},`:`;${i}=`}${$},${N}`}),""):h==="form"?w.reduce(((C,$)=>{const N=as(l[$],x);return`${C?`${C}${v?"&":","}`:""}${$}${v?"=":","}${N}`}),""):void 0})(t):(function({key:i,value:l,style:h,escape:v}){return h==="simple"?as(l,v):h==="label"?`.${as(l,v)}`:h==="matrix"?`;${i}=${as(l,v)}`:h==="form"||h==="deepObject"?as(l,v):void 0})(t)}function as(t,n=!1){return Array.isArray(t)||t!==null&&typeof t=="object"?t=JSON.stringify(t):typeof t!="number"&&typeof t!="boolean"||(t=String(t)),n&&t.length>0?rh(t,n):t}const Bg={form:",",spaceDelimited:"%20",pipeDelimited:"|"},ku={csv:",",ssv:"%20",tsv:"%09",pipes:"|"};function mc(t,n,i=!1){const{collectionFormat:l,allowEmptyValue:h,serializationOption:v,encoding:x}=n,w=typeof n!="object"||Array.isArray(n)?n:n.value,C=i?N=>N.toString():N=>encodeURIComponent(N),$=C(t);if(w===void 0&&h)return[[$,""]];if(nh(w)||Aw(w))return[[$,w]];if(v)return Ug(t,w,i,v);if(x){if([typeof x.style,typeof x.explode,typeof x.allowReserved].some((N=>N!=="undefined"))){const{style:N,explode:_,allowReserved:F}=x;return Ug(t,w,i,{style:N,explode:_,allowReserved:F})}if(typeof x.contentType=="string"){if(x.contentType.startsWith("application/json")){const _=C(typeof w=="string"?w:JSON.stringify(w));return[[$,new qg(_,"blob",{type:x.contentType})]]}const N=C(String(w));return[[$,new qg(N,"blob",{type:x.contentType})]]}return typeof w!="object"?[[$,C(w)]]:Array.isArray(w)&&w.every((N=>typeof N!="object"))?[[$,w.map(C).join(",")]]:[[$,C(JSON.stringify(w))]]}return typeof w!="object"?[[$,C(w)]]:Array.isArray(w)?l==="multi"?[[$,w.map(C)]]:[[$,w.map(C).join(ku[l||"csv"])]]:[[$,""]]}function Ug(t,n,i,l){const h=l.style||"form",v=l.explode===void 0?h==="form":l.explode,x=!i&&(l&&l.allowReserved?"unsafe":"reserved"),w=$=>as($,x),C=i?$=>$:$=>w($);return typeof n!="object"?[[C(t),w(n)]]:Array.isArray(n)?v?[[C(t),n.map(w)]]:[[C(t),n.map(w).join(Bg[h])]]:h==="deepObject"?Object.keys(n).map(($=>[C(`${t}[${$}]`),w(n[$])])):v?Object.keys(n).map(($=>[C($),w(n[$])])):[[C(t),Object.keys(n).map(($=>[`${C($)},${w(n[$])}`])).join(",")]]}function Fp(t){return((n,{encode:i=!0}={})=>{const l=(x,w,C)=>(C==null?x.append(w,""):Array.isArray(C)?C.reduce((($,N)=>l(x,w,N)),x):C instanceof Date?x.append(w,C.toISOString()):typeof C=="object"?Object.entries(C).reduce((($,[N,_])=>l(x,`${w}[${N}]`,_)),x):x.append(w,C),x),h=Object.entries(n).reduce(((x,[w,C])=>l(x,w,C)),new URLSearchParams),v=String(h);return i?v:decodeURIComponent(v)})(Object.keys(t).reduce(((n,i)=>{for(const[l,h]of mc(i,t[i]))n[l]=h instanceof qg?h.valueOf():h;return n}),{}),{encode:!1})}function qp(t={}){const{url:n="",query:i,form:l}=t;if(l){const v=Object.keys(l).some((w=>{const{value:C}=l[w];return nh(C)||Aw(C)})),x=t.headers["content-type"]||t.headers["Content-Type"];if(v||/multipart\/form-data/i.test(x)){const w=(h=t.form,Object.entries(h).reduce(((C,[$,N])=>{for(const[_,F]of mc($,N,!0))if(Array.isArray(F))for(const U of F)if(ArrayBuffer.isView(U)){const J=new Blob([U]);C.append(_,J)}else C.append(_,U);else if(ArrayBuffer.isView(F)){const U=new Blob([F]);C.append(_,U)}else C.append(_,F);return C}),new FormData));t.formdata=w,t.body=w}else t.body=Fp(l);delete t.form}var h;if(i){const[v,x]=n.split("?");let w="";if(x){const $=new URLSearchParams(x);Object.keys(i).forEach((N=>$.delete(N))),w=String($)}const C=((...$)=>{const N=$.filter((_=>_)).join("&");return N?`?${N}`:""})(w,Fp(i));t.url=v+C,delete t.query}return t}function Ru(t){return t==null}var ar={isNothing:Ru,isObject:function(t){return typeof t=="object"&&t!==null},toArray:function(t){return Array.isArray(t)?t:Ru(t)?[]:[t]},repeat:function(t,n){var i,l="";for(i=0;isetTimeout(n,t)))}function hl(t,n){const i=n.target,l=document.createElement("textarea");l.value=t,l.style.position="fixed",document.body.appendChild(l),l.focus(),l.select();try{document.execCommand("copy"),i.innerText="Copied",setTimeout((()=>{i.innerText="Copy"}),5e3)}catch(h){console.error("Unable to copy",h)}document.body.removeChild(l)}function th(t,n,i=""){return`${n.method} ${n.path} ${n.summary||""} ${n.description||""} ${n.operationId||""} ${i}`.toLowerCase().includes(t.toLowerCase())}function Js(t,n=new Set){return t&&Object.keys(t).forEach((i=>{var l;if(n.add(i),t[i].properties)Js(t[i].properties,n);else if((l=t[i].items)!==null&&l!==void 0&&l.properties){var h;Js((h=t[i].items)===null||h===void 0?void 0:h.properties,n)}})),n}function Lp(t,n){if(t){const i=document.createElement("a");document.body.appendChild(i),i.style="display: none",i.href=t,i.download=n,i.click(),i.remove()}}function qg(t){if(t){const n=document.createElement("a");document.body.appendChild(n),n.style="display: none",n.href=t,n.target="_blank",n.click(),n.remove()}}const zp=Object.freeze({url:"/"}),{fetch:Au,Response:bw,Headers:ww,Request:Ou,FormData:nA,File:Sw,Blob:Ew}=globalThis;function nh(t,n){return n||typeof navigator>"u"||(n=navigator),n&&n.product==="ReactNative"?!(!t||typeof t!="object"||typeof t.uri!="string"):typeof File<"u"&&t instanceof File||typeof Blob<"u"&&t instanceof Blob||!!ArrayBuffer.isView(t)||t!==null&&typeof t=="object"&&typeof t.pipe=="function"}function jw(t,n){return Array.isArray(t)&&t.some((i=>nh(i,n)))}globalThis.fetch===void 0&&(globalThis.fetch=Au),globalThis.Headers===void 0&&(globalThis.Headers=ww),globalThis.Request===void 0&&(globalThis.Request=Ou),globalThis.Response===void 0&&(globalThis.Response=bw),globalThis.FormData===void 0&&(globalThis.FormData=nA),globalThis.File===void 0&&(globalThis.File=Sw),globalThis.Blob===void 0&&(globalThis.Blob=Ew);class Bg extends File{constructor(n,i="",l={}){super([n],i,l),this.data=n}valueOf(){return this.data}toString(){return this.valueOf()}}function rh(t,n="reserved"){return[...t].map((i=>{if((h=>/^[a-z0-9\-._~]+$/i.test(h))(i)||(h=>":/?#[]@!$&'()*+,;=".indexOf(h)>-1)(i)&&n==="unsafe")return i;const l=new TextEncoder;return Array.from(l.encode(i)).map((h=>`0${h.toString(16).toUpperCase()}`.slice(-2))).map((h=>`%${h}`)).join("")})).join("")}function xa(t){const{value:n}=t;return Array.isArray(n)?(function({key:i,value:l,style:h,explode:v,escape:x}){if(h==="simple")return l.map((w=>is(w,x))).join(",");if(h==="label")return`.${l.map((w=>is(w,x))).join(".")}`;if(h==="matrix")return l.map((w=>is(w,x))).reduce(((w,C)=>!w||v?`${w||""};${i}=${C}`:`${w},${C}`),"");if(h==="form"){const w=v?`&${i}=`:",";return l.map((C=>is(C,x))).join(w)}if(h==="spaceDelimited"){const w=v?`${i}=`:"";return l.map((C=>is(C,x))).join(` ${w}`)}if(h==="pipeDelimited"){const w=v?`${i}=`:"";return l.map((C=>is(C,x))).join(`|${w}`)}})(t):typeof n=="object"?(function({key:i,value:l,style:h,explode:v,escape:x}){const w=Object.keys(l);return h==="simple"?w.reduce(((C,$)=>{const N=is(l[$],x);return`${C?`${C},`:""}${$}${v?"=":","}${N}`}),""):h==="label"?w.reduce(((C,$)=>{const N=is(l[$],x);return`${C?`${C}.`:"."}${$}${v?"=":"."}${N}`}),""):h==="matrix"&&v?w.reduce(((C,$)=>`${C?`${C};`:";"}${$}=${is(l[$],x)}`),""):h==="matrix"?w.reduce(((C,$)=>{const N=is(l[$],x);return`${C?`${C},`:`;${i}=`}${$},${N}`}),""):h==="form"?w.reduce(((C,$)=>{const N=is(l[$],x);return`${C?`${C}${v?"&":","}`:""}${$}${v?"=":","}${N}`}),""):void 0})(t):(function({key:i,value:l,style:h,escape:v}){return h==="simple"?is(l,v):h==="label"?`.${is(l,v)}`:h==="matrix"?`;${i}=${is(l,v)}`:h==="form"||h==="deepObject"?is(l,v):void 0})(t)}function is(t,n=!1){return Array.isArray(t)||t!==null&&typeof t=="object"?t=JSON.stringify(t):typeof t!="number"&&typeof t!="boolean"||(t=String(t)),n&&t.length>0?rh(t,n):t}const Ug={form:",",spaceDelimited:"%20",pipeDelimited:"|"},ku={csv:",",ssv:"%20",tsv:"%09",pipes:"|"};function mc(t,n,i=!1){const{collectionFormat:l,allowEmptyValue:h,serializationOption:v,encoding:x}=n,w=typeof n!="object"||Array.isArray(n)?n:n.value,C=i?N=>N.toString():N=>encodeURIComponent(N),$=C(t);if(w===void 0&&h)return[[$,""]];if(nh(w)||jw(w))return[[$,w]];if(v)return Kg(t,w,i,v);if(x){if([typeof x.style,typeof x.explode,typeof x.allowReserved].some((N=>N!=="undefined"))){const{style:N,explode:_,allowReserved:F}=x;return Kg(t,w,i,{style:N,explode:_,allowReserved:F})}if(typeof x.contentType=="string"){if(x.contentType.startsWith("application/json")){const _=C(typeof w=="string"?w:JSON.stringify(w));return[[$,new Bg(_,"blob",{type:x.contentType})]]}const N=C(String(w));return[[$,new Bg(N,"blob",{type:x.contentType})]]}return typeof w!="object"?[[$,C(w)]]:Array.isArray(w)&&w.every((N=>typeof N!="object"))?[[$,w.map(C).join(",")]]:[[$,C(JSON.stringify(w))]]}return typeof w!="object"?[[$,C(w)]]:Array.isArray(w)?l==="multi"?[[$,w.map(C)]]:[[$,w.map(C).join(ku[l||"csv"])]]:[[$,""]]}function Kg(t,n,i,l){const h=l.style||"form",v=l.explode===void 0?h==="form":l.explode,x=!i&&(l&&l.allowReserved?"unsafe":"reserved"),w=$=>is($,x),C=i?$=>$:$=>w($);return typeof n!="object"?[[C(t),w(n)]]:Array.isArray(n)?v?[[C(t),n.map(w)]]:[[C(t),n.map(w).join(Ug[h])]]:h==="deepObject"?Object.keys(n).map(($=>[C(`${t}[${$}]`),w(n[$])])):v?Object.keys(n).map(($=>[C($),w(n[$])])):[[C(t),Object.keys(n).map(($=>[`${C($)},${w(n[$])}`])).join(",")]]}function Fp(t){return((n,{encode:i=!0}={})=>{const l=(x,w,C)=>(C==null?x.append(w,""):Array.isArray(C)?C.reduce((($,N)=>l(x,w,N)),x):C instanceof Date?x.append(w,C.toISOString()):typeof C=="object"?Object.entries(C).reduce((($,[N,_])=>l(x,`${w}[${N}]`,_)),x):x.append(w,C),x),h=Object.entries(n).reduce(((x,[w,C])=>l(x,w,C)),new URLSearchParams),v=String(h);return i?v:decodeURIComponent(v)})(Object.keys(t).reduce(((n,i)=>{for(const[l,h]of mc(i,t[i]))n[l]=h instanceof Bg?h.valueOf():h;return n}),{}),{encode:!1})}function qp(t={}){const{url:n="",query:i,form:l}=t;if(l){const v=Object.keys(l).some((w=>{const{value:C}=l[w];return nh(C)||jw(C)})),x=t.headers["content-type"]||t.headers["Content-Type"];if(v||/multipart\/form-data/i.test(x)){const w=(h=t.form,Object.entries(h).reduce(((C,[$,N])=>{for(const[_,F]of mc($,N,!0))if(Array.isArray(F))for(const U of F)if(ArrayBuffer.isView(U)){const J=new Blob([U]);C.append(_,J)}else C.append(_,U);else if(ArrayBuffer.isView(F)){const U=new Blob([F]);C.append(_,U)}else C.append(_,F);return C}),new FormData));t.formdata=w,t.body=w}else t.body=Fp(l);delete t.form}var h;if(i){const[v,x]=n.split("?");let w="";if(x){const $=new URLSearchParams(x);Object.keys(i).forEach((N=>$.delete(N))),w=String($)}const C=((...$)=>{const N=$.filter((_=>_)).join("&");return N?`?${N}`:""})(w,Fp(i));t.url=v+C,delete t.query}return t}function Ru(t){return t==null}var ar={isNothing:Ru,isObject:function(t){return typeof t=="object"&&t!==null},toArray:function(t){return Array.isArray(t)?t:Ru(t)?[]:[t]},repeat:function(t,n){var i,l="";for(i=0;iw&&(n=l-w+(v=" ... ").length),i-l>w&&(i=l+w-(x=" ...").length),{str:v+t.slice(n,i).replace(/\t/g,"→")+x,pos:l-n+v.length}}function Tu(t,n){return ar.repeat(" ",n-t.length)+t}var Ow=function(t,n){if(n=Object.create(n||null),!t.buffer)return null;n.maxLength||(n.maxLength=79),typeof n.indent!="number"&&(n.indent=1),typeof n.linesBefore!="number"&&(n.linesBefore=3),typeof n.linesAfter!="number"&&(n.linesAfter=2);for(var i,l=/\r?\n|\r|\0/g,h=[0],v=[],x=-1;i=l.exec(t.buffer);)v.push(i.index),h.push(i.index+i[0].length),t.position<=i.index&&x<0&&(x=h.length-2);x<0&&(x=h.length-1);var w,C,$="",N=Math.min(t.line+n.linesAfter,v.length).toString().length,_=n.maxLength-(n.indent+N+3);for(w=1;w<=n.linesBefore&&!(x-w<0);w++)C=sh(t.buffer,h[x-w],v[x-w],t.position-(h[x]-h[x-w]),_),$=ar.repeat(" ",n.indent)+Tu((t.line-w+1).toString(),N)+" | "+C.str+` +`+t.mark.snippet),l+" "+i):l}function po(t,n){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=n,this.message=Bp(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}po.prototype=Object.create(Error.prototype),po.prototype.constructor=po,po.prototype.toString=function(t){return this.name+": "+Bp(this,t)};var Rr=po;function sh(t,n,i,l,h){var v="",x="",w=Math.floor(h/2)-1;return l-n>w&&(n=l-w+(v=" ... ").length),i-l>w&&(i=l+w-(x=" ...").length),{str:v+t.slice(n,i).replace(/\t/g,"→")+x,pos:l-n+v.length}}function Tu(t,n){return ar.repeat(" ",n-t.length)+t}var Cw=function(t,n){if(n=Object.create(n||null),!t.buffer)return null;n.maxLength||(n.maxLength=79),typeof n.indent!="number"&&(n.indent=1),typeof n.linesBefore!="number"&&(n.linesBefore=3),typeof n.linesAfter!="number"&&(n.linesAfter=2);for(var i,l=/\r?\n|\r|\0/g,h=[0],v=[],x=-1;i=l.exec(t.buffer);)v.push(i.index),h.push(i.index+i[0].length),t.position<=i.index&&x<0&&(x=h.length-2);x<0&&(x=h.length-1);var w,C,$="",N=Math.min(t.line+n.linesAfter,v.length).toString().length,_=n.maxLength-(n.indent+N+3);for(w=1;w<=n.linesBefore&&!(x-w<0);w++)C=sh(t.buffer,h[x-w],v[x-w],t.position-(h[x]-h[x-w]),_),$=ar.repeat(" ",n.indent)+Tu((t.line-w+1).toString(),N)+" | "+C.str+` `+$;for(C=sh(t.buffer,h[x],v[x],t.position,_),$+=ar.repeat(" ",n.indent)+Tu((t.line+1).toString(),N)+" | "+C.str+` `,$+=ar.repeat("-",n.indent+N+3+C.pos)+`^ `,w=1;w<=n.linesAfter&&!(x+w>=v.length);w++)C=sh(t.buffer,h[x+w],v[x+w],t.position-(h[x]-h[x+w]),_),$+=ar.repeat(" ",n.indent)+Tu((t.line+w+1).toString(),N)+" | "+C.str+` -`;return $.replace(/\n$/,"")},Up=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Kp=["scalar","sequence","mapping"],os=function(t,n){if(n=n||{},Object.keys(n).forEach((function(i){if(Up.indexOf(i)===-1)throw new Rr('Unknown option "'+i+'" is met in definition of "'+t+'" YAML type.')})),this.options=n,this.tag=t,this.kind=n.kind||null,this.resolve=n.resolve||function(){return!0},this.construct=n.construct||function(i){return i},this.instanceOf=n.instanceOf||null,this.predicate=n.predicate||null,this.represent=n.represent||null,this.representName=n.representName||null,this.defaultStyle=n.defaultStyle||null,this.multi=n.multi||!1,this.styleAliases=(function(i){var l={};return i!==null&&Object.keys(i).forEach((function(h){i[h].forEach((function(v){l[String(v)]=h}))})),l})(n.styleAliases||null),Kp.indexOf(this.kind)===-1)throw new Rr('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')};function Ms(t,n){var i=[];return t[n].forEach((function(l){var h=i.length;i.forEach((function(v,x){v.tag===l.tag&&v.kind===l.kind&&v.multi===l.multi&&(h=x)})),i[h]=l})),i}function mo(t){return this.extend(t)}mo.prototype.extend=function(t){var n=[],i=[];if(t instanceof os)i.push(t);else if(Array.isArray(t))i=i.concat(t);else{if(!t||!Array.isArray(t.implicit)&&!Array.isArray(t.explicit))throw new Rr("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.implicit&&(n=n.concat(t.implicit)),t.explicit&&(i=i.concat(t.explicit))}n.forEach((function(h){if(!(h instanceof os))throw new Rr("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(h.loadKind&&h.loadKind!=="scalar")throw new Rr("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(h.multi)throw new Rr("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),i.forEach((function(h){if(!(h instanceof os))throw new Rr("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var l=Object.create(mo.prototype);return l.implicit=(this.implicit||[]).concat(n),l.explicit=(this.explicit||[]).concat(i),l.compiledImplicit=Ms(l,"implicit"),l.compiledExplicit=Ms(l,"explicit"),l.compiledTypeMap=(function(){var h,v,x={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function w(C){C.multi?(x.multi[C.kind].push(C),x.multi.fallback.push(C)):x[C.kind][C.tag]=x.fallback[C.tag]=C}for(h=0,v=arguments.length;h=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),sA=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),Kg=/^[-+]?[0-9]+e/,_w=new os("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(t){return t!==null&&!(!sA.test(t)||t[t.length-1]==="_")},construct:function(t){var n,i;return i=(n=t.replace(/_/g,"").toLowerCase())[0]==="-"?-1:1,"+-".indexOf(n[0])>=0&&(n=n.slice(1)),n===".inf"?i===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:n===".nan"?NaN:i*parseFloat(n,10)},predicate:function(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!=0||ar.isNegativeZero(t))},represent:function(t,n){var i;if(isNaN(t))switch(n){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(n){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(n){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(ar.isNegativeZero(t))return"-0.0";return i=t.toString(10),Kg.test(i)?i.replace("e",".e"):i},defaultStyle:"lowercase"}),$w=Hp.extend({implicit:[$u,ah,Tw,_w]}),Nw=$w,Dw=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Pw=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"),Vg=new os("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(t){return t!==null&&(Dw.exec(t)!==null||Pw.exec(t)!==null)},construct:function(t){var n,i,l,h,v,x,w,C,$=0,N=null;if((n=Dw.exec(t))===null&&(n=Pw.exec(t)),n===null)throw new Error("Date resolve error");if(i=+n[1],l=+n[2]-1,h=+n[3],!n[4])return new Date(Date.UTC(i,l,h));if(v=+n[4],x=+n[5],w=+n[6],n[7]){for($=n[7].slice(0,3);$.length<3;)$+="0";$=+$}return n[9]&&(N=6e4*(60*+n[10]+ +(n[11]||0)),n[9]==="-"&&(N=-N)),C=new Date(Date.UTC(i,l,h,v,x,w,$)),N&&C.setTime(C.getTime()-N),C},instanceOf:Date,represent:function(t){return t.toISOString()}}),Mw=new os("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(t){return t==="<<"||t===null}}),Hg=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= -\r`,Iw=new os("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(t){if(t===null)return!1;var n,i,l=0,h=t.length,v=Hg;for(i=0;i64)){if(n<0)return!1;l+=6}return l%8==0},construct:function(t){var n,i,l=t.replace(/[\r\n=]/g,""),h=l.length,v=Hg,x=0,w=[];for(n=0;n>16&255),w.push(x>>8&255),w.push(255&x)),x=x<<6|v.indexOf(l.charAt(n));return(i=h%4*6)==0?(w.push(x>>16&255),w.push(x>>8&255),w.push(255&x)):i===18?(w.push(x>>10&255),w.push(x>>2&255)):i===12&&w.push(x>>4&255),new Uint8Array(w)},predicate:function(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"},represent:function(t){var n,i,l="",h=0,v=t.length,x=Hg;for(n=0;n>18&63],l+=x[h>>12&63],l+=x[h>>6&63],l+=x[63&h]),h=(h<<8)+t[n];return(i=v%3)==0?(l+=x[h>>18&63],l+=x[h>>12&63],l+=x[h>>6&63],l+=x[63&h]):i===2?(l+=x[h>>10&63],l+=x[h>>4&63],l+=x[h<<2&63],l+=x[64]):i===1&&(l+=x[h>>2&63],l+=x[h<<4&63],l+=x[64],l+=x[64]),l}}),iA=Object.prototype.hasOwnProperty,Gg=Object.prototype.toString,zw=new os("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(t){if(t===null)return!0;var n,i,l,h,v,x=[],w=t;for(n=0,i=w.length;n>10),56320+(t-65536&1023))}for(var Zg=new Array(256),yc=new Array(256),Nu=0;Nu<256;Nu++)Zg[Nu]=Yg(Nu)?1:0,yc[Nu]=Yg(Nu);function uA(t,n){this.input=t,this.filename=n.filename||null,this.schema=n.schema||Xg,this.onWarning=n.onWarning||null,this.legacy=n.legacy||!1,this.json=n.json||!1,this.listener=n.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Gw(t,n){var i={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return i.snippet=Ow(i),new Rr(n,i)}function Bt(t,n){throw Gw(t,n)}function oh(t,n){t.onWarning&&t.onWarning.call(null,Gw(t,n))}var Du={YAML:function(t,n,i){var l,h,v;t.version!==null&&Bt(t,"duplication of %YAML directive"),i.length!==1&&Bt(t,"YAML directive accepts exactly one argument"),(l=/^([0-9]+)\.([0-9]+)$/.exec(i[0]))===null&&Bt(t,"ill-formed argument of the YAML directive"),h=parseInt(l[1],10),v=parseInt(l[2],10),h!==1&&Bt(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=v<2,v!==1&&v!==2&&oh(t,"unsupported YAML version of the document")},TAG:function(t,n,i){var l,h;i.length!==2&&Bt(t,"TAG directive accepts exactly two arguments"),l=i[0],h=i[1],Bw.test(l)||Bt(t,"ill-formed tag handle (first argument) of the TAG directive"),pl.call(t.tagMap,l)&&Bt(t,'there is a previously declared suffix for "'+l+'" tag handle'),Uw.test(h)||Bt(t,"ill-formed tag prefix (second argument) of the TAG directive");try{h=decodeURIComponent(h)}catch{Bt(t,"tag prefix is malformed: "+h)}t.tagMap[l]=h}};function Xi(t,n,i,l){var h,v,x,w;if(n1&&(t.result+=ar.repeat(` -`,n-1))}function Wg(t,n){var i,l,h=t.tag,v=t.anchor,x=[],w=!1;if(t.firstTabInLine!==-1)return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=x),l=t.input.charCodeAt(t.position);l!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,Bt(t,"tab characters must not be used in indentation")),l===45)&&Qs(t.input.charCodeAt(t.position+1));)if(w=!0,t.position++,Nr(t,!0,-1)&&t.lineIndent<=n)x.push(null),l=t.input.charCodeAt(t.position);else if(i=t.line,Mu(t,n,3,!1,!0),x.push(t.result),Nr(t,!0,-1),l=t.input.charCodeAt(t.position),(t.line===i||t.lineIndent>n)&&l!==0)Bt(t,"bad indentation of a sequence entry");else if(t.lineIndentn?J=1:t.lineIndent===n?J=0:t.lineIndentn?J=1:t.lineIndent===n?J=0:t.lineIndentse)&&(Tt&&(Te=P.line,Ae=P.lineStart,qe=P.position),Mu(P,se,4,!0,ge)&&(Tt?qt=P.result:kn=P.result),Tt||(go(P,Ie,Qe,ot,qt,kn,Te,Ae,qe),ot=qt=kn=null),Nr(P,!0,-1),Se=P.input.charCodeAt(P.position)),(P.line===pe||P.lineIndent>se)&&Se!==0)Bt(P,"bad indentation of a mapping entry");else if(P.lineIndent=0))break;ge===0?Bt(P,"bad explicit indentation width of a block scalar; it cannot be less than one"):Se?Bt(P,"repeat of an indentation width identifier"):(me=se+ge-1,Se=!0)}if(ba(pe)){do pe=P.input.charCodeAt(++P.position);while(ba(pe));if(pe===35)do pe=P.input.charCodeAt(++P.position);while(!Gi(pe)&&pe!==0)}for(;pe!==0;){for(Gp(P),P.lineIndent=0,pe=P.input.charCodeAt(P.position);(!Se||P.lineIndentme&&(me=P.lineIndent),Gi(pe))Me++;else{if(P.lineIndent=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),sA=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),Vg=/^[-+]?[0-9]+e/,Rw=new as("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(t){return t!==null&&!(!sA.test(t)||t[t.length-1]==="_")},construct:function(t){var n,i;return i=(n=t.replace(/_/g,"").toLowerCase())[0]==="-"?-1:1,"+-".indexOf(n[0])>=0&&(n=n.slice(1)),n===".inf"?i===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:n===".nan"?NaN:i*parseFloat(n,10)},predicate:function(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!=0||ar.isNegativeZero(t))},represent:function(t,n){var i;if(isNaN(t))switch(n){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(n){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(n){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(ar.isNegativeZero(t))return"-0.0";return i=t.toString(10),Vg.test(i)?i.replace("e",".e"):i},defaultStyle:"lowercase"}),Tw=Hp.extend({implicit:[$u,ah,kw,Rw]}),_w=Tw,$w=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Nw=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"),Hg=new as("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(t){return t!==null&&($w.exec(t)!==null||Nw.exec(t)!==null)},construct:function(t){var n,i,l,h,v,x,w,C,$=0,N=null;if((n=$w.exec(t))===null&&(n=Nw.exec(t)),n===null)throw new Error("Date resolve error");if(i=+n[1],l=+n[2]-1,h=+n[3],!n[4])return new Date(Date.UTC(i,l,h));if(v=+n[4],x=+n[5],w=+n[6],n[7]){for($=n[7].slice(0,3);$.length<3;)$+="0";$=+$}return n[9]&&(N=6e4*(60*+n[10]+ +(n[11]||0)),n[9]==="-"&&(N=-N)),C=new Date(Date.UTC(i,l,h,v,x,w,$)),N&&C.setTime(C.getTime()-N),C},instanceOf:Date,represent:function(t){return t.toISOString()}}),Dw=new as("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(t){return t==="<<"||t===null}}),Gg=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= +\r`,Pw=new as("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(t){if(t===null)return!1;var n,i,l=0,h=t.length,v=Gg;for(i=0;i64)){if(n<0)return!1;l+=6}return l%8==0},construct:function(t){var n,i,l=t.replace(/[\r\n=]/g,""),h=l.length,v=Gg,x=0,w=[];for(n=0;n>16&255),w.push(x>>8&255),w.push(255&x)),x=x<<6|v.indexOf(l.charAt(n));return(i=h%4*6)==0?(w.push(x>>16&255),w.push(x>>8&255),w.push(255&x)):i===18?(w.push(x>>10&255),w.push(x>>2&255)):i===12&&w.push(x>>4&255),new Uint8Array(w)},predicate:function(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"},represent:function(t){var n,i,l="",h=0,v=t.length,x=Gg;for(n=0;n>18&63],l+=x[h>>12&63],l+=x[h>>6&63],l+=x[63&h]),h=(h<<8)+t[n];return(i=v%3)==0?(l+=x[h>>18&63],l+=x[h>>12&63],l+=x[h>>6&63],l+=x[63&h]):i===2?(l+=x[h>>10&63],l+=x[h>>4&63],l+=x[h<<2&63],l+=x[64]):i===1&&(l+=x[h>>2&63],l+=x[h<<4&63],l+=x[64],l+=x[64]),l}}),iA=Object.prototype.hasOwnProperty,Xg=Object.prototype.toString,Mw=new as("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(t){if(t===null)return!0;var n,i,l,h,v,x=[],w=t;for(n=0,i=w.length;n>10),56320+(t-65536&1023))}for(var Wg=new Array(256),yc=new Array(256),Nu=0;Nu<256;Nu++)Wg[Nu]=Zg(Nu)?1:0,yc[Nu]=Zg(Nu);function uA(t,n){this.input=t,this.filename=n.filename||null,this.schema=n.schema||Yg,this.onWarning=n.onWarning||null,this.legacy=n.legacy||!1,this.json=n.json||!1,this.listener=n.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Vw(t,n){var i={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return i.snippet=Cw(i),new Rr(n,i)}function Bt(t,n){throw Vw(t,n)}function oh(t,n){t.onWarning&&t.onWarning.call(null,Vw(t,n))}var Du={YAML:function(t,n,i){var l,h,v;t.version!==null&&Bt(t,"duplication of %YAML directive"),i.length!==1&&Bt(t,"YAML directive accepts exactly one argument"),(l=/^([0-9]+)\.([0-9]+)$/.exec(i[0]))===null&&Bt(t,"ill-formed argument of the YAML directive"),h=parseInt(l[1],10),v=parseInt(l[2],10),h!==1&&Bt(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=v<2,v!==1&&v!==2&&oh(t,"unsupported YAML version of the document")},TAG:function(t,n,i){var l,h;i.length!==2&&Bt(t,"TAG directive accepts exactly two arguments"),l=i[0],h=i[1],Fw.test(l)||Bt(t,"ill-formed tag handle (first argument) of the TAG directive"),pl.call(t.tagMap,l)&&Bt(t,'there is a previously declared suffix for "'+l+'" tag handle'),qw.test(h)||Bt(t,"ill-formed tag prefix (second argument) of the TAG directive");try{h=decodeURIComponent(h)}catch{Bt(t,"tag prefix is malformed: "+h)}t.tagMap[l]=h}};function Xi(t,n,i,l){var h,v,x,w;if(n1&&(t.result+=ar.repeat(` +`,n-1))}function Jg(t,n){var i,l,h=t.tag,v=t.anchor,x=[],w=!1;if(t.firstTabInLine!==-1)return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=x),l=t.input.charCodeAt(t.position);l!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,Bt(t,"tab characters must not be used in indentation")),l===45)&&Qs(t.input.charCodeAt(t.position+1));)if(w=!0,t.position++,Nr(t,!0,-1)&&t.lineIndent<=n)x.push(null),l=t.input.charCodeAt(t.position);else if(i=t.line,Mu(t,n,3,!1,!0),x.push(t.result),Nr(t,!0,-1),l=t.input.charCodeAt(t.position),(t.line===i||t.lineIndent>n)&&l!==0)Bt(t,"bad indentation of a sequence entry");else if(t.lineIndentn?J=1:t.lineIndent===n?J=0:t.lineIndentn?J=1:t.lineIndent===n?J=0:t.lineIndentse)&&(Tt&&(Te=P.line,Ae=P.lineStart,qe=P.position),Mu(P,se,4,!0,ge)&&(Tt?qt=P.result:kn=P.result),Tt||(mo(P,Ie,Qe,ot,qt,kn,Te,Ae,qe),ot=qt=kn=null),Nr(P,!0,-1),Se=P.input.charCodeAt(P.position)),(P.line===pe||P.lineIndent>se)&&Se!==0)Bt(P,"bad indentation of a mapping entry");else if(P.lineIndent=0))break;ge===0?Bt(P,"bad explicit indentation width of a block scalar; it cannot be less than one"):Se?Bt(P,"repeat of an indentation width identifier"):(me=se+ge-1,Se=!0)}if(ba(pe)){do pe=P.input.charCodeAt(++P.position);while(ba(pe));if(pe===35)do pe=P.input.charCodeAt(++P.position);while(!Gi(pe)&&pe!==0)}for(;pe!==0;){for(Gp(P),P.lineIndent=0,pe=P.input.charCodeAt(P.position);(!Se||P.lineIndentme&&(me=P.lineIndent),Gi(pe))Me++;else{if(P.lineIndent0){for(ge=Te,pe=0;ge>0;ge--)(Te=Vw(Ae=P.input.charCodeAt(++P.position)))>=0?pe=(pe<<4)+Te:Bt(P,"expected hexadecimal character");P.result+=Hw(pe),P.position++}else Bt(P,"unknown escape sequence");ae=he=P.position}else Gi(Ae)?(Xi(P,ae,he,!0),lh(P,Nr(P,!1,se)),ae=he=P.position):P.position===P.lineStart&&Pu(P)?Bt(P,"unexpected end of the document within a double quoted scalar"):(P.position++,he=P.position)}Bt(P,"unexpected end of the stream within a double quoted scalar")})(t,F)?Z=!0:(function(P){var se,ae,he;if((he=P.input.charCodeAt(P.position))!==42)return!1;for(he=P.input.charCodeAt(++P.position),se=P.position;he!==0&&!Qs(he)&&!gc(he);)he=P.input.charCodeAt(++P.position);return P.position===se&&Bt(P,"name of an alias node must contain at least one character"),ae=P.input.slice(se,P.position),pl.call(P.anchorMap,ae)||Bt(P,'unidentified alias "'+ae+'"'),P.result=P.anchorMap[ae],Nr(P,!0,-1),!0})(t)?(Z=!0,t.tag===null&&t.anchor===null||Bt(t,"alias node should not have any properties")):(function(P,se,ae){var he,ge,pe,Te,Ae,qe,Se,me,Me=P.kind,Ie=P.result;if(Qs(me=P.input.charCodeAt(P.position))||gc(me)||me===35||me===38||me===42||me===33||me===124||me===62||me===39||me===34||me===37||me===64||me===96||(me===63||me===45)&&(Qs(he=P.input.charCodeAt(P.position+1))||ae&&gc(he)))return!1;for(P.kind="scalar",P.result="",ge=pe=P.position,Te=!1;me!==0;){if(me===58){if(Qs(he=P.input.charCodeAt(P.position+1))||ae&&gc(he))break}else if(me===35){if(Qs(P.input.charCodeAt(P.position-1)))break}else{if(P.position===P.lineStart&&Pu(P)||ae&&gc(me))break;if(Gi(me)){if(Ae=P.line,qe=P.lineStart,Se=P.lineIndent,Nr(P,!1,-1),P.lineIndent>=se){Te=!0,me=P.input.charCodeAt(P.position);continue}P.position=pe,P.line=Ae,P.lineStart=qe,P.lineIndent=Se;break}}Te&&(Xi(P,ge,pe,!1),lh(P,P.line-Ae),ge=pe=P.position,Te=!1),ba(me)||(pe=P.position+1),me=P.input.charCodeAt(++P.position)}return Xi(P,ge,pe,!1),!!P.result||(P.kind=Me,P.result=Ie,!1)})(t,F,i===1)&&(Z=!0,t.tag===null&&(t.tag="?")),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):J===0&&(Z=w&&Wg(t,U))),t.tag===null)t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);else if(t.tag==="?"){for(t.result!==null&&t.kind!=="scalar"&&Bt(t,'unacceptable node kind for ! tag; it should be "scalar", not "'+t.kind+'"'),C=0,$=t.implicitTypes.length;C<$;C+=1)if((_=t.implicitTypes[C]).resolve(t.result)){t.result=_.construct(t.result),t.tag=_.tag,t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);break}}else if(t.tag!=="!"){if(pl.call(t.typeMap[t.kind||"fallback"],t.tag))_=t.typeMap[t.kind||"fallback"][t.tag];else for(_=null,C=0,$=(N=t.typeMap.multi[t.kind||"fallback"]).length;C<$;C+=1)if(t.tag.slice(0,N[C].tag.length)===N[C].tag){_=N[C];break}_||Bt(t,"unknown tag !<"+t.tag+">"),t.result!==null&&_.kind!==t.kind&&Bt(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+_.kind+'", not "'+t.kind+'"'),_.resolve(t.result,t.tag)?(t.result=_.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):Bt(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||Z}function dA(t){var n,i,l,h,v=t.position,x=!1;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(h=t.input.charCodeAt(t.position))!==0&&(Nr(t,!0,-1),h=t.input.charCodeAt(t.position),!(t.lineIndent>0||h!==37));){for(x=!0,h=t.input.charCodeAt(++t.position),n=t.position;h!==0&&!Qs(h);)h=t.input.charCodeAt(++t.position);for(l=[],(i=t.input.slice(n,t.position)).length<1&&Bt(t,"directive name must not be less than one character in length");h!==0;){for(;ba(h);)h=t.input.charCodeAt(++t.position);if(h===35){do h=t.input.charCodeAt(++t.position);while(h!==0&&!Gi(h));break}if(Gi(h))break;for(n=t.position;h!==0&&!Qs(h);)h=t.input.charCodeAt(++t.position);l.push(t.input.slice(n,t.position))}h!==0&&Gp(t),pl.call(Du,i)?Du[i](t,i,l):oh(t,'unknown document directive "'+i+'"')}Nr(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,Nr(t,!0,-1)):x&&Bt(t,"directives end mark is expected"),Mu(t,t.lineIndent-1,4,!1,!0),Nr(t,!0,-1),t.checkLineBreaks&&lA.test(t.input.slice(v,t.position))&&oh(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&Pu(t)?t.input.charCodeAt(t.position)===46&&(t.position+=3,Nr(t,!0,-1)):t.position0){for(ge=Te,pe=0;ge>0;ge--)(Te=Uw(Ae=P.input.charCodeAt(++P.position)))>=0?pe=(pe<<4)+Te:Bt(P,"expected hexadecimal character");P.result+=Kw(pe),P.position++}else Bt(P,"unknown escape sequence");ae=he=P.position}else Gi(Ae)?(Xi(P,ae,he,!0),lh(P,Nr(P,!1,se)),ae=he=P.position):P.position===P.lineStart&&Pu(P)?Bt(P,"unexpected end of the document within a double quoted scalar"):(P.position++,he=P.position)}Bt(P,"unexpected end of the stream within a double quoted scalar")})(t,F)?Z=!0:(function(P){var se,ae,he;if((he=P.input.charCodeAt(P.position))!==42)return!1;for(he=P.input.charCodeAt(++P.position),se=P.position;he!==0&&!Qs(he)&&!gc(he);)he=P.input.charCodeAt(++P.position);return P.position===se&&Bt(P,"name of an alias node must contain at least one character"),ae=P.input.slice(se,P.position),pl.call(P.anchorMap,ae)||Bt(P,'unidentified alias "'+ae+'"'),P.result=P.anchorMap[ae],Nr(P,!0,-1),!0})(t)?(Z=!0,t.tag===null&&t.anchor===null||Bt(t,"alias node should not have any properties")):(function(P,se,ae){var he,ge,pe,Te,Ae,qe,Se,me,Me=P.kind,Ie=P.result;if(Qs(me=P.input.charCodeAt(P.position))||gc(me)||me===35||me===38||me===42||me===33||me===124||me===62||me===39||me===34||me===37||me===64||me===96||(me===63||me===45)&&(Qs(he=P.input.charCodeAt(P.position+1))||ae&&gc(he)))return!1;for(P.kind="scalar",P.result="",ge=pe=P.position,Te=!1;me!==0;){if(me===58){if(Qs(he=P.input.charCodeAt(P.position+1))||ae&&gc(he))break}else if(me===35){if(Qs(P.input.charCodeAt(P.position-1)))break}else{if(P.position===P.lineStart&&Pu(P)||ae&&gc(me))break;if(Gi(me)){if(Ae=P.line,qe=P.lineStart,Se=P.lineIndent,Nr(P,!1,-1),P.lineIndent>=se){Te=!0,me=P.input.charCodeAt(P.position);continue}P.position=pe,P.line=Ae,P.lineStart=qe,P.lineIndent=Se;break}}Te&&(Xi(P,ge,pe,!1),lh(P,P.line-Ae),ge=pe=P.position,Te=!1),ba(me)||(pe=P.position+1),me=P.input.charCodeAt(++P.position)}return Xi(P,ge,pe,!1),!!P.result||(P.kind=Me,P.result=Ie,!1)})(t,F,i===1)&&(Z=!0,t.tag===null&&(t.tag="?")),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):J===0&&(Z=w&&Jg(t,U))),t.tag===null)t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);else if(t.tag==="?"){for(t.result!==null&&t.kind!=="scalar"&&Bt(t,'unacceptable node kind for ! tag; it should be "scalar", not "'+t.kind+'"'),C=0,$=t.implicitTypes.length;C<$;C+=1)if((_=t.implicitTypes[C]).resolve(t.result)){t.result=_.construct(t.result),t.tag=_.tag,t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);break}}else if(t.tag!=="!"){if(pl.call(t.typeMap[t.kind||"fallback"],t.tag))_=t.typeMap[t.kind||"fallback"][t.tag];else for(_=null,C=0,$=(N=t.typeMap.multi[t.kind||"fallback"]).length;C<$;C+=1)if(t.tag.slice(0,N[C].tag.length)===N[C].tag){_=N[C];break}_||Bt(t,"unknown tag !<"+t.tag+">"),t.result!==null&&_.kind!==t.kind&&Bt(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+_.kind+'", not "'+t.kind+'"'),_.resolve(t.result,t.tag)?(t.result=_.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):Bt(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||Z}function dA(t){var n,i,l,h,v=t.position,x=!1;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(h=t.input.charCodeAt(t.position))!==0&&(Nr(t,!0,-1),h=t.input.charCodeAt(t.position),!(t.lineIndent>0||h!==37));){for(x=!0,h=t.input.charCodeAt(++t.position),n=t.position;h!==0&&!Qs(h);)h=t.input.charCodeAt(++t.position);for(l=[],(i=t.input.slice(n,t.position)).length<1&&Bt(t,"directive name must not be less than one character in length");h!==0;){for(;ba(h);)h=t.input.charCodeAt(++t.position);if(h===35){do h=t.input.charCodeAt(++t.position);while(h!==0&&!Gi(h));break}if(Gi(h))break;for(n=t.position;h!==0&&!Qs(h);)h=t.input.charCodeAt(++t.position);l.push(t.input.slice(n,t.position))}h!==0&&Gp(t),pl.call(Du,i)?Du[i](t,i,l):oh(t,'unknown document directive "'+i+'"')}Nr(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,Nr(t,!0,-1)):x&&Bt(t,"directives end mark is expected"),Mu(t,t.lineIndent-1,4,!1,!0),Nr(t,!0,-1),t.checkLineBreaks&&lA.test(t.input.slice(v,t.position))&&oh(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&Pu(t)?t.input.charCodeAt(t.position)===46&&(t.position+=3,Nr(t,!0,-1)):t.position=55296&&l<=56319&&n+1=56320&&i<=57343?1024*(l-55296)+i-56320+65536:l}function vc(t){return/^\n* /.test(t)}function ey(t,n,i,l,h){t.dump=(function(){if(n.length===0)return t.quotingType===2?'""':"''";if(!t.noCompatMode&&(Qw.indexOf(n)!==-1||e0.test(n)))return t.quotingType===2?'"'+n+'"':"'"+n+"'";var v=t.indent*Math.max(1,i),x=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-v),w=l||t.flowLevel>-1&&i>=t.flowLevel;switch((function(C,$,N,_,F,U,J,Y){var Z,P,se=0,ae=null,he=!1,ge=!1,pe=_!==-1,Te=-1,Ae=yo(P=wa(C,0))&&P!==65279&&!zu(P)&&P!==45&&P!==63&&P!==58&&P!==44&&P!==91&&P!==93&&P!==123&&P!==125&&P!==35&&P!==38&&P!==42&&P!==33&&P!==124&&P!==61&&P!==62&&P!==39&&P!==34&&P!==37&&P!==64&&P!==96&&(function(qe){return!zu(qe)&&qe!==58})(wa(C,C.length-1));if($||J)for(Z=0;Z=65536?Z+=2:Z++){if(!yo(se=wa(C,Z)))return 5;Ae=Ae&&Qg(se,ae,Y),ae=se}else{for(Z=0;Z=65536?Z+=2:Z++){if((se=wa(C,Z))===10)he=!0,pe&&(ge=ge||Z-Te-1>_&&C[Te+1]!==" ",Te=Z);else if(!yo(se))return 5;Ae=Ae&&Qg(se,ae,Y),ae=se}ge=ge||pe&&Z-Te-1>_&&C[Te+1]!==" "}return he||ge?N>9&&vc(C)?5:J?U===2?5:2:ge?4:3:!Ae||J||F(C)?U===2?5:2:1})(n,w,t.indent,x,(function(C){return(function($,N){var _,F;for(_=0,F=$.implicitTypes.length;_"+ty(n,t.indent)+ml(n0((function(C,$){for(var N,_,F,U=/(\n+)([^\n]*)/g,J=(F=(F=C.indexOf(` -`))!==-1?F:C.length,U.lastIndex=F,ny(C.slice(0,F),$)),Y=C[0]===` +`+ar.repeat(" ",t.indent*n)}function Lu(t){return t===32||t===9}function go(t){return 32<=t&&t<=126||161<=t&&t<=55295&&t!==8232&&t!==8233||57344<=t&&t<=65533&&t!==65279||65536<=t&&t<=1114111}function Xp(t){return go(t)&&t!==65279&&t!==13&&t!==10}function ey(t,n,i){var l=Xp(t),h=l&&!Lu(t);return(i?l:l&&t!==44&&t!==91&&t!==93&&t!==123&&t!==125)&&t!==35&&!(n===58&&!h)||Xp(n)&&!Lu(n)&&t===35||n===58&&h}function wa(t,n){var i,l=t.charCodeAt(n);return l>=55296&&l<=56319&&n+1=56320&&i<=57343?1024*(l-55296)+i-56320+65536:l}function vc(t){return/^\n* /.test(t)}function ty(t,n,i,l,h){t.dump=(function(){if(n.length===0)return t.quotingType===2?'""':"''";if(!t.noCompatMode&&(Ww.indexOf(n)!==-1||Jw.test(n)))return t.quotingType===2?'"'+n+'"':"'"+n+"'";var v=t.indent*Math.max(1,i),x=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-v),w=l||t.flowLevel>-1&&i>=t.flowLevel;switch((function(C,$,N,_,F,U,J,Y){var Z,P,se=0,ae=null,he=!1,ge=!1,pe=_!==-1,Te=-1,Ae=go(P=wa(C,0))&&P!==65279&&!Lu(P)&&P!==45&&P!==63&&P!==58&&P!==44&&P!==91&&P!==93&&P!==123&&P!==125&&P!==35&&P!==38&&P!==42&&P!==33&&P!==124&&P!==61&&P!==62&&P!==39&&P!==34&&P!==37&&P!==64&&P!==96&&(function(qe){return!Lu(qe)&&qe!==58})(wa(C,C.length-1));if($||J)for(Z=0;Z=65536?Z+=2:Z++){if(!go(se=wa(C,Z)))return 5;Ae=Ae&&ey(se,ae,Y),ae=se}else{for(Z=0;Z=65536?Z+=2:Z++){if((se=wa(C,Z))===10)he=!0,pe&&(ge=ge||Z-Te-1>_&&C[Te+1]!==" ",Te=Z);else if(!go(se))return 5;Ae=Ae&&ey(se,ae,Y),ae=se}ge=ge||pe&&Z-Te-1>_&&C[Te+1]!==" "}return he||ge?N>9&&vc(C)?5:J?U===2?5:2:ge?4:3:!Ae||J||F(C)?U===2?5:2:1})(n,w,t.indent,x,(function(C){return(function($,N){var _,F;for(_=0,F=$.implicitTypes.length;_"+ny(n,t.indent)+ml(e0((function(C,$){for(var N,_,F,U=/(\n+)([^\n]*)/g,J=(F=(F=C.indexOf(` +`))!==-1?F:C.length,U.lastIndex=F,ry(C.slice(0,F),$)),Y=C[0]===` `||C[0]===" ";_=U.exec(C);){var Z=_[1],P=_[2];N=P[0]===" ",J+=Z+(Y||N||P===""?"":` -`)+ny(P,$),Y=N}return J})(n,x),v));case 5:return'"'+(function(C){for(var $,N="",_=0,F=0;F=65536?F+=2:F++)_=wa(C,F),!($=Jw[_])&&yo(_)?(N+=C[F],_>=65536&&(N+=C[F+1])):N+=$||t0(_);return N})(n)+'"';default:throw new Rr("impossible error: invalid scalar style")}})()}function ty(t,n){var i=vc(t)?String(n):"",l=t[t.length-1]===` +`)+ry(P,$),Y=N}return J})(n,x),v));case 5:return'"'+(function(C){for(var $,N="",_=0,F=0;F=65536?F+=2:F++)_=wa(C,F),!($=Zw[_])&&go(_)?(N+=C[F],_>=65536&&(N+=C[F+1])):N+=$||Qw(_);return N})(n)+'"';default:throw new Rr("impossible error: invalid scalar style")}})()}function ny(t,n){var i=vc(t)?String(n):"",l=t[t.length-1]===` `;return i+(!l||t[t.length-2]!==` `&&t!==` `?l?"":"-":"+")+` `}function ml(t){return t[t.length-1]===` -`?t.slice(0,-1):t}function ny(t,n){if(t===""||t[0]===" ")return t;for(var i,l,h=/ [^ ]/g,v=0,x=0,w=0,C="";i=h.exec(t);)(w=i.index)-v>n&&(l=x>v?x:w,C+=` +`?t.slice(0,-1):t}function ry(t,n){if(t===""||t[0]===" ")return t;for(var i,l,h=/ [^ ]/g,v=0,x=0,w=0,C="";i=h.exec(t);)(w=i.index)-v>n&&(l=x>v?x:w,C+=` `+t.slice(v,l),v=l+1),x=w;return C+=` `,t.length-v>n&&x>v?C+=t.slice(v,x)+` -`+t.slice(x+1):C+=t.slice(v),C.slice(1)}function ry(t,n,i,l){var h,v,x,w="",C=t.tag;for(h=0,v=i.length;h tag resolver accepts not "'+C+'" style');l=w.represent[C](n,C)}t.dump=l}return!0}return!1}function vo(t,n,i,l,h,v,x){t.tag=null,t.dump=i,sy(t,i,!1)||sy(t,i,!0);var w,C=ei.call(t.dump),$=l;l&&(l=t.flowLevel<0||t.flowLevel>n);var N,_,F=C==="[object Object]"||C==="[object Array]";if(F&&(_=(N=t.duplicates.indexOf(i))!==-1),(t.tag!==null&&t.tag!=="?"||_||t.indent!==2&&n>0)&&(h=!1),_&&t.usedDuplicates[N])t.dump="*ref_"+N;else{if(F&&_&&!t.usedDuplicates[N]&&(t.usedDuplicates[N]=!0),C==="[object Object]")l&&Object.keys(t.dump).length!==0?((function(U,J,Y,Z){var P,se,ae,he,ge,pe,Te="",Ae=U.tag,qe=Object.keys(Y);if(U.sortKeys===!0)qe.sort();else if(typeof U.sortKeys=="function")qe.sort(U.sortKeys);else if(U.sortKeys)throw new Rr("sortKeys must be a boolean or a function");for(P=0,se=qe.length;P1024)&&(U.dump&&U.dump.charCodeAt(0)===10?pe+="?":pe+="? "),pe+=U.dump,ge&&(pe+=fl(U,J)),vo(U,J+1,he,!0,ge)&&(U.dump&&U.dump.charCodeAt(0)===10?pe+=":":pe+=": ",Te+=pe+=U.dump));U.tag=Ae,U.dump=Te||"{}"})(t,n,t.dump,h),_&&(t.dump="&ref_"+N+t.dump)):((function(U,J,Y){var Z,P,se,ae,he,ge="",pe=U.tag,Te=Object.keys(Y);for(Z=0,P=Te.length;Z1024&&(he+="? "),he+=U.dump+(U.condenseFlow?'"':"")+":"+(U.condenseFlow?"":" "),vo(U,J,ae,!1,!1)&&(ge+=he+=U.dump));U.tag=pe,U.dump="{"+ge+"}"})(t,n,t.dump),_&&(t.dump="&ref_"+N+" "+t.dump));else if(C==="[object Array]")l&&t.dump.length!==0?(t.noArrayIndent&&!x&&n>0?ry(t,n-1,t.dump,h):ry(t,n,t.dump,h),_&&(t.dump="&ref_"+N+t.dump)):((function(U,J,Y){var Z,P,se,ae="",he=U.tag;for(Z=0,P=Y.length;Z",t.dump=w+" "+t.dump)}return!0}function fA(t,n){var i,l,h=[],v=[];for(iy(t,h,v),i=0,l=v.length;i(n[i]=(function(h){return h.includes(", ")?h.split(", "):h})(l),n)),{})}function Qp(t,n,{loadSpec:i=!1}={}){const l={ok:t.ok,url:t.url||n,status:t.status,statusText:t.statusText,headers:ti(t.headers)},h=l.headers["content-type"],v=i||((x="")=>/(json|xml|yaml|text)\b/.test(x))(h);return(v?t.text:t.blob||t.buffer).call(t).then((x=>{if(l.text=x,l.data=x,v)try{const w=(function(C,$){return $&&($.indexOf("application/json")===0||$.indexOf("+json")>0)?JSON.parse(C):qu.load(C)})(x,h);l.body=w,l.obj=w}catch(w){l.parseError=w}return l}))}async function ni(t,n={}){typeof t=="object"&&(t=(n=t).url),n.headers=n.headers||{},(n=qp(n)).headers&&Object.keys(n.headers).forEach((h=>{const v=n.headers[h];typeof v=="string"&&(n.headers[h]=v.replace(/\n+/g," "))})),n.requestInterceptor&&(n=await n.requestInterceptor(n)||n);const i=n.headers["content-type"]||n.headers["Content-Type"];let l;/multipart\/form-data/i.test(i)&&(delete n.headers["content-type"],delete n.headers["Content-Type"]);try{l=await(n.userFetch||fetch)(n.url,n),l=await Qp(l,t,n),n.responseInterceptor&&(l=await n.responseInterceptor(l)||l)}catch(h){if(!l)throw h;const v=new Error(l.statusText||`response status is ${l.status}`);throw v.status=l.status,v.statusCode=l.status,v.responseError=h,v}if(!l.ok){const h=new Error(l.statusText||`response status is ${l.status}`);throw h.status=l.status,h.statusCode=l.status,h.response=l,h}return l}function cy(t,n={}){const{requestInterceptor:i,responseInterceptor:l}=n,h=t.withCredentials?"include":"same-origin";return v=>t({url:v,loadSpec:!0,requestInterceptor:i,responseInterceptor:l,headers:{Accept:"application/json, application/yaml"},credentials:h}).then((x=>x.body))}const Bu=t=>{var n,i;const{baseDoc:l,url:h}=t,v=(n=l??h)!==null&&n!==void 0?n:"";return typeof((i=globalThis.document)===null||i===void 0?void 0:i.baseURI)=="string"?String(new URL(v,globalThis.document.baseURI)):v},gl=t=>{const{fetch:n,http:i}=t;return n||i||ni};var Uu,i0=(Uu=function(t,n){return Uu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,l){i.__proto__=l}||function(i,l){for(var h in l)l.hasOwnProperty(h)&&(i[h]=l[h])},Uu(t,n)},function(t,n){function i(){this.constructor=t}Uu(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}),uy=Object.prototype.hasOwnProperty;function ef(t,n){return uy.call(t,n)}function ri(t){if(Array.isArray(t)){for(var n=new Array(t.length),i=0;i=48&&n<=57))return!1;i++}return!0}function Ia(t){return t.indexOf("/")===-1&&t.indexOf("~")===-1?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}function Ku(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function si(t){if(t===void 0)return!0;if(t){if(Array.isArray(t)){for(var n=0,i=t.length;n0&&w[$-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(i&&_===void 0&&(C[F]===void 0?_=w.slice(0,$).join("/"):$==N-1&&(_=n.path),_!==void 0&&U(n,0,t,_)),$++,Array.isArray(C)){if(F==="-")F=C.length;else{if(i&&!yl(F))throw new Kn("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",v,n,t);yl(F)&&(F=~~F)}if($>=N){if(i&&n.op==="add"&&F>C.length)throw new Kn("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",v,n,t);if((x=a0[n.op].call(n,C,F,t)).test===!1)throw new Kn("Test operation failed","TEST_OPERATION_FAILED",v,n,t);return x}}else if($>=N){if((x=ii[n.op].call(n,C,F,t)).test===!1)throw new Kn("Test operation failed","TEST_OPERATION_FAILED",v,n,t);return x}if(C=C[F],i&&$0)throw new Kn('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",n,t,i);if((t.op==="move"||t.op==="copy")&&typeof t.from!="string")throw new Kn("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",n,t,i);if((t.op==="add"||t.op==="replace"||t.op==="test")&&t.value===void 0)throw new Kn("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",n,t,i);if((t.op==="add"||t.op==="replace"||t.op==="test")&&si(t.value))throw new Kn("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",n,t,i);if(i){if(t.op=="add"){var h=t.path.split("/").length,v=l.split("/").length;if(h!==v+1&&h!==v)throw new Kn("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",n,t,i)}else if(t.op==="replace"||t.op==="remove"||t.op==="_get"){if(t.path!==l)throw new Kn("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",n,t,i)}else if(t.op==="move"||t.op==="copy"){var x=hr([{op:"_get",path:t.from,value:void 0}],i);if(x&&x.name==="OPERATION_PATH_UNRESOLVABLE")throw new Kn("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",n,t,i)}}}function hr(t,n,i){try{if(!Array.isArray(t))throw new Kn("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(n)wo(ls(n),ls(t),i||!0);else{i=i||Fr;for(var l=0;l0&&(t.patches=[],t.callback&&t.callback(l)),l}function nf(t,n,i,l,h){if(n!==t){typeof n.toJSON=="function"&&(n=n.toJSON());for(var v=ri(n),x=ri(t),w=!1,C=x.length-1;C>=0;C--){var $=t[_=x[C]];if(!ef(n,_)||n[_]===void 0&&$!==void 0&&Array.isArray(n)===!1)Array.isArray(t)===Array.isArray(n)?(h&&i.push({op:"test",path:l+"/"+Ia(_),value:ls($)}),i.push({op:"remove",path:l+"/"+Ia(_)}),w=!0):(h&&i.push({op:"test",path:l,value:t}),i.push({op:"replace",path:l,value:n}));else{var N=n[_];typeof $=="object"&&$!=null&&typeof N=="object"&&N!=null&&Array.isArray($)===Array.isArray(N)?nf($,N,i,l+"/"+Ia(_),h):$!==N&&(h&&i.push({op:"test",path:l+"/"+Ia(_),value:ls($)}),i.push({op:"replace",path:l+"/"+Ia(_),value:ls(N)}))}}if(w||v.length!=x.length)for(C=0;Cl!==void 0&&i?i[l]:i),t)},applyPatch:function(t,n,i){if(i=i||{},(n={...n,path:n.path&&jc(n.path)}).op==="merge"){const l=Sl(t,n.path);Object.assign(l,n.value),wo(t,[Cc(n.path,l)])}else if(n.op==="mergeDeep"){const l=Sl(t,n.path),h=py(l,n.value);t=wo(t,[Cc(n.path,h)]).newDocument}else if(n.op==="add"&&n.path===""&&Ac(n.value)){const l=Object.keys(n.value).reduce(((h,v)=>(h.push({op:"add",path:`/${jc(v)}`,value:n.value[v]}),h)),[]);wo(t,l)}else if(n.op==="replace"&&n.path===""){let{value:l}=n;i.allowMetaPatches&&n.meta&&wl(n)&&(Array.isArray(n.value)||Ac(n.value))&&(l={...l,...n.meta}),t=l}else if(wo(t,[n]),i.allowMetaPatches&&n.meta&&wl(n)&&(Array.isArray(n.value)||Ac(n.value))){const l={...Sl(t,n.path),...n.meta};wo(t,[Cc(n.path,l)])}return t},parentPathMatch:function(t,n){if(!Array.isArray(n))return!1;for(let i=0,l=n.length;i(n+"").replace(/~/g,"~0").replace(/\//g,"~1"))).join("/")}`:t}function Cc(t,n,i){return{op:"replace",path:t,value:n,meta:i}}function bl(t,n,i){return o0(uh(t.filter(wl).map((l=>n(l.value,i,l.path)))||[]))}function Wr(t,n,i){return i=i||[],Array.isArray(t)?t.map(((l,h)=>Wr(l,n,i.concat(h)))):Ac(t)?Object.keys(t).map((l=>Wr(t[l],n,i.concat(l)))):n(t,i[i.length-1],i)}function Hu(t,n,i){let l=[];if((i=i||[]).length>0){const h=n(t,i[i.length-1],i);h&&(l=l.concat(h))}if(Array.isArray(t)){const h=t.map(((v,x)=>Hu(v,n,i.concat(x))));h&&(l=l.concat(h))}else if(Ac(t)){const h=Object.keys(t).map((v=>Hu(t[v],n,i.concat(v))));h&&(l=l.concat(h))}return l=uh(l),l}function fy(t){return Array.isArray(t)?t:[t]}function uh(t){return[].concat(...t.map((n=>Array.isArray(n)?uh(n):n)))}function o0(t){return t.filter((n=>n!==void 0))}function Ac(t){return t&&typeof t=="object"}function Dr(t){return t&&typeof t=="function"}function rf(t){if(Xu(t)){const{op:n}=t;return n==="add"||n==="remove"||n==="replace"}return!1}function Gu(t){return rf(t)||Xu(t)&&t.type==="mutation"}function wl(t){return Gu(t)&&(t.op==="add"||t.op==="replace"||t.op==="merge"||t.op==="mergeDeep")}function Xu(t){return t&&typeof t=="object"}function Sl(t,n){try{return wc(t,n)}catch(i){return console.error(i),{}}}var qa=function(t){return t&&t.Math===Math&&t},ji=qa(typeof globalThis=="object"&&globalThis)||qa(typeof window=="object"&&window)||qa(typeof self=="object"&&self)||qa(typeof Um=="object"&&Um)||qa(!1)||(function(){return this})()||Function("return this")(),Zi=function(t){try{return!!t()}catch{return!0}},sf=!Zi((function(){var t=(function(){}).bind();return typeof t!="function"||t.hasOwnProperty("prototype")})),l0=sf,El=Function.prototype,af=El.apply,dh=El.call,of=typeof Reflect=="object"&&Reflect.apply||(l0?dh.bind(af):function(){return dh.apply(af,arguments)}),Oc=sf,lf=Function.prototype,Yu=lf.call,cf=Oc&&lf.bind.bind(Yu,Yu),Wi=Oc?cf:function(t){return function(){return Yu.apply(t,arguments)}},my=Wi,kc=my({}.toString),Rc=my("".slice),uf=function(t){return Rc(kc(t),8,-1)},c0=uf,Zu=Wi,Tc=function(t){if(c0(t)==="Function")return Zu(t)},Wu=typeof document=="object"&&document.all,ks=Wu===void 0&&Wu!==void 0?function(t){return typeof t=="function"||t===Wu}:function(t){return typeof t=="function"},Ju={},Eo=!Zi((function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})),_c=sf,hh=Function.prototype.call,li=_c?hh.bind(hh):function(){return hh.apply(hh,arguments)},df={},hf={}.propertyIsEnumerable,jo=Object.getOwnPropertyDescriptor,jl=jo&&!hf.call({1:2},1);df.f=jl?function(t){var n=jo(this,t);return!!n&&n.enumerable}:hf;var Ji,Qu,$c=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}},ph=Zi,fh=uf,pf=Object,u0=Wi("".split),ed=ph((function(){return!pf("z").propertyIsEnumerable(0)}))?function(t){return fh(t)==="String"?u0(t,""):pf(t)}:pf,td=function(t){return t==null},d0=td,gy=TypeError,nd=function(t){if(d0(t))throw new gy("Can't call method on "+t);return t},Ci=ed,Qi=nd,ea=function(t){return Ci(Qi(t))},yy=ks,Ea=function(t){return typeof t=="object"?t!==null:yy(t)},Ba={},Is=Ba,jr=ji,ff=ks,Ua=function(t){return ff(t)?t:void 0},en=function(t,n){return arguments.length<2?Ua(Is[t])||Ua(jr[t]):Is[t]&&Is[t][n]||jr[t]&&jr[t][n]},Vn=Wi({}.isPrototypeOf),Pr=ji.navigator,mh=Pr&&Pr.userAgent,Nc=ji,Co=mh?String(mh):"",gh=Nc.process,rd=Nc.Deno,Dc=gh&&gh.versions||rd&&rd.version,h0=Dc&&Dc.v8;h0&&(Qu=(Ji=h0.split("."))[0]>0&&Ji[0]<4?1:+(Ji[0]+Ji[1])),!Qu&&Co&&(!(Ji=Co.match(/Edge\/(\d+)/))||Ji[1]>=74)&&(Ji=Co.match(/Chrome\/(\d+)/))&&(Qu=+Ji[1]);var Cr=Qu,vy=Zi,xy=ji.String,by=!!Object.getOwnPropertySymbols&&!vy((function(){var t=Symbol("symbol detection");return!xy(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&Cr&&Cr<41})),wy=by&&!Symbol.sham&&typeof Symbol.iterator=="symbol",mA=en,Sy=ks,Ey=Vn,jy=Object,Rs=wy?function(t){return typeof t=="symbol"}:function(t){var n=mA("Symbol");return Sy(n)&&Ey(n.prototype,jy(t))},Mr=String,sd=function(t){try{return Mr(t)}catch{return"Object"}},yh=ks,mf=sd,Cy=TypeError,ta=function(t){if(yh(t))return t;throw new Cy(mf(t)+" is not a function")},gf=ta,Ay=td,vh=function(t,n){var i=t[n];return Ay(i)?void 0:gf(i)},Oy=li,ky=ks,Ry=Ea,p0=TypeError,Ty={exports:{}},_y=ji,$y=Object.defineProperty,f0=ji,m0=Ty.exports=f0.o||(function(t,n){try{$y(_y,t,{value:n,configurable:!0,writable:!0})}catch{_y[t]=n}return n})("__core-js_shared__",{});(m0.versions||(m0.versions=[])).push({version:"3.38.1",mode:"pure",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Ny=Ty.exports,Dy=Ny,Py=function(t,n){return Dy[t]||(Dy[t]=n||{})},My=nd,g0=Object,Iy=function(t){return g0(My(t))},y0=Iy,v0=Wi({}.hasOwnProperty),Ka=Object.hasOwn||function(t,n){return v0(y0(t),n)},gA=Wi,x0=0,id=Math.random(),b0=gA(1 .toString),xh=function(t){return"Symbol("+(t===void 0?"":t)+")_"+b0(++x0+id,36)},yf=Py,zy=Ka,Ly=xh,yA=by,w0=wy,Pc=ji.Symbol,vf=yf("wks"),S0=w0?Pc.for||Pc:Pc&&Pc.withoutSetter||Ly,Va=function(t){return zy(vf,t)||(vf[t]=yA&&zy(Pc,t)?Pc[t]:S0("Symbol."+t)),vf[t]},Fy=li,qy=Ea,By=Rs,Uy=vh,E0=TypeError,j0=Va("toPrimitive"),vA=function(t,n){if(!qy(t)||By(t))return t;var i,l=Uy(t,j0);if(l){if(i=Fy(l,t,n),!qy(i)||By(i))return i;throw new E0("Can't convert object to primitive value")}return(function(h,v){var x,w;if(ky(x=h.toString)&&!Ry(w=Oy(x,h))||ky(x=h.valueOf)&&!Ry(w=Oy(x,h)))return w;throw new p0("Can't convert object to primitive value")})(t)},Ky=Rs,Vy=function(t){var n=vA(t,"string");return Ky(n)?n:n+""},Hy=Ea,bh=ji.document,C0=Hy(bh)&&Hy(bh.createElement),Gy=function(t){return C0?bh.createElement(t):{}},xA=Gy,A0=!Eo&&!Zi((function(){return Object.defineProperty(xA("div"),"a",{get:function(){return 7}}).a!==7})),O0=Eo,wh=li,Xy=df,xf=$c,k0=ea,R0=Vy,Sh=Ka,T0=A0,bf=Object.getOwnPropertyDescriptor;Ju.f=O0?bf:function(t,n){if(t=k0(t),n=R0(n),T0)try{return bf(t,n)}catch{}if(Sh(t,n))return xf(!wh(Xy.f,t,n),t[n])};var _0=Zi,Yy=ks,Zy=/#|\.prototype\./,ad=function(t,n){var i=Mc[$0(t)];return i===D0||i!==N0&&(Yy(n)?_0(n):!!n)},$0=ad.normalize=function(t){return String(t).replace(Zy,".").toLowerCase()},Mc=ad.data={},N0=ad.NATIVE="N",D0=ad.POLYFILL="P",P0=ad,wf=ta,M0=sf,Wy=Tc(Tc.bind),Jy=function(t,n){return wf(t),n===void 0?t:M0?Wy(t,n):function(){return t.apply(n,arguments)}},Cl={},I0=Eo&&Zi((function(){return Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype!==42})),Qy=Ea,qr=String,vs=TypeError,Al=function(t){if(Qy(t))return t;throw new vs(qr(t)+" is not an object")},z0=Eo,L0=A0,F0=I0,Ol=Al,ev=Vy,Sf=TypeError,Ef=Object.defineProperty,bA=Object.getOwnPropertyDescriptor;Cl.f=z0?F0?function(t,n,i){if(Ol(t),n=ev(n),Ol(i),typeof t=="function"&&n==="prototype"&&"value"in i&&"writable"in i&&!i.writable){var l=bA(t,n);l&&l.writable&&(t[n]=i.value,i={configurable:"configurable"in i?i.configurable:l.configurable,enumerable:"enumerable"in i?i.enumerable:l.enumerable,writable:!1})}return Ef(t,n,i)}:Ef:function(t,n,i){if(Ol(t),n=ev(n),Ol(i),L0)try{return Ef(t,n,i)}catch{}if("get"in i||"set"in i)throw new Sf("Accessors not supported");return"value"in i&&(t[n]=i.value),t};var jf=Cl,tv=$c,Ao=Eo?function(t,n,i){return jf.f(t,n,tv(1,i))}:function(t,n,i){return t[n]=i,t},od=ji,q0=of,nv=Tc,rv=ks,sv=Ju.f,B0=P0,kl=Ba,Cf=Jy,Rl=Ao,iv=Ka,av=function(t){var n=function(i,l,h){if(this instanceof n){switch(arguments.length){case 0:return new t;case 1:return new t(i);case 2:return new t(i,l)}return new t(i,l,h)}return q0(t,this,arguments)};return n.prototype=t.prototype,n},Eh=function(t,n){var i,l,h,v,x,w,C,$,N,_=t.target,F=t.global,U=t.stat,J=t.proto,Y=F?od:U?od[_]:od[_]&&od[_].prototype,Z=F?kl:kl[_]||Rl(kl,_,{})[_],P=Z.prototype;for(v in n)l=!(i=B0(F?v:_+(U?".":"#")+v,t.forced))&&Y&&iv(Y,v),w=Z[v],l&&(C=t.dontCallGetSet?(N=sv(Y,v))&&N.value:Y[v]),x=l&&C?C:n[v],(i||J||typeof w!=typeof x)&&($=t.bind&&l?Cf(x,od):t.wrap&&l?av(x):J&&rv(x)?nv(x):x,(t.sham||x&&x.sham||w&&w.sham)&&Rl($,"sham",!0),Rl(Z,v,$),J&&(iv(kl,h=_+"Prototype")||Rl(kl,h,{}),Rl(kl[h],v,x),t.real&&P&&(i||!P[v])&&Rl(P,v,x)))},Oo=xh,Af=Py("keys"),ov=function(t){return Af[t]||(Af[t]=Oo(t))},U0=!Zi((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),ko=Ka,lv=ks,K0=Iy,Of=U0,ld=ov("IE_PROTO"),or=Object,wA=or.prototype,cv=Of?or.getPrototypeOf:function(t){var n=K0(t);if(ko(n,ld))return n[ld];var i=n.constructor;return lv(i)&&n instanceof i?i.prototype:n instanceof or?wA:null},V0=Wi,jh=ta,Tl=Ea,H0=String,G0=TypeError,Ch=Ea,Ha=nd,X0=function(t){if((function(n){return Tl(n)||n===null})(t))return t;throw new G0("Can't set "+H0(t)+" as a prototype")},Ah=Object.setPrototypeOf||("__proto__"in{}?(function(){var t,n=!1,i={};try{(t=(function(l,h,v){try{return V0(jh(Object.getOwnPropertyDescriptor(l,h)[v]))}catch{}})(Object.prototype,"__proto__","set"))(i,[]),n=i instanceof Array}catch{}return function(l,h){return Ha(l),X0(h),Ch(l)&&(n?t(l,h):l.__proto__=h),l}})():void 0),uv={},dv=Math.ceil,hv=Math.floor,kf=Math.trunc||function(t){var n=+t;return(n>0?hv:dv)(n)},Rf=function(t){var n=+t;return n!=n||n===0?0:kf(n)},Ro=Rf,Br=Math.max,pv=Math.min,Y0=Rf,cs=Math.min,Z0=function(t){return(function(n){var i=Y0(n);return i>0?cs(i,9007199254740991):0})(t.length)},W0=ea,J0=Z0,xr=function(t){return function(n,i,l){var h=W0(n),v=J0(h);if(v===0)return!t&&-1;var x,w=(function(C,$){var N=Ro(C);return N<0?Br(N+$,0):pv(N,$)})(l,v);if(t&&i!=i){for(;v>w;)if((x=h[w++])!=x)return!0}else for(;v>w;w++)if((t||w in h)&&h[w]===i)return t||w||0;return!t&&-1}},ci={indexOf:xr(!1)},ja={},Tf=Ka,Q0=ea,eS=ci.indexOf,SA=ja,Oh=Wi([].push),zs=function(t,n){var i,l=Q0(t),h=0,v=[];for(i in l)!Tf(SA,i)&&Tf(l,i)&&Oh(v,i);for(;n.length>h;)Tf(l,i=n[h++])&&(~eS(v,i)||Oh(v,i));return v},Ai=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],tS=zs,ui=Ai.concat("length","prototype");uv.f=Object.getOwnPropertyNames||function(t){return tS(t,ui)};var fv={};fv.f=Object.getOwnPropertySymbols;var To=en,Ic=uv,_o=fv,mv=Al,gv=Wi([].concat),Ca=To("Reflect","ownKeys")||function(t){var n=Ic.f(mv(t)),i=_o.f;return i?gv(n,i(t)):n},yv=Ka,cd=Ca,kh=Ju,Rh=Cl,zc=function(t,n,i){for(var l=cd(n),h=Rh.f,v=kh.f,x=0;xx;)EA.f(t,i=h[x++],l[i]);return t};var hn,An=en("document","documentElement"),Wn=Al,Oi=vv,$o=Ai,ud=ja,xv=An,No=Gy,Ar=ov("IE_PROTO"),Ga=function(){},_l=function(t){return" - + + diff --git a/internal/web/dist/index.html.br b/internal/web/dist/index.html.br index da54db0..57f586b 100644 Binary files a/internal/web/dist/index.html.br and b/internal/web/dist/index.html.br differ diff --git a/internal/web/dist/index.html.gz b/internal/web/dist/index.html.gz index 55000c9..d153132 100644 Binary files a/internal/web/dist/index.html.gz and b/internal/web/dist/index.html.gz differ