@graphty/compact-mantine 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@mantine/core"),n=require("react/jsx-runtime"),X=require("@mantine/hooks"),r=require("react"),jo=require("react-dom"),xe=require("@tanstack/react-table"),Lo=require("@tanstack/react-virtual"),u={WIDTH:280,PAD_LEFT:16,PAD_RIGHT:8,CONTENT:256,BODY:224,FIELD:108,GUTTER:8,TRAIL_GAP:8,TRAIL:24,TRIPLE:72,TRIPLE_GAP:4,CONTROL_HEIGHT:24,ROW_PITCH:32,TOGGLE_PITCH:24,DATA_PITCH:28,SECTION_HEADER:32,SECTION_PAD_BOTTOM:8,GLYPH_SLOT:16,GLYPH:14,CHEVRON:12,VALUE_INSET:24,SPARKLINE_HEIGHT:32,HISTOGRAM_HEIGHT:64,LABEL_COLUMN:76},g={VALUE:"var(--mantine-color-text)",CHROME:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-1))",PROSE:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-1))",PLACEHOLDER:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-1))",DISABLED:"var(--mantine-color-disabled-color)",SURFACE:"light-dark(var(--mantine-color-gray-1), var(--mantine-color-dark-6))",PANEL:"var(--mantine-color-body)",RAISED:"light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-5))",SELECTED:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-1))",ON_SELECTED:"var(--mantine-color-body)",BORDER:"light-dark(var(--mantine-color-gray-6), var(--mantine-color-dark-2))",DIVIDER:"light-dark(var(--mantine-color-gray-6), var(--mantine-color-dark-2))",ACCENT:"var(--mantine-primary-color-filled)",ON_ACCENT:"var(--mantine-primary-color-contrast)",WARNING:"var(--mantine-color-yellow-6)",SUCCESS:"var(--mantine-color-green-6)",DANGER:"var(--mantine-color-red-6)"},Fn=["#d5d7da","#a3a8b1","#7a828e","#5f6873","#48525c","#374047","#2a3035","#1f2428","#161b22","#0d1117"],Vn={...o.DEFAULT_THEME.colors,dark:Fn},_o={compactSize:"sm",sizes:{xs:{"--button-height":"20px","--button-fz":"10px","--button-padding-x":"6px"},sm:{"--button-height":"24px","--button-fz":"11px","--button-padding-x":"8px"},md:{"--button-height":"30px","--button-fz":"13px","--button-padding-x":"12px"},lg:{"--button-height":"36px","--button-fz":"15px","--button-padding-x":"16px"},xl:{"--button-height":"44px","--button-fz":"17px","--button-padding-x":"20px"}}},Oo={compactSize:"sm",sizes:{xs:{"--ai-size":"18px"},sm:{"--ai-size":"24px"},md:{"--ai-size":"30px"},lg:{"--ai-size":"36px"},xl:{"--ai-size":"44px"}}};function Ho(e){return e==="light"?{"--ai-bd":"1px solid var(--ai-color)"}:{}}const Un={compactSize:"xs",sizes:{xs:{"--cb-size":"16px","--cb-icon-size":"12px"},sm:{"--cb-size":"20px","--cb-icon-size":"14px"},md:{"--cb-size":"24px","--cb-icon-size":"16px"},lg:{"--cb-size":"30px","--cb-icon-size":"20px"},xl:{"--cb-size":"36px","--cb-icon-size":"24px"}}};function F(e,t){const s=t==null?e.compactSize:String(t);return e.sizes[s]??e.sizes[e.compactSize]}const No={Button:o.Button.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(_o,t==null?void 0:t.size)})}),ActionIcon:o.ActionIcon.extend({defaultProps:{size:"sm",variant:"subtle"},vars:(e,t)=>({root:{...F(Oo,t==null?void 0:t.size),...Ho(t==null?void 0:t.variant)}})}),CloseButton:o.CloseButton.extend({defaultProps:{size:"xs"},vars:(e,t)=>({root:F(Un,t==null?void 0:t.size)})})},Do={compactSize:"sm",sizes:{xs:{"--switch-height":"12px","--switch-width":"22px","--switch-thumb-size":"8px","--switch-track-label-padding":"2px","--switch-label-font-size":"4px"},sm:{"--switch-height":"16px","--switch-width":"28px","--switch-thumb-size":"12px","--switch-track-label-padding":"2px","--switch-label-font-size":"5px"},md:{"--switch-height":"20px","--switch-width":"36px","--switch-thumb-size":"16px","--switch-track-label-padding":"3px","--switch-label-font-size":"7px"},lg:{"--switch-height":"24px","--switch-width":"44px","--switch-thumb-size":"20px","--switch-track-label-padding":"3px","--switch-label-font-size":"9px"},xl:{"--switch-height":"28px","--switch-width":"52px","--switch-thumb-size":"24px","--switch-track-label-padding":"4px","--switch-label-font-size":"11px"}}},ko={compactSize:"sm",sizes:{xs:{"--checkbox-size":"12px"},sm:{"--checkbox-size":"16px"},md:{"--checkbox-size":"20px"},lg:{"--checkbox-size":"24px"},xl:{"--checkbox-size":"28px"}}},Mo={compactSize:"sm",sizes:{xs:{"--radio-size":"12px","--radio-icon-size":"5px"},sm:{"--radio-size":"16px","--radio-icon-size":"6px"},md:{"--radio-size":"20px","--radio-icon-size":"8px"},lg:{"--radio-size":"24px","--radio-icon-size":"10px"},xl:{"--radio-size":"28px","--radio-icon-size":"12px"}}},an={compactSize:"sm",sizes:{xs:{"--slider-size":"2px","--slider-thumb-size":"8px"},sm:{"--slider-size":"4px","--slider-thumb-size":"12px"},md:{"--slider-size":"6px","--slider-thumb-size":"16px"},lg:{"--slider-size":"8px","--slider-thumb-size":"20px"},xl:{"--slider-size":"10px","--slider-thumb-size":"24px"}}},Go={compactSize:"sm",sizes:{xs:{"--sc-font-size":"9px","--sc-padding":"2px 6px"},sm:{"--sc-font-size":"10px","--sc-padding":"4px 8px"},md:{"--sc-font-size":"12px","--sc-padding":"6px 10px"},lg:{"--sc-font-size":"14px","--sc-padding":"8px 12px"},xl:{"--sc-font-size":"16px","--sc-padding":"10px 16px"}}},Bo={backgroundColor:"transparent"},Fo={backgroundColor:"light-dark(var(--mantine-color-gray-2), var(--mantine-color-dark-6))"},zt={fontSize:11},ln={fontSize:10,marginTop:2},Vo={SegmentedControl:o.SegmentedControl.extend({defaultProps:{size:"sm",withItemsBorders:!1},vars:(e,t)=>({root:F(Go,t==null?void 0:t.size)}),styles:{root:Bo,indicator:Fo}}),Checkbox:o.Checkbox.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(ko,t==null?void 0:t.size)}),styles:{label:zt}}),Switch:o.Switch.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Do,t==null?void 0:t.size)}),styles:{label:zt}}),Slider:o.Slider.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(an,t==null?void 0:t.size)}),styles:{markLabel:ln}}),Radio:o.Radio.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Mo,t==null?void 0:t.size)}),styles:{label:zt}}),RangeSlider:o.RangeSlider.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(an,t==null?void 0:t.size)}),styles:{markLabel:ln}})},Uo={compactSize:"sm",sizes:{xs:{"--badge-height":"12px","--badge-fz":"8px","--badge-padding-x":"3px"},sm:{"--badge-height":"14px","--badge-fz":"9px","--badge-padding-x":"4px"},md:{"--badge-height":"18px","--badge-fz":"11px","--badge-padding-x":"6px"},lg:{"--badge-height":"22px","--badge-fz":"13px","--badge-padding-x":"8px"},xl:{"--badge-height":"26px","--badge-fz":"15px","--badge-padding-x":"10px"}}},$o={compactSize:"sm",sizes:{xs:{"--avatar-size":"18px"},sm:{"--avatar-size":"24px"},md:{"--avatar-size":"30px"},lg:{"--avatar-size":"36px"},xl:{"--avatar-size":"44px"}}},Wo={compactSize:"sm",sizes:{xs:{"--ti-size":"18px"},sm:{"--ti-size":"24px"},md:{"--ti-size":"30px"},lg:{"--ti-size":"36px"},xl:{"--ti-size":"44px"}}},Yo={compactSize:"sm",sizes:{xs:{"--indicator-size":"6px"},sm:{"--indicator-size":"8px"},md:{"--indicator-size":"10px"},lg:{"--indicator-size":"12px"},xl:{"--indicator-size":"14px"}}},Xo={compactSize:"sm",sizes:{xs:{"--kbd-fz":"9px","--kbd-padding":"1px 3px"},sm:{"--kbd-fz":"10px","--kbd-padding":"2px 4px"},md:{"--kbd-fz":"12px","--kbd-padding":"3px 6px"},lg:{"--kbd-fz":"14px","--kbd-padding":"4px 8px"},xl:{"--kbd-fz":"16px","--kbd-padding":"5px 10px"}}},Ko={compactSize:"sm",sizes:{xs:{"--pill-height":"14px","--pill-fz":"9px"},sm:{"--pill-height":"16px","--pill-fz":"10px"},md:{"--pill-height":"20px","--pill-fz":"12px"},lg:{"--pill-height":"24px","--pill-fz":"14px"},xl:{"--pill-height":"28px","--pill-fz":"16px"}}},qo={Text:o.Text.extend({}),Badge:o.Badge.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Uo,t==null?void 0:t.size)})}),Pill:o.Pill.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Ko,t==null?void 0:t.size)})}),Avatar:o.Avatar.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F($o,t==null?void 0:t.size)})}),ThemeIcon:o.ThemeIcon.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Wo,t==null?void 0:t.size)})}),Indicator:o.Indicator.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Yo,t==null?void 0:t.size)})}),Kbd:o.Kbd.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Xo,t==null?void 0:t.size)})})},Zo={compactSize:"sm",sizes:{xs:{"--loader-size":"14px"},sm:{"--loader-size":"18px"},md:{"--loader-size":"24px"},lg:{"--loader-size":"30px"},xl:{"--loader-size":"38px"}}},Jo={compactSize:"sm",sizes:{xs:{"--progress-size":"2px"},sm:{"--progress-size":"4px"},md:{"--progress-size":"6px"},lg:{"--progress-size":"8px"},xl:{"--progress-size":"10px"}}},Qo={label:{fontSize:9}},ei={Loader:o.Loader.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Zo,t==null?void 0:t.size)})}),Progress:o.Progress.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Jo,t==null?void 0:t.size)}),styles:Qo}),RingProgress:o.RingProgress.extend({})},Gt=1e3,Me=1100,$n=8,Wn=4,Yn="light-dark(var(--mantine-primary-color-filled), var(--mantine-primary-color-5))",Tt={"--input-height":"24px","--input-size":"24px","--input-fz":"11px","--input-bg":"var(--mantine-color-default)","--input-bd":"transparent","--input-bd-focus":Yn},Xn={"--input-fz":"11px","--input-bg":"var(--mantine-color-default)","--input-bd":"transparent","--input-bd-focus":Yn},nt={fontSize:11,color:g.CHROME,marginBottom:1,lineHeight:1.2},$t={paddingInlineStart:8,paddingInlineEnd:8,backgroundColor:"var(--mantine-color-default)"},tt={label:nt,input:$t},cn={label:nt,input:$t},ht={dropdown:{padding:4,border:"none",boxShadow:"var(--mantine-shadow-md)"},option:{fontSize:11,padding:"4px 8px",borderRadius:4},options:{},groupLabel:{fontSize:10,padding:"4px 8px"},empty:{fontSize:11,padding:"8px"}},Pt={input:{...tt.input,minHeight:24,height:"auto",display:"flex",alignItems:"center",paddingTop:4,paddingBottom:4},pillsList:{columnGap:4,rowGap:2},pill:{margin:0}};function ve(e,t){return{...Tt,"--input-height":e,"--input-size":e,"--input-fz":t}}function gt(e){return{...Xn,"--input-fz":e}}const at={compactSize:"sm",sizes:{xs:ve("20px","10px"),sm:Tt,md:ve("30px","13px"),lg:ve("36px","15px"),xl:ve("44px","17px")}},mt={compactSize:"sm",sizes:{xs:gt("10px"),sm:Xn,md:gt("13px"),lg:gt("15px"),xl:gt("17px")}},ti={compactSize:"sm",sizes:{xs:{...ve("20px","10px"),"--input-right-section-width":"20px"},sm:{...Tt,"--input-right-section-width":"24px"},md:{...ve("30px","13px"),"--input-right-section-width":"30px"},lg:{...ve("36px","15px"),"--input-right-section-width":"36px"},xl:{...ve("44px","17px"),"--input-right-section-width":"44px"}}},ni={compactSize:"sm",sizes:{xs:{"--ni-chevron-size":"8px"},sm:{"--ni-chevron-size":"10px"},md:{"--ni-chevron-size":"12px"},lg:{"--ni-chevron-size":"14px"},xl:{"--ni-chevron-size":"16px"}}},oi={compactSize:"sm",sizes:{xs:{...ve("20px","10px"),"--combobox-chevron-size":"10px"},sm:{...Tt,"--combobox-chevron-size":"12px"},md:{...ve("30px","13px"),"--combobox-chevron-size":"14px"},lg:{...ve("36px","15px"),"--combobox-chevron-size":"16px"},xl:{...ve("44px","17px"),"--combobox-chevron-size":"18px"}}},ii={TextInput:o.TextInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:F(at,t==null?void 0:t.size)}),styles:tt}),NumberInput:o.NumberInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:F(ti,t==null?void 0:t.size),controls:F(ni,t==null?void 0:t.size)}),styles:{label:nt,input:$t,control:{borderColor:"transparent"}}}),Select:o.Select.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:Me}},vars:(e,t)=>({root:{},wrapper:F(at,t==null?void 0:t.size)}),styles:{...tt,...ht}}),Textarea:o.Textarea.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:F(mt,t==null?void 0:t.size)}),styles:cn}),PasswordInput:o.PasswordInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:F(at,t==null?void 0:t.size)}),styles:{...tt,innerInput:{paddingInlineStart:8,paddingInlineEnd:8}}}),Autocomplete:o.Autocomplete.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:Me}},vars:(e,t)=>({root:{},wrapper:F(at,t==null?void 0:t.size)}),styles:{...tt,...ht}}),MultiSelect:o.MultiSelect.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:Me}},vars:(e,t)=>({root:{},wrapper:F(oi,t==null?void 0:t.size)}),styles:{label:nt,...ht,...Pt,inputField:{minWidth:60,flexBasis:60}}}),TagsInput:o.TagsInput.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:Me}},vars:(e,t)=>({root:{},wrapper:F(mt,t==null?void 0:t.size)}),styles:{label:nt,...ht,...Pt,inputField:{minWidth:30,flexBasis:30}}}),PillsInput:o.PillsInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:F(mt,t==null?void 0:t.size)}),styles:{label:nt,...Pt}}),FileInput:o.FileInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:F(at,t==null?void 0:t.size)}),styles:tt}),JsonInput:o.JsonInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:F(mt,t==null?void 0:t.size)}),styles:cn}),InputClearButton:o.InputClearButton.extend({defaultProps:{size:"xs"},vars:(e,t)=>({root:F(Un,t==null?void 0:t.size)})})},si={compactSize:"sm",sizes:{xs:{"--pagination-control-size":"20px","--pagination-control-fz":"10px"},sm:{"--pagination-control-size":"24px","--pagination-control-fz":"11px"},md:{"--pagination-control-size":"30px","--pagination-control-fz":"13px"},lg:{"--pagination-control-size":"36px","--pagination-control-fz":"15px"},xl:{"--pagination-control-size":"44px","--pagination-control-fz":"17px"}}},ri={compactSize:"sm",sizes:{xs:{"--stepper-icon-size":"20px","--stepper-fz":"10px","--stepper-spacing":"6px"},sm:{"--stepper-icon-size":"24px","--stepper-fz":"11px","--stepper-spacing":"8px"},md:{"--stepper-icon-size":"30px","--stepper-fz":"13px","--stepper-spacing":"12px"},lg:{"--stepper-icon-size":"36px","--stepper-fz":"15px","--stepper-spacing":"16px"},xl:{"--stepper-icon-size":"44px","--stepper-fz":"17px","--stepper-spacing":"20px"}}},ai={compactSize:"sm",sizes:{xs:{"--burger-size":"14px","--burger-line-size":"2px"},sm:{"--burger-size":"18px","--burger-line-size":"2px"},md:{"--burger-size":"24px","--burger-line-size":"3px"},lg:{"--burger-size":"30px","--burger-line-size":"3px"},xl:{"--burger-size":"38px","--burger-line-size":"4px"}}},li={root:{fontSize:11}},ci={root:{fontSize:11,minHeight:28},label:{fontSize:11}},di={tab:{fontSize:11,padding:"6px 10px"}},ui={Anchor:o.Anchor.extend({defaultProps:{size:"sm"},styles:li}),Burger:o.Burger.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(ai,t==null?void 0:t.size)})}),NavLink:o.NavLink.extend({styles:ci}),Pagination:o.Pagination.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(si,t==null?void 0:t.size)})}),Stepper:o.Stepper.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(ri,t==null?void 0:t.size)})}),Tabs:o.Tabs.extend({styles:di})},pi={"--menu-item-fz":"11px"},fi={tooltip:{fontSize:11,padding:"4px 8px"}},xi={dropdown:{padding:8}},hi={dropdown:{padding:8}},gi={Menu:o.Menu.extend({defaultProps:{zIndex:Me},vars:()=>({dropdown:pi})}),Tooltip:o.Tooltip.extend({defaultProps:{zIndex:Me},styles:fi}),Popover:o.Popover.extend({defaultProps:{zIndex:Me},styles:xi}),HoverCard:o.HoverCard.extend({defaultProps:{zIndex:Me},styles:hi})},mi={xs:"10px",sm:"11px",md:"13px",lg:"14px",xl:"16px"},bi={xs:"4px",sm:"6px",md:"8px",lg:"12px",xl:"16px"},yi={xs:"2px",sm:"4px",md:"6px",lg:"8px",xl:"12px"},Kn=o.createTheme({colors:Vn,fontSizes:mi,spacing:bi,radius:yi,focusRing:"auto",other:{panelGrid:u},components:{...ii,...No,...Vo,...qo,...ei,...ui,...gi}}),vi=o.mergeMantineTheme(o.DEFAULT_THEME,Kn),qn=["#5B8FF9FF","#FF6B6BFF","#61D095FF","#F7B731FF","#9B59B6FF","#5B8FF980","#FF6B6B80","#61D09580","#F7B73180","#9B59B680"],St="#888888",Zn={mixed:"Mixed",fieldBound:"Bound to a data attribute",fieldPending:"Set but not yet applied",scaleSqrt:"Square root scale",scaleLinear:"Linear scale",scaleLog:"Logarithmic scale",details:"Details",departure:"Departure",percentile:e=>`${e} percentile`,expandSection:e=>`Expand ${e}`,collapseSection:e=>`Collapse ${e}`,addToSection:e=>`Add ${e}`,sectionHasConfiguredValues:e=>`${e} has configured values`,about:e=>`About ${e}`,resetToDefault:e=>`Reset ${e} to default`,colorSwatch:"Color swatch",colorHexValue:"Color hex value",opacity:"Opacity",colorPanelTitle:"Color",colorGenericName:"color",colorStops:"Color Stops",addColorStop:"Add color stop",colorStopPosition:e=>`Stop ${e} position`,removeColorStop:e=>`Remove color stop ${e}`,direction:"Direction",gradientDirection:"Gradient direction",degrees:e=>`${e}°`,percent:e=>`${e}%`,dataTable:"Data table",search:"Search",searchPlaceholder:"Search",clearSearch:"Clear search",noRows:"No rows",noMatchingRows:"No rows match the search",rowsShown:(e,t)=>`${e} of ${t} rows`,rowsSelected:e=>`${e} selected`,yes:"Yes",no:"No",closePanel:"Close panel",settings:"Settings",ordinal:(e,t)=>{switch(t){case"one":return`${e}st`;case"two":return`${e}nd`;case"few":return`${e}rd`;default:return`${e}th`}}},wi="en",Bt=r.createContext(Zn),Ft=r.createContext(void 0);function Si(e){return e!==void 0&&e!==""?e:typeof document<"u"&&document.documentElement.lang!==""?document.documentElement.lang:typeof navigator<"u"&&navigator.language!==""?navigator.language:wi}function Ii({labels:e,locale:t,children:s}){const i=r.useContext(Bt),a=r.useContext(Ft),l=r.useMemo(()=>({...i,...e}),[i,e]),c=t??a;return n.jsx(Ft.Provider,{value:c,children:n.jsx(Bt.Provider,{value:l,children:s})})}function ae(){return r.useContext(Bt)}function Fe(){const e=r.useContext(Ft);return Si(e)}const Ei=1234.5,Ci="9876543210",Ti=9876543210,Ri=new Set([" "," "," "," ","'","’"]),zi="−",Pi=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?/iu,dn=new Map;function Ai(e){var f,p;const t=dn.get(e);if(t!==void 0)return t;const s=new Intl.NumberFormat(e).formatToParts(Ei),i=((f=s.find(h=>h.type==="decimal"))==null?void 0:f.value)??".",a=((p=s.find(h=>h.type==="group"))==null?void 0:p.value)??"",l=new Map;for(const h of"0123456789")l.set(h,h);const c=new Intl.NumberFormat(e,{useGrouping:!1}).format(Ti);Array.from(c).forEach((h,m)=>{l.set(h,Ci[m])});const x={decimal:i,digits:l,group:a};return dn.set(e,x),x}function Jn(e,t){const s=Ai(t);let i="";for(const l of e.trim()){const c=s.digits.get(l);if(c!==void 0){i+=c;continue}if(l===s.decimal){i+=".";continue}if(!(l===s.group||Ri.has(l))){if(l==="-"||l===zi){i+="-";continue}if(l==="+"){i+="+";continue}if(l==="e"||l==="E"){i+=l;continue}break}}const a=Pi.exec(i);return a===null?Number.NaN:Number(a[0])}function qe(e){const t=Fe(),s=JSON.stringify(e??{});return r.useMemo(()=>new Intl.NumberFormat(t,e),[t,s])}function Qn(){const e=Fe(),t=ae(),s=qe(),i=r.useMemo(()=>new Intl.PluralRules(e,{type:"ordinal"}),[e]);return r.useCallback(a=>t.ordinal(s.format(a),i.select(a)),[t,s,i])}function eo(e){const t=Fe(),s=JSON.stringify(e??{});return r.useMemo(()=>new Intl.Collator(t,e),[t,s])}function Wt(){const e=Fe();return r.useCallback(t=>Jn(t,e),[e])}const to=["sizeSmallest","sizeLargest","width","opacity","attribute","scaleSqrt","scaleLinear","scaleLog"],no=["N","E","W","D","K"],ji=["chevronDown","chevronRight","chevronLeft","close","plus","minus","gear","warning","check","eye","refresh","copy","pin","keepOpen","info","reset"],oo={viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},je={fill:"currentColor",stroke:"none"},Li={sizeSmallest:e=>n.jsxs(n.Fragment,{children:[n.jsx("circle",{cx:"5",cy:"11",r:"2.5",...e?je:{}}),n.jsx("circle",{cx:"10.5",cy:"6.5",r:"4",...e?je:{}})]}),sizeLargest:e=>n.jsxs(n.Fragment,{children:[n.jsx("circle",{cx:"4.5",cy:"11.5",r:"1.75",...e?je:{}}),n.jsx("circle",{cx:"10",cy:"6",r:"5",...e?je:{}})]}),width:e=>n.jsxs(n.Fragment,{children:[n.jsx("line",{x1:"2.5",y1:"8",x2:"13.5",y2:"8"}),n.jsx("polyline",{points:"5,5.5 2.5,8 5,10.5",...e?je:{}}),n.jsx("polyline",{points:"11,5.5 13.5,8 11,10.5",...e?je:{}})]}),opacity:e=>e?n.jsx("circle",{cx:"8",cy:"8",r:"5.5",...je}):n.jsxs(n.Fragment,{children:[n.jsx("circle",{cx:"8",cy:"8",r:"5.5"}),n.jsx("path",{d:"M8 2.5a5.5 5.5 0 0 1 0 11z",...je})]}),attribute:e=>e?n.jsxs(n.Fragment,{children:[n.jsx("path",{d:"M2.5 7.2V3.5a1 1 0 0 1 1-1h3.7l6.3 6.3-4.7 4.7z",...je}),n.jsx("circle",{cx:"5.5",cy:"5.5",r:"0.75",style:{fill:g.SURFACE},stroke:"none"})]}):n.jsxs(n.Fragment,{children:[n.jsx("path",{d:"M2.5 7.2V3.5a1 1 0 0 1 1-1h3.7l6.3 6.3-4.7 4.7z"}),n.jsx("circle",{cx:"5.5",cy:"5.5",r:"0.75"})]}),scaleSqrt:()=>n.jsx("path",{d:"M2.5 13.5C4.5 5 8 2.5 13.5 2.5"}),scaleLinear:()=>n.jsx("line",{x1:"2.5",y1:"13.5",x2:"13.5",y2:"2.5"}),scaleLog:()=>n.jsx("path",{d:"M2.5 13.5C8 13.5 11.5 11 13.5 2.5"})},_i={chevronDown:n.jsx("polyline",{points:"4,6 8,10 12,6"}),chevronRight:n.jsx("polyline",{points:"6,4 10,8 6,12"}),chevronLeft:n.jsx("polyline",{points:"10,4 6,8 10,12"}),close:n.jsxs(n.Fragment,{children:[n.jsx("line",{x1:"4",y1:"4",x2:"12",y2:"12"}),n.jsx("line",{x1:"12",y1:"4",x2:"4",y2:"12"})]}),plus:n.jsxs(n.Fragment,{children:[n.jsx("line",{x1:"8",y1:"3",x2:"8",y2:"13"}),n.jsx("line",{x1:"3",y1:"8",x2:"13",y2:"8"})]}),minus:n.jsx("line",{x1:"3",y1:"8",x2:"13",y2:"8"}),gear:n.jsxs(n.Fragment,{children:[n.jsx("circle",{cx:"8",cy:"8",r:"2.25"}),n.jsx("circle",{cx:"8",cy:"8",r:"4.75"}),n.jsx("path",{d:"M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2M3.4 3.4l1.4 1.4M11.2 11.2l1.4 1.4M12.6 3.4l-1.4 1.4M4.8 11.2l-1.4 1.4"})]}),warning:n.jsxs(n.Fragment,{children:[n.jsx("path",{d:"M8 2.5l6 11H2z"}),n.jsx("line",{x1:"8",y1:"6.5",x2:"8",y2:"9.5"}),n.jsx("line",{x1:"8",y1:"11.5",x2:"8",y2:"11.75"})]}),check:n.jsx("polyline",{points:"3.5,8.5 6.5,11.5 12.5,5"}),eye:n.jsxs(n.Fragment,{children:[n.jsx("path",{d:"M1.5 8s2.5-4.5 6.5-4.5S14.5 8 14.5 8s-2.5 4.5-6.5 4.5S1.5 8 1.5 8z"}),n.jsx("circle",{cx:"8",cy:"8",r:"2"})]}),refresh:n.jsxs(n.Fragment,{children:[n.jsx("path",{d:"M2.5 8a5.5 5.5 0 1 0 1.6-3.9"}),n.jsx("polyline",{points:"2.5,2.5 2.5,6 6,6"})]}),copy:n.jsxs(n.Fragment,{children:[n.jsx("rect",{x:"5.5",y:"5.5",width:"8",height:"8",rx:"1"}),n.jsx("path",{d:"M10.5 5.5v-2a1 1 0 0 0-1-1h-6a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2"})]}),pin:n.jsxs(n.Fragment,{children:[n.jsx("path",{d:"M6 2.5h4l-.5 3.5 2 2.5H4.5l2-2.5z"}),n.jsx("line",{x1:"8",y1:"8.5",x2:"8",y2:"13.5"})]}),keepOpen:n.jsxs(n.Fragment,{children:[n.jsx("rect",{x:"3.5",y:"7",width:"9",height:"6.5",rx:"1"}),n.jsx("path",{d:"M5.75 7V5.25a2.25 2.25 0 0 1 4.5 0V7"})]}),info:n.jsxs(n.Fragment,{children:[n.jsx("circle",{cx:"8",cy:"8",r:"6.5"}),n.jsx("line",{x1:"8",y1:"7",x2:"8",y2:"11.5"}),n.jsx("line",{x1:"8",y1:"4.5",x2:"8",y2:"4.75"})]}),reset:n.jsxs(n.Fragment,{children:[n.jsx("line",{x1:"4",y1:"4",x2:"12",y2:"12"}),n.jsx("line",{x1:"12",y1:"4",x2:"4",y2:"12"})]})};function Ke({name:e,filled:t=!1,size:s=u.GLYPH}){return n.jsx("svg",{width:s,height:s,...oo,"aria-hidden":"true",focusable:"false","data-glyph":e,"data-filled":t?"true":"false",style:{flex:"0 0 auto",display:"block"},children:Li[e](t)})}function re({name:e,size:t=u.GLYPH}){return n.jsx("svg",{width:t,height:t,...oo,"aria-hidden":"true",focusable:"false","data-glyph":e,style:{flex:"0 0 auto",display:"block"},children:_i[e]})}function Yt(e){return typeof e=="string"&&to.includes(e)}function Xt(e){return typeof e=="string"&&no.includes(e)}const Kt=255,qt=100;function Zt(e){return Math.round(parseInt(e,16)/Kt*qt)}function Jt(e){return Math.round(e/qt*Kt).toString(16).padStart(2,"0")}function Oi(e){let t=e.replace("#","");t.length===3?t=`${t.split("").map(l=>l+l).join("")}ff`:t.length===4?t=t.split("").map(l=>l+l).join(""):t.length===6&&(t=`${t}ff`);const s=`#${t.slice(0,6)}`,i=t.slice(6,8),a=Zt(i);return{hex:s,opacity:a}}function Hi(e,t){const s=e.replace("#",""),i=Jt(t);return`#${s}${i}`}function Ni(e){return/^#?([A-Fa-f0-9]{3}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)}const It={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0};function Di(e,t){const s=e===void 0?"":e.trim();return s===""?t:`${/[.!?]$/u.test(s)?s:`${s}.`} ${t}`}function st({name:e,enabledTitle:t,disabled:s=!1,disabledReason:i,extraDescriptions:a}){const l=r.useId(),c=s&&i!==void 0&&i!==""?i:void 0,x=[];for(const p of a??[])p!==void 0&&p!==""&&x.push(p);c!==void 0&&x.push(c);const f=x.length>0?x.join(". "):void 0;return{title:c===void 0?t:Di(t??e,c),description:f,describedBy:f===void 0?void 0:l}}const io=r.createContext(null);function ki(){return r.useContext(io)}function Mi({children:e}){const t=r.useRef(null);if(!r.isValidElement(e))throw new Error("PopoutAnchor requires a single valid React element as its child");const s=e,i=r.cloneElement(s,{ref:t});return n.jsx(io.Provider,{value:{anchorRef:t},children:i})}function Gi({children:e}){return n.jsx(o.Box,{p:"sm",children:e})}const Bi=["[data-portal]","[data-combobox-dropdown]","[data-menu-dropdown]","[data-popover-dropdown]","[data-tooltip]","[data-hovercard-dropdown]","[data-dates-dropdown]","[data-modal]"].join(", ");function Fi(e,t=!0){r.useEffect(()=>{if(!t)return;const s=i=>{const a=i.target;a.closest('[role="dialog"]')||a.closest("[data-popout-trigger]")||a.closest("[data-popout-portal-container]")||a.closest(Bi)||e()};return document.addEventListener("mousedown",s),()=>{document.removeEventListener("mousedown",s)}},[e,t])}function Vi(e,t=!0){r.useEffect(()=>{if(!t)return;const s=i=>{i.key==="Escape"&&(i.preventDefault(),e())};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s)}},[e,t])}const so=r.createContext(null);function Ui({id:e,children:t}){return n.jsx(so.Provider,{value:e,children:t})}function ro(){return r.useContext(so)}const Qt=r.createContext(null),en=r.createContext(null);function Rt(){const e=r.useContext(Qt);if(!e)throw new Error("usePopoutContext must be used within a Popout component");return e}function $i(){return r.useContext(Qt)}function Wi(){const e=r.useContext(en);if(!e)throw new Error("usePopoutManagerContext must be used within a PopoutManager");return e}function Yi(){return r.useContext(en)}function Xi({children:e,parentId:t=null,opened:s,defaultOpened:i,onOpenChange:a}){const l=r.useId(),c=r.useRef(null),x=ro(),[f,p]=X.useUncontrolled({value:s,defaultValue:i,finalValue:!1,onChange:a}),h=r.useRef(p);r.useEffect(()=>{h.current=p});const m=r.useCallback((C,z)=>{if(z){h.current(C,z);return}h.current(C)},[]),b=r.useCallback(C=>{m(!0,C)},[m]),v=r.useCallback(C=>{m(!1,C)},[m]),T=r.useCallback(C=>{m(!f,C)},[f,m]),R=r.useMemo(()=>({id:l,isOpen:f,open:b,close:v,toggle:T,triggerRef:c,parentId:t,region:x}),[l,f,b,v,T,t,x]);return n.jsx(Qt.Provider,{value:R,children:e})}function Ki({children:e}){const[t,s]=r.useState(null),i=r.useRef([]),a=r.useRef(new Map),l=r.useRef(new Map),c=r.useRef(new Map),[x,f]=r.useState(0),p=r.useCallback((y,S,H)=>(l.current.get(y)??null)!==S?!1:S!==null?!0:(c.current.get(y)??null)===H,[]),h=r.useCallback((y,S)=>i.current.filter(H=>p(H,y,S)),[p]),m=r.useCallback(y=>{const S=[];for(const H of i.current){let k=H;for(;k;){const K=l.current.get(k)??null;if(K===y){S.push(H);break}k=K}}return S},[]),b=r.useCallback(y=>{let S=0,H=y;for(;H;){const k=l.current.get(H)??null;if(!k)break;S++,H=k}return S},[]),v=r.useCallback(y=>{var H;const S=[...y].sort((k,K)=>b(K)-b(k));for(const k of S)(H=a.current.get(k))==null||H()},[b]),T=r.useCallback((y,S,H,k)=>{if(i.current.includes(y)){a.current.set(y,S);return}const K=H??null,q=k??null,ge=h(K,q),Q=[];for(const ne of ge)Q.push(ne),Q.push(...m(ne));v(Q);const le=new Set(Q);i.current=i.current.filter(ne=>!le.has(ne)),i.current.push(y),a.current.set(y,S),l.current.set(y,K),c.current.set(y,q),f(ne=>ne+1)},[h,m,v]),R=r.useCallback(y=>{if(!i.current.includes(y)){a.current.delete(y),l.current.delete(y),c.current.delete(y);return}i.current=i.current.filter(S=>S!==y),a.current.delete(y),l.current.delete(y),c.current.delete(y),f(S=>S+1)},[]),C=r.useCallback(y=>{const S=i.current.indexOf(y);return S>=0?Gt+S:Gt},[]),z=r.useCallback(y=>{const S=i.current,H=S.indexOf(y);H===-1||H===S.length-1||(i.current=[...S.filter(k=>k!==y),y],f(k=>k+1))},[]),I=r.useCallback(y=>l.current.get(y)??null,[]),w=r.useCallback((y,S)=>{let H=S;for(;H;){const k=l.current.get(H);if(k===y)return!0;H=k??null}return!1},[]),P=r.useCallback(y=>{const S=[],H=i.current;for(const k of H)w(y,k)&&S.push(k);return S},[w]),j=r.useCallback(y=>{const S=P(y);for(const H of[...S].reverse()){const k=a.current.get(H);k==null||k()}},[P]),L=r.useCallback(y=>{j(y);const S=a.current.get(y);S==null||S()},[j]),D=r.useCallback((y,S)=>{const H=c.current.get(y)??null;for(const k of i.current)k!==y&&p(k,S,H)&&L(k)},[L,p]),U=r.useCallback(()=>{const y=i.current;if(y.length===0)return;const S=y[y.length-1],H=a.current.get(S);H==null||H()},[]),G=r.useCallback(()=>{const y=[...i.current];for(const S of y){const H=a.current.get(S);H==null||H()}},[]),N=r.useCallback(()=>i.current.length>0,[]),[$,A]=r.useState(!1);r.useEffect(()=>{A(i.current.length>0)},[x]),Vi(U,$),Fi(G,$);const O=r.useMemo(()=>({register:T,unregister:R,getZIndex:C,bringToFront:z,portalContainer:t,zIndexVersion:x,closeFocused:U,closeAll:G,hasOpenPopouts:N,closeWithDescendants:L,closeDescendants:j,closeSiblings:D,getParentId:I,isAncestor:w}),[T,R,C,z,t,x,U,G,N,L,j,D,I,w]);return n.jsxs(en.Provider,{value:O,children:[e,n.jsx("div",{ref:s,"data-popout-portal-container":!0,style:{display:"contents"}})]})}function _e(){return o.useDirection().dir}function he(e){return e==="rtl"}function qi(e,t){return he(t)?1-e:e}function Zi(e,t,s){return qi(e,s)*t}function Ji(e){return he(e)?{transform:"scaleX(-1)"}:{}}const un=3;function Qi(e){const{isOpen:t,onPress:s,onDragStart:i,onDrag:a,onDragEnd:l}=e,[c,x]=r.useState({left:0,top:0}),f=r.useRef(!1),p=r.useRef(!1),h=r.useRef(!1),m=r.useRef({x:0,y:0,offsetLeft:0,offsetTop:0}),b=r.useCallback(()=>{x({left:0,top:0})},[]),v=r.useCallback(()=>{const I=h.current;return h.current=!1,I},[]),T=r.useCallback(I=>{const w=I.target;if(!(w.tagName==="INPUT"||w.tagName==="TEXTAREA"||w.tagName==="BUTTON"||w.tagName==="SELECT"||w.closest("button")||w.closest("input")||w.closest("textarea")||w.closest("select"))){f.current=!0,p.current=!1,h.current=!1,m.current={x:I.clientX,y:I.clientY,offsetLeft:c.left,offsetTop:c.top},s==null||s(I);try{w.setPointerCapture(I.pointerId)}catch{}}},[c.left,c.top,s]),R=r.useCallback(I=>{if(!f.current)return;const w=I.clientX-m.current.x,P=I.clientY-m.current.y;if(!p.current){if(!(Math.abs(w)>=un||Math.abs(P)>=un))return;p.current=!0,i==null||i(I)}const j={left:m.current.offsetLeft+w,top:m.current.offsetTop+P};x(j),a==null||a(j,I)},[a,i]),C=r.useCallback(I=>{if(!f.current)return;f.current=!1;const w=I.target;w.hasPointerCapture(I.pointerId)&&w.releasePointerCapture(I.pointerId),p.current&&(p.current=!1,h.current=!0,l==null||l(I))},[l]),z=c.left!==0||c.top!==0;return t?{dragTriggerProps:{"data-drag-trigger":!0,onPointerDown:T,onPointerMove:R,onPointerUp:C,onPointerCancel:C,style:{cursor:"grab",userSelect:"none",touchAction:"none"}},dragOffset:c,resetDragOffset:b,hasDragged:z,consumeDragClick:v}:{dragTriggerProps:{},dragOffset:{left:0,top:0},resetDragOffset:b,hasDragged:!1,consumeDragClick:v}}function es({config:e,onClose:t,dragTriggerProps:s={},actions:i=[],activeTab:a,onTabChange:l,titleId:c}){var v;const x=ae(),{style:f,...p}=s,m=e.variant==="tabs"?e:null,b=(m==null?void 0:m.tabs.map(T=>({value:T.id,label:T.label})))??[];return n.jsxs(o.Group,{"data-testid":"popout-header",justify:"space-between",px:"sm",py:"xs",...p,style:{...f},children:[e.variant==="title"?n.jsx(o.Text,{id:c,"data-testid":"popout-header-title",size:"sm",fw:500,children:e.title}):n.jsxs(n.Fragment,{children:[n.jsx(o.VisuallyHidden,{id:c,children:((v=m==null?void 0:m.tabs[0])==null?void 0:v.label)??x.settings}),n.jsx(o.SegmentedControl,{"data-testid":"popout-header-tabs",data:b,value:a,onChange:T=>l==null?void 0:l(T),size:"xs"})]}),n.jsxs(o.Group,{gap:4,children:[i.map(T=>n.jsx(o.ActionIcon,{variant:"subtle",onClick:T.onClick,"aria-label":T.label,children:T.icon},T.id)),n.jsx(o.CloseButton,{"data-testid":"popout-header-close",onClick:t,"aria-label":x.closePanel})]})]})}function ts(e,t=document){return e===null?null:t.querySelector(`[data-popout-id="${e}"]`)}function pn(e,t,s){const{trigger:i,parent:a,panel:l}=s;if(e!==void 0){if(typeof e=="object")return e.current;switch(e){case"parent":return a??l??i;case"panel":return l??a??i;case"trigger":return i;default:{const c=e;throw new Error(`Unknown anchor target: ${String(c)}`)}}}return t==="x"?a??l??i:i??a??l}function ns(e,t){return e==="start"?he(t)?"right":"left":e==="end"?he(t)?"left":"right":e}function os(e,t,s=$n,i={}){const{placement:a="left",alignment:l="start",panelHeight:c=0,crossAnchorRect:x=e,direction:f="ltr"}=i;let p,h;switch(a){case"left":p=e.left-t-s,h=fn(x,l,c);break;case"right":p=e.right+s,h=fn(x,l,c);break;case"top":p=xn(x,l,t,f),h=e.top-c-s;break;case"bottom":p=xn(x,l,t,f),h=e.bottom+s;break;default:{const m=a;throw new Error(`Unknown placement: ${String(m)}`)}}return{left:p,top:h}}function fn(e,t,s){switch(t){case"start":return e.top;case"center":return e.top+e.height/2-s/2;case"end":return e.bottom-s;default:{const i=t;throw new Error(`Unknown alignment: ${String(i)}`)}}}function xn(e,t,s,i){switch(t){case"start":return he(i)?e.right-s:e.left;case"center":return e.left+e.width/2-s/2;case"end":return he(i)?e.left:e.right-s;default:{const a=t;throw new Error(`Unknown alignment: ${String(a)}`)}}}function is(e){var Ye,Se;const{width:t,height:s,header:i,label:a,children:l,anchorX:c,anchorY:x,placement:f="left",alignment:p="start",gap:h,actions:m,manageFocus:b=!0,onDragStart:v,onDrag:T,onDragEnd:R}=e,{isOpen:C,close:z,triggerRef:I,id:w,parentId:P,region:j}=Rt(),{getZIndex:L,portalContainer:D,register:U,unregister:G,bringToFront:N,zIndexVersion:$,closeDescendants:A}=Wi(),O=ki(),y=_e(),S=r.useId(),H=`popout-panel-${w}`,k=`popout-title-${S}`,[K,q]=r.useState(null),ge=r.useRef(!1),Q=r.useRef(null),le=r.useCallback(()=>{N(w)},[N,w]),{dragTriggerProps:ne,dragOffset:W,resetDragOffset:oe,hasDragged:Y,consumeDragClick:me}=Qi({isOpen:C,onPress:le,onDragStart:v,onDrag:T,onDragEnd:R}),be=(i==null?void 0:i.variant)==="tabs",Z=(i==null?void 0:i.variant)==="tabs"?i:null,fe=(Z==null?void 0:Z.defaultTab)??((Ye=Z==null?void 0:Z.tabs[0])==null?void 0:Ye.id),[Ve,Oe]=r.useState(fe),Ze=h??(P===null?0:Wn),Ue=r.useCallback((B,ee)=>{var te;Oe(B),(te=Z==null?void 0:Z.onTabChange)==null||te.call(Z,B,ee)},[Z]),de=r.useCallback(B=>{B.stopPropagation(),N(w),!me()&&A(w)},[A,N,me,w]),we=r.useCallback(B=>{A(w),z(B)},[A,z,w]),Ce=r.useRef(z);r.useEffect(()=>{Ce.current=z});const Re=r.useCallback(()=>{Ce.current()},[]);r.useEffect(()=>(C?U(w,Re,P,j):G(w),()=>{G(w)}),[C,w,U,G,Re,P,j]);const He=r.useCallback(()=>{const B={trigger:I.current,parent:ts(P),panel:(O==null?void 0:O.anchorRef.current)??null};return{inline:pn(c,"x",B),block:pn(x,"y",B)}},[I,P,O,c,x]),Ne=r.useCallback(()=>{var et;const{inline:B,block:ee}=He(),te=B??ee,ie=ee??B;if(!te||!ie)return;const ue=(et=Q.current)==null?void 0:et.getBoundingClientRect(),Ie=Math.max(t,(ue==null?void 0:ue.width)??0),M=Math.max(s??0,(ue==null?void 0:ue.height)??0),se=ns(f,y),Te=se==="top"||se==="bottom",dt=Te?ie:te,De=Te?te:ie,ce=os(dt.getBoundingClientRect(),Ie,Ze,{placement:se,alignment:p,panelHeight:M,crossAnchorRect:De.getBoundingClientRect(),direction:y});q(ke=>ke&&ke.left===ce.left&&ke.top===ce.top?ke:ce)},[He,t,s,f,p,Ze,y]);if(X.useIsomorphicEffect(()=>{if(!C){q(null);return}ge.current||(oe(),be&&Oe(fe)),Ne()},[C,Ne,oe,be,fe]),r.useEffect(()=>{if(!C)return;let B=0;const ee=()=>{B===0&&(B=requestAnimationFrame(()=>{B=0,Ne()}))},te=new ResizeObserver(ee),ie=new MutationObserver(ee),{inline:ue,block:Ie}=He();for(const se of new Set([ue,Ie].filter(Te=>Te!==null)))te.observe(se),ie.observe(se,{attributes:!0,attributeFilter:["style","class"]});Q.current&&te.observe(Q.current);const M=()=>{Y||ee()};return window.addEventListener("resize",M),window.addEventListener("scroll",M,!0),()=>{B!==0&&cancelAnimationFrame(B),te.disconnect(),ie.disconnect(),window.removeEventListener("resize",M),window.removeEventListener("scroll",M,!0)}},[C,Ne,He,Y]),r.useEffect(()=>{var B;if(b){if(C){const ee=setTimeout(()=>{var te;(te=Q.current)==null||te.focus()},0);return()=>{clearTimeout(ee)}}ge.current&&((B=I.current)==null||B.focus())}},[C,b,I]),r.useEffect(()=>{ge.current=C},[C]),!C||!D)return null;const $e=L(w),Je={left:((K==null?void 0:K.left)??0)+W.left,top:((K==null?void 0:K.top)??0)+W.top},ze=n.jsxs(o.Paper,{ref:Q,id:H,role:"dialog","aria-modal":"false","aria-labelledby":i?k:void 0,"aria-label":i?void 0:a,tabIndex:-1,radius:8,onClick:de,"data-testid":"popout-panel","data-popout-id":w,...P&&{"data-parent-id":P},style:{position:"fixed",left:Je.left,top:Je.top,minWidth:t,width:"min-content",...s!==void 0&&{minHeight:s},...K===null&&{visibility:"hidden"},zIndex:$e,backgroundColor:"var(--mantine-color-body)",border:"1px solid light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.12))",boxShadow:["0 1px 2px light-dark(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.4))","0 4px 8px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.35))","0 8px 16px light-dark(rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.25))"].join(", ")},children:[i?n.jsx(es,{config:i,onClose:we,dragTriggerProps:ne,activeTab:Ve,onTabChange:Ue,actions:m,titleId:k}):null,n.jsx(o.Box,{"data-testid":"popout-panel-content",children:be?(Se=Z==null?void 0:Z.tabs.find(B=>B.id===Ve))==null?void 0:Se.content:l})]});return jo.createPortal(ze,D)}function ss({children:e,action:t="toggle"}){const{open:s,toggle:i,triggerRef:a,isOpen:l,id:c}=Rt(),x=r.useCallback(h=>{if(h.stopPropagation(),t==="open"){s(h);return}i(h)},[t,s,i]);if(!r.isValidElement(e))throw new Error("PopoutTrigger requires a single valid React element as its child");const f=`popout-panel-${c}`,p=e;return r.cloneElement(p,{onClick:h=>{var m,b;(b=(m=p.props).onClick)==null||b.call(m,h),x(h)},ref:a,"data-popout-trigger":!0,"aria-expanded":l,"aria-controls":f,"aria-haspopup":"dialog"})}function rs({children:e,opened:t,defaultOpened:s,onOpenChange:i}){const a=$i(),l=(a==null?void 0:a.id)??null;return n.jsx(Xi,{parentId:l,opened:t,defaultOpened:s,onOpenChange:i,children:e})}const Ge=Object.assign(rs,{Trigger:ss,Panel:is,Content:Gi,Anchor:Mi}),as=r.forwardRef(function({icon:t,size:s="xs",...i},a){const{isOpen:l}=Rt();return n.jsx(o.ActionIcon,{ref:a,"data-testid":"popout-button",variant:l?"light":"subtle",size:s,c:l?void 0:"dimmed",...i,children:t})});function ao({children:e}){return n.jsx(Ki,{children:e})}const hn=4,gn=4,ls=2,cs=72,ds=54,us=220,mn=0,At=100,bn=9,yn=7,ps=/^#[0-9A-F]{6}$/iu,fs=1.1;function jt(e){const t=e==="start"?gn:0,s=e==="end"?gn:0;return{borderStartStartRadius:t,borderEndStartRadius:t,borderStartEndRadius:s,borderEndEndRadius:s}}function xs(){const e=Fe();return r.useMemo(()=>{var s;return((s=new Intl.NumberFormat(e).formatToParts(fs).find(i=>i.type==="decimal"))==null?void 0:s.value)??"."},[e])}function lo({color:e,defaultColor:t,opacity:s,defaultOpacity:i=At,onColorChange:a,onOpacityChange:l,onChange:c,label:x,showOpacity:f=!0,disabled:p=!1,disabledReason:h,onFocus:m,onBlur:b}){const v=ae(),T=Wt(),R=xs(),C=r.useId(),z=st({name:x,disabled:p,disabledReason:h}),[I,w]=X.useUncontrolled({value:e,defaultValue:void 0,finalValue:void 0,onChange:a}),[P,j]=X.useUncontrolled({value:s,defaultValue:void 0,finalValue:void 0,onChange:l}),L=I===void 0,D=P===void 0,U=L&&(!f||D),G=I??t,N=P??i,[$,A]=r.useState(G.replace("#","").toUpperCase()),[O,y]=r.useState(N);r.useEffect(()=>{A(G.replace("#","").toUpperCase())},[G]),r.useEffect(()=>{y(N)},[N]);const S=W=>{const oe=W.length===bn,Y=oe?W.slice(0,yn).toUpperCase():W.toUpperCase(),me=oe&&f,be=me?Zt(W.slice(yn,bn)):P;w(Y),me&&j(be),c==null||c(Y,be)},H=()=>`${G}${Jt(N)}`.toUpperCase(),k=W=>{A(W.currentTarget.value.toUpperCase())},K=W=>{const oe=$.toUpperCase(),Y=oe.startsWith("#")?oe:`#${oe}`;ps.test(Y)&&Y!==G?(w(Y,W),c==null||c(Y,P,W)):A(G.replace("#","").toUpperCase()),b==null||b(W)},q=W=>{y(W)},ge=W=>{const oe=typeof O=="string"?T(O):O;if(Number.isNaN(oe)){y(N),b==null||b(W);return}const Y=Math.min(At,Math.max(mn,oe));Y!==N&&(j(Y,W),c==null||c(I,Y,W)),y(Y),b==null||b(W)},Q=W=>{w(void 0,W),f&&j(void 0,W),c==null||c(void 0,f?void 0:P,W)},le=f?"middle":"end",ne=n.jsxs(o.Group,{"data-testid":"compact-color-input",gap:hn,wrap:"nowrap",title:x===void 0?z.title:void 0,"data-disabled":p?"true":void 0,children:[n.jsxs(o.Group,{gap:0,wrap:"nowrap",children:[n.jsxs(Ge,{children:[n.jsx(Ge.Trigger,{children:n.jsx(o.ActionIcon,{variant:"filled",size:u.CONTROL_HEIGHT,radius:0,style:{backgroundColor:"var(--mantine-color-default)",...jt("start")},"data-testid":"compact-color-input-swatch",disabled:p,"aria-label":v.colorSwatch,"aria-describedby":z.describedBy,children:n.jsx(o.ColorSwatch,{color:G,size:u.GLYPH,radius:ls,style:{border:`1px solid ${g.BORDER}`}})})}),n.jsx(Ge.Panel,{width:us,header:{variant:"title",title:x??v.colorPanelTitle},placement:"bottom",alignment:"start",gap:hn,children:n.jsx(Ge.Content,{children:n.jsx(o.ColorPicker,{format:"hexa",value:H(),onChange:S,swatches:[...qn]})})})]}),n.jsx(o.TextInput,{"data-testid":"compact-color-input-hex",disabled:p,description:z.description,value:$,onChange:k,onFocus:m,onBlur:K,"aria-label":v.colorHexValue,"data-is-default":L?"true":"false",w:cs,styles:{input:{...jt(le),fontFamily:"monospace",textTransform:"uppercase",...L?{fontStyle:"italic",color:g.CHROME}:{}},description:It}}),f&&n.jsxs(n.Fragment,{children:[n.jsx(o.Divider,{orientation:"vertical",color:g.BORDER,h:u.CONTROL_HEIGHT,my:0}),n.jsx(o.NumberInput,{"data-testid":"compact-color-input-opacity",disabled:p,description:z.description,value:O,onChange:q,onFocus:m,onBlur:ge,min:mn,max:At,decimalSeparator:R,hideControls:!0,suffix:"%","aria-label":v.opacity,"data-is-default":D?"true":"false",w:ds,styles:{input:{...jt("end"),textAlign:"end",...D?{fontStyle:"italic",color:g.CHROME}:{}},description:It}})]})]}),!U&&n.jsx(o.ActionIcon,{variant:"subtle",size:u.TRAIL,c:g.CHROME,"data-testid":"compact-color-input-reset",disabled:p,"aria-label":v.resetToDefault(x??v.colorGenericName),onClick:Q,children:n.jsx(re,{name:"reset",size:u.CHEVRON})}),z.description!==void 0&&n.jsx(o.VisuallyHidden,{id:z.describedBy,children:z.description})]});return x===void 0?ne:n.jsxs(o.Stack,{"data-testid":"compact-color-input-labelled",gap:0,role:"group","aria-labelledby":C,title:z.title,children:[n.jsx(o.Text,{id:C,"data-testid":"compact-color-input-label",size:"xs",c:g.CHROME,mb:1,lh:1.2,children:x}),ne]})}const bt=u.GUTTER,vn=4,hs=1,gs=1.2,ms="calc(-1 * var(--mantine-spacing-sm) - 1px)";function bs({label:e,actions:t,children:s,bleed:i=!1}){const a=r.useId(),l=t!=null;return n.jsxs(o.Box,{"data-testid":"control-group",role:"group","aria-labelledby":a,children:[n.jsx(o.Divider,{"data-testid":"control-group-divider",color:g.DIVIDER,size:hs,style:{marginBlockStart:bt,marginBlockEnd:0,marginInline:i?ms:void 0}}),n.jsxs(o.Box,{"data-testid":"control-group-header",style:{display:"flex",alignItems:"center",gap:vn,boxSizing:"border-box",paddingBlock:bt,paddingInline:bt},children:[n.jsx(o.Box,{component:"span",id:a,"data-testid":"control-group-label",title:e,style:{flex:"1 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--mantine-font-size-xs)",fontWeight:500,lineHeight:gs,color:g.VALUE},children:e}),l&&n.jsx(o.Box,{"data-testid":"control-group-actions",style:{display:"flex",alignItems:"center",gap:vn,flex:"0 0 auto"},children:t})]}),n.jsx(o.Stack,{"data-testid":"control-group-content",gap:0,px:bt,children:s})]})}function Le(e){const t=r.useRef(void 0);r.useEffect(()=>{process.env.NODE_ENV==="production"||e===void 0||t.current!==e&&(t.current=e,console.warn(e))},[e])}const wn=250,ys=4;function vs({name:e,bubbleId:t}){const{isOpen:s,open:i,close:a}=Rt();return n.jsx(Ge.Trigger,{action:"open",children:n.jsx(o.UnstyledButton,{type:"button",title:e,"aria-label":e,"aria-describedby":s?t:void 0,"data-testid":"info-circle",onMouseEnter:i,onMouseLeave:a,onFocus:i,onBlur:a,style:{flex:"0 0 auto",width:u.GLYPH,height:u.GLYPH,display:"inline-flex",alignItems:"center",justifyContent:"center",background:"transparent",color:g.CHROME,cursor:"default"},children:n.jsx(re,{name:"info",size:u.CHEVRON})})})}function co({children:e,label:t,opened:s,defaultOpened:i,onOpenChange:a}){const l=ae(),c=r.useId(),x=Yi()!==null,f=l.about(t),p=n.jsxs(Ge,{opened:s,defaultOpened:i,onOpenChange:a,children:[n.jsx(vs,{name:f,bubbleId:c}),n.jsx(Ge.Panel,{width:wn,label:f,placement:"bottom",alignment:"start",gap:ys,anchorX:"trigger",anchorY:"trigger",manageFocus:!1,children:n.jsx(o.Box,{id:c,w:wn,p:"xs",style:{fontSize:"var(--mantine-font-size-sm)",lineHeight:1.4,color:g.PROSE},children:e})})]});return x?p:n.jsx(ao,{children:p})}function lt(e){return e!=null&&e!==!1}function Ee({children:e}){return n.jsx(o.Box,{"data-testid":"trailing-slot",style:{flex:"0 0 auto",width:u.TRAIL,height:u.CONTROL_HEIGHT,display:"flex",alignItems:"center",justifyContent:"center"},children:e})}const uo=r.forwardRef(function(t,s){const{label:i,changed:a=!1,icon:l,onClick:c,disabled:x=!1,loading:f=!1,style:p,...h}=t,m=ae(),b=a?m.sectionHasConfiguredValues(i):i,v=a?g.VALUE:g.CHROME;return n.jsx(o.ActionIcon,{...h,ref:s,type:"button",variant:"subtle",color:"gray",size:u.TRAIL,radius:"sm",vars:()=>({root:{"--ai-color":v}}),title:b,"aria-label":b,"aria-busy":f,disabled:x,loading:f,"data-testid":"advanced-button","data-changed":a?"true":"false",onClick:c,style:{flex:"0 0 auto",...p},children:l??n.jsx(re,{name:"gear",size:u.GLYPH})})}),Lt=4,ws=1,Sn=6,Ss=12,Is=1.2;function Es(e){const{label:t,technicalName:s,opened:i,defaultOpened:a,onOpenChange:l,hasConfiguredValues:c=!1,empty:x=!1,onAdd:f,info:p,actions:h,children:m}=e,b=ae(),v=_e(),T=r.useId(),R=r.useId(),C=r.useId(),[z,I]=X.useUncontrolled({value:i,defaultValue:a,finalValue:!0,onChange:l}),w=!x&&r.Children.toArray(m).length>0,P=p!=null;Le(x||w?void 0:`ControlSection "${t}" was given no children, and it holds the rows of a section. Pass the rows, set "empty" to draw it as a single row with a "+", or do not render it: a section header whose chevron opens onto nothing is a dead end for the reader.`);const j=O=>{I(!z,O)},L=z?b.collapseSection(t):b.expandSection(t),D=b.addToSection(t),U=he(v)?"chevronLeft":"chevronRight",G={flex:"0 0 auto",width:u.GLYPH_SLOT,height:u.GLYPH_SLOT,display:"flex",alignItems:"center",justifyContent:"center",color:g.CHROME},N={display:"flex",alignItems:"center",gap:Lt,flex:"0 1 auto",minWidth:0,height:"100%",background:"transparent",textAlign:"start"},$=s===void 0?t:`${t} (${s})`,A=n.jsxs(o.Box,{component:"span",id:T,title:$,"data-testid":"control-section-name",style:{minWidth:0,fontSize:Ss,fontWeight:500,lineHeight:Is,color:x?g.CHROME:g.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[t,s===void 0?null:n.jsx(o.Box,{component:"span","data-testid":"control-section-technical-name",style:{fontWeight:400,color:g.CHROME},children:` (${s})`})]});return n.jsxs(o.Box,{role:"group","aria-labelledby":T,"aria-describedby":P?C:void 0,"data-testid":"control-section","data-empty":x?"true":void 0,children:[n.jsx(o.Divider,{"data-testid":"control-section-divider",color:g.DIVIDER,size:ws,my:0,mx:0}),n.jsxs(o.Box,{"data-testid":"control-section-header",style:{display:"flex",alignItems:"center",gap:Lt,boxSizing:"border-box",height:u.SECTION_HEADER,paddingInlineStart:u.PAD_LEFT,paddingInlineEnd:u.PAD_RIGHT},children:[w?n.jsxs(o.UnstyledButton,{type:"button","data-testid":"control-section-toggle","aria-label":L,"aria-expanded":z,"aria-controls":R,onClick:j,style:{...N,cursor:"pointer"},children:[n.jsx(o.Box,{"data-testid":"control-section-chevron-slot",style:G,children:n.jsx(re,{name:z?"chevronDown":U,size:u.CHEVRON})}),A]}):n.jsxs(o.Box,{style:N,children:[n.jsx(o.Box,{"data-testid":"control-section-chevron-slot",style:G}),A]}),c&&n.jsx(o.Box,{role:"img","aria-label":b.sectionHasConfiguredValues(t),"data-testid":"control-section-dot",style:{flex:"0 0 auto",width:Sn,height:Sn,borderRadius:"50%",background:g.ACCENT}}),P&&n.jsx(co,{label:t,children:p}),n.jsx(o.Box,{style:{flex:"1 1 auto"}}),h!=null&&n.jsx(o.Box,{"data-testid":"control-section-actions",style:{display:"flex",alignItems:"center",gap:Lt,flex:"0 0 auto"},children:h}),x&&f!==void 0&&n.jsx(Ee,{children:n.jsx(o.ActionIcon,{type:"button",variant:"subtle",size:u.CONTROL_HEIGHT,radius:"sm",c:g.CHROME,title:D,"aria-label":D,"data-testid":"control-section-add",onClick:f,children:n.jsx(re,{name:"plus",size:u.GLYPH})})})]}),P&&n.jsx(o.Box,{id:C,"data-testid":"control-section-description",hidden:!0,children:p}),w&&n.jsx(o.Collapse,{id:R,in:z,children:n.jsx(o.Box,{"data-testid":"control-section-content",style:{paddingInlineStart:u.PAD_LEFT,paddingInlineEnd:u.PAD_RIGHT,paddingBottom:u.SECTION_PAD_BOTTOM},children:n.jsx(o.Stack,{gap:0,children:m})})})]})}const _t="control-sub-group",In=4,Cs=10,Ts=1.2;function Rs(e){const{label:t,opened:s,defaultOpened:i,onOpenChange:a,children:l}=e,c=ae(),x=_e(),f=r.useRef(void 0),[p,h]=X.useUncontrolled({value:s,defaultValue:i,finalValue:!1,onChange:a}),m=r.useCallback(C=>{f.current=C},[]),b=r.useCallback(C=>{const z=f.current;f.current=void 0,h(C===_t,z)},[h]),v=p?c.collapseSection(t):c.expandSection(t);let T="chevronDown";p||(T=he(x)?"chevronLeft":"chevronRight");const R={item:{border:"none",background:"transparent"},control:{paddingInline:0,paddingBlock:0,minHeight:u.TOGGLE_PITCH,color:g.CHROME},label:{paddingBlock:0,fontSize:"var(--mantine-font-size-xs)",lineHeight:Ts,color:g.CHROME},chevron:{marginInlineStart:0,marginInlineEnd:In,color:g.CHROME},content:{paddingBlock:0,paddingInlineStart:u.GUTTER,paddingInlineEnd:0}};return n.jsx(o.Accordion,{"data-testid":"control-sub-group",value:p?_t:null,onChange:b,chevronPosition:"left",chevronSize:u.GLYPH_SLOT,disableChevronRotation:!0,chevron:n.jsx(re,{name:T,size:Cs}),styles:R,children:n.jsxs(o.Accordion.Item,{value:_t,"data-testid":"control-sub-group-item",children:[n.jsx(o.Accordion.Control,{"data-testid":"control-sub-group-control","aria-label":v,onClick:m,children:n.jsx(o.Box,{component:"span","data-testid":"control-sub-group-label",title:t,style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t})}),n.jsx(o.Accordion.Panel,{"data-testid":"control-sub-group-panel",children:n.jsx(o.Box,{"data-testid":"control-sub-group-content",style:{display:"flex",flexDirection:"column",gap:In},children:l})})]})})}function it(e){if("key"in e)return{source:"keyboard"};const t=e.nativeEvent;return typeof PointerEvent<"u"&&t instanceof PointerEvent?{source:t.pointerType===""?"keyboard":"pointer"}:{source:t.detail===0?"keyboard":"pointer"}}function zs(e){const t=ae();return r.useMemo(()=>({...t,...e}),[t,e])}const pe=-1;function ot(e,t,s){return Math.min(Math.max(e,t),s)}function Ps(e,t,s,i,a){const{rowCount:l,columnCount:c,pageSize:x}=s,f=l-1,p=c-1;if(c===0)return;const h=he(i)?"ArrowLeft":"ArrowRight",m=he(i)?"ArrowRight":"ArrowLeft";if(t===h)return{row:e.row,column:Math.min(e.column+1,p)};if(t===m)return{row:e.row,column:Math.max(e.column-1,0)};if(t==="ArrowDown")return{row:ot(e.row+1,pe,f),column:e.column};if(t==="ArrowUp")return{row:ot(e.row-1,pe,f),column:e.column};if(t==="Home")return a.jumpToEnd?{row:pe,column:0}:{row:e.row,column:0};if(t==="End")return a.jumpToEnd?{row:Math.max(f,pe),column:p}:{row:e.row,column:p};if(t==="PageDown")return{row:ot(Math.max(e.row,0)+x,0,Math.max(f,0)),column:e.column};if(t==="PageUp")return{row:ot(Math.max(e.row,0)-x,0,Math.max(f,0)),column:e.column}}function As(e,t){const s=t.rowCount-1,i=Math.max(t.columnCount-1,0);return{row:ot(e.row,pe,Math.max(s,pe)),column:ot(e.column,0,i)}}function yt(e,t){return e.row===t.row&&e.column===t.column}function js(e,t,s){const i=Math.min(t,s),a=Math.max(t,s);return e.slice(i,a+1)}function Vt(e,t){const s=new Set(e),i=[];for(const a of s)t.includes(a)||i.push(a);for(const a of t)s.has(a)&&i.push(a);return i}function Ls(e){const{ids:t,index:s,selected:i,anchor:a,modifiers:l,mode:c}=e,x=t[s];if(c==="none"||x===void 0)return{selected:[...i],anchor:a};if(c==="single")return{selected:[x],anchor:x};const f=a===void 0?-1:t.indexOf(a);if(l.extend&&f!==-1){const p=js(t,f,s);return{selected:l.toggle?Vt([...i,...p],t):p,anchor:a}}if(l.toggle){const p=new Set(i);return p.has(x)?p.delete(x):p.add(x),{selected:Vt(p,t),anchor:x}}return{selected:[x],anchor:x}}function _s(e,t,s){return s!=="multiple"?{selected:[...t],anchor:void 0}:{selected:Vt([...t,...e],e),anchor:e[0]}}function En(e,t){return e==null?"":typeof e=="string"?e:typeof e=="number"?Number.isFinite(e)?t.number.format(e):"":typeof e=="boolean"?e?t.yes:t.no:Number.isNaN(e.getTime())?"":t.date.format(e)}function Cn(e){return e==null?!0:typeof e=="number"?!Number.isFinite(e):e instanceof Date&&Number.isNaN(e.getTime())}function Os(e,t,s){const i=Cn(e),a=Cn(t);return i||a?i&&a?0:i?-1:1:typeof e=="number"&&typeof t=="number"?e-t:typeof e=="boolean"&&typeof t=="boolean"?e===t?0:e?1:-1:e instanceof Date&&t instanceof Date?e.getTime()-t.getTime():s.compare(String(e),String(t))}const Hs=xe.tableFeatures({columnFilteringFeature:xe.columnFilteringFeature,columnOrderingFeature:xe.columnOrderingFeature,columnVisibilityFeature:xe.columnVisibilityFeature,filteredRowModel:xe.createFilteredRowModel(),globalFilteringFeature:xe.globalFilteringFeature,rowSelectionFeature:xe.rowSelectionFeature,rowSortingFeature:xe.rowSortingFeature,sortedRowModel:xe.createSortedRowModel()}),Ns=320,Ds=8,ks=12,Ms=1.2,Gs="var(--mantine-primary-color-light)",Tn="mantine-focus-auto",Ot=[],Bs=[];function Rn(e){return e==="asc"?"ascending":e==="desc"?"descending":"none"}function Fs(e,t,s){return Math.min(Math.max(e,t),s)}function Vs(e,t){const{data:s,columns:i,getRowId:a,label:l,labelledBy:c,labels:x,height:f=Ns,rowHeight:p=u.DATA_PITCH,headerHeight:h=u.CONTROL_HEIGHT,overscan:m=Ds,selectionMode:b="multiple",selectedIds:v,defaultSelectedIds:T,onSelectionChange:R,sorting:C,defaultSorting:z,onSortingChange:I,hiddenColumns:w,defaultHiddenColumns:P,onHiddenColumnsChange:j,columnOrder:L,defaultColumnOrder:D,onColumnOrderChange:U,filter:G,defaultFilter:N,onFilterChange:$,searchable:A=!1,onRowClick:O,onRowDoubleClick:y,onRowContextMenu:S,onFocus:H,onBlur:k,empty:K}=e,q=zs(x),ge=_e(),Q=Fe(),le=qe(),ne=eo({numeric:!0,sensitivity:"variant"}),W=r.useMemo(()=>new Intl.DateTimeFormat(Q),[Q]),oe=r.useMemo(()=>({number:le,date:W,yes:q.yes,no:q.no}),[le,W,q.yes,q.no]),[Y,me]=X.useUncontrolled({value:v,defaultValue:T,finalValue:Ot,onChange:(d,E)=>{R==null||R([...d],E)}}),[be,Z]=X.useUncontrolled({value:C,defaultValue:z,finalValue:Bs,onChange:(d,E)=>{I==null||I([...d],E)}}),[fe,Ve]=X.useUncontrolled({value:w,defaultValue:P,finalValue:Ot,onChange:(d,E)=>{j==null||j([...d],E)}}),[Oe,Ze]=X.useUncontrolled({value:L,defaultValue:D,finalValue:Ot,onChange:(d,E)=>{U==null||U([...d],E)}}),[Ue,de]=X.useUncontrolled({value:G,defaultValue:N,finalValue:"",onChange:(d,E)=>{$==null||$(d,E)}}),we=r.useMemo(()=>{const d=new Map;for(const E of i)d.set(E.id,E);return d},[i]),Ce=JSON.stringify(fe),Re=r.useMemo(()=>{const d=new Set(fe);return i.filter(E=>(E.filterable??!0)&&!d.has(E.id)).map(E=>E.id)},[i,Ce]),He=r.useMemo(()=>{const d=Ue.trim();if(d!=="")return{query:d.toLocaleLowerCase(Q),columnIds:Re}},[Ue,Q,Re]),Ne=r.useMemo(()=>[...s],[s]),$e=r.useMemo(()=>i.map(d=>({id:d.id,accessorFn:E=>d.value(E),enableSorting:d.sortable??!0,enableHiding:d.hideable??!0,enableGlobalFilter:d.filterable??!0,sortDescFirst:d.descendingFirst,sortFn:(E,_)=>Os(d.value(E.original),d.value(_.original),ne)})),[i,ne]),Je=JSON.stringify(be),Qe=r.useMemo(()=>be.map(d=>({id:d.id,desc:d.desc})),[Je]),We=r.useMemo(()=>{const d={};for(const E of fe)d[E]=!1;return d},[fe]),ze=r.useMemo(()=>{const d={};for(const E of Y)d[E]=!0;return d},[Y]),Ye=r.useMemo(()=>[...Oe],[Oe]),Se=r.useRef(void 0),B=xe.useTable({features:Hs,data:Ne,columns:$e,getRowId:a,enableRowSelection:b!=="none",enableMultiRowSelection:b==="multiple",getColumnCanGlobalFilter:()=>!0,globalFilterFn:(d,E,_)=>{const V=_;if(V===void 0||!V.columnIds.includes(E))return!1;const J=we.get(E);return J===void 0?!1:En(J.value(d.original),oe).toLocaleLowerCase(Q).includes(V.query)},state:{sorting:Qe,columnVisibility:We,columnOrder:Ye,rowSelection:ze,globalFilter:He},onSortingChange:d=>{const E=xe.functionalUpdate(d,Qe);Z(E.map(_=>({id:_.id,desc:_.desc})),Se.current)},onColumnVisibilityChange:d=>{const E=xe.functionalUpdate(d,We);Ve(Object.keys(E).filter(_=>!E[_]))},onColumnOrderChange:d=>{Ze(xe.functionalUpdate(d,Ye))},onRowSelectionChange:d=>{me(Object.keys(xe.functionalUpdate(d,ze)))}}),{rows:ee}=B.getRowModel(),te=B.getVisibleLeafColumns(),ie=ee.length,ue=te.length,Ie=r.useMemo(()=>ee.map(d=>d.id),[ee]),M=r.useRef(null),se=r.useRef(null),Te=Lo.useVirtualizer({count:ie,getScrollElement:()=>M.current,estimateSize:()=>p,getItemKey:d=>Ie[d]??d,overscan:m}),[dt,De]=r.useState({row:pe,column:0}),ce=r.useMemo(()=>As(dt,{rowCount:ie,columnCount:ue}),[dt,ie,ue]),et=r.useRef(!1),ke=r.useRef(void 0),Co=d=>{d.row>=0&&Te.scrollToIndex(d.row),et.current=!0,De(E=>yt(E,d)?E:d)};r.useLayoutEffect(()=>{var _;if(!et.current)return;const d=`[data-grid-row="${ce.row}"][data-grid-column="${ce.column}"]`,E=(_=se.current)==null?void 0:_.querySelector(d);E instanceof HTMLElement&&(et.current=!1,E.focus())});const nn=(d,E)=>{ke.current=d.anchor,!(d.selected.length===Y.length&&d.selected.every((V,J)=>V===Y[J]))&&me(d.selected,E)},ut=(d,E,_)=>{nn(Ls({ids:Ie,index:d,selected:Y,anchor:ke.current,modifiers:E,mode:b}),_)},on=(d,E,_)=>{const V=ee[d];V!==void 0&&(O==null||O(V.original,E,_))},To=(d,E)=>{d.getCanSort()&&(Se.current=E,d.toggleSorting(void 0,E.shiftKey&&d.getCanMultiSort()),Se.current=void 0)},Ro=()=>{var _;const d=((_=M.current)==null?void 0:_.clientHeight)??0,E=Math.floor((d===0?p*10:d)/p);return Math.max(1,E-1)},zo=d=>{const E=b==="multiple",_=d.ctrlKey||d.metaKey;if(E&&_&&(d.key==="a"||d.key==="A")){d.preventDefault(),nn(_s(Ie,Y,b),d);return}if(ce.row>=0&&(d.key===" "||d.key==="Enter")){d.preventDefault(),d.key===" "?ut(ce.row,{extend:d.shiftKey,toggle:!d.shiftKey},d):(ut(ce.row,{extend:!1,toggle:!1},d),on(ce.row,d,{source:"keyboard"}));return}const V=Ps(ce,d.key,{rowCount:ie,columnCount:ue,pageSize:Ro()},ge,{jumpToEnd:_});V!==void 0&&(d.preventDefault(),Co(V),E&&d.shiftKey&&V.row>=0&&V.row!==ce.row&&ut(V.row,{extend:!0,toggle:!1},d))};r.useImperativeHandle(t,()=>({scrollToRow:d=>{d>=0&&d<ie&&Te.scrollToIndex(d)},setColumnHidden:(d,E)=>{var _;(_=B.getColumn(d))==null||_.toggleVisibility(!E)},moveColumn:(d,E)=>{const _=B.getAllLeafColumns().map(J=>J.id),V=_.indexOf(d);V!==-1&&(_.splice(V,1),_.splice(Fs(E,0,_.length),0,d),B.setColumnOrder(_))},clearSelection:()=>{ke.current=void 0,me([])}}),[B,Te,ie,me]);const Po=te.reduce((d,E)=>{var _;return d+(((_=we.get(E.id))==null?void 0:_.width)??u.FIELD)},0),sn=(d,E)=>{const _=(d==null?void 0:d.width)??u.FIELD;return{flex:E===ue-1?`1 1 ${String(_)}px`:`0 0 ${String(_)}px`,minWidth:0,boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:(d==null?void 0:d.align)==="end"?"flex-end":"flex-start",paddingInline:u.GUTTER,outlineOffset:-2,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},pt=b!=="none",rn=q.rowsShown(le.format(ie),le.format(s.length)),Ao=()=>K!==void 0?K:s.length===0?q.noRows:q.noMatchingRows;return n.jsxs(o.Box,{"data-testid":"data-table",dir:he(ge)?"rtl":void 0,onFocus:H,onBlur:k,style:{display:"flex",flexDirection:"column",gap:u.TRAIL_GAP,width:"100%",color:g.VALUE},children:[A&&n.jsxs(o.Box,{style:{display:"flex",alignItems:"center",gap:u.GUTTER},children:[n.jsx(o.TextInput,{"data-testid":"data-table-search",size:"xs",type:"search","aria-label":q.search,placeholder:q.searchPlaceholder,value:Ue,onChange:d=>{de(d.currentTarget.value,d)},rightSection:Ue===""?void 0:n.jsx(o.ActionIcon,{"data-testid":"data-table-search-clear",variant:"subtle",size:u.CONTROL_HEIGHT,"aria-label":q.clearSearch,onClick:d=>{de("",d)},children:n.jsx(re,{name:"close",size:u.CHEVRON})}),rightSectionPointerEvents:"all",style:{flex:"1 1 auto",minWidth:0}}),n.jsx(o.Box,{component:"span","data-testid":"data-table-count","aria-hidden":"true",dir:"auto",style:{flex:"0 0 auto",fontSize:"var(--mantine-font-size-sm)",color:g.CHROME},children:rn})]}),n.jsxs(o.VisuallyHidden,{role:"status","aria-live":"polite",dir:"auto","data-testid":"data-table-status",children:[rn,pt&&Y.length>0?` ${q.rowsSelected(le.format(Y.length))}`:""]}),n.jsxs(o.Box,{ref:M,"data-testid":"data-table-viewport",style:{height:f,overflow:"auto",position:"relative",border:`1px solid ${g.BORDER}`,borderRadius:"var(--mantine-radius-sm)",background:g.PANEL},children:[n.jsxs(o.Table,{ref:se,role:"grid","aria-label":c===void 0&&l===void 0?q.dataTable:l,"aria-labelledby":c,"aria-rowcount":ie+1,"aria-colcount":ue,"aria-multiselectable":b==="multiple"?!0:void 0,onKeyDown:zo,stickyHeader:!0,tabularNums:!0,withRowBorders:!1,horizontalSpacing:0,verticalSpacing:0,highlightOnHover:pt,highlightOnHoverColor:g.SURFACE,style:{display:"grid",width:"100%",minWidth:Po,fontSize:ks,lineHeight:Ms},children:[n.jsx(o.Table.Thead,{style:{display:"grid",position:"sticky",insetBlockStart:0,zIndex:1,background:g.PANEL,borderBlockEnd:`1px solid ${g.DIVIDER}`},children:n.jsx(o.Table.Tr,{role:"row","aria-rowindex":1,style:{display:"flex",width:"100%",height:h},children:te.map((d,E)=>{const _=we.get(d.id),V=d.getCanSort(),J=d.getIsSorted(),ye=ce.row===pe&&ce.column===E,ft=J===!1?-1:d.getSortIndex(),xt=ye?0:-1,rt=n.jsxs(n.Fragment,{children:[n.jsx(o.Box,{component:"span","data-testid":"data-table-header-label",dir:"auto",title:_==null?void 0:_.header,style:{flex:"0 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:J===!1?void 0:g.VALUE},children:(_==null?void 0:_.header)??d.id}),J!==!1&&n.jsx(o.Box,{component:"span","data-testid":"data-table-sort-glyph","data-direction":Rn(J),"aria-hidden":"true",style:{flex:"0 0 auto",display:"flex",alignItems:"center",color:g.VALUE,transform:J==="asc"?"rotate(180deg)":void 0},children:n.jsx(re,{name:"chevronDown",size:u.CHEVRON})}),Qe.length>1&&ft>=0&&n.jsx(o.Box,{component:"span","data-testid":"data-table-sort-priority","aria-hidden":"true",style:{flex:"0 0 auto",fontSize:"var(--mantine-font-size-xs)",color:g.CHROME},children:le.format(ft+1)})]});return n.jsx(o.Table.Th,{scope:"col","data-testid":"data-table-header","aria-colindex":E+1,"aria-sort":V?Rn(J):void 0,"data-grid-row":V?void 0:pe,"data-grid-column":V?void 0:E,tabIndex:V?void 0:xt,className:V?void 0:Tn,onFocus:V?void 0:()=>{De(Pe=>yt(Pe,{row:pe,column:E})?Pe:{row:pe,column:E})},style:{...sn(_,E),gap:u.GUTTER/2,height:h,fontSize:"var(--mantine-font-size-sm)",fontWeight:500,color:g.CHROME,textAlign:"start"},children:V?n.jsx(o.UnstyledButton,{type:"button","data-testid":"data-table-sort-button","data-grid-row":pe,"data-grid-column":E,tabIndex:xt,onClick:Pe=>{De({row:pe,column:E}),To(d,Pe)},onFocus:()=>{De(Pe=>yt(Pe,{row:pe,column:E})?Pe:{row:pe,column:E})},style:{display:"flex",alignItems:"center",gap:u.GUTTER/2,justifyContent:(_==null?void 0:_.align)==="end"?"flex-end":"flex-start",flex:"1 1 auto",minWidth:0,height:"100%",background:"transparent",color:"inherit",font:"inherit",textAlign:"start",outlineOffset:-2,cursor:"pointer"},children:rt}):rt},d.id)})})}),n.jsx(o.Table.Tbody,{style:{display:"grid",position:"relative",height:Te.getTotalSize()},children:Te.getVirtualItems().map(d=>{const E=ee[d.index];if(E===void 0)return null;const _=Y.includes(E.id);return n.jsx(o.Table.Tr,{role:"row","data-testid":"data-table-row","data-index":d.index,"data-selected":_?"true":void 0,"aria-rowindex":d.index+2,"aria-selected":pt?_:void 0,onDoubleClick:V=>{y==null||y(E.original,V)},onContextMenu:V=>{S==null||S(E.original,V)},style:{display:"flex",position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:p,transform:`translateY(${String(d.start)}px)`,background:_?Gs:void 0,cursor:pt?"pointer":void 0},children:te.map((V,J)=>{const ye=we.get(V.id),ft=ce.row===d.index&&ce.column===J,xt=ye==null?void 0:ye.value(E.original),rt=En(xt,oe),Pe=(ye==null?void 0:ye.cell)===void 0?n.jsx(o.Box,{component:"span",dir:"auto",style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:rt}):ye.cell(E.original);return n.jsx(o.Table.Td,{role:"gridcell","data-testid":"data-table-cell","aria-colindex":J+1,"data-grid-row":d.index,"data-grid-column":J,tabIndex:ft?0:-1,className:Tn,title:(ye==null?void 0:ye.cell)===void 0?rt:void 0,onFocus:()=>{De(Ae=>yt(Ae,{row:d.index,column:J})?Ae:{row:d.index,column:J})},onClick:Ae=>{De({row:d.index,column:J}),ut(d.index,{extend:Ae.shiftKey,toggle:Ae.metaKey||Ae.ctrlKey},Ae),on(d.index,Ae,it(Ae))},style:sn(ye,J),children:Pe},V.id)})},E.id)})})]}),ie===0&&n.jsx(o.Box,{"data-testid":"data-table-empty",style:{display:"flex",alignItems:"center",justifyContent:"center",padding:u.PAD_LEFT,fontSize:"var(--mantine-font-size-sm)",color:g.CHROME},children:Ao()})]})]})}const Us=r.forwardRef(Vs);function $s(){return crypto.randomUUID().slice(0,8)}function Et(e,t){return{id:$s(),offset:e,color:t}}function po(){return[Et(0,"#6366F1"),Et(1,"#06B6D4")]}const Ws=2,Ys=5,Xs=80,Ks=0,Ht=100,Nt=0,qs=360,Zs=[0,90,180,270,360];function Js({stops:e,defaultStops:t,direction:s,defaultDirection:i=Nt,showDirection:a=!0,onChange:l,onChangeStart:c,onChangeEnd:x,minStops:f=Ws,maxStops:p=Ys}){const h=ae(),m=qe({maximumFractionDigits:0}),b=r.useId(),v=r.useId(),T=r.useMemo(()=>po(),[]),[R,C]=X.useUncontrolled({value:e,defaultValue:t,finalValue:T,onChange:(A,O)=>{l==null||l(A,z,O)}}),[z,I]=X.useUncontrolled({value:s,defaultValue:i,finalValue:Nt,onChange:(A,O)=>{l==null||l(R,A,O)}}),w=r.useRef(!1),P=A=>{w.current||(w.current=!0,c==null||c(A))},j=(A,O)=>{w.current=!1,x==null||x(A,O)},L=(A,O)=>R.map((y,S)=>S===A?{...y,color:O}:y),D=(A,O)=>R.map((y,S)=>S===A?{...y,offset:O/Ht}:y),U=A=>{if(R.length>=p)return;const O=R[R.length-1],y=O===void 0?.5:(O.offset+1)/2,S=[...R,Et(y,St)];S.sort((H,k)=>H.offset-k.offset),C(S,A)},G=(A,O)=>{R.length<=f||C(R.filter((y,S)=>S!==A),O)},N=R.length>=p,$=R.length<=f;return n.jsxs(o.Stack,{"data-testid":"gradient-editor",gap:"xs",children:[n.jsxs(o.Group,{justify:"space-between",align:"center",children:[n.jsx(o.Text,{id:b,"data-testid":"gradient-editor-heading",size:"xs",c:g.CHROME,children:h.colorStops}),n.jsx(o.ActionIcon,{variant:"subtle",color:"gray",size:u.TRAIL,"data-testid":"gradient-editor-add-stop",onClick:U,disabled:N,"aria-label":h.addColorStop,children:n.jsx(re,{name:"plus",size:u.CHEVRON})})]}),n.jsx(o.Stack,{"data-testid":"gradient-editor-stops",gap:"xs",role:"group","aria-labelledby":b,children:R.map((A,O)=>{const y=m.format(O+1);return n.jsxs(o.Group,{"data-testid":"gradient-editor-stop",gap:"xs",align:"flex-end",wrap:"nowrap",children:[n.jsx(lo,{color:A.color,defaultColor:St,onColorChange:(S,H)=>{C(L(O,S??St),H)},showOpacity:!1}),n.jsx(o.Box,{style:{width:Xs},children:n.jsx(o.Slider,{"data-testid":"gradient-editor-stop-position",min:Ks,max:Ht,value:A.offset*Ht,onPointerDown:P,onChange:S=>{P(),C(D(O,S))},onChangeEnd:S=>{j(D(O,S),z)},label:S=>h.percent(m.format(S)),thumbLabel:h.colorStopPosition(y)})}),n.jsx(o.ActionIcon,{variant:"subtle",color:"gray",size:u.TRAIL,onClick:S=>{G(O,S)},"data-testid":"gradient-editor-remove-stop",disabled:$,"aria-label":h.removeColorStop(y),children:n.jsx(re,{name:"minus",size:u.CHEVRON})})]},A.id)})}),a&&n.jsxs(o.Box,{"data-testid":"gradient-editor-direction",pb:"md",role:"group","aria-labelledby":v,children:[n.jsx(o.Text,{id:v,"data-testid":"gradient-editor-direction-heading",size:"xs",c:g.CHROME,mb:4,children:h.direction}),n.jsx(o.Slider,{"data-testid":"gradient-editor-direction-slider",min:Nt,max:qs,value:z,onPointerDown:P,onChange:A=>{P(),I(A)},onChangeEnd:A=>{j(R,A)},label:A=>h.degrees(m.format(A)),thumbLabel:h.gradientDirection,marks:Zs.map(A=>({value:A,label:h.degrees(m.format(A))}))})]})]})}const Qs=4,er=2,tr=1.1;function nr(){const e=Fe();return r.useMemo(()=>{var s;return((s=new Intl.NumberFormat(e).formatToParts(tr).find(i=>i.type==="decimal"))==null?void 0:s.value)??"."},[e])}function or({label:e,value:t,defaultValue:s,onChange:i,min:a,max:l,step:c,decimalScale:x,suffix:f,hideControls:p=!0,disabled:h=!1,disabledReason:m,onFocus:b,onBlur:v}){const T=ae(),R=st({name:e,disabled:h,disabledReason:m}),C=Wt(),z=nr(),[I,w]=X.useUncontrolled({value:t,defaultValue:void 0,finalValue:void 0,onChange:i}),P=I===void 0,j=I??s,[L,D]=r.useState(j),U=r.useRef(!1);r.useEffect(()=>{U.current||D(I??s),U.current=!1},[I,s]);const G=A=>{U.current=!0,D(A)},N=A=>{const O=typeof L=="string"?C(L):L;if(Number.isNaN(O)){D(I??s),v==null||v(A);return}let y=O;a!==void 0&&y<a&&(y=a),l!==void 0&&y>l&&(y=l),y!==I&&w(y,A),D(y),v==null||v(A)},$=A=>{w(void 0,A)};return n.jsxs(o.Group,{"data-testid":"style-number-input",gap:Qs,wrap:"nowrap",align:"flex-end",title:R.title,"data-disabled":h?"true":void 0,children:[n.jsx(o.NumberInput,{"data-testid":"style-number-input-field",label:e,description:R.description,value:L,onChange:G,onFocus:b,onBlur:N,min:a,max:l,step:c,decimalScale:x,decimalSeparator:z,suffix:f,hideControls:p,disabled:h,"data-is-default":P?"true":"false",styles:{input:P?{fontStyle:"italic",color:g.CHROME}:void 0,description:It},style:{flex:1}}),!P&&n.jsx(o.ActionIcon,{variant:"subtle",size:u.TRAIL,c:g.CHROME,"data-testid":"style-number-input-reset",disabled:h,"aria-label":T.resetToDefault(e),onClick:$,style:{marginBlockEnd:er},children:n.jsx(re,{name:"reset",size:u.CHEVRON})})]})}const ir=4,sr=2;function rr({label:e,value:t,defaultValue:s,options:i,onChange:a,disabled:l=!1,disabledReason:c,onFocus:x,onBlur:f}){const p=ae(),h=st({name:e,disabled:l,disabledReason:c}),[m,b]=X.useUncontrolled({value:t,defaultValue:void 0,finalValue:void 0,onChange:a}),v=m===void 0,T=m??s,R=z=>{z!==null&&b(z)},C=z=>{b(void 0,z)};return n.jsxs(o.Group,{"data-testid":"style-select",gap:ir,wrap:"nowrap",align:"flex-end",title:h.title,"data-disabled":l?"true":void 0,children:[n.jsx(o.Select,{"data-testid":"style-select-field",label:e,description:h.description,value:T,onChange:R,onFocus:x,onBlur:f,data:i,rightSection:n.jsx(re,{name:"chevronDown",size:u.GLYPH}),rightSectionPointerEvents:"none",disabled:l,"data-is-default":v?"true":"false",allowDeselect:!1,styles:{input:v?{fontStyle:"italic",color:g.CHROME}:void 0,description:It},style:{flex:1}}),!v&&n.jsx(o.ActionIcon,{variant:"subtle",size:u.TRAIL,c:g.CHROME,"data-testid":"style-select-reset",disabled:l,"aria-label":p.resetToDefault(e),onClick:C,style:{marginBlockEnd:sr},children:n.jsx(re,{name:"reset",size:u.CHEVRON})})]})}const vt=4,ar=`${String(u.TOGGLE_PITCH)}px`;function lr({label:e,checked:t,defaultChecked:s,onChange:i,disabled:a=!1,disabledReason:l,bound:c=!1,boundDescription:x,onFocus:f,onBlur:p,children:h}){const m=r.useId(),b=ae(),[v,T]=X.useUncontrolled({value:t,defaultValue:s,finalValue:!1,onChange:i}),R=P=>{T(P.currentTarget.checked,P)},C={root:{minWidth:0},body:{alignItems:"center",minWidth:0},labelWrapper:{minWidth:0},label:{display:"block",height:u.TOGGLE_PITCH,paddingInlineStart:vt,fontSize:"var(--mantine-font-size-sm)",lineHeight:ar,color:a?g.DISABLED:g.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},z=x??b.fieldBound,I=st({name:e,enabledTitle:e,disabled:a,disabledReason:l,extraDescriptions:c?[z]:void 0}),w=n.jsx(o.Checkbox,{"data-testid":"toggle-with-content-checkbox",label:e,checked:v,disabled:a,"aria-expanded":v,"aria-controls":v?m:void 0,"aria-describedby":I.describedBy,onChange:R,onFocus:f,onBlur:p,wrapperProps:{title:I.title},styles:C});return n.jsxs(o.Box,{"data-testid":"toggle-with-content","data-checked":v?"true":"false","data-disabled":a?"true":void 0,"data-bound":c?"true":void 0,style:{display:"flex",flexDirection:"column",gap:vt},children:[c?n.jsxs(o.Box,{"data-testid":"toggle-with-content-row",style:{display:"flex",alignItems:"center",gap:vt},children:[w,n.jsx(o.Box,{component:"span","data-testid":"toggle-with-content-bound",style:{flex:"0 0 auto",display:"inline-flex",alignItems:"center",color:g.CHROME},children:n.jsx(Ke,{name:"attribute",filled:!0})})]}):w,I.description!==void 0&&n.jsx(o.VisuallyHidden,{id:I.describedBy,children:I.description}),v&&n.jsx(o.Box,{id:m,"data-testid":"toggle-with-content-children",style:{display:"flex",flexDirection:"column",gap:vt,paddingInlineStart:u.GUTTER},children:h})]})}function fo(e,t){return e!==void 0?e:t===void 0?"off":"polite"}function Be(e,t){const s=fo(e,t);return s==="off"?{"aria-busy":t}:{"aria-live":s,"aria-atomic":!0,"aria-busy":t}}const Dt=4,cr="(hover: none)";function dr(e){if(typeof e=="string")return e;if(typeof e=="number")return String(e)}function ur(e){const{state:t,stateTitle:s,busy:i,live:a,actions:l,residentActions:c,actionsVisible:x,disabled:f=!1,onClick:p,onFocus:h,onBlur:m}=e,b=Be(a,i),{hovered:v,ref:T}=X.useHover(),R=X.useMediaQuery(cr)??!1,[C,z]=r.useState(!1),I=r.useId(),w=C||(x??(v||R)),P=l!==void 0||c!==void 0,j=dr(t),L=s!==void 0&&s!==j,D=s??j,U=P&&t!==void 0,G=L?n.jsxs(n.Fragment,{children:[n.jsx("span",{"aria-hidden":"true",children:t}),n.jsx(o.VisuallyHidden,{"data-testid":"action-row-state-full",children:s})]}):t;Le(p!==void 0&&t===void 0?"ActionRow was given onClick but no state, and its own activation is carried by the text it reports. That text is also what names the row for a screen reader, so a row with nothing to report has nothing to activate. Give the row a state, or put the action on a control in actions.":void 0);const N=S=>{z(!0),h==null||h(S)},$=S=>{S.currentTarget.contains(S.relatedTarget)||z(!1),m==null||m(S)},A=S=>{f||p==null||p(S,it(S))},O={flex:"1 1 auto",minWidth:0,fontSize:"var(--mantine-font-size-sm)",lineHeight:1.2,color:f?g.DISABLED:g.CHROME,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},y={...O,alignSelf:"stretch",lineHeight:`${u.ROW_PITCH}px`,textAlign:"start",borderRadius:"var(--mantine-radius-sm)"};return n.jsxs(o.Box,{ref:T,"data-testid":"action-row",role:U?"group":void 0,"aria-labelledby":U?I:void 0,"aria-disabled":f||void 0,"data-disabled":f||void 0,onFocus:N,onBlur:$,style:{display:"flex",alignItems:"center",justifyContent:"space-between",boxSizing:"border-box",gap:u.TRAIL_GAP,height:u.ROW_PITCH},children:[t!==void 0&&(p===void 0?n.jsx(o.Box,{component:"span",id:I,"data-testid":"action-row-state",title:D,...b,style:O,children:G}):n.jsx(o.UnstyledButton,{type:"button",id:I,"data-testid":"action-row-state",title:D,...b,onClick:A,style:y,children:G})),P&&n.jsxs(o.Box,{"data-testid":"action-row-affordances",style:{flex:"0 0 auto",marginInlineStart:"auto",display:"flex",alignItems:"center",gap:Dt},children:[l!==void 0&&n.jsx(o.Box,{"data-testid":"action-row-actions","data-visible":w?"true":"false",style:{flex:"0 0 auto",display:"flex",alignItems:"center",gap:Dt,opacity:w?1:0,pointerEvents:w?void 0:"none"},children:l}),c!==void 0&&n.jsx(o.Box,{"data-testid":"action-row-resident-actions",style:{flex:"0 0 auto",display:"flex",alignItems:"center",gap:Dt},children:c})]})]})}const xo=u.GUTTER,pr=12,ho=1.2,fr=20,xr=500,hr="var(--mantine-primary-color-light)";function gr({name:e,value:t,icon:s,selected:i=!1,role:a="button",tabIndex:l,onClick:c,onDoubleClick:x,onContextMenu:f,onFocus:p,onBlur:h,trailing:m}){const{hovered:b,ref:v}=X.useHover(),T=c!==void 0,R=s!=null,C=t!=null,z=lt(m),I=a==="option",w=I?i:void 0,P=!I&&i?!0:void 0,j=G=>{c==null||c(G,it(G))};let L="transparent";i?L=hr:T&&b&&(L=g.SURFACE);const D=n.jsxs(n.Fragment,{children:[R&&n.jsx(o.Box,{component:"span","data-testid":"data-row-icon",style:{flex:"0 0 auto",width:u.GLYPH_SLOT,height:u.GLYPH_SLOT,display:"flex",alignItems:"center",justifyContent:"center",color:g.CHROME},children:s}),n.jsx(o.Box,{component:"span","data-testid":"data-row-name",title:e,style:{flex:"1 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),C&&n.jsx(o.Box,{component:"span","data-testid":"data-row-value",style:{flex:"0 0 auto",fontSize:"var(--mantine-font-size-sm)",color:g.CHROME},children:t})]}),U={display:"flex",alignItems:"center",gap:u.GUTTER,flex:"1 1 auto",minWidth:0,height:"100%",background:"transparent",color:"inherit",font:"inherit",textAlign:"start",cursor:T?"pointer":"default"};return n.jsxs(o.Box,{ref:v,"data-testid":"data-row","data-selected":i?"true":void 0,onDoubleClick:x,onContextMenu:f,style:{display:"flex",alignItems:"center",gap:u.TRAIL_GAP,boxSizing:"border-box",width:"100%",height:u.DATA_PITCH,paddingInline:xo,borderRadius:"var(--mantine-radius-sm)",background:L,color:g.VALUE,fontSize:pr,lineHeight:ho},children:[T?n.jsx(o.UnstyledButton,{type:"button","data-testid":"data-row-button",role:I?"option":void 0,"aria-current":P,"aria-selected":w,tabIndex:l,onClick:j,onFocus:p,onBlur:h,style:U,children:D}):n.jsx(o.Box,{"data-testid":"data-row-body",role:I?"option":void 0,"aria-current":P,"aria-selected":w,tabIndex:l,onFocus:p,onBlur:h,style:U,children:D}),z&&n.jsx(Ee,{children:m})]})}function mr({label:e,unit:t,sortDirection:s,defaultSortDirection:i,onSortChange:a,sortPriority:l}){const[c,x]=X.useUncontrolled({value:s,defaultValue:i,finalValue:"none",onChange:a}),f=qe(),p=a!==void 0,h=c!=="none",m=T=>{x(c==="ascending"?"descending":"ascending",T)},b=n.jsxs(n.Fragment,{children:[n.jsx(o.Box,{component:"span","data-testid":"data-row-header-label",title:e,style:{flex:"1 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:h?g.VALUE:void 0},children:e}),t!==void 0&&n.jsx(o.Box,{component:"span","data-testid":"data-row-header-unit",style:{flex:"0 0 auto",whiteSpace:"nowrap"},children:t}),l!==void 0&&h&&n.jsx(o.Box,{component:"span","aria-hidden":"true",style:{flex:"0 0 auto",display:"flex"},children:n.jsx(tn,{children:f.format(l)})}),h&&n.jsx(o.Box,{component:"span","data-testid":"data-row-header-sort-glyph","data-direction":c,style:{flex:"0 0 auto",display:"flex",alignItems:"center",color:g.VALUE,transform:c==="ascending"?"rotate(180deg)":void 0},children:n.jsx(re,{name:"chevronDown",size:u.CHEVRON})})]}),v=p||h;return n.jsx(o.Box,{"data-testid":"data-row-header",role:v?"columnheader":void 0,"aria-sort":v?c:void 0,style:{display:"flex",alignItems:"center",gap:u.GUTTER,boxSizing:"border-box",width:"100%",height:fr,paddingInline:xo,fontSize:"var(--mantine-font-size-sm)",lineHeight:ho,color:g.CHROME},children:p?n.jsx(o.UnstyledButton,{type:"button","data-testid":"data-row-header-sort",onClick:m,style:{display:"flex",alignItems:"center",gap:u.GUTTER,flex:"1 1 auto",minWidth:0,height:"100%",background:"transparent",color:"inherit",font:"inherit",textAlign:"start",cursor:"pointer"},children:b}):b})}function tn({children:e}){return n.jsx(o.Badge,{component:"span","data-testid":"rank-chip",style:{flex:"0 0 auto",background:g.RAISED,color:g.VALUE,fontWeight:xr,textTransform:"none",letterSpacing:"normal"},children:e})}const zn=2,br=1,yr=13,vr=2,wr=1,Sr=1,Ir=64,go=4,Pn=go/2,mo=4,Er=12,Xe=100,Cr=1.5,Ut=100;function Ct({children:e,end:t,id:s}){return n.jsx(o.Box,{component:"span",id:s,"data-testid":`chart-axis-${t}`,style:{flex:"0 0 auto",minWidth:0,fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:g.CHROME,whiteSpace:"nowrap"},children:e})}function bo(){return n.jsx(o.Box,{"data-testid":"chart-baseline",style:{flex:"0 0 auto",height:br,background:g.BORDER}})}function yo({caption:e,rows:t,testId:s}){return n.jsxs(o.VisuallyHidden,{component:"table","data-testid":s,children:[e!==void 0&&n.jsx("caption",{children:e}),n.jsx("tbody",{children:t.map(i=>n.jsxs("tr",{children:[n.jsx("th",{scope:"row",children:i.header}),n.jsx("td",{children:i.value})]},i.id))})]})}function Tr(e,t){if(e.length===0)return null;const s=Xe/2;if(e.length===1)return`0,${s} ${Xe},${s}`;const i=Math.min(...e),l=Math.max(...e)-i,c=e.length-1;return e.map((x,f)=>{const p=Zi(f/c,Xe,t),h=l===0?s:Xe-(x-i)/l*Xe;return`${p},${h}`}).join(" ")}function vo(){const e=r.useId(),t=`${e}min`,s=`${e}max`;return{min:t,max:s,describedBy:`${t} ${s}`}}function Rr({bins:e,label:t,minLabel:s,maxLabel:i,busy:a,live:l,trailing:c}){const x=qe(),f=vo(),p=e.reduce((m,b)=>Math.max(m,b.count,0),0),h=e.map((m,b)=>({id:`${m.label}-${String(b)}`,header:m.label,value:x.format(m.count)}));return n.jsxs(o.Box,{"data-testid":"histogram-row","aria-busy":a,style:{display:"flex",alignItems:"flex-start",gap:u.TRAIL_GAP,height:u.HISTOGRAM_HEIGHT},children:[n.jsxs(o.Box,{"data-testid":"histogram-chart",...Be(l,a),style:{flex:"1 1 auto",minWidth:0,height:"100%",display:"flex",flexDirection:"column",gap:zn},children:[n.jsxs(o.Box,{"data-testid":"histogram-drawing",role:t===void 0?void 0:"img","aria-label":t,"aria-describedby":t===void 0?void 0:f.describedBy,"aria-hidden":t===void 0?!0:void 0,style:{flex:"1 1 auto",minHeight:0,display:"flex",flexDirection:"column",gap:zn},children:[n.jsx(o.Box,{"data-testid":"histogram-plot",style:{flex:"1 1 auto",minHeight:0,display:"flex",alignItems:"flex-end",gap:vr},children:e.map((m,b)=>{const v=Math.max(0,m.count),T=p===0?0:v/p*Ut,R=m.highlighted===!0;return n.jsx(o.Box,{"data-testid":"histogram-bar","data-highlighted":R?"true":"false","aria-hidden":"true",title:m.label,style:{flex:"1 1 0",minWidth:0,height:`${String(T)}%`,minHeight:v>0?Sr:0,background:R?g.ACCENT:g.BORDER,borderRadius:wr}},`${m.label}-${String(b)}`)})}),n.jsx(bo,{})]}),n.jsxs(o.Box,{"data-testid":"chart-axis",style:{flex:"0 0 auto",height:yr,display:"flex",alignItems:"center",justifyContent:"space-between",gap:mo},children:[n.jsx(Ct,{end:"min",id:f.min,children:s}),n.jsx(Ct,{end:"max",id:f.max,children:i})]})]}),n.jsx(yo,{caption:t,rows:h,testId:"histogram-values"}),lt(c)&&n.jsx(Ee,{children:c})]})}function zr({values:e,label:t,minLabel:s,maxLabel:i,busy:a,live:l,trailing:c}){const x=_e(),f=qe(),p=vo(),h=Tr(e,x),m=e.map((b,v)=>({id:`point-${String(v)}`,header:f.format(v+1),value:f.format(b)}));return n.jsxs(o.Box,{"data-testid":"sparkline-row","aria-busy":a,style:{display:"flex",alignItems:"center",gap:u.TRAIL_GAP,height:u.SPARKLINE_HEIGHT},children:[n.jsxs(o.Box,{"data-testid":"sparkline-chart",...Be(l,a),style:{flex:"1 1 auto",minWidth:0,display:"flex",alignItems:"center",gap:mo},children:[n.jsx(Ct,{end:"min",id:p.min,children:s}),n.jsxs(o.Box,{"data-testid":"sparkline-drawing",role:t===void 0?void 0:"img","aria-label":t,"aria-describedby":t===void 0?void 0:p.describedBy,"aria-hidden":t===void 0?!0:void 0,style:{flex:"1 1 auto",minWidth:0,display:"flex",flexDirection:"column",color:g.BORDER},children:[n.jsx(o.Box,{component:"svg","data-testid":"sparkline-plot",width:"100%",height:u.CONTROL_HEIGHT,viewBox:`0 0 ${String(Xe)} ${String(Xe)}`,preserveAspectRatio:"none",fill:"none",stroke:"currentColor",strokeWidth:Cr,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",style:{display:"block",overflow:"visible"},children:h!==null&&n.jsx("polyline",{points:h,vectorEffect:"non-scaling-stroke"})}),n.jsx(bo,{})]}),n.jsx(Ct,{end:"max",id:p.max,children:i})]}),n.jsx(yo,{caption:t,rows:m,testId:"sparkline-values"}),lt(c)&&n.jsx(Ee,{children:c})]})}function Pr({name:e,percentile:t,value:s,rank:i,busy:a,live:l,onClick:c,onDoubleClick:x,onContextMenu:f,onFocus:p,onBlur:h}){const m=ae(),b=Qn(),v=r.useId(),T=c,R=T!==void 0,C=Math.min(Ut,Math.max(0,t)),z=m.percentile(b(Math.round(C))),I=P=>{T!==void 0&&T(P,it(P))},w=P=>{T!==void 0&&(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),T(P,it(P)))};return n.jsxs(o.Box,{"data-testid":"metric-row",role:R?"button":void 0,tabIndex:R?0:void 0,...Be(l,a),onClick:I,onKeyDown:w,onDoubleClick:x,onContextMenu:f,onFocus:p,onBlur:h,style:{display:"flex",alignItems:"center",gap:u.GUTTER,height:u.ROW_PITCH,cursor:R?"pointer":"default"},children:[n.jsx(o.Box,{component:"span",id:v,"data-testid":"metric-row-name",title:e,style:{flex:"1 1 auto",minWidth:0,fontSize:Er,lineHeight:1.2,color:g.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),n.jsx(o.Progress.Root,{"data-testid":"metric-row-bar",role:"progressbar","aria-labelledby":v,"aria-valuemin":0,"aria-valuemax":Ut,"aria-valuenow":C,"aria-valuetext":z,title:z,size:go,style:{flex:`0 0 ${String(Ir)}px`,borderRadius:Pn,background:g.SURFACE},children:n.jsx(o.Progress.Section,{"data-testid":"metric-row-fill",value:C,withAria:!1,color:g.ACCENT,style:{borderRadius:Pn}})}),n.jsx(o.Box,{component:"span","data-testid":"metric-row-value",style:{flex:"0 0 auto",fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:g.VALUE},children:s}),i!==void 0&&n.jsx(tn,{children:i})]})}const wo=r.createContext(!1);function So({showLabels:e=!1,children:t}){return n.jsx(wo.Provider,{value:e,children:t})}function ct(){return r.useContext(wo)}const Ar=u.VALUE_INSET-u.GLYPH_SLOT,jr=2,Lr=1,_r=2,Or=3;function Hr(e){if(e.fullValue!==void 0)return e.fullValue;if(typeof e.value=="string")return e.value;if(typeof e.value=="number")return String(e.value)}function Nr({segment:e,grow:t,index:s}){const{glyph:i,value:a,unit:l,mono:c=!1}=e;let x=null;Yt(i)?x=n.jsx(Ke,{name:i}):Xt(i)?x=n.jsx(o.Box,{component:"span","data-letter":i,style:{fontSize:"var(--mantine-font-size-sm)",lineHeight:1},children:i}):i!=null&&(x=i);const f=Hr(e),p=e.fullValue!==void 0;return n.jsxs(o.Box,{"data-testid":"compound-segment","data-segment-index":s,"data-grow":t?"true":"false",style:{display:"flex",alignItems:"center",boxSizing:"border-box",flex:t?"1 1 auto":"0 0 auto",minWidth:0,height:u.CONTROL_HEIGHT,paddingBlock:0,paddingInline:Ar},children:[x!==null&&n.jsx(o.Box,{"data-testid":"compound-segment-slot",style:{flex:"0 0 auto",width:u.GLYPH_SLOT,height:u.GLYPH_SLOT,display:"flex",alignItems:"center",justifyContent:"center",color:g.CHROME},children:x}),n.jsx(o.Box,{component:"span","data-testid":"compound-segment-value","data-mono":c?"true":"false",title:f,"aria-hidden":p?!0:void 0,style:{flex:t?"1 1 auto":"0 0 auto",minWidth:0,fontFamily:c?"var(--mantine-font-family-monospace)":void 0,fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:g.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",unicodeBidi:"isolate"},children:a}),p&&n.jsx(o.VisuallyHidden,{children:e.fullValue}),l!==void 0&&n.jsx(o.Box,{component:"span","data-testid":"compound-segment-unit",style:{flex:"0 0 auto",marginInlineStart:jr,fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:g.CHROME},children:l})]})}function Dr(e,t){if(!(t>=_r&&t<=Or))return`CompoundRow "${e}" was given ${String(t)} ${t===1?"segment":"segments"}, and it holds two or three. A compound row shows one value together with the parts that belong to it: use PanelField for a single value, and a table or a list of rows for more than three.`}function kr(e,t){if(t!==1)return`CompoundRow "${e}" was given ${String(t)} segments that set grow, and exactly one should. The segment that sets grow takes the box's leftover width and should be the main value, with the rest sized to their content. Using the first segment that sets it, or the leading segment when none does.`}function Mr({label:e,segments:t,width:s=u.BODY,trailing:i,busy:a,live:l,onClick:c,onFocus:x,onBlur:f}){const p=ct(),h=r.useId(),m=t.filter(L=>L.grow===!0).length;Le(Dr(e,t.length)),Le(kr(e,m));const b=t.findIndex(L=>L.grow===!0),v=b===-1?0:b,T=c!==void 0,R=fo(l,a)!=="off",C=T||R,z=T?void 0:h,I=C?void 0:h,w=C||p,P={display:"flex",alignItems:"center",boxSizing:"border-box",flex:p?"1 1 auto":"0 0 auto",width:p?void 0:s,minWidth:0,height:u.CONTROL_HEIGHT,background:g.SURFACE,borderRadius:"var(--mantine-radius-sm)",overflow:"hidden",textAlign:"start",cursor:T?"pointer":void 0},j=n.jsxs(n.Fragment,{children:[C&&n.jsx(o.VisuallyHidden,{id:z,children:e}),t.map((L,D)=>n.jsxs(r.Fragment,{children:[D>0&&n.jsx(o.Box,{"data-testid":"compound-row-hairline",style:{flex:"0 0 auto",width:Lr,height:u.CONTROL_HEIGHT,background:g.PANEL}}),n.jsx(Nr,{segment:L,grow:D===v,index:D})]},D))]});return n.jsxs(o.Box,{"data-testid":"compound-row",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:u.TRAIL_GAP,height:u.ROW_PITCH},children:[p&&n.jsx(o.Box,{component:"span",id:I,"data-testid":"compound-row-label",title:e,"aria-hidden":C?!0:void 0,style:{flex:`0 0 ${u.LABEL_COLUMN}px`,fontSize:"var(--mantine-font-size-sm)",lineHeight:1.2,color:g.CHROME,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),T?n.jsx(o.UnstyledButton,{type:"button",title:e,"data-testid":"compound-row-box","data-interactive":"true",...Be(l,a),onClick:c,onFocus:x,onBlur:f,style:P,children:j}):n.jsx(o.Box,{role:"group","aria-label":w?void 0:e,"aria-labelledby":w?h:void 0,title:e,"data-testid":"compound-row-box","data-interactive":"false",...Be(l,a),onFocus:x,onBlur:f,style:P,children:j}),n.jsx(Ee,{children:i})]})}const kt=u.VALUE_INSET-u.GLYPH_SLOT,wt=4,An=4,Gr=u.VALUE_INSET+u.LABEL_COLUMN,jn={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0},Io=r.forwardRef(function(t,s){const{label:i,glyph:a,kind:l,value:c,defaultValue:x,onChange:f,data:p,unit:h,width:m=u.FIELD,bound:b=!1,mixed:v=!1,placeholder:T,pending:R=!1,min:C,max:z,step:I,onScrubStart:w,onScrub:P,onScrubEnd:j,onClick:L,disabled:D=!1,readOnly:U,boundDescription:G,pendingDescription:N,title:$,style:A,className:O,onKeyDown:y,...S}=t,H=ct(),k=ae(),K=_e(),q=X.useMediaQuery("(pointer: coarse)"),[ge,Q]=X.useUncontrolled({value:c===null?"":c,defaultValue:x,finalValue:"",onChange:f}),le=l??(p!==void 0?"select":"text"),ne=le==="select",W=le==="select"&&p!==void 0,oe=U??(f===void 0&&x===void 0),Y=String(ge),me=T===!0,be=v||me;let Z;v?Z=k.mixed:me?Z=Y:typeof T=="string"&&(Z=T);const fe=[];v&&fe.push(k.mixed);const Ve=G??k.fieldBound,Oe=N??k.fieldPending;b&&Ve!==""&&fe.push(Ve),R&&Oe!==""&&fe.push(Oe);const Ze=fe.length>0?fe.join(". "):void 0,de=(w!==void 0||P!==void 0||j!==void 0)&&!D&&!q,we=r.useRef(!1),Ce=r.useRef(!1),Re=r.useRef(0),He=M=>{if(!de||M.button!==0)return;M.preventDefault(),M.stopPropagation();const se=M.currentTarget;typeof se.setPointerCapture=="function"&&se.setPointerCapture(M.pointerId),we.current=!0,Ce.current=!1,Re.current=M.clientX},Ne=M=>{if(!we.current)return;const se=M.clientX-Re.current;se!==0&&(Re.current=M.clientX,Ce.current||(Ce.current=!0,w==null||w(M)),P==null||P(he(K)?-se:se,M))},$e=M=>{we.current&&(we.current=!1,Ce.current&&(Ce.current=!1,j==null||j(M)))},Je=M=>{D||L==null||L(M)},Qe=M=>{y==null||y(M),!(L===void 0||D||M.defaultPrevented)&&(W||(M.key==="Enter"||M.key===" "&&oe)&&(M.preventDefault(),L(M)))},We=(M,se)=>{Q(M,se)};let ze=null;Yt(a)?ze=n.jsx(Ke,{name:a,filled:b}):Xt(a)?ze=n.jsx(o.Box,{component:"span","data-letter":a,style:{fontSize:"var(--mantine-font-size-sm)",lineHeight:1},children:a}):a!=null&&(ze=a);const Ye=n.jsxs(n.Fragment,{children:[n.jsxs(o.Box,{"data-testid":"panel-field-slot","data-scrub":de?"true":void 0,onPointerDown:de?He:void 0,onPointerMove:de?Ne:void 0,onPointerUp:de?$e:void 0,onPointerCancel:de?$e:void 0,onLostPointerCapture:de?$e:void 0,style:{position:"relative",flex:"0 0 auto",width:u.GLYPH_SLOT,height:u.GLYPH_SLOT,display:"flex",alignItems:"center",justifyContent:"center",color:g.CHROME,cursor:de?"ew-resize":void 0,touchAction:de?"none":void 0},children:[ze,R&&n.jsx(o.Box,{"data-testid":"panel-field-pending",style:{position:"absolute",insetInlineStart:0,bottom:0,width:An,height:An,background:g.ACCENT}})]}),H&&n.jsx(o.Box,{component:"span","data-testid":"panel-field-label","aria-hidden":"true",style:{flex:"1 1 auto",minWidth:0,marginInlineStart:wt,fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:g.CHROME,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i})]}),Se=h!==void 0,B=Se||ne?n.jsxs(n.Fragment,{children:[Se&&n.jsx(o.Box,{component:"span","data-testid":"panel-field-unit",style:{flex:"0 0 auto",lineHeight:1},children:h}),ne&&n.jsx(o.Box,{component:"span","data-testid":"panel-field-chevron",style:{flex:"0 0 auto",display:"flex",alignItems:"center",marginInlineStart:Se?wt:0},children:n.jsx(re,{name:"chevronDown",size:u.GLYPH})})]}):void 0;let ee=kt+wt;ne&&(ee+=u.GLYPH),ne&&Se&&(ee+=wt);const te=B===void 0?void 0:`calc(${String((h==null?void 0:h.length)??0)}ch + ${String(ee)}px)`,ie=de?"auto":"none",Ie={"data-testid":"panel-field-value",...S,ref:s,className:O,label:i,description:Ze,placeholder:Z,disabled:D,readOnly:oe,onClick:Je,onKeyDown:Qe,leftSection:Ye,leftSectionWidth:H?Gr:u.VALUE_INSET,leftSectionPointerEvents:ie,leftSectionProps:{style:{insetInlineStart:0,justifyContent:"flex-start",paddingInlineStart:kt}},rightSection:B,rightSectionWidth:te,rightSectionPointerEvents:"none",rightSectionProps:{style:{insetInlineEnd:0,justifyContent:"flex-end",paddingInlineEnd:kt,fontSize:"var(--mantine-font-size-sm)",color:g.CHROME}},styles:{wrapper:{marginTop:0,marginBottom:0,"--input-placeholder-color":v?g.VALUE:g.PLACEHOLDER},input:{backgroundColor:g.SURFACE,paddingInlineStart:void 0,paddingInlineEnd:void 0},label:jn,description:jn},wrapperProps:{title:$??i,"data-testid":"panel-field","data-kind":le,"data-bound":b?"true":void 0,"data-mixed":v?"true":void 0,"data-pending":R?"true":void 0,"data-disabled":D?"true":void 0},style:{flex:m==="fill"?"1 1 auto":"0 0 auto",width:m==="fill"?"100%":m,minWidth:0,...A}};return le==="number"?n.jsx(o.NumberInput,{...Ie,value:be?"":ge,onChange:We,min:C,max:z,step:I,hideControls:!0}):W?n.jsx(o.Select,{...Ie,data:p,value:be||Y===""?null:Y,onChange:M=>{We(M??"")}}):n.jsx(o.TextInput,{...Ie,value:be?"":Y,onChange:M=>{We(M.currentTarget.value,M)}})}),Br=2,Fr=u.BODY+u.TRAIL_GAP;function Vr(e){return r.Children.toArray(e).flatMap(t=>r.isValidElement(t)&&t.type===r.Fragment?r.Children.toArray(t.props.children):[t])}function Ln(e,t){return r.isValidElement(e)&&e.key!==null?e.key:`field-row-${String(t)}`}function Ur(e){if(r.isValidElement(e)&&typeof e.props.label=="string")return e.props.label}function _n(e){return r.isValidElement(e)&&e.type===Io?r.cloneElement(e,{width:"fill"}):e}const $r=r.forwardRef(function({children:t,trailing:s,groupLabel:i,role:a,style:l,"aria-label":c,"aria-labelledby":x,...f},p){const h=ct(),m=Vr(t),b=m.length;Le(b===0||b>Br?`FieldRow was given ${String(b)} ${b===1?"field":"fields"}, and it holds one field, or two side by side. A row with none is an empty 32px gap, and a third field has nowhere to go in the 280px panel the row is measured for. Put the extra fields on rows of their own.`:void 0);const v=i??c,R=a??(v!==void 0||x!==void 0?"group":void 0),C=lt(s);if(h&&b>1)return n.jsx(o.Box,{ref:p,"data-testid":"field-row-labelled","data-fields":b,role:R,"aria-label":v,"aria-labelledby":x,...f,style:{display:"flex",flexDirection:"column",...l},children:m.map((j,L)=>{const D=Ur(j);return n.jsxs(o.Box,{"data-testid":"field-row","data-labelled":"true",style:{display:"flex",alignItems:"center",height:u.ROW_PITCH},children:[n.jsx(o.Box,{component:"span","data-testid":"field-row-label",title:D,style:{flex:`0 0 ${String(u.LABEL_COLUMN)}px`,minWidth:0,fontSize:"var(--mantine-font-size-sm)",lineHeight:1.2,color:g.CHROME,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:D}),n.jsx(o.Box,{"data-testid":"field-row-slot","data-width":"fill",style:{display:"flex",alignItems:"center",flex:"1 1 auto",minWidth:0,marginInlineStart:u.GUTTER,marginInlineEnd:u.TRAIL_GAP},children:n.jsx(So,{showLabels:!1,children:_n(j)})}),n.jsx(Ee,{children:L===0?s:null})]},Ln(j,L))})});const z=b<=1,I=z&&!C;let w=u.FIELD;z&&(w=I?Fr:u.BODY);const P=I?void 0:u.TRAIL_GAP;return n.jsxs(o.Box,{ref:p,"data-testid":"field-row","data-fields":b,role:R,"aria-label":v,"aria-labelledby":x,...f,style:{display:"flex",alignItems:"center",height:u.ROW_PITCH,...l},children:[m.map((j,L)=>n.jsx(o.Box,{"data-testid":"field-row-slot","data-width":w,style:{display:"flex",alignItems:"center",flex:`0 0 ${String(w)}px`,minWidth:0,marginInlineStart:L===0?void 0:u.GUTTER,marginInlineEnd:L===b-1?P:void 0},children:_n(j)},Ln(j,L))),n.jsx(Ee,{children:s})]})}),Wr=2,Yr=6,Eo=1,Xr=u.CONTROL_HEIGHT-Eo*2,Kr=2,On=3,qr=4,Zr=6,Jr=u.GLYPH,Qr=3;function ea(e,t){return t?g.DISABLED:e?g.ON_SELECTED:g.CHROME}function ta(e){const{options:t,value:s,defaultValue:i,onChange:a,label:l,labelledBy:c,name:x,disabled:f=!1,disabledReason:p,hybrid:h=!1,width:m,trailing:b,onFocus:v,onBlur:T}=e,R=ct(),C=t.length,z=st({name:l,disabled:f,disabledReason:p}),[I]=t,[w,P]=X.useUncontrolled({value:s,defaultValue:i,finalValue:I===void 0?"":I.value,onChange:a}),j=r.useRef(void 0);Le(C<Wr||C>Yr?`IconGroupRow was given ${String(C)} ${C===1?"option":"options"}, and it holds two to six drawable ones. One option is a statement rather than a choice and belongs in a field, and more than six stop reading as a set of drawings -- use a select instead. Rendering them anyway.`:void 0);const L=m??(C<=Qr?u.FIELD:u.BODY),D=L==="fill",U=N=>{var y;if(f||N.key!=="Home"&&N.key!=="End")return;const $=t.filter(S=>S.disabled!==!0),A=N.key==="Home"?$[0]:$[$.length-1];if(A===void 0)return;N.preventDefault(),P(A.value,N),(y=Array.from(N.currentTarget.querySelectorAll('input[type="radio"]')).find(S=>S.value===A.value))==null||y.focus()},G=t.map(N=>{const $=N.value===w,A=f||N.disabled===!0,O=R||h&&$;return{value:N.value,disabled:N.disabled,label:n.jsxs(o.Box,{component:"span","data-testid":"icon-group-button","data-value":N.value,"data-active":$?"true":"false",title:N.label,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",gap:O?qr:0,paddingInline:O?Zr:0,width:"100%",minWidth:0,color:ea($,A)},children:[n.jsx(o.Box,{component:"span","data-testid":"icon-group-icon",style:{flex:"0 0 auto",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:N.icon}),O?n.jsx(o.Box,{component:"span","data-testid":"icon-group-word",style:{minWidth:0,fontWeight:500,lineHeight:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:N.label}):n.jsx(o.VisuallyHidden,{children:N.label})]})}});return n.jsxs(o.Box,{"data-testid":"icon-group-row",title:z.title,"data-disabled":f?"true":void 0,style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:u.TRAIL_GAP,height:u.ROW_PITCH},children:[n.jsx(o.SegmentedControl,{data:G,value:w,onChange:N=>{const $=j.current;j.current=void 0,P(N,$)},onChangeCapture:N=>{j.current=N},onKeyDown:U,onFocus:v,onBlur:T,name:x,disabled:f,radius:"sm","aria-label":l,"aria-labelledby":c,"aria-describedby":z.describedBy,"data-testid":"icon-group-track","data-hybrid":h?"true":void 0,__vars:{"--sc-color":g.SELECTED,"--sc-shadow":"none"},styles:{root:{boxSizing:"border-box",flex:D?"1 1 auto":"0 0 auto",width:D?"100%":L,minWidth:0,height:u.CONTROL_HEIGHT,padding:Eo,gap:Kr,backgroundColor:g.SURFACE,overflow:"visible"},control:{flex:"1 1 auto",minWidth:Jr},label:{display:"flex",alignItems:"center",justifyContent:"center",height:Xr,padding:0,borderRadius:On,fontSize:"var(--mantine-font-size-sm)"},innerLabel:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",minWidth:0},indicator:{backgroundColor:g.SELECTED,borderRadius:On,boxShadow:"none"}}}),z.description!==void 0&&n.jsx(o.VisuallyHidden,{id:z.describedBy,children:z.description}),n.jsx(Ee,{children:b})]})}const na=12,oa=1.5,Hn=1.4,Nn=4,ia=20,Dn=220,kn=2,Mn=new RegExp("\\p{Sentence_Terminal}","u"),sa=/[.!?]/u,Gn=/\s/u;function ra(e){const t=Array.from(e);let s=0,i=0,a=0;for(;i<t.length;){if(!Mn.test(t[i])){i+=1;continue}let c=i;for(;c+1<t.length&&Mn.test(t[c+1]);)c+=1;const x=t[c+1],f=sa.test(t[c]);i=c+1,(!f||x===void 0||Gn.test(x))&&(s+=1,a=i)}return t.slice(a).some(c=>!Gn.test(c))?s+1:s}function aa(e){return Array.from(e).length}function la(e,t){if(e!=="reading"||typeof t!="string")return;const s=aa(t);if(s>Dn)return`ProseBlock was given a reading of ${String(s)} characters, and a reading is at most ${String(Dn)} characters. Shorten it, or it has stopped being a reading and become an explanation.`;const i=ra(t);if(i>kn)return`ProseBlock was given a reading of ${String(i)} sentences, and a reading is at most ${String(kn)} sentences. Delete any sentence that repeats what is already on screen, and move the rest into an InfoCircle.`}function ca(e,t){if(!(t===void 0||e==="runRecord"))return`ProseBlock was given onDetails on the "${e}" shape, and it belongs to "runRecord". A reading and a departure line carry no chevron, so the handler is ignored.`}function da({variant:e,children:t,onDetails:s,busy:i,live:a}){const l=ae(),c=_e(),x=r.useId();Le(la(e,t)),Le(ca(e,s));const f=Be(a,i);if(e==="reading")return n.jsx(o.Text,{...f,"data-testid":"prose-block","data-variant":e,style:{fontSize:na,lineHeight:oa,color:g.PROSE},children:t});if(e==="departure")return n.jsxs(o.Box,{...f,role:"note","aria-label":l.departure,"data-testid":"prose-block","data-variant":e,style:{display:"flex",alignItems:"flex-start",gap:Nn},children:[n.jsx(o.Box,{"aria-hidden":!0,"data-testid":"prose-block-warning",style:{flex:"0 0 auto",inlineSize:u.GLYPH_SLOT,blockSize:u.GLYPH_SLOT,display:"flex",alignItems:"center",justifyContent:"center",color:g.WARNING},children:n.jsx(re,{name:"warning",size:u.GLYPH})}),n.jsx(o.Text,{span:!0,size:"sm","data-testid":"prose-block-text",style:{lineHeight:Hn,color:g.VALUE},children:t})]});const p=typeof t=="string"?t:void 0;return n.jsxs(o.Box,{...f,"data-testid":"prose-block","data-variant":e,style:{display:"flex",alignItems:"center",gap:Nn,blockSize:ia},children:[n.jsx(o.Text,{span:!0,size:"sm",truncate:"end",id:x,title:p,"data-testid":"prose-block-text",style:{flex:"1 1 auto",minInlineSize:0,lineHeight:Hn,color:g.CHROME},children:t}),s!==void 0&&n.jsx(o.UnstyledButton,{type:"button",title:l.details,"aria-label":l.details,"aria-describedby":x,"data-testid":"prose-block-details",onClick:s,style:{flex:"0 0 auto",inlineSize:u.GLYPH_SLOT,blockSize:u.GLYPH_SLOT,display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",background:"transparent",color:g.CHROME,cursor:"pointer"},children:n.jsx(re,{name:he(c)?"chevronLeft":"chevronRight",size:u.CHEVRON})})]})}const Mt=4,ua=4,pa=`polygon(0 calc(100% - ${ua}px), 100% 0, 100% 100%, 0 100%)`,fa=120,xa=`linear-gradient(to right, ${g.SURFACE}, ${g.ACCENT})`,ha={sqrt:"scaleSqrt",linear:"scaleLinear",log:"scaleLog"},Bn={flex:"0 0 auto",lineHeight:1,color:g.CHROME,whiteSpace:"nowrap"};function ga({min:e,max:t,label:s,variant:i="size",gradient:a,scale:l,busy:c,live:x,onScaleClick:f,trailing:p}){const h=ae(),m=_e(),b=r.useId(),v=i==="color",T=l===void 0?void 0:ha[l],R=T===void 0?void 0:h[T],C=`${b}-label`,z=`${b}-min`,I=`${b}-max`,w=`${b}-scale`,P=[s===void 0?void 0:C,z,I,R===void 0?void 0:w].filter(D=>D!==void 0);let j=null;T!==void 0&&R!==void 0&&(f===void 0?j=n.jsx(o.Box,{"data-testid":"ramp-row-scale","aria-hidden":"true",title:R,style:{flex:"0 0 auto",width:u.TRAIL,height:u.CONTROL_HEIGHT,display:"flex",alignItems:"center",justifyContent:"center",color:g.CHROME},children:n.jsx(Ke,{name:T})}):j=n.jsx(uo,{label:R,icon:n.jsx(Ke,{name:T}),onClick:f}));const L=lt(p)?p:j;return n.jsxs(o.Box,{"data-testid":"ramp-row","data-variant":i,"data-scale":l,style:{display:"flex",alignItems:"center",gap:Mt,height:u.ROW_PITCH},children:[n.jsxs(o.Box,{"data-testid":"ramp-row-figure",role:"img","aria-labelledby":P.join(" "),...Be(x,c),style:{flex:"1 1 auto",minWidth:0,display:"flex",alignItems:"center",gap:Mt},children:[s!==void 0&&n.jsx(o.VisuallyHidden,{"data-testid":"ramp-row-a11y-label",id:C,children:s}),n.jsx(o.Text,{span:!0,size:"sm",id:z,"data-testid":"ramp-row-min",style:Bn,children:e}),n.jsx(o.Box,{"data-testid":"ramp-row-ramp","data-variant":i,"aria-hidden":"true",style:{flex:"1 1 auto",minWidth:fa,height:u.GLYPH,boxSizing:"border-box",background:v?a??xa:g.CHROME,borderRadius:v?"var(--mantine-radius-xs)":void 0,border:v?`1px solid ${g.BORDER}`:void 0,clipPath:v?void 0:pa,...Ji(m)}}),n.jsx(o.Text,{span:!0,size:"sm",id:I,"data-testid":"ramp-row-max",style:Bn,children:t}),R!==void 0&&n.jsx(o.VisuallyHidden,{"data-testid":"ramp-row-a11y-scale",id:w,children:R})]}),n.jsx(o.Box,{style:{flex:"0 0 auto",display:"flex",marginInlineStart:u.TRAIL_GAP-Mt},children:n.jsx(Ee,{children:L})})]})}const ma=4,ba=`${String(u.TOGGLE_PITCH)}px`,ya=2;function va({label:e,checked:t,defaultChecked:s,onChange:i,control:a="checkbox",trailing:l,disabled:c=!1,disabledReason:x,bound:f=!1,boundDescription:p,onFocus:h,onBlur:m}){const b=ae(),[v,T]=X.useUncontrolled({value:t,defaultValue:s,finalValue:!1,onChange:i}),R=j=>{T(j.currentTarget.checked,j)},C={root:{flex:"1 1 auto",minWidth:0},body:{alignItems:"center",minWidth:0},labelWrapper:{minWidth:0},label:{display:"block",height:u.TOGGLE_PITCH,paddingInlineStart:ma,fontSize:"var(--mantine-font-size-sm)",lineHeight:ba,color:c?g.DISABLED:g.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},z=p??b.fieldBound,I=st({name:e,enabledTitle:e,disabled:c,disabledReason:x,extraDescriptions:f?[z]:void 0}),w={title:I.title},P=f?n.jsx(o.Box,{component:"span","data-testid":"toggle-row-bound",style:{flex:"0 0 auto",display:"inline-flex",alignItems:"center",color:g.CHROME},children:n.jsx(Ke,{name:"attribute",filled:!0})}):null;return n.jsxs(o.Box,{"data-testid":"toggle-row","data-control":a,"data-checked":v?"true":"false","data-disabled":c?"true":void 0,"data-bound":f?"true":void 0,style:{display:"flex",alignItems:"center",boxSizing:"border-box",gap:u.TRAIL_GAP,height:u.TOGGLE_PITCH},children:[a==="switch"?n.jsx(o.Switch,{"data-testid":"toggle-row-control",label:e,checked:v,disabled:c,"aria-describedby":I.describedBy,onChange:R,onFocus:h,onBlur:m,wrapperProps:w,styles:C}):n.jsx(o.Checkbox,{"data-testid":"toggle-row-control",label:e,checked:v,disabled:c,"aria-describedby":I.describedBy,onChange:R,onFocus:h,onBlur:m,wrapperProps:w,styles:C}),I.description!==void 0&&n.jsx(o.VisuallyHidden,{id:I.describedBy,children:I.description}),P,n.jsx(Ee,{children:l})]})}function wa({children:e,label:t,labelledBy:s}){const i=r.Children.toArray(e).length;return Le(i<ya?`ToggleRowGroup was given ${String(i)} ${i===1?"row":"rows"}, and it holds two or more. A single checkbox on a row of its own interrupts a column of rows to say one bit: put it in the trailing slot of the row it modifies, or make it one tile of a group of icon buttons. Rendering it anyway.`:void 0),n.jsx(o.Box,{role:"group","aria-label":s===void 0?t:void 0,"aria-labelledby":s,"data-testid":"toggle-row-group","data-rows":i,style:{display:"flex",flexDirection:"column"},children:e})}function Sa(e="dark"){return o.useComputedColorScheme(e)}const Ia={xs:o.rem(4),sm:o.rem(8),md:o.rem(16),lg:o.rem(24),xl:o.rem(32)},Ea={HEIGHT:24,FONT_SIZE:11,CONTROL_PADDING:8,SECTION_GAP:4},Ca="0.7.0";exports.ActionRow=ur;exports.AdvancedButton=uo;exports.COMPACT_SIZING=Ea;exports.CompactColorInput=lo;exports.CompoundRow=Mr;exports.ControlGroup=bs;exports.ControlSection=Es;exports.ControlSubGroup=Rs;exports.DEFAULT_GRADIENT_STOP_COLOR=St;exports.DataRow=gr;exports.DataRowHeader=mr;exports.DataTable=Us;exports.FIELD_GLYPH_NAMES=to;exports.FIELD_LETTERS=no;exports.FieldGlyph=Ke;exports.FieldRow=$r;exports.GradientEditor=Js;exports.HistogramRow=Rr;exports.IconGroupRow=ta;exports.InfoCircle=co;exports.LabelsProvider=Ii;exports.MANTINE_SPACING=Ia;exports.MAX_ALPHA_HEX=Kt;exports.MAX_OPACITY_PERCENT=qt;exports.MetricRow=Pr;exports.PANEL_GRID=u;exports.PANEL_INK=g;exports.POPOUT_GAP=$n;exports.POPOUT_NESTED_GAP=Wn;exports.POPOUT_Z_INDEX_BASE=Gt;exports.PanelField=Io;exports.PanelLabelsProvider=So;exports.Popout=Ge;exports.PopoutButton=as;exports.PopoutManager=ao;exports.PopoutRegion=Ui;exports.ProseBlock=da;exports.RampRow=ga;exports.RankChip=tn;exports.SWATCH_COLORS_HEXA=qn;exports.SparklineRow=zr;exports.StyleNumberInput=or;exports.StyleSelect=rr;exports.ToggleRow=va;exports.ToggleRowGroup=wa;exports.ToggleWithContent=lr;exports.TrailingSlot=Ee;exports.UI_GLYPH_NAMES=ji;exports.UiGlyph=re;exports.VERSION=Ca;exports.compactColors=Vn;exports.compactDarkColors=Fn;exports.compactTheme=vi;exports.compactThemeOverride=Kn;exports.createColorStop=Et;exports.createDefaultGradientStops=po;exports.defaultLabels=Zn;exports.getActivationMeta=it;exports.isFieldGlyphName=Yt;exports.isFieldLetter=Xt;exports.isRtl=he;exports.isValidHex=Ni;exports.opacityToAlphaHex=Jt;exports.parseAlphaFromHexa=Zt;exports.parseHexaColor=Oi;exports.parseLocaleNumber=Jn;exports.toHexaColor=Hi;exports.useActualColorScheme=Sa;exports.useCollator=eo;exports.useDirection=_e;exports.useLabels=ae;exports.useLocale=Fe;exports.useNumberFormatter=qe;exports.useNumberParser=Wt;exports.useOrdinalFormatter=Qn;exports.usePanelLabels=ct;exports.usePopoutRegion=ro;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@mantine/core"),n=require("react/jsx-runtime"),X=require("@mantine/hooks"),r=require("react"),jo=require("react-dom"),xe=require("@tanstack/react-table"),Lo=require("@tanstack/react-virtual"),u={WIDTH:280,PAD_LEFT:16,PAD_RIGHT:8,CONTENT:256,BODY:224,FIELD:108,GUTTER:8,TRAIL_GAP:8,TRAIL:24,TRIPLE:72,TRIPLE_GAP:4,CONTROL_HEIGHT:24,ROW_PITCH:32,TOGGLE_PITCH:24,DATA_PITCH:28,SECTION_HEADER:32,SECTION_PAD_BOTTOM:8,GLYPH_SLOT:16,GLYPH:14,CHEVRON:12,VALUE_INSET:24,SPARKLINE_HEIGHT:32,HISTOGRAM_HEIGHT:64,LABEL_COLUMN:76},g={VALUE:"var(--mantine-color-text)",CHROME:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-1))",PROSE:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-1))",PLACEHOLDER:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-1))",DISABLED:"var(--mantine-color-disabled-color)",SURFACE:"light-dark(var(--mantine-color-gray-1), var(--mantine-color-dark-6))",PANEL:"var(--mantine-color-body)",RAISED:"light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-5))",SELECTED:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-1))",ON_SELECTED:"var(--mantine-color-body)",BORDER:"light-dark(var(--mantine-color-gray-6), var(--mantine-color-dark-2))",DIVIDER:"light-dark(var(--mantine-color-gray-6), var(--mantine-color-dark-2))",ACCENT:"var(--mantine-primary-color-filled)",ON_ACCENT:"var(--mantine-primary-color-contrast)",WARNING:"var(--mantine-color-yellow-6)",SUCCESS:"var(--mantine-color-green-6)",DANGER:"var(--mantine-color-red-6)"},Fn=["#d5d7da","#a3a8b1","#7a828e","#5f6873","#48525c","#374047","#2a3035","#1f2428","#161b22","#0d1117"],Un={...o.DEFAULT_THEME.colors,dark:Fn},_o={compactSize:"sm",sizes:{xs:{"--button-height":"20px","--button-fz":"10px","--button-padding-x":"6px"},sm:{"--button-height":"24px","--button-fz":"11px","--button-padding-x":"8px"},md:{"--button-height":"30px","--button-fz":"13px","--button-padding-x":"12px"},lg:{"--button-height":"36px","--button-fz":"15px","--button-padding-x":"16px"},xl:{"--button-height":"44px","--button-fz":"17px","--button-padding-x":"20px"}}},Oo={compactSize:"sm",sizes:{xs:{"--ai-size":"18px"},sm:{"--ai-size":"24px"},md:{"--ai-size":"30px"},lg:{"--ai-size":"36px"},xl:{"--ai-size":"44px"}}};function Ho(e){return e==="light"?{"--ai-bd":"1px solid var(--ai-color)"}:{}}const Vn={compactSize:"xs",sizes:{xs:{"--cb-size":"16px","--cb-icon-size":"12px"},sm:{"--cb-size":"20px","--cb-icon-size":"14px"},md:{"--cb-size":"24px","--cb-icon-size":"16px"},lg:{"--cb-size":"30px","--cb-icon-size":"20px"},xl:{"--cb-size":"36px","--cb-icon-size":"24px"}}};function F(e,t){const s=t==null?e.compactSize:String(t);return e.sizes[s]??e.sizes[e.compactSize]}const No={Button:o.Button.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(_o,t==null?void 0:t.size)})}),ActionIcon:o.ActionIcon.extend({defaultProps:{size:"sm",variant:"subtle"},vars:(e,t)=>({root:{...F(Oo,t==null?void 0:t.size),...Ho(t==null?void 0:t.variant)}})}),CloseButton:o.CloseButton.extend({defaultProps:{size:"xs"},vars:(e,t)=>({root:F(Vn,t==null?void 0:t.size)})})},Do={compactSize:"sm",sizes:{xs:{"--switch-height":"12px","--switch-width":"22px","--switch-thumb-size":"8px","--switch-track-label-padding":"2px","--switch-label-font-size":"4px"},sm:{"--switch-height":"16px","--switch-width":"28px","--switch-thumb-size":"12px","--switch-track-label-padding":"2px","--switch-label-font-size":"5px"},md:{"--switch-height":"20px","--switch-width":"36px","--switch-thumb-size":"16px","--switch-track-label-padding":"3px","--switch-label-font-size":"7px"},lg:{"--switch-height":"24px","--switch-width":"44px","--switch-thumb-size":"20px","--switch-track-label-padding":"3px","--switch-label-font-size":"9px"},xl:{"--switch-height":"28px","--switch-width":"52px","--switch-thumb-size":"24px","--switch-track-label-padding":"4px","--switch-label-font-size":"11px"}}},ko={compactSize:"sm",sizes:{xs:{"--checkbox-size":"12px"},sm:{"--checkbox-size":"16px"},md:{"--checkbox-size":"20px"},lg:{"--checkbox-size":"24px"},xl:{"--checkbox-size":"28px"}}},Mo={compactSize:"sm",sizes:{xs:{"--radio-size":"12px","--radio-icon-size":"5px"},sm:{"--radio-size":"16px","--radio-icon-size":"6px"},md:{"--radio-size":"20px","--radio-icon-size":"8px"},lg:{"--radio-size":"24px","--radio-icon-size":"10px"},xl:{"--radio-size":"28px","--radio-icon-size":"12px"}}},an={compactSize:"sm",sizes:{xs:{"--slider-size":"2px","--slider-thumb-size":"8px"},sm:{"--slider-size":"4px","--slider-thumb-size":"12px"},md:{"--slider-size":"6px","--slider-thumb-size":"16px"},lg:{"--slider-size":"8px","--slider-thumb-size":"20px"},xl:{"--slider-size":"10px","--slider-thumb-size":"24px"}}},Go={compactSize:"sm",sizes:{xs:{"--sc-font-size":"9px","--sc-padding":"2px 6px"},sm:{"--sc-font-size":"10px","--sc-padding":"4px 8px"},md:{"--sc-font-size":"12px","--sc-padding":"6px 10px"},lg:{"--sc-font-size":"14px","--sc-padding":"8px 12px"},xl:{"--sc-font-size":"16px","--sc-padding":"10px 16px"}}},Bo={backgroundColor:"transparent"},Fo={backgroundColor:"light-dark(var(--mantine-color-gray-2), var(--mantine-color-dark-6))"},zt={fontSize:11},ln={fontSize:10,marginTop:2},Uo={SegmentedControl:o.SegmentedControl.extend({defaultProps:{size:"sm",withItemsBorders:!1},vars:(e,t)=>({root:F(Go,t==null?void 0:t.size)}),styles:{root:Bo,indicator:Fo}}),Checkbox:o.Checkbox.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(ko,t==null?void 0:t.size)}),styles:{label:zt}}),Switch:o.Switch.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Do,t==null?void 0:t.size)}),styles:{label:zt}}),Slider:o.Slider.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(an,t==null?void 0:t.size)}),styles:{markLabel:ln}}),Radio:o.Radio.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Mo,t==null?void 0:t.size)}),styles:{label:zt}}),RangeSlider:o.RangeSlider.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(an,t==null?void 0:t.size)}),styles:{markLabel:ln}})},Vo={compactSize:"sm",sizes:{xs:{"--badge-height":"12px","--badge-fz":"8px","--badge-padding-x":"3px"},sm:{"--badge-height":"14px","--badge-fz":"9px","--badge-padding-x":"4px"},md:{"--badge-height":"18px","--badge-fz":"11px","--badge-padding-x":"6px"},lg:{"--badge-height":"22px","--badge-fz":"13px","--badge-padding-x":"8px"},xl:{"--badge-height":"26px","--badge-fz":"15px","--badge-padding-x":"10px"}}},$o={compactSize:"sm",sizes:{xs:{"--avatar-size":"18px"},sm:{"--avatar-size":"24px"},md:{"--avatar-size":"30px"},lg:{"--avatar-size":"36px"},xl:{"--avatar-size":"44px"}}},Wo={compactSize:"sm",sizes:{xs:{"--ti-size":"18px"},sm:{"--ti-size":"24px"},md:{"--ti-size":"30px"},lg:{"--ti-size":"36px"},xl:{"--ti-size":"44px"}}},Yo={compactSize:"sm",sizes:{xs:{"--indicator-size":"6px"},sm:{"--indicator-size":"8px"},md:{"--indicator-size":"10px"},lg:{"--indicator-size":"12px"},xl:{"--indicator-size":"14px"}}},Xo={compactSize:"sm",sizes:{xs:{"--kbd-fz":"9px","--kbd-padding":"1px 3px"},sm:{"--kbd-fz":"10px","--kbd-padding":"2px 4px"},md:{"--kbd-fz":"12px","--kbd-padding":"3px 6px"},lg:{"--kbd-fz":"14px","--kbd-padding":"4px 8px"},xl:{"--kbd-fz":"16px","--kbd-padding":"5px 10px"}}},Ko={compactSize:"sm",sizes:{xs:{"--pill-height":"14px","--pill-fz":"9px"},sm:{"--pill-height":"16px","--pill-fz":"10px"},md:{"--pill-height":"20px","--pill-fz":"12px"},lg:{"--pill-height":"24px","--pill-fz":"14px"},xl:{"--pill-height":"28px","--pill-fz":"16px"}}},qo={Text:o.Text.extend({}),Badge:o.Badge.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Vo,t==null?void 0:t.size)})}),Pill:o.Pill.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Ko,t==null?void 0:t.size)})}),Avatar:o.Avatar.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F($o,t==null?void 0:t.size)})}),ThemeIcon:o.ThemeIcon.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Wo,t==null?void 0:t.size)})}),Indicator:o.Indicator.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Yo,t==null?void 0:t.size)})}),Kbd:o.Kbd.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Xo,t==null?void 0:t.size)})})},Zo={compactSize:"sm",sizes:{xs:{"--loader-size":"14px"},sm:{"--loader-size":"18px"},md:{"--loader-size":"24px"},lg:{"--loader-size":"30px"},xl:{"--loader-size":"38px"}}},Jo={compactSize:"sm",sizes:{xs:{"--progress-size":"2px"},sm:{"--progress-size":"4px"},md:{"--progress-size":"6px"},lg:{"--progress-size":"8px"},xl:{"--progress-size":"10px"}}},Qo={label:{fontSize:9}},ei={Loader:o.Loader.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Zo,t==null?void 0:t.size)})}),Progress:o.Progress.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(Jo,t==null?void 0:t.size)}),styles:Qo}),RingProgress:o.RingProgress.extend({})},Gt=1e3,Me=1100,$n=8,Wn=4,Yn="light-dark(var(--mantine-primary-color-filled), var(--mantine-primary-color-5))",Tt={"--input-height":"24px","--input-size":"24px","--input-fz":"11px","--input-bg":"var(--mantine-color-default)","--input-bd":"transparent","--input-bd-focus":Yn},Xn={"--input-fz":"11px","--input-bg":"var(--mantine-color-default)","--input-bd":"transparent","--input-bd-focus":Yn},nt={fontSize:11,color:g.CHROME,marginBottom:1,lineHeight:1.2},$t={paddingInlineStart:8,paddingInlineEnd:8,backgroundColor:"var(--mantine-color-default)"},tt={label:nt,input:$t},cn={label:nt,input:$t},ht={dropdown:{padding:4,border:"none",boxShadow:"var(--mantine-shadow-md)"},option:{fontSize:11,padding:"4px 8px",borderRadius:4},options:{},groupLabel:{fontSize:10,padding:"4px 8px"},empty:{fontSize:11,padding:"8px"}},Pt={input:{...tt.input,minHeight:24,height:"auto",display:"flex",alignItems:"center",paddingTop:4,paddingBottom:4},pillsList:{columnGap:4,rowGap:2},pill:{margin:0}};function ve(e,t){return{...Tt,"--input-height":e,"--input-size":e,"--input-fz":t}}function gt(e){return{...Xn,"--input-fz":e}}const at={compactSize:"sm",sizes:{xs:ve("20px","10px"),sm:Tt,md:ve("30px","13px"),lg:ve("36px","15px"),xl:ve("44px","17px")}},mt={compactSize:"sm",sizes:{xs:gt("10px"),sm:Xn,md:gt("13px"),lg:gt("15px"),xl:gt("17px")}},ti={compactSize:"sm",sizes:{xs:{...ve("20px","10px"),"--input-right-section-width":"20px"},sm:{...Tt,"--input-right-section-width":"24px"},md:{...ve("30px","13px"),"--input-right-section-width":"30px"},lg:{...ve("36px","15px"),"--input-right-section-width":"36px"},xl:{...ve("44px","17px"),"--input-right-section-width":"44px"}}},ni={compactSize:"sm",sizes:{xs:{"--ni-chevron-size":"8px"},sm:{"--ni-chevron-size":"10px"},md:{"--ni-chevron-size":"12px"},lg:{"--ni-chevron-size":"14px"},xl:{"--ni-chevron-size":"16px"}}},oi={compactSize:"sm",sizes:{xs:{...ve("20px","10px"),"--combobox-chevron-size":"10px"},sm:{...Tt,"--combobox-chevron-size":"12px"},md:{...ve("30px","13px"),"--combobox-chevron-size":"14px"},lg:{...ve("36px","15px"),"--combobox-chevron-size":"16px"},xl:{...ve("44px","17px"),"--combobox-chevron-size":"18px"}}},ii={TextInput:o.TextInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:F(at,t==null?void 0:t.size)}),styles:tt}),NumberInput:o.NumberInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:F(ti,t==null?void 0:t.size),controls:F(ni,t==null?void 0:t.size)}),styles:{label:nt,input:$t,control:{borderColor:"transparent"}}}),Select:o.Select.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:Me}},vars:(e,t)=>({root:{},wrapper:F(at,t==null?void 0:t.size)}),styles:{...tt,...ht}}),Textarea:o.Textarea.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:F(mt,t==null?void 0:t.size)}),styles:cn}),PasswordInput:o.PasswordInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:F(at,t==null?void 0:t.size)}),styles:{...tt,innerInput:{paddingInlineStart:8,paddingInlineEnd:8}}}),Autocomplete:o.Autocomplete.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:Me}},vars:(e,t)=>({root:{},wrapper:F(at,t==null?void 0:t.size)}),styles:{...tt,...ht}}),MultiSelect:o.MultiSelect.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:Me}},vars:(e,t)=>({root:{},wrapper:F(oi,t==null?void 0:t.size)}),styles:{label:nt,...ht,...Pt,inputField:{minWidth:60,flexBasis:60}}}),TagsInput:o.TagsInput.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:Me}},vars:(e,t)=>({root:{},wrapper:F(mt,t==null?void 0:t.size)}),styles:{label:nt,...ht,...Pt,inputField:{minWidth:30,flexBasis:30}}}),PillsInput:o.PillsInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:F(mt,t==null?void 0:t.size)}),styles:{label:nt,...Pt}}),FileInput:o.FileInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:F(at,t==null?void 0:t.size)}),styles:tt}),JsonInput:o.JsonInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:F(mt,t==null?void 0:t.size)}),styles:cn}),InputClearButton:o.InputClearButton.extend({defaultProps:{size:"xs"},vars:(e,t)=>({root:F(Vn,t==null?void 0:t.size)})})},si={compactSize:"sm",sizes:{xs:{"--pagination-control-size":"20px","--pagination-control-fz":"10px"},sm:{"--pagination-control-size":"24px","--pagination-control-fz":"11px"},md:{"--pagination-control-size":"30px","--pagination-control-fz":"13px"},lg:{"--pagination-control-size":"36px","--pagination-control-fz":"15px"},xl:{"--pagination-control-size":"44px","--pagination-control-fz":"17px"}}},ri={compactSize:"sm",sizes:{xs:{"--stepper-icon-size":"20px","--stepper-fz":"10px","--stepper-spacing":"6px"},sm:{"--stepper-icon-size":"24px","--stepper-fz":"11px","--stepper-spacing":"8px"},md:{"--stepper-icon-size":"30px","--stepper-fz":"13px","--stepper-spacing":"12px"},lg:{"--stepper-icon-size":"36px","--stepper-fz":"15px","--stepper-spacing":"16px"},xl:{"--stepper-icon-size":"44px","--stepper-fz":"17px","--stepper-spacing":"20px"}}},ai={compactSize:"sm",sizes:{xs:{"--burger-size":"14px","--burger-line-size":"2px"},sm:{"--burger-size":"18px","--burger-line-size":"2px"},md:{"--burger-size":"24px","--burger-line-size":"3px"},lg:{"--burger-size":"30px","--burger-line-size":"3px"},xl:{"--burger-size":"38px","--burger-line-size":"4px"}}},li={root:{fontSize:11}},ci={root:{fontSize:11,minHeight:28},label:{fontSize:11}},di={tab:{fontSize:11,padding:"6px 10px"}},ui={Anchor:o.Anchor.extend({defaultProps:{size:"sm"},styles:li}),Burger:o.Burger.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(ai,t==null?void 0:t.size)})}),NavLink:o.NavLink.extend({styles:ci}),Pagination:o.Pagination.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(si,t==null?void 0:t.size)})}),Stepper:o.Stepper.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:F(ri,t==null?void 0:t.size)})}),Tabs:o.Tabs.extend({styles:di})},pi={"--menu-item-fz":"11px"},fi={tooltip:{fontSize:11,padding:"4px 8px"}},xi={dropdown:{padding:8}},hi={dropdown:{padding:8}},gi={Menu:o.Menu.extend({defaultProps:{zIndex:Me},vars:()=>({dropdown:pi})}),Tooltip:o.Tooltip.extend({defaultProps:{zIndex:Me},styles:fi}),Popover:o.Popover.extend({defaultProps:{zIndex:Me},styles:xi}),HoverCard:o.HoverCard.extend({defaultProps:{zIndex:Me},styles:hi})},mi={xs:"10px",sm:"11px",md:"13px",lg:"14px",xl:"16px"},bi={xs:"4px",sm:"6px",md:"8px",lg:"12px",xl:"16px"},yi={xs:"2px",sm:"4px",md:"6px",lg:"8px",xl:"12px"},Kn=o.createTheme({colors:Un,fontSizes:mi,spacing:bi,radius:yi,focusRing:"auto",other:{panelGrid:u},components:{...ii,...No,...Uo,...qo,...ei,...ui,...gi}}),vi=o.mergeMantineTheme(o.DEFAULT_THEME,Kn),qn=["#5B8FF9FF","#FF6B6BFF","#61D095FF","#F7B731FF","#9B59B6FF","#5B8FF980","#FF6B6B80","#61D09580","#F7B73180","#9B59B680"],St="#888888",Zn={mixed:"Mixed",fieldBound:"Bound to a data attribute",fieldPending:"Set but not yet applied",scaleSqrt:"Square root scale",scaleLinear:"Linear scale",scaleLog:"Logarithmic scale",details:"Details",departure:"Departure",percentile:e=>`${e} percentile`,expandSection:e=>`Expand ${e}`,collapseSection:e=>`Collapse ${e}`,addToSection:e=>`Add ${e}`,sectionHasConfiguredValues:e=>`${e} has configured values`,about:e=>`About ${e}`,resetToDefault:e=>`Reset ${e} to default`,colorSwatch:"Color swatch",colorHexValue:"Color hex value",opacity:"Opacity",colorPanelTitle:"Color",colorGenericName:"color",colorStops:"Color Stops",addColorStop:"Add color stop",colorStopPosition:e=>`Stop ${e} position`,removeColorStop:e=>`Remove color stop ${e}`,direction:"Direction",gradientDirection:"Gradient direction",degrees:e=>`${e}°`,percent:e=>`${e}%`,dataTable:"Data table",search:"Search",searchPlaceholder:"Search",clearSearch:"Clear search",noRows:"No rows",noMatchingRows:"No rows match the search",rowsShown:(e,t)=>`${e} of ${t} rows`,rowsSelected:e=>`${e} selected`,yes:"Yes",no:"No",closePanel:"Close panel",settings:"Settings",ordinal:(e,t)=>{switch(t){case"one":return`${e}st`;case"two":return`${e}nd`;case"few":return`${e}rd`;default:return`${e}th`}}},wi="en",Bt=r.createContext(Zn),Ft=r.createContext(void 0);function Si(e){return e!==void 0&&e!==""?e:typeof document<"u"&&document.documentElement.lang!==""?document.documentElement.lang:typeof navigator<"u"&&navigator.language!==""?navigator.language:wi}function Ii({labels:e,locale:t,children:s}){const i=r.useContext(Bt),a=r.useContext(Ft),l=r.useMemo(()=>({...i,...e}),[i,e]),c=t??a;return n.jsx(Ft.Provider,{value:c,children:n.jsx(Bt.Provider,{value:l,children:s})})}function ae(){return r.useContext(Bt)}function Fe(){const e=r.useContext(Ft);return Si(e)}const Ei=1234.5,Ci="9876543210",Ti=9876543210,Ri=new Set([" "," "," "," ","'","’"]),zi="−",Pi=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?/iu,dn=new Map;function Ai(e){var f,p;const t=dn.get(e);if(t!==void 0)return t;const s=new Intl.NumberFormat(e).formatToParts(Ei),i=((f=s.find(h=>h.type==="decimal"))==null?void 0:f.value)??".",a=((p=s.find(h=>h.type==="group"))==null?void 0:p.value)??"",l=new Map;for(const h of"0123456789")l.set(h,h);const c=new Intl.NumberFormat(e,{useGrouping:!1}).format(Ti);Array.from(c).forEach((h,m)=>{l.set(h,Ci[m])});const x={decimal:i,digits:l,group:a};return dn.set(e,x),x}function Jn(e,t){const s=Ai(t);let i="";for(const l of e.trim()){const c=s.digits.get(l);if(c!==void 0){i+=c;continue}if(l===s.decimal){i+=".";continue}if(!(l===s.group||Ri.has(l))){if(l==="-"||l===zi){i+="-";continue}if(l==="+"){i+="+";continue}if(l==="e"||l==="E"){i+=l;continue}break}}const a=Pi.exec(i);return a===null?Number.NaN:Number(a[0])}function qe(e){const t=Fe(),s=JSON.stringify(e??{});return r.useMemo(()=>new Intl.NumberFormat(t,e),[t,s])}function Qn(){const e=Fe(),t=ae(),s=qe(),i=r.useMemo(()=>new Intl.PluralRules(e,{type:"ordinal"}),[e]);return r.useCallback(a=>t.ordinal(s.format(a),i.select(a)),[t,s,i])}function eo(e){const t=Fe(),s=JSON.stringify(e??{});return r.useMemo(()=>new Intl.Collator(t,e),[t,s])}function Wt(){const e=Fe();return r.useCallback(t=>Jn(t,e),[e])}const to=["sizeSmallest","sizeLargest","width","opacity","attribute","scaleSqrt","scaleLinear","scaleLog"],no=["N","E","W","D","K"],ji=["chevronDown","chevronRight","chevronLeft","close","plus","minus","gear","warning","check","eye","refresh","copy","pin","keepOpen","info","reset"],oo={viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},je={fill:"currentColor",stroke:"none"},Li={sizeSmallest:e=>n.jsxs(n.Fragment,{children:[n.jsx("circle",{cx:"5",cy:"11",r:"2.5",...e?je:{}}),n.jsx("circle",{cx:"10.5",cy:"6.5",r:"4",...e?je:{}})]}),sizeLargest:e=>n.jsxs(n.Fragment,{children:[n.jsx("circle",{cx:"4.5",cy:"11.5",r:"1.75",...e?je:{}}),n.jsx("circle",{cx:"10",cy:"6",r:"5",...e?je:{}})]}),width:e=>n.jsxs(n.Fragment,{children:[n.jsx("line",{x1:"2.5",y1:"8",x2:"13.5",y2:"8"}),n.jsx("polyline",{points:"5,5.5 2.5,8 5,10.5",...e?je:{}}),n.jsx("polyline",{points:"11,5.5 13.5,8 11,10.5",...e?je:{}})]}),opacity:e=>e?n.jsx("circle",{cx:"8",cy:"8",r:"5.5",...je}):n.jsxs(n.Fragment,{children:[n.jsx("circle",{cx:"8",cy:"8",r:"5.5"}),n.jsx("path",{d:"M8 2.5a5.5 5.5 0 0 1 0 11z",...je})]}),attribute:e=>e?n.jsxs(n.Fragment,{children:[n.jsx("path",{d:"M2.5 7.2V3.5a1 1 0 0 1 1-1h3.7l6.3 6.3-4.7 4.7z",...je}),n.jsx("circle",{cx:"5.5",cy:"5.5",r:"0.75",style:{fill:g.SURFACE},stroke:"none"})]}):n.jsxs(n.Fragment,{children:[n.jsx("path",{d:"M2.5 7.2V3.5a1 1 0 0 1 1-1h3.7l6.3 6.3-4.7 4.7z"}),n.jsx("circle",{cx:"5.5",cy:"5.5",r:"0.75"})]}),scaleSqrt:()=>n.jsx("path",{d:"M2.5 13.5C4.5 5 8 2.5 13.5 2.5"}),scaleLinear:()=>n.jsx("line",{x1:"2.5",y1:"13.5",x2:"13.5",y2:"2.5"}),scaleLog:()=>n.jsx("path",{d:"M2.5 13.5C8 13.5 11.5 11 13.5 2.5"})},_i={chevronDown:n.jsx("polyline",{points:"4,6 8,10 12,6"}),chevronRight:n.jsx("polyline",{points:"6,4 10,8 6,12"}),chevronLeft:n.jsx("polyline",{points:"10,4 6,8 10,12"}),close:n.jsxs(n.Fragment,{children:[n.jsx("line",{x1:"4",y1:"4",x2:"12",y2:"12"}),n.jsx("line",{x1:"12",y1:"4",x2:"4",y2:"12"})]}),plus:n.jsxs(n.Fragment,{children:[n.jsx("line",{x1:"8",y1:"3",x2:"8",y2:"13"}),n.jsx("line",{x1:"3",y1:"8",x2:"13",y2:"8"})]}),minus:n.jsx("line",{x1:"3",y1:"8",x2:"13",y2:"8"}),gear:n.jsxs(n.Fragment,{children:[n.jsx("circle",{cx:"8",cy:"8",r:"2.25"}),n.jsx("circle",{cx:"8",cy:"8",r:"4.75"}),n.jsx("path",{d:"M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2M3.4 3.4l1.4 1.4M11.2 11.2l1.4 1.4M12.6 3.4l-1.4 1.4M4.8 11.2l-1.4 1.4"})]}),warning:n.jsxs(n.Fragment,{children:[n.jsx("path",{d:"M8 2.5l6 11H2z"}),n.jsx("line",{x1:"8",y1:"6.5",x2:"8",y2:"9.5"}),n.jsx("line",{x1:"8",y1:"11.5",x2:"8",y2:"11.75"})]}),check:n.jsx("polyline",{points:"3.5,8.5 6.5,11.5 12.5,5"}),eye:n.jsxs(n.Fragment,{children:[n.jsx("path",{d:"M1.5 8s2.5-4.5 6.5-4.5S14.5 8 14.5 8s-2.5 4.5-6.5 4.5S1.5 8 1.5 8z"}),n.jsx("circle",{cx:"8",cy:"8",r:"2"})]}),refresh:n.jsxs(n.Fragment,{children:[n.jsx("path",{d:"M2.5 8a5.5 5.5 0 1 0 1.6-3.9"}),n.jsx("polyline",{points:"2.5,2.5 2.5,6 6,6"})]}),copy:n.jsxs(n.Fragment,{children:[n.jsx("rect",{x:"5.5",y:"5.5",width:"8",height:"8",rx:"1"}),n.jsx("path",{d:"M10.5 5.5v-2a1 1 0 0 0-1-1h-6a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2"})]}),pin:n.jsxs(n.Fragment,{children:[n.jsx("path",{d:"M6 2.5h4l-.5 3.5 2 2.5H4.5l2-2.5z"}),n.jsx("line",{x1:"8",y1:"8.5",x2:"8",y2:"13.5"})]}),keepOpen:n.jsxs(n.Fragment,{children:[n.jsx("rect",{x:"3.5",y:"7",width:"9",height:"6.5",rx:"1"}),n.jsx("path",{d:"M5.75 7V5.25a2.25 2.25 0 0 1 4.5 0V7"})]}),info:n.jsxs(n.Fragment,{children:[n.jsx("circle",{cx:"8",cy:"8",r:"6.5"}),n.jsx("line",{x1:"8",y1:"7",x2:"8",y2:"11.5"}),n.jsx("line",{x1:"8",y1:"4.5",x2:"8",y2:"4.75"})]}),reset:n.jsxs(n.Fragment,{children:[n.jsx("line",{x1:"4",y1:"4",x2:"12",y2:"12"}),n.jsx("line",{x1:"12",y1:"4",x2:"4",y2:"12"})]})};function Ke({name:e,filled:t=!1,size:s=u.GLYPH}){return n.jsx("svg",{width:s,height:s,...oo,"aria-hidden":"true",focusable:"false","data-glyph":e,"data-filled":t?"true":"false",style:{flex:"0 0 auto",display:"block"},children:Li[e](t)})}function re({name:e,size:t=u.GLYPH}){return n.jsx("svg",{width:t,height:t,...oo,"aria-hidden":"true",focusable:"false","data-glyph":e,style:{flex:"0 0 auto",display:"block"},children:_i[e]})}function Yt(e){return typeof e=="string"&&to.includes(e)}function Xt(e){return typeof e=="string"&&no.includes(e)}const Kt=255,qt=100;function Zt(e){return Math.round(parseInt(e,16)/Kt*qt)}function Jt(e){return Math.round(e/qt*Kt).toString(16).padStart(2,"0")}function Oi(e){let t=e.replace("#","");t.length===3?t=`${t.split("").map(l=>l+l).join("")}ff`:t.length===4?t=t.split("").map(l=>l+l).join(""):t.length===6&&(t=`${t}ff`);const s=`#${t.slice(0,6)}`,i=t.slice(6,8),a=Zt(i);return{hex:s,opacity:a}}function Hi(e,t){const s=e.replace("#",""),i=Jt(t);return`#${s}${i}`}function Ni(e){return/^#?([A-Fa-f0-9]{3}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)}const It={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0};function Di(e,t){const s=e===void 0?"":e.trim();return s===""?t:`${/[.!?]$/u.test(s)?s:`${s}.`} ${t}`}function st({name:e,enabledTitle:t,disabled:s=!1,disabledReason:i,extraDescriptions:a}){const l=r.useId(),c=s&&i!==void 0&&i!==""?i:void 0,x=[];for(const p of a??[])p!==void 0&&p!==""&&x.push(p);c!==void 0&&x.push(c);const f=x.length>0?x.join(". "):void 0;return{title:c===void 0?t:Di(t??e,c),description:f,describedBy:f===void 0?void 0:l}}const io=r.createContext(null);function ki(){return r.useContext(io)}function Mi({children:e}){const t=r.useRef(null);if(!r.isValidElement(e))throw new Error("PopoutAnchor requires a single valid React element as its child");const s=e,i=r.cloneElement(s,{ref:t});return n.jsx(io.Provider,{value:{anchorRef:t},children:i})}function Gi({children:e}){return n.jsx(o.Box,{p:"sm",children:e})}const Bi=["[data-portal]","[data-combobox-dropdown]","[data-menu-dropdown]","[data-popover-dropdown]","[data-tooltip]","[data-hovercard-dropdown]","[data-dates-dropdown]","[data-modal]"].join(", ");function Fi(e,t=!0){r.useEffect(()=>{if(!t)return;const s=i=>{const a=i.target;a.closest('[role="dialog"]')||a.closest("[data-popout-trigger]")||a.closest("[data-popout-portal-container]")||a.closest(Bi)||e()};return document.addEventListener("mousedown",s),()=>{document.removeEventListener("mousedown",s)}},[e,t])}function Ui(e,t=!0){r.useEffect(()=>{if(!t)return;const s=i=>{i.key==="Escape"&&(i.preventDefault(),e())};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s)}},[e,t])}const so=r.createContext(null);function Vi({id:e,children:t}){return n.jsx(so.Provider,{value:e,children:t})}function ro(){return r.useContext(so)}const Qt=r.createContext(null),en=r.createContext(null);function Rt(){const e=r.useContext(Qt);if(!e)throw new Error("usePopoutContext must be used within a Popout component");return e}function $i(){return r.useContext(Qt)}function Wi(){const e=r.useContext(en);if(!e)throw new Error("usePopoutManagerContext must be used within a PopoutManager");return e}function Yi(){return r.useContext(en)}function Xi({children:e,parentId:t=null,opened:s,defaultOpened:i,onOpenChange:a}){const l=r.useId(),c=r.useRef(null),x=ro(),[f,p]=X.useUncontrolled({value:s,defaultValue:i,finalValue:!1,onChange:a}),h=r.useRef(p);r.useEffect(()=>{h.current=p});const m=r.useCallback((C,z)=>{if(z){h.current(C,z);return}h.current(C)},[]),b=r.useCallback(C=>{m(!0,C)},[m]),v=r.useCallback(C=>{m(!1,C)},[m]),T=r.useCallback(C=>{m(!f,C)},[f,m]),R=r.useMemo(()=>({id:l,isOpen:f,open:b,close:v,toggle:T,triggerRef:c,parentId:t,region:x}),[l,f,b,v,T,t,x]);return n.jsx(Qt.Provider,{value:R,children:e})}function Ki({children:e}){const[t,s]=r.useState(null),i=r.useRef([]),a=r.useRef(new Map),l=r.useRef(new Map),c=r.useRef(new Map),[x,f]=r.useState(0),p=r.useCallback((y,S,H)=>(l.current.get(y)??null)!==S?!1:S!==null?!0:(c.current.get(y)??null)===H,[]),h=r.useCallback((y,S)=>i.current.filter(H=>p(H,y,S)),[p]),m=r.useCallback(y=>{const S=[];for(const H of i.current){let k=H;for(;k;){const K=l.current.get(k)??null;if(K===y){S.push(H);break}k=K}}return S},[]),b=r.useCallback(y=>{let S=0,H=y;for(;H;){const k=l.current.get(H)??null;if(!k)break;S++,H=k}return S},[]),v=r.useCallback(y=>{var H;const S=[...y].sort((k,K)=>b(K)-b(k));for(const k of S)(H=a.current.get(k))==null||H()},[b]),T=r.useCallback((y,S,H,k)=>{if(i.current.includes(y)){a.current.set(y,S);return}const K=H??null,q=k??null,ge=h(K,q),Q=[];for(const ne of ge)Q.push(ne),Q.push(...m(ne));v(Q);const le=new Set(Q);i.current=i.current.filter(ne=>!le.has(ne)),i.current.push(y),a.current.set(y,S),l.current.set(y,K),c.current.set(y,q),f(ne=>ne+1)},[h,m,v]),R=r.useCallback(y=>{if(!i.current.includes(y)){a.current.delete(y),l.current.delete(y),c.current.delete(y);return}i.current=i.current.filter(S=>S!==y),a.current.delete(y),l.current.delete(y),c.current.delete(y),f(S=>S+1)},[]),C=r.useCallback(y=>{const S=i.current.indexOf(y);return S>=0?Gt+S:Gt},[]),z=r.useCallback(y=>{const S=i.current,H=S.indexOf(y);H===-1||H===S.length-1||(i.current=[...S.filter(k=>k!==y),y],f(k=>k+1))},[]),I=r.useCallback(y=>l.current.get(y)??null,[]),w=r.useCallback((y,S)=>{let H=S;for(;H;){const k=l.current.get(H);if(k===y)return!0;H=k??null}return!1},[]),P=r.useCallback(y=>{const S=[],H=i.current;for(const k of H)w(y,k)&&S.push(k);return S},[w]),j=r.useCallback(y=>{const S=P(y);for(const H of[...S].reverse()){const k=a.current.get(H);k==null||k()}},[P]),L=r.useCallback(y=>{j(y);const S=a.current.get(y);S==null||S()},[j]),D=r.useCallback((y,S)=>{const H=c.current.get(y)??null;for(const k of i.current)k!==y&&p(k,S,H)&&L(k)},[L,p]),V=r.useCallback(()=>{const y=i.current;if(y.length===0)return;const S=y[y.length-1],H=a.current.get(S);H==null||H()},[]),G=r.useCallback(()=>{const y=[...i.current];for(const S of y){const H=a.current.get(S);H==null||H()}},[]),N=r.useCallback(()=>i.current.length>0,[]),[$,A]=r.useState(!1);r.useEffect(()=>{A(i.current.length>0)},[x]),Ui(V,$),Fi(G,$);const O=r.useMemo(()=>({register:T,unregister:R,getZIndex:C,bringToFront:z,portalContainer:t,zIndexVersion:x,closeFocused:V,closeAll:G,hasOpenPopouts:N,closeWithDescendants:L,closeDescendants:j,closeSiblings:D,getParentId:I,isAncestor:w}),[T,R,C,z,t,x,V,G,N,L,j,D,I,w]);return n.jsxs(en.Provider,{value:O,children:[e,n.jsx("div",{ref:s,"data-popout-portal-container":!0,style:{display:"contents"}})]})}function _e(){return o.useDirection().dir}function he(e){return e==="rtl"}function qi(e,t){return he(t)?1-e:e}function Zi(e,t,s){return qi(e,s)*t}function Ji(e){return he(e)?{transform:"scaleX(-1)"}:{}}const un=3;function Qi(e){const{isOpen:t,onPress:s,onDragStart:i,onDrag:a,onDragEnd:l}=e,[c,x]=r.useState({left:0,top:0}),f=r.useRef(!1),p=r.useRef(!1),h=r.useRef(!1),m=r.useRef({x:0,y:0,offsetLeft:0,offsetTop:0}),b=r.useCallback(()=>{x({left:0,top:0})},[]),v=r.useCallback(()=>{const I=h.current;return h.current=!1,I},[]),T=r.useCallback(I=>{const w=I.target;if(!(w.tagName==="INPUT"||w.tagName==="TEXTAREA"||w.tagName==="BUTTON"||w.tagName==="SELECT"||w.closest("button")||w.closest("input")||w.closest("textarea")||w.closest("select"))){f.current=!0,p.current=!1,h.current=!1,m.current={x:I.clientX,y:I.clientY,offsetLeft:c.left,offsetTop:c.top},s==null||s(I);try{w.setPointerCapture(I.pointerId)}catch{}}},[c.left,c.top,s]),R=r.useCallback(I=>{if(!f.current)return;const w=I.clientX-m.current.x,P=I.clientY-m.current.y;if(!p.current){if(!(Math.abs(w)>=un||Math.abs(P)>=un))return;p.current=!0,i==null||i(I)}const j={left:m.current.offsetLeft+w,top:m.current.offsetTop+P};x(j),a==null||a(j,I)},[a,i]),C=r.useCallback(I=>{if(!f.current)return;f.current=!1;const w=I.target;w.hasPointerCapture(I.pointerId)&&w.releasePointerCapture(I.pointerId),p.current&&(p.current=!1,h.current=!0,l==null||l(I))},[l]),z=c.left!==0||c.top!==0;return t?{dragTriggerProps:{"data-drag-trigger":!0,onPointerDown:T,onPointerMove:R,onPointerUp:C,onPointerCancel:C,style:{cursor:"grab",userSelect:"none",touchAction:"none"}},dragOffset:c,resetDragOffset:b,hasDragged:z,consumeDragClick:v}:{dragTriggerProps:{},dragOffset:{left:0,top:0},resetDragOffset:b,hasDragged:!1,consumeDragClick:v}}function es({config:e,onClose:t,dragTriggerProps:s={},actions:i=[],activeTab:a,onTabChange:l,titleId:c}){var v;const x=ae(),{style:f,...p}=s,m=e.variant==="tabs"?e:null,b=(m==null?void 0:m.tabs.map(T=>({value:T.id,label:T.label})))??[];return n.jsxs(o.Group,{"data-testid":"popout-header",justify:"space-between",px:"sm",py:"xs",...p,style:{...f},children:[e.variant==="title"?n.jsx(o.Text,{id:c,"data-testid":"popout-header-title",size:"sm",fw:500,children:e.title}):n.jsxs(n.Fragment,{children:[n.jsx(o.VisuallyHidden,{id:c,children:((v=m==null?void 0:m.tabs[0])==null?void 0:v.label)??x.settings}),n.jsx(o.SegmentedControl,{"data-testid":"popout-header-tabs",data:b,value:a,onChange:T=>l==null?void 0:l(T),size:"xs"})]}),n.jsxs(o.Group,{gap:4,children:[i.map(T=>n.jsx(o.ActionIcon,{variant:"subtle",onClick:T.onClick,"aria-label":T.label,children:T.icon},T.id)),n.jsx(o.CloseButton,{"data-testid":"popout-header-close",onClick:t,"aria-label":x.closePanel})]})]})}function ts(e,t=document){return e===null?null:t.querySelector(`[data-popout-id="${e}"]`)}function pn(e,t,s){const{trigger:i,parent:a,panel:l}=s;if(e!==void 0){if(typeof e=="object")return e.current;switch(e){case"parent":return a??l??i;case"panel":return l??a??i;case"trigger":return i;default:{const c=e;throw new Error(`Unknown anchor target: ${String(c)}`)}}}return t==="x"?a??l??i:i??a??l}function ns(e,t){return e==="start"?he(t)?"right":"left":e==="end"?he(t)?"left":"right":e}function os(e,t,s=$n,i={}){const{placement:a="left",alignment:l="start",panelHeight:c=0,crossAnchorRect:x=e,direction:f="ltr"}=i;let p,h;switch(a){case"left":p=e.left-t-s,h=fn(x,l,c);break;case"right":p=e.right+s,h=fn(x,l,c);break;case"top":p=xn(x,l,t,f),h=e.top-c-s;break;case"bottom":p=xn(x,l,t,f),h=e.bottom+s;break;default:{const m=a;throw new Error(`Unknown placement: ${String(m)}`)}}return{left:p,top:h}}function fn(e,t,s){switch(t){case"start":return e.top;case"center":return e.top+e.height/2-s/2;case"end":return e.bottom-s;default:{const i=t;throw new Error(`Unknown alignment: ${String(i)}`)}}}function xn(e,t,s,i){switch(t){case"start":return he(i)?e.right-s:e.left;case"center":return e.left+e.width/2-s/2;case"end":return he(i)?e.left:e.right-s;default:{const a=t;throw new Error(`Unknown alignment: ${String(a)}`)}}}function is(e){var Ye,Se;const{width:t,height:s,header:i,label:a,children:l,anchorX:c,anchorY:x,placement:f="left",alignment:p="start",gap:h,actions:m,manageFocus:b=!0,onDragStart:v,onDrag:T,onDragEnd:R}=e,{isOpen:C,close:z,triggerRef:I,id:w,parentId:P,region:j}=Rt(),{getZIndex:L,portalContainer:D,register:V,unregister:G,bringToFront:N,zIndexVersion:$,closeDescendants:A}=Wi(),O=ki(),y=_e(),S=r.useId(),H=`popout-panel-${w}`,k=`popout-title-${S}`,[K,q]=r.useState(null),ge=r.useRef(!1),Q=r.useRef(null),le=r.useCallback(()=>{N(w)},[N,w]),{dragTriggerProps:ne,dragOffset:W,resetDragOffset:oe,hasDragged:Y,consumeDragClick:me}=Qi({isOpen:C,onPress:le,onDragStart:v,onDrag:T,onDragEnd:R}),be=(i==null?void 0:i.variant)==="tabs",Z=(i==null?void 0:i.variant)==="tabs"?i:null,fe=(Z==null?void 0:Z.defaultTab)??((Ye=Z==null?void 0:Z.tabs[0])==null?void 0:Ye.id),[Ue,Oe]=r.useState(fe),Ze=h??(P===null?0:Wn),Ve=r.useCallback((B,ee)=>{var te;Oe(B),(te=Z==null?void 0:Z.onTabChange)==null||te.call(Z,B,ee)},[Z]),de=r.useCallback(B=>{B.stopPropagation(),N(w),!me()&&A(w)},[A,N,me,w]),we=r.useCallback(B=>{A(w),z(B)},[A,z,w]),Ce=r.useRef(z);r.useEffect(()=>{Ce.current=z});const Re=r.useCallback(()=>{Ce.current()},[]);r.useEffect(()=>(C?V(w,Re,P,j):G(w),()=>{G(w)}),[C,w,V,G,Re,P,j]);const He=r.useCallback(()=>{const B={trigger:I.current,parent:ts(P),panel:(O==null?void 0:O.anchorRef.current)??null};return{inline:pn(c,"x",B),block:pn(x,"y",B)}},[I,P,O,c,x]),Ne=r.useCallback(()=>{var et;const{inline:B,block:ee}=He(),te=B??ee,ie=ee??B;if(!te||!ie)return;const ue=(et=Q.current)==null?void 0:et.getBoundingClientRect(),Ie=Math.max(t,(ue==null?void 0:ue.width)??0),M=Math.max(s??0,(ue==null?void 0:ue.height)??0),se=ns(f,y),Te=se==="top"||se==="bottom",dt=Te?ie:te,De=Te?te:ie,ce=os(dt.getBoundingClientRect(),Ie,Ze,{placement:se,alignment:p,panelHeight:M,crossAnchorRect:De.getBoundingClientRect(),direction:y});q(ke=>ke&&ke.left===ce.left&&ke.top===ce.top?ke:ce)},[He,t,s,f,p,Ze,y]);if(X.useIsomorphicEffect(()=>{if(!C){q(null);return}ge.current||(oe(),be&&Oe(fe)),Ne()},[C,Ne,oe,be,fe]),r.useEffect(()=>{if(!C)return;let B=0;const ee=()=>{B===0&&(B=requestAnimationFrame(()=>{B=0,Ne()}))},te=new ResizeObserver(ee),ie=new MutationObserver(ee),{inline:ue,block:Ie}=He();for(const se of new Set([ue,Ie].filter(Te=>Te!==null)))te.observe(se),ie.observe(se,{attributes:!0,attributeFilter:["style","class"]});Q.current&&te.observe(Q.current);const M=()=>{Y||ee()};return window.addEventListener("resize",M),window.addEventListener("scroll",M,!0),()=>{B!==0&&cancelAnimationFrame(B),te.disconnect(),ie.disconnect(),window.removeEventListener("resize",M),window.removeEventListener("scroll",M,!0)}},[C,Ne,He,Y]),r.useEffect(()=>{var B;if(b){if(C){const ee=setTimeout(()=>{var te;(te=Q.current)==null||te.focus()},0);return()=>{clearTimeout(ee)}}ge.current&&((B=I.current)==null||B.focus())}},[C,b,I]),r.useEffect(()=>{ge.current=C},[C]),!C||!D)return null;const $e=L(w),Je={left:((K==null?void 0:K.left)??0)+W.left,top:((K==null?void 0:K.top)??0)+W.top},ze=n.jsxs(o.Paper,{ref:Q,id:H,role:"dialog","aria-modal":"false","aria-labelledby":i?k:void 0,"aria-label":i?void 0:a,tabIndex:-1,radius:8,onClick:de,"data-testid":"popout-panel","data-popout-id":w,...P&&{"data-parent-id":P},style:{position:"fixed",left:Je.left,top:Je.top,minWidth:t,width:"min-content",...s!==void 0&&{minHeight:s},...K===null&&{visibility:"hidden"},zIndex:$e,backgroundColor:"var(--mantine-color-body)",border:"1px solid light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.12))",boxShadow:["0 1px 2px light-dark(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.4))","0 4px 8px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.35))","0 8px 16px light-dark(rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.25))"].join(", ")},children:[i?n.jsx(es,{config:i,onClose:we,dragTriggerProps:ne,activeTab:Ue,onTabChange:Ve,actions:m,titleId:k}):null,n.jsx(o.Box,{"data-testid":"popout-panel-content",children:be?(Se=Z==null?void 0:Z.tabs.find(B=>B.id===Ue))==null?void 0:Se.content:l})]});return jo.createPortal(ze,D)}function ss({children:e,action:t="toggle"}){const{open:s,toggle:i,triggerRef:a,isOpen:l,id:c}=Rt(),x=r.useCallback(h=>{if(h.stopPropagation(),t==="open"){s(h);return}i(h)},[t,s,i]);if(!r.isValidElement(e))throw new Error("PopoutTrigger requires a single valid React element as its child");const f=`popout-panel-${c}`,p=e;return r.cloneElement(p,{onClick:h=>{var m,b;(b=(m=p.props).onClick)==null||b.call(m,h),x(h)},ref:a,"data-popout-trigger":!0,"aria-expanded":l,"aria-controls":f,"aria-haspopup":"dialog"})}function rs({children:e,opened:t,defaultOpened:s,onOpenChange:i}){const a=$i(),l=(a==null?void 0:a.id)??null;return n.jsx(Xi,{parentId:l,opened:t,defaultOpened:s,onOpenChange:i,children:e})}const Ge=Object.assign(rs,{Trigger:ss,Panel:is,Content:Gi,Anchor:Mi}),as=r.forwardRef(function({icon:t,size:s="xs",...i},a){const{isOpen:l}=Rt();return n.jsx(o.ActionIcon,{ref:a,"data-testid":"popout-button",variant:l?"light":"subtle",size:s,c:l?void 0:"dimmed",...i,children:t})});function ao({children:e}){return n.jsx(Ki,{children:e})}const hn=4,gn=4,ls=2,cs=72,ds=54,us=220,mn=0,At=100,bn=9,yn=7,ps=/^#[0-9A-F]{6}$/iu,fs=1.1;function jt(e){const t=e==="start"?gn:0,s=e==="end"?gn:0;return{borderStartStartRadius:t,borderEndStartRadius:t,borderStartEndRadius:s,borderEndEndRadius:s}}function xs(){const e=Fe();return r.useMemo(()=>{var s;return((s=new Intl.NumberFormat(e).formatToParts(fs).find(i=>i.type==="decimal"))==null?void 0:s.value)??"."},[e])}function lo({color:e,defaultColor:t,opacity:s,defaultOpacity:i=At,onColorChange:a,onOpacityChange:l,onChange:c,label:x,showOpacity:f=!0,disabled:p=!1,disabledReason:h,onFocus:m,onBlur:b}){const v=ae(),T=Wt(),R=xs(),C=r.useId(),z=st({name:x,disabled:p,disabledReason:h}),[I,w]=X.useUncontrolled({value:e,defaultValue:void 0,finalValue:void 0,onChange:a}),[P,j]=X.useUncontrolled({value:s,defaultValue:void 0,finalValue:void 0,onChange:l}),L=I===void 0,D=P===void 0,V=L&&(!f||D),G=I??t,N=P??i,[$,A]=r.useState(G.replace("#","").toUpperCase()),[O,y]=r.useState(N);r.useEffect(()=>{A(G.replace("#","").toUpperCase())},[G]),r.useEffect(()=>{y(N)},[N]);const S=W=>{const oe=W.length===bn,Y=oe?W.slice(0,yn).toUpperCase():W.toUpperCase(),me=oe&&f,be=me?Zt(W.slice(yn,bn)):P;w(Y),me&&j(be),c==null||c(Y,be)},H=()=>`${G}${Jt(N)}`.toUpperCase(),k=W=>{A(W.currentTarget.value.toUpperCase())},K=W=>{const oe=$.toUpperCase(),Y=oe.startsWith("#")?oe:`#${oe}`;ps.test(Y)&&Y!==G?(w(Y,W),c==null||c(Y,P,W)):A(G.replace("#","").toUpperCase()),b==null||b(W)},q=W=>{y(W)},ge=W=>{const oe=typeof O=="string"?T(O):O;if(Number.isNaN(oe)){y(N),b==null||b(W);return}const Y=Math.min(At,Math.max(mn,oe));Y!==N&&(j(Y,W),c==null||c(I,Y,W)),y(Y),b==null||b(W)},Q=W=>{w(void 0,W),f&&j(void 0,W),c==null||c(void 0,f?void 0:P,W)},le=f?"middle":"end",ne=n.jsxs(o.Group,{"data-testid":"compact-color-input",gap:hn,wrap:"nowrap",title:x===void 0?z.title:void 0,"data-disabled":p?"true":void 0,children:[n.jsxs(o.Group,{gap:0,wrap:"nowrap",children:[n.jsxs(Ge,{children:[n.jsx(Ge.Trigger,{children:n.jsx(o.ActionIcon,{variant:"filled",size:u.CONTROL_HEIGHT,radius:0,style:{backgroundColor:"var(--mantine-color-default)",...jt("start")},"data-testid":"compact-color-input-swatch",disabled:p,"aria-label":v.colorSwatch,"aria-describedby":z.describedBy,children:n.jsx(o.ColorSwatch,{color:G,size:u.GLYPH,radius:ls,style:{border:`1px solid ${g.BORDER}`}})})}),n.jsx(Ge.Panel,{width:us,header:{variant:"title",title:x??v.colorPanelTitle},placement:"bottom",alignment:"start",gap:hn,children:n.jsx(Ge.Content,{children:n.jsx(o.ColorPicker,{format:"hexa",value:H(),onChange:S,swatches:[...qn]})})})]}),n.jsx(o.TextInput,{"data-testid":"compact-color-input-hex",disabled:p,description:z.description,value:$,onChange:k,onFocus:m,onBlur:K,"aria-label":v.colorHexValue,"data-is-default":L?"true":"false",w:cs,styles:{input:{...jt(le),fontFamily:"monospace",textTransform:"uppercase",...L?{fontStyle:"italic",color:g.CHROME}:{}},description:It}}),f&&n.jsxs(n.Fragment,{children:[n.jsx(o.Divider,{orientation:"vertical",color:g.BORDER,h:u.CONTROL_HEIGHT,my:0}),n.jsx(o.NumberInput,{"data-testid":"compact-color-input-opacity",disabled:p,description:z.description,value:O,onChange:q,onFocus:m,onBlur:ge,min:mn,max:At,decimalSeparator:R,hideControls:!0,suffix:"%","aria-label":v.opacity,"data-is-default":D?"true":"false",w:ds,styles:{input:{...jt("end"),textAlign:"end",...D?{fontStyle:"italic",color:g.CHROME}:{}},description:It}})]})]}),!V&&n.jsx(o.ActionIcon,{variant:"subtle",size:u.TRAIL,c:g.CHROME,"data-testid":"compact-color-input-reset",disabled:p,"aria-label":v.resetToDefault(x??v.colorGenericName),onClick:Q,children:n.jsx(re,{name:"reset",size:u.CHEVRON})}),z.description!==void 0&&n.jsx(o.VisuallyHidden,{id:z.describedBy,children:z.description})]});return x===void 0?ne:n.jsxs(o.Stack,{"data-testid":"compact-color-input-labelled",gap:0,role:"group","aria-labelledby":C,title:z.title,children:[n.jsx(o.Text,{id:C,"data-testid":"compact-color-input-label",size:"xs",c:g.CHROME,mb:1,lh:1.2,children:x}),ne]})}const bt=u.GUTTER,vn=4,hs=1,gs=1.2,ms="calc(-1 * var(--mantine-spacing-sm) - 1px)";function bs({label:e,actions:t,children:s,bleed:i=!1}){const a=r.useId(),l=t!=null;return n.jsxs(o.Box,{"data-testid":"control-group",role:"group","aria-labelledby":a,children:[n.jsx(o.Divider,{"data-testid":"control-group-divider",color:g.DIVIDER,size:hs,style:{marginBlockStart:bt,marginBlockEnd:0,marginInline:i?ms:void 0}}),n.jsxs(o.Box,{"data-testid":"control-group-header",style:{display:"flex",alignItems:"center",gap:vn,boxSizing:"border-box",paddingBlock:bt,paddingInline:bt},children:[n.jsx(o.Box,{component:"span",id:a,"data-testid":"control-group-label",title:e,style:{flex:"1 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--mantine-font-size-xs)",fontWeight:500,lineHeight:gs,color:g.VALUE},children:e}),l&&n.jsx(o.Box,{"data-testid":"control-group-actions",style:{display:"flex",alignItems:"center",gap:vn,flex:"0 0 auto"},children:t})]}),n.jsx(o.Stack,{"data-testid":"control-group-content",gap:0,px:bt,children:s})]})}function Le(e){const t=r.useRef(void 0);r.useEffect(()=>{process.env.NODE_ENV==="production"||e===void 0||t.current!==e&&(t.current=e,console.warn(e))},[e])}const wn=250,ys=4;function vs({name:e,bubbleId:t}){const{isOpen:s,open:i,close:a}=Rt();return n.jsx(Ge.Trigger,{action:"open",children:n.jsx(o.UnstyledButton,{type:"button",title:e,"aria-label":e,"aria-describedby":s?t:void 0,"data-testid":"info-circle",onMouseEnter:i,onMouseLeave:a,onFocus:i,onBlur:a,style:{flex:"0 0 auto",width:u.GLYPH,height:u.GLYPH,display:"inline-flex",alignItems:"center",justifyContent:"center",background:"transparent",color:g.CHROME,cursor:"default"},children:n.jsx(re,{name:"info",size:u.CHEVRON})})})}function co({children:e,label:t,opened:s,defaultOpened:i,onOpenChange:a}){const l=ae(),c=r.useId(),x=Yi()!==null,f=l.about(t),p=n.jsxs(Ge,{opened:s,defaultOpened:i,onOpenChange:a,children:[n.jsx(vs,{name:f,bubbleId:c}),n.jsx(Ge.Panel,{width:wn,label:f,placement:"bottom",alignment:"start",gap:ys,anchorX:"trigger",anchorY:"trigger",manageFocus:!1,children:n.jsx(o.Box,{id:c,w:wn,p:"xs",style:{fontSize:"var(--mantine-font-size-sm)",lineHeight:1.4,color:g.PROSE},children:e})})]});return x?p:n.jsx(ao,{children:p})}function lt(e){return e!=null&&e!==!1}function Ee({children:e}){return n.jsx(o.Box,{"data-testid":"trailing-slot",style:{flex:"0 0 auto",width:u.TRAIL,height:u.CONTROL_HEIGHT,display:"flex",alignItems:"center",justifyContent:"center"},children:e})}const uo=r.forwardRef(function(t,s){const{label:i,changed:a=!1,icon:l,onClick:c,disabled:x=!1,loading:f=!1,style:p,...h}=t,m=ae(),b=a?m.sectionHasConfiguredValues(i):i,v=a?g.VALUE:g.CHROME;return n.jsx(o.ActionIcon,{...h,ref:s,type:"button",variant:"subtle",color:"gray",size:u.TRAIL,radius:"sm",vars:()=>({root:{"--ai-color":v}}),title:b,"aria-label":b,"aria-busy":f,disabled:x,loading:f,"data-testid":"advanced-button","data-changed":a?"true":"false",onClick:c,style:{flex:"0 0 auto",...p},children:l??n.jsx(re,{name:"gear",size:u.GLYPH})})}),Lt=4,ws=1,Sn=6,Ss=12,Is=1.2;function Es(e){const{label:t,technicalName:s,opened:i,defaultOpened:a,onOpenChange:l,hasConfiguredValues:c=!1,empty:x=!1,onAdd:f,info:p,actions:h,children:m}=e,b=ae(),v=_e(),T=r.useId(),R=r.useId(),C=r.useId(),[z,I]=X.useUncontrolled({value:i,defaultValue:a,finalValue:!0,onChange:l}),w=!x&&r.Children.toArray(m).length>0,P=p!=null;Le(x||w?void 0:`ControlSection "${t}" was given no children, and it holds the rows of a section. Pass the rows, set "empty" to draw it as a single row with a "+", or do not render it: a section header whose chevron opens onto nothing is a dead end for the reader.`);const j=O=>{I(!z,O)},L=z?b.collapseSection(t):b.expandSection(t),D=b.addToSection(t),V=he(v)?"chevronLeft":"chevronRight",G={flex:"0 0 auto",width:u.GLYPH_SLOT,height:u.GLYPH_SLOT,display:"flex",alignItems:"center",justifyContent:"center",color:g.CHROME},N={display:"flex",alignItems:"center",gap:Lt,flex:"0 1 auto",minWidth:0,height:"100%",background:"transparent",textAlign:"start"},$=s===void 0?t:`${t} (${s})`,A=n.jsxs(o.Box,{component:"span",id:T,title:$,"data-testid":"control-section-name",style:{minWidth:0,fontSize:Ss,fontWeight:500,lineHeight:Is,color:x?g.CHROME:g.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[t,s===void 0?null:n.jsx(o.Box,{component:"span","data-testid":"control-section-technical-name",style:{fontWeight:400,color:g.CHROME},children:` (${s})`})]});return n.jsxs(o.Box,{role:"group","aria-labelledby":T,"aria-describedby":P?C:void 0,"data-testid":"control-section","data-empty":x?"true":void 0,children:[n.jsx(o.Divider,{"data-testid":"control-section-divider",color:g.DIVIDER,size:ws,my:0,mx:0}),n.jsxs(o.Box,{"data-testid":"control-section-header",style:{display:"flex",alignItems:"center",gap:Lt,boxSizing:"border-box",height:u.SECTION_HEADER,paddingInlineStart:u.PAD_LEFT,paddingInlineEnd:u.PAD_RIGHT},children:[w?n.jsxs(o.UnstyledButton,{type:"button","data-testid":"control-section-toggle","aria-label":L,"aria-expanded":z,"aria-controls":R,onClick:j,style:{...N,cursor:"pointer"},children:[n.jsx(o.Box,{"data-testid":"control-section-chevron-slot",style:G,children:n.jsx(re,{name:z?"chevronDown":V,size:u.CHEVRON})}),A]}):n.jsxs(o.Box,{style:N,children:[n.jsx(o.Box,{"data-testid":"control-section-chevron-slot",style:G}),A]}),c&&n.jsx(o.Box,{role:"img","aria-label":b.sectionHasConfiguredValues(t),"data-testid":"control-section-dot",style:{flex:"0 0 auto",width:Sn,height:Sn,borderRadius:"50%",background:g.ACCENT}}),P&&n.jsx(co,{label:t,children:p}),n.jsx(o.Box,{style:{flex:"1 1 auto"}}),h!=null&&n.jsx(o.Box,{"data-testid":"control-section-actions",style:{display:"flex",alignItems:"center",gap:Lt,flex:"0 0 auto"},children:h}),x&&f!==void 0&&n.jsx(Ee,{children:n.jsx(o.ActionIcon,{type:"button",variant:"subtle",size:u.CONTROL_HEIGHT,radius:"sm",c:g.CHROME,title:D,"aria-label":D,"data-testid":"control-section-add",onClick:f,children:n.jsx(re,{name:"plus",size:u.GLYPH})})})]}),P&&n.jsx(o.Box,{id:C,"data-testid":"control-section-description",hidden:!0,children:p}),w&&n.jsx(o.Collapse,{id:R,in:z,children:n.jsx(o.Box,{"data-testid":"control-section-content",style:{paddingInlineStart:u.PAD_LEFT,paddingInlineEnd:u.PAD_RIGHT,paddingBottom:u.SECTION_PAD_BOTTOM},children:n.jsx(o.Stack,{gap:0,children:m})})})]})}const _t="control-sub-group",In=4,Cs=10,Ts=1.2;function Rs(e){const{label:t,opened:s,defaultOpened:i,onOpenChange:a,children:l}=e,c=ae(),x=_e(),f=r.useRef(void 0),[p,h]=X.useUncontrolled({value:s,defaultValue:i,finalValue:!1,onChange:a}),m=r.useCallback(C=>{f.current=C},[]),b=r.useCallback(C=>{const z=f.current;f.current=void 0,h(C===_t,z)},[h]),v=p?c.collapseSection(t):c.expandSection(t);let T="chevronDown";p||(T=he(x)?"chevronLeft":"chevronRight");const R={item:{border:"none",background:"transparent"},control:{paddingInline:0,paddingBlock:0,minHeight:u.TOGGLE_PITCH,color:g.CHROME},label:{paddingBlock:0,fontSize:"var(--mantine-font-size-xs)",lineHeight:Ts,color:g.CHROME},chevron:{marginInlineStart:0,marginInlineEnd:In,color:g.CHROME},content:{paddingBlock:0,paddingInlineStart:u.GUTTER,paddingInlineEnd:0}};return n.jsx(o.Accordion,{"data-testid":"control-sub-group",value:p?_t:null,onChange:b,chevronPosition:"left",chevronSize:u.GLYPH_SLOT,disableChevronRotation:!0,chevron:n.jsx(re,{name:T,size:Cs}),styles:R,children:n.jsxs(o.Accordion.Item,{value:_t,"data-testid":"control-sub-group-item",children:[n.jsx(o.Accordion.Control,{"data-testid":"control-sub-group-control","aria-label":v,onClick:m,children:n.jsx(o.Box,{component:"span","data-testid":"control-sub-group-label",title:t,style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t})}),n.jsx(o.Accordion.Panel,{"data-testid":"control-sub-group-panel",children:n.jsx(o.Box,{"data-testid":"control-sub-group-content",style:{display:"flex",flexDirection:"column",gap:In},children:l})})]})})}function it(e){if("key"in e)return{source:"keyboard"};const t=e.nativeEvent;return typeof PointerEvent<"u"&&t instanceof PointerEvent?{source:t.pointerType===""?"keyboard":"pointer"}:{source:t.detail===0?"keyboard":"pointer"}}function zs(e){const t=ae();return r.useMemo(()=>({...t,...e}),[t,e])}const pe=-1;function ot(e,t,s){return Math.min(Math.max(e,t),s)}function Ps(e,t,s,i,a){const{rowCount:l,columnCount:c,pageSize:x}=s,f=l-1,p=c-1;if(c===0)return;const h=he(i)?"ArrowLeft":"ArrowRight",m=he(i)?"ArrowRight":"ArrowLeft";if(t===h)return{row:e.row,column:Math.min(e.column+1,p)};if(t===m)return{row:e.row,column:Math.max(e.column-1,0)};if(t==="ArrowDown")return{row:ot(e.row+1,pe,f),column:e.column};if(t==="ArrowUp")return{row:ot(e.row-1,pe,f),column:e.column};if(t==="Home")return a.jumpToEnd?{row:pe,column:0}:{row:e.row,column:0};if(t==="End")return a.jumpToEnd?{row:Math.max(f,pe),column:p}:{row:e.row,column:p};if(t==="PageDown")return{row:ot(Math.max(e.row,0)+x,0,Math.max(f,0)),column:e.column};if(t==="PageUp")return{row:ot(Math.max(e.row,0)-x,0,Math.max(f,0)),column:e.column}}function As(e,t){const s=t.rowCount-1,i=Math.max(t.columnCount-1,0);return{row:ot(e.row,pe,Math.max(s,pe)),column:ot(e.column,0,i)}}function yt(e,t){return e.row===t.row&&e.column===t.column}function js(e,t,s){const i=Math.min(t,s),a=Math.max(t,s);return e.slice(i,a+1)}function Ut(e,t){const s=new Set(e),i=[];for(const a of s)t.includes(a)||i.push(a);for(const a of t)s.has(a)&&i.push(a);return i}function Ls(e){const{ids:t,index:s,selected:i,anchor:a,modifiers:l,mode:c}=e,x=t[s];if(c==="none"||x===void 0)return{selected:[...i],anchor:a};if(c==="single")return{selected:[x],anchor:x};const f=a===void 0?-1:t.indexOf(a);if(l.extend&&f!==-1){const p=js(t,f,s);return{selected:l.toggle?Ut([...i,...p],t):p,anchor:a}}if(l.toggle){const p=new Set(i);return p.has(x)?p.delete(x):p.add(x),{selected:Ut(p,t),anchor:x}}return{selected:[x],anchor:x}}function _s(e,t,s){return s!=="multiple"?{selected:[...t],anchor:void 0}:{selected:Ut([...t,...e],e),anchor:e[0]}}function En(e,t){return e==null?"":typeof e=="string"?e:typeof e=="number"?Number.isFinite(e)?t.number.format(e):"":typeof e=="boolean"?e?t.yes:t.no:Number.isNaN(e.getTime())?"":t.date.format(e)}function Cn(e){return e==null?!0:typeof e=="number"?!Number.isFinite(e):e instanceof Date&&Number.isNaN(e.getTime())}function Os(e,t,s){const i=Cn(e),a=Cn(t);return i||a?i&&a?0:i?-1:1:typeof e=="number"&&typeof t=="number"?e-t:typeof e=="boolean"&&typeof t=="boolean"?e===t?0:e?1:-1:e instanceof Date&&t instanceof Date?e.getTime()-t.getTime():s.compare(String(e),String(t))}const Hs=xe.tableFeatures({columnFilteringFeature:xe.columnFilteringFeature,columnOrderingFeature:xe.columnOrderingFeature,columnVisibilityFeature:xe.columnVisibilityFeature,filteredRowModel:xe.createFilteredRowModel(),globalFilteringFeature:xe.globalFilteringFeature,rowSelectionFeature:xe.rowSelectionFeature,rowSortingFeature:xe.rowSortingFeature,sortedRowModel:xe.createSortedRowModel()}),Ns=320,Ds=8,ks=12,Ms=1.2,Gs="var(--mantine-primary-color-light)",Tn="mantine-focus-auto",Ot=[],Bs=[];function Rn(e){return e==="asc"?"ascending":e==="desc"?"descending":"none"}function Fs(e,t,s){return Math.min(Math.max(e,t),s)}function Us(e,t){const{data:s,columns:i,getRowId:a,label:l,labelledBy:c,labels:x,height:f=Ns,rowHeight:p=u.DATA_PITCH,headerHeight:h=u.CONTROL_HEIGHT,overscan:m=Ds,selectionMode:b="multiple",selectedIds:v,defaultSelectedIds:T,onSelectionChange:R,sorting:C,defaultSorting:z,onSortingChange:I,hiddenColumns:w,defaultHiddenColumns:P,onHiddenColumnsChange:j,columnOrder:L,defaultColumnOrder:D,onColumnOrderChange:V,filter:G,defaultFilter:N,onFilterChange:$,searchable:A=!1,onRowClick:O,onRowDoubleClick:y,onRowContextMenu:S,onFocus:H,onBlur:k,empty:K}=e,q=zs(x),ge=_e(),Q=Fe(),le=qe(),ne=eo({numeric:!0,sensitivity:"variant"}),W=r.useMemo(()=>new Intl.DateTimeFormat(Q),[Q]),oe=r.useMemo(()=>({number:le,date:W,yes:q.yes,no:q.no}),[le,W,q.yes,q.no]),[Y,me]=X.useUncontrolled({value:v,defaultValue:T,finalValue:Ot,onChange:(d,E)=>{R==null||R([...d],E)}}),[be,Z]=X.useUncontrolled({value:C,defaultValue:z,finalValue:Bs,onChange:(d,E)=>{I==null||I([...d],E)}}),[fe,Ue]=X.useUncontrolled({value:w,defaultValue:P,finalValue:Ot,onChange:(d,E)=>{j==null||j([...d],E)}}),[Oe,Ze]=X.useUncontrolled({value:L,defaultValue:D,finalValue:Ot,onChange:(d,E)=>{V==null||V([...d],E)}}),[Ve,de]=X.useUncontrolled({value:G,defaultValue:N,finalValue:"",onChange:(d,E)=>{$==null||$(d,E)}}),we=r.useMemo(()=>{const d=new Map;for(const E of i)d.set(E.id,E);return d},[i]),Ce=JSON.stringify(fe),Re=r.useMemo(()=>{const d=new Set(fe);return i.filter(E=>(E.filterable??!0)&&!d.has(E.id)).map(E=>E.id)},[i,Ce]),He=r.useMemo(()=>{const d=Ve.trim();if(d!=="")return{query:d.toLocaleLowerCase(Q),columnIds:Re}},[Ve,Q,Re]),Ne=r.useMemo(()=>[...s],[s]),$e=r.useMemo(()=>i.map(d=>({id:d.id,accessorFn:E=>d.value(E),enableSorting:d.sortable??!0,enableHiding:d.hideable??!0,enableGlobalFilter:d.filterable??!0,sortDescFirst:d.descendingFirst,sortFn:(E,_)=>Os(d.value(E.original),d.value(_.original),ne)})),[i,ne]),Je=JSON.stringify(be),Qe=r.useMemo(()=>be.map(d=>({id:d.id,desc:d.desc})),[Je]),We=r.useMemo(()=>{const d={};for(const E of fe)d[E]=!1;return d},[fe]),ze=r.useMemo(()=>{const d={};for(const E of Y)d[E]=!0;return d},[Y]),Ye=r.useMemo(()=>[...Oe],[Oe]),Se=r.useRef(void 0),B=xe.useTable({features:Hs,data:Ne,columns:$e,getRowId:a,enableRowSelection:b!=="none",enableMultiRowSelection:b==="multiple",getColumnCanGlobalFilter:()=>!0,globalFilterFn:(d,E,_)=>{const U=_;if(U===void 0||!U.columnIds.includes(E))return!1;const J=we.get(E);return J===void 0?!1:En(J.value(d.original),oe).toLocaleLowerCase(Q).includes(U.query)},state:{sorting:Qe,columnVisibility:We,columnOrder:Ye,rowSelection:ze,globalFilter:He},onSortingChange:d=>{const E=xe.functionalUpdate(d,Qe);Z(E.map(_=>({id:_.id,desc:_.desc})),Se.current)},onColumnVisibilityChange:d=>{const E=xe.functionalUpdate(d,We);Ue(Object.keys(E).filter(_=>!E[_]))},onColumnOrderChange:d=>{Ze(xe.functionalUpdate(d,Ye))},onRowSelectionChange:d=>{me(Object.keys(xe.functionalUpdate(d,ze)))}}),{rows:ee}=B.getRowModel(),te=B.getVisibleLeafColumns(),ie=ee.length,ue=te.length,Ie=r.useMemo(()=>ee.map(d=>d.id),[ee]),M=r.useRef(null),se=r.useRef(null),Te=Lo.useVirtualizer({count:ie,getScrollElement:()=>M.current,estimateSize:()=>p,getItemKey:d=>Ie[d]??d,overscan:m}),[dt,De]=r.useState({row:pe,column:0}),ce=r.useMemo(()=>As(dt,{rowCount:ie,columnCount:ue}),[dt,ie,ue]),et=r.useRef(!1),ke=r.useRef(void 0),Co=d=>{d.row>=0&&Te.scrollToIndex(d.row),et.current=!0,De(E=>yt(E,d)?E:d)};r.useLayoutEffect(()=>{var _;if(!et.current)return;const d=`[data-grid-row="${ce.row}"][data-grid-column="${ce.column}"]`,E=(_=se.current)==null?void 0:_.querySelector(d);E instanceof HTMLElement&&(et.current=!1,E.focus())});const nn=(d,E)=>{ke.current=d.anchor,!(d.selected.length===Y.length&&d.selected.every((U,J)=>U===Y[J]))&&me(d.selected,E)},ut=(d,E,_)=>{nn(Ls({ids:Ie,index:d,selected:Y,anchor:ke.current,modifiers:E,mode:b}),_)},on=(d,E,_)=>{const U=ee[d];U!==void 0&&(O==null||O(U.original,E,_))},To=(d,E)=>{d.getCanSort()&&(Se.current=E,d.toggleSorting(void 0,E.shiftKey&&d.getCanMultiSort()),Se.current=void 0)},Ro=()=>{var _;const d=((_=M.current)==null?void 0:_.clientHeight)??0,E=Math.floor((d===0?p*10:d)/p);return Math.max(1,E-1)},zo=d=>{const E=b==="multiple",_=d.ctrlKey||d.metaKey;if(E&&_&&(d.key==="a"||d.key==="A")){d.preventDefault(),nn(_s(Ie,Y,b),d);return}if(ce.row>=0&&(d.key===" "||d.key==="Enter")){d.preventDefault(),d.key===" "?ut(ce.row,{extend:d.shiftKey,toggle:!d.shiftKey},d):(ut(ce.row,{extend:!1,toggle:!1},d),on(ce.row,d,{source:"keyboard"}));return}const U=Ps(ce,d.key,{rowCount:ie,columnCount:ue,pageSize:Ro()},ge,{jumpToEnd:_});U!==void 0&&(d.preventDefault(),Co(U),E&&d.shiftKey&&U.row>=0&&U.row!==ce.row&&ut(U.row,{extend:!0,toggle:!1},d))};r.useImperativeHandle(t,()=>({scrollToRow:d=>{d>=0&&d<ie&&Te.scrollToIndex(d)},setColumnHidden:(d,E)=>{var _;(_=B.getColumn(d))==null||_.toggleVisibility(!E)},moveColumn:(d,E)=>{const _=B.getAllLeafColumns().map(J=>J.id),U=_.indexOf(d);U!==-1&&(_.splice(U,1),_.splice(Fs(E,0,_.length),0,d),B.setColumnOrder(_))},clearSelection:()=>{ke.current=void 0,me([])}}),[B,Te,ie,me]);const Po=te.reduce((d,E)=>{var _;return d+(((_=we.get(E.id))==null?void 0:_.width)??u.FIELD)},0),sn=(d,E)=>{const _=(d==null?void 0:d.width)??u.FIELD;return{flex:E===ue-1?`1 1 ${String(_)}px`:`0 0 ${String(_)}px`,minWidth:0,boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:(d==null?void 0:d.align)==="end"?"flex-end":"flex-start",paddingInline:u.GUTTER,outlineOffset:-2,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},pt=b!=="none",rn=q.rowsShown(le.format(ie),le.format(s.length)),Ao=()=>K!==void 0?K:s.length===0?q.noRows:q.noMatchingRows;return n.jsxs(o.Box,{"data-testid":"data-table",dir:he(ge)?"rtl":void 0,onFocus:H,onBlur:k,style:{display:"flex",flexDirection:"column",gap:u.TRAIL_GAP,width:"100%",color:g.VALUE},children:[A&&n.jsxs(o.Box,{style:{display:"flex",alignItems:"center",gap:u.GUTTER},children:[n.jsx(o.TextInput,{"data-testid":"data-table-search",size:"xs",type:"search","aria-label":q.search,placeholder:q.searchPlaceholder,value:Ve,onChange:d=>{de(d.currentTarget.value,d)},rightSection:Ve===""?void 0:n.jsx(o.ActionIcon,{"data-testid":"data-table-search-clear",variant:"subtle",size:u.CONTROL_HEIGHT,"aria-label":q.clearSearch,onClick:d=>{de("",d)},children:n.jsx(re,{name:"close",size:u.CHEVRON})}),rightSectionPointerEvents:"all",style:{flex:"1 1 auto",minWidth:0}}),n.jsx(o.Box,{component:"span","data-testid":"data-table-count","aria-hidden":"true",dir:"auto",style:{flex:"0 0 auto",fontSize:"var(--mantine-font-size-sm)",color:g.CHROME},children:rn})]}),n.jsxs(o.VisuallyHidden,{role:"status","aria-live":"polite",dir:"auto","data-testid":"data-table-status",children:[rn,pt&&Y.length>0?` ${q.rowsSelected(le.format(Y.length))}`:""]}),n.jsxs(o.Box,{ref:M,"data-testid":"data-table-viewport",style:{height:f,overflow:"auto",position:"relative",border:`1px solid ${g.BORDER}`,borderRadius:"var(--mantine-radius-sm)",background:g.PANEL},children:[n.jsxs(o.Table,{ref:se,role:"grid","aria-label":c===void 0&&l===void 0?q.dataTable:l,"aria-labelledby":c,"aria-rowcount":ie+1,"aria-colcount":ue,"aria-multiselectable":b==="multiple"?!0:void 0,onKeyDown:zo,stickyHeader:!0,tabularNums:!0,withRowBorders:!1,horizontalSpacing:0,verticalSpacing:0,highlightOnHover:pt,highlightOnHoverColor:g.SURFACE,style:{display:"grid",width:"100%",minWidth:Po,fontSize:ks,lineHeight:Ms},children:[n.jsx(o.Table.Thead,{style:{display:"grid",position:"sticky",insetBlockStart:0,zIndex:1,background:g.PANEL,borderBlockEnd:`1px solid ${g.DIVIDER}`},children:n.jsx(o.Table.Tr,{role:"row","aria-rowindex":1,style:{display:"flex",width:"100%",height:h},children:te.map((d,E)=>{const _=we.get(d.id),U=d.getCanSort(),J=d.getIsSorted(),ye=ce.row===pe&&ce.column===E,ft=J===!1?-1:d.getSortIndex(),xt=ye?0:-1,rt=n.jsxs(n.Fragment,{children:[n.jsx(o.Box,{component:"span","data-testid":"data-table-header-label",dir:"auto",title:_==null?void 0:_.header,style:{flex:"0 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:J===!1?void 0:g.VALUE},children:(_==null?void 0:_.header)??d.id}),J!==!1&&n.jsx(o.Box,{component:"span","data-testid":"data-table-sort-glyph","data-direction":Rn(J),"aria-hidden":"true",style:{flex:"0 0 auto",display:"flex",alignItems:"center",color:g.VALUE,transform:J==="asc"?"rotate(180deg)":void 0},children:n.jsx(re,{name:"chevronDown",size:u.CHEVRON})}),Qe.length>1&&ft>=0&&n.jsx(o.Box,{component:"span","data-testid":"data-table-sort-priority","aria-hidden":"true",style:{flex:"0 0 auto",fontSize:"var(--mantine-font-size-xs)",color:g.CHROME},children:le.format(ft+1)})]});return n.jsx(o.Table.Th,{scope:"col","data-testid":"data-table-header","aria-colindex":E+1,"aria-sort":U?Rn(J):void 0,"data-grid-row":U?void 0:pe,"data-grid-column":U?void 0:E,tabIndex:U?void 0:xt,className:U?void 0:Tn,onFocus:U?void 0:()=>{De(Pe=>yt(Pe,{row:pe,column:E})?Pe:{row:pe,column:E})},style:{...sn(_,E),gap:u.GUTTER/2,height:h,fontSize:"var(--mantine-font-size-sm)",fontWeight:500,color:g.CHROME,textAlign:"start"},children:U?n.jsx(o.UnstyledButton,{type:"button","data-testid":"data-table-sort-button","data-grid-row":pe,"data-grid-column":E,tabIndex:xt,onClick:Pe=>{De({row:pe,column:E}),To(d,Pe)},onFocus:()=>{De(Pe=>yt(Pe,{row:pe,column:E})?Pe:{row:pe,column:E})},style:{display:"flex",alignItems:"center",gap:u.GUTTER/2,justifyContent:(_==null?void 0:_.align)==="end"?"flex-end":"flex-start",flex:"1 1 auto",minWidth:0,height:"100%",background:"transparent",color:"inherit",font:"inherit",textAlign:"start",outlineOffset:-2,cursor:"pointer"},children:rt}):rt},d.id)})})}),n.jsx(o.Table.Tbody,{style:{display:"grid",position:"relative",height:Te.getTotalSize()},children:Te.getVirtualItems().map(d=>{const E=ee[d.index];if(E===void 0)return null;const _=Y.includes(E.id);return n.jsx(o.Table.Tr,{role:"row","data-testid":"data-table-row","data-index":d.index,"data-selected":_?"true":void 0,"aria-rowindex":d.index+2,"aria-selected":pt?_:void 0,onDoubleClick:U=>{y==null||y(E.original,U)},onContextMenu:U=>{S==null||S(E.original,U)},style:{display:"flex",position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:p,transform:`translateY(${String(d.start)}px)`,background:_?Gs:void 0,cursor:pt?"pointer":void 0},children:te.map((U,J)=>{const ye=we.get(U.id),ft=ce.row===d.index&&ce.column===J,xt=ye==null?void 0:ye.value(E.original),rt=En(xt,oe),Pe=(ye==null?void 0:ye.cell)===void 0?n.jsx(o.Box,{component:"span",dir:"auto",style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:rt}):ye.cell(E.original);return n.jsx(o.Table.Td,{role:"gridcell","data-testid":"data-table-cell","aria-colindex":J+1,"data-grid-row":d.index,"data-grid-column":J,tabIndex:ft?0:-1,className:Tn,title:(ye==null?void 0:ye.cell)===void 0?rt:void 0,onFocus:()=>{De(Ae=>yt(Ae,{row:d.index,column:J})?Ae:{row:d.index,column:J})},onClick:Ae=>{De({row:d.index,column:J}),ut(d.index,{extend:Ae.shiftKey,toggle:Ae.metaKey||Ae.ctrlKey},Ae),on(d.index,Ae,it(Ae))},style:sn(ye,J),children:Pe},U.id)})},E.id)})})]}),ie===0&&n.jsx(o.Box,{"data-testid":"data-table-empty",style:{display:"flex",alignItems:"center",justifyContent:"center",padding:u.PAD_LEFT,fontSize:"var(--mantine-font-size-sm)",color:g.CHROME},children:Ao()})]})]})}const Vs=r.forwardRef(Us);function $s(){return crypto.randomUUID().slice(0,8)}function Et(e,t){return{id:$s(),offset:e,color:t}}function po(){return[Et(0,"#6366F1"),Et(1,"#06B6D4")]}const Ws=2,Ys=5,Xs=80,Ks=0,Ht=100,Nt=0,qs=360,Zs=[0,90,180,270,360];function Js({stops:e,defaultStops:t,direction:s,defaultDirection:i=Nt,showDirection:a=!0,onChange:l,onChangeStart:c,onChangeEnd:x,minStops:f=Ws,maxStops:p=Ys}){const h=ae(),m=qe({maximumFractionDigits:0}),b=r.useId(),v=r.useId(),T=r.useMemo(()=>po(),[]),[R,C]=X.useUncontrolled({value:e,defaultValue:t,finalValue:T,onChange:(A,O)=>{l==null||l(A,z,O)}}),[z,I]=X.useUncontrolled({value:s,defaultValue:i,finalValue:Nt,onChange:(A,O)=>{l==null||l(R,A,O)}}),w=r.useRef(!1),P=A=>{w.current||(w.current=!0,c==null||c(A))},j=(A,O)=>{w.current=!1,x==null||x(A,O)},L=(A,O)=>R.map((y,S)=>S===A?{...y,color:O}:y),D=(A,O)=>R.map((y,S)=>S===A?{...y,offset:O/Ht}:y),V=A=>{if(R.length>=p)return;const O=R[R.length-1],y=O===void 0?.5:(O.offset+1)/2,S=[...R,Et(y,St)];S.sort((H,k)=>H.offset-k.offset),C(S,A)},G=(A,O)=>{R.length<=f||C(R.filter((y,S)=>S!==A),O)},N=R.length>=p,$=R.length<=f;return n.jsxs(o.Stack,{"data-testid":"gradient-editor",gap:"xs",children:[n.jsxs(o.Group,{justify:"space-between",align:"center",children:[n.jsx(o.Text,{id:b,"data-testid":"gradient-editor-heading",size:"xs",c:g.CHROME,children:h.colorStops}),n.jsx(o.ActionIcon,{variant:"subtle",color:"gray",size:u.TRAIL,"data-testid":"gradient-editor-add-stop",onClick:V,disabled:N,"aria-label":h.addColorStop,children:n.jsx(re,{name:"plus",size:u.CHEVRON})})]}),n.jsx(o.Stack,{"data-testid":"gradient-editor-stops",gap:"xs",role:"group","aria-labelledby":b,children:R.map((A,O)=>{const y=m.format(O+1);return n.jsxs(o.Group,{"data-testid":"gradient-editor-stop",gap:"xs",align:"flex-end",wrap:"nowrap",children:[n.jsx(lo,{color:A.color,defaultColor:St,onColorChange:(S,H)=>{C(L(O,S??St),H)},showOpacity:!1}),n.jsx(o.Box,{style:{width:Xs},children:n.jsx(o.Slider,{"data-testid":"gradient-editor-stop-position",min:Ks,max:Ht,value:A.offset*Ht,onPointerDown:P,onChange:S=>{P(),C(D(O,S))},onChangeEnd:S=>{j(D(O,S),z)},label:S=>h.percent(m.format(S)),thumbLabel:h.colorStopPosition(y)})}),n.jsx(o.ActionIcon,{variant:"subtle",color:"gray",size:u.TRAIL,onClick:S=>{G(O,S)},"data-testid":"gradient-editor-remove-stop",disabled:$,"aria-label":h.removeColorStop(y),children:n.jsx(re,{name:"minus",size:u.CHEVRON})})]},A.id)})}),a&&n.jsxs(o.Box,{"data-testid":"gradient-editor-direction",pb:"md",role:"group","aria-labelledby":v,children:[n.jsx(o.Text,{id:v,"data-testid":"gradient-editor-direction-heading",size:"xs",c:g.CHROME,mb:4,children:h.direction}),n.jsx(o.Slider,{"data-testid":"gradient-editor-direction-slider",min:Nt,max:qs,value:z,onPointerDown:P,onChange:A=>{P(),I(A)},onChangeEnd:A=>{j(R,A)},label:A=>h.degrees(m.format(A)),thumbLabel:h.gradientDirection,marks:Zs.map(A=>({value:A,label:h.degrees(m.format(A))}))})]})]})}const Qs=4,er=2,tr=1.1;function nr(){const e=Fe();return r.useMemo(()=>{var s;return((s=new Intl.NumberFormat(e).formatToParts(tr).find(i=>i.type==="decimal"))==null?void 0:s.value)??"."},[e])}function or({label:e,value:t,defaultValue:s,onChange:i,min:a,max:l,step:c,decimalScale:x,suffix:f,hideControls:p=!0,disabled:h=!1,disabledReason:m,onFocus:b,onBlur:v}){const T=ae(),R=st({name:e,disabled:h,disabledReason:m}),C=Wt(),z=nr(),[I,w]=X.useUncontrolled({value:t,defaultValue:void 0,finalValue:void 0,onChange:i}),P=I===void 0,j=I??s,[L,D]=r.useState(j),V=r.useRef(!1);r.useEffect(()=>{V.current||D(I??s),V.current=!1},[I,s]);const G=A=>{V.current=!0,D(A)},N=A=>{const O=typeof L=="string"?C(L):L;if(Number.isNaN(O)){D(I??s),v==null||v(A);return}let y=O;a!==void 0&&y<a&&(y=a),l!==void 0&&y>l&&(y=l),y!==I&&w(y,A),D(y),v==null||v(A)},$=A=>{w(void 0,A)};return n.jsxs(o.Group,{"data-testid":"style-number-input",gap:Qs,wrap:"nowrap",align:"flex-end",title:R.title,"data-disabled":h?"true":void 0,children:[n.jsx(o.NumberInput,{"data-testid":"style-number-input-field",label:e,description:R.description,value:L,onChange:G,onFocus:b,onBlur:N,min:a,max:l,step:c,decimalScale:x,decimalSeparator:z,suffix:f,hideControls:p,disabled:h,"data-is-default":P?"true":"false",styles:{input:P?{fontStyle:"italic",color:g.CHROME}:void 0,description:It},style:{flex:1}}),!P&&n.jsx(o.ActionIcon,{variant:"subtle",size:u.TRAIL,c:g.CHROME,"data-testid":"style-number-input-reset",disabled:h,"aria-label":T.resetToDefault(e),onClick:$,style:{marginBlockEnd:er},children:n.jsx(re,{name:"reset",size:u.CHEVRON})})]})}const ir=4,sr=2;function rr({label:e,value:t,defaultValue:s,options:i,onChange:a,disabled:l=!1,disabledReason:c,onFocus:x,onBlur:f}){const p=ae(),h=st({name:e,disabled:l,disabledReason:c}),[m,b]=X.useUncontrolled({value:t,defaultValue:void 0,finalValue:void 0,onChange:a}),v=m===void 0,T=m??s,R=z=>{z!==null&&b(z)},C=z=>{b(void 0,z)};return n.jsxs(o.Group,{"data-testid":"style-select",gap:ir,wrap:"nowrap",align:"flex-end",title:h.title,"data-disabled":l?"true":void 0,children:[n.jsx(o.Select,{"data-testid":"style-select-field",label:e,description:h.description,value:T,onChange:R,onFocus:x,onBlur:f,data:i,rightSection:n.jsx(re,{name:"chevronDown",size:u.GLYPH}),rightSectionPointerEvents:"none",disabled:l,"data-is-default":v?"true":"false",allowDeselect:!1,styles:{input:v?{fontStyle:"italic",color:g.CHROME}:void 0,description:It},style:{flex:1}}),!v&&n.jsx(o.ActionIcon,{variant:"subtle",size:u.TRAIL,c:g.CHROME,"data-testid":"style-select-reset",disabled:l,"aria-label":p.resetToDefault(e),onClick:C,style:{marginBlockEnd:sr},children:n.jsx(re,{name:"reset",size:u.CHEVRON})})]})}const vt=4,ar=`${String(u.TOGGLE_PITCH)}px`;function lr({label:e,checked:t,defaultChecked:s,onChange:i,disabled:a=!1,disabledReason:l,bound:c=!1,boundDescription:x,onFocus:f,onBlur:p,children:h}){const m=r.useId(),b=ae(),[v,T]=X.useUncontrolled({value:t,defaultValue:s,finalValue:!1,onChange:i}),R=P=>{T(P.currentTarget.checked,P)},C={root:{minWidth:0},body:{alignItems:"center",minWidth:0},labelWrapper:{minWidth:0},label:{display:"block",height:u.TOGGLE_PITCH,paddingInlineStart:vt,fontSize:"var(--mantine-font-size-sm)",lineHeight:ar,color:a?g.DISABLED:g.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},z=x??b.fieldBound,I=st({name:e,enabledTitle:e,disabled:a,disabledReason:l,extraDescriptions:c?[z]:void 0}),w=n.jsx(o.Checkbox,{"data-testid":"toggle-with-content-checkbox",label:e,checked:v,disabled:a,"aria-expanded":v,"aria-controls":v?m:void 0,"aria-describedby":I.describedBy,onChange:R,onFocus:f,onBlur:p,wrapperProps:{title:I.title},styles:C});return n.jsxs(o.Box,{"data-testid":"toggle-with-content","data-checked":v?"true":"false","data-disabled":a?"true":void 0,"data-bound":c?"true":void 0,style:{display:"flex",flexDirection:"column",gap:vt},children:[c?n.jsxs(o.Box,{"data-testid":"toggle-with-content-row",style:{display:"flex",alignItems:"center",gap:vt},children:[w,n.jsx(o.Box,{component:"span","data-testid":"toggle-with-content-bound",style:{flex:"0 0 auto",display:"inline-flex",alignItems:"center",color:g.CHROME},children:n.jsx(Ke,{name:"attribute",filled:!0})})]}):w,I.description!==void 0&&n.jsx(o.VisuallyHidden,{id:I.describedBy,children:I.description}),v&&n.jsx(o.Box,{id:m,"data-testid":"toggle-with-content-children",style:{display:"flex",flexDirection:"column",gap:vt,paddingInlineStart:u.GUTTER},children:h})]})}function fo(e,t){return e!==void 0?e:t===void 0?"off":"polite"}function Be(e,t){const s=fo(e,t);return s==="off"?{"aria-busy":t}:{"aria-live":s,"aria-atomic":!0,"aria-busy":t}}const Dt=4,cr="(hover: none)";function dr(e){if(typeof e=="string")return e;if(typeof e=="number")return String(e)}function ur(e){const{state:t,stateTitle:s,busy:i,live:a,actions:l,residentActions:c,actionsVisible:x,disabled:f=!1,onClick:p,onFocus:h,onBlur:m}=e,b=Be(a,i),{hovered:v,ref:T}=X.useHover(),R=X.useMediaQuery(cr)??!1,[C,z]=r.useState(!1),I=r.useId(),w=C||(x??(v||R)),P=l!==void 0||c!==void 0,j=dr(t),L=s!==void 0&&s!==j,D=s??j,V=P&&t!==void 0,G=L?n.jsxs(n.Fragment,{children:[n.jsx("span",{"aria-hidden":"true",children:t}),n.jsx(o.VisuallyHidden,{"data-testid":"action-row-state-full",children:s})]}):t;Le(p!==void 0&&t===void 0?"ActionRow was given onClick but no state, and its own activation is carried by the text it reports. That text is also what names the row for a screen reader, so a row with nothing to report has nothing to activate. Give the row a state, or put the action on a control in actions.":void 0);const N=S=>{z(!0),h==null||h(S)},$=S=>{S.currentTarget.contains(S.relatedTarget)||z(!1),m==null||m(S)},A=S=>{f||p==null||p(S,it(S))},O={flex:"1 1 auto",minWidth:0,fontSize:"var(--mantine-font-size-sm)",lineHeight:1.2,color:f?g.DISABLED:g.CHROME,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},y={...O,alignSelf:"stretch",lineHeight:`${u.ROW_PITCH}px`,textAlign:"start",borderRadius:"var(--mantine-radius-sm)"};return n.jsxs(o.Box,{ref:T,"data-testid":"action-row",role:V?"group":void 0,"aria-labelledby":V?I:void 0,"aria-disabled":f||void 0,"data-disabled":f||void 0,onFocus:N,onBlur:$,style:{display:"flex",alignItems:"center",justifyContent:"space-between",boxSizing:"border-box",gap:u.TRAIL_GAP,height:u.ROW_PITCH},children:[t!==void 0&&(p===void 0?n.jsx(o.Box,{component:"span",id:I,"data-testid":"action-row-state",title:D,...b,style:O,children:G}):n.jsx(o.UnstyledButton,{type:"button",id:I,"data-testid":"action-row-state",title:D,...b,onClick:A,style:y,children:G})),P&&n.jsxs(o.Box,{"data-testid":"action-row-affordances",style:{flex:"0 0 auto",marginInlineStart:"auto",display:"flex",alignItems:"center",gap:Dt},children:[l!==void 0&&n.jsx(o.Box,{"data-testid":"action-row-actions","data-visible":w?"true":"false",style:{flex:"0 0 auto",display:"flex",alignItems:"center",gap:Dt,opacity:w?1:0,pointerEvents:w?void 0:"none"},children:l}),c!==void 0&&n.jsx(o.Box,{"data-testid":"action-row-resident-actions",style:{flex:"0 0 auto",display:"flex",alignItems:"center",gap:Dt},children:c})]})]})}const xo=u.GUTTER,pr=12,ho=1.2,fr=20,xr=500,hr="var(--mantine-primary-color-light)";function gr({name:e,value:t,icon:s,selected:i=!1,role:a="button",tabIndex:l,onClick:c,onDoubleClick:x,onContextMenu:f,onFocus:p,onBlur:h,trailing:m}){const{hovered:b,ref:v}=X.useHover(),T=c!==void 0,R=s!=null,C=t!=null,z=lt(m),I=a==="option",w=I?i:void 0,P=!I&&i?!0:void 0,j=G=>{c==null||c(G,it(G))};let L="transparent";i?L=hr:T&&b&&(L=g.SURFACE);const D=n.jsxs(n.Fragment,{children:[R&&n.jsx(o.Box,{component:"span","data-testid":"data-row-icon",style:{flex:"0 0 auto",width:u.GLYPH_SLOT,height:u.GLYPH_SLOT,display:"flex",alignItems:"center",justifyContent:"center",color:g.CHROME},children:s}),n.jsx(o.Box,{component:"span","data-testid":"data-row-name",title:e,style:{flex:"1 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),C&&n.jsx(o.Box,{component:"span","data-testid":"data-row-value",style:{flex:"0 0 auto",fontSize:"var(--mantine-font-size-sm)",color:g.CHROME},children:t})]}),V={display:"flex",alignItems:"center",gap:u.GUTTER,flex:"1 1 auto",minWidth:0,height:"100%",background:"transparent",color:"inherit",font:"inherit",textAlign:"start",cursor:T?"pointer":"default"};return n.jsxs(o.Box,{ref:v,"data-testid":"data-row","data-selected":i?"true":void 0,onDoubleClick:x,onContextMenu:f,style:{display:"flex",alignItems:"center",gap:u.TRAIL_GAP,boxSizing:"border-box",width:"100%",height:u.DATA_PITCH,paddingInline:xo,borderRadius:"var(--mantine-radius-sm)",background:L,color:g.VALUE,fontSize:pr,lineHeight:ho},children:[T?n.jsx(o.UnstyledButton,{type:"button","data-testid":"data-row-button",role:I?"option":void 0,"aria-current":P,"aria-selected":w,tabIndex:l,onClick:j,onFocus:p,onBlur:h,style:V,children:D}):n.jsx(o.Box,{"data-testid":"data-row-body",role:I?"option":void 0,"aria-current":P,"aria-selected":w,tabIndex:l,onFocus:p,onBlur:h,style:V,children:D}),z&&n.jsx(Ee,{children:m})]})}function mr({label:e,unit:t,sortDirection:s,defaultSortDirection:i,onSortChange:a,sortPriority:l}){const[c,x]=X.useUncontrolled({value:s,defaultValue:i,finalValue:"none",onChange:a}),f=qe(),p=a!==void 0,h=c!=="none",m=T=>{x(c==="ascending"?"descending":"ascending",T)},b=n.jsxs(n.Fragment,{children:[n.jsx(o.Box,{component:"span","data-testid":"data-row-header-label",title:e,style:{flex:"1 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:h?g.VALUE:void 0},children:e}),t!==void 0&&n.jsx(o.Box,{component:"span","data-testid":"data-row-header-unit",style:{flex:"0 0 auto",whiteSpace:"nowrap"},children:t}),l!==void 0&&h&&n.jsx(o.Box,{component:"span","aria-hidden":"true",style:{flex:"0 0 auto",display:"flex"},children:n.jsx(tn,{children:f.format(l)})}),h&&n.jsx(o.Box,{component:"span","data-testid":"data-row-header-sort-glyph","data-direction":c,style:{flex:"0 0 auto",display:"flex",alignItems:"center",color:g.VALUE,transform:c==="ascending"?"rotate(180deg)":void 0},children:n.jsx(re,{name:"chevronDown",size:u.CHEVRON})})]}),v=p||h;return n.jsx(o.Box,{"data-testid":"data-row-header",role:v?"columnheader":void 0,"aria-sort":v?c:void 0,style:{display:"flex",alignItems:"center",gap:u.GUTTER,boxSizing:"border-box",width:"100%",height:fr,paddingInline:xo,fontSize:"var(--mantine-font-size-sm)",lineHeight:ho,color:g.CHROME},children:p?n.jsx(o.UnstyledButton,{type:"button","data-testid":"data-row-header-sort",onClick:m,style:{display:"flex",alignItems:"center",gap:u.GUTTER,flex:"1 1 auto",minWidth:0,height:"100%",background:"transparent",color:"inherit",font:"inherit",textAlign:"start",cursor:"pointer"},children:b}):b})}function tn({children:e}){return n.jsx(o.Badge,{component:"span","data-testid":"rank-chip",style:{flex:"0 0 auto",background:g.RAISED,color:g.VALUE,fontWeight:xr,textTransform:"none",letterSpacing:"normal"},children:e})}const zn=2,br=1,yr=13,vr=2,wr=1,Sr=1,Ir=64,go=4,Pn=go/2,mo=4,Er=12,Xe=100,Cr=1.5,Vt=100;function Ct({children:e,end:t,id:s}){return n.jsx(o.Box,{component:"span",id:s,"data-testid":`chart-axis-${t}`,style:{flex:"0 0 auto",minWidth:0,fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:g.CHROME,whiteSpace:"nowrap"},children:e})}function bo(){return n.jsx(o.Box,{"data-testid":"chart-baseline",style:{flex:"0 0 auto",height:br,background:g.BORDER}})}function yo({caption:e,rows:t,testId:s}){return n.jsxs(o.VisuallyHidden,{component:"table","data-testid":s,children:[e!==void 0&&n.jsx("caption",{children:e}),n.jsx("tbody",{children:t.map(i=>n.jsxs("tr",{children:[n.jsx("th",{scope:"row",children:i.header}),n.jsx("td",{children:i.value})]},i.id))})]})}function Tr(e,t){if(e.length===0)return null;const s=Xe/2;if(e.length===1)return`0,${s} ${Xe},${s}`;const i=Math.min(...e),l=Math.max(...e)-i,c=e.length-1;return e.map((x,f)=>{const p=Zi(f/c,Xe,t),h=l===0?s:Xe-(x-i)/l*Xe;return`${p},${h}`}).join(" ")}function vo(){const e=r.useId(),t=`${e}min`,s=`${e}max`;return{min:t,max:s,describedBy:`${t} ${s}`}}function Rr({bins:e,label:t,minLabel:s,maxLabel:i,busy:a,live:l,trailing:c}){const x=qe(),f=vo(),p=e.reduce((m,b)=>Math.max(m,b.count,0),0),h=e.map((m,b)=>({id:`${m.label}-${String(b)}`,header:m.label,value:x.format(m.count)}));return n.jsxs(o.Box,{"data-testid":"histogram-row","aria-busy":a,style:{display:"flex",alignItems:"flex-start",gap:u.TRAIL_GAP,height:u.HISTOGRAM_HEIGHT},children:[n.jsxs(o.Box,{"data-testid":"histogram-chart",...Be(l,a),style:{flex:"1 1 auto",minWidth:0,height:"100%",display:"flex",flexDirection:"column",gap:zn},children:[n.jsxs(o.Box,{"data-testid":"histogram-drawing",role:t===void 0?void 0:"img","aria-label":t,"aria-describedby":t===void 0?void 0:f.describedBy,"aria-hidden":t===void 0?!0:void 0,style:{flex:"1 1 auto",minHeight:0,display:"flex",flexDirection:"column",gap:zn},children:[n.jsx(o.Box,{"data-testid":"histogram-plot",style:{flex:"1 1 auto",minHeight:0,display:"flex",alignItems:"flex-end",gap:vr},children:e.map((m,b)=>{const v=Math.max(0,m.count),T=p===0?0:v/p*Vt,R=m.highlighted===!0;return n.jsx(o.Box,{"data-testid":"histogram-bar","data-highlighted":R?"true":"false","aria-hidden":"true",title:m.label,style:{flex:"1 1 0",minWidth:0,height:`${String(T)}%`,minHeight:v>0?Sr:0,background:R?g.ACCENT:g.BORDER,borderRadius:wr}},`${m.label}-${String(b)}`)})}),n.jsx(bo,{})]}),n.jsxs(o.Box,{"data-testid":"chart-axis",style:{flex:"0 0 auto",height:yr,display:"flex",alignItems:"center",justifyContent:"space-between",gap:mo},children:[n.jsx(Ct,{end:"min",id:f.min,children:s}),n.jsx(Ct,{end:"max",id:f.max,children:i})]})]}),n.jsx(yo,{caption:t,rows:h,testId:"histogram-values"}),lt(c)&&n.jsx(Ee,{children:c})]})}function zr({values:e,label:t,minLabel:s,maxLabel:i,busy:a,live:l,trailing:c}){const x=_e(),f=qe(),p=vo(),h=Tr(e,x),m=e.map((b,v)=>({id:`point-${String(v)}`,header:f.format(v+1),value:f.format(b)}));return n.jsxs(o.Box,{"data-testid":"sparkline-row","aria-busy":a,style:{display:"flex",alignItems:"center",gap:u.TRAIL_GAP,height:u.SPARKLINE_HEIGHT},children:[n.jsxs(o.Box,{"data-testid":"sparkline-chart",...Be(l,a),style:{flex:"1 1 auto",minWidth:0,display:"flex",alignItems:"center",gap:mo},children:[n.jsx(Ct,{end:"min",id:p.min,children:s}),n.jsxs(o.Box,{"data-testid":"sparkline-drawing",role:t===void 0?void 0:"img","aria-label":t,"aria-describedby":t===void 0?void 0:p.describedBy,"aria-hidden":t===void 0?!0:void 0,style:{flex:"1 1 auto",minWidth:0,display:"flex",flexDirection:"column",color:g.BORDER},children:[n.jsx(o.Box,{component:"svg","data-testid":"sparkline-plot",width:"100%",height:u.CONTROL_HEIGHT,viewBox:`0 0 ${String(Xe)} ${String(Xe)}`,preserveAspectRatio:"none",fill:"none",stroke:"currentColor",strokeWidth:Cr,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",style:{display:"block",overflow:"visible"},children:h!==null&&n.jsx("polyline",{points:h,vectorEffect:"non-scaling-stroke"})}),n.jsx(bo,{})]}),n.jsx(Ct,{end:"max",id:p.max,children:i})]}),n.jsx(yo,{caption:t,rows:m,testId:"sparkline-values"}),lt(c)&&n.jsx(Ee,{children:c})]})}function Pr({name:e,percentile:t,value:s,rank:i,busy:a,live:l,onClick:c,onDoubleClick:x,onContextMenu:f,onFocus:p,onBlur:h}){const m=ae(),b=Qn(),v=r.useId(),T=c,R=T!==void 0,C=Math.min(Vt,Math.max(0,t)),z=m.percentile(b(Math.round(C))),I=P=>{T!==void 0&&T(P,it(P))},w=P=>{T!==void 0&&(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),T(P,it(P)))};return n.jsxs(o.Box,{"data-testid":"metric-row",role:R?"button":void 0,tabIndex:R?0:void 0,...Be(l,a),onClick:I,onKeyDown:w,onDoubleClick:x,onContextMenu:f,onFocus:p,onBlur:h,style:{display:"flex",alignItems:"center",gap:u.GUTTER,height:u.ROW_PITCH,cursor:R?"pointer":"default"},children:[n.jsx(o.Box,{component:"span",id:v,"data-testid":"metric-row-name",title:e,style:{flex:"1 1 auto",minWidth:0,fontSize:Er,lineHeight:1.2,color:g.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),n.jsx(o.Progress.Root,{"data-testid":"metric-row-bar",role:"progressbar","aria-labelledby":v,"aria-valuemin":0,"aria-valuemax":Vt,"aria-valuenow":C,"aria-valuetext":z,title:z,size:go,style:{flex:`0 0 ${String(Ir)}px`,borderRadius:Pn,background:g.SURFACE},children:n.jsx(o.Progress.Section,{"data-testid":"metric-row-fill",value:C,withAria:!1,color:g.ACCENT,style:{borderRadius:Pn}})}),n.jsx(o.Box,{component:"span","data-testid":"metric-row-value",style:{flex:"0 0 auto",fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:g.VALUE},children:s}),i!==void 0&&n.jsx(tn,{children:i})]})}const wo=r.createContext(!1);function So({showLabels:e=!1,children:t}){return n.jsx(wo.Provider,{value:e,children:t})}function ct(){return r.useContext(wo)}const Ar=u.VALUE_INSET-u.GLYPH_SLOT,jr=2,Lr=1,_r=2,Or=3;function Hr(e){if(e.fullValue!==void 0)return e.fullValue;if(typeof e.value=="string")return e.value;if(typeof e.value=="number")return String(e.value)}function Nr({segment:e,grow:t,index:s}){const{glyph:i,value:a,unit:l,mono:c=!1}=e;let x=null;Yt(i)?x=n.jsx(Ke,{name:i}):Xt(i)?x=n.jsx(o.Box,{component:"span","data-letter":i,style:{fontSize:"var(--mantine-font-size-sm)",lineHeight:1},children:i}):i!=null&&(x=i);const f=Hr(e),p=e.fullValue!==void 0;return n.jsxs(o.Box,{"data-testid":"compound-segment","data-segment-index":s,"data-grow":t?"true":"false",style:{display:"flex",alignItems:"center",boxSizing:"border-box",flex:t?"1 1 auto":"0 0 auto",minWidth:0,height:u.CONTROL_HEIGHT,paddingBlock:0,paddingInline:Ar},children:[x!==null&&n.jsx(o.Box,{"data-testid":"compound-segment-slot",style:{flex:"0 0 auto",width:u.GLYPH_SLOT,height:u.GLYPH_SLOT,display:"flex",alignItems:"center",justifyContent:"center",color:g.CHROME},children:x}),n.jsx(o.Box,{component:"span","data-testid":"compound-segment-value","data-mono":c?"true":"false",title:f,"aria-hidden":p?!0:void 0,style:{flex:t?"1 1 auto":"0 0 auto",minWidth:0,fontFamily:c?"var(--mantine-font-family-monospace)":void 0,fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:g.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",unicodeBidi:"isolate"},children:a}),p&&n.jsx(o.VisuallyHidden,{children:e.fullValue}),l!==void 0&&n.jsx(o.Box,{component:"span","data-testid":"compound-segment-unit",style:{flex:"0 0 auto",marginInlineStart:jr,fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:g.CHROME},children:l})]})}function Dr(e,t){if(!(t>=_r&&t<=Or))return`CompoundRow "${e}" was given ${String(t)} ${t===1?"segment":"segments"}, and it holds two or three. A compound row shows one value together with the parts that belong to it: use PanelField for a single value, and a table or a list of rows for more than three.`}function kr(e,t){if(t!==1)return`CompoundRow "${e}" was given ${String(t)} segments that set grow, and exactly one should. The segment that sets grow takes the box's leftover width and should be the main value, with the rest sized to their content. Using the first segment that sets it, or the leading segment when none does.`}function Mr({label:e,segments:t,width:s=u.BODY,trailing:i,busy:a,live:l,onClick:c,onFocus:x,onBlur:f}){const p=ct(),h=r.useId(),m=t.filter(L=>L.grow===!0).length;Le(Dr(e,t.length)),Le(kr(e,m));const b=t.findIndex(L=>L.grow===!0),v=b===-1?0:b,T=c!==void 0,R=fo(l,a)!=="off",C=T||R,z=T?void 0:h,I=C?void 0:h,w=C||p,P={display:"flex",alignItems:"center",boxSizing:"border-box",flex:p?"1 1 auto":"0 0 auto",width:p?void 0:s,minWidth:0,height:u.CONTROL_HEIGHT,background:g.SURFACE,borderRadius:"var(--mantine-radius-sm)",overflow:"hidden",textAlign:"start",cursor:T?"pointer":void 0},j=n.jsxs(n.Fragment,{children:[C&&n.jsx(o.VisuallyHidden,{id:z,children:e}),t.map((L,D)=>n.jsxs(r.Fragment,{children:[D>0&&n.jsx(o.Box,{"data-testid":"compound-row-hairline",style:{flex:"0 0 auto",width:Lr,height:u.CONTROL_HEIGHT,background:g.PANEL}}),n.jsx(Nr,{segment:L,grow:D===v,index:D})]},D))]});return n.jsxs(o.Box,{"data-testid":"compound-row",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:u.TRAIL_GAP,height:u.ROW_PITCH},children:[p&&n.jsx(o.Box,{component:"span",id:I,"data-testid":"compound-row-label",title:e,"aria-hidden":C?!0:void 0,style:{flex:`0 0 ${u.LABEL_COLUMN}px`,fontSize:"var(--mantine-font-size-sm)",lineHeight:1.2,color:g.CHROME,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),T?n.jsx(o.UnstyledButton,{type:"button",title:e,"data-testid":"compound-row-box","data-interactive":"true",...Be(l,a),onClick:c,onFocus:x,onBlur:f,style:P,children:j}):n.jsx(o.Box,{role:"group","aria-label":w?void 0:e,"aria-labelledby":w?h:void 0,title:e,"data-testid":"compound-row-box","data-interactive":"false",...Be(l,a),onFocus:x,onBlur:f,style:P,children:j}),n.jsx(Ee,{children:i})]})}const kt=u.VALUE_INSET-u.GLYPH_SLOT,wt=4,An=4,Gr=u.VALUE_INSET+u.LABEL_COLUMN,jn={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0},Io=r.forwardRef(function(t,s){const{label:i,glyph:a,kind:l,value:c,defaultValue:x,onChange:f,data:p,unit:h,width:m=u.FIELD,bound:b=!1,mixed:v=!1,placeholder:T,pending:R=!1,min:C,max:z,step:I,onScrubStart:w,onScrub:P,onScrubEnd:j,onClick:L,disabled:D=!1,readOnly:V,boundDescription:G,pendingDescription:N,title:$,style:A,className:O,onKeyDown:y,...S}=t,H=ct(),k=ae(),K=_e(),q=X.useMediaQuery("(pointer: coarse)"),[ge,Q]=X.useUncontrolled({value:c===null?"":c,defaultValue:x,finalValue:"",onChange:f}),le=l??(p!==void 0?"select":"text"),ne=le==="select",W=le==="select"&&p!==void 0,oe=V??(f===void 0&&x===void 0),Y=String(ge),me=T===!0,be=v||me;let Z;v?Z=k.mixed:me?Z=Y:typeof T=="string"&&(Z=T);const fe=[];v&&fe.push(k.mixed);const Ue=G??k.fieldBound,Oe=N??k.fieldPending;b&&Ue!==""&&fe.push(Ue),R&&Oe!==""&&fe.push(Oe);const Ze=fe.length>0?fe.join(". "):void 0,de=(w!==void 0||P!==void 0||j!==void 0)&&!D&&!q,we=r.useRef(!1),Ce=r.useRef(!1),Re=r.useRef(0),He=M=>{if(!de||M.button!==0)return;M.preventDefault(),M.stopPropagation();const se=M.currentTarget;typeof se.setPointerCapture=="function"&&se.setPointerCapture(M.pointerId),we.current=!0,Ce.current=!1,Re.current=M.clientX},Ne=M=>{if(!we.current)return;const se=M.clientX-Re.current;se!==0&&(Re.current=M.clientX,Ce.current||(Ce.current=!0,w==null||w(M)),P==null||P(he(K)?-se:se,M))},$e=M=>{we.current&&(we.current=!1,Ce.current&&(Ce.current=!1,j==null||j(M)))},Je=M=>{D||L==null||L(M)},Qe=M=>{y==null||y(M),!(L===void 0||D||M.defaultPrevented)&&(W||(M.key==="Enter"||M.key===" "&&oe)&&(M.preventDefault(),L(M)))},We=(M,se)=>{Q(M,se)};let ze=null;Yt(a)?ze=n.jsx(Ke,{name:a,filled:b}):Xt(a)?ze=n.jsx(o.Box,{component:"span","data-letter":a,style:{fontSize:"var(--mantine-font-size-sm)",lineHeight:1},children:a}):a!=null&&(ze=a);const Ye=n.jsxs(n.Fragment,{children:[n.jsxs(o.Box,{"data-testid":"panel-field-slot","data-scrub":de?"true":void 0,onPointerDown:de?He:void 0,onPointerMove:de?Ne:void 0,onPointerUp:de?$e:void 0,onPointerCancel:de?$e:void 0,onLostPointerCapture:de?$e:void 0,style:{position:"relative",flex:"0 0 auto",width:u.GLYPH_SLOT,height:u.GLYPH_SLOT,display:"flex",alignItems:"center",justifyContent:"center",color:g.CHROME,cursor:de?"ew-resize":void 0,touchAction:de?"none":void 0},children:[ze,R&&n.jsx(o.Box,{"data-testid":"panel-field-pending",style:{position:"absolute",insetInlineStart:0,bottom:0,width:An,height:An,background:g.ACCENT}})]}),H&&n.jsx(o.Box,{component:"span","data-testid":"panel-field-label","aria-hidden":"true",style:{flex:"1 1 auto",minWidth:0,marginInlineStart:wt,fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:g.CHROME,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i})]}),Se=h!==void 0,B=Se||ne?n.jsxs(n.Fragment,{children:[Se&&n.jsx(o.Box,{component:"span","data-testid":"panel-field-unit",style:{flex:"0 0 auto",lineHeight:1},children:h}),ne&&n.jsx(o.Box,{component:"span","data-testid":"panel-field-chevron",style:{flex:"0 0 auto",display:"flex",alignItems:"center",marginInlineStart:Se?wt:0},children:n.jsx(re,{name:"chevronDown",size:u.GLYPH})})]}):void 0;let ee=kt+wt;ne&&(ee+=u.GLYPH),ne&&Se&&(ee+=wt);const te=B===void 0?void 0:`calc(${String((h==null?void 0:h.length)??0)}ch + ${String(ee)}px)`,ie=de?"auto":"none",Ie={"data-testid":"panel-field-value",...S,ref:s,className:O,label:i,description:Ze,placeholder:Z,disabled:D,readOnly:oe,onClick:Je,onKeyDown:Qe,leftSection:Ye,leftSectionWidth:H?Gr:u.VALUE_INSET,leftSectionPointerEvents:ie,leftSectionProps:{style:{insetInlineStart:0,justifyContent:"flex-start",paddingInlineStart:kt}},rightSection:B,rightSectionWidth:te,rightSectionPointerEvents:"none",rightSectionProps:{style:{insetInlineEnd:0,justifyContent:"flex-end",paddingInlineEnd:kt,fontSize:"var(--mantine-font-size-sm)",color:g.CHROME}},styles:{wrapper:{marginTop:0,marginBottom:0,"--input-placeholder-color":v?g.VALUE:g.PLACEHOLDER},input:{backgroundColor:g.SURFACE,paddingInlineStart:void 0,paddingInlineEnd:void 0},label:jn,description:jn},wrapperProps:{title:$??i,"data-testid":"panel-field","data-kind":le,"data-bound":b?"true":void 0,"data-mixed":v?"true":void 0,"data-pending":R?"true":void 0,"data-disabled":D?"true":void 0},style:{flex:m==="fill"?"1 1 auto":"0 0 auto",width:m==="fill"?"100%":m,minWidth:0,...A}};return le==="number"?n.jsx(o.NumberInput,{...Ie,value:be?"":ge,onChange:We,min:C,max:z,step:I,hideControls:!0}):W?n.jsx(o.Select,{...Ie,data:p,value:be||Y===""?null:Y,onChange:M=>{We(M??"")}}):n.jsx(o.TextInput,{...Ie,value:be?"":Y,onChange:M=>{We(M.currentTarget.value,M)}})}),Br=2,Fr=u.BODY+u.TRAIL_GAP;function Ur(e){return r.Children.toArray(e).flatMap(t=>r.isValidElement(t)&&t.type===r.Fragment?r.Children.toArray(t.props.children):[t])}function Ln(e,t){return r.isValidElement(e)&&e.key!==null?e.key:`field-row-${String(t)}`}function Vr(e){if(r.isValidElement(e)&&typeof e.props.label=="string")return e.props.label}function _n(e){return r.isValidElement(e)&&e.type===Io?r.cloneElement(e,{width:"fill"}):e}const $r=r.forwardRef(function({children:t,trailing:s,groupLabel:i,role:a,style:l,"aria-label":c,"aria-labelledby":x,...f},p){const h=ct(),m=Ur(t),b=m.length;Le(b===0||b>Br?`FieldRow was given ${String(b)} ${b===1?"field":"fields"}, and it holds one field, or two side by side. A row with none is an empty 32px gap, and a third field has nowhere to go in the 280px panel the row is measured for. Put the extra fields on rows of their own.`:void 0);const v=i??c,R=a??(v!==void 0||x!==void 0?"group":void 0),C=lt(s);if(h&&b>1)return n.jsx(o.Box,{ref:p,"data-testid":"field-row-labelled","data-fields":b,role:R,"aria-label":v,"aria-labelledby":x,...f,style:{display:"flex",flexDirection:"column",...l},children:m.map((j,L)=>{const D=Vr(j);return n.jsxs(o.Box,{"data-testid":"field-row","data-labelled":"true",style:{display:"flex",alignItems:"center",height:u.ROW_PITCH},children:[n.jsx(o.Box,{component:"span","data-testid":"field-row-label",title:D,style:{flex:`0 0 ${String(u.LABEL_COLUMN)}px`,minWidth:0,fontSize:"var(--mantine-font-size-sm)",lineHeight:1.2,color:g.CHROME,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:D}),n.jsx(o.Box,{"data-testid":"field-row-slot","data-width":"fill",style:{display:"flex",alignItems:"center",flex:"1 1 auto",minWidth:0,marginInlineStart:u.GUTTER,marginInlineEnd:u.TRAIL_GAP},children:n.jsx(So,{showLabels:!1,children:_n(j)})}),n.jsx(Ee,{children:L===0?s:null})]},Ln(j,L))})});const z=b<=1,I=z&&!C;let w=u.FIELD;z&&(w=I?Fr:u.BODY);const P=I?void 0:u.TRAIL_GAP;return n.jsxs(o.Box,{ref:p,"data-testid":"field-row","data-fields":b,role:R,"aria-label":v,"aria-labelledby":x,...f,style:{display:"flex",alignItems:"center",height:u.ROW_PITCH,...l},children:[m.map((j,L)=>n.jsx(o.Box,{"data-testid":"field-row-slot","data-width":w,style:{display:"flex",alignItems:"center",flex:`0 0 ${String(w)}px`,minWidth:0,marginInlineStart:L===0?void 0:u.GUTTER,marginInlineEnd:L===b-1?P:void 0},children:_n(j)},Ln(j,L))),n.jsx(Ee,{children:s})]})}),Wr=2,Yr=6,Eo=1,Xr=u.CONTROL_HEIGHT-Eo*2,Kr=2,On=3,qr=4,Zr=6,Jr=u.GLYPH,Qr=3;function ea(e,t){return t?g.DISABLED:e?g.ON_SELECTED:g.CHROME}function ta(e){const{options:t,value:s,defaultValue:i,onChange:a,label:l,labelledBy:c,name:x,disabled:f=!1,disabledReason:p,hybrid:h=!1,width:m,trailing:b,onFocus:v,onBlur:T}=e,R=ct(),C=t.length,z=st({name:l,disabled:f,disabledReason:p}),[I]=t,[w,P]=X.useUncontrolled({value:s,defaultValue:i,finalValue:I===void 0?"":I.value,onChange:a}),j=r.useRef(void 0);Le(C<Wr||C>Yr?`IconGroupRow was given ${String(C)} ${C===1?"option":"options"}, and it holds two to six drawable ones. One option is a statement rather than a choice and belongs in a field, and more than six stop reading as a set of drawings -- use a select instead. Rendering them anyway.`:void 0);const L=m??(C<=Qr?u.FIELD:u.BODY),D=L==="fill",V=N=>{var y;if(f||N.key!=="Home"&&N.key!=="End")return;const $=t.filter(S=>S.disabled!==!0),A=N.key==="Home"?$[0]:$[$.length-1];if(A===void 0)return;N.preventDefault(),P(A.value,N),(y=Array.from(N.currentTarget.querySelectorAll('input[type="radio"]')).find(S=>S.value===A.value))==null||y.focus()},G=t.map(N=>{const $=N.value===w,A=f||N.disabled===!0,O=R||h&&$;return{value:N.value,disabled:N.disabled,label:n.jsxs(o.Box,{component:"span","data-testid":"icon-group-button","data-value":N.value,"data-active":$?"true":"false",title:N.label,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",gap:O?qr:0,paddingInline:O?Zr:0,width:"100%",minWidth:0,color:ea($,A)},children:[n.jsx(o.Box,{component:"span","data-testid":"icon-group-icon",style:{flex:"0 0 auto",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:N.icon}),O?n.jsx(o.Box,{component:"span","data-testid":"icon-group-word",style:{minWidth:0,fontWeight:500,lineHeight:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:N.label}):n.jsx(o.VisuallyHidden,{children:N.label})]})}});return n.jsxs(o.Box,{"data-testid":"icon-group-row",title:z.title,"data-disabled":f?"true":void 0,style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:u.TRAIL_GAP,height:u.ROW_PITCH},children:[n.jsx(o.SegmentedControl,{data:G,value:w,onChange:N=>{const $=j.current;j.current=void 0,P(N,$)},onChangeCapture:N=>{j.current=N},onKeyDown:V,onFocus:v,onBlur:T,name:x,disabled:f,radius:"sm","aria-label":l,"aria-labelledby":c,"aria-describedby":z.describedBy,"data-testid":"icon-group-track","data-hybrid":h?"true":void 0,__vars:{"--sc-color":g.SELECTED,"--sc-shadow":"none"},styles:{root:{boxSizing:"border-box",flex:D?"1 1 auto":"0 0 auto",width:D?"100%":L,minWidth:0,height:u.CONTROL_HEIGHT,padding:Eo,gap:Kr,backgroundColor:g.SURFACE,overflow:"visible"},control:{flex:"1 1 auto",minWidth:Jr},label:{display:"flex",alignItems:"center",justifyContent:"center",height:Xr,padding:0,borderRadius:On,fontSize:"var(--mantine-font-size-sm)"},innerLabel:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",minWidth:0},indicator:{backgroundColor:g.SELECTED,borderRadius:On,boxShadow:"none"}}}),z.description!==void 0&&n.jsx(o.VisuallyHidden,{id:z.describedBy,children:z.description}),n.jsx(Ee,{children:b})]})}const na=12,oa=1.5,Hn=1.4,Nn=4,ia=20,Dn=220,kn=2,Mn=new RegExp("\\p{Sentence_Terminal}","u"),sa=/[.!?]/u,Gn=/\s/u;function ra(e){const t=Array.from(e);let s=0,i=0,a=0;for(;i<t.length;){if(!Mn.test(t[i])){i+=1;continue}let c=i;for(;c+1<t.length&&Mn.test(t[c+1]);)c+=1;const x=t[c+1],f=sa.test(t[c]);i=c+1,(!f||x===void 0||Gn.test(x))&&(s+=1,a=i)}return t.slice(a).some(c=>!Gn.test(c))?s+1:s}function aa(e){return Array.from(e).length}function la(e,t){if(e!=="reading"||typeof t!="string")return;const s=aa(t);if(s>Dn)return`ProseBlock was given a reading of ${String(s)} characters, and a reading is at most ${String(Dn)} characters. Shorten it, or it has stopped being a reading and become an explanation.`;const i=ra(t);if(i>kn)return`ProseBlock was given a reading of ${String(i)} sentences, and a reading is at most ${String(kn)} sentences. Delete any sentence that repeats what is already on screen, and move the rest into an InfoCircle.`}function ca(e,t){if(!(t===void 0||e==="runRecord"))return`ProseBlock was given onDetails on the "${e}" shape, and it belongs to "runRecord". A reading and a departure line carry no chevron, so the handler is ignored.`}function da({variant:e,children:t,onDetails:s,busy:i,live:a}){const l=ae(),c=_e(),x=r.useId();Le(la(e,t)),Le(ca(e,s));const f=Be(a,i);if(e==="reading")return n.jsx(o.Text,{...f,"data-testid":"prose-block","data-variant":e,style:{fontSize:na,lineHeight:oa,color:g.PROSE},children:t});if(e==="departure")return n.jsxs(o.Box,{...f,role:"note","aria-label":l.departure,"data-testid":"prose-block","data-variant":e,style:{display:"flex",alignItems:"flex-start",gap:Nn},children:[n.jsx(o.Box,{"aria-hidden":!0,"data-testid":"prose-block-warning",style:{flex:"0 0 auto",inlineSize:u.GLYPH_SLOT,blockSize:u.GLYPH_SLOT,display:"flex",alignItems:"center",justifyContent:"center",color:g.WARNING},children:n.jsx(re,{name:"warning",size:u.GLYPH})}),n.jsx(o.Text,{span:!0,size:"sm","data-testid":"prose-block-text",style:{lineHeight:Hn,color:g.VALUE},children:t})]});const p=typeof t=="string"?t:void 0;return n.jsxs(o.Box,{...f,"data-testid":"prose-block","data-variant":e,style:{display:"flex",alignItems:"center",gap:Nn,blockSize:ia},children:[n.jsx(o.Text,{span:!0,size:"sm",truncate:"end",id:x,title:p,"data-testid":"prose-block-text",style:{flex:"1 1 auto",minInlineSize:0,lineHeight:Hn,color:g.CHROME},children:t}),s!==void 0&&n.jsx(o.UnstyledButton,{type:"button",title:l.details,"aria-label":l.details,"aria-describedby":x,"data-testid":"prose-block-details",onClick:s,style:{flex:"0 0 auto",inlineSize:u.GLYPH_SLOT,blockSize:u.GLYPH_SLOT,display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",background:"transparent",color:g.CHROME,cursor:"pointer"},children:n.jsx(re,{name:he(c)?"chevronLeft":"chevronRight",size:u.CHEVRON})})]})}const Mt=4,ua=4,pa=`polygon(0 calc(100% - ${ua}px), 100% 0, 100% 100%, 0 100%)`,fa=120,xa=`linear-gradient(to right, ${g.SURFACE}, ${g.ACCENT})`,ha={sqrt:"scaleSqrt",linear:"scaleLinear",log:"scaleLog"},Bn={flex:"0 0 auto",lineHeight:1,color:g.CHROME,whiteSpace:"nowrap"};function ga({min:e,max:t,label:s,variant:i="size",gradient:a,scale:l,busy:c,live:x,onScaleClick:f,trailing:p}){const h=ae(),m=_e(),b=r.useId(),v=i==="color",T=l===void 0?void 0:ha[l],R=T===void 0?void 0:h[T],C=`${b}-label`,z=`${b}-min`,I=`${b}-max`,w=`${b}-scale`,P=[s===void 0?void 0:C,z,I,R===void 0?void 0:w].filter(D=>D!==void 0);let j=null;T!==void 0&&R!==void 0&&(f===void 0?j=n.jsx(o.Box,{"data-testid":"ramp-row-scale","aria-hidden":"true",title:R,style:{flex:"0 0 auto",width:u.TRAIL,height:u.CONTROL_HEIGHT,display:"flex",alignItems:"center",justifyContent:"center",color:g.CHROME},children:n.jsx(Ke,{name:T})}):j=n.jsx(uo,{label:R,icon:n.jsx(Ke,{name:T}),onClick:f}));const L=lt(p)?p:j;return n.jsxs(o.Box,{"data-testid":"ramp-row","data-variant":i,"data-scale":l,style:{display:"flex",alignItems:"center",gap:Mt,height:u.ROW_PITCH},children:[n.jsxs(o.Box,{"data-testid":"ramp-row-figure",role:"img","aria-labelledby":P.join(" "),...Be(x,c),style:{flex:"1 1 auto",minWidth:0,display:"flex",alignItems:"center",gap:Mt},children:[s!==void 0&&n.jsx(o.VisuallyHidden,{"data-testid":"ramp-row-a11y-label",id:C,children:s}),n.jsx(o.Text,{span:!0,size:"sm",id:z,"data-testid":"ramp-row-min",style:Bn,children:e}),n.jsx(o.Box,{"data-testid":"ramp-row-ramp","data-variant":i,"aria-hidden":"true",style:{flex:"1 1 auto",minWidth:fa,height:u.GLYPH,boxSizing:"border-box",background:v?a??xa:g.CHROME,borderRadius:v?"var(--mantine-radius-xs)":void 0,border:v?`1px solid ${g.BORDER}`:void 0,clipPath:v?void 0:pa,...Ji(m)}}),n.jsx(o.Text,{span:!0,size:"sm",id:I,"data-testid":"ramp-row-max",style:Bn,children:t}),R!==void 0&&n.jsx(o.VisuallyHidden,{"data-testid":"ramp-row-a11y-scale",id:w,children:R})]}),n.jsx(o.Box,{style:{flex:"0 0 auto",display:"flex",marginInlineStart:u.TRAIL_GAP-Mt},children:n.jsx(Ee,{children:L})})]})}const ma=4,ba=`${String(u.TOGGLE_PITCH)}px`,ya=2;function va({label:e,checked:t,defaultChecked:s,onChange:i,control:a="checkbox",trailing:l,disabled:c=!1,disabledReason:x,bound:f=!1,boundDescription:p,onFocus:h,onBlur:m}){const b=ae(),[v,T]=X.useUncontrolled({value:t,defaultValue:s,finalValue:!1,onChange:i}),R=j=>{T(j.currentTarget.checked,j)},C={root:{flex:"1 1 auto",minWidth:0},body:{alignItems:"center",minWidth:0},labelWrapper:{minWidth:0},label:{display:"block",height:u.TOGGLE_PITCH,paddingInlineStart:ma,fontSize:"var(--mantine-font-size-sm)",lineHeight:ba,color:c?g.DISABLED:g.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},z=p??b.fieldBound,I=st({name:e,enabledTitle:e,disabled:c,disabledReason:x,extraDescriptions:f?[z]:void 0}),w={title:I.title},P=f?n.jsx(o.Box,{component:"span","data-testid":"toggle-row-bound",style:{flex:"0 0 auto",display:"inline-flex",alignItems:"center",color:g.CHROME},children:n.jsx(Ke,{name:"attribute",filled:!0})}):null;return n.jsxs(o.Box,{"data-testid":"toggle-row","data-control":a,"data-checked":v?"true":"false","data-disabled":c?"true":void 0,"data-bound":f?"true":void 0,style:{display:"flex",alignItems:"center",boxSizing:"border-box",gap:u.TRAIL_GAP,height:u.TOGGLE_PITCH},children:[a==="switch"?n.jsx(o.Switch,{"data-testid":"toggle-row-control",label:e,checked:v,disabled:c,"aria-describedby":I.describedBy,onChange:R,onFocus:h,onBlur:m,wrapperProps:w,styles:C}):n.jsx(o.Checkbox,{"data-testid":"toggle-row-control",label:e,checked:v,disabled:c,"aria-describedby":I.describedBy,onChange:R,onFocus:h,onBlur:m,wrapperProps:w,styles:C}),I.description!==void 0&&n.jsx(o.VisuallyHidden,{id:I.describedBy,children:I.description}),P,n.jsx(Ee,{children:l})]})}function wa({children:e,label:t,labelledBy:s}){const i=r.Children.toArray(e).length;return Le(i<ya?`ToggleRowGroup was given ${String(i)} ${i===1?"row":"rows"}, and it holds two or more. A single checkbox on a row of its own interrupts a column of rows to say one bit: put it in the trailing slot of the row it modifies, or make it one tile of a group of icon buttons. Rendering it anyway.`:void 0),n.jsx(o.Box,{role:"group","aria-label":s===void 0?t:void 0,"aria-labelledby":s,"data-testid":"toggle-row-group","data-rows":i,style:{display:"flex",flexDirection:"column"},children:e})}function Sa(e="dark"){return o.useComputedColorScheme(e)}const Ia={xs:o.rem(4),sm:o.rem(8),md:o.rem(16),lg:o.rem(24),xl:o.rem(32)},Ea={HEIGHT:24,FONT_SIZE:11,CONTROL_PADDING:8,SECTION_GAP:4};exports.ActionRow=ur;exports.AdvancedButton=uo;exports.COMPACT_SIZING=Ea;exports.CompactColorInput=lo;exports.CompoundRow=Mr;exports.ControlGroup=bs;exports.ControlSection=Es;exports.ControlSubGroup=Rs;exports.DEFAULT_GRADIENT_STOP_COLOR=St;exports.DataRow=gr;exports.DataRowHeader=mr;exports.DataTable=Vs;exports.FIELD_GLYPH_NAMES=to;exports.FIELD_LETTERS=no;exports.FieldGlyph=Ke;exports.FieldRow=$r;exports.GradientEditor=Js;exports.HistogramRow=Rr;exports.IconGroupRow=ta;exports.InfoCircle=co;exports.LabelsProvider=Ii;exports.MANTINE_SPACING=Ia;exports.MAX_ALPHA_HEX=Kt;exports.MAX_OPACITY_PERCENT=qt;exports.MetricRow=Pr;exports.PANEL_GRID=u;exports.PANEL_INK=g;exports.POPOUT_GAP=$n;exports.POPOUT_NESTED_GAP=Wn;exports.POPOUT_Z_INDEX_BASE=Gt;exports.PanelField=Io;exports.PanelLabelsProvider=So;exports.Popout=Ge;exports.PopoutButton=as;exports.PopoutManager=ao;exports.PopoutRegion=Vi;exports.ProseBlock=da;exports.RampRow=ga;exports.RankChip=tn;exports.SWATCH_COLORS_HEXA=qn;exports.SparklineRow=zr;exports.StyleNumberInput=or;exports.StyleSelect=rr;exports.ToggleRow=va;exports.ToggleRowGroup=wa;exports.ToggleWithContent=lr;exports.TrailingSlot=Ee;exports.UI_GLYPH_NAMES=ji;exports.UiGlyph=re;exports.compactColors=Un;exports.compactDarkColors=Fn;exports.compactTheme=vi;exports.compactThemeOverride=Kn;exports.createColorStop=Et;exports.createDefaultGradientStops=po;exports.defaultLabels=Zn;exports.getActivationMeta=it;exports.isFieldGlyphName=Yt;exports.isFieldLetter=Xt;exports.isRtl=he;exports.isValidHex=Ni;exports.opacityToAlphaHex=Jt;exports.parseAlphaFromHexa=Zt;exports.parseHexaColor=Oi;exports.parseLocaleNumber=Jn;exports.toHexaColor=Hi;exports.useActualColorScheme=Sa;exports.useCollator=eo;exports.useDirection=_e;exports.useLabels=ae;exports.useLocale=Fe;exports.useNumberFormatter=qe;exports.useNumberParser=Wt;exports.useOrdinalFormatter=Qn;exports.usePanelLabels=ct;exports.usePopoutRegion=ro;