From 226ad00c6e35dbd4d4a785b8fbb024097d03840c Mon Sep 17 00:00:00 2001 From: fahimreza-dev Date: Mon, 5 Oct 2026 05:51:48 +0600 Subject: [PATCH 1/2] feat(modules): a module can be one page, with no sidebar A descriptor's 'layout' => 'page' draws the module as one page: no sidebar and no icon tab row. Its first tab is the page, 1040 wide like Home. Settings, reached by address, reads Saddle / Module / Settings and the module crumb leads back. A drill-in reads Saddle / Module / title. saddleShell.has( 'page-layout' ) tells a module; older Core ignores the key, and Rank and CRM keep the sidebar. Refs #330 Co-Authored-By: Claude Opus 5.5 --- admin/src/components/Frame.jsx | 6 ++ admin/src/extensions.js | 1 + admin/src/frame-logic.js | 24 ++++- includes/admin/class-saddle-settings.php | 1 + includes/class-saddle-modules.php | 13 ++- readme.txt | 3 + tests/js/frame-logic.test.js | 108 +++++++++++++++++++++++ tests/module-nav-test.php | 37 ++++++++ 8 files changed, 188 insertions(+), 5 deletions(-) diff --git a/admin/src/components/Frame.jsx b/admin/src/components/Frame.jsx index 15b6958..c15f129 100644 --- a/admin/src/components/Frame.jsx +++ b/admin/src/components/Frame.jsx @@ -489,6 +489,12 @@ export default function Frame( { let width = PAGE_WIDTH; if ( head.showSidebar ) { width = MODULE_WIDTH; + } else if ( 'page' === head.layout ) { + // One page is as wide as Home; its Settings reads like a module's. + width = + area.tabs && area.tabs[ 0 ] && area.tabs[ 0 ].key === tab + ? HOME_WIDTH + : MODULE_WIDTH; } else if ( 'home' === area.key && 'overview' === tab ) { width = HOME_WIDTH; } diff --git a/admin/src/extensions.js b/admin/src/extensions.js index d568644..a87347f 100644 --- a/admin/src/extensions.js +++ b/admin/src/extensions.js @@ -265,6 +265,7 @@ const FEATURES = [ 'view', 'drill-in', 'subtabs', + 'page-layout', ]; // What this shell supports, for addons that feature-detect. Set when the diff --git a/admin/src/frame-logic.js b/admin/src/frame-logic.js index a3c5029..c918c27 100644 --- a/admin/src/frame-logic.js +++ b/admin/src/frame-logic.js @@ -7,6 +7,10 @@ * (`&tab=`) and, in a section with two or more pages, an icon tab row * (`&sub=`). Core's pages keep their header tab row instead. * + * A module that declares `layout: 'page'` is one page instead: no sidebar and + * no icon tab row. Its first tab is the page; any other tab (Settings) is a + * drill-in reached by address, read as `Saddle / Module / Settings`. + * * A module screen opens one item with `&view=`. While it is open, the screen * may call `props.header.drillIn( { title } )`: the breadcrumb then reads * `Saddle / Module / Section / title` and the icon tab row steps aside. The @@ -28,7 +32,7 @@ * @param {Object} props.home The first crumb: `{ label, url }` (Saddle, to Home). * @param {string=} props.crumb The page's name when it is not the area's title * (first run's "Welcome"). - * @return {{crumbs: Array, title: string, drilled: boolean, showTabs: boolean, showSidebar: boolean, showSubtabs: boolean}} + * @return {{crumbs: Array, title: string, drilled: boolean, layout: string, showTabs: boolean, showSidebar: boolean, showSubtabs: boolean}} * The header. Each crumb is `{ key, label, url }`; `key` is `home`, * `module`, `section` or `current`, and the last one has no url. */ @@ -44,7 +48,9 @@ export function frameHeader( { const tabs = area && Array.isArray( area.tabs ) ? area.tabs : []; const title = ( area && area.title ) || ''; const module = !! ( area && area.module ) && ! crumb; + const onePage = module && 'page' === area.layout; const current = tabs.find( ( t ) => t.key === tab ); + const first = tabs.length > 0 && tabs[ 0 ].key === tab; const pages = current && Array.isArray( current.subtabs ) ? current.subtabs : []; @@ -68,6 +74,17 @@ export function frameHeader( { crumbs = [ homeCrumb, { key: 'current', label: crumb, url: '' } ]; } else if ( area && 'home' === area.key ) { crumbs = [ { ...homeCrumb, url: '' } ]; + } else if ( onePage && ( drilled || ( current && ! first ) ) ) { + // One page has no sections to name: the module, then what is open. + crumbs = [ + homeCrumb, + { key: 'module', label: title, url: ( area && area.url ) || '' }, + { + key: 'current', + label: drilled ? drill.title : current.label, + url: '', + }, + ]; } else if ( drilled ) { const page = sub && pages.find( ( p ) => p.key === sub ); crumbs = [ @@ -92,9 +109,10 @@ export function frameHeader( { crumbs, title: crumbs[ crumbs.length - 1 ].label, drilled, + layout: onePage ? 'page' : 'sections', showTabs: ! module && ! drilled && tabs.length > 1, - showSidebar: module && tabs.length > 0, - showSubtabs: module && ! drilled && pages.length > 1, + showSidebar: module && ! onePage && tabs.length > 0, + showSubtabs: module && ! onePage && ! drilled && pages.length > 1, }; } diff --git a/includes/admin/class-saddle-settings.php b/includes/admin/class-saddle-settings.php index 85547d8..74374f3 100644 --- a/includes/admin/class-saddle-settings.php +++ b/includes/admin/class-saddle-settings.php @@ -359,6 +359,7 @@ private static function areas_for_app() { 'version' => isset( $area['version'] ) ? $area['version'] : '', 'summary' => isset( $area['summary'] ) ? $area['summary'] : '', 'content' => isset( $area['content'] ) ? $area['content'] : '', + 'layout' => $area['layout'], 'tabs' => $tabs, ); } diff --git a/includes/class-saddle-modules.php b/includes/class-saddle-modules.php index 9e7f240..74eb0af 100644 --- a/includes/class-saddle-modules.php +++ b/includes/class-saddle-modules.php @@ -111,6 +111,7 @@ public static function modules() { * 'tab_icons' => array( 'reports' => 'reports' ), // Tab key => icon. * 'subtabs' => array( 'reports' => array( 'sources' => 'Sources', 'pages' => 'Pages' ) ), * 'subtab_icons' => array( 'reports' => array( 'sources' => 'globe', 'pages' => 'page' ) ), + * 'layout' => 'page', // Or 'sections', the default. * * plus `product`, `version`, `summary`, `order`, `nav`, `capability`, * `script`, `content` and the `status`, `setup` and `settings` @@ -133,6 +134,12 @@ public static function modules() { * stay plain strings in `tabs` and `subtabs`; an icon never goes there. * Older Core ignores all three keys, so a module can ship them first. * + * `layout => 'page'` makes the module one page: no sidebar and no icon + * tab row. Its first tab is the page; Settings (and any other tab) is + * reached by address and reads `Saddle / Module / Settings`. Older Core + * ignores the key and draws the tabs as sections. The client can tell + * with `window.saddleShell?.has?.( 'page-layout' )`. + * * A screen registers for a tab, or for one page of it: * `{ module, tab, sub, Component }` through `saddle.admin.screens`. * Core picks the most specific match (module, tab and sub, then module @@ -202,6 +209,7 @@ public static function modules() { 'subtab_icons' => Saddle_Module_Nav::icons( $subtabs, isset( $module['subtab_icons'] ) ? $module['subtab_icons'] : array() ), 'script' => isset( $module['script'] ) ? sanitize_key( (string) $module['script'] ) : '', 'content' => isset( $module['content'] ) && 'mount' === $module['content'] ? 'mount' : 'screens', + 'layout' => isset( $module['layout'] ) && 'page' === $module['layout'] ? 'page' : 'sections', ); } @@ -221,8 +229,8 @@ static function ( $a, $b ) use ( $modules ) { * * @return array Keyed by area; each has `slug`, `title`, * `tabs`, `nav`, `capability`, `module`, - * `icon`, `tab_icons`, `subtabs` and - * `subtab_icons`. + * `icon`, `tab_icons`, `subtabs`, + * `subtab_icons` and `layout`. */ public static function areas() { $core = self::core_areas(); @@ -247,6 +255,7 @@ public static function areas() { 'tab_icons' => Saddle_Nav_Icons::tab_icons( $area['tabs'], array() ), 'subtabs' => array(), 'subtab_icons' => array(), + 'layout' => 'sections', ), $area ); diff --git a/readme.txt b/readme.txt index ca762e2..02d6954 100644 --- a/readme.txt +++ b/readme.txt @@ -208,6 +208,9 @@ The WordPress.org version never checks for its own updates. The version from plu == Changelog == += 1.5.1 = +* New: A plugin that adds a page under Saddle can draw it as one page, with no sidebar and no tab row. Its settings open from the page and lead back to it. Saddle Analytics uses this. + = 1.5.0 = * New: Each connected app has its own access. On AI apps, choose Read only, Edit content (posts, pages, media, menus and SEO) or Manage the site (also plugins, themes, updates and settings) for each app. A new app starts at Read only. Updating Saddle keeps what each existing app could already do and never widens it. * New: Needs your OK. When an app asks to make a big change, such as publishing or deleting, you can approve or reject it on Home as well as in the chat. The request shows what would change. Only the app that asked can confirm it, and a request leaves the list once its app no longer has the access it needs. diff --git a/tests/js/frame-logic.test.js b/tests/js/frame-logic.test.js index 9037b6a..9b77efb 100644 --- a/tests/js/frame-logic.test.js +++ b/tests/js/frame-logic.test.js @@ -306,6 +306,114 @@ describe( 'frameHeader: sidebar and tab rows', () => { } ); } ); +describe( 'frameHeader: a one-page module', () => { + const analytics = { + key: 'analytics', + title: 'Analytics', + module: true, + layout: 'page', + url: 'admin.php?page=saddle-analytics', + tabs: [ + { + key: 'overview', + label: 'Overview', + url: 'admin.php?page=saddle-analytics', + subtabs: [], + }, + { + key: 'settings', + label: 'Settings', + url: 'admin.php?page=saddle-analytics&tab=settings', + subtabs: [], + }, + ], + }; + + it( 'draws the page with no sidebar and no tab rows', () => { + const head = frameHeader( { + area: analytics, + tab: 'overview', + home: HOME, + } ); + expect( head.layout ).toBe( 'page' ); + expect( head.showSidebar ).toBe( false ); + expect( head.showTabs ).toBe( false ); + expect( head.showSubtabs ).toBe( false ); + expect( labels( head ) ).toEqual( [ 'Saddle', 'Analytics' ] ); + } ); + + it( 'reads Settings as Saddle / Module / Settings, the module crumb linked', () => { + const head = frameHeader( { + area: analytics, + tab: 'settings', + home: HOME, + } ); + expect( head.showSidebar ).toBe( false ); + expect( labels( head ) ).toEqual( [ + 'Saddle', + 'Analytics', + 'Settings', + ] ); + expect( head.crumbs[ 1 ] ).toEqual( { + key: 'module', + label: 'Analytics', + url: 'admin.php?page=saddle-analytics', + } ); + expect( head.crumbs[ 2 ].url ).toBe( '' ); + } ); + + it( 'drills in with no section crumb', () => { + const head = frameHeader( { + area: analytics, + tab: 'overview', + view: 'country', + drill: { + title: 'Country', + tab: 'overview', + sub: '', + view: 'country', + }, + home: HOME, + } ); + expect( head.drilled ).toBe( true ); + expect( labels( head ) ).toEqual( [ + 'Saddle', + 'Analytics', + 'Country', + ] ); + expect( head.title ).toBe( 'Country' ); + } ); + + it( 'leaves a sections module as it was', () => { + const head = frameHeader( { + area: { ...crm, layout: 'sections' }, + tab: 'contacts', + sub: 'contacts', + home: HOME, + } ); + expect( head.layout ).toBe( 'sections' ); + expect( head.showSidebar ).toBe( true ); + expect( head.showSubtabs ).toBe( true ); + expect( labels( head ) ).toEqual( [ 'Saddle', 'CRM' ] ); + } ); + + it( 'treats a module without a layout as sections (older payloads)', () => { + const head = frameHeader( { area: crm, tab: 'campaigns', home: HOME } ); + expect( head.layout ).toBe( 'sections' ); + expect( head.showSidebar ).toBe( true ); + } ); + + it( 'ignores the key on a Core page', () => { + const head = frameHeader( { + area: { ...context, layout: 'page' }, + tab: 'overview', + home: HOME, + } ); + expect( head.layout ).toBe( 'sections' ); + expect( labels( head ) ).toEqual( [ 'Saddle', 'Context' ] ); + } ); +} ); + describe( 'sidebarItems', () => { it( 'keeps the module order and moves Settings last', () => { const { items, settings } = sidebarItems( [ diff --git a/tests/module-nav-test.php b/tests/module-nav-test.php index b7c680e..b319728 100644 --- a/tests/module-nav-test.php +++ b/tests/module-nav-test.php @@ -297,6 +297,43 @@ public function routes() { ); } + /** + * A module is one page only when it says exactly 'page'; anything else, + * and every Core page, keeps the sections. + * + * @dataProvider layouts + * + * @param mixed $layout The descriptor's value, or null for none. + * @param string $expected The layout Core keeps. + */ + public function test_layout_is_page_or_sections( $layout, $expected ) { + $this->rank( null === $layout ? array() : array( 'layout' => $layout ) ); + + $this->assertSame( $expected, Saddle_Modules::modules()['rank']['layout'] ); + $this->assertSame( 'sections', Saddle_Modules::areas()['home']['layout'] ); + $this->assertSame( 'sections', Saddle_Modules::areas()['settings']['layout'] ); + } + + public function layouts() { + return array( + 'none' => array( null, 'sections' ), + 'page' => array( 'page', 'page' ), + 'sections' => array( 'sections', 'sections' ), + 'unknown' => array( 'grid', 'sections' ), + 'wrong' => array( array( 'page' ), 'sections' ), + ); + } + + public function test_the_app_gets_each_pages_layout() { + $this->rank( array( 'layout' => 'page' ) ); + $saddle = $this->saddle_data( 'saddle-rank' ); + $areas = array_combine( array_column( $saddle['areas'], 'key' ), $saddle['areas'] ); + + $this->assertSame( 'page', $areas['rank']['layout'] ); + $this->assertSame( 'sections', $areas['home']['layout'] ); + $this->assertSame( 'sections', $areas['connections']['layout'] ); + } + public function test_the_app_gets_the_page_and_each_sections_pages() { $this->rank(); $_GET['tab'] = 'visibility'; From 9a579d898881312f5648a6468ddaef5cf6221a06 Mon Sep 17 00:00:00 2001 From: fahimreza-dev Date: Mon, 5 Oct 2026 05:51:48 +0600 Subject: [PATCH 2/2] build: rebuild the admin bundle main's committed bundle was older than its sources; this is the build of the sources on this branch. Co-Authored-By: Claude Opus 5.5 --- admin/build/index.asset.php | 2 +- admin/build/index.js | 8 ++++---- admin/build/palette-rtl.css | 2 +- admin/build/palette.asset.php | 2 +- admin/build/palette.css | 2 +- admin/build/style-index-rtl.css | 2 +- admin/build/style-index.css | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/admin/build/index.asset.php b/admin/build/index.asset.php index e64f069..c2cdb9e 100644 --- a/admin/build/index.asset.php +++ b/admin/build/index.asset.php @@ -1 +1 @@ - array('react', 'react-dom', 'wp-api-fetch', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => 'e7ba886decc02a88b978'); + array('react', 'react-dom', 'wp-api-fetch', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '71a3abd97070ba94673e'); diff --git a/admin/build/index.js b/admin/build/index.js index 1aba276..9658248 100644 --- a/admin/build/index.js +++ b/admin/build/index.js @@ -1,4 +1,4 @@ -(()=>{"use strict";var e={744(e,t,n){var a=n(609),r=n.t(a,2);const s=window.wp.apiFetch;var o=n.n(s);const l=window.wp.element,i=window.ReactDOM,c=Array(12).fill(0),d=({visible:e,className:t})=>a.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},a.createElement("div",{className:"sonner-spinner"},c.map((e,t)=>a.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${t}`})))),u=a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},a.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"})),p=a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},a.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"})),m=a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},a.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"})),h=a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},a.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"})),f=a.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"},a.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}));let g=1;const y=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;const{message:n,...a}=e,r="number"==typeof(null==e?void 0:e.id)||(null==(t=e.id)?void 0:t.length)>0?e.id:g++,s=this.toasts.find(e=>e.id===r),o=void 0===e.dismissible||e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),s?this.toasts=this.toasts.map(t=>t.id===r?(this.publish({...t,...e,id:r,title:n}),{...t,...e,id:r,dismissible:o,title:n}):t):this.addToast({title:n,...a,dismissible:o,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;void 0!==t.loading&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:"function"!=typeof t.description?t.description:void 0}));const r=Promise.resolve(e instanceof Function?e():e);let s,o=void 0!==n;const l=r.then(async e=>{if(s=["resolve",e],a.isValidElement(e))o=!1,this.create({id:n,type:"default",message:e});else if(v(e)&&!e.ok){o=!1;const r="function"==typeof t.error?await t.error(`HTTP error! status: ${e.status}`):t.error,s="function"==typeof t.description?await t.description(`HTTP error! status: ${e.status}`):t.description,l="object"!=typeof r||a.isValidElement(r)?{message:r}:r;this.create({id:n,type:"error",description:s,...l})}else if(e instanceof Error){o=!1;const r="function"==typeof t.error?await t.error(e):t.error,s="function"==typeof t.description?await t.description(e):t.description,l="object"!=typeof r||a.isValidElement(r)?{message:r}:r;this.create({id:n,type:"error",description:s,...l})}else if(void 0!==t.success){o=!1;const r="function"==typeof t.success?await t.success(e):t.success,s="function"==typeof t.description?await t.description(e):t.description,l="object"!=typeof r||a.isValidElement(r)?{message:r}:r;this.create({id:n,type:"success",description:s,...l})}}).catch(async e=>{if(s=["reject",e],void 0!==t.error){o=!1;const r="function"==typeof t.error?await t.error(e):t.error,s="function"==typeof t.description?await t.description(e):t.description,l="object"!=typeof r||a.isValidElement(r)?{message:r}:r;this.create({id:n,type:"error",description:s,...l})}}).finally(()=>{o&&(this.dismiss(n),n=void 0),null==t.finally||t.finally.call(t)}),i=()=>new Promise((e,t)=>l.then(()=>"reject"===s[0]?t(s[1]):e(s[1])).catch(t));return"string"!=typeof n&&"number"!=typeof n?{unwrap:i}:Object.assign(n,{unwrap:i})},this.custom=(e,t)=>{const n=(null==t?void 0:t.id)||g++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},v=e=>e&&"object"==typeof e&&"ok"in e&&"boolean"==typeof e.ok&&"status"in e&&"number"==typeof e.status,b=Object.assign((e,t)=>{const n=(null==t?void 0:t.id)||g++;return y.addToast({title:e,...t,id:n}),n},{success:y.success,info:y.info,warning:y.warning,error:y.error,custom:y.custom,message:y.message,promise:y.promise,dismiss:y.dismiss,loading:y.loading},{getHistory:()=>y.toasts,getToasts:()=>y.getActiveToasts()});function w(e){return void 0!==e.label}!function(e){if("undefined"==typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}("[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%)}");const _=3,j=14;function k(...e){return e.filter(Boolean).join(" ")}const x=e=>{var t,n,r,s,o,l,i,c,g;const{invert:y,toast:v,unstyled:b,interacting:_,setHeights:j,visibleToasts:x,heights:M,index:N,toasts:E,expanded:I,removeToast:C,defaultRichColors:L,closeButton:S,style:D,cancelButtonStyle:T,actionButtonStyle:A,className:O="",descriptionClassName:z="",duration:P,position:R,gap:Z,expandByDefault:W,classNames:Y,icons:G,closeButtonAriaLabel:B="Close toast"}=e,[V,U]=a.useState(null),[F,H]=a.useState(null),[Q,X]=a.useState(!1),[$,J]=a.useState(!1),[K,q]=a.useState(!1),[ee,te]=a.useState(!1),[ne,ae]=a.useState(!1),[re,se]=a.useState(0),[oe,le]=a.useState(0),ie=a.useRef(v.duration||P||4e3),ce=a.useRef(null),de=a.useRef(null),ue=0===N,pe=N+1<=x,me=v.type,he=!1!==v.dismissible,fe=v.className||"",ge=v.descriptionClassName||"",ye=a.useMemo(()=>M.findIndex(e=>e.toastId===v.id)||0,[M,v.id]),ve=a.useMemo(()=>{var e;return null!=(e=v.closeButton)?e:S},[v.closeButton,S]),be=a.useMemo(()=>v.duration||P||4e3,[v.duration,P]),we=a.useRef(0),_e=a.useRef(0),je=a.useRef(0),ke=a.useRef(null),[xe,Me]=R.split("-"),Ne=a.useMemo(()=>M.reduce((e,t,n)=>n>=ye?e:e+t.height,0),[M,ye]),Ee=(()=>{const[e,t]=a.useState(document.hidden);return a.useEffect(()=>{const e=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",e),()=>window.removeEventListener("visibilitychange",e)},[]),e})(),Ie=v.invert||y,Ce="loading"===me;_e.current=a.useMemo(()=>ye*Z+Ne,[ye,Ne]),a.useEffect(()=>{ie.current=be},[be]),a.useEffect(()=>{X(!0)},[]),a.useEffect(()=>{const e=de.current;if(e){const t=e.getBoundingClientRect().height;return le(t),j(e=>[{toastId:v.id,height:t,position:v.position},...e]),()=>j(e=>e.filter(e=>e.toastId!==v.id))}},[j,v.id]),a.useLayoutEffect(()=>{if(!Q)return;const e=de.current,t=e.style.height;e.style.height="auto";const n=e.getBoundingClientRect().height;e.style.height=t,le(n),j(e=>e.find(e=>e.toastId===v.id)?e.map(e=>e.toastId===v.id?{...e,height:n}:e):[{toastId:v.id,height:n,position:v.position},...e])},[Q,v.title,v.description,j,v.id,v.jsx,v.action,v.cancel]);const Le=a.useCallback(()=>{J(!0),se(_e.current),j(e=>e.filter(e=>e.toastId!==v.id)),setTimeout(()=>{C(v)},200)},[v,C,j,_e]);a.useEffect(()=>{if(v.promise&&"loading"===me||v.duration===1/0||"loading"===v.type)return;let e;return I||_||Ee?(()=>{if(je.current{null==v.onAutoClose||v.onAutoClose.call(v,v),Le()},ie.current)),()=>clearTimeout(e)},[I,_,v,me,Ee,Le]),a.useEffect(()=>{v.delete&&(Le(),null==v.onDismiss||v.onDismiss.call(v,v))},[Le,v.delete]);const Se=v.icon||(null==G?void 0:G[me])||(e=>{switch(e){case"success":return u;case"info":return m;case"warning":return p;case"error":return h;default:return null}})(me);var De,Te;return a.createElement("li",{tabIndex:0,ref:de,className:k(O,fe,null==Y?void 0:Y.toast,null==v||null==(t=v.classNames)?void 0:t.toast,null==Y?void 0:Y.default,null==Y?void 0:Y[me],null==v||null==(n=v.classNames)?void 0:n[me]),"data-sonner-toast":"","data-rich-colors":null!=(De=v.richColors)?De:L,"data-styled":!Boolean(v.jsx||v.unstyled||b),"data-mounted":Q,"data-promise":Boolean(v.promise),"data-swiped":ne,"data-removed":$,"data-visible":pe,"data-y-position":xe,"data-x-position":Me,"data-index":N,"data-front":ue,"data-swiping":K,"data-dismissible":he,"data-type":me,"data-invert":Ie,"data-swipe-out":ee,"data-swipe-direction":F,"data-expanded":Boolean(I||W&&Q),"data-testid":v.testId,style:{"--index":N,"--toasts-before":N,"--z-index":E.length-N,"--offset":`${$?re:_e.current}px`,"--initial-height":W?"auto":`${oe}px`,...D,...v.style},onDragEnd:()=>{q(!1),U(null),ke.current=null},onPointerDown:e=>{2!==e.button&&!Ce&&he&&(ce.current=new Date,se(_e.current),e.target.setPointerCapture(e.pointerId),"BUTTON"!==e.target.tagName&&(q(!0),ke.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{var e,t,n;if(ee||!he)return;ke.current=null;const a=Number((null==(e=de.current)?void 0:e.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),r=Number((null==(t=de.current)?void 0:t.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),s=(new Date).getTime()-(null==(n=ce.current)?void 0:n.getTime()),o="x"===V?a:r,l=Math.abs(o)/s;if(Math.abs(o)>=45||l>.11)return se(_e.current),null==v.onDismiss||v.onDismiss.call(v,v),H("x"===V?a>0?"right":"left":r>0?"down":"up"),Le(),void te(!0);var i,c;null==(i=de.current)||i.style.setProperty("--swipe-amount-x","0px"),null==(c=de.current)||c.style.setProperty("--swipe-amount-y","0px"),ae(!1),q(!1),U(null)},onPointerMove:t=>{var n,a,r;if(!ke.current||!he)return;if((null==(n=window.getSelection())?void 0:n.toString().length)>0)return;const s=t.clientY-ke.current.y,o=t.clientX-ke.current.x;var l;const i=null!=(l=e.swipeDirections)?l:function(e){const[t,n]=e.split("-"),a=[];return t&&a.push(t),n&&a.push(n),a}(R);!V&&(Math.abs(o)>1||Math.abs(s)>1)&&U(Math.abs(o)>Math.abs(s)?"x":"y");let c={x:0,y:0};const d=e=>1/(1.5+Math.abs(e)/20);if("y"===V){if(i.includes("top")||i.includes("bottom"))if(i.includes("top")&&s<0||i.includes("bottom")&&s>0)c.y=s;else{const e=s*d(s);c.y=Math.abs(e)0)c.x=o;else{const e=o*d(o);c.x=Math.abs(e)0||Math.abs(c.y)>0)&&ae(!0),null==(a=de.current)||a.style.setProperty("--swipe-amount-x",`${c.x}px`),null==(r=de.current)||r.style.setProperty("--swipe-amount-y",`${c.y}px`)}},ve&&!v.jsx&&"loading"!==me?a.createElement("button",{"aria-label":B,"data-disabled":Ce,"data-close-button":!0,onClick:Ce||!he?()=>{}:()=>{Le(),null==v.onDismiss||v.onDismiss.call(v,v)},className:k(null==Y?void 0:Y.closeButton,null==v||null==(r=v.classNames)?void 0:r.closeButton)},null!=(Te=null==G?void 0:G.close)?Te:f):null,(me||v.icon||v.promise)&&null!==v.icon&&(null!==(null==G?void 0:G[me])||v.icon)?a.createElement("div",{"data-icon":"",className:k(null==Y?void 0:Y.icon,null==v||null==(s=v.classNames)?void 0:s.icon)},v.promise||"loading"===v.type&&!v.icon?v.icon||function(){var e,t;return(null==G?void 0:G.loading)?a.createElement("div",{className:k(null==Y?void 0:Y.loader,null==v||null==(t=v.classNames)?void 0:t.loader,"sonner-loader"),"data-visible":"loading"===me},G.loading):a.createElement(d,{className:k(null==Y?void 0:Y.loader,null==v||null==(e=v.classNames)?void 0:e.loader),visible:"loading"===me})}():null,"loading"!==v.type?Se:null):null,a.createElement("div",{"data-content":"",className:k(null==Y?void 0:Y.content,null==v||null==(o=v.classNames)?void 0:o.content)},a.createElement("div",{"data-title":"",className:k(null==Y?void 0:Y.title,null==v||null==(l=v.classNames)?void 0:l.title)},v.jsx?v.jsx:"function"==typeof v.title?v.title():v.title),v.description?a.createElement("div",{"data-description":"",className:k(z,ge,null==Y?void 0:Y.description,null==v||null==(i=v.classNames)?void 0:i.description)},"function"==typeof v.description?v.description():v.description):null),a.isValidElement(v.cancel)?v.cancel:v.cancel&&w(v.cancel)?a.createElement("button",{"data-button":!0,"data-cancel":!0,style:v.cancelButtonStyle||T,onClick:e=>{w(v.cancel)&&he&&(null==v.cancel.onClick||v.cancel.onClick.call(v.cancel,e),Le())},className:k(null==Y?void 0:Y.cancelButton,null==v||null==(c=v.classNames)?void 0:c.cancelButton)},v.cancel.label):null,a.isValidElement(v.action)?v.action:v.action&&w(v.action)?a.createElement("button",{"data-button":!0,"data-action":!0,style:v.actionButtonStyle||A,onClick:e=>{w(v.action)&&(null==v.action.onClick||v.action.onClick.call(v.action,e),e.defaultPrevented||Le())},className:k(null==Y?void 0:Y.actionButton,null==v||null==(g=v.classNames)?void 0:g.actionButton)},v.action.label):null)};function M(){if("undefined"==typeof window)return"ltr";if("undefined"==typeof document)return"ltr";const e=document.documentElement.getAttribute("dir");return"auto"!==e&&e?e:window.getComputedStyle(document.documentElement).direction}function N(e,t){const n={};return[e,t].forEach((e,t)=>{const a=1===t,r=a?"--mobile-offset":"--offset",s=a?"16px":"24px";function o(e){["top","right","bottom","left"].forEach(t=>{n[`${r}-${t}`]="number"==typeof e?`${e}px`:e})}"number"==typeof e||"string"==typeof e?o(e):"object"==typeof e?["top","right","bottom","left"].forEach(t=>{void 0===e[t]?n[`${r}-${t}`]=s:n[`${r}-${t}`]="number"==typeof e[t]?`${e[t]}px`:e[t]}):o(s)}),n}const E=a.forwardRef(function(e,t){const{id:n,invert:r,position:s="bottom-right",hotkey:o=["altKey","KeyT"],expand:l,closeButton:c,className:d,offset:u,mobileOffset:p,theme:m="light",richColors:h,duration:f,style:g,visibleToasts:v=_,toastOptions:b,dir:w=M(),gap:k=j,icons:E,containerAriaLabel:I="Notifications"}=e,[C,L]=a.useState([]),S=a.useMemo(()=>n?C.filter(e=>e.toasterId===n):C.filter(e=>!e.toasterId),[C,n]),D=a.useMemo(()=>Array.from(new Set([s].concat(S.filter(e=>e.position).map(e=>e.position)))),[S,s]),[T,A]=a.useState([]),[O,z]=a.useState(!1),[P,R]=a.useState(!1),[Z,W]=a.useState("system"!==m?m:"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Y=a.useRef(null),G=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),B=a.useRef(null),V=a.useRef(!1),U=a.useCallback(e=>{L(t=>{var n;return(null==(n=t.find(t=>t.id===e.id))?void 0:n.delete)||y.dismiss(e.id),t.filter(({id:t})=>t!==e.id)})},[]);return a.useEffect(()=>y.subscribe(e=>{e.dismiss?requestAnimationFrame(()=>{L(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))}):setTimeout(()=>{i.flushSync(()=>{L(t=>{const n=t.findIndex(t=>t.id===e.id);return-1!==n?[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]:[e,...t]})})})}),[C]),a.useEffect(()=>{if("system"!==m)return void W(m);if("system"===m&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?W("dark"):W("light")),"undefined"==typeof window)return;const e=window.matchMedia("(prefers-color-scheme: dark)");try{e.addEventListener("change",({matches:e})=>{W(e?"dark":"light")})}catch(t){e.addListener(({matches:e})=>{try{W(e?"dark":"light")}catch(e){console.error(e)}})}},[m]),a.useEffect(()=>{C.length<=1&&z(!1)},[C]),a.useEffect(()=>{const e=e=>{var t;var n;o.every(t=>e[t]||e.code===t)&&(z(!0),null==(n=Y.current)||n.focus()),"Escape"!==e.code||document.activeElement!==Y.current&&!(null==(t=Y.current)?void 0:t.contains(document.activeElement))||z(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[o]),a.useEffect(()=>{if(Y.current)return()=>{B.current&&(B.current.focus({preventScroll:!0}),B.current=null,V.current=!1)}},[Y.current]),a.createElement("section",{ref:t,"aria-label":`${I} ${G}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},D.map((t,n)=>{var s;const[o,i]=t.split("-");return S.length?a.createElement("ol",{key:t,dir:"auto"===w?M():w,tabIndex:-1,ref:Y,className:d,"data-sonner-toaster":!0,"data-sonner-theme":Z,"data-y-position":o,"data-x-position":i,style:{"--front-toast-height":`${(null==(s=T[0])?void 0:s.height)||0}px`,"--width":"356px","--gap":`${k}px`,...g,...N(u,p)},onBlur:e=>{V.current&&!e.currentTarget.contains(e.relatedTarget)&&(V.current=!1,B.current&&(B.current.focus({preventScroll:!0}),B.current=null))},onFocus:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||V.current||(V.current=!0,B.current=e.relatedTarget)},onMouseEnter:()=>z(!0),onMouseMove:()=>z(!0),onMouseLeave:()=>{P||z(!1)},onDragEnd:()=>z(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||R(!0)},onPointerUp:()=>R(!1)},S.filter(e=>!e.position&&0===n||e.position===t).map((n,s)=>{var o,i;return a.createElement(x,{key:n.id,icons:E,index:s,toast:n,defaultRichColors:h,duration:null!=(o=null==b?void 0:b.duration)?o:f,className:null==b?void 0:b.className,descriptionClassName:null==b?void 0:b.descriptionClassName,invert:r,visibleToasts:v,closeButton:null!=(i=null==b?void 0:b.closeButton)?i:c,interacting:P,position:t,style:null==b?void 0:b.style,unstyled:null==b?void 0:b.unstyled,classNames:null==b?void 0:b.classNames,cancelButtonStyle:null==b?void 0:b.cancelButtonStyle,actionButtonStyle:null==b?void 0:b.actionButtonStyle,closeButtonAriaLabel:null==b?void 0:b.closeButtonAriaLabel,removeToast:U,toasts:S.filter(e=>e.position==n.position),heights:T.filter(e=>e.position==n.position),setHeights:A,expandByDefault:l,gap:k,expanded:O,swipeDirections:e.swipeDirections})})):null}))});var I=n(848);const C=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},L=(...e)=>e.filter((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim(),S=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};var D={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 T=(0,a.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:l,...i},c)=>(0,a.createElement)("svg",{ref:c,...D,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:L("lucide",s),...!o&&!S(i)&&{"aria-hidden":"true"},...i},[...l.map(([e,t])=>(0,a.createElement)(e,t)),...Array.isArray(o)?o:[o]])),A=(e,t)=>{const n=(0,a.forwardRef)(({className:n,...r},s)=>{return(0,a.createElement)(T,{ref:s,iconNode:t,className:L(`lucide-${o=C(e),o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,n),...r});var o});return n.displayName=C(e),n},O=A("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);function z(e,[t,n]){return Math.min(n,Math.max(t,e))}function P(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e?.(a),!1===n||!a||!a.defaultPrevented)return t?.(a)}}function R(e,t=[]){let n=[];const r=()=>{const t=n.map(e=>a.createContext(e));return function(n){const r=n?.[e]||t;return a.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return r.scopeName=e,[function(t,r){const s=a.createContext(r);s.displayName=t+"Context";const o=n.length;n=[...n,r];const l=t=>{const{scope:n,children:r,...l}=t,i=n?.[e]?.[o]||s,c=a.useMemo(()=>l,Object.values(l));return(0,I.jsx)(i.Provider,{value:c,children:r})};return l.displayName=t+"Provider",[l,function(n,l,i={}){const{optional:c=!1}=i,d=l?.[e]?.[o]||s,u=a.useContext(d);if(u)return u;if(void 0!==r)return r;if(!c)throw new Error(`\`${n}\` must be used within \`${t}\``)}]},Z(r,...t)]}function Z(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const r=n.reduce((t,{useScope:n,scopeName:a})=>({...t,...n(e)[`__scope${a}`]}),{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function W(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Y(...e){return a.useCallback(function(...e){return t=>{let n=!1;const a=e.map(e=>{const a=W(e,t);return n||"function"!=typeof a||(n=!0),a});if(n)return()=>{for(let t=0;t{let{children:r,...s}=t,o=null,l=!1;const i=[];F(r)&&"function"==typeof X&&(r=X(r._payload)),a.Children.forEach(r,e=>{if(t=e,a.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===B){l=!0;const t=e;let n="child"in t.props?t.props.child:t.props.children;F(n)&&"function"==typeof X&&(n=X(n._payload)),o=V(t,n),i.push(o?.props?.children)}else i.push(e);var t}),o?o=a.cloneElement(o,void 0,i):!l&&1===a.Children.count(r)&&a.isValidElement(r)&&(o=r);const c=o?function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}(o):void 0,d=Y(n,c);if(!o){if(r||0===r)throw new Error(l?Q(e):H(e));return r}const u=function(e,t){const n={...t};for(const a in t){const r=e[a],s=t[a];/^on[A-Z]/.test(a)?r&&s?n[a]=(...e)=>{const t=s(...e);return r(...e),t}:r&&(n[a]=r):"style"===a?n[a]={...r,...s}:"className"===a&&(n[a]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}(s,o.props??{});return o.type!==a.Fragment&&(u.ref=n?d:c),a.cloneElement(o,u)});return t.displayName=`${e}.Slot`,t}"undefined"==typeof window||!window.document||window.document.createElement;var B=Symbol.for("radix.slottable");var V=(e,t)=>{if("child"in e.props){const t=e.props.child;return a.isValidElement(t)?a.cloneElement(t,void 0,e.props.children(t.props.children)):null}return a.isValidElement(t)?t:null},U=Symbol.for("react.lazy");function F(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===U&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t;var t}var H=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Q=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,X=r[" use ".trim().toString()];function $(e){const t=e+"CollectionProvider",[n,r]=R(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=e=>{const{scope:t,children:n}=e,r=a.useRef(null),o=a.useRef(new Map).current;return(0,I.jsx)(s,{scope:t,itemMap:o,collectionRef:r,children:n})};l.displayName=t;const i=e+"CollectionSlot",c=G(i),d=a.forwardRef((e,t)=>{const{scope:n,children:a}=e,r=Y(t,o(i,n).collectionRef);return(0,I.jsx)(c,{ref:r,children:a})});d.displayName=i;const u=e+"CollectionItemSlot",p="data-radix-collection-item",m=G(u),h=a.forwardRef((e,t)=>{const{scope:n,children:r,...s}=e,l=a.useRef(null),i=Y(t,l),c=o(u,n);return a.useEffect(()=>(c.itemMap.set(l,{ref:l,...s}),()=>{c.itemMap.delete(l)})),(0,I.jsx)(m,{[p]:"",ref:i,children:r})});return h.displayName=u,[{Provider:l,Slot:d,ItemSlot:h},function(t){const n=o(e+"CollectionConsumer",t);return a.useCallback(()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])},r]}Map;var J=a.createContext(void 0);function K(e){const t=a.useContext(J);return e||t||"ltr"}var q=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const n=G(`Primitive.${t}`),r=a.forwardRef((e,a)=>{const{asChild:r,...s}=e,o=r?n:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,I.jsx)(o,{...s,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ee(e,t){e&&i.flushSync(()=>e.dispatchEvent(t))}function te(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...e)=>t.current?.(...e),[])}var ne,ae="dismissableLayer.update",re=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),se=a.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:i,onDismiss:c,...d}=e,u=a.useContext(re),[p,m]=a.useState(null),h=p?.ownerDocument??globalThis?.document,[,f]=a.useState({}),g=Y(t,m),y=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=v?y.indexOf(v):-1,w=p?y.indexOf(p):-1,_=u.layersWithOutsidePointerEventsDisabled.size>0,j=w>=b,k=a.useRef(!1),x=function(e,t){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:s,dismissableSurfaces:o,shouldHandlePointerDownOutside:l=oe}=t,i=te(e),c=a.useRef(!1),d=a.useRef(!1),u=a.useRef(new Map),p=a.useRef(()=>{});return a.useEffect(()=>{function e(){d.current=!1,s.current=!1,u.current.clear()}function t(e){if(!d.current)return;const t=e.target;t instanceof Node&&[...o].some(e=>e.contains(t))||u.current.set(e.type,!0),"click"===e.type&&window.setTimeout(()=>{d.current&&p.current()},0)}function a(e){d.current&&u.current.set(e.type,!1)}const m=t=>{if(t.target&&!c.current){let a=function(){n.removeEventListener("click",p.current);const t=Array.from(u.current.values()).some(Boolean);e(),t||ie("dismissableLayer.pointerDownOutside",i,o,{discrete:!0})};if(!l(t.target))return n.removeEventListener("click",p.current),e(),void(c.current=!1);const o={originalEvent:t};d.current=!0,s.current=r&&0===t.button,u.current.clear(),r&&0===t.button?(n.removeEventListener("click",p.current),p.current=a,n.addEventListener("click",p.current,{once:!0})):a()}else n.removeEventListener("click",p.current),e();c.current=!1},h=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const e of h)n.addEventListener(e,t,!0),n.addEventListener(e,a);const f=window.setTimeout(()=>{n.addEventListener("pointerdown",m)},0);return()=>{window.clearTimeout(f),n.removeEventListener("pointerdown",m),n.removeEventListener("click",p.current);for(const e of h)n.removeEventListener(e,t,!0),n.removeEventListener(e,a)}},[n,i,r,s,o,l]),{onPointerDownCapture:()=>c.current=!0}}(e=>{o?.(e),i?.(e),e.defaultPrevented||c?.()},{ownerDocument:h,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:k,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:a.useCallback(e=>{if(!(e instanceof Node))return!1;const t=[...u.branches].some(t=>t.contains(e));return j&&!t},[u.branches,j])}),M=function(e,t=globalThis?.document){const n=te(e),r=a.useRef(!1);return a.useEffect(()=>{const e=e=>{e.target&&!r.current&&ie("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{if(r&&k.current)return;const t=e.target;[...u.branches].some(e=>e.contains(t))||(l?.(e),i?.(e),e.defaultPrevented||c?.())},h),N=!!p&&w===y.length-1,E=te(e=>{"Escape"===e.key&&(s?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return a.useEffect(()=>{if(N)return h.addEventListener("keydown",E,{capture:!0}),()=>h.removeEventListener("keydown",E,{capture:!0})},[h,N,E]),a.useEffect(()=>{if(p)return n&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(ne=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(p)),u.layers.add(p),le(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(p),0===u.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=ne))}},[p,h,n,u]),a.useEffect(()=>()=>{p&&(u.layers.delete(p),u.layersWithOutsidePointerEventsDisabled.delete(p),le())},[p,u]),a.useEffect(()=>{const e=()=>f({});return document.addEventListener(ae,e),()=>document.removeEventListener(ae,e)},[]),(0,I.jsx)(q.div,{...d,ref:g,style:{pointerEvents:_?j?"auto":"none":void 0,...e.style},onFocusCapture:P(e.onFocusCapture,M.onFocusCapture),onBlurCapture:P(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:P(e.onPointerDownCapture,x.onPointerDownCapture)})});se.displayName="DismissableLayer",a.forwardRef((e,t)=>{const n=a.useContext(re),r=a.useRef(null),s=Y(t,r);return a.useEffect(()=>{const e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,I.jsx)(q.div,{...e,ref:s})}).displayName="DismissableLayerBranch";var oe=()=>!0;function le(){const e=new CustomEvent(ae);document.dispatchEvent(e)}function ie(e,t,n,{discrete:a}){const r=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),a?ee(r,s):r.dispatchEvent(s)}var ce=0,de=null;function ue(){a.useEffect(()=>{de||(de={start:pe(),end:pe()});const{start:e,end:t}=de;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),ce++,()=>{1===ce&&(de?.start.remove(),de?.end.remove(),de=null),ce=Math.max(0,ce-1)}},[])}function pe(){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 me="focusScope.autoFocusOnMount",he="focusScope.autoFocusOnUnmount",fe={bubbles:!1,cancelable:!0},ge=a.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...l}=e,[i,c]=a.useState(null),d=te(s),u=te(o),p=a.useRef(null),m=Y(t,c),h=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(r){let e=function(e){if(h.paused||!i)return;const t=e.target;i.contains(t)?p.current=t:we(p.current,{select:!0})},t=function(e){if(h.paused||!i)return;const t=e.relatedTarget;null!==t&&(i.contains(t)||we(p.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&we(i)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const a=new MutationObserver(n);return i&&a.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),a.disconnect()}}},[r,i,h.paused]),a.useEffect(()=>{if(i){_e.add(h);const e=document.activeElement;if(!i.contains(e)){const t=new CustomEvent(me,fe);i.addEventListener(me,d),i.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(we(a,{select:t}),document.activeElement!==n)return}(ye(i).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&we(i))}return()=>{i.removeEventListener(me,d),setTimeout(()=>{const t=new CustomEvent(he,fe);i.addEventListener(he,u),i.dispatchEvent(t),t.defaultPrevented||we(e??document.body,{select:!0}),i.removeEventListener(he,u),_e.remove(h)},0)}}},[i,d,u,h]);const f=a.useCallback(e=>{if(!n&&!r)return;if(h.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,a=document.activeElement;if(t&&a){const t=e.currentTarget,[r,s]=function(e){const t=ye(e);return[ve(t,e),ve(t.reverse(),e)]}(t);r&&s?e.shiftKey||a!==s?e.shiftKey&&a===r&&(e.preventDefault(),n&&we(s,{select:!0})):(e.preventDefault(),n&&we(r,{select:!0})):a===t&&e.preventDefault()}},[n,r,h.paused]);return(0,I.jsx)(q.div,{tabIndex:-1,...l,ref:m,onKeyDown:f})});function ye(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ve(e,t){const n="function"==typeof t.checkVisibility&&t.checkVisibility({checkVisibilityCSS:!0});for(const a of e)if(!(n?!a.checkVisibility({checkVisibilityCSS:!0}):be(a,{upTo:t})))return a}function be(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function we(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}ge.displayName="FocusScope";var _e=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=je(e,t),e.unshift(t)},remove(t){e=je(e,t),e[0]?.resume()}}}();function je(e,t){const n=[...e],a=n.indexOf(t);return-1!==a&&n.splice(a,1),n}var ke=globalThis?.document?a.useLayoutEffect:()=>{},xe=r[" useId ".trim().toString()]||(()=>{}),Me=0;function Ne(e){const[t,n]=a.useState(xe());return ke(()=>{e||n(e=>e??String(Me++))},[e]),e||(t?`radix-${t}`:"")}const Ee=["top","right","bottom","left"],Ie=Math.min,Ce=Math.max,Le=Math.round,Se=Math.floor,De=e=>({x:e,y:e}),Te={left:"right",right:"left",bottom:"top",top:"bottom"};function Ae(e,t,n){return Ce(e,Ie(t,n))}function Oe(e,t){return"function"==typeof e?e(t):e}function ze(e){return e.split("-")[0]}function Pe(e){return e.split("-")[1]}function Re(e){return"x"===e?"y":"x"}function Ze(e){return"y"===e?"height":"width"}function We(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function Ye(e){return Re(We(e))}function Ge(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Be=["left","right"],Ve=["right","left"],Ue=["top","bottom"],Fe=["bottom","top"];function He(e){const t=ze(e);return Te[t]+e.slice(t.length)}function Qe(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Xe(e){const{x:t,y:n,width:a,height:r}=e;return{width:a,height:r,top:n,left:t,right:t+a,bottom:n+r,x:t,y:n}}function $e(e,t,n){let{reference:a,floating:r}=e;const s=We(t),o=Ye(t),l=Ze(o),i=ze(t),c="y"===s,d=a.x+a.width/2-r.width/2,u=a.y+a.height/2-r.height/2,p=a[l]/2-r[l]/2;let m;switch(i){case"top":m={x:d,y:a.y-r.height};break;case"bottom":m={x:d,y:a.y+a.height};break;case"right":m={x:a.x+a.width,y:u};break;case"left":m={x:a.x-r.width,y:u};break;default:m={x:a.x,y:a.y}}switch(Pe(t)){case"start":m[o]-=p*(n&&c?-1:1);break;case"end":m[o]+=p*(n&&c?-1:1)}return m}async function Je(e,t){var n;void 0===t&&(t={});const{x:a,y:r,platform:s,rects:o,elements:l,strategy:i}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:p=!1,padding:m=0}=Oe(t,e),h=Qe(m),f=l[p?"floating"===u?"reference":"floating":u],g=Xe(await s.getClippingRect({element:null==(n=await(null==s.isElement?void 0:s.isElement(f)))||n?f:f.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(l.floating)),boundary:c,rootBoundary:d,strategy:i})),y="floating"===u?{x:a,y:r,width:o.floating.width,height:o.floating.height}:o.reference,v=await(null==s.getOffsetParent?void 0:s.getOffsetParent(l.floating)),b=await(null==s.isElement?void 0:s.isElement(v))&&await(null==s.getScale?void 0:s.getScale(v))||{x:1,y:1},w=Xe(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:v,strategy:i}):y);return{top:(g.top-w.top+h.top)/b.y,bottom:(w.bottom-g.bottom+h.bottom)/b.y,left:(g.left-w.left+h.left)/b.x,right:(w.right-g.right+h.right)/b.x}}function Ke(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function qe(e){return Ee.some(t=>e[t]>=0)}const et=new Set(["left","top"]);function tt(){return"undefined"!=typeof window}function nt(e){return st(e)?(e.nodeName||"").toLowerCase():"#document"}function at(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function rt(e){var t;return null==(t=(st(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function st(e){return!!tt()&&(e instanceof Node||e instanceof at(e).Node)}function ot(e){return!!tt()&&(e instanceof Element||e instanceof at(e).Element)}function lt(e){return!!tt()&&(e instanceof HTMLElement||e instanceof at(e).HTMLElement)}function it(e){return!(!tt()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof at(e).ShadowRoot)}function ct(e){const{overflow:t,overflowX:n,overflowY:a,display:r}=bt(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+n)&&"inline"!==r&&"contents"!==r}function dt(e){return/^(table|td|th)$/.test(nt(e))}function ut(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}const pt=/transform|translate|scale|rotate|perspective|filter/,mt=/paint|layout|strict|content/,ht=e=>!!e&&"none"!==e;let ft;function gt(e){const t=ot(e)?bt(e):e;return ht(t.transform)||ht(t.translate)||ht(t.scale)||ht(t.rotate)||ht(t.perspective)||!yt()&&(ht(t.backdropFilter)||ht(t.filter))||pt.test(t.willChange||"")||mt.test(t.contain||"")}function yt(){return null==ft&&(ft="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ft}function vt(e){return/^(html|body|#document)$/.test(nt(e))}function bt(e){return at(e).getComputedStyle(e)}function wt(e){return ot(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function _t(e){if("html"===nt(e))return e;const t=e.assignedSlot||e.parentNode||it(e)&&e.host||rt(e);return it(t)?t.host:t}function jt(e){const t=_t(e);return vt(t)?e.ownerDocument?e.ownerDocument.body:e.body:lt(t)&&ct(t)?t:jt(t)}function kt(e,t,n){var a;void 0===t&&(t=[]),void 0===n&&(n=!0);const r=jt(e),s=r===(null==(a=e.ownerDocument)?void 0:a.body),o=at(r);if(s){const e=xt(o);return t.concat(o,o.visualViewport||[],ct(r)?r:[],e&&n?kt(e):[])}return t.concat(r,kt(r,[],n))}function xt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Mt(e){const t=bt(e);let n=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const r=lt(e),s=r?e.offsetWidth:n,o=r?e.offsetHeight:a,l=Le(n)!==s||Le(a)!==o;return l&&(n=s,a=o),{width:n,height:a,$:l}}function Nt(e){return ot(e)?e:e.contextElement}function Et(e){const t=Nt(e);if(!lt(t))return De(1);const n=t.getBoundingClientRect(),{width:a,height:r,$:s}=Mt(t);let o=(s?Le(n.width):n.width)/a,l=(s?Le(n.height):n.height)/r;return o&&Number.isFinite(o)||(o=1),l&&Number.isFinite(l)||(l=1),{x:o,y:l}}const It=De(0);function Ct(e){const t=at(e);return yt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:It}function Lt(e,t,n,a){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),s=Nt(e);let o=De(1);t&&(a?ot(a)&&(o=Et(a)):o=Et(e));const l=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==at(e))&&t}(s,n,a)?Ct(s):De(0);let i=(r.left+l.x)/o.x,c=(r.top+l.y)/o.y,d=r.width/o.x,u=r.height/o.y;if(s){const e=at(s),t=a&&ot(a)?at(a):a;let n=e,r=xt(n);for(;r&&a&&t!==n;){const e=Et(r),t=r.getBoundingClientRect(),a=bt(r),s=t.left+(r.clientLeft+parseFloat(a.paddingLeft))*e.x,o=t.top+(r.clientTop+parseFloat(a.paddingTop))*e.y;i*=e.x,c*=e.y,d*=e.x,u*=e.y,i+=s,c+=o,n=at(r),r=xt(n)}}return Xe({width:d,height:u,x:i,y:c})}function St(e,t){const n=wt(e).scrollLeft;return t?t.left+n:Lt(rt(e)).left+n}function Dt(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-St(e,n),y:n.top+t.scrollTop}}function Tt(e,t,n){let a;if("viewport"===t)a=function(e,t){const n=at(e),a=rt(e),r=n.visualViewport;let s=a.clientWidth,o=a.clientHeight,l=0,i=0;if(r){s=r.width,o=r.height;const e=yt();(!e||e&&"fixed"===t)&&(l=r.offsetLeft,i=r.offsetTop)}const c=St(a);if(c<=0){const e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(a.clientWidth-t.clientWidth-r);o<=25&&(s-=o)}else c<=25&&(s+=c);return{width:s,height:o,x:l,y:i}}(e,n);else if("document"===t)a=function(e){const t=rt(e),n=wt(e),a=e.ownerDocument.body,r=Ce(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),s=Ce(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight);let o=-n.scrollLeft+St(e);const l=-n.scrollTop;return"rtl"===bt(a).direction&&(o+=Ce(t.clientWidth,a.clientWidth)-r),{width:r,height:s,x:o,y:l}}(rt(e));else if(ot(t))a=function(e,t){const n=Lt(e,!0,"fixed"===t),a=n.top+e.clientTop,r=n.left+e.clientLeft,s=lt(e)?Et(e):De(1);return{width:e.clientWidth*s.x,height:e.clientHeight*s.y,x:r*s.x,y:a*s.y}}(t,n);else{const n=Ct(e);a={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Xe(a)}function At(e,t){const n=_t(e);return!(n===t||!ot(n)||vt(n))&&("fixed"===bt(n).position||At(n,t))}function Ot(e,t,n){const a=lt(t),r=rt(t),s="fixed"===n,o=Lt(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const i=De(0);function c(){i.x=St(r)}if(a||!a&&!s)if(("body"!==nt(t)||ct(r))&&(l=wt(t)),a){const e=Lt(t,!0,s,t);i.x=e.x+t.clientLeft,i.y=e.y+t.clientTop}else r&&c();s&&!a&&r&&c();const d=!r||a||s?De(0):Dt(r,l);return{x:o.left+l.scrollLeft-i.x-d.x,y:o.top+l.scrollTop-i.y-d.y,width:o.width,height:o.height}}function zt(e){return"static"===bt(e).position}function Pt(e,t){if(!lt(e)||"fixed"===bt(e).position)return null;if(t)return t(e);let n=e.offsetParent;return rt(e)===n&&(n=n.ownerDocument.body),n}function Rt(e,t){const n=at(e);if(ut(e))return n;if(!lt(e)){let t=_t(e);for(;t&&!vt(t);){if(ot(t)&&!zt(t))return t;t=_t(t)}return n}let a=Pt(e,t);for(;a&&dt(a)&&zt(a);)a=Pt(a,t);return a&&vt(a)&&zt(a)&&!gt(a)?n:a||function(e){let t=_t(e);for(;lt(t)&&!vt(t);){if(gt(t))return t;if(ut(t))return null;t=_t(t)}return null}(e)||n}const Zt={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:a,strategy:r}=e;const s="fixed"===r,o=rt(a),l=!!t&&ut(t.floating);if(a===o||l&&s)return n;let i={scrollLeft:0,scrollTop:0},c=De(1);const d=De(0),u=lt(a);if((u||!u&&!s)&&(("body"!==nt(a)||ct(o))&&(i=wt(a)),u)){const e=Lt(a);c=Et(a),d.x=e.x+a.clientLeft,d.y=e.y+a.clientTop}const p=!o||u||s?De(0):Dt(o,i);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-i.scrollLeft*c.x+d.x+p.x,y:n.y*c.y-i.scrollTop*c.y+d.y+p.y}},getDocumentElement:rt,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:a,strategy:r}=e;const s="clippingAncestors"===n?ut(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let a=kt(e,[],!1).filter(e=>ot(e)&&"body"!==nt(e)),r=null;const s="fixed"===bt(e).position;let o=s?_t(e):e;for(;ot(o)&&!vt(o);){const t=bt(o),n=gt(o);n||"fixed"!==t.position||(r=null),(s?!n&&!r:!n&&"static"===t.position&&r&&("absolute"===r.position||"fixed"===r.position)||ct(o)&&!n&&At(e,o))?a=a.filter(e=>e!==o):r=t,o=_t(o)}return t.set(e,a),a}(t,this._c):[].concat(n),o=[...s,a],l=Tt(t,o[0],r);let i=l.top,c=l.right,d=l.bottom,u=l.left;for(let e=1;ee+"-"+r),t&&(s=s.concat(s.map(Ge)))),s}(l,f,h,w));const k=[l,..._],x=await i.detectOverflow(t,g),M=[];let N=(null==(a=s.flip)?void 0:a.overflows)||[];if(d&&M.push(x[y]),u){const e=function(e,t,n){void 0===n&&(n=!1);const a=Pe(e),r=Ye(e),s=Ze(r);let o="x"===r?a===(n?"end":"start")?"right":"left":"start"===a?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=He(o)),[o,He(o)]}(r,o,w);M.push(x[e[0]],x[e[1]])}if(N=[...N,{placement:r,overflows:M}],!M.every(e=>e<=0)){var E,I;const e=((null==(E=s.flip)?void 0:E.index)||0)+1,t=k[e];if(t&&("alignment"!==u||v===We(t)||N.every(e=>We(e.placement)!==v||e.overflows[0]>0)))return{data:{index:e,overflows:N},reset:{placement:t}};let n=null==(I=N.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:I.placement;if(!n)switch(m){case"bestFit":{var C;const e=null==(C=N.filter(e=>{if(j){const t=We(e.placement);return t===v||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:C[0];e&&(n=e);break}case"initialPlacement":n=l}if(r!==n)return{reset:{placement:n}}}return{}}}},Gt=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:a,placement:r,rects:s,platform:o,elements:l,middlewareData:i}=t,{element:c,padding:d=0}=Oe(e,t)||{};if(null==c)return{};const u=Qe(d),p={x:n,y:a},m=Ye(r),h=Ze(m),f=await o.getDimensions(c),g="y"===m,y=g?"top":"left",v=g?"bottom":"right",b=g?"clientHeight":"clientWidth",w=s.reference[h]+s.reference[m]-p[m]-s.floating[h],_=p[m]-s.reference[m],j=await(null==o.getOffsetParent?void 0:o.getOffsetParent(c));let k=j?j[b]:0;k&&await(null==o.isElement?void 0:o.isElement(j))||(k=l.floating[b]||s.floating[h]);const x=w/2-_/2,M=k/2-f[h]/2-1,N=Ie(u[y],M),E=Ie(u[v],M),I=N,C=k-f[h]-E,L=k/2-f[h]/2+x,S=Ae(I,L,C),D=!i.arrow&&null!=Pe(r)&&L!==S&&s.reference[h]/2-(Ln&&(m=n)}if(c){var y,v;const e="y"===p?"width":"height",t=et.has(ze(r)),n=s.reference[u]-s.floating[e]+(t&&(null==(y=o.offset)?void 0:y[u])||0)+(t?0:g.crossAxis),a=s.reference[u]+s.reference[e]+(t?0:(null==(v=o.offset)?void 0:v[u])||0)-(t?g.crossAxis:0);ha&&(h=a)}return{[p]:m,[u]:h}}}},Vt=(e,t,n)=>{const a=new Map,r={platform:Zt,...n},s={...r.platform,_c:a};return(async(e,t,n)=>{const{placement:a="bottom",strategy:r="absolute",middleware:s=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:Je},i=await(null==o.isRTL?void 0:o.isRTL(t));let c=await o.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:u}=$e(c,a,i),p=a,m=0;const h={};for(let n=0;n{t.current=e}),t}const $t=(e,t)=>{const n=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,a;const{x:r,y:s,placement:o,middlewareData:l}=t,i=await async function(e,t){const{placement:n,platform:a,elements:r}=e,s=await(null==a.isRTL?void 0:a.isRTL(r.floating)),o=ze(n),l=Pe(n),i="y"===We(n),c=et.has(o)?-1:1,d=s&&i?-1:1,u=Oe(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:h}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return l&&"number"==typeof h&&(m="end"===l?-1*h:h),i?{x:m*d,y:p*c}:{x:p*c,y:m*d}}(t,e);return o===(null==(n=l.offset)?void 0:n.placement)&&null!=(a=l.arrow)&&a.alignmentOffset?{}:{x:r+i.x,y:s+i.y,data:{...i,placement:o}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jt=(e,t)=>{const n=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:a,placement:r,platform:s}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:i={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=Oe(e,t),d={x:n,y:a},u=await s.detectOverflow(t,c),p=We(ze(r)),m=Re(p);let h=d[m],f=d[p];if(o){const e="y"===m?"bottom":"right";h=Ae(h+u["y"===m?"top":"left"],h,h-u[e])}if(l){const e="y"===p?"bottom":"right";f=Ae(f+u["y"===p?"top":"left"],f,f-u[e])}const g=i.fn({...t,[m]:h,[p]:f});return{...g,data:{x:g.x-n,y:g.y-a,enabled:{[m]:o,[p]:l}}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kt=(e,t)=>({fn:Bt(e).fn,options:[e,t]}),qt=(e,t)=>{const n=Yt(e);return{name:n.name,fn:n.fn,options:[e,t]}},en=(e,t)=>{const n=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,a;const{placement:r,rects:s,platform:o,elements:l}=t,{apply:i=()=>{},...c}=Oe(e,t),d=await o.detectOverflow(t,c),u=ze(r),p=Pe(r),m="y"===We(r),{width:h,height:f}=s.floating;let g,y;"top"===u||"bottom"===u?(g=u,y=p===(await(null==o.isRTL?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(y=u,g="end"===p?"top":"bottom");const v=f-d.top-d.bottom,b=h-d.left-d.right,w=Ie(f-d[g],v),_=Ie(h-d[y],b),j=!t.middlewareData.shift;let k=w,x=_;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(x=b),null!=(a=t.middlewareData.shift)&&a.enabled.y&&(k=v),j&&!p){const e=Ce(d.left,0),t=Ce(d.right,0),n=Ce(d.top,0),a=Ce(d.bottom,0);m?x=h-2*(0!==e||0!==t?e+t:Ce(d.left,d.right)):k=f-2*(0!==n||0!==a?n+a:Ce(d.top,d.bottom))}await i({...t,availableWidth:x,availableHeight:k});const M=await o.getDimensions(l.floating);return h!==M.width||f!==M.height?{reset:{rects:!0}}:{}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},tn=(e,t)=>{const n=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:a}=t,{strategy:r="referenceHidden",...s}=Oe(e,t);switch(r){case"referenceHidden":{const e=Ke(await a.detectOverflow(t,{...s,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:qe(e)}}}case"escaped":{const e=Ke(await a.detectOverflow(t,{...s,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:qe(e)}}}default:return{}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},nn=(e,t)=>{const n=(e=>({name:"arrow",options:e,fn(t){const{element:n,padding:a}="function"==typeof e?e(t):e;return n&&(r=n,{}.hasOwnProperty.call(r,"current"))?null!=n.current?Gt({element:n.current,padding:a}).fn(t):{}:n?Gt({element:n,padding:a}).fn(t):{};var r}}))(e);return{name:n.name,fn:n.fn,options:[e,t]}};var an=a.forwardRef((e,t)=>{const{children:n,width:a=10,height:r=5,...s}=e;return(0,I.jsx)(q.svg,{...s,ref:t,width:a,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:(0,I.jsx)("polygon",{points:"0,0 30,0 15,10"})})});an.displayName="Arrow";var rn=an,sn="Popper",[on,ln]=R(sn),[cn,dn]=on(sn),un=e=>{const{__scopePopper:t,children:n}=e,[r,s]=a.useState(null),[o,l]=a.useState(void 0);return(0,I.jsx)(cn,{scope:t,anchor:r,onAnchorChange:s,placementState:o,setPlacementState:l,children:n})};un.displayName=sn;var pn="PopperAnchor",mn=a.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,o=dn(pn,n),l=a.useRef(null),i=o.onAnchorChange,c=Y(t,a.useCallback(e=>{l.current=e,e&&i(e)},[i])),d=a.useRef(null);a.useEffect(()=>{if(!r)return;const e=d.current;d.current=r.current,e!==d.current&&i(d.current)});const u=o.placementState&&xn(o.placementState),p=u?.[0],m=u?.[1];return r?null:(0,I.jsx)(q.div,{"data-radix-popper-side":p,"data-radix-popper-align":m,...s,ref:c})});mn.displayName=pn;var hn="PopperContent",[fn,gn]=on(hn),yn=a.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:u=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:h=!1,updatePositionStrategy:f="optimized",onPlaced:g,...y}=e,v=dn(hn,n),[b,w]=a.useState(null),_=Y(t,w),[j,k]=a.useState(null),x=function(e){const[t,n]=a.useState(void 0);return ke(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const a=t[0];let r,s;if("borderBoxSize"in a){const e=a.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,s=t.blockSize}else r=e.offsetWidth,s=e.offsetHeight;n({width:r,height:s})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}(j),M=x?.width??0,N=x?.height??0,E=r+("center"!==o?"-"+o:""),C="number"==typeof p?p:{top:0,right:0,bottom:0,left:0,...p},L=Array.isArray(u)?u:[u],S=L.length>0,D={padding:C,boundary:L.filter(jn),altBoundary:S},{refs:T,floatingStyles:A,placement:O,isPositioned:z,middlewareData:P}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:o,floating:l}={},transform:c=!0,whileElementsMounted:d,open:u}=e,[p,m]=a.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=a.useState(r);Ft(h,r)||f(r);const[g,y]=a.useState(null),[v,b]=a.useState(null),w=a.useCallback(e=>{e!==x.current&&(x.current=e,y(e))},[]),_=a.useCallback(e=>{e!==M.current&&(M.current=e,b(e))},[]),j=o||g,k=l||v,x=a.useRef(null),M=a.useRef(null),N=a.useRef(p),E=null!=d,I=Xt(d),C=Xt(s),L=Xt(u),S=a.useCallback(()=>{if(!x.current||!M.current)return;const e={placement:t,strategy:n,middleware:h};C.current&&(e.platform=C.current),Vt(x.current,M.current,e).then(e=>{const t={...e,isPositioned:!1!==L.current};D.current&&!Ft(N.current,t)&&(N.current=t,i.flushSync(()=>{m(t)}))})},[h,t,n,C,L]);Ut(()=>{!1===u&&N.current.isPositioned&&(N.current.isPositioned=!1,m(e=>({...e,isPositioned:!1})))},[u]);const D=a.useRef(!1);Ut(()=>(D.current=!0,()=>{D.current=!1}),[]),Ut(()=>{if(j&&(x.current=j),k&&(M.current=k),j&&k){if(I.current)return I.current(j,k,S);S()}},[j,k,S,I,E]);const T=a.useMemo(()=>({reference:x,floating:M,setReference:w,setFloating:_}),[w,_]),A=a.useMemo(()=>({reference:j,floating:k}),[j,k]),O=a.useMemo(()=>{const e={position:n,left:0,top:0};if(!A.floating)return e;const t=Qt(A.floating,p.x),a=Qt(A.floating,p.y);return c?{...e,transform:"translate("+t+"px, "+a+"px)",...Ht(A.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:a}},[n,c,A.floating,p.x,p.y]);return a.useMemo(()=>({...p,update:S,refs:T,elements:A,floatingStyles:O}),[p,S,T,A,O])}({strategy:"fixed",placement:E,whileElementsMounted:(...e)=>function(e,t,n,a){void 0===a&&(a={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:o="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:i=!1}=a,c=Nt(e),d=r||s?[...c?kt(c):[],...t?kt(t):[]]:[];d.forEach(e=>{r&&e.addEventListener("scroll",n,{passive:!0}),s&&e.addEventListener("resize",n)});const u=c&&l?function(e,t){let n,a=null;const r=rt(e);function s(){var e;clearTimeout(n),null==(e=a)||e.disconnect(),a=null}return function o(l,i){void 0===l&&(l=!1),void 0===i&&(i=1),s();const c=e.getBoundingClientRect(),{left:d,top:u,width:p,height:m}=c;if(l||t(),!p||!m)return;const h={rootMargin:-Se(u)+"px "+-Se(r.clientWidth-(d+p))+"px "+-Se(r.clientHeight-(u+m))+"px "+-Se(d)+"px",threshold:Ce(0,Ie(1,i))||1};let f=!0;function g(t){const a=t[0].intersectionRatio;if(a!==i){if(!f)return o();a?o(!1,a):n=setTimeout(()=>{o(!1,1e-7)},1e3)}1!==a||Wt(c,e.getBoundingClientRect())||o(),f=!1}try{a=new IntersectionObserver(g,{...h,root:r.ownerDocument})}catch(e){a=new IntersectionObserver(g,h)}a.observe(e)}(!0),s}(c,n):null;let p,m=-1,h=null;o&&(h=new ResizeObserver(e=>{let[a]=e;a&&a.target===c&&h&&t&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),c&&!i&&h.observe(c),t&&h.observe(t));let f=i?Lt(e):null;return i&&function t(){const a=Lt(e);f&&!Wt(f,a)&&n(),f=a,p=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach(e=>{r&&e.removeEventListener("scroll",n),s&&e.removeEventListener("resize",n)}),null==u||u(),null==(e=h)||e.disconnect(),h=null,i&&cancelAnimationFrame(p)}}(...e,{animationFrame:"always"===f}),elements:{reference:v.anchor},middleware:[$t({mainAxis:s+N,alignmentAxis:l}),d&&Jt({mainAxis:!0,crossAxis:!1,limiter:"partial"===m?Kt():void 0,...D}),d&&qt({...D}),en({...D,apply:({elements:e,rects:t,availableWidth:n,availableHeight:a})=>{const{width:r,height:s}=t.reference,o=e.floating.style;o.setProperty("--radix-popper-available-width",`${n}px`),o.setProperty("--radix-popper-available-height",`${a}px`),o.setProperty("--radix-popper-anchor-width",`${r}px`),o.setProperty("--radix-popper-anchor-height",`${s}px`)}}),j&&nn({element:j,padding:c}),kn({arrowWidth:M,arrowHeight:N}),h&&tn({strategy:"referenceHidden",...D,boundary:S?D.boundary:void 0})]}),R=v.setPlacementState;ke(()=>(R(O),()=>{R(void 0)}),[O,R]);const[Z,W]=xn(O),G=te(g);ke(()=>{z&&G?.()},[z,G]);const B=P.arrow?.x,V=P.arrow?.y,U=0!==P.arrow?.centerOffset,[F,H]=a.useState();return ke(()=>{b&&H(window.getComputedStyle(b).zIndex)},[b]),(0,I.jsx)("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...A,transform:z?A.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:F,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(" "),...P.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,I.jsx)(fn,{scope:n,placedSide:Z,placedAlign:W,onArrowChange:k,arrowX:B,arrowY:V,shouldHideArrow:U,children:(0,I.jsx)(q.div,{"data-side":Z,"data-align":W,...y,ref:_,style:{...y.style,animation:z?void 0:"none"}})})})});yn.displayName=hn;var vn="PopperArrow",bn={top:"bottom",right:"left",bottom:"top",left:"right"},wn=a.forwardRef(function(e,t){const{__scopePopper:n,...a}=e,r=gn(vn,n),s=bn[r.placedSide];return(0,I.jsx)("span",{ref:r.onArrowChange,style:{position:"absolute",left:r.arrowX,top:r.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[r.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[r.placedSide],visibility:r.shouldHideArrow?"hidden":void 0},children:(0,I.jsx)(rn,{...a,ref:t,style:{...a.style,display:"block"}})})});function jn(e){return null!==e}wn.displayName=vn;var kn=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:a,middlewareData:r}=t,s=0!==r.arrow?.centerOffset,o=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[i,c]=xn(n),d={start:"0%",center:"50%",end:"100%"}[c],u=(r.arrow?.x??0)+o/2,p=(r.arrow?.y??0)+l/2;let m="",h="";return"bottom"===i?(m=s?d:`${u}px`,h=-l+"px"):"top"===i?(m=s?d:`${u}px`,h=`${a.floating.height+l}px`):"right"===i?(m=-l+"px",h=s?d:`${p}px`):"left"===i&&(m=`${a.floating.width+l}px`,h=s?d:`${p}px`),{data:{x:m,y:h}}}});function xn(e){const[t,n="center"]=e.split("-");return[t,n]}var Mn=un,Nn=mn,En=yn,In=wn,Cn=a.forwardRef((e,t)=>{const{container:n,...r}=e,[s,o]=a.useState(!1);ke(()=>o(!0),[]);const l=n||s&&globalThis?.document?.body;return l?i.createPortal((0,I.jsx)(q.div,{...r,ref:t}),l):null});Cn.displayName="Portal";var Ln=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=a.useState(),r=a.useRef(null),s=a.useRef(e),o=a.useRef("none"),l=a.useRef(void 0),i=e?"mounted":"unmounted",[c,d]=function(e,t){return a.useReducer((e,n)=>t[e][n]??e,e)}(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{"mounted"===c?(o.current=l.current??Dn(r.current),l.current=void 0):o.current="none"},[c]),ke(()=>{const t=r.current,n=s.current;if(n!==e){const a=o.current,r=Dn(t);e?(l.current=r,d("MOUNT")):d("none"===r||"none"===t?.display?"UNMOUNT":n&&a!==r?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,d]),ke(()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,a=a=>{const o=Dn(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(d("ANIMATION_END"),!s.current)){const a=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=a)})}},l=e=>{e.target===t&&(o.current=Dn(r.current))};return t.addEventListener("animationstart",l),t.addEventListener("animationcancel",a),t.addEventListener("animationend",a),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",l),t.removeEventListener("animationcancel",a),t.removeEventListener("animationend",a)}}d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:a.useCallback(e=>{if(e){const t=getComputedStyle(e);r.current=t,l.current=Dn(t)}else r.current=null;n(e)},[])}}(t),s="function"==typeof n?n({present:r.isPresent}):a.Children.only(n),o=function(...e){const t=a.useRef(e);return t.current=e,a.useCallback(e=>{const n=t.current;let a=!1;const r=n.map(t=>{const n=Sn(t,e);return a||"function"!=typeof n||(a=!0),n});if(a)return()=>{for(let e=0;e{},caller:r}){const[s,o,l]=function({defaultProp:e,onChange:t}){const[n,r]=a.useState(e),s=a.useRef(n),o=a.useRef(t);return Tn(()=>{o.current=t},[t]),a.useEffect(()=>{s.current!==n&&(o.current?.(n),s.current=n)},[n,s]),[n,r,o]}({defaultProp:t,onChange:n}),i=void 0!==e,c=i?e:s;{const t=a.useRef(void 0!==e);a.useEffect(()=>{const e=t.current;if(e!==i){const t=e?"controlled":"uncontrolled",n=i?"controlled":"uncontrolled";console.warn(`${r} is changing from ${t} to ${n}. 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.`)}t.current=i},[i,r])}const d=a.useCallback(t=>{if(i){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&l.current?.(n)}else o(t)},[i,e,o,l]);return[c,d]}Symbol("RADIX:SYNC_STATE");var On=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"}),zn=a.forwardRef((e,t)=>(0,I.jsx)(q.span,{...e,ref:t,style:{...On,...e.style}}));zn.displayName="VisuallyHidden";var Pn=zn,Rn=new WeakMap,Zn=new WeakMap,Wn={},Yn=0,Gn=function(e){return e&&(e.host||Gn(e.parentNode))},Bn=function(e,t,n){void 0===n&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),r=t||function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return r?(a.push.apply(a,Array.from(r.querySelectorAll("[aria-live], script"))),function(e,t,n,a){var r=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Gn(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);Wn[n]||(Wn[n]=new WeakMap);var s=Wn[n],o=[],l=new Set,i=new Set(r),c=function(e){e&&!l.has(e)&&(l.add(e),c(e.parentNode))};r.forEach(c);var d=function(e){e&&!i.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(l.has(e))d(e);else try{var t=e.getAttribute(a),r=null!==t&&"false"!==t,i=(Rn.get(e)||0)+1,c=(s.get(e)||0)+1;Rn.set(e,i),s.set(e,c),o.push(e),1===i&&r&&Zn.set(e,!0),1===c&&e.setAttribute(n,"true"),r||e.setAttribute(a,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return d(t),l.clear(),Yn++,function(){o.forEach(function(e){var t=Rn.get(e)-1,r=s.get(e)-1;Rn.set(e,t),s.set(e,r),t||(Zn.has(e)||e.removeAttribute(a),Zn.delete(e)),r||e.removeAttribute(n)}),--Yn||(Rn=new WeakMap,Rn=new WeakMap,Zn=new WeakMap,Wn={})}}(a,r,n,"aria-hidden")):function(){return null}},Vn=function(){return Vn=Object.assign||function(e){for(var t,n=1,a=arguments.length;n