@graphty/compact-mantine 0.8.18 → 0.8.19
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/README.md +8 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +52 -13
- package/dist/index.d.ts +52 -13
- package/dist/index.js +2067 -1973
- package/package.json +1 -1
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"),r=require("react"),X=require("@mantine/hooks"),$o=require("react-dom"),fe=require("@tanstack/react-table"),Wo=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)"},to=["#d5d7da","#a3a8b1","#7a828e","#5f6873","#48525c","#374047","#2a3035","#1f2428","#161b22","#0d1117"],no={...o.DEFAULT_THEME.colors,dark:to},Yo={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"}}},Xo={compactSize:"sm",sizes:{xs:{"--ai-size":"18px"},sm:{"--ai-size":"24px"},md:{"--ai-size":"30px"},lg:{"--ai-size":"36px"},xl:{"--ai-size":"44px"}}};function Ko(e){return e==="light"?{"--ai-bd":"1px solid var(--ai-color)"}:{}}const oo={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 G(e,t){const s=t==null?e.compactSize:String(t);return e.sizes[s]??e.sizes[e.compactSize]}const qo={Button:o.Button.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(Yo,t==null?void 0:t.size)})}),ActionIcon:o.ActionIcon.extend({defaultProps:{size:"sm",variant:"subtle"},vars:(e,t)=>({root:{...G(Xo,t==null?void 0:t.size),...Ko(t==null?void 0:t.variant)}})}),CloseButton:o.CloseButton.extend({defaultProps:{size:"xs"},vars:(e,t)=>({root:G(oo,t==null?void 0:t.size)})})},Zo={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"}}},Jo={compactSize:"sm",sizes:{xs:{"--checkbox-size":"12px"},sm:{"--checkbox-size":"16px"},md:{"--checkbox-size":"20px"},lg:{"--checkbox-size":"24px"},xl:{"--checkbox-size":"28px"}}},Qo={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"}}},bn={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"}}},ei={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"}}},ti={backgroundColor:"transparent"},ni={backgroundColor:"light-dark(var(--mantine-color-gray-2), var(--mantine-color-dark-6))"},_t={fontSize:11},yn={fontSize:10,marginTop:2},oi={SegmentedControl:o.SegmentedControl.extend({defaultProps:{size:"sm",withItemsBorders:!1},vars:(e,t)=>({root:G(ei,t==null?void 0:t.size)}),styles:{root:ti,indicator:ni}}),Checkbox:o.Checkbox.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(Jo,t==null?void 0:t.size)}),styles:{label:_t}}),Switch:o.Switch.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(Zo,t==null?void 0:t.size)}),styles:{label:_t}}),Slider:o.Slider.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(bn,t==null?void 0:t.size)}),styles:{markLabel:yn}}),Radio:o.Radio.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(Qo,t==null?void 0:t.size)}),styles:{label:_t}}),RangeSlider:o.RangeSlider.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(bn,t==null?void 0:t.size)}),styles:{markLabel:yn}})},ii={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"}}},si={compactSize:"sm",sizes:{xs:{"--avatar-size":"18px"},sm:{"--avatar-size":"24px"},md:{"--avatar-size":"30px"},lg:{"--avatar-size":"36px"},xl:{"--avatar-size":"44px"}}},ri={compactSize:"sm",sizes:{xs:{"--ti-size":"18px"},sm:{"--ti-size":"24px"},md:{"--ti-size":"30px"},lg:{"--ti-size":"36px"},xl:{"--ti-size":"44px"}}},ai={compactSize:"sm",sizes:{xs:{"--indicator-size":"6px"},sm:{"--indicator-size":"8px"},md:{"--indicator-size":"10px"},lg:{"--indicator-size":"12px"},xl:{"--indicator-size":"14px"}}},li={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"}}},ci={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"}}},di={Text:o.Text.extend({}),Badge:o.Badge.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(ii,t==null?void 0:t.size)})}),Pill:o.Pill.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(ci,t==null?void 0:t.size)})}),Avatar:o.Avatar.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(si,t==null?void 0:t.size)})}),ThemeIcon:o.ThemeIcon.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(ri,t==null?void 0:t.size)})}),Indicator:o.Indicator.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(ai,t==null?void 0:t.size)})}),Kbd:o.Kbd.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(li,t==null?void 0:t.size)})})},ui={compactSize:"sm",sizes:{xs:{"--loader-size":"14px"},sm:{"--loader-size":"18px"},md:{"--loader-size":"24px"},lg:{"--loader-size":"30px"},xl:{"--loader-size":"38px"}}},pi={compactSize:"sm",sizes:{xs:{"--progress-size":"2px"},sm:{"--progress-size":"4px"},md:{"--progress-size":"6px"},lg:{"--progress-size":"8px"},xl:{"--progress-size":"10px"}}},fi={label:{fontSize:9}},xi={Loader:o.Loader.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(ui,t==null?void 0:t.size)})}),Progress:o.Progress.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(pi,t==null?void 0:t.size)}),styles:fi}),RingProgress:o.RingProgress.extend({})},$t=1e3,Fe=1100,io=8,so=4,ro="light-dark(var(--mantine-primary-color-filled), var(--mantine-primary-color-5))",Rt={"--input-height":"24px","--input-size":"24px","--input-fz":"11px","--input-bg":"var(--mantine-color-default)","--input-bd":"transparent","--input-bd-focus":ro},ao={"--input-fz":"11px","--input-bg":"var(--mantine-color-default)","--input-bd":"transparent","--input-bd-focus":ro},nt={fontSize:11,color:g.CHROME,marginBottom:1,lineHeight:1.2},qt={paddingInlineStart:8,paddingInlineEnd:8,backgroundColor:"var(--mantine-color-default)"},Be={label:nt,input:qt},vn={label:nt,input:qt},yt={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"}},Ot={input:{...Be.input,minHeight:"var(--input-height)",height:"auto",display:"flex",alignItems:"center",paddingTop:1,paddingBottom:1},pillsList:{columnGap:4,rowGap:2},pill:{margin:0}};function we(e,t){return{...Rt,"--input-height":e,"--input-size":e,"--input-fz":t}}function dt(e){return{...ao,"--input-fz":e}}function ct(e,t){return{...dt(t),"--input-height":e}}const Ke={compactSize:"sm",sizes:{xs:we("20px","10px"),sm:Rt,md:we("30px","13px"),lg:we("36px","15px"),xl:we("44px","17px")}},wn={compactSize:"sm",sizes:{xs:dt("10px"),sm:ao,md:dt("13px"),lg:dt("15px"),xl:dt("17px")}},hi={compactSize:"sm",sizes:{xs:{...we("20px","10px"),"--input-right-section-width":"20px"},sm:{...Rt,"--input-right-section-width":"24px"},md:{...we("30px","13px"),"--input-right-section-width":"30px"},lg:{...we("36px","15px"),"--input-right-section-width":"36px"},xl:{...we("44px","17px"),"--input-right-section-width":"44px"}}},gi={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"}}},mi={compactSize:"sm",sizes:{xs:{...we("20px","10px"),"--combobox-chevron-size":"10px"},sm:{...Rt,"--combobox-chevron-size":"12px"},md:{...we("30px","13px"),"--combobox-chevron-size":"14px"},lg:{...we("36px","15px"),"--combobox-chevron-size":"16px"},xl:{...we("44px","17px"),"--combobox-chevron-size":"18px"}}},Sn={compactSize:"sm",sizes:{xs:ct("20px","10px"),sm:ct("24px","11px"),md:ct("30px","13px"),lg:ct("36px","15px"),xl:ct("44px","17px")}},lo={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",passwordReveal:"Show the password",ordinal:(e,t)=>{switch(t){case"one":return`${e}st`;case"two":return`${e}nd`;case"few":return`${e}rd`;default:return`${e}th`}}},bi="en",Wt=r.createContext(lo),Yt=r.createContext(void 0);function yi(e){return e!==void 0&&e!==""?e:typeof document<"u"&&document.documentElement.lang!==""?document.documentElement.lang:typeof navigator<"u"&&navigator.language!==""?navigator.language:bi}function vi({labels:e,locale:t,children:s}){const i=r.useContext(Wt),a=r.useContext(Yt),l=r.useMemo(()=>({...i,...e}),[i,e]),c=t??a;return n.jsx(Yt.Provider,{value:c,children:n.jsx(Wt.Provider,{value:l,children:s})})}function oe(){return r.useContext(Wt)}function $e(){const e=r.useContext(Yt);return yi(e)}const wi=1234.5,Si="9876543210",Ii=9876543210,Ei=new Set([" "," "," "," ","'","’"]),Ci="−",Ti=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?/iu,In=new Map;function zi(e){var f,p;const t=In.get(e);if(t!==void 0)return t;const s=new Intl.NumberFormat(e).formatToParts(wi),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(Ii);Array.from(c).forEach((h,m)=>{l.set(h,Si[m])});const x={decimal:i,digits:l,group:a};return In.set(e,x),x}function co(e,t){const s=zi(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||Ei.has(l))){if(l==="-"||l===Ci){i+="-";continue}if(l==="+"){i+="+";continue}if(l==="e"||l==="E"){i+=l;continue}break}}const a=Ti.exec(i);return a===null?Number.NaN:Number(a[0])}function Je(e){const t=$e(),s=JSON.stringify(e??{});return r.useMemo(()=>new Intl.NumberFormat(t,e),[t,s])}function uo(){const e=$e(),t=oe(),s=Je(),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 po(e){const t=$e(),s=JSON.stringify(e??{});return r.useMemo(()=>new Intl.Collator(t,e),[t,s])}function Zt(){const e=$e();return r.useCallback(t=>co(t,e),[e])}const Ri="M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",Pi="M13.3536 2.35355C13.5488 2.15829 13.5488 1.84171 13.3536 1.64645C13.1583 1.45118 12.8417 1.45118 12.6464 1.64645L10.6828 3.61012C9.70652 3.21671 8.63759 3 7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C0.902945 9.08812 2.02314 10.1861 3.36061 10.9323L1.64645 12.6464C1.45118 12.8417 1.45118 13.1583 1.64645 13.3536C1.84171 13.5488 2.15829 13.5488 2.35355 13.3536L4.31723 11.3899C5.29348 11.7833 6.36241 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C14.0971 5.9119 12.9769 4.81391 11.6394 4.06771L13.3536 2.35355ZM9.90428 4.38861C9.15332 4.1361 8.34759 4 7.5 4C4.80285 4 2.52952 5.37816 1.09622 7.50001C1.87284 8.6497 2.89609 9.58106 4.09974 10.1931L9.90428 4.38861ZM5.09572 10.6114L10.9003 4.80685C12.1039 5.41894 13.1272 6.35031 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11C6.65241 11 5.84668 10.8639 5.09572 10.6114Z";function Ai({reveal:e}){const t=oe();return n.jsxs(n.Fragment,{children:[n.jsx("svg",{viewBox:"0 0 15 15",fill:"none","aria-hidden":!0,style:{width:"var(--psi-icon-size)",height:"var(--psi-icon-size)"},children:n.jsx("path",{d:e?Pi:Ri,fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}),n.jsx(o.VisuallyHidden,{children:t.passwordReveal})]})}const ji={TextInput:o.TextInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:G(Ke,t==null?void 0:t.size)}),styles:Be}),NumberInput:o.NumberInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:G(hi,t==null?void 0:t.size),controls:G(gi,t==null?void 0:t.size)}),styles:{label:nt,input:qt,control:{borderColor:"transparent"}}}),Select:o.Select.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:Fe}},vars:(e,t)=>({root:{},wrapper:G(Ke,t==null?void 0:t.size)}),styles:{...Be,...yt}}),Textarea:o.Textarea.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:G(wn,t==null?void 0:t.size)}),styles:vn}),PasswordInput:o.PasswordInput.extend({defaultProps:{size:"sm",variant:"filled",visibilityToggleButtonProps:{},visibilityToggleIcon:Ai},vars:(e,t)=>({root:{},wrapper:G(Ke,t==null?void 0:t.size)}),styles:{...Be,innerInput:{paddingInlineStart:8,paddingInlineEnd:8}}}),Autocomplete:o.Autocomplete.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:Fe}},vars:(e,t)=>({root:{},wrapper:G(Ke,t==null?void 0:t.size)}),styles:{...Be,...yt}}),MultiSelect:o.MultiSelect.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:Fe}},vars:(e,t)=>({root:{},wrapper:G(mi,t==null?void 0:t.size)}),styles:{label:nt,...yt,...Ot,inputField:{minWidth:60,flexBasis:60}}}),TagsInput:o.TagsInput.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:Fe}},vars:(e,t)=>({root:{},wrapper:G(Sn,t==null?void 0:t.size)}),styles:{label:nt,...yt,...Ot,inputField:{minWidth:30,flexBasis:30}}}),PillsInput:o.PillsInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:G(Sn,t==null?void 0:t.size)}),styles:{label:nt,...Ot}}),FileInput:o.FileInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:G(Ke,t==null?void 0:t.size)}),styles:Be}),JsonInput:o.JsonInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:G(wn,t==null?void 0:t.size)}),styles:vn}),NativeSelect:o.NativeSelect.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:G(Ke,t==null?void 0:t.size)}),styles:Be}),ColorInput:o.ColorInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(e,t)=>({root:{},wrapper:G(Ke,t==null?void 0:t.size),eyeDropperIcon:{},eyeDropperButton:{},colorPreview:{}}),styles:Be}),InputClearButton:o.InputClearButton.extend({defaultProps:{size:"xs"},vars:(e,t)=>({root:G(oo,t==null?void 0:t.size)})})},Li={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"}}},_i={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"}}},Oi={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"}}},Hi={root:{fontSize:11}},Ni={root:{fontSize:11,minHeight:28},label:{fontSize:11}},Di={tab:{fontSize:11,padding:"6px 10px"}},ki={Anchor:o.Anchor.extend({defaultProps:{size:"sm"},styles:Hi}),Burger:o.Burger.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(Oi,t==null?void 0:t.size)})}),NavLink:o.NavLink.extend({styles:Ni}),Pagination:o.Pagination.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(Li,t==null?void 0:t.size)})}),Stepper:o.Stepper.extend({defaultProps:{size:"sm"},vars:(e,t)=>({root:G(_i,t==null?void 0:t.size)})}),Tabs:o.Tabs.extend({styles:Di})},Mi={"--menu-item-fz":"11px"},Gi={tooltip:{fontSize:11,padding:"4px 8px"}},Bi={dropdown:{padding:8}},Fi={dropdown:{padding:8}},Vi={Menu:o.Menu.extend({defaultProps:{zIndex:Fe,withInitialFocusPlaceholder:!1},vars:()=>({dropdown:Mi})}),Modal:o.Modal.extend({defaultProps:{closeButtonProps:{"aria-label":"Close"}}}),Drawer:o.Drawer.extend({defaultProps:{closeButtonProps:{"aria-label":"Close"}}}),Tooltip:o.Tooltip.extend({defaultProps:{zIndex:Fe},styles:Gi}),Popover:o.Popover.extend({defaultProps:{zIndex:Fe},styles:Bi}),HoverCard:o.HoverCard.extend({defaultProps:{zIndex:Fe},styles:Fi})},Ui={xs:"10px",sm:"11px",md:"13px",lg:"14px",xl:"16px"},$i={xs:"4px",sm:"6px",md:"8px",lg:"12px",xl:"16px"},Wi={xs:"2px",sm:"4px",md:"6px",lg:"8px",xl:"12px"},fo=o.createTheme({colors:no,fontSizes:Ui,spacing:$i,radius:Wi,focusRing:"auto",other:{panelGrid:u},components:{...ji,...qo,...oi,...di,...xi,...ki,...Vi}}),Yi=o.mergeMantineTheme(o.DEFAULT_THEME,fo),xo=["#5B8FF9FF","#FF6B6BFF","#61D095FF","#F7B731FF","#9B59B6FF","#5B8FF980","#FF6B6B80","#61D09580","#F7B73180","#9B59B680"],Et="#888888",ho=["sizeSmallest","sizeLargest","width","opacity","attribute","scaleSqrt","scaleLinear","scaleLog"],go=["N","E","W","D","K"],Xi=["chevronDown","chevronRight","chevronLeft","close","plus","minus","gear","warning","check","eye","refresh","copy","pin","keepOpen","info","reset"],mo={viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},Re={fill:"currentColor",stroke:"none"},Ki={sizeSmallest:e=>n.jsxs(n.Fragment,{children:[n.jsx("circle",{cx:"5",cy:"11",r:"2.5",...e?Re:{}}),n.jsx("circle",{cx:"10.5",cy:"6.5",r:"4",...e?Re:{}})]}),sizeLargest:e=>n.jsxs(n.Fragment,{children:[n.jsx("circle",{cx:"4.5",cy:"11.5",r:"1.75",...e?Re:{}}),n.jsx("circle",{cx:"10",cy:"6",r:"5",...e?Re:{}})]}),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?Re:{}}),n.jsx("polyline",{points:"11,5.5 13.5,8 11,10.5",...e?Re:{}})]}),opacity:e=>e?n.jsx("circle",{cx:"8",cy:"8",r:"5.5",...Re}):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",...Re})]}),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",...Re}),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:"1.5",...Re})]}),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"})},qi={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 Ze({name:e,filled:t=!1,size:s=u.GLYPH}){return n.jsx("svg",{width:s,height:s,...mo,"aria-hidden":"true",focusable:"false","data-glyph":e,"data-filled":t?"true":"false",style:{flex:"0 0 auto",display:"block"},children:Ki[e](t)})}function ie({name:e,size:t=u.GLYPH}){return n.jsx("svg",{width:t,height:t,...mo,"aria-hidden":"true",focusable:"false","data-glyph":e,style:{flex:"0 0 auto",display:"block"},children:qi[e]})}function Jt(e){return typeof e=="string"&&ho.includes(e)}function Qt(e){return typeof e=="string"&&go.includes(e)}const en=255,tn=100;function nn(e){return Math.round(parseInt(e,16)/en*tn)}function on(e){return Math.round(e/tn*en).toString(16).padStart(2,"0")}function Zi(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=nn(i);return{hex:s,opacity:a}}function Ji(e,t){const s=e.replace("#",""),i=on(t);return`#${s}${i}`}function Qi(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 Ct={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0};function es(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:es(t??e,c),description:f,describedBy:f===void 0?void 0:l}}const bo=r.createContext(null);function ts(){return r.useContext(bo)}function ns({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(bo.Provider,{value:{anchorRef:t},children:i})}function os({children:e}){return n.jsx(o.Box,{p:"sm",children:e})}const is=["[data-portal]","[data-combobox-dropdown]","[data-menu-dropdown]","[data-popover-dropdown]","[data-tooltip]","[data-hovercard-dropdown]","[data-dates-dropdown]","[data-modal]"].join(", ");function ss(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(is)||e()};return document.addEventListener("mousedown",s),()=>{document.removeEventListener("mousedown",s)}},[e,t])}function rs(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 yo=r.createContext(null);function as({id:e,children:t}){return n.jsx(yo.Provider,{value:e,children:t})}function vo(){return r.useContext(yo)}const sn=r.createContext(null),rn=r.createContext(null);function Pt(){const e=r.useContext(sn);if(!e)throw new Error("usePopoutContext must be used within a Popout component");return e}function ls(){return r.useContext(sn)}function wo(){const e=r.useContext(rn);if(!e)throw new Error("usePopoutManagerContext must be used within a PopoutManager");return e}function cs(){return r.useContext(rn)}function ds(){const{closeAll:e,hasOpenPopouts:t}=wo();return r.useMemo(()=>({closeAll:e,hasOpenPopouts:t}),[e,t])}function us({children:e,parentId:t=null,opened:s,defaultOpened:i,onOpenChange:a}){const l=r.useId(),c=r.useRef(null),x=vo(),[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,R)=>{if(R){h.current(C,R);return}h.current(C)},[]),b=r.useCallback(C=>{m(!0,C)},[m]),v=r.useCallback(C=>{m(!1,C)},[m]),z=r.useCallback(C=>{m(!f,C)},[f,m]),T=r.useMemo(()=>({id:l,isOpen:f,open:b,close:v,toggle:z,triggerRef:c,parentId:t,region:x}),[l,f,b,v,z,t,x]);return n.jsx(sn.Provider,{value:T,children:e})}function ps({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,O)=>(l.current.get(y)??null)!==S?!1:S!==null?!0:(c.current.get(y)??null)===O,[]),h=r.useCallback((y,S)=>i.current.filter(O=>p(O,y,S)),[p]),m=r.useCallback(y=>{const S=[];for(const O of i.current){let k=O;for(;k;){const K=l.current.get(k)??null;if(K===y){S.push(O);break}k=K}}return S},[]),b=r.useCallback(y=>{let S=0,O=y;for(;O;){const k=l.current.get(O)??null;if(!k)break;S++,O=k}return S},[]),v=r.useCallback(y=>{var O;const S=[...y].sort((k,K)=>b(K)-b(k));for(const k of S)(O=a.current.get(k))==null||O()},[b]),z=r.useCallback((y,S,O,k)=>{if(i.current.includes(y)){a.current.set(y,S);return}const K=O??null,Se=k??null,be=h(K,Se),se=[];for(const te of be)se.push(te),se.push(...m(te));v(se);const q=new Set(se);i.current=i.current.filter(te=>!q.has(te)),i.current.push(y),a.current.set(y,S),l.current.set(y,K),c.current.set(y,Se),f(te=>te+1)},[h,m,v]),T=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?$t+S:$t},[]),R=r.useCallback(y=>{const S=i.current,O=S.indexOf(y);O===-1||O===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 O=S;for(;O;){const k=l.current.get(O);if(k===y)return!0;O=k??null}return!1},[]),P=r.useCallback(y=>{const S=[],O=i.current;for(const k of O)w(y,k)&&S.push(k);return S},[w]),j=r.useCallback(y=>{const S=P(y);for(const O of[...S].reverse()){const k=a.current.get(O);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 O=c.current.get(y)??null;for(const k of i.current)k!==y&&p(k,S,O)&&L(k)},[L,p]),U=r.useCallback(()=>{const y=i.current;if(y.length===0)return;const S=y[y.length-1],O=a.current.get(S);O==null||O()},[]),B=r.useCallback(()=>{const y=[...i.current];for(const S of y){const O=a.current.get(S);O==null||O()}},[]),N=r.useCallback(()=>i.current.length>0,[]),[$,A]=r.useState(!1);r.useEffect(()=>{A(i.current.length>0)},[x]),rs(U,$),ss(B,$);const H=r.useMemo(()=>({register:z,unregister:T,getZIndex:C,bringToFront:R,portalContainer:t,zIndexVersion:x,closeFocused:U,closeAll:B,hasOpenPopouts:N,closeWithDescendants:L,closeDescendants:j,closeSiblings:D,getParentId:I,isAncestor:w}),[z,T,C,R,t,x,U,B,N,L,j,D,I,w]);return n.jsxs(rn.Provider,{value:H,children:[e,n.jsx("div",{ref:s,"data-popout-portal-container":!0,style:{display:"contents"}})]})}function Oe(){return o.useDirection().dir}function xe(e){return e==="rtl"}function fs(e,t){return xe(t)?1-e:e}function xs(e,t,s){return fs(e,s)*t}function hs(e){return xe(e)?{transform:"scaleX(-1)"}:{}}const En=3;function gs(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},[]),z=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]),T=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)>=En||Math.abs(P)>=En))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]),R=c.left!==0||c.top!==0;return t?{dragTriggerProps:{"data-drag-trigger":!0,onPointerDown:z,onPointerMove:T,onPointerUp:C,onPointerCancel:C,style:{cursor:"grab",userSelect:"none",touchAction:"none"}},dragOffset:c,resetDragOffset:b,hasDragged:R,consumeDragClick:v}:{dragTriggerProps:{},dragOffset:{left:0,top:0},resetDragOffset:b,hasDragged:!1,consumeDragClick:v}}function ms({config:e,onClose:t,dragTriggerProps:s={},actions:i=[],activeTab:a,onTabChange:l,titleId:c}){var v;const x=oe(),{style:f,...p}=s,m=e.variant==="tabs"?e:null,b=(m==null?void 0:m.tabs.map(z=>({value:z.id,label:z.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:z=>l==null?void 0:l(z),size:"xs"})]}),n.jsxs(o.Group,{gap:4,children:[i.map(z=>n.jsx(o.ActionIcon,{variant:"subtle",onClick:z.onClick,"aria-label":z.label,children:z.icon},z.id)),n.jsx(o.CloseButton,{"data-testid":"popout-header-close",onClick:t,"aria-label":x.closePanel})]})]})}function bs(e,t=document){return e===null?null:t.querySelector(`[data-popout-id="${e}"]`)}function Cn(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 ys(e,t){return e==="start"?xe(t)?"right":"left":e==="end"?xe(t)?"left":"right":e}function vs(e,t,s=io,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=Tn(x,l,c);break;case"right":p=e.right+s,h=Tn(x,l,c);break;case"top":p=zn(x,l,t,f),h=e.top-c-s;break;case"bottom":p=zn(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 Tn(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 zn(e,t,s,i){switch(t){case"start":return xe(i)?e.right-s:e.left;case"center":return e.left+e.width/2-s/2;case"end":return xe(i)?e.left:e.right-s;default:{const a=t;throw new Error(`Unknown alignment: ${String(a)}`)}}}function ws(e){var Ge,Te;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:z,onDragEnd:T}=e,{isOpen:C,close:R,triggerRef:I,id:w,parentId:P,region:j}=Pt(),{getZIndex:L,portalContainer:D,register:U,unregister:B,bringToFront:N,zIndexVersion:$,closeDescendants:A}=wo(),H=ts(),y=Oe(),S=r.useId(),O=`popout-panel-${w}`,k=`popout-title-${S}`,[K,Se]=r.useState(null),be=r.useRef(!1),se=r.useRef(null),q=r.useCallback(()=>{N(w)},[N,w]),{dragTriggerProps:te,dragOffset:F,resetDragOffset:J,hasDragged:Z,consumeDragClick:Ie}=gs({isOpen:C,onPress:q,onDragStart:v,onDrag:z,onDragEnd:T}),he=(i==null?void 0:i.variant)==="tabs",W=(i==null?void 0:i.variant)==="tabs"?i:null,ce=(W==null?void 0:W.defaultTab)??((Ge=W==null?void 0:W.tabs[0])==null?void 0:Ge.id),[He,We]=r.useState(ce),Pe=h??(P===null?0:so),ft=r.useCallback((Y,re)=>{var ne;We(Y),(ne=W==null?void 0:W.onTabChange)==null||ne.call(W,Y,re)},[W]),ae=r.useCallback(Y=>{Y.stopPropagation(),N(w),!Ie()&&A(w)},[A,N,Ie,w]),Ne=r.useCallback(Y=>{A(w),R(Y)},[A,R,w]),ge=r.useRef(R);r.useEffect(()=>{ge.current=R});const Ae=r.useCallback(()=>{ge.current()},[]);r.useEffect(()=>(C?U(w,Ae,P,j):B(w),()=>{B(w)}),[C,w,U,B,Ae,P,j]);const Ee=r.useCallback(()=>{const Y={trigger:I.current,parent:bs(P),panel:(H==null?void 0:H.anchorRef.current)??null};return{inline:Cn(c,"x",Y),block:Cn(x,"y",Y)}},[I,P,H,c,x]),De=r.useCallback(()=>{var at;const{inline:Y,block:re}=Ee(),ne=Y??re,ye=re??Y;if(!ne||!ye)return;const de=(at=se.current)==null?void 0:at.getBoundingClientRect(),ue=Math.max(t,(de==null?void 0:de.width)??0),M=Math.max(s??0,(de==null?void 0:de.height)??0),ee=ys(f,y),pe=ee==="top"||ee==="bottom",Ye=pe?ye:ne,rt=pe?ne:ye,Xe=vs(Ye.getBoundingClientRect(),ue,Pe,{placement:ee,alignment:p,panelHeight:M,crossAnchorRect:rt.getBoundingClientRect(),direction:y});Se(ze=>ze&&ze.left===Xe.left&&ze.top===Xe.top?ze:Xe)},[Ee,t,s,f,p,Pe,y]);if(X.useIsomorphicEffect(()=>{if(!C){Se(null);return}be.current||(J(),he&&We(ce)),De()},[C,De,J,he,ce]),r.useEffect(()=>{if(!C)return;let Y=0;const re=()=>{Y===0&&(Y=requestAnimationFrame(()=>{Y=0,De()}))},ne=new ResizeObserver(re),ye=new MutationObserver(re),{inline:de,block:ue}=Ee();for(const ee of new Set([de,ue].filter(pe=>pe!==null)))ne.observe(ee),ye.observe(ee,{attributes:!0,attributeFilter:["style","class"]});se.current&&ne.observe(se.current);const M=()=>{Z||re()};return window.addEventListener("resize",M),window.addEventListener("scroll",M,!0),()=>{Y!==0&&cancelAnimationFrame(Y),ne.disconnect(),ye.disconnect(),window.removeEventListener("resize",M),window.removeEventListener("scroll",M,!0)}},[C,De,Ee,Z]),r.useEffect(()=>{var Y;if(b){if(C){const re=setTimeout(()=>{var ne;(ne=se.current)==null||ne.focus()},0);return()=>{clearTimeout(re)}}be.current&&((Y=I.current)==null||Y.focus())}},[C,b,I]),r.useEffect(()=>{be.current=C},[C]),!C||!D)return null;const ke=L(w),Qe={left:((K==null?void 0:K.left)??0)+F.left,top:((K==null?void 0:K.top)??0)+F.top},Me=n.jsxs(o.Paper,{ref:se,id:O,role:"dialog","aria-modal":"false","aria-labelledby":i?k:void 0,"aria-label":i?void 0:a,tabIndex:-1,radius:8,onClick:ae,"data-testid":"popout-panel","data-popout-id":w,...P&&{"data-parent-id":P},style:{position:"fixed",left:Qe.left,top:Qe.top,minWidth:t,width:"min-content",...s!==void 0&&{minHeight:s},...K===null&&{visibility:"hidden"},zIndex:ke,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(ms,{config:i,onClose:Ne,dragTriggerProps:te,activeTab:He,onTabChange:ft,actions:m,titleId:k}):null,n.jsx(o.Box,{"data-testid":"popout-panel-content",children:he?(Te=W==null?void 0:W.tabs.find(Y=>Y.id===He))==null?void 0:Te.content:l})]});return $o.createPortal(Me,D)}function Ss({children:e,action:t="toggle"}){const{open:s,toggle:i,triggerRef:a,isOpen:l,id:c}=Pt(),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 Is({children:e,opened:t,defaultOpened:s,onOpenChange:i}){const a=ls(),l=(a==null?void 0:a.id)??null;return n.jsx(us,{parentId:l,opened:t,defaultOpened:s,onOpenChange:i,children:e})}const Ve=Object.assign(Is,{Trigger:Ss,Panel:ws,Content:os,Anchor:ns}),Es=r.forwardRef(function({icon:t,size:s="xs",...i},a){const{isOpen:l}=Pt();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 So({children:e}){return n.jsx(ps,{children:e})}const Rn=4,Pn=4,Cs=2,Ts=72,zs=54,Rs=220,An=0,Ht=100,jn=9,Ln=7,Ps=/^#[0-9A-F]{6}$/iu,As=1.1;function Nt(e){const t=e==="start"?Pn:0,s=e==="end"?Pn:0;return{borderStartStartRadius:t,borderEndStartRadius:t,borderStartEndRadius:s,borderEndEndRadius:s}}function js(){const e=$e();return r.useMemo(()=>{var s;return((s=new Intl.NumberFormat(e).formatToParts(As).find(i=>i.type==="decimal"))==null?void 0:s.value)??"."},[e])}function Io({color:e,defaultColor:t,opacity:s,defaultOpacity:i=Ht,onColorChange:a,onOpacityChange:l,onChange:c,label:x,showOpacity:f=!0,disabled:p=!1,disabledReason:h,onFocus:m,onBlur:b}){const v=oe(),z=Zt(),T=js(),C=r.useId(),R=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),B=I??t,N=P??i,[$,A]=r.useState(B.replace("#","").toUpperCase()),[H,y]=r.useState(N);r.useEffect(()=>{A(B.replace("#","").toUpperCase())},[B]),r.useEffect(()=>{y(N)},[N]);const S=F=>{const J=F.length===jn,Z=J?F.slice(0,Ln).toUpperCase():F.toUpperCase(),Ie=J&&f,he=Ie?nn(F.slice(Ln,jn)):P;w(Z),Ie&&j(he),c==null||c(Z,he)},O=()=>`${B}${on(N)}`.toUpperCase(),k=F=>{A(F.currentTarget.value.toUpperCase())},K=F=>{const J=$.toUpperCase(),Z=J.startsWith("#")?J:`#${J}`;Ps.test(Z)&&Z!==B?(w(Z,F),c==null||c(Z,P,F)):A(B.replace("#","").toUpperCase()),b==null||b(F)},Se=F=>{y(F)},be=F=>{const J=typeof H=="string"?z(H):H;if(Number.isNaN(J)){y(N),b==null||b(F);return}const Z=Math.min(Ht,Math.max(An,J));Z!==N&&(j(Z,F),c==null||c(I,Z,F)),y(Z),b==null||b(F)},se=F=>{w(void 0,F),f&&j(void 0,F),c==null||c(void 0,f?void 0:P,F)},q=f?"middle":"end",te=n.jsxs(o.Group,{"data-testid":"compact-color-input",gap:Rn,wrap:"nowrap",title:x===void 0?R.title:void 0,"data-disabled":p?"true":void 0,children:[n.jsxs(o.Group,{gap:0,wrap:"nowrap",children:[n.jsxs(Ve,{children:[n.jsx(Ve.Trigger,{children:n.jsx(o.ActionIcon,{variant:"filled",size:u.CONTROL_HEIGHT,radius:0,style:{backgroundColor:"var(--mantine-color-default)",...Nt("start")},"data-testid":"compact-color-input-swatch",disabled:p,"aria-label":v.colorSwatch,"aria-describedby":R.describedBy,children:n.jsx(o.ColorSwatch,{color:B,size:u.GLYPH,radius:Cs,style:{border:`1px solid ${g.BORDER}`}})})}),n.jsx(Ve.Panel,{width:Rs,header:{variant:"title",title:x??v.colorPanelTitle},placement:"bottom",alignment:"start",gap:Rn,children:n.jsx(Ve.Content,{children:n.jsx(o.ColorPicker,{format:"hexa",value:O(),onChange:S,swatches:[...xo]})})})]}),n.jsx(o.TextInput,{"data-testid":"compact-color-input-hex",disabled:p,description:R.description,value:$,onChange:k,onFocus:m,onBlur:K,"aria-label":v.colorHexValue,"data-is-default":L?"true":"false",w:Ts,styles:{input:{...Nt(q),fontFamily:"monospace",textTransform:"uppercase",...L?{fontStyle:"italic",color:g.CHROME}:{}},description:Ct}}),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:R.description,value:H,onChange:Se,onFocus:m,onBlur:be,min:An,max:Ht,decimalSeparator:T,hideControls:!0,suffix:"%","aria-label":v.opacity,"data-is-default":D?"true":"false",w:zs,styles:{input:{...Nt("end"),textAlign:"end",...D?{fontStyle:"italic",color:g.CHROME}:{}},description:Ct}})]})]}),!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:se,children:n.jsx(ie,{name:"reset",size:u.CHEVRON})}),R.description!==void 0&&n.jsx(o.VisuallyHidden,{id:R.describedBy,children:R.description})]});return x===void 0?te:n.jsxs(o.Stack,{"data-testid":"compact-color-input-labelled",gap:0,role:"group","aria-labelledby":C,title:R.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}),te]})}const vt=u.GUTTER,_n=4,Ls=1,_s=1.2,Os="calc(-1 * var(--mantine-spacing-sm) - 1px)";function Hs({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:Ls,style:{marginBlockStart:vt,marginBlockEnd:0,marginInline:i?Os:void 0}}),n.jsxs(o.Box,{"data-testid":"control-group-header",style:{display:"flex",alignItems:"center",gap:_n,boxSizing:"border-box",paddingBlock:vt,paddingInline:vt},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:_s,color:g.VALUE},children:e}),l&&n.jsx(o.Box,{"data-testid":"control-group-actions",style:{display:"flex",alignItems:"center",gap:_n,flex:"0 0 auto"},children:t})]}),n.jsx(o.Stack,{"data-testid":"control-group-content",gap:0,px:vt,children:s})]})}function _e(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 On=250,Ns=4;function Ds({name:e,bubbleId:t}){const{isOpen:s,open:i,close:a}=Pt();return n.jsx(Ve.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(ie,{name:"info",size:u.CHEVRON})})})}function Eo({children:e,label:t,opened:s,defaultOpened:i,onOpenChange:a}){const l=oe(),c=r.useId(),x=cs()!==null,f=l.about(t),p=n.jsxs(Ve,{opened:s,defaultOpened:i,onOpenChange:a,children:[n.jsx(Ds,{name:f,bubbleId:c}),n.jsx(Ve.Panel,{width:On,label:f,placement:"bottom",alignment:"start",gap:Ns,anchorX:"trigger",anchorY:"trigger",manageFocus:!1,children:n.jsx(o.Box,{id:c,w:On,p:"xs",style:{fontSize:"var(--mantine-font-size-sm)",lineHeight:1.4,color:g.PROSE},children:e})})]});return x?p:n.jsx(So,{children:p})}function ut(e){return e!=null&&e!==!1}function Ce({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 Co=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=oe(),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(ie,{name:"gear",size:u.GLYPH})})}),Dt=4,ks=1,Hn=6,Ms=12,Gs=1.2;function Bs(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=oe(),v=Oe(),z=r.useId(),T=r.useId(),C=r.useId(),[R,I]=X.useUncontrolled({value:i,defaultValue:a,finalValue:!0,onChange:l}),w=!x&&r.Children.toArray(m).length>0,P=p!=null;_e(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=H=>{I(!R,H)},L=R?b.collapseSection(t):b.expandSection(t),D=b.addToSection(t),U=xe(v)?"chevronLeft":"chevronRight",B={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:Dt,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:z,title:$,"data-testid":"control-section-name",style:{minWidth:0,fontSize:Ms,fontWeight:500,lineHeight:Gs,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":z,"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:ks,my:0,mx:0}),n.jsxs(o.Box,{"data-testid":"control-section-header",style:{display:"flex",alignItems:"center",gap:Dt,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":R,"aria-controls":T,onClick:j,style:{...N,cursor:"pointer"},children:[n.jsx(o.Box,{"data-testid":"control-section-chevron-slot",style:B,children:n.jsx(ie,{name:R?"chevronDown":U,size:u.CHEVRON})}),A]}):n.jsxs(o.Box,{style:N,children:[n.jsx(o.Box,{"data-testid":"control-section-chevron-slot",style:B}),A]}),c&&n.jsx(o.Box,{role:"img","aria-label":b.sectionHasConfiguredValues(t),"data-testid":"control-section-dot",style:{flex:"0 0 auto",width:Hn,height:Hn,borderRadius:"50%",background:g.ACCENT}}),P&&n.jsx(Eo,{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:Dt,flex:"0 0 auto"},children:h}),x&&f!==void 0&&n.jsx(Ce,{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(ie,{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:T,in:R,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 kt="control-sub-group",Nn=4,Fs=10,Vs=1.2;function Us(e){const{label:t,opened:s,defaultOpened:i,onOpenChange:a,children:l}=e,c=oe(),x=Oe(),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 R=f.current;f.current=void 0,h(C===kt,R)},[h]),v=p?c.collapseSection(t):c.expandSection(t);let z="chevronDown";p||(z=xe(x)?"chevronLeft":"chevronRight");const T={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:Vs,color:g.CHROME},chevron:{marginInlineStart:0,marginInlineEnd:Nn,color:g.CHROME},content:{paddingBlock:0,paddingInlineStart:u.GUTTER,paddingInlineEnd:0}};return n.jsx(o.Accordion,{"data-testid":"control-sub-group",value:p?kt:null,onChange:b,chevronPosition:"left",chevronSize:u.GLYPH_SLOT,disableChevronRotation:!0,chevron:n.jsx(ie,{name:z,size:Fs}),styles:T,children:n.jsxs(o.Accordion.Item,{value:kt,"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:Nn},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 $s(e){const t=oe();return r.useMemo(()=>({...t,...e}),[t,e])}const le=-1;function ot(e,t,s){return Math.min(Math.max(e,t),s)}function Ws(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=xe(i)?"ArrowLeft":"ArrowRight",m=xe(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,le,f),column:e.column};if(t==="ArrowUp")return{row:ot(e.row-1,le,f),column:e.column};if(t==="Home")return a.jumpToEnd?{row:le,column:0}:{row:e.row,column:0};if(t==="End")return a.jumpToEnd?{row:Math.max(f,le),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 Ys(e,t){const s=t.rowCount-1,i=Math.max(t.columnCount-1,0);return{row:ot(e.row,le,Math.max(s,le)),column:ot(e.column,0,i)}}function wt(e,t){return e.row===t.row&&e.column===t.column}function Xs(e,t,s){const i=Math.min(t,s),a=Math.max(t,s);return e.slice(i,a+1)}function Xt(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 Ks(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=Xs(t,f,s);return{selected:l.toggle?Xt([...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:Xt(p,t),anchor:x}}return{selected:[x],anchor:x}}function qs(e,t,s){return s!=="multiple"?{selected:[...t],anchor:void 0}:{selected:Xt([...t,...e],e),anchor:e[0]}}function Dn(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 kn(e){return e==null?!0:typeof e=="number"?!Number.isFinite(e):e instanceof Date&&Number.isNaN(e.getTime())}function Zs(e,t,s){const i=kn(e),a=kn(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 Js=fe.tableFeatures({columnFilteringFeature:fe.columnFilteringFeature,columnOrderingFeature:fe.columnOrderingFeature,columnVisibilityFeature:fe.columnVisibilityFeature,filteredRowModel:fe.createFilteredRowModel(),globalFilteringFeature:fe.globalFilteringFeature,rowSelectionFeature:fe.rowSelectionFeature,rowSortingFeature:fe.rowSortingFeature,sortedRowModel:fe.createSortedRowModel()}),Qs=320,er=8,tr=12,nr=1.2,or="var(--mantine-primary-color-light)",Mn="mantine-focus-auto",Mt=[],ir=[];function Gn(e){return e==="asc"?"ascending":e==="desc"?"descending":"none"}function sr(e,t,s){return Math.min(Math.max(e,t),s)}function rr(e,t){var gn,mn;const{data:s,rowCount:i,rowOffset:a=0,onRangeChange:l,columns:c,getRowId:x,label:f,labelledBy:p,labels:h,height:m=Qs,rowHeight:b=u.DATA_PITCH,headerHeight:v=u.CONTROL_HEIGHT,overscan:z=er,selectionMode:T="multiple",selectedIds:C,defaultSelectedIds:R,onSelectionChange:I,sorting:w,defaultSorting:P,onSortingChange:j,hiddenColumns:L,defaultHiddenColumns:D,onHiddenColumnsChange:U,columnOrder:B,defaultColumnOrder:N,onColumnOrderChange:$,filter:A,defaultFilter:H,onFilterChange:y,searchable:S=!1,onRowClick:O,onRowDoubleClick:k,onRowContextMenu:K,onFocus:Se,onBlur:be,empty:se}=e,q=$s(h),te=Oe(),F=$e(),J=Je(),Z=po({numeric:!0,sensitivity:"variant"}),Ie=r.useMemo(()=>new Intl.DateTimeFormat(F),[F]),he=r.useMemo(()=>({number:J,date:Ie,yes:q.yes,no:q.no}),[J,Ie,q.yes,q.no]),[W,ce]=X.useUncontrolled({value:C,defaultValue:R,finalValue:Mt,onChange:(d,E)=>{I==null||I([...d],E)}}),[He,We]=X.useUncontrolled({value:w,defaultValue:P,finalValue:ir,onChange:(d,E)=>{j==null||j([...d],E)}}),[Pe,ft]=X.useUncontrolled({value:L,defaultValue:D,finalValue:Mt,onChange:(d,E)=>{U==null||U([...d],E)}}),[ae,Ne]=X.useUncontrolled({value:B,defaultValue:N,finalValue:Mt,onChange:(d,E)=>{$==null||$([...d],E)}}),[ge,Ae]=X.useUncontrolled({value:A,defaultValue:H,finalValue:"",onChange:(d,E)=>{y==null||y(d,E)}}),Ee=r.useMemo(()=>{const d=new Map;for(const E of c)d.set(E.id,E);return d},[c]),De=JSON.stringify(Pe),ke=r.useMemo(()=>{const d=new Set(Pe);return c.filter(E=>(E.filterable??!0)&&!d.has(E.id)).map(E=>E.id)},[c,De]),Qe=r.useMemo(()=>{const d=ge.trim();if(d!=="")return{query:d.toLocaleLowerCase(F),columnIds:ke}},[ge,F,ke]),xt=r.useMemo(()=>[...s],[s]),et=r.useMemo(()=>c.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,_)=>Zs(d.value(E.original),d.value(_.original),Z)})),[c,Z]),Me=JSON.stringify(He),Ge=r.useMemo(()=>He.map(d=>({id:d.id,desc:d.desc})),[Me]),Te=r.useMemo(()=>{const d={};for(const E of Pe)d[E]=!1;return d},[Pe]),Y=r.useMemo(()=>{const d={};for(const E of W)d[E]=!0;return d},[W]),re=r.useMemo(()=>[...ae],[ae]),ne=r.useRef(void 0),ye=i!==void 0,de=ye?a:0,ue=fe.useTable({features:Js,data:xt,columns:et,getRowId:x,manualSorting:ye,manualFiltering:ye,enableRowSelection:T!=="none",enableMultiRowSelection:T==="multiple",getColumnCanGlobalFilter:()=>!0,globalFilterFn:(d,E,_)=>{const V=_;if(V===void 0||!V.columnIds.includes(E))return!1;const Q=Ee.get(E);return Q===void 0?!1:Dn(Q.value(d.original),he).toLocaleLowerCase(F).includes(V.query)},state:{sorting:Ge,columnVisibility:Te,columnOrder:re,rowSelection:Y,globalFilter:Qe},onSortingChange:d=>{const E=fe.functionalUpdate(d,Ge);We(E.map(_=>({id:_.id,desc:_.desc})),ne.current)},onColumnVisibilityChange:d=>{const E=fe.functionalUpdate(d,Te);ft(Object.keys(E).filter(_=>!E[_]))},onColumnOrderChange:d=>{Ne(fe.functionalUpdate(d,re))},onRowSelectionChange:d=>{ce(Object.keys(fe.functionalUpdate(d,Y)))}}),{rows:M}=ue.getRowModel(),ee=ue.getVisibleLeafColumns(),pe=i??M.length,Ye=ee.length,rt=r.useMemo(()=>M.map(d=>d.id),[M]),Xe=r.useRef(null),at=r.useRef(null),ze=Wo.useVirtualizer({count:pe,getScrollElement:()=>Xe.current,estimateSize:()=>b,getItemKey:d=>rt[d-de]??d,overscan:z}),At=ze.getVirtualItems(),ln=((gn=At[0])==null?void 0:gn.index)??0,cn=(((mn=At.at(-1))==null?void 0:mn.index)??-1)+1;r.useEffect(()=>{l==null||l(ln,cn)},[ln,cn]);const[dn,tt]=r.useState({row:le,column:0}),ve=r.useMemo(()=>Ys(dn,{rowCount:pe,columnCount:Ye}),[dn,pe,Ye]),jt=r.useRef(!1),Lt=r.useRef(void 0),Mo=d=>{d.row>=0&&ze.scrollToIndex(d.row),jt.current=!0,tt(E=>wt(E,d)?E:d)};r.useLayoutEffect(()=>{var _;if(!jt.current)return;const d=`[data-grid-row="${ve.row}"][data-grid-column="${ve.column}"]`,E=(_=at.current)==null?void 0:_.querySelector(d);E instanceof HTMLElement&&(jt.current=!1,E.focus())});const un=(d,E)=>{Lt.current=d.anchor,!(d.selected.length===W.length&&d.selected.every((V,Q)=>V===W[Q]))&&ce(d.selected,E)},ht=(d,E,_)=>{un(Ks({ids:rt,index:d-de,selected:W,anchor:Lt.current,modifiers:E,mode:T}),_)},pn=(d,E,_)=>{const V=M[d-de];V!==void 0&&(O==null||O(V.original,E,_))},Go=(d,E)=>{d.getCanSort()&&(ne.current=E,d.toggleSorting(void 0,E.shiftKey&&d.getCanMultiSort()),ne.current=void 0)},Bo=()=>{var _;const d=((_=Xe.current)==null?void 0:_.clientHeight)??0,E=Math.floor((d===0?b*10:d)/b);return Math.max(1,E-1)},Fo=d=>{const E=T==="multiple",_=d.ctrlKey||d.metaKey;if(E&&_&&(d.key==="a"||d.key==="A")){d.preventDefault(),un(qs(rt,W,T),d);return}if(ve.row>=0&&(d.key===" "||d.key==="Enter")){d.preventDefault(),d.key===" "?ht(ve.row,{extend:d.shiftKey,toggle:!d.shiftKey},d):(ht(ve.row,{extend:!1,toggle:!1},d),pn(ve.row,d,{source:"keyboard"}));return}const V=Ws(ve,d.key,{rowCount:pe,columnCount:Ye,pageSize:Bo()},te,{jumpToEnd:_});V!==void 0&&(d.preventDefault(),Mo(V),E&&d.shiftKey&&V.row>=0&&V.row!==ve.row&&ht(V.row,{extend:!0,toggle:!1},d))};r.useImperativeHandle(t,()=>({scrollToRow:d=>{d>=0&&d<pe&&ze.scrollToIndex(d)},setColumnHidden:(d,E)=>{var _;(_=ue.getColumn(d))==null||_.toggleVisibility(!E)},moveColumn:(d,E)=>{const _=ue.getAllLeafColumns().map(Q=>Q.id),V=_.indexOf(d);V!==-1&&(_.splice(V,1),_.splice(sr(E,0,_.length),0,d),ue.setColumnOrder(_))},clearSelection:()=>{Lt.current=void 0,ce([])}}),[ue,ze,pe,ce]);const Vo=ee.reduce((d,E)=>{var _;return d+(((_=Ee.get(E.id))==null?void 0:_.width)??u.FIELD)},0),fn=(d,E)=>{const _=(d==null?void 0:d.width)??u.FIELD;return{flex:E===Ye-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"}},gt=T!=="none",xn=i??s.length,hn=q.rowsShown(J.format(pe),J.format(xn)),Uo=()=>se!==void 0?se:xn===0?q.noRows:q.noMatchingRows;return n.jsxs(o.Box,{"data-testid":"data-table",dir:xe(te)?"rtl":void 0,onFocus:Se,onBlur:be,style:{display:"flex",flexDirection:"column",gap:u.TRAIL_GAP,width:"100%",color:g.VALUE},children:[S&&n.jsxs(o.Box,{style:{display:"flex",alignItems:"center",gap:u.GUTTER},children:[n.jsx(o.TextInput,{"data-testid":"data-table-search",type:"search","aria-label":q.search,placeholder:q.searchPlaceholder,value:ge,onChange:d=>{Ae(d.currentTarget.value,d)},rightSection:ge===""?void 0:n.jsx(o.ActionIcon,{"data-testid":"data-table-search-clear",variant:"subtle",size:u.CONTROL_HEIGHT,"aria-label":q.clearSearch,onClick:d=>{Ae("",d)},children:n.jsx(ie,{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:hn})]}),n.jsxs(o.VisuallyHidden,{role:"status","aria-live":"polite",dir:"auto","data-testid":"data-table-status",children:[hn,gt&&W.length>0?` ${q.rowsSelected(J.format(W.length))}`:""]}),n.jsxs(o.Box,{ref:Xe,"data-testid":"data-table-viewport",style:{height:m,overflow:"auto",position:"relative",border:`1px solid ${g.BORDER}`,borderRadius:"var(--mantine-radius-sm)",background:g.PANEL},children:[n.jsxs(o.Table,{ref:at,role:"grid","aria-label":p===void 0&&f===void 0?q.dataTable:f,"aria-labelledby":p,"aria-rowcount":pe+1,"aria-colcount":Ye,"aria-multiselectable":T==="multiple"?!0:void 0,onKeyDown:Fo,stickyHeader:!0,tabularNums:!0,withRowBorders:!1,horizontalSpacing:0,verticalSpacing:0,highlightOnHover:gt,highlightOnHoverColor:g.SURFACE,style:{display:"grid",width:"100%",minWidth:Vo,fontSize:tr,lineHeight:nr},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:v},children:ee.map((d,E)=>{const _=Ee.get(d.id),V=d.getCanSort(),Q=d.getIsSorted(),me=ve.row===le&&ve.column===E,mt=Q===!1?-1:d.getSortIndex(),bt=me?0:-1,lt=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:Q===!1?void 0:g.VALUE},children:(_==null?void 0:_.header)??d.id}),Q!==!1&&n.jsx(o.Box,{component:"span","data-testid":"data-table-sort-glyph","data-direction":Gn(Q),"aria-hidden":"true",style:{flex:"0 0 auto",display:"flex",alignItems:"center",color:g.VALUE,transform:Q==="asc"?"rotate(180deg)":void 0},children:n.jsx(ie,{name:"chevronDown",size:u.CHEVRON})}),Ge.length>1&&mt>=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:J.format(mt+1)})]});return n.jsx(o.Table.Th,{scope:"col","data-testid":"data-table-header","aria-colindex":E+1,"aria-sort":V?Gn(Q):void 0,"data-grid-row":V?void 0:le,"data-grid-column":V?void 0:E,tabIndex:V?void 0:bt,className:V?void 0:Mn,onFocus:V?void 0:()=>{tt(je=>wt(je,{row:le,column:E})?je:{row:le,column:E})},style:{...fn(_,E),gap:u.GUTTER/2,height:v,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":le,"data-grid-column":E,tabIndex:bt,onClick:je=>{tt({row:le,column:E}),Go(d,je)},onFocus:()=>{tt(je=>wt(je,{row:le,column:E})?je:{row:le,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:lt}):lt},d.id)})})}),n.jsx(o.Table.Tbody,{style:{display:"grid",position:"relative",height:ze.getTotalSize()},children:At.map(d=>{const E=M[d.index-de];if(E===void 0)return null;const _=W.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":gt?_:void 0,onDoubleClick:V=>{k==null||k(E.original,V)},onContextMenu:V=>{K==null||K(E.original,V)},style:{display:"flex",position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:b,transform:`translateY(${String(d.start)}px)`,background:_?or:void 0,cursor:gt?"pointer":void 0},children:ee.map((V,Q)=>{const me=Ee.get(V.id),mt=ve.row===d.index&&ve.column===Q,bt=me==null?void 0:me.value(E.original),lt=Dn(bt,he),je=(me==null?void 0:me.cell)===void 0?n.jsx(o.Box,{component:"span",dir:"auto",style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:lt}):me.cell(E.original);return n.jsx(o.Table.Td,{role:"gridcell","data-testid":"data-table-cell","aria-colindex":Q+1,"data-grid-row":d.index,"data-grid-column":Q,tabIndex:mt?0:-1,className:Mn,title:(me==null?void 0:me.cell)===void 0?lt:void 0,onFocus:()=>{tt(Le=>wt(Le,{row:d.index,column:Q})?Le:{row:d.index,column:Q})},onClick:Le=>{tt({row:d.index,column:Q}),ht(d.index,{extend:Le.shiftKey,toggle:Le.metaKey||Le.ctrlKey},Le),pn(d.index,Le,it(Le))},style:fn(me,Q),children:je},V.id)})},E.id)})})]}),pe===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:Uo()})]})]})}const ar=r.forwardRef(rr);function lr(){return crypto.randomUUID().slice(0,8)}function Tt(e,t){return{id:lr(),offset:e,color:t}}function To(){return[Tt(0,"#6366F1"),Tt(1,"#06B6D4")]}const cr=2,dr=5,ur=80,pr=0,Gt=100,Bt=0,fr=360,xr=[0,90,180,270,360];function hr({stops:e,defaultStops:t,direction:s,defaultDirection:i=Bt,showDirection:a=!0,onChange:l,onChangeStart:c,onChangeEnd:x,minStops:f=cr,maxStops:p=dr}){const h=oe(),m=Je({maximumFractionDigits:0}),b=r.useId(),v=r.useId(),z=r.useMemo(()=>To(),[]),[T,C]=X.useUncontrolled({value:e,defaultValue:t,finalValue:z,onChange:(A,H)=>{l==null||l(A,R,H)}}),[R,I]=X.useUncontrolled({value:s,defaultValue:i,finalValue:Bt,onChange:(A,H)=>{l==null||l(T,A,H)}}),w=r.useRef(!1),P=A=>{w.current||(w.current=!0,c==null||c(A))},j=(A,H)=>{w.current=!1,x==null||x(A,H)},L=(A,H)=>T.map((y,S)=>S===A?{...y,color:H}:y),D=(A,H)=>T.map((y,S)=>S===A?{...y,offset:H/Gt}:y),U=A=>{if(T.length>=p)return;const H=T[T.length-1],y=H===void 0?.5:(H.offset+1)/2,S=[...T,Tt(y,Et)];S.sort((O,k)=>O.offset-k.offset),C(S,A)},B=(A,H)=>{T.length<=f||C(T.filter((y,S)=>S!==A),H)},N=T.length>=p,$=T.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(ie,{name:"plus",size:u.CHEVRON})})]}),n.jsx(o.Stack,{"data-testid":"gradient-editor-stops",gap:"xs",role:"group","aria-labelledby":b,children:T.map((A,H)=>{const y=m.format(H+1);return n.jsxs(o.Group,{"data-testid":"gradient-editor-stop",gap:"xs",align:"flex-end",wrap:"nowrap",children:[n.jsx(Io,{color:A.color,defaultColor:Et,onColorChange:(S,O)=>{C(L(H,S??Et),O)},showOpacity:!1}),n.jsx(o.Box,{style:{width:ur},children:n.jsx(o.Slider,{"data-testid":"gradient-editor-stop-position",min:pr,max:Gt,value:A.offset*Gt,onPointerDown:P,onChange:S=>{P(),C(D(H,S))},onChangeEnd:S=>{j(D(H,S),R)},label:S=>h.percent(m.format(S)),thumbLabel:h.colorStopPosition(y)})}),n.jsx(o.ActionIcon,{variant:"subtle",color:"gray",size:u.TRAIL,onClick:S=>{B(H,S)},"data-testid":"gradient-editor-remove-stop",disabled:$,"aria-label":h.removeColorStop(y),children:n.jsx(ie,{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:Bt,max:fr,value:R,onPointerDown:P,onChange:A=>{P(),I(A)},onChangeEnd:A=>{j(T,A)},label:A=>h.degrees(m.format(A)),thumbLabel:h.gradientDirection,marks:xr.map(A=>({value:A,label:h.degrees(m.format(A))}))})]})]})}const gr=4,mr=2,br=1.1;function yr(){const e=$e();return r.useMemo(()=>{var s;return((s=new Intl.NumberFormat(e).formatToParts(br).find(i=>i.type==="decimal"))==null?void 0:s.value)??"."},[e])}function vr({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 z=oe(),T=st({name:e,disabled:h,disabledReason:m}),C=Zt(),R=yr(),[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 B=A=>{U.current=!0,D(A)},N=A=>{const H=typeof L=="string"?C(L):L;if(Number.isNaN(H)){D(I??s),v==null||v(A);return}let y=H;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:gr,wrap:"nowrap",align:"flex-end",title:T.title,"data-disabled":h?"true":void 0,children:[n.jsx(o.NumberInput,{"data-testid":"style-number-input-field",label:e,description:T.description,value:L,onChange:B,onFocus:b,onBlur:N,min:a,max:l,step:c,decimalScale:x,decimalSeparator:R,suffix:f,hideControls:p,disabled:h,"data-is-default":P?"true":"false",styles:{input:P?{fontStyle:"italic",color:g.CHROME}:void 0,description:Ct},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":z.resetToDefault(e),onClick:$,style:{marginBlockEnd:mr},children:n.jsx(ie,{name:"reset",size:u.CHEVRON})})]})}const wr=4,Sr=2;function Ir({label:e,value:t,defaultValue:s,options:i,onChange:a,disabled:l=!1,disabledReason:c,onFocus:x,onBlur:f}){const p=oe(),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,z=m??s,T=R=>{R!==null&&b(R)},C=R=>{b(void 0,R)};return n.jsxs(o.Group,{"data-testid":"style-select",gap:wr,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:z,onChange:T,onFocus:x,onBlur:f,data:i,rightSection:n.jsx(ie,{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:Ct},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(ie,{name:"reset",size:u.CHEVRON})})]})}const St=4,Er=`${String(u.TOGGLE_PITCH)}px`;function Cr({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=oe(),[v,z]=X.useUncontrolled({value:t,defaultValue:s,finalValue:!1,onChange:i}),T=P=>{z(P.currentTarget.checked,P)},C={root:{minWidth:0},body:{alignItems:"center",minWidth:0},labelWrapper:{minWidth:0},label:{display:"block",height:u.TOGGLE_PITCH,paddingInlineStart:St,fontSize:"var(--mantine-font-size-sm)",lineHeight:Er,color:a?g.DISABLED:g.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},R=x??b.fieldBound,I=st({name:e,enabledTitle:e,disabled:a,disabledReason:l,extraDescriptions:c?[R]: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:T,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:St},children:[c?n.jsxs(o.Box,{"data-testid":"toggle-with-content-row",style:{display:"flex",alignItems:"center",gap:St},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(Ze,{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:St,paddingInlineStart:u.GUTTER},children:h})]})}function zo(e,t){return e!==void 0?e:t===void 0?"off":"polite"}function Ue(e,t){const s=zo(e,t);return s==="off"?{"aria-busy":t}:{"aria-live":s,"aria-atomic":!0,"aria-busy":t}}const Ft=4,Tr="(hover: none)";function zr(e){if(typeof e=="string")return e;if(typeof e=="number")return String(e)}function Rr(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=Ue(a,i),{hovered:v,ref:z}=X.useHover(),T=X.useMediaQuery(Tr)??!1,[C,R]=r.useState(!1),I=r.useId(),w=C||(x??(v||T)),P=l!==void 0||c!==void 0,j=zr(t),L=s!==void 0&&s!==j,D=s??j,U=P&&t!==void 0,B=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;_e(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=>{R(!0),h==null||h(S)},$=S=>{S.currentTarget.contains(S.relatedTarget)||R(!1),m==null||m(S)},A=S=>{f||p==null||p(S,it(S))},H={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={...H,alignSelf:"stretch",lineHeight:`${u.ROW_PITCH}px`,textAlign:"start",borderRadius:"var(--mantine-radius-sm)"};return n.jsxs(o.Box,{ref:z,"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:H,children:B}):n.jsx(o.UnstyledButton,{type:"button",id:I,"data-testid":"action-row-state",title:D,...b,onClick:A,style:y,children:B})),P&&n.jsxs(o.Box,{"data-testid":"action-row-affordances",style:{flex:"0 0 auto",marginInlineStart:"auto",display:"flex",alignItems:"center",gap:Ft},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:Ft,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:Ft},children:c})]})]})}const Ro=u.GUTTER,Pr=12,Po=1.2,Ar=20,jr=500,Lr="var(--mantine-primary-color-light)";function _r({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(),z=c!==void 0,T=s!=null,C=t!=null,R=ut(m),I=a==="option",w=I?i:void 0,P=!I&&i?!0:void 0,j=B=>{c==null||c(B,it(B))};let L="transparent";i?L=Lr:z&&b&&(L=g.SURFACE);const D=n.jsxs(n.Fragment,{children:[T&&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:z?"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:Ro,borderRadius:"var(--mantine-radius-sm)",background:L,color:g.VALUE,fontSize:Pr,lineHeight:Po},children:[z?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}),R&&n.jsx(Ce,{children:m})]})}function Or({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=Je(),p=a!==void 0,h=c!=="none",m=z=>{x(c==="ascending"?"descending":"ascending",z)},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(an,{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(ie,{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:Ar,paddingInline:Ro,fontSize:"var(--mantine-font-size-sm)",lineHeight:Po,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 an({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:jr,textTransform:"none",letterSpacing:"normal"},children:e})}const Bn=2,Hr=1,Nr=13,Dr=2,kr=1,Mr=1,Gr=64,Ao=4,Fn=Ao/2,jo=4,Br=12,qe=100,Fr=1.5,Kt=100;function zt({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 Lo(){return n.jsx(o.Box,{"data-testid":"chart-baseline",style:{flex:"0 0 auto",height:Hr,background:g.BORDER}})}function _o({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 Vr(e,t){if(e.length===0)return null;const s=qe/2;if(e.length===1)return`0,${s} ${qe},${s}`;const i=Math.min(...e),l=Math.max(...e)-i,c=e.length-1;return e.map((x,f)=>{const p=xs(f/c,qe,t),h=l===0?s:qe-(x-i)/l*qe;return`${p},${h}`}).join(" ")}function Oo(){const e=r.useId(),t=`${e}min`,s=`${e}max`;return{min:t,max:s,describedBy:`${t} ${s}`}}function Ur({bins:e,label:t,minLabel:s,maxLabel:i,busy:a,live:l,trailing:c}){const x=Je(),f=Oo(),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",...Ue(l,a),style:{flex:"1 1 auto",minWidth:0,height:"100%",display:"flex",flexDirection:"column",gap:Bn},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:Bn},children:[n.jsx(o.Box,{"data-testid":"histogram-plot",style:{flex:"1 1 auto",minHeight:0,display:"flex",alignItems:"flex-end",gap:Dr},children:e.map((m,b)=>{const v=Math.max(0,m.count),z=p===0?0:v/p*Kt,T=m.highlighted===!0;return n.jsx(o.Box,{"data-testid":"histogram-bar","data-highlighted":T?"true":"false","aria-hidden":"true",title:m.label,style:{flex:"1 1 0",minWidth:0,height:`${String(z)}%`,minHeight:v>0?Mr:0,background:T?g.ACCENT:g.BORDER,borderRadius:kr}},`${m.label}-${String(b)}`)})}),n.jsx(Lo,{})]}),n.jsxs(o.Box,{"data-testid":"chart-axis",style:{flex:"0 0 auto",height:Nr,display:"flex",alignItems:"center",justifyContent:"space-between",gap:jo},children:[n.jsx(zt,{end:"min",id:f.min,children:s}),n.jsx(zt,{end:"max",id:f.max,children:i})]})]}),n.jsx(_o,{caption:t,rows:h,testId:"histogram-values"}),ut(c)&&n.jsx(Ce,{children:c})]})}function $r({values:e,label:t,minLabel:s,maxLabel:i,busy:a,live:l,trailing:c}){const x=Oe(),f=Je(),p=Oo(),h=Vr(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",...Ue(l,a),style:{flex:"1 1 auto",minWidth:0,display:"flex",alignItems:"center",gap:jo},children:[n.jsx(zt,{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(qe)} ${String(qe)}`,preserveAspectRatio:"none",fill:"none",stroke:"currentColor",strokeWidth:Fr,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(Lo,{})]}),n.jsx(zt,{end:"max",id:p.max,children:i})]}),n.jsx(_o,{caption:t,rows:m,testId:"sparkline-values"}),ut(c)&&n.jsx(Ce,{children:c})]})}function Wr({name:e,percentile:t,value:s,rank:i,busy:a,live:l,onClick:c,onDoubleClick:x,onContextMenu:f,onFocus:p,onBlur:h}){const m=oe(),b=uo(),v=r.useId(),z=c,T=z!==void 0,C=Math.min(Kt,Math.max(0,t)),R=m.percentile(b(Math.round(C))),I=P=>{z!==void 0&&z(P,it(P))},w=P=>{z!==void 0&&(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),z(P,it(P)))};return n.jsxs(o.Box,{"data-testid":"metric-row",role:T?"button":void 0,tabIndex:T?0:void 0,...Ue(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:T?"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:Br,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":Kt,"aria-valuenow":C,"aria-valuetext":R,title:R,size:Ao,style:{flex:`0 0 ${String(Gr)}px`,borderRadius:Fn,background:g.SURFACE},children:n.jsx(o.Progress.Section,{"data-testid":"metric-row-fill",value:C,withAria:!1,color:g.ACCENT,style:{borderRadius:Fn}})}),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(an,{children:i})]})}const Ho=r.createContext(!1);function No({showLabels:e=!1,children:t}){return n.jsx(Ho.Provider,{value:e,children:t})}function pt(){return r.useContext(Ho)}const Yr=u.VALUE_INSET-u.GLYPH_SLOT,Xr=2,Kr=1,qr=2,Zr=3;function Jr(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 Qr({segment:e,grow:t,index:s}){const{glyph:i,value:a,unit:l,mono:c=!1}=e;let x=null;Jt(i)?x=n.jsx(Ze,{name:i}):Qt(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=Jr(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:Yr},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:Xr,fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:g.CHROME},children:l})]})}function ea(e,t){if(!(t>=qr&&t<=Zr))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 ta(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 na({label:e,segments:t,width:s=u.BODY,trailing:i,busy:a,live:l,onClick:c,onFocus:x,onBlur:f}){const p=pt(),h=r.useId(),m=t.filter(L=>L.grow===!0).length;_e(ea(e,t.length)),_e(ta(e,m));const b=t.findIndex(L=>L.grow===!0),v=b===-1?0:b,z=c!==void 0,T=zo(l,a)!=="off",C=z||T,R=z?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:z?"pointer":void 0},j=n.jsxs(n.Fragment,{children:[C&&n.jsx(o.VisuallyHidden,{id:R,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:Kr,height:u.CONTROL_HEIGHT,background:g.PANEL}}),n.jsx(Qr,{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}),z?n.jsx(o.UnstyledButton,{type:"button",title:e,"data-testid":"compound-row-box","data-interactive":"true",...Ue(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",...Ue(l,a),onFocus:x,onBlur:f,style:P,children:j}),n.jsx(Ce,{children:i})]})}const Vt=u.VALUE_INSET-u.GLYPH_SLOT,It=4,Vn=4,oa=u.VALUE_INSET+u.LABEL_COLUMN,Un={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0},Do=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:z,pending:T=!1,min:C,max:R,step:I,onScrubStart:w,onScrub:P,onScrubEnd:j,onClick:L,disabled:D=!1,readOnly:U,boundDescription:B,pendingDescription:N,title:$,style:A,className:H,onKeyDown:y,...S}=t,O=pt(),k=oe(),K=Oe(),Se=X.useMediaQuery("(pointer: coarse)"),[be,se]=X.useUncontrolled({value:c===null?"":c,defaultValue:x,finalValue:"",onChange:f}),q=l??(p!==void 0?"select":"text"),te=q==="select",F=q==="select"&&p!==void 0,J=U??(f===void 0&&x===void 0),Z=String(be),Ie=z===!0,he=v||Ie;let W;v?W=k.mixed:Ie?W=Z:typeof z=="string"&&(W=z);const ce=[];v&&ce.push(k.mixed);const He=B??k.fieldBound,We=N??k.fieldPending;b&&He!==""&&ce.push(He),T&&We!==""&&ce.push(We);const Pe=ce.length>0?ce.join(". "):void 0,ae=(w!==void 0||P!==void 0||j!==void 0)&&!D&&!Se,Ne=r.useRef(!1),ge=r.useRef(!1),Ae=r.useRef(0),Ee=M=>{if(!ae||M.button!==0)return;M.preventDefault(),M.stopPropagation();const ee=M.currentTarget;typeof ee.setPointerCapture=="function"&&ee.setPointerCapture(M.pointerId),Ne.current=!0,ge.current=!1,Ae.current=M.clientX},De=M=>{if(!Ne.current)return;const ee=M.clientX-Ae.current;ee!==0&&(Ae.current=M.clientX,ge.current||(ge.current=!0,w==null||w(M)),P==null||P(xe(K)?-ee:ee,M))},ke=M=>{Ne.current&&(Ne.current=!1,ge.current&&(ge.current=!1,j==null||j(M)))},Qe=M=>{D||L==null||L(M)},xt=M=>{y==null||y(M),!(L===void 0||D||M.defaultPrevented)&&(F||(M.key==="Enter"||M.key===" "&&J)&&(M.preventDefault(),L(M)))},et=(M,ee)=>{se(M,ee)};let Me=null;Jt(a)?Me=n.jsx(Ze,{name:a,filled:b}):Qt(a)?Me=n.jsx(o.Box,{component:"span","data-letter":a,style:{fontSize:"var(--mantine-font-size-sm)",lineHeight:1},children:a}):a!=null&&(Me=a);const Ge=n.jsxs(n.Fragment,{children:[n.jsxs(o.Box,{"data-testid":"panel-field-slot","data-scrub":ae?"true":void 0,onPointerDown:ae?Ee:void 0,onPointerMove:ae?De:void 0,onPointerUp:ae?ke:void 0,onPointerCancel:ae?ke:void 0,onLostPointerCapture:ae?ke: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:ae?"ew-resize":void 0,touchAction:ae?"none":void 0},children:[Me,T&&n.jsx(o.Box,{"data-testid":"panel-field-pending",style:{position:"absolute",insetInlineStart:0,bottom:0,width:Vn,height:Vn,background:g.ACCENT}})]}),O&&n.jsx(o.Box,{component:"span","data-testid":"panel-field-label","aria-hidden":"true",style:{flex:"1 1 auto",minWidth:0,marginInlineStart:It,fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:g.CHROME,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i})]}),Te=h!==void 0,Y=Te||te?n.jsxs(n.Fragment,{children:[Te&&n.jsx(o.Box,{component:"span","data-testid":"panel-field-unit",style:{flex:"0 0 auto",lineHeight:1},children:h}),te&&n.jsx(o.Box,{component:"span","data-testid":"panel-field-chevron",style:{flex:"0 0 auto",display:"flex",alignItems:"center",marginInlineStart:Te?It:0},children:n.jsx(ie,{name:"chevronDown",size:u.GLYPH})})]}):void 0;let re=Vt+It;te&&(re+=u.GLYPH),te&&Te&&(re+=It);const ne=Y===void 0?void 0:`calc(${String((h==null?void 0:h.length)??0)}ch + ${String(re)}px)`,ye=ae?"auto":"none",ue={"data-testid":"panel-field-value",...S,ref:s,className:H,label:i,description:Pe,placeholder:W,disabled:D,readOnly:J,onClick:Qe,onKeyDown:xt,leftSection:Ge,leftSectionWidth:O?oa:u.VALUE_INSET,leftSectionPointerEvents:ye,leftSectionProps:{style:{insetInlineStart:0,justifyContent:"flex-start",paddingInlineStart:Vt}},rightSection:Y,rightSectionWidth:ne,rightSectionPointerEvents:"none",rightSectionProps:{style:{insetInlineEnd:0,justifyContent:"flex-end",paddingInlineEnd:Vt,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:Un,description:Un},wrapperProps:{title:$??i,"data-testid":"panel-field","data-kind":q,"data-bound":b?"true":void 0,"data-mixed":v?"true":void 0,"data-pending":T?"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 q==="number"?n.jsx(o.NumberInput,{...ue,value:he?"":be,onChange:et,min:C,max:R,step:I,hideControls:!0}):F?n.jsx(o.Select,{...ue,data:p,value:he||Z===""?null:Z,onChange:M=>{et(M??"")}}):n.jsx(o.TextInput,{...ue,value:he?"":Z,onChange:M=>{et(M.currentTarget.value,M)}})}),ia=2,sa=u.BODY+u.TRAIL_GAP;function ra(e){return r.Children.toArray(e).flatMap(t=>r.isValidElement(t)&&t.type===r.Fragment?r.Children.toArray(t.props.children):[t])}function $n(e,t){return r.isValidElement(e)&&e.key!==null?e.key:`field-row-${String(t)}`}function aa(e){if(r.isValidElement(e)&&typeof e.props.label=="string")return e.props.label}function Wn(e){return r.isValidElement(e)&&e.type===Do?r.cloneElement(e,{width:"fill"}):e}const la=r.forwardRef(function({children:t,trailing:s,groupLabel:i,role:a,style:l,"aria-label":c,"aria-labelledby":x,...f},p){const h=pt(),m=ra(t),b=m.length;_e(b===0||b>ia?`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,T=a??(v!==void 0||x!==void 0?"group":void 0),C=ut(s);if(h&&b>1)return n.jsx(o.Box,{ref:p,"data-testid":"field-row-labelled","data-fields":b,role:T,"aria-label":v,"aria-labelledby":x,...f,style:{display:"flex",flexDirection:"column",...l},children:m.map((j,L)=>{const D=aa(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(No,{showLabels:!1,children:Wn(j)})}),n.jsx(Ce,{children:L===0?s:null})]},$n(j,L))})});const R=b<=1,I=R&&!C;let w=u.FIELD;R&&(w=I?sa: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:T,"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:Wn(j)},$n(j,L))),n.jsx(Ce,{children:s})]})}),ca=2,da=6,ko=1,ua=u.CONTROL_HEIGHT-ko*2,pa=2,Yn=3,fa=4,xa=6,ha=u.GLYPH,ga=3;function ma(e,t){return t?g.DISABLED:e?g.ON_SELECTED:g.CHROME}function ba(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:z}=e,T=pt(),C=t.length,R=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);_e(C<ca||C>da?`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<=ga?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()},B=t.map(N=>{const $=N.value===w,A=f||N.disabled===!0,H=T||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:H?fa:0,paddingInline:H?xa:0,width:"100%",minWidth:0,color:ma($,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}),H?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:R.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:B,value:w,onChange:N=>{const $=j.current;j.current=void 0,P(N,$)},onChangeCapture:N=>{j.current=N},onKeyDown:U,onFocus:v,onBlur:z,name:x,disabled:f,radius:"sm","aria-label":l,"aria-labelledby":c,"aria-describedby":R.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:ko,gap:pa,backgroundColor:g.SURFACE,overflow:"visible"},control:{flex:"1 1 auto",minWidth:ha},label:{display:"flex",alignItems:"center",justifyContent:"center",height:ua,padding:0,borderRadius:Yn,fontSize:"var(--mantine-font-size-sm)"},innerLabel:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",minWidth:0},indicator:{backgroundColor:g.SELECTED,borderRadius:Yn,boxShadow:"none"}}}),R.description!==void 0&&n.jsx(o.VisuallyHidden,{id:R.describedBy,children:R.description}),n.jsx(Ce,{children:b})]})}const ya=12,va=1.5,Xn=1.4,Kn=4,wa=20,qn=220,Zn=2,Jn=new RegExp("\\p{Sentence_Terminal}","u"),Sa=/[.!?]/u,Qn=/\s/u;function Ia(e){const t=Array.from(e);let s=0,i=0,a=0;for(;i<t.length;){if(!Jn.test(t[i])){i+=1;continue}let c=i;for(;c+1<t.length&&Jn.test(t[c+1]);)c+=1;const x=t[c+1],f=Sa.test(t[c]);i=c+1,(!f||x===void 0||Qn.test(x))&&(s+=1,a=i)}return t.slice(a).some(c=>!Qn.test(c))?s+1:s}function Ea(e){return Array.from(e).length}function Ca(e,t){if(e!=="reading"||typeof t!="string")return;const s=Ea(t);if(s>qn)return`ProseBlock was given a reading of ${String(s)} characters, and a reading is at most ${String(qn)} characters. Shorten it, or it has stopped being a reading and become an explanation.`;const i=Ia(t);if(i>Zn)return`ProseBlock was given a reading of ${String(i)} sentences, and a reading is at most ${String(Zn)} sentences. Delete any sentence that repeats what is already on screen, and move the rest into an InfoCircle.`}function Ta(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 za({variant:e,children:t,onDetails:s,busy:i,live:a}){const l=oe(),c=Oe(),x=r.useId();_e(Ca(e,t)),_e(Ta(e,s));const f=Ue(a,i);if(e==="reading")return n.jsx(o.Text,{...f,"data-testid":"prose-block","data-variant":e,style:{fontSize:ya,lineHeight:va,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:Kn},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(ie,{name:"warning",size:u.GLYPH})}),n.jsx(o.Text,{span:!0,size:"sm","data-testid":"prose-block-text",style:{lineHeight:Xn,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:Kn,blockSize:wa},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:Xn,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(ie,{name:xe(c)?"chevronLeft":"chevronRight",size:u.CHEVRON})})]})}const Ut=4,Ra=4,Pa=`polygon(0 calc(100% - ${Ra}px), 100% 0, 100% 100%, 0 100%)`,Aa=120,ja=`linear-gradient(to right, ${g.SURFACE}, ${g.ACCENT})`,La={sqrt:"scaleSqrt",linear:"scaleLinear",log:"scaleLog"},eo={flex:"0 0 auto",lineHeight:1,color:g.CHROME,whiteSpace:"nowrap"};function _a({min:e,max:t,label:s,variant:i="size",gradient:a,scale:l,busy:c,live:x,onScaleClick:f,trailing:p}){const h=oe(),m=Oe(),b=r.useId(),v=i==="color",z=l===void 0?void 0:La[l],T=z===void 0?void 0:h[z],C=`${b}-label`,R=`${b}-min`,I=`${b}-max`,w=`${b}-scale`,P=[s===void 0?void 0:C,R,I,T===void 0?void 0:w].filter(D=>D!==void 0);let j=null;z!==void 0&&T!==void 0&&(f===void 0?j=n.jsx(o.Box,{"data-testid":"ramp-row-scale","aria-hidden":"true",title:T,style:{flex:"0 0 auto",width:u.TRAIL,height:u.CONTROL_HEIGHT,display:"flex",alignItems:"center",justifyContent:"center",color:g.CHROME},children:n.jsx(Ze,{name:z})}):j=n.jsx(Co,{label:T,icon:n.jsx(Ze,{name:z}),onClick:f}));const L=ut(p)?p:j;return n.jsxs(o.Box,{"data-testid":"ramp-row","data-variant":i,"data-scale":l,style:{display:"flex",alignItems:"center",gap:Ut,height:u.ROW_PITCH},children:[n.jsxs(o.Box,{"data-testid":"ramp-row-figure",role:"img","aria-labelledby":P.join(" "),...Ue(x,c),style:{flex:"1 1 auto",minWidth:0,display:"flex",alignItems:"center",gap:Ut},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:R,"data-testid":"ramp-row-min",style:eo,children:e}),n.jsx(o.Box,{"data-testid":"ramp-row-ramp","data-variant":i,"aria-hidden":"true",style:{flex:"1 1 auto",minWidth:Aa,height:u.GLYPH,boxSizing:"border-box",background:v?a??ja:g.CHROME,borderRadius:v?"var(--mantine-radius-xs)":void 0,border:v?`1px solid ${g.BORDER}`:void 0,clipPath:v?void 0:Pa,...hs(m)}}),n.jsx(o.Text,{span:!0,size:"sm",id:I,"data-testid":"ramp-row-max",style:eo,children:t}),T!==void 0&&n.jsx(o.VisuallyHidden,{"data-testid":"ramp-row-a11y-scale",id:w,children:T})]}),n.jsx(o.Box,{style:{flex:"0 0 auto",display:"flex",marginInlineStart:u.TRAIL_GAP-Ut},children:n.jsx(Ce,{children:L})})]})}const Oa=4,Ha=`${String(u.TOGGLE_PITCH)}px`,Na=2;function Da({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=oe(),[v,z]=X.useUncontrolled({value:t,defaultValue:s,finalValue:!1,onChange:i}),T=j=>{z(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:Oa,fontSize:"var(--mantine-font-size-sm)",lineHeight:Ha,color:c?g.DISABLED:g.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},R=p??b.fieldBound,I=st({name:e,enabledTitle:e,disabled:c,disabledReason:x,extraDescriptions:f?[R]: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(Ze,{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:T,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:T,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(Ce,{children:l})]})}function ka({children:e,label:t,labelledBy:s}){const i=r.Children.toArray(e).length;return _e(i<Na?`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 Ma(e="dark"){return o.useComputedColorScheme(e)}const Ga={xs:o.rem(4),sm:o.rem(8),md:o.rem(16),lg:o.rem(24),xl:o.rem(32)},Ba={HEIGHT:24,FONT_SIZE:11,CONTROL_PADDING:8,SECTION_GAP:4};exports.ActionRow=Rr;exports.AdvancedButton=Co;exports.COMPACT_SIZING=Ba;exports.CompactColorInput=Io;exports.CompoundRow=na;exports.ControlGroup=Hs;exports.ControlSection=Bs;exports.ControlSubGroup=Us;exports.DEFAULT_GRADIENT_STOP_COLOR=Et;exports.DataRow=_r;exports.DataRowHeader=Or;exports.DataTable=ar;exports.FIELD_GLYPH_NAMES=ho;exports.FIELD_LETTERS=go;exports.FieldGlyph=Ze;exports.FieldRow=la;exports.GradientEditor=hr;exports.HistogramRow=Ur;exports.IconGroupRow=ba;exports.InfoCircle=Eo;exports.LabelsProvider=vi;exports.MANTINE_SPACING=Ga;exports.MAX_ALPHA_HEX=en;exports.MAX_OPACITY_PERCENT=tn;exports.MetricRow=Wr;exports.PANEL_GRID=u;exports.PANEL_INK=g;exports.POPOUT_GAP=io;exports.POPOUT_NESTED_GAP=so;exports.POPOUT_Z_INDEX_BASE=$t;exports.PanelField=Do;exports.PanelLabelsProvider=No;exports.Popout=Ve;exports.PopoutButton=Es;exports.PopoutManager=So;exports.PopoutRegion=as;exports.ProseBlock=za;exports.RampRow=_a;exports.RankChip=an;exports.SWATCH_COLORS_HEXA=xo;exports.SparklineRow=$r;exports.StyleNumberInput=vr;exports.StyleSelect=Ir;exports.ToggleRow=Da;exports.ToggleRowGroup=ka;exports.ToggleWithContent=Cr;exports.TrailingSlot=Ce;exports.UI_GLYPH_NAMES=Xi;exports.UiGlyph=ie;exports.compactColors=no;exports.compactDarkColors=to;exports.compactTheme=Yi;exports.compactThemeOverride=fo;exports.createColorStop=Tt;exports.createDefaultGradientStops=To;exports.defaultLabels=lo;exports.getActivationMeta=it;exports.isFieldGlyphName=Jt;exports.isFieldLetter=Qt;exports.isRtl=xe;exports.isValidHex=Qi;exports.opacityToAlphaHex=on;exports.parseAlphaFromHexa=nn;exports.parseHexaColor=Zi;exports.parseLocaleNumber=co;exports.toHexaColor=Ji;exports.useActualColorScheme=Ma;exports.useCollator=po;exports.useDirection=Oe;exports.useLabels=oe;exports.useLocale=$e;exports.useNumberFormatter=Je;exports.useNumberParser=Zt;exports.useOrdinalFormatter=uo;exports.usePanelLabels=pt;exports.usePopoutManager=ds;exports.usePopoutRegion=vo;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@mantine/core"),n=require("react/jsx-runtime"),a=require("react"),X=require("@mantine/hooks"),Yo=require("react-dom"),pe=require("@tanstack/react-table"),Xo=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)"},oo=["#d5d7da","#a3a8b1","#7a828e","#5f6873","#48525c","#374047","#2a3035","#1f2428","#161b22","#0d1117"],io={...o.DEFAULT_THEME.colors,dark:oo},Ko={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"}}},qo={compactSize:"sm",sizes:{xs:{"--ai-size":"18px"},sm:{"--ai-size":"24px"},md:{"--ai-size":"30px"},lg:{"--ai-size":"36px"},xl:{"--ai-size":"44px"}}};function Zo(t){return t==="light"?{"--ai-bd":"1px solid var(--ai-color)"}:{}}const ro={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 G(t,e){const r=e==null?t.compactSize:String(e);return t.sizes[r]??t.sizes[t.compactSize]}const Jo={Button:o.Button.extend({defaultProps:{size:"sm"},vars:(t,e)=>({root:G(Ko,e==null?void 0:e.size)})}),ActionIcon:o.ActionIcon.extend({defaultProps:{size:"sm",variant:"subtle"},vars:(t,e)=>({root:{...G(qo,e==null?void 0:e.size),...Zo(e==null?void 0:e.variant)}})}),CloseButton:o.CloseButton.extend({defaultProps:{size:"xs"},vars:(t,e)=>({root:G(ro,e==null?void 0:e.size)})})};function Zt(t,e){const r=l=>o.parseThemeColor({color:t??e.primaryColor,theme:e,colorScheme:l}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)",i=r("light"),s=r("dark");return i===s?i:`light-dark(${i}, ${s})`}function Ze(t,e){if(!(!t||!o.getAutoContrastValue(e==null?void 0:e.autoContrast,t)))return Zt(e==null?void 0:e.color,t)}function Qo(t,e){if(!t)return;const r=e??t.primaryColor,i=o.parseThemeColor({color:r,theme:t});if(!(!i.isThemeColor||i.shade!==void 0)&&Zt(r,t)==="light-dark(var(--mantine-color-white), var(--mantine-color-black))")return`var(--mantine-color-${i.color}-${o.getPrimaryShade(t,"light")})`}const ei=t=>{const e=o.defaultVariantColorsResolver(t);return t.variant==="filled"&&o.getAutoContrastValue(t.autoContrast,t.theme)?{...e,color:Zt(t.color,t.theme)}:e},ti={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"}}},ni={compactSize:"sm",sizes:{xs:{"--checkbox-size":"12px"},sm:{"--checkbox-size":"16px"},md:{"--checkbox-size":"20px"},lg:{"--checkbox-size":"24px"},xl:{"--checkbox-size":"28px"}}},oi={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"}}},yn={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"}}},ii={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"}}},ri={backgroundColor:"transparent"},ai={backgroundColor:"light-dark(var(--mantine-color-gray-2), var(--mantine-color-dark-6))"},_t={fontSize:11},wn={fontSize:10,marginTop:2},si={SegmentedControl:o.SegmentedControl.extend({defaultProps:{size:"sm",withItemsBorders:!1},vars:(t,e)=>({root:G(ii,e==null?void 0:e.size)}),styles:{root:ri,indicator:ai}}),Checkbox:o.Checkbox.extend({defaultProps:{size:"sm"},vars:(t,e)=>({root:{...G(ni,e==null?void 0:e.size),"--checkbox-icon-color":e!=null&&e.iconColor?void 0:Ze(t,e)}}),styles:{label:_t}}),Switch:o.Switch.extend({defaultProps:{size:"sm"},vars:(t,e)=>({root:{...G(ti,e==null?void 0:e.size),"--switch-color":Qo(t,e==null?void 0:e.color)}}),styles:{label:_t}}),Slider:o.Slider.extend({defaultProps:{size:"sm"},vars:(t,e)=>({root:G(yn,e==null?void 0:e.size)}),styles:{markLabel:wn}}),Radio:o.Radio.extend({defaultProps:{size:"sm"},vars:(t,e)=>({root:{...G(oi,e==null?void 0:e.size),"--radio-icon-color":e!=null&&e.iconColor?void 0:Ze(t,e)}}),styles:{label:_t}}),RangeSlider:o.RangeSlider.extend({defaultProps:{size:"sm"},vars:(t,e)=>({root:G(yn,e==null?void 0:e.size)}),styles:{markLabel:wn}})},li={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"}}},ci={compactSize:"sm",sizes:{xs:{"--avatar-size":"18px"},sm:{"--avatar-size":"24px"},md:{"--avatar-size":"30px"},lg:{"--avatar-size":"36px"},xl:{"--avatar-size":"44px"}}},di={compactSize:"sm",sizes:{xs:{"--ti-size":"18px"},sm:{"--ti-size":"24px"},md:{"--ti-size":"30px"},lg:{"--ti-size":"36px"},xl:{"--ti-size":"44px"}}},ui={compactSize:"sm",sizes:{xs:{"--indicator-size":"6px"},sm:{"--indicator-size":"8px"},md:{"--indicator-size":"10px"},lg:{"--indicator-size":"12px"},xl:{"--indicator-size":"14px"}}},fi={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"}}},xi={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"}}},pi={Text:o.Text.extend({}),Badge:o.Badge.extend({defaultProps:{size:"sm"},vars:(t,e)=>({root:{...G(li,e==null?void 0:e.size),"--badge-color":(e==null?void 0:e.color)===void 0&&(e==null?void 0:e.variant)===void 0?Ze(t,e):void 0}})}),Pill:o.Pill.extend({defaultProps:{size:"sm"},vars:(t,e)=>({root:G(xi,e==null?void 0:e.size)})}),Avatar:o.Avatar.extend({defaultProps:{size:"sm"},vars:(t,e)=>({root:G(ci,e==null?void 0:e.size)})}),ThemeIcon:o.ThemeIcon.extend({defaultProps:{size:"sm"},vars:(t,e)=>({root:{...G(di,e==null?void 0:e.size),"--ti-color":(e==null?void 0:e.color)===void 0&&(e==null?void 0:e.variant)===void 0?Ze(t,e):void 0}})}),Indicator:o.Indicator.extend({defaultProps:{size:"sm"},vars:(t,e)=>({root:{...G(ui,e==null?void 0:e.size),"--indicator-text-color":Ze(t,e)}})}),Kbd:o.Kbd.extend({defaultProps:{size:"sm"},vars:(t,e)=>({root:G(fi,e==null?void 0:e.size)})})},hi={compactSize:"sm",sizes:{xs:{"--loader-size":"14px"},sm:{"--loader-size":"18px"},md:{"--loader-size":"24px"},lg:{"--loader-size":"30px"},xl:{"--loader-size":"38px"}}},gi={compactSize:"sm",sizes:{xs:{"--progress-size":"2px"},sm:{"--progress-size":"4px"},md:{"--progress-size":"6px"},lg:{"--progress-size":"8px"},xl:{"--progress-size":"10px"}}},mi={label:{fontSize:9}},bi={Loader:o.Loader.extend({defaultProps:{size:"sm"},vars:(t,e)=>({root:G(hi,e==null?void 0:e.size)})}),Progress:o.Progress.extend({defaultProps:{size:"sm"},vars:(t,e)=>({root:G(gi,e==null?void 0:e.size)}),styles:mi}),RingProgress:o.RingProgress.extend({})},Wt=1e3,Fe=1100,ao=8,so=4,lo="light-dark(var(--mantine-primary-color-filled), var(--mantine-primary-color-5))",Pt={"--input-height":"24px","--input-size":"24px","--input-fz":"11px","--input-bg":"var(--mantine-color-default)","--input-bd":"transparent","--input-bd-focus":lo},co={"--input-fz":"11px","--input-bg":"var(--mantine-color-default)","--input-bd":"transparent","--input-bd-focus":lo},ot={fontSize:11,color:g.CHROME,marginBottom:1,lineHeight:1.2},Jt={paddingInlineStart:8,paddingInlineEnd:8,backgroundColor:"var(--mantine-color-default)"},Be={label:ot,input:Jt},Sn={label:ot,input:Jt},yt={dropdown:{padding:4,border:"none",boxShadow:"var(--mantine-shadow-md)"},option:{fontSize:11,padding:"4px 8px",borderRadius:4,"--mantine-color-white":"var(--mantine-primary-color-contrast)"},options:{},groupLabel:{fontSize:10,padding:"4px 8px"},empty:{fontSize:11,padding:"8px"}},Ht={input:{...Be.input,minHeight:"var(--input-height)",height:"auto",display:"flex",alignItems:"center",paddingTop:1,paddingBottom:1},pillsList:{columnGap:4,rowGap:2},pill:{margin:0}};function Se(t,e){return{...Pt,"--input-height":t,"--input-size":t,"--input-fz":e}}function ut(t){return{...co,"--input-fz":t}}function dt(t,e){return{...ut(e),"--input-height":t}}const Ke={compactSize:"sm",sizes:{xs:Se("20px","10px"),sm:Pt,md:Se("30px","13px"),lg:Se("36px","15px"),xl:Se("44px","17px")}},In={compactSize:"sm",sizes:{xs:ut("10px"),sm:co,md:ut("13px"),lg:ut("15px"),xl:ut("17px")}},vi={compactSize:"sm",sizes:{xs:{...Se("20px","10px"),"--input-right-section-width":"20px"},sm:{...Pt,"--input-right-section-width":"24px"},md:{...Se("30px","13px"),"--input-right-section-width":"30px"},lg:{...Se("36px","15px"),"--input-right-section-width":"36px"},xl:{...Se("44px","17px"),"--input-right-section-width":"44px"}}},yi={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"}}},wi={compactSize:"sm",sizes:{xs:{...Se("20px","10px"),"--combobox-chevron-size":"10px"},sm:{...Pt,"--combobox-chevron-size":"12px"},md:{...Se("30px","13px"),"--combobox-chevron-size":"14px"},lg:{...Se("36px","15px"),"--combobox-chevron-size":"16px"},xl:{...Se("44px","17px"),"--combobox-chevron-size":"18px"}}},Cn={compactSize:"sm",sizes:{xs:dt("20px","10px"),sm:dt("24px","11px"),md:dt("30px","13px"),lg:dt("36px","15px"),xl:dt("44px","17px")}},uo={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:t=>`${t} percentile`,expandSection:t=>`Expand ${t}`,collapseSection:t=>`Collapse ${t}`,addToSection:t=>`Add ${t}`,sectionHasConfiguredValues:t=>`${t} has configured values`,about:t=>`About ${t}`,resetToDefault:t=>`Reset ${t} to default`,colorSwatch:"Color swatch",colorHexValue:"Color hex value",opacity:"Opacity",colorPanelTitle:"Color",colorGenericName:"color",colorStops:"Color Stops",addColorStop:"Add color stop",colorStopPosition:t=>`Stop ${t} position`,removeColorStop:t=>`Remove color stop ${t}`,direction:"Direction",gradientDirection:"Gradient direction",degrees:t=>`${t}°`,percent:t=>`${t}%`,dataTable:"Data table",search:"Search",searchPlaceholder:"Search",clearSearch:"Clear search",noRows:"No rows",noMatchingRows:"No rows match the search",rowsShown:(t,e)=>`${t} of ${e} rows`,rowsSelected:t=>`${t} selected`,yes:"Yes",no:"No",closePanel:"Close panel",settings:"Settings",passwordReveal:"Show the password",ordinal:(t,e)=>{switch(e){case"one":return`${t}st`;case"two":return`${t}nd`;case"few":return`${t}rd`;default:return`${t}th`}}},Si="en",Yt=a.createContext(uo),Xt=a.createContext(void 0);function Ii(t){return t!==void 0&&t!==""?t:typeof document<"u"&&document.documentElement.lang!==""?document.documentElement.lang:typeof navigator<"u"&&navigator.language!==""?navigator.language:Si}function Ci({labels:t,locale:e,children:r}){const i=a.useContext(Yt),s=a.useContext(Xt),l=a.useMemo(()=>({...i,...t}),[i,t]),c=e??s;return n.jsx(Xt.Provider,{value:c,children:n.jsx(Yt.Provider,{value:l,children:r})})}function ne(){return a.useContext(Yt)}function $e(){const t=a.useContext(Xt);return Ii(t)}const Ei=1234.5,Ti="9876543210",Ri=9876543210,zi=new Set([" "," "," "," ","'","’"]),Pi="−",Ai=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?/iu,En=new Map;function ji(t){var x,f;const e=En.get(t);if(e!==void 0)return e;const r=new Intl.NumberFormat(t).formatToParts(Ei),i=((x=r.find(h=>h.type==="decimal"))==null?void 0:x.value)??".",s=((f=r.find(h=>h.type==="group"))==null?void 0:f.value)??"",l=new Map;for(const h of"0123456789")l.set(h,h);const c=new Intl.NumberFormat(t,{useGrouping:!1}).format(Ri);Array.from(c).forEach((h,m)=>{l.set(h,Ti[m])});const p={decimal:i,digits:l,group:s};return En.set(t,p),p}function fo(t,e){const r=ji(e);let i="";for(const l of t.trim()){const c=r.digits.get(l);if(c!==void 0){i+=c;continue}if(l===r.decimal){i+=".";continue}if(!(l===r.group||zi.has(l))){if(l==="-"||l===Pi){i+="-";continue}if(l==="+"){i+="+";continue}if(l==="e"||l==="E"){i+=l;continue}break}}const s=Ai.exec(i);return s===null?Number.NaN:Number(s[0])}function Qe(t){const e=$e(),r=JSON.stringify(t??{});return a.useMemo(()=>new Intl.NumberFormat(e,t),[e,r])}function xo(){const t=$e(),e=ne(),r=Qe(),i=a.useMemo(()=>new Intl.PluralRules(t,{type:"ordinal"}),[t]);return a.useCallback(s=>e.ordinal(r.format(s),i.select(s)),[e,r,i])}function po(t){const e=$e(),r=JSON.stringify(t??{});return a.useMemo(()=>new Intl.Collator(e,t),[e,r])}function Qt(){const t=$e();return a.useCallback(e=>fo(e,t),[t])}const Li="M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",Oi="M13.3536 2.35355C13.5488 2.15829 13.5488 1.84171 13.3536 1.64645C13.1583 1.45118 12.8417 1.45118 12.6464 1.64645L10.6828 3.61012C9.70652 3.21671 8.63759 3 7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C0.902945 9.08812 2.02314 10.1861 3.36061 10.9323L1.64645 12.6464C1.45118 12.8417 1.45118 13.1583 1.64645 13.3536C1.84171 13.5488 2.15829 13.5488 2.35355 13.3536L4.31723 11.3899C5.29348 11.7833 6.36241 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C14.0971 5.9119 12.9769 4.81391 11.6394 4.06771L13.3536 2.35355ZM9.90428 4.38861C9.15332 4.1361 8.34759 4 7.5 4C4.80285 4 2.52952 5.37816 1.09622 7.50001C1.87284 8.6497 2.89609 9.58106 4.09974 10.1931L9.90428 4.38861ZM5.09572 10.6114L10.9003 4.80685C12.1039 5.41894 13.1272 6.35031 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11C6.65241 11 5.84668 10.8639 5.09572 10.6114Z";function _i({reveal:t}){const e=ne();return n.jsxs(n.Fragment,{children:[n.jsx("svg",{viewBox:"0 0 15 15",fill:"none","aria-hidden":!0,style:{width:"var(--psi-icon-size)",height:"var(--psi-icon-size)"},children:n.jsx("path",{d:t?Oi:Li,fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}),n.jsx(o.VisuallyHidden,{children:e.passwordReveal})]})}const Hi={TextInput:o.TextInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(t,e)=>({root:{},wrapper:G(Ke,e==null?void 0:e.size)}),styles:Be}),NumberInput:o.NumberInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(t,e)=>({root:{},wrapper:G(vi,e==null?void 0:e.size),controls:G(yi,e==null?void 0:e.size)}),styles:{label:ot,input:Jt,control:{borderColor:"transparent"}}}),Select:o.Select.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:Fe}},vars:(t,e)=>({root:{},wrapper:G(Ke,e==null?void 0:e.size)}),styles:{...Be,...yt}}),Textarea:o.Textarea.extend({defaultProps:{size:"sm",variant:"filled"},vars:(t,e)=>({root:{},wrapper:G(In,e==null?void 0:e.size)}),styles:Sn}),PasswordInput:o.PasswordInput.extend({defaultProps:{size:"sm",variant:"filled",visibilityToggleButtonProps:{},visibilityToggleIcon:_i},vars:(t,e)=>({root:{},wrapper:G(Ke,e==null?void 0:e.size)}),styles:{...Be,innerInput:{paddingInlineStart:8,paddingInlineEnd:8}}}),Autocomplete:o.Autocomplete.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:Fe}},vars:(t,e)=>({root:{},wrapper:G(Ke,e==null?void 0:e.size)}),styles:{...Be,...yt}}),MultiSelect:o.MultiSelect.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:Fe}},vars:(t,e)=>({root:{},wrapper:G(wi,e==null?void 0:e.size)}),styles:{label:ot,...yt,...Ht,inputField:{minWidth:60,flexBasis:60}}}),TagsInput:o.TagsInput.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:Fe}},vars:(t,e)=>({root:{},wrapper:G(Cn,e==null?void 0:e.size)}),styles:{label:ot,...yt,...Ht,inputField:{minWidth:30,flexBasis:30}}}),PillsInput:o.PillsInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(t,e)=>({root:{},wrapper:G(Cn,e==null?void 0:e.size)}),styles:{label:ot,...Ht}}),FileInput:o.FileInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(t,e)=>({root:{},wrapper:G(Ke,e==null?void 0:e.size)}),styles:Be}),JsonInput:o.JsonInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(t,e)=>({root:{},wrapper:G(In,e==null?void 0:e.size)}),styles:Sn}),NativeSelect:o.NativeSelect.extend({defaultProps:{size:"sm",variant:"filled"},vars:(t,e)=>({root:{},wrapper:G(Ke,e==null?void 0:e.size)}),styles:Be}),ColorInput:o.ColorInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:(t,e)=>({root:{},wrapper:G(Ke,e==null?void 0:e.size),eyeDropperIcon:{},eyeDropperButton:{},colorPreview:{}}),styles:Be}),InputClearButton:o.InputClearButton.extend({defaultProps:{size:"xs"},vars:(t,e)=>({root:G(ro,e==null?void 0:e.size)})})},Ni={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"}}},ki={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"}}},Di={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"}}},Mi={root:{fontSize:11}},Gi={root:{fontSize:11,minHeight:28},label:{fontSize:11}},Bi={tab:{fontSize:11,padding:"6px 10px"}},Fi={Anchor:o.Anchor.extend({defaultProps:{size:"sm"},styles:Mi}),Burger:o.Burger.extend({defaultProps:{size:"sm"},vars:(t,e)=>({root:G(Di,e==null?void 0:e.size)})}),NavLink:o.NavLink.extend({styles:Gi}),Pagination:o.Pagination.extend({defaultProps:{size:"sm"},vars:(t,e)=>({root:{...G(Ni,e==null?void 0:e.size),"--pagination-active-color":Ze(t,e)}})}),Stepper:o.Stepper.extend({defaultProps:{size:"sm"},vars:(t,e)=>({root:{...G(ki,e==null?void 0:e.size),"--stepper-icon-color":Ze(t,e)}})}),Tabs:o.Tabs.extend({styles:Bi})},Vi={"--menu-item-fz":"11px"},Ui={tooltip:{fontSize:11,padding:"4px 8px"}},$i={dropdown:{padding:8}},Wi={dropdown:{padding:8}},Yi={Menu:o.Menu.extend({defaultProps:{zIndex:Fe,withInitialFocusPlaceholder:!1},vars:()=>({dropdown:Vi})}),Modal:o.Modal.extend({defaultProps:{closeButtonProps:{"aria-label":"Close"}}}),Drawer:o.Drawer.extend({defaultProps:{closeButtonProps:{"aria-label":"Close"}}}),Tooltip:o.Tooltip.extend({defaultProps:{zIndex:Fe},styles:Ui}),Popover:o.Popover.extend({defaultProps:{zIndex:Fe},styles:$i}),HoverCard:o.HoverCard.extend({defaultProps:{zIndex:Fe},styles:Wi})},Xi={xs:"10px",sm:"11px",md:"13px",lg:"14px",xl:"16px"},Ki={xs:"4px",sm:"6px",md:"8px",lg:"12px",xl:"16px"},qi={xs:"2px",sm:"4px",md:"6px",lg:"8px",xl:"12px"},ho=o.createTheme({colors:io,fontSizes:Xi,spacing:Ki,radius:qi,focusRing:"auto",primaryShade:{light:8,dark:5},autoContrast:!0,luminanceThreshold:.18,variantColorResolver:ei,other:{panelGrid:u},components:{...Hi,...Jo,...si,...pi,...bi,...Fi,...Yi}}),Zi=o.mergeMantineTheme(o.DEFAULT_THEME,ho),go=["#5B8FF9FF","#FF6B6BFF","#61D095FF","#F7B731FF","#9B59B6FF","#5B8FF980","#FF6B6B80","#61D09580","#F7B73180","#9B59B680"],Et="#888888",mo=["sizeSmallest","sizeLargest","width","opacity","attribute","scaleSqrt","scaleLinear","scaleLog"],bo=["N","E","W","D","K"],Ji=["chevronDown","chevronRight","chevronLeft","close","plus","minus","gear","warning","check","eye","refresh","copy","pin","keepOpen","info","reset"],vo={viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},ze={fill:"currentColor",stroke:"none"},Qi={sizeSmallest:t=>n.jsxs(n.Fragment,{children:[n.jsx("circle",{cx:"5",cy:"11",r:"2.5",...t?ze:{}}),n.jsx("circle",{cx:"10.5",cy:"6.5",r:"4",...t?ze:{}})]}),sizeLargest:t=>n.jsxs(n.Fragment,{children:[n.jsx("circle",{cx:"4.5",cy:"11.5",r:"1.75",...t?ze:{}}),n.jsx("circle",{cx:"10",cy:"6",r:"5",...t?ze:{}})]}),width:t=>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",...t?ze:{}}),n.jsx("polyline",{points:"11,5.5 13.5,8 11,10.5",...t?ze:{}})]}),opacity:t=>t?n.jsx("circle",{cx:"8",cy:"8",r:"5.5",...ze}):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",...ze})]}),attribute:t=>t?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",...ze}),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:"1.5",...ze})]}),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"})},er={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 Je({name:t,filled:e=!1,size:r=u.GLYPH}){return n.jsx("svg",{width:r,height:r,...vo,"aria-hidden":"true",focusable:"false","data-glyph":t,"data-filled":e?"true":"false",style:{flex:"0 0 auto",display:"block"},children:Qi[t](e)})}function ie({name:t,size:e=u.GLYPH}){return n.jsx("svg",{width:e,height:e,...vo,"aria-hidden":"true",focusable:"false","data-glyph":t,style:{flex:"0 0 auto",display:"block"},children:er[t]})}function en(t){return typeof t=="string"&&mo.includes(t)}function tn(t){return typeof t=="string"&&bo.includes(t)}const nn=255,on=100;function rn(t){return Math.round(parseInt(t,16)/nn*on)}function an(t){return Math.round(t/on*nn).toString(16).padStart(2,"0")}function tr(t){let e=t.replace("#","");e.length===3?e=`${e.split("").map(l=>l+l).join("")}ff`:e.length===4?e=e.split("").map(l=>l+l).join(""):e.length===6&&(e=`${e}ff`);const r=`#${e.slice(0,6)}`,i=e.slice(6,8),s=rn(i);return{hex:r,opacity:s}}function nr(t,e){const r=t.replace("#",""),i=an(e);return`#${r}${i}`}function or(t){return/^#?([A-Fa-f0-9]{3}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(t)}const Tt={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0};function ir(t,e){const r=t===void 0?"":t.trim();return r===""?e:`${/[.!?]$/u.test(r)?r:`${r}.`} ${e}`}function at({name:t,enabledTitle:e,disabled:r=!1,disabledReason:i,extraDescriptions:s}){const l=a.useId(),c=r&&i!==void 0&&i!==""?i:void 0,p=[];for(const f of s??[])f!==void 0&&f!==""&&p.push(f);c!==void 0&&p.push(c);const x=p.length>0?p.join(". "):void 0;return{title:c===void 0?e:ir(e??t,c),description:x,describedBy:x===void 0?void 0:l}}function Pe(t){const e=a.useRef(void 0);a.useEffect(()=>{process.env.NODE_ENV==="production"||t===void 0||e.current!==t&&(e.current=t,console.warn(t))},[t])}const yo=a.createContext(null);function rr(){return a.useContext(yo)}function ar({children:t}){const e=a.useRef(null);if(!a.isValidElement(t))throw new Error("PopoutAnchor requires a single valid React element as its child");const r=t,i=a.cloneElement(r,{ref:e});return n.jsx(yo.Provider,{value:{anchorRef:e},children:i})}function sr({children:t}){return n.jsx(o.Box,{p:"sm",children:t})}const lr=["[data-portal]","[data-combobox-dropdown]","[data-menu-dropdown]","[data-popover-dropdown]","[data-tooltip]","[data-hovercard-dropdown]","[data-dates-dropdown]","[data-modal]"].join(", ");function cr(t,e=!0){a.useEffect(()=>{if(!e)return;const r=i=>{const s=i.target;s.closest('[role="dialog"]')||s.closest("[data-popout-trigger]")||s.closest("[data-popout-portal-container]")||s.closest(lr)||t()};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r)}},[t,e])}function dr(t,e=!0){a.useEffect(()=>{if(!e)return;const r=i=>{i.key==="Escape"&&(i.preventDefault(),t())};return document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}},[t,e])}const wo=a.createContext(null);function ur({id:t,children:e}){return n.jsx(wo.Provider,{value:t,children:e})}function So(){return a.useContext(wo)}const sn=a.createContext(null),ln=a.createContext(null);function At(){const t=a.useContext(sn);if(!t)throw new Error("usePopoutContext must be used within a Popout component");return t}function fr(){return a.useContext(sn)}function Io(){const t=a.useContext(ln);if(!t)throw new Error("usePopoutManagerContext must be used within a PopoutManager");return t}function xr(){return a.useContext(ln)}function pr(){const{closeAll:t,hasOpenPopouts:e}=Io();return a.useMemo(()=>({closeAll:t,hasOpenPopouts:e}),[t,e])}function hr({children:t,parentId:e=null,opened:r,defaultOpened:i,onOpenChange:s}){const l=a.useId(),c=a.useRef(null),p=So(),[x,f]=X.useUncontrolled({value:r,defaultValue:i,finalValue:!1,onChange:s}),h=a.useRef(f);a.useEffect(()=>{h.current=f});const m=a.useCallback((E,z)=>{if(z){h.current(E,z);return}h.current(E)},[]),b=a.useCallback(E=>{m(!0,E)},[m]),y=a.useCallback(E=>{m(!1,E)},[m]),R=a.useCallback(E=>{m(!x,E)},[x,m]),T=a.useMemo(()=>({id:l,isOpen:x,open:b,close:y,toggle:R,triggerRef:c,parentId:e,region:p}),[l,x,b,y,R,e,p]);return n.jsx(sn.Provider,{value:T,children:t})}function gr({children:t}){const[e,r]=a.useState(null),i=a.useRef([]),s=a.useRef(new Map),l=a.useRef(new Map),c=a.useRef(new Map),[p,x]=a.useState(0),f=a.useCallback((v,w,_)=>(l.current.get(v)??null)!==w?!1:w!==null?!0:(c.current.get(v)??null)===_,[]),h=a.useCallback((v,w)=>i.current.filter(_=>f(_,v,w)),[f]),m=a.useCallback(v=>{const w=[];for(const _ of i.current){let D=_;for(;D;){const K=l.current.get(D)??null;if(K===v){w.push(_);break}D=K}}return w},[]),b=a.useCallback(v=>{let w=0,_=v;for(;_;){const D=l.current.get(_)??null;if(!D)break;w++,_=D}return w},[]),y=a.useCallback(v=>{var _;const w=[...v].sort((D,K)=>b(K)-b(D));for(const D of w)(_=s.current.get(D))==null||_()},[b]),R=a.useCallback((v,w,_,D)=>{if(i.current.includes(v)){s.current.set(v,w);return}const K=_??null,Ie=D??null,ve=h(K,Ie),re=[];for(const oe of ve)re.push(oe),re.push(...m(oe));y(re);const q=new Set(re);i.current=i.current.filter(oe=>!q.has(oe)),i.current.push(v),s.current.set(v,w),l.current.set(v,K),c.current.set(v,Ie),x(oe=>oe+1)},[h,m,y]),T=a.useCallback(v=>{if(!i.current.includes(v)){s.current.delete(v),l.current.delete(v),c.current.delete(v);return}i.current=i.current.filter(w=>w!==v),s.current.delete(v),l.current.delete(v),c.current.delete(v),x(w=>w+1)},[]),E=a.useCallback(v=>{const w=i.current.indexOf(v);return w>=0?Wt+w:Wt},[]),z=a.useCallback(v=>{const w=i.current,_=w.indexOf(v);_===-1||_===w.length-1||(i.current=[...w.filter(D=>D!==v),v],x(D=>D+1))},[]),I=a.useCallback(v=>l.current.get(v)??null,[]),S=a.useCallback((v,w)=>{let _=w;for(;_;){const D=l.current.get(_);if(D===v)return!0;_=D??null}return!1},[]),P=a.useCallback(v=>{const w=[],_=i.current;for(const D of _)S(v,D)&&w.push(D);return w},[S]),j=a.useCallback(v=>{const w=P(v);for(const _ of[...w].reverse()){const D=s.current.get(_);D==null||D()}},[P]),L=a.useCallback(v=>{j(v);const w=s.current.get(v);w==null||w()},[j]),k=a.useCallback((v,w)=>{const _=c.current.get(v)??null;for(const D of i.current)D!==v&&f(D,w,_)&&L(D)},[L,f]),U=a.useCallback(()=>{const v=i.current;if(v.length===0)return;const w=v[v.length-1],_=s.current.get(w);_==null||_()},[]),Y=a.useCallback(()=>{const v=[...i.current];for(const w of v){const _=s.current.get(w);_==null||_()}},[]),H=a.useCallback(()=>i.current.length>0,[]),[B,A]=a.useState(!1);a.useEffect(()=>{A(i.current.length>0)},[p]),dr(U,B),cr(Y,B);const N=a.useMemo(()=>({register:R,unregister:T,getZIndex:E,bringToFront:z,portalContainer:e,zIndexVersion:p,closeFocused:U,closeAll:Y,hasOpenPopouts:H,closeWithDescendants:L,closeDescendants:j,closeSiblings:k,getParentId:I,isAncestor:S}),[R,T,E,z,e,p,U,Y,H,L,j,k,I,S]);return n.jsxs(ln.Provider,{value:N,children:[t,n.jsx("div",{ref:r,"data-popout-portal-container":!0,style:{display:"contents"}})]})}function _e(){return o.useDirection().dir}function he(t){return t==="rtl"}function mr(t,e){return he(e)?1-t:t}function br(t,e,r){return mr(t,r)*e}function vr(t){return he(t)?{transform:"scaleX(-1)"}:{}}const Tn=3;function yr(t){const{isOpen:e,onPress:r,onDragStart:i,onDrag:s,onDragEnd:l}=t,[c,p]=a.useState({left:0,top:0}),x=a.useRef(!1),f=a.useRef(!1),h=a.useRef(!1),m=a.useRef({x:0,y:0,offsetLeft:0,offsetTop:0}),b=a.useCallback(()=>{p({left:0,top:0})},[]),y=a.useCallback(()=>{const I=h.current;return h.current=!1,I},[]),R=a.useCallback(I=>{const S=I.target;if(!(S.tagName==="INPUT"||S.tagName==="TEXTAREA"||S.tagName==="BUTTON"||S.tagName==="SELECT"||S.closest("button")||S.closest("input")||S.closest("textarea")||S.closest("select"))){x.current=!0,f.current=!1,h.current=!1,m.current={x:I.clientX,y:I.clientY,offsetLeft:c.left,offsetTop:c.top},r==null||r(I);try{S.setPointerCapture(I.pointerId)}catch{}}},[c.left,c.top,r]),T=a.useCallback(I=>{if(!x.current)return;const S=I.clientX-m.current.x,P=I.clientY-m.current.y;if(!f.current){if(!(Math.abs(S)>=Tn||Math.abs(P)>=Tn))return;f.current=!0,i==null||i(I)}const j={left:m.current.offsetLeft+S,top:m.current.offsetTop+P};p(j),s==null||s(j,I)},[s,i]),E=a.useCallback(I=>{if(!x.current)return;x.current=!1;const S=I.target;S.hasPointerCapture(I.pointerId)&&S.releasePointerCapture(I.pointerId),f.current&&(f.current=!1,h.current=!0,l==null||l(I))},[l]),z=c.left!==0||c.top!==0;return e?{dragTriggerProps:{"data-drag-trigger":!0,onPointerDown:R,onPointerMove:T,onPointerUp:E,onPointerCancel:E,style:{cursor:"grab",userSelect:"none",touchAction:"none"}},dragOffset:c,resetDragOffset:b,hasDragged:z,consumeDragClick:y}:{dragTriggerProps:{},dragOffset:{left:0,top:0},resetDragOffset:b,hasDragged:!1,consumeDragClick:y}}function wr({config:t,onClose:e,dragTriggerProps:r={},actions:i=[],activeTab:s,onTabChange:l,titleId:c}){var y;const p=ne(),{style:x,...f}=r,m=t.variant==="tabs"?t:null,b=(m==null?void 0:m.tabs.map(R=>({value:R.id,label:R.label})))??[];return n.jsxs(o.Group,{"data-testid":"popout-header",justify:"space-between",px:"sm",py:"xs",...f,style:{...x},children:[t.variant==="title"?n.jsx(o.Text,{id:c,"data-testid":"popout-header-title",size:"sm",fw:500,children:t.title}):n.jsxs(n.Fragment,{children:[n.jsx(o.VisuallyHidden,{id:c,children:((y=m==null?void 0:m.tabs[0])==null?void 0:y.label)??p.settings}),n.jsx(o.SegmentedControl,{"data-testid":"popout-header-tabs",data:b,value:s,onChange:R=>l==null?void 0:l(R),size:"xs"})]}),n.jsxs(o.Group,{gap:4,children:[i.map(R=>n.jsx(o.ActionIcon,{variant:"subtle",onClick:R.onClick,"aria-label":R.label,children:R.icon},R.id)),n.jsx(o.CloseButton,{"data-testid":"popout-header-close",onClick:e,"aria-label":p.closePanel})]})]})}function Sr(t,e=document){return t===null?null:e.querySelector(`[data-popout-id="${t}"]`)}function Rn(t,e,r){const{trigger:i,parent:s,panel:l}=r;if(t!==void 0){if(typeof t=="object")return t.current;switch(t){case"parent":return s??l??i;case"panel":return l??s??i;case"trigger":return i;default:{const c=t;throw new Error(`Unknown anchor target: ${String(c)}`)}}}return e==="x"?s??l??i:i??s??l}function Ir(t,e){return t==="start"?he(e)?"right":"left":t==="end"?he(e)?"left":"right":t}function Cr(t,e,r=ao,i={}){const{placement:s="left",alignment:l="start",panelHeight:c=0,crossAnchorRect:p=t,direction:x="ltr"}=i;let f,h;switch(s){case"left":f=t.left-e-r,h=zn(p,l,c);break;case"right":f=t.right+r,h=zn(p,l,c);break;case"top":f=Pn(p,l,e,x),h=t.top-c-r;break;case"bottom":f=Pn(p,l,e,x),h=t.bottom+r;break;default:{const m=s;throw new Error(`Unknown placement: ${String(m)}`)}}return{left:f,top:h}}function zn(t,e,r){switch(e){case"start":return t.top;case"center":return t.top+t.height/2-r/2;case"end":return t.bottom-r;default:{const i=e;throw new Error(`Unknown alignment: ${String(i)}`)}}}function Pn(t,e,r,i){switch(e){case"start":return he(i)?t.right-r:t.left;case"center":return t.left+t.width/2-r/2;case"end":return he(i)?t.left:t.right-r;default:{const s=e;throw new Error(`Unknown alignment: ${String(s)}`)}}}function Er(t){var Ge,Te;const{width:e,height:r,header:i,label:s,children:l,anchorX:c,anchorY:p,placement:x="left",alignment:f="start",gap:h,actions:m,manageFocus:b=!0,onDragStart:y,onDrag:R,onDragEnd:T}=t,{isOpen:E,close:z,triggerRef:I,id:S,parentId:P,region:j}=At(),{getZIndex:L,portalContainer:k,register:U,unregister:Y,bringToFront:H,zIndexVersion:B,closeDescendants:A}=Io(),N=rr(),v=_e(),w=a.useId(),_=`popout-panel-${S}`,D=`popout-title-${w}`,[K,Ie]=a.useState(null),ve=a.useRef(!1),re=a.useRef(null),q=a.useCallback(()=>{H(S)},[H,S]),{dragTriggerProps:oe,dragOffset:ce,resetDragOffset:F,hasDragged:Q,consumeDragClick:Z}=yr({isOpen:E,onPress:q,onDragStart:y,onDrag:R,onDragEnd:T}),ge=(i==null?void 0:i.variant)==="tabs",V=(i==null?void 0:i.variant)==="tabs"?i:null,de=(V==null?void 0:V.defaultTab)??((Ge=V==null?void 0:V.tabs[0])==null?void 0:Ge.id),[He,We]=a.useState(de),Ae=h??(P===null?0:so),pt=a.useCallback((W,ae)=>{var te;We(W),(te=V==null?void 0:V.onTabChange)==null||te.call(V,W,ae)},[V]),se=a.useCallback(W=>{W.stopPropagation(),H(S),!Z()&&A(S)},[A,H,Z,S]),Ne=a.useCallback(W=>{A(S),z(W)},[A,z,S]),me=a.useRef(z);a.useEffect(()=>{me.current=z});const je=a.useCallback(()=>{me.current()},[]);a.useEffect(()=>(E?U(S,je,P,j):Y(S),()=>{Y(S)}),[E,S,U,Y,je,P,j]);const Ce=a.useCallback(()=>{const W={trigger:I.current,parent:Sr(P),panel:(N==null?void 0:N.anchorRef.current)??null};return{inline:Rn(c,"x",W),block:Rn(p,"y",W)}},[I,P,N,c,p]),ke=a.useCallback(()=>{var lt;const{inline:W,block:ae}=Ce(),te=W??ae,ye=ae??W;if(!te||!ye)return;const ue=(lt=re.current)==null?void 0:lt.getBoundingClientRect(),fe=Math.max(e,(ue==null?void 0:ue.width)??0),M=Math.max(r??0,(ue==null?void 0:ue.height)??0),ee=Ir(x,v),xe=ee==="top"||ee==="bottom",Ye=xe?ye:te,st=xe?te:ye,Xe=Cr(Ye.getBoundingClientRect(),fe,Ae,{placement:ee,alignment:f,panelHeight:M,crossAnchorRect:st.getBoundingClientRect(),direction:v});Ie(Re=>Re&&Re.left===Xe.left&&Re.top===Xe.top?Re:Xe)},[Ce,e,r,x,f,Ae,v]);if(X.useIsomorphicEffect(()=>{if(!E){Ie(null);return}ve.current||(F(),ge&&We(de)),ke()},[E,ke,F,ge,de]),a.useEffect(()=>{if(!E)return;let W=0;const ae=()=>{W===0&&(W=requestAnimationFrame(()=>{W=0,ke()}))},te=new ResizeObserver(ae),ye=new MutationObserver(ae),{inline:ue,block:fe}=Ce();for(const ee of new Set([ue,fe].filter(xe=>xe!==null)))te.observe(ee),ye.observe(ee,{attributes:!0,attributeFilter:["style","class"]});re.current&&te.observe(re.current);const M=()=>{Q||ae()};return window.addEventListener("resize",M),window.addEventListener("scroll",M,!0),()=>{W!==0&&cancelAnimationFrame(W),te.disconnect(),ye.disconnect(),window.removeEventListener("resize",M),window.removeEventListener("scroll",M,!0)}},[E,ke,Ce,Q]),a.useEffect(()=>{var W;if(b){if(E){const ae=setTimeout(()=>{var te;(te=re.current)==null||te.focus()},0);return()=>{clearTimeout(ae)}}ve.current&&((W=I.current)==null||W.focus())}},[E,b,I]),a.useEffect(()=>{ve.current=E},[E]),!E||!k)return null;const De=L(S),et={left:((K==null?void 0:K.left)??0)+ce.left,top:((K==null?void 0:K.top)??0)+ce.top},Me=n.jsxs(o.Paper,{ref:re,id:_,role:"dialog","aria-modal":"false","aria-labelledby":i?D:void 0,"aria-label":i?void 0:s,tabIndex:-1,radius:8,onClick:se,"data-testid":"popout-panel","data-popout-id":S,...P&&{"data-parent-id":P},style:{position:"fixed",left:et.left,top:et.top,minWidth:e,width:"min-content",...r!==void 0&&{minHeight:r},...K===null&&{visibility:"hidden"},zIndex:De,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(wr,{config:i,onClose:Ne,dragTriggerProps:oe,activeTab:He,onTabChange:pt,actions:m,titleId:D}):null,n.jsx(o.Box,{"data-testid":"popout-panel-content",children:ge?(Te=V==null?void 0:V.tabs.find(W=>W.id===He))==null?void 0:Te.content:l})]});return Yo.createPortal(Me,k)}function Tr({children:t,action:e="toggle"}){const{open:r,toggle:i,triggerRef:s,isOpen:l,id:c}=At(),p=a.useCallback(h=>{if(h.stopPropagation(),e==="open"){r(h);return}i(h)},[e,r,i]);if(!a.isValidElement(t))throw new Error("PopoutTrigger requires a single valid React element as its child");const x=`popout-panel-${c}`,f=t;return a.cloneElement(f,{onClick:h=>{var m,b;(b=(m=f.props).onClick)==null||b.call(m,h),p(h)},ref:s,"data-popout-trigger":!0,"aria-expanded":l,"aria-controls":x,"aria-haspopup":"dialog"})}function Rr({children:t,opened:e,defaultOpened:r,onOpenChange:i}){const s=fr(),l=(s==null?void 0:s.id)??null;return n.jsx(hr,{parentId:l,opened:e,defaultOpened:r,onOpenChange:i,children:t})}const Ve=Object.assign(Rr,{Trigger:Tr,Panel:Er,Content:sr,Anchor:ar}),zr=a.forwardRef(function({icon:e,size:r="xs",...i},s){const{isOpen:l}=At();return n.jsx(o.ActionIcon,{ref:s,"data-testid":"popout-button",variant:l?"light":"subtle",size:r,c:l?void 0:"dimmed",...i,children:e})});function Co({children:t}){return n.jsx(gr,{children:t})}const An=4,jn=4,Pr=2,Ar=72,jr=54,Lr=220,Ln=0,Nt=100,On=9,_n=7,Or=/^#[0-9A-F]{6}$/iu,_r=1.1;function kt(t){const e=t==="start"?jn:0,r=t==="end"?jn:0;return{borderStartStartRadius:e,borderEndStartRadius:e,borderStartEndRadius:r,borderEndEndRadius:r}}function Hr(){const t=$e();return a.useMemo(()=>{var r;return((r=new Intl.NumberFormat(t).formatToParts(_r).find(i=>i.type==="decimal"))==null?void 0:r.value)??"."},[t])}function Eo({color:t,defaultColor:e,opacity:r,defaultOpacity:i=Nt,onColorChange:s,onOpacityChange:l,onChange:c,label:p,showOpacity:x=!0,disabled:f=!1,disabledReason:h,onFocus:m,onBlur:b}){const y=ne(),R=Qt(),T=Hr(),E=a.useId(),z=at({name:p,disabled:f,disabledReason:h}),I=c!==void 0;Pe(I&&(s!==void 0||l!==void 0)?"CompactColorInput was given onChange together with onColorChange or onOpacityChange. Only onChange is called; drop the other callbacks.":void 0);const[S,P]=X.useUncontrolled({value:t,defaultValue:void 0,finalValue:void 0,onChange:I?void 0:s}),[j,L]=X.useUncontrolled({value:r,defaultValue:void 0,finalValue:void 0,onChange:I?void 0:l}),k=S===void 0,U=j===void 0,Y=k&&(!x||U),H=S??e,B=j??i,[A,N]=a.useState(H.replace("#","").toUpperCase()),[v,w]=a.useState(B);a.useEffect(()=>{N(H.replace("#","").toUpperCase())},[H]),a.useEffect(()=>{w(B)},[B]);const _=F=>{const Q=F.length===On,Z=Q?F.slice(0,_n).toUpperCase():F.toUpperCase(),ge=Q&&x,V=ge?rn(F.slice(_n,On)):j;P(Z),ge&&L(V),c==null||c(Z,V)},D=()=>`${H}${an(B)}`.toUpperCase(),K=F=>{N(F.currentTarget.value.toUpperCase())},Ie=F=>{const Q=A.toUpperCase(),Z=Q.startsWith("#")?Q:`#${Q}`;Or.test(Z)&&Z!==H?(P(Z,F),c==null||c(Z,j,F)):N(H.replace("#","").toUpperCase()),b==null||b(F)},ve=F=>{w(F)},re=F=>{const Q=typeof v=="string"?R(v):v;if(Number.isNaN(Q)){w(B),b==null||b(F);return}const Z=Math.min(Nt,Math.max(Ln,Q));Z!==B&&(L(Z,F),c==null||c(S,Z,F)),w(Z),b==null||b(F)},q=F=>{P(void 0,F),x&&L(void 0,F),c==null||c(void 0,x?void 0:j,F)},oe=x?"middle":"end",ce=n.jsxs(o.Group,{"data-testid":"compact-color-input",gap:An,wrap:"nowrap",title:p===void 0?z.title:void 0,"data-disabled":f?"true":void 0,children:[n.jsxs(o.Group,{gap:0,wrap:"nowrap",children:[n.jsxs(Ve,{children:[n.jsx(Ve.Trigger,{children:n.jsx(o.ActionIcon,{variant:"filled",size:u.CONTROL_HEIGHT,radius:0,style:{backgroundColor:"var(--mantine-color-default)",...kt("start")},"data-testid":"compact-color-input-swatch",disabled:f,"aria-label":y.colorSwatch,"aria-describedby":z.describedBy,children:n.jsx(o.ColorSwatch,{color:H,size:u.GLYPH,radius:Pr,style:{border:`1px solid ${g.BORDER}`}})})}),n.jsx(Ve.Panel,{width:Lr,header:{variant:"title",title:p??y.colorPanelTitle},placement:"bottom",alignment:"start",gap:An,children:n.jsx(Ve.Content,{children:n.jsx(o.ColorPicker,{format:"hexa",value:D(),onChange:_,swatches:[...go]})})})]}),n.jsx(o.TextInput,{"data-testid":"compact-color-input-hex",disabled:f,description:z.description,value:A,onChange:K,onFocus:m,onBlur:Ie,"aria-label":y.colorHexValue,"data-is-default":k?"true":"false",w:Ar,styles:{input:{...kt(oe),fontFamily:"monospace",textTransform:"uppercase",...k?{fontStyle:"italic",color:g.CHROME}:{}},description:Tt}}),x&&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:f,description:z.description,value:v,onChange:ve,onFocus:m,onBlur:re,min:Ln,max:Nt,decimalSeparator:T,hideControls:!0,suffix:"%","aria-label":y.opacity,"data-is-default":U?"true":"false",w:jr,styles:{input:{...kt("end"),textAlign:"end",...U?{fontStyle:"italic",color:g.CHROME}:{}},description:Tt}})]})]}),!Y&&n.jsx(o.ActionIcon,{variant:"subtle",size:u.TRAIL,c:g.CHROME,"data-testid":"compact-color-input-reset",disabled:f,"aria-label":y.resetToDefault(p??y.colorGenericName),onClick:q,children:n.jsx(ie,{name:"reset",size:u.CHEVRON})}),z.description!==void 0&&n.jsx(o.VisuallyHidden,{id:z.describedBy,children:z.description})]});return p===void 0?ce:n.jsxs(o.Stack,{"data-testid":"compact-color-input-labelled",gap:0,role:"group","aria-labelledby":E,title:z.title,children:[n.jsx(o.Text,{id:E,"data-testid":"compact-color-input-label",size:"xs",c:g.CHROME,mb:1,lh:1.2,children:p}),ce]})}const wt=u.GUTTER,Hn=4,Nr=1,kr=1.2,Dr="calc(-1 * var(--mantine-spacing-sm) - 1px)";function Mr({label:t,actions:e,children:r,bleed:i=!1}){const s=a.useId(),l=e!=null;return n.jsxs(o.Box,{"data-testid":"control-group",role:"group","aria-labelledby":s,children:[n.jsx(o.Divider,{"data-testid":"control-group-divider",color:g.DIVIDER,size:Nr,style:{marginBlockStart:wt,marginBlockEnd:0,marginInline:i?Dr:void 0}}),n.jsxs(o.Box,{"data-testid":"control-group-header",style:{display:"flex",alignItems:"center",gap:Hn,boxSizing:"border-box",paddingBlock:wt,paddingInline:wt},children:[n.jsx(o.Box,{component:"span",id:s,"data-testid":"control-group-label",title:t,style:{flex:"1 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--mantine-font-size-xs)",fontWeight:500,lineHeight:kr,color:g.VALUE},children:t}),l&&n.jsx(o.Box,{"data-testid":"control-group-actions",style:{display:"flex",alignItems:"center",gap:Hn,flex:"0 0 auto"},children:e})]}),n.jsx(o.Stack,{"data-testid":"control-group-content",gap:0,px:wt,children:r})]})}const Nn=250,Gr=4;function Br({name:t,bubbleId:e}){const{isOpen:r,open:i,close:s}=At();return n.jsx(Ve.Trigger,{action:"open",children:n.jsx(o.UnstyledButton,{type:"button",title:t,"aria-label":t,"aria-describedby":r?e:void 0,"data-testid":"info-circle",onMouseEnter:i,onMouseLeave:s,onFocus:i,onBlur:s,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(ie,{name:"info",size:u.CHEVRON})})})}function To({children:t,label:e,opened:r,defaultOpened:i,onOpenChange:s}){const l=ne(),c=a.useId(),p=xr()!==null,x=l.about(e),f=n.jsxs(Ve,{opened:r,defaultOpened:i,onOpenChange:s,children:[n.jsx(Br,{name:x,bubbleId:c}),n.jsx(Ve.Panel,{width:Nn,label:x,placement:"bottom",alignment:"start",gap:Gr,anchorX:"trigger",anchorY:"trigger",manageFocus:!1,children:n.jsx(o.Box,{id:c,w:Nn,p:"xs",style:{fontSize:"var(--mantine-font-size-sm)",lineHeight:1.4,color:g.PROSE},children:t})})]});return p?f:n.jsx(Co,{children:f})}function ft(t){return t!=null&&t!==!1}function Ee({children:t}){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:t})}const Ro=a.forwardRef(function(e,r){const{label:i,changed:s=!1,icon:l,onClick:c,disabled:p=!1,loading:x=!1,style:f,...h}=e,m=ne(),b=s?m.sectionHasConfiguredValues(i):i,y=s?g.VALUE:g.CHROME;return n.jsx(o.ActionIcon,{...h,ref:r,type:"button",variant:"subtle",color:"gray",size:u.TRAIL,radius:"sm",vars:()=>({root:{"--ai-color":y}}),title:b,"aria-label":b,"aria-busy":x,disabled:p,loading:x,"data-testid":"advanced-button","data-changed":s?"true":"false",onClick:c,style:{flex:"0 0 auto",...f},children:l??n.jsx(ie,{name:"gear",size:u.GLYPH})})}),Dt=4,Fr=1,kn=6,Vr=12,Ur=1.2;function $r(t){const{label:e,technicalName:r,opened:i,defaultOpened:s,onOpenChange:l,hasConfiguredValues:c=!1,empty:p=!1,onAdd:x,info:f,actions:h,children:m}=t,b=ne(),y=_e(),R=a.useId(),T=a.useId(),E=a.useId(),[z,I]=X.useUncontrolled({value:i,defaultValue:s,finalValue:!0,onChange:l}),S=!p&&a.Children.toArray(m).length>0,P=f!=null;Pe(p||S?void 0:`ControlSection "${e}" 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=N=>{I(!z,N)},L=z?b.collapseSection(e):b.expandSection(e),k=b.addToSection(e),U=he(y)?"chevronLeft":"chevronRight",Y={flex:"0 0 auto",width:u.GLYPH_SLOT,height:u.GLYPH_SLOT,display:"flex",alignItems:"center",justifyContent:"center",color:g.CHROME},H={display:"flex",alignItems:"center",gap:Dt,flex:"0 1 auto",minWidth:0,height:"100%",background:"transparent",textAlign:"start"},B=r===void 0?e:`${e} (${r})`,A=n.jsxs(o.Box,{component:"span",id:R,title:B,"data-testid":"control-section-name",style:{minWidth:0,fontSize:Vr,fontWeight:500,lineHeight:Ur,color:p?g.CHROME:g.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[e,r===void 0?null:n.jsx(o.Box,{component:"span","data-testid":"control-section-technical-name",style:{fontWeight:400,color:g.CHROME},children:` (${r})`})]});return n.jsxs(o.Box,{role:"group","aria-labelledby":R,"aria-describedby":P?E:void 0,"data-testid":"control-section","data-empty":p?"true":void 0,children:[n.jsx(o.Divider,{"data-testid":"control-section-divider",color:g.DIVIDER,size:Fr,my:0,mx:0}),n.jsxs(o.Box,{"data-testid":"control-section-header",style:{display:"flex",alignItems:"center",gap:Dt,boxSizing:"border-box",height:u.SECTION_HEADER,paddingInlineStart:u.PAD_LEFT,paddingInlineEnd:u.PAD_RIGHT},children:[S?n.jsxs(o.UnstyledButton,{type:"button","data-testid":"control-section-toggle","aria-label":L,"aria-expanded":z,"aria-controls":T,onClick:j,style:{...H,cursor:"pointer"},children:[n.jsx(o.Box,{"data-testid":"control-section-chevron-slot",style:Y,children:n.jsx(ie,{name:z?"chevronDown":U,size:u.CHEVRON})}),A]}):n.jsxs(o.Box,{style:H,children:[n.jsx(o.Box,{"data-testid":"control-section-chevron-slot",style:Y}),A]}),c&&n.jsx(o.Box,{role:"img","aria-label":b.sectionHasConfiguredValues(e),"data-testid":"control-section-dot",style:{flex:"0 0 auto",width:kn,height:kn,borderRadius:"50%",background:g.ACCENT}}),P&&n.jsx(To,{label:e,children:f}),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:Dt,flex:"0 0 auto"},children:h}),p&&x!==void 0&&n.jsx(Ee,{children:n.jsx(o.ActionIcon,{type:"button",variant:"subtle",size:u.CONTROL_HEIGHT,radius:"sm",c:g.CHROME,title:k,"aria-label":k,"data-testid":"control-section-add",onClick:x,children:n.jsx(ie,{name:"plus",size:u.GLYPH})})})]}),P&&n.jsx(o.Box,{id:E,"data-testid":"control-section-description",hidden:!0,children:f}),S&&n.jsx(o.Collapse,{id:T,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 Mt="control-sub-group",Dn=4,Wr=10,Yr=1.2;function Xr(t){const{label:e,opened:r,defaultOpened:i,onOpenChange:s,children:l}=t,c=ne(),p=_e(),x=a.useRef(void 0),[f,h]=X.useUncontrolled({value:r,defaultValue:i,finalValue:!1,onChange:s}),m=a.useCallback(E=>{x.current=E},[]),b=a.useCallback(E=>{const z=x.current;x.current=void 0,h(E===Mt,z)},[h]),y=f?c.collapseSection(e):c.expandSection(e);let R="chevronDown";f||(R=he(p)?"chevronLeft":"chevronRight");const T={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:Yr,color:g.CHROME},chevron:{marginInlineStart:0,marginInlineEnd:Dn,color:g.CHROME},content:{paddingBlock:0,paddingInlineStart:u.GUTTER,paddingInlineEnd:0}};return n.jsx(o.Accordion,{"data-testid":"control-sub-group",value:f?Mt:null,onChange:b,chevronPosition:"left",chevronSize:u.GLYPH_SLOT,disableChevronRotation:!0,chevron:n.jsx(ie,{name:R,size:Wr}),styles:T,children:n.jsxs(o.Accordion.Item,{value:Mt,"data-testid":"control-sub-group-item",children:[n.jsx(o.Accordion.Control,{"data-testid":"control-sub-group-control","aria-label":y,onClick:m,children:n.jsx(o.Box,{component:"span","data-testid":"control-sub-group-label",title:e,style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e})}),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:Dn},children:l})})]})})}function rt(t){if("key"in t)return{source:"keyboard"};const e=t.nativeEvent;return typeof PointerEvent<"u"&&e instanceof PointerEvent?{source:e.pointerType===""?"keyboard":"pointer"}:{source:e.detail===0?"keyboard":"pointer"}}function Kr(t){const e=ne();return a.useMemo(()=>({...e,...t}),[e,t])}const le=-1;function it(t,e,r){return Math.min(Math.max(t,e),r)}function qr(t,e,r,i,s){const{rowCount:l,columnCount:c,pageSize:p}=r,x=l-1,f=c-1;if(c===0)return;const h=he(i)?"ArrowLeft":"ArrowRight",m=he(i)?"ArrowRight":"ArrowLeft";if(e===h)return{row:t.row,column:Math.min(t.column+1,f)};if(e===m)return{row:t.row,column:Math.max(t.column-1,0)};if(e==="ArrowDown")return{row:it(t.row+1,le,x),column:t.column};if(e==="ArrowUp")return{row:it(t.row-1,le,x),column:t.column};if(e==="Home")return s.jumpToEnd?{row:le,column:0}:{row:t.row,column:0};if(e==="End")return s.jumpToEnd?{row:Math.max(x,le),column:f}:{row:t.row,column:f};if(e==="PageDown")return{row:it(Math.max(t.row,0)+p,0,Math.max(x,0)),column:t.column};if(e==="PageUp")return{row:it(Math.max(t.row,0)-p,0,Math.max(x,0)),column:t.column}}function Zr(t,e){const r=e.rowCount-1,i=Math.max(e.columnCount-1,0);return{row:it(t.row,le,Math.max(r,le)),column:it(t.column,0,i)}}function St(t,e){return t.row===e.row&&t.column===e.column}function Jr(t,e,r){const i=Math.min(e,r),s=Math.max(e,r);return t.slice(i,s+1)}function Kt(t,e){const r=new Set(t),i=[];for(const s of r)e.includes(s)||i.push(s);for(const s of e)r.has(s)&&i.push(s);return i}function Qr(t){const{ids:e,index:r,selected:i,anchor:s,modifiers:l,mode:c}=t,p=e[r];if(c==="none"||p===void 0)return{selected:[...i],anchor:s};if(c==="single")return{selected:[p],anchor:p};const x=s===void 0?-1:e.indexOf(s);if(l.extend&&x!==-1){const f=Jr(e,x,r);return{selected:l.toggle?Kt([...i,...f],e):f,anchor:s}}if(l.toggle){const f=new Set(i);return f.has(p)?f.delete(p):f.add(p),{selected:Kt(f,e),anchor:p}}return{selected:[p],anchor:p}}function ea(t,e,r){return r!=="multiple"?{selected:[...e],anchor:void 0}:{selected:Kt([...e,...t],t),anchor:t[0]}}function Mn(t,e){return t==null?"":typeof t=="string"?t:typeof t=="number"?Number.isFinite(t)?e.number.format(t):"":typeof t=="boolean"?t?e.yes:e.no:Number.isNaN(t.getTime())?"":e.date.format(t)}function Gn(t){return t==null?!0:typeof t=="number"?!Number.isFinite(t):t instanceof Date&&Number.isNaN(t.getTime())}function ta(t,e,r){const i=Gn(t),s=Gn(e);return i||s?i&&s?0:i?-1:1:typeof t=="number"&&typeof e=="number"?t-e:typeof t=="boolean"&&typeof e=="boolean"?t===e?0:t?1:-1:t instanceof Date&&e instanceof Date?t.getTime()-e.getTime():r.compare(String(t),String(e))}const na=pe.tableFeatures({columnFilteringFeature:pe.columnFilteringFeature,columnOrderingFeature:pe.columnOrderingFeature,columnVisibilityFeature:pe.columnVisibilityFeature,filteredRowModel:pe.createFilteredRowModel(),globalFilteringFeature:pe.globalFilteringFeature,rowSelectionFeature:pe.rowSelectionFeature,rowSortingFeature:pe.rowSortingFeature,sortedRowModel:pe.createSortedRowModel()}),oa=320,ia=8,ra=12,aa=1.2,sa="var(--mantine-primary-color-light)",Bn="mantine-focus-auto",Gt=[],la=[];function Fn(t){return t==="asc"?"ascending":t==="desc"?"descending":"none"}function ca(t,e,r){return Math.min(Math.max(t,e),r)}function da(t,e){var bn,vn;const{data:r,rowCount:i,rowOffset:s=0,onRangeChange:l,columns:c,getRowId:p,label:x,labelledBy:f,labels:h,height:m=oa,rowHeight:b=u.DATA_PITCH,headerHeight:y=u.CONTROL_HEIGHT,overscan:R=ia,selectionMode:T="multiple",selectedIds:E,defaultSelectedIds:z,onSelectionChange:I,sorting:S,defaultSorting:P,onSortingChange:j,hiddenColumns:L,defaultHiddenColumns:k,onHiddenColumnsChange:U,columnOrder:Y,defaultColumnOrder:H,onColumnOrderChange:B,filter:A,defaultFilter:N,onFilterChange:v,searchable:w=!1,onRowClick:_,onRowDoubleClick:D,onRowContextMenu:K,onFocus:Ie,onBlur:ve,empty:re}=t,q=Kr(h),oe=_e(),ce=$e(),F=Qe(),Q=po({numeric:!0,sensitivity:"variant"}),Z=a.useMemo(()=>new Intl.DateTimeFormat(ce),[ce]),ge=a.useMemo(()=>({number:F,date:Z,yes:q.yes,no:q.no}),[F,Z,q.yes,q.no]),[V,de]=X.useUncontrolled({value:E,defaultValue:z,finalValue:Gt,onChange:(d,C)=>{I==null||I([...d],C)}}),[He,We]=X.useUncontrolled({value:S,defaultValue:P,finalValue:la,onChange:(d,C)=>{j==null||j([...d],C)}}),[Ae,pt]=X.useUncontrolled({value:L,defaultValue:k,finalValue:Gt,onChange:(d,C)=>{U==null||U([...d],C)}}),[se,Ne]=X.useUncontrolled({value:Y,defaultValue:H,finalValue:Gt,onChange:(d,C)=>{B==null||B([...d],C)}}),[me,je]=X.useUncontrolled({value:A,defaultValue:N,finalValue:"",onChange:(d,C)=>{v==null||v(d,C)}}),Ce=a.useMemo(()=>{const d=new Map;for(const C of c)d.set(C.id,C);return d},[c]),ke=JSON.stringify(Ae),De=a.useMemo(()=>{const d=new Set(Ae);return c.filter(C=>(C.filterable??!0)&&!d.has(C.id)).map(C=>C.id)},[c,ke]),et=a.useMemo(()=>{const d=me.trim();if(d!=="")return{query:d.toLocaleLowerCase(ce),columnIds:De}},[me,ce,De]),ht=a.useMemo(()=>[...r],[r]),tt=a.useMemo(()=>c.map(d=>({id:d.id,accessorFn:C=>d.value(C),enableSorting:d.sortable??!0,enableHiding:d.hideable??!0,enableGlobalFilter:d.filterable??!0,sortDescFirst:d.descendingFirst,sortFn:(C,O)=>ta(d.value(C.original),d.value(O.original),Q)})),[c,Q]),Me=JSON.stringify(He),Ge=a.useMemo(()=>He.map(d=>({id:d.id,desc:d.desc})),[Me]),Te=a.useMemo(()=>{const d={};for(const C of Ae)d[C]=!1;return d},[Ae]),W=a.useMemo(()=>{const d={};for(const C of V)d[C]=!0;return d},[V]),ae=a.useMemo(()=>[...se],[se]),te=a.useRef(void 0),ye=i!==void 0,ue=ye?s:0,fe=pe.useTable({features:na,data:ht,columns:tt,getRowId:p,manualSorting:ye,manualFiltering:ye,enableRowSelection:T!=="none",enableMultiRowSelection:T==="multiple",getColumnCanGlobalFilter:()=>!0,globalFilterFn:(d,C,O)=>{const $=O;if($===void 0||!$.columnIds.includes(C))return!1;const J=Ce.get(C);return J===void 0?!1:Mn(J.value(d.original),ge).toLocaleLowerCase(ce).includes($.query)},state:{sorting:Ge,columnVisibility:Te,columnOrder:ae,rowSelection:W,globalFilter:et},onSortingChange:d=>{const C=pe.functionalUpdate(d,Ge);We(C.map(O=>({id:O.id,desc:O.desc})),te.current)},onColumnVisibilityChange:d=>{const C=pe.functionalUpdate(d,Te);pt(Object.keys(C).filter(O=>!C[O]))},onColumnOrderChange:d=>{Ne(pe.functionalUpdate(d,ae))},onRowSelectionChange:d=>{de(Object.keys(pe.functionalUpdate(d,W)))}}),{rows:M}=fe.getRowModel(),ee=fe.getVisibleLeafColumns(),xe=i??M.length,Ye=ee.length,st=a.useMemo(()=>M.map(d=>d.id),[M]),Xe=a.useRef(null),lt=a.useRef(null),Re=Xo.useVirtualizer({count:xe,getScrollElement:()=>Xe.current,estimateSize:()=>b,getItemKey:d=>st[d-ue]??d,overscan:R}),jt=Re.getVirtualItems(),dn=((bn=jt[0])==null?void 0:bn.index)??0,un=(((vn=jt.at(-1))==null?void 0:vn.index)??-1)+1;a.useEffect(()=>{l==null||l(dn,un)},[dn,un]);const[fn,nt]=a.useState({row:le,column:0}),we=a.useMemo(()=>Zr(fn,{rowCount:xe,columnCount:Ye}),[fn,xe,Ye]),Lt=a.useRef(!1),Ot=a.useRef(void 0),Bo=d=>{d.row>=0&&Re.scrollToIndex(d.row),Lt.current=!0,nt(C=>St(C,d)?C:d)};a.useLayoutEffect(()=>{var O;if(!Lt.current)return;const d=`[data-grid-row="${we.row}"][data-grid-column="${we.column}"]`,C=(O=lt.current)==null?void 0:O.querySelector(d);C instanceof HTMLElement&&(Lt.current=!1,C.focus())});const xn=(d,C)=>{Ot.current=d.anchor,!(d.selected.length===V.length&&d.selected.every(($,J)=>$===V[J]))&&de(d.selected,C)},gt=(d,C,O)=>{xn(Qr({ids:st,index:d-ue,selected:V,anchor:Ot.current,modifiers:C,mode:T}),O)},pn=(d,C,O)=>{const $=M[d-ue];$!==void 0&&(_==null||_($.original,C,O))},Fo=(d,C)=>{d.getCanSort()&&(te.current=C,d.toggleSorting(void 0,C.shiftKey&&d.getCanMultiSort()),te.current=void 0)},Vo=()=>{var O;const d=((O=Xe.current)==null?void 0:O.clientHeight)??0,C=Math.floor((d===0?b*10:d)/b);return Math.max(1,C-1)},Uo=d=>{const C=T==="multiple",O=d.ctrlKey||d.metaKey;if(C&&O&&(d.key==="a"||d.key==="A")){d.preventDefault(),xn(ea(st,V,T),d);return}if(we.row>=0&&(d.key===" "||d.key==="Enter")){d.preventDefault(),d.key===" "?gt(we.row,{extend:d.shiftKey,toggle:!d.shiftKey},d):(gt(we.row,{extend:!1,toggle:!1},d),pn(we.row,d,{source:"keyboard"}));return}const $=qr(we,d.key,{rowCount:xe,columnCount:Ye,pageSize:Vo()},oe,{jumpToEnd:O});$!==void 0&&(d.preventDefault(),Bo($),C&&d.shiftKey&&$.row>=0&&$.row!==we.row&>($.row,{extend:!0,toggle:!1},d))};a.useImperativeHandle(e,()=>({scrollToRow:d=>{d>=0&&d<xe&&Re.scrollToIndex(d)},setColumnHidden:(d,C)=>{var O;(O=fe.getColumn(d))==null||O.toggleVisibility(!C)},moveColumn:(d,C)=>{const O=fe.getAllLeafColumns().map(J=>J.id),$=O.indexOf(d);$!==-1&&(O.splice($,1),O.splice(ca(C,0,O.length),0,d),fe.setColumnOrder(O))},clearSelection:()=>{Ot.current=void 0,de([])}}),[fe,Re,xe,de]);const $o=ee.reduce((d,C)=>{var O;return d+(((O=Ce.get(C.id))==null?void 0:O.width)??u.FIELD)},0),hn=(d,C)=>{const O=(d==null?void 0:d.width)??u.FIELD;return{flex:C===Ye-1?`1 1 ${String(O)}px`:`0 0 ${String(O)}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"}},mt=T!=="none",gn=i??r.length,mn=q.rowsShown(F.format(xe),F.format(gn)),Wo=()=>re!==void 0?re:gn===0?q.noRows:q.noMatchingRows;return n.jsxs(o.Box,{"data-testid":"data-table",dir:he(oe)?"rtl":void 0,onFocus:Ie,onBlur:ve,style:{display:"flex",flexDirection:"column",gap:u.TRAIL_GAP,width:"100%",color:g.VALUE},children:[w&&n.jsxs(o.Box,{style:{display:"flex",alignItems:"center",gap:u.GUTTER},children:[n.jsx(o.TextInput,{"data-testid":"data-table-search",type:"search","aria-label":q.search,placeholder:q.searchPlaceholder,value:me,onChange:d=>{je(d.currentTarget.value,d)},rightSection:me===""?void 0:n.jsx(o.ActionIcon,{"data-testid":"data-table-search-clear",variant:"subtle",size:u.CONTROL_HEIGHT,"aria-label":q.clearSearch,onClick:d=>{je("",d)},children:n.jsx(ie,{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:mn})]}),n.jsxs(o.VisuallyHidden,{role:"status","aria-live":"polite",dir:"auto","data-testid":"data-table-status",children:[mn,mt&&V.length>0?` ${q.rowsSelected(F.format(V.length))}`:""]}),n.jsxs(o.Box,{ref:Xe,"data-testid":"data-table-viewport",style:{height:m,overflow:"auto",position:"relative",border:`1px solid ${g.BORDER}`,borderRadius:"var(--mantine-radius-sm)",background:g.PANEL},children:[n.jsxs(o.Table,{ref:lt,role:"grid","aria-label":f===void 0&&x===void 0?q.dataTable:x,"aria-labelledby":f,"aria-rowcount":xe+1,"aria-colcount":Ye,"aria-multiselectable":T==="multiple"?!0:void 0,onKeyDown:Uo,stickyHeader:!0,tabularNums:!0,withRowBorders:!1,horizontalSpacing:0,verticalSpacing:0,highlightOnHover:mt,highlightOnHoverColor:g.SURFACE,style:{display:"grid",width:"100%",minWidth:$o,fontSize:ra,lineHeight:aa},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:y},children:ee.map((d,C)=>{const O=Ce.get(d.id),$=d.getCanSort(),J=d.getIsSorted(),be=we.row===le&&we.column===C,bt=J===!1?-1:d.getSortIndex(),vt=be?0:-1,ct=n.jsxs(n.Fragment,{children:[n.jsx(o.Box,{component:"span","data-testid":"data-table-header-label",dir:"auto",title:O==null?void 0:O.header,style:{flex:"0 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:J===!1?void 0:g.VALUE},children:(O==null?void 0:O.header)??d.id}),J!==!1&&n.jsx(o.Box,{component:"span","data-testid":"data-table-sort-glyph","data-direction":Fn(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(ie,{name:"chevronDown",size:u.CHEVRON})}),Ge.length>1&&bt>=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:F.format(bt+1)})]});return n.jsx(o.Table.Th,{scope:"col","data-testid":"data-table-header","aria-colindex":C+1,"aria-sort":$?Fn(J):void 0,"data-grid-row":$?void 0:le,"data-grid-column":$?void 0:C,tabIndex:$?void 0:vt,className:$?void 0:Bn,onFocus:$?void 0:()=>{nt(Le=>St(Le,{row:le,column:C})?Le:{row:le,column:C})},style:{...hn(O,C),gap:u.GUTTER/2,height:y,fontSize:"var(--mantine-font-size-sm)",fontWeight:500,color:g.CHROME,textAlign:"start"},children:$?n.jsx(o.UnstyledButton,{type:"button","data-testid":"data-table-sort-button","data-grid-row":le,"data-grid-column":C,tabIndex:vt,onClick:Le=>{nt({row:le,column:C}),Fo(d,Le)},onFocus:()=>{nt(Le=>St(Le,{row:le,column:C})?Le:{row:le,column:C})},style:{display:"flex",alignItems:"center",gap:u.GUTTER/2,justifyContent:(O==null?void 0:O.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:ct}):ct},d.id)})})}),n.jsx(o.Table.Tbody,{style:{display:"grid",position:"relative",height:Re.getTotalSize()},children:jt.map(d=>{const C=M[d.index-ue];if(C===void 0)return null;const O=V.includes(C.id);return n.jsx(o.Table.Tr,{role:"row","data-testid":"data-table-row","data-index":d.index,"data-selected":O?"true":void 0,"aria-rowindex":d.index+2,"aria-selected":mt?O:void 0,onDoubleClick:$=>{D==null||D(C.original,$)},onContextMenu:$=>{K==null||K(C.original,$)},style:{display:"flex",position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:b,transform:`translateY(${String(d.start)}px)`,background:O?sa:void 0,cursor:mt?"pointer":void 0},children:ee.map(($,J)=>{const be=Ce.get($.id),bt=we.row===d.index&&we.column===J,vt=be==null?void 0:be.value(C.original),ct=Mn(vt,ge),Le=(be==null?void 0:be.cell)===void 0?n.jsx(o.Box,{component:"span",dir:"auto",style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:ct}):be.cell(C.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:bt?0:-1,className:Bn,title:(be==null?void 0:be.cell)===void 0?ct:void 0,onFocus:()=>{nt(Oe=>St(Oe,{row:d.index,column:J})?Oe:{row:d.index,column:J})},onClick:Oe=>{nt({row:d.index,column:J}),gt(d.index,{extend:Oe.shiftKey,toggle:Oe.metaKey||Oe.ctrlKey},Oe),pn(d.index,Oe,rt(Oe))},style:hn(be,J),children:Le},$.id)})},C.id)})})]}),xe===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:Wo()})]})]})}const ua=a.forwardRef(da);function fa(){return crypto.randomUUID().slice(0,8)}function Rt(t,e){return{id:fa(),offset:t,color:e}}function zo(){return[Rt(0,"#6366F1"),Rt(1,"#06B6D4")]}const xa=2,pa=5,ha=80,ga=0,Bt=100,Ft=0,ma=360,ba=[0,90,180,270,360];function va({stops:t,defaultStops:e,direction:r,defaultDirection:i=Ft,showDirection:s=!0,onChange:l,onChangeStart:c,onChangeEnd:p,minStops:x=xa,maxStops:f=pa}){const h=ne(),m=Qe({maximumFractionDigits:0}),b=a.useId(),y=a.useId(),R=a.useMemo(()=>zo(),[]),[T,E]=X.useUncontrolled({value:t,defaultValue:e,finalValue:R,onChange:(A,N)=>{l==null||l(A,z,N)}}),[z,I]=X.useUncontrolled({value:r,defaultValue:i,finalValue:Ft,onChange:(A,N)=>{l==null||l(T,A,N)}}),S=a.useRef(!1),P=A=>{S.current||(S.current=!0,c==null||c(A))},j=(A,N)=>{S.current=!1,p==null||p(A,N)},L=(A,N)=>T.map((v,w)=>w===A?{...v,color:N}:v),k=(A,N)=>T.map((v,w)=>w===A?{...v,offset:N/Bt}:v),U=A=>{if(T.length>=f)return;const N=T[T.length-1],v=N===void 0?.5:(N.offset+1)/2,w=[...T,Rt(v,Et)];w.sort((_,D)=>_.offset-D.offset),E(w,A)},Y=(A,N)=>{T.length<=x||E(T.filter((v,w)=>w!==A),N)},H=T.length>=f,B=T.length<=x;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:H,"aria-label":h.addColorStop,children:n.jsx(ie,{name:"plus",size:u.CHEVRON})})]}),n.jsx(o.Stack,{"data-testid":"gradient-editor-stops",gap:"xs",role:"group","aria-labelledby":b,children:T.map((A,N)=>{const v=m.format(N+1);return n.jsxs(o.Group,{"data-testid":"gradient-editor-stop",gap:"xs",align:"flex-end",wrap:"nowrap",children:[n.jsx(Eo,{color:A.color,defaultColor:Et,onColorChange:(w,_)=>{E(L(N,w??Et),_)},showOpacity:!1}),n.jsx(o.Box,{style:{width:ha},children:n.jsx(o.Slider,{"data-testid":"gradient-editor-stop-position",min:ga,max:Bt,value:A.offset*Bt,onPointerDown:P,onChange:w=>{P(),E(k(N,w))},onChangeEnd:w=>{j(k(N,w),z)},label:w=>h.percent(m.format(w)),thumbLabel:h.colorStopPosition(v)})}),n.jsx(o.ActionIcon,{variant:"subtle",color:"gray",size:u.TRAIL,onClick:w=>{Y(N,w)},"data-testid":"gradient-editor-remove-stop",disabled:B,"aria-label":h.removeColorStop(v),children:n.jsx(ie,{name:"minus",size:u.CHEVRON})})]},A.id)})}),s&&n.jsxs(o.Box,{"data-testid":"gradient-editor-direction",pb:"md",role:"group","aria-labelledby":y,children:[n.jsx(o.Text,{id:y,"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:Ft,max:ma,value:z,onPointerDown:P,onChange:A=>{P(),I(A)},onChangeEnd:A=>{j(T,A)},label:A=>h.degrees(m.format(A)),thumbLabel:h.gradientDirection,marks:ba.map(A=>({value:A,label:h.degrees(m.format(A))}))})]})]})}function ya(t){const e=o.useInputWrapperContext();return n.jsx(o.SegmentedControl,{"aria-labelledby":e==null?void 0:e.labelId,"aria-describedby":e==null?void 0:e.describedBy,...t})}const wa=4,Sa=2,Ia=1.1;function Ca(){const t=$e();return a.useMemo(()=>{var r;return((r=new Intl.NumberFormat(t).formatToParts(Ia).find(i=>i.type==="decimal"))==null?void 0:r.value)??"."},[t])}function Ea({label:t,value:e,defaultValue:r,onChange:i,min:s,max:l,step:c,decimalScale:p,suffix:x,hideControls:f=!0,disabled:h=!1,disabledReason:m,onFocus:b,onBlur:y}){const R=ne(),T=at({name:t,disabled:h,disabledReason:m}),E=Qt(),z=Ca(),[I,S]=X.useUncontrolled({value:e,defaultValue:void 0,finalValue:void 0,onChange:i}),P=I===void 0,j=I??r,[L,k]=a.useState(j),U=a.useRef(!1);a.useEffect(()=>{U.current||k(I??r),U.current=!1},[I,r]);const Y=A=>{U.current=!0,k(A)},H=A=>{const N=typeof L=="string"?E(L):L;if(Number.isNaN(N)){k(I??r),y==null||y(A);return}let v=N;s!==void 0&&v<s&&(v=s),l!==void 0&&v>l&&(v=l),v!==I&&S(v,A),k(v),y==null||y(A)},B=A=>{S(void 0,A)};return n.jsxs(o.Group,{"data-testid":"style-number-input",gap:wa,wrap:"nowrap",align:"flex-end",title:T.title,"data-disabled":h?"true":void 0,children:[n.jsx(o.NumberInput,{"data-testid":"style-number-input-field",label:t,description:T.description,value:L,onChange:Y,onFocus:b,onBlur:H,min:s,max:l,step:c,decimalScale:p,decimalSeparator:z,suffix:x,hideControls:f,disabled:h,"data-is-default":P?"true":"false",styles:{input:P?{fontStyle:"italic",color:g.CHROME}:void 0,description:Tt},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":R.resetToDefault(t),onClick:B,style:{marginBlockEnd:Sa},children:n.jsx(ie,{name:"reset",size:u.CHEVRON})})]})}const Ta=4,Ra=2;function za({label:t,value:e,defaultValue:r,options:i,onChange:s,disabled:l=!1,disabledReason:c,onFocus:p,onBlur:x}){const f=ne(),h=at({name:t,disabled:l,disabledReason:c}),[m,b]=X.useUncontrolled({value:e,defaultValue:void 0,finalValue:void 0,onChange:s}),y=m===void 0,R=m??r,T=z=>{z!==null&&b(z)},E=z=>{b(void 0,z)};return n.jsxs(o.Group,{"data-testid":"style-select",gap:Ta,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:t,description:h.description,value:R,onChange:T,onFocus:p,onBlur:x,data:i,rightSection:n.jsx(ie,{name:"chevronDown",size:u.GLYPH}),rightSectionPointerEvents:"none",disabled:l,"data-is-default":y?"true":"false",allowDeselect:!1,styles:{input:y?{fontStyle:"italic",color:g.CHROME}:void 0,description:Tt},style:{flex:1}}),!y&&n.jsx(o.ActionIcon,{variant:"subtle",size:u.TRAIL,c:g.CHROME,"data-testid":"style-select-reset",disabled:l,"aria-label":f.resetToDefault(t),onClick:E,style:{marginBlockEnd:Ra},children:n.jsx(ie,{name:"reset",size:u.CHEVRON})})]})}const It=4,Pa=`${String(u.TOGGLE_PITCH)}px`;function Aa({label:t,checked:e,defaultChecked:r,onChange:i,disabled:s=!1,disabledReason:l,bound:c=!1,boundDescription:p,onFocus:x,onBlur:f,children:h}){const m=a.useId(),b=ne(),[y,R]=X.useUncontrolled({value:e,defaultValue:r,finalValue:!1,onChange:i}),T=P=>{R(P.currentTarget.checked,P)},E={root:{minWidth:0},body:{alignItems:"center",minWidth:0},labelWrapper:{minWidth:0},label:{display:"block",height:u.TOGGLE_PITCH,paddingInlineStart:It,fontSize:"var(--mantine-font-size-sm)",lineHeight:Pa,color:s?g.DISABLED:g.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},z=p??b.fieldBound,I=at({name:t,enabledTitle:t,disabled:s,disabledReason:l,extraDescriptions:c?[z]:void 0}),S=n.jsx(o.Checkbox,{"data-testid":"toggle-with-content-checkbox",label:t,checked:y,disabled:s,"aria-expanded":y,"aria-controls":y?m:void 0,"aria-describedby":I.describedBy,onChange:T,onFocus:x,onBlur:f,wrapperProps:{title:I.title},styles:E});return n.jsxs(o.Box,{"data-testid":"toggle-with-content","data-checked":y?"true":"false","data-disabled":s?"true":void 0,"data-bound":c?"true":void 0,style:{display:"flex",flexDirection:"column",gap:It},children:[c?n.jsxs(o.Box,{"data-testid":"toggle-with-content-row",style:{display:"flex",alignItems:"center",gap:It},children:[S,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(Je,{name:"attribute",filled:!0})})]}):S,I.description!==void 0&&n.jsx(o.VisuallyHidden,{id:I.describedBy,children:I.description}),y&&n.jsx(o.Box,{id:m,"data-testid":"toggle-with-content-children",style:{display:"flex",flexDirection:"column",gap:It,paddingInlineStart:u.GUTTER},children:h})]})}function Po(t,e){return t!==void 0?t:e===void 0?"off":"polite"}function Ue(t,e){const r=Po(t,e);return r==="off"?{"aria-busy":e}:{"aria-live":r,"aria-atomic":!0,"aria-busy":e}}const Vt=4,ja="(hover: none)";function La(t){if(typeof t=="string")return t;if(typeof t=="number")return String(t)}function Oa(t){const{state:e,stateTitle:r,busy:i,live:s,actions:l,residentActions:c,actionsVisible:p,disabled:x=!1,onClick:f,onFocus:h,onBlur:m}=t,b=Ue(s,i),{hovered:y,ref:R}=X.useHover(),T=X.useMediaQuery(ja)??!1,[E,z]=a.useState(!1),I=a.useId(),S=E||(p??(y||T)),P=l!==void 0||c!==void 0,j=La(e),L=r!==void 0&&r!==j,k=r??j,U=P&&e!==void 0,Y=L?n.jsxs(n.Fragment,{children:[n.jsx("span",{"aria-hidden":"true",children:e}),n.jsx(o.VisuallyHidden,{"data-testid":"action-row-state-full",children:r})]}):e;Pe(f!==void 0&&e===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 H=w=>{z(!0),h==null||h(w)},B=w=>{w.currentTarget.contains(w.relatedTarget)||z(!1),m==null||m(w)},A=w=>{x||f==null||f(w,rt(w))},N={flex:"1 1 auto",minWidth:0,fontSize:"var(--mantine-font-size-sm)",lineHeight:1.2,color:x?g.DISABLED:g.CHROME,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},v={...N,alignSelf:"stretch",lineHeight:`${u.ROW_PITCH}px`,textAlign:"start",borderRadius:"var(--mantine-radius-sm)"};return n.jsxs(o.Box,{ref:R,"data-testid":"action-row",role:U?"group":void 0,"aria-labelledby":U?I:void 0,"aria-disabled":x||void 0,"data-disabled":x||void 0,onFocus:H,onBlur:B,style:{display:"flex",alignItems:"center",justifyContent:"space-between",boxSizing:"border-box",gap:u.TRAIL_GAP,height:u.ROW_PITCH},children:[e!==void 0&&(f===void 0?n.jsx(o.Box,{component:"span",id:I,"data-testid":"action-row-state",title:k,...b,style:N,children:Y}):n.jsx(o.UnstyledButton,{type:"button",id:I,"data-testid":"action-row-state",title:k,...b,onClick:A,style:v,children:Y})),P&&n.jsxs(o.Box,{"data-testid":"action-row-affordances",style:{flex:"0 0 auto",marginInlineStart:"auto",display:"flex",alignItems:"center",gap:Vt},children:[l!==void 0&&n.jsx(o.Box,{"data-testid":"action-row-actions","data-visible":S?"true":"false",style:{flex:"0 0 auto",display:"flex",alignItems:"center",gap:Vt,opacity:S?1:0,pointerEvents:S?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:Vt},children:c})]})]})}const Ao=u.GUTTER,_a=12,jo=1.2,Ha=20,Na=500,ka="var(--mantine-primary-color-light)";function Da({name:t,value:e,icon:r,selected:i=!1,role:s="button",tabIndex:l,onClick:c,onDoubleClick:p,onContextMenu:x,onFocus:f,onBlur:h,trailing:m}){const{hovered:b,ref:y}=X.useHover(),R=c!==void 0,T=r!=null,E=e!=null,z=ft(m),I=s==="option",S=I?i:void 0,P=!I&&i?!0:void 0,j=Y=>{c==null||c(Y,rt(Y))};let L="transparent";i?L=ka:R&&b&&(L=g.SURFACE);const k=n.jsxs(n.Fragment,{children:[T&&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:r}),n.jsx(o.Box,{component:"span","data-testid":"data-row-name",title:t,style:{flex:"1 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t}),E&&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:e})]}),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:R?"pointer":"default"};return n.jsxs(o.Box,{ref:y,"data-testid":"data-row","data-selected":i?"true":void 0,onDoubleClick:p,onContextMenu:x,style:{display:"flex",alignItems:"center",gap:u.TRAIL_GAP,boxSizing:"border-box",width:"100%",height:u.DATA_PITCH,paddingInline:Ao,borderRadius:"var(--mantine-radius-sm)",background:L,color:g.VALUE,fontSize:_a,lineHeight:jo},children:[R?n.jsx(o.UnstyledButton,{type:"button","data-testid":"data-row-button",role:I?"option":void 0,"aria-current":P,"aria-selected":S,tabIndex:l,onClick:j,onFocus:f,onBlur:h,style:U,children:k}):n.jsx(o.Box,{"data-testid":"data-row-body",role:I?"option":void 0,"aria-current":P,"aria-selected":S,tabIndex:l,onFocus:f,onBlur:h,style:U,children:k}),z&&n.jsx(Ee,{children:m})]})}function Ma({label:t,unit:e,sortDirection:r,defaultSortDirection:i,onSortChange:s,sortPriority:l}){const[c,p]=X.useUncontrolled({value:r,defaultValue:i,finalValue:"none",onChange:s}),x=Qe(),f=s!==void 0,h=c!=="none",m=R=>{p(c==="ascending"?"descending":"ascending",R)},b=n.jsxs(n.Fragment,{children:[n.jsx(o.Box,{component:"span","data-testid":"data-row-header-label",title:t,style:{flex:"1 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:h?g.VALUE:void 0},children:t}),e!==void 0&&n.jsx(o.Box,{component:"span","data-testid":"data-row-header-unit",style:{flex:"0 0 auto",whiteSpace:"nowrap"},children:e}),l!==void 0&&h&&n.jsx(o.Box,{component:"span","aria-hidden":"true",style:{flex:"0 0 auto",display:"flex"},children:n.jsx(cn,{children:x.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(ie,{name:"chevronDown",size:u.CHEVRON})})]}),y=f||h;return n.jsx(o.Box,{"data-testid":"data-row-header",role:y?"columnheader":void 0,"aria-sort":y?c:void 0,style:{display:"flex",alignItems:"center",gap:u.GUTTER,boxSizing:"border-box",width:"100%",height:Ha,paddingInline:Ao,fontSize:"var(--mantine-font-size-sm)",lineHeight:jo,color:g.CHROME},children:f?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 cn({children:t}){return n.jsx(o.Badge,{component:"span","data-testid":"rank-chip",style:{flex:"0 0 auto",background:g.RAISED,color:g.VALUE,fontWeight:Na,textTransform:"none",letterSpacing:"normal"},children:t})}const Vn=2,Ga=1,Ba=13,Fa=2,Va=1,Ua=1,$a=64,Lo=4,Un=Lo/2,Oo=4,Wa=12,qe=100,Ya=1.5,qt=100;function zt({children:t,end:e,id:r}){return n.jsx(o.Box,{component:"span",id:r,"data-testid":`chart-axis-${e}`,style:{flex:"0 0 auto",minWidth:0,fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:g.CHROME,whiteSpace:"nowrap"},children:t})}function _o(){return n.jsx(o.Box,{"data-testid":"chart-baseline",style:{flex:"0 0 auto",height:Ga,background:g.BORDER}})}function Ho({caption:t,rows:e,testId:r}){return n.jsxs(o.VisuallyHidden,{component:"table","data-testid":r,children:[t!==void 0&&n.jsx("caption",{children:t}),n.jsx("tbody",{children:e.map(i=>n.jsxs("tr",{children:[n.jsx("th",{scope:"row",children:i.header}),n.jsx("td",{children:i.value})]},i.id))})]})}function Xa(t,e){if(t.length===0)return null;const r=qe/2;if(t.length===1)return`0,${r} ${qe},${r}`;const i=Math.min(...t),l=Math.max(...t)-i,c=t.length-1;return t.map((p,x)=>{const f=br(x/c,qe,e),h=l===0?r:qe-(p-i)/l*qe;return`${f},${h}`}).join(" ")}function No(){const t=a.useId(),e=`${t}min`,r=`${t}max`;return{min:e,max:r,describedBy:`${e} ${r}`}}function Ka({bins:t,label:e,minLabel:r,maxLabel:i,busy:s,live:l,trailing:c}){const p=Qe(),x=No(),f=t.reduce((m,b)=>Math.max(m,b.count,0),0),h=t.map((m,b)=>({id:`${m.label}-${String(b)}`,header:m.label,value:p.format(m.count)}));return n.jsxs(o.Box,{"data-testid":"histogram-row","aria-busy":s,style:{display:"flex",alignItems:"flex-start",gap:u.TRAIL_GAP,height:u.HISTOGRAM_HEIGHT},children:[n.jsxs(o.Box,{"data-testid":"histogram-chart",...Ue(l,s),style:{flex:"1 1 auto",minWidth:0,height:"100%",display:"flex",flexDirection:"column",gap:Vn},children:[n.jsxs(o.Box,{"data-testid":"histogram-drawing",role:e===void 0?void 0:"img","aria-label":e,"aria-describedby":e===void 0?void 0:x.describedBy,"aria-hidden":e===void 0?!0:void 0,style:{flex:"1 1 auto",minHeight:0,display:"flex",flexDirection:"column",gap:Vn},children:[n.jsx(o.Box,{"data-testid":"histogram-plot",style:{flex:"1 1 auto",minHeight:0,display:"flex",alignItems:"flex-end",gap:Fa},children:t.map((m,b)=>{const y=Math.max(0,m.count),R=f===0?0:y/f*qt,T=m.highlighted===!0;return n.jsx(o.Box,{"data-testid":"histogram-bar","data-highlighted":T?"true":"false","aria-hidden":"true",title:m.label,style:{flex:"1 1 0",minWidth:0,height:`${String(R)}%`,minHeight:y>0?Ua:0,background:T?g.ACCENT:g.BORDER,borderRadius:Va}},`${m.label}-${String(b)}`)})}),n.jsx(_o,{})]}),n.jsxs(o.Box,{"data-testid":"chart-axis",style:{flex:"0 0 auto",height:Ba,display:"flex",alignItems:"center",justifyContent:"space-between",gap:Oo},children:[n.jsx(zt,{end:"min",id:x.min,children:r}),n.jsx(zt,{end:"max",id:x.max,children:i})]})]}),n.jsx(Ho,{caption:e,rows:h,testId:"histogram-values"}),ft(c)&&n.jsx(Ee,{children:c})]})}function qa({values:t,label:e,minLabel:r,maxLabel:i,busy:s,live:l,trailing:c}){const p=_e(),x=Qe(),f=No(),h=Xa(t,p),m=t.map((b,y)=>({id:`point-${String(y)}`,header:x.format(y+1),value:x.format(b)}));return n.jsxs(o.Box,{"data-testid":"sparkline-row","aria-busy":s,style:{display:"flex",alignItems:"center",gap:u.TRAIL_GAP,height:u.SPARKLINE_HEIGHT},children:[n.jsxs(o.Box,{"data-testid":"sparkline-chart",...Ue(l,s),style:{flex:"1 1 auto",minWidth:0,display:"flex",alignItems:"center",gap:Oo},children:[n.jsx(zt,{end:"min",id:f.min,children:r}),n.jsxs(o.Box,{"data-testid":"sparkline-drawing",role:e===void 0?void 0:"img","aria-label":e,"aria-describedby":e===void 0?void 0:f.describedBy,"aria-hidden":e===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(qe)} ${String(qe)}`,preserveAspectRatio:"none",fill:"none",stroke:"currentColor",strokeWidth:Ya,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(_o,{})]}),n.jsx(zt,{end:"max",id:f.max,children:i})]}),n.jsx(Ho,{caption:e,rows:m,testId:"sparkline-values"}),ft(c)&&n.jsx(Ee,{children:c})]})}function Za({name:t,percentile:e,value:r,rank:i,busy:s,live:l,onClick:c,onDoubleClick:p,onContextMenu:x,onFocus:f,onBlur:h}){const m=ne(),b=xo(),y=a.useId(),R=c,T=R!==void 0,E=Math.min(qt,Math.max(0,e)),z=m.percentile(b(Math.round(E))),I=P=>{R!==void 0&&R(P,rt(P))},S=P=>{R!==void 0&&(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),R(P,rt(P)))};return n.jsxs(o.Box,{"data-testid":"metric-row",role:T?"button":void 0,tabIndex:T?0:void 0,...Ue(l,s),onClick:I,onKeyDown:S,onDoubleClick:p,onContextMenu:x,onFocus:f,onBlur:h,style:{display:"flex",alignItems:"center",gap:u.GUTTER,height:u.ROW_PITCH,cursor:T?"pointer":"default"},children:[n.jsx(o.Box,{component:"span",id:y,"data-testid":"metric-row-name",title:t,style:{flex:"1 1 auto",minWidth:0,fontSize:Wa,lineHeight:1.2,color:g.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t}),n.jsx(o.Progress.Root,{"data-testid":"metric-row-bar",role:"progressbar","aria-labelledby":y,"aria-valuemin":0,"aria-valuemax":qt,"aria-valuenow":E,"aria-valuetext":z,title:z,size:Lo,style:{flex:`0 0 ${String($a)}px`,borderRadius:Un,background:g.SURFACE},children:n.jsx(o.Progress.Section,{"data-testid":"metric-row-fill",value:E,withAria:!1,color:g.ACCENT,style:{borderRadius:Un}})}),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:r}),i!==void 0&&n.jsx(cn,{children:i})]})}const ko=a.createContext(!1);function Do({showLabels:t=!1,children:e}){return n.jsx(ko.Provider,{value:t,children:e})}function xt(){return a.useContext(ko)}const Ja=u.VALUE_INSET-u.GLYPH_SLOT,Qa=2,es=1,ts=2,ns=3;function os(t){if(t.fullValue!==void 0)return t.fullValue;if(typeof t.value=="string")return t.value;if(typeof t.value=="number")return String(t.value)}function is({segment:t,grow:e,index:r}){const{glyph:i,value:s,unit:l,mono:c=!1}=t;let p=null;en(i)?p=n.jsx(Je,{name:i}):tn(i)?p=n.jsx(o.Box,{component:"span","data-letter":i,style:{fontSize:"var(--mantine-font-size-sm)",lineHeight:1},children:i}):i!=null&&(p=i);const x=os(t),f=t.fullValue!==void 0;return n.jsxs(o.Box,{"data-testid":"compound-segment","data-segment-index":r,"data-grow":e?"true":"false",style:{display:"flex",alignItems:"center",boxSizing:"border-box",flex:e?"1 1 auto":"0 0 auto",minWidth:0,height:u.CONTROL_HEIGHT,paddingBlock:0,paddingInline:Ja},children:[p!==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:p}),n.jsx(o.Box,{component:"span","data-testid":"compound-segment-value","data-mono":c?"true":"false",title:x,"aria-hidden":f?!0:void 0,style:{flex:e?"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:s}),f&&n.jsx(o.VisuallyHidden,{children:t.fullValue}),l!==void 0&&n.jsx(o.Box,{component:"span","data-testid":"compound-segment-unit",style:{flex:"0 0 auto",marginInlineStart:Qa,fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:g.CHROME},children:l})]})}function rs(t,e){if(!(e>=ts&&e<=ns))return`CompoundRow "${t}" was given ${String(e)} ${e===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 as(t,e){if(e!==1)return`CompoundRow "${t}" was given ${String(e)} 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 ss({label:t,segments:e,width:r=u.BODY,trailing:i,busy:s,live:l,onClick:c,onFocus:p,onBlur:x}){const f=xt(),h=a.useId(),m=e.filter(L=>L.grow===!0).length;Pe(rs(t,e.length)),Pe(as(t,m));const b=e.findIndex(L=>L.grow===!0),y=b===-1?0:b,R=c!==void 0,T=Po(l,s)!=="off",E=R||T,z=R?void 0:h,I=E?void 0:h,S=E||f,P={display:"flex",alignItems:"center",boxSizing:"border-box",flex:f?"1 1 auto":"0 0 auto",width:f?void 0:r,minWidth:0,height:u.CONTROL_HEIGHT,background:g.SURFACE,borderRadius:"var(--mantine-radius-sm)",overflow:"hidden",textAlign:"start",cursor:R?"pointer":void 0},j=n.jsxs(n.Fragment,{children:[E&&n.jsx(o.VisuallyHidden,{id:z,children:t}),e.map((L,k)=>n.jsxs(a.Fragment,{children:[k>0&&n.jsx(o.Box,{"data-testid":"compound-row-hairline",style:{flex:"0 0 auto",width:es,height:u.CONTROL_HEIGHT,background:g.PANEL}}),n.jsx(is,{segment:L,grow:k===y,index:k})]},k))]});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:[f&&n.jsx(o.Box,{component:"span",id:I,"data-testid":"compound-row-label",title:t,"aria-hidden":E?!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:t}),R?n.jsx(o.UnstyledButton,{type:"button",title:t,"data-testid":"compound-row-box","data-interactive":"true",...Ue(l,s),onClick:c,onFocus:p,onBlur:x,style:P,children:j}):n.jsx(o.Box,{role:"group","aria-label":S?void 0:t,"aria-labelledby":S?h:void 0,title:t,"data-testid":"compound-row-box","data-interactive":"false",...Ue(l,s),onFocus:p,onBlur:x,style:P,children:j}),n.jsx(Ee,{children:i})]})}const Ut=u.VALUE_INSET-u.GLYPH_SLOT,Ct=4,$n=4,ls=u.VALUE_INSET+u.LABEL_COLUMN,Wn={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0},Mo=a.forwardRef(function(e,r){const{label:i,glyph:s,kind:l,value:c,defaultValue:p,onChange:x,data:f,unit:h,width:m=u.FIELD,bound:b=!1,mixed:y=!1,placeholder:R,pending:T=!1,min:E,max:z,step:I,onScrubStart:S,onScrub:P,onScrubEnd:j,onClick:L,disabled:k=!1,readOnly:U,boundDescription:Y,pendingDescription:H,title:B,style:A,className:N,onKeyDown:v,...w}=e,_=xt(),D=ne(),K=_e(),Ie=X.useMediaQuery("(pointer: coarse)"),[ve,re]=X.useUncontrolled({value:c===null?"":c,defaultValue:p,finalValue:"",onChange:x}),q=l??(f!==void 0?"select":"text"),oe=q==="select",ce=q==="select"&&f!==void 0,F=U??(x===void 0&&p===void 0),Q=String(ve),Z=R===!0,ge=y||Z;let V;y?V=D.mixed:Z?V=Q:typeof R=="string"&&(V=R);const de=[];y&&de.push(D.mixed);const He=Y??D.fieldBound,We=H??D.fieldPending;b&&He!==""&&de.push(He),T&&We!==""&&de.push(We);const Ae=de.length>0?de.join(". "):void 0,se=(S!==void 0||P!==void 0||j!==void 0)&&!k&&!Ie,Ne=a.useRef(!1),me=a.useRef(!1),je=a.useRef(0),Ce=M=>{if(!se||M.button!==0)return;M.preventDefault(),M.stopPropagation();const ee=M.currentTarget;typeof ee.setPointerCapture=="function"&&ee.setPointerCapture(M.pointerId),Ne.current=!0,me.current=!1,je.current=M.clientX},ke=M=>{if(!Ne.current)return;const ee=M.clientX-je.current;ee!==0&&(je.current=M.clientX,me.current||(me.current=!0,S==null||S(M)),P==null||P(he(K)?-ee:ee,M))},De=M=>{Ne.current&&(Ne.current=!1,me.current&&(me.current=!1,j==null||j(M)))},et=M=>{k||L==null||L(M)},ht=M=>{v==null||v(M),!(L===void 0||k||M.defaultPrevented)&&(ce||(M.key==="Enter"||M.key===" "&&F)&&(M.preventDefault(),L(M)))},tt=(M,ee)=>{re(M,ee)};let Me=null;en(s)?Me=n.jsx(Je,{name:s,filled:b}):tn(s)?Me=n.jsx(o.Box,{component:"span","data-letter":s,style:{fontSize:"var(--mantine-font-size-sm)",lineHeight:1},children:s}):s!=null&&(Me=s);const Ge=n.jsxs(n.Fragment,{children:[n.jsxs(o.Box,{"data-testid":"panel-field-slot","data-scrub":se?"true":void 0,onPointerDown:se?Ce:void 0,onPointerMove:se?ke:void 0,onPointerUp:se?De:void 0,onPointerCancel:se?De:void 0,onLostPointerCapture:se?De: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:se?"ew-resize":void 0,touchAction:se?"none":void 0},children:[Me,T&&n.jsx(o.Box,{"data-testid":"panel-field-pending",style:{position:"absolute",insetInlineStart:0,bottom:0,width:$n,height:$n,background:g.ACCENT}})]}),_&&n.jsx(o.Box,{component:"span","data-testid":"panel-field-label","aria-hidden":"true",style:{flex:"1 1 auto",minWidth:0,marginInlineStart:Ct,fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:g.CHROME,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i})]}),Te=h!==void 0,W=Te||oe?n.jsxs(n.Fragment,{children:[Te&&n.jsx(o.Box,{component:"span","data-testid":"panel-field-unit",style:{flex:"0 0 auto",lineHeight:1},children:h}),oe&&n.jsx(o.Box,{component:"span","data-testid":"panel-field-chevron",style:{flex:"0 0 auto",display:"flex",alignItems:"center",marginInlineStart:Te?Ct:0},children:n.jsx(ie,{name:"chevronDown",size:u.GLYPH})})]}):void 0;let ae=Ut+Ct;oe&&(ae+=u.GLYPH),oe&&Te&&(ae+=Ct);const te=W===void 0?void 0:`calc(${String((h==null?void 0:h.length)??0)}ch + ${String(ae)}px)`,ye=se?"auto":"none",fe={"data-testid":"panel-field-value",...w,ref:r,className:N,label:i,description:Ae,placeholder:V,disabled:k,readOnly:F,onClick:et,onKeyDown:ht,leftSection:Ge,leftSectionWidth:_?ls:u.VALUE_INSET,leftSectionPointerEvents:ye,leftSectionProps:{style:{insetInlineStart:0,justifyContent:"flex-start",paddingInlineStart:Ut}},rightSection:W,rightSectionWidth:te,rightSectionPointerEvents:"none",rightSectionProps:{style:{insetInlineEnd:0,justifyContent:"flex-end",paddingInlineEnd:Ut,fontSize:"var(--mantine-font-size-sm)",color:g.CHROME}},styles:{wrapper:{marginTop:0,marginBottom:0,"--input-placeholder-color":y?g.VALUE:g.PLACEHOLDER},input:{backgroundColor:g.SURFACE,paddingInlineStart:void 0,paddingInlineEnd:void 0},label:Wn,description:Wn},wrapperProps:{title:B??i,"data-testid":"panel-field","data-kind":q,"data-bound":b?"true":void 0,"data-mixed":y?"true":void 0,"data-pending":T?"true":void 0,"data-disabled":k?"true":void 0},style:{flex:m==="fill"?"1 1 auto":"0 0 auto",width:m==="fill"?"100%":m,minWidth:0,...A}};return q==="number"?n.jsx(o.NumberInput,{...fe,value:ge?"":ve,onChange:tt,min:E,max:z,step:I,hideControls:!0}):ce?n.jsx(o.Select,{...fe,data:f,value:ge||Q===""?null:Q,onChange:M=>{tt(M??"")}}):n.jsx(o.TextInput,{...fe,value:ge?"":Q,onChange:M=>{tt(M.currentTarget.value,M)}})}),cs=2,ds=u.BODY+u.TRAIL_GAP;function us(t){return a.Children.toArray(t).flatMap(e=>a.isValidElement(e)&&e.type===a.Fragment?a.Children.toArray(e.props.children):[e])}function Yn(t,e){return a.isValidElement(t)&&t.key!==null?t.key:`field-row-${String(e)}`}function fs(t){if(a.isValidElement(t)&&typeof t.props.label=="string")return t.props.label}function Xn(t){return a.isValidElement(t)&&t.type===Mo?a.cloneElement(t,{width:"fill"}):t}const xs=a.forwardRef(function({children:e,trailing:r,groupLabel:i,role:s,style:l,"aria-label":c,"aria-labelledby":p,...x},f){const h=xt(),m=us(e),b=m.length;Pe(b===0||b>cs?`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 y=i??c,T=s??(y!==void 0||p!==void 0?"group":void 0),E=ft(r);if(h&&b>1)return n.jsx(o.Box,{ref:f,"data-testid":"field-row-labelled","data-fields":b,role:T,"aria-label":y,"aria-labelledby":p,...x,style:{display:"flex",flexDirection:"column",...l},children:m.map((j,L)=>{const k=fs(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:k,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:k}),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(Do,{showLabels:!1,children:Xn(j)})}),n.jsx(Ee,{children:L===0?r:null})]},Yn(j,L))})});const z=b<=1,I=z&&!E;let S=u.FIELD;z&&(S=I?ds:u.BODY);const P=I?void 0:u.TRAIL_GAP;return n.jsxs(o.Box,{ref:f,"data-testid":"field-row","data-fields":b,role:T,"aria-label":y,"aria-labelledby":p,...x,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":S,style:{display:"flex",alignItems:"center",flex:`0 0 ${String(S)}px`,minWidth:0,marginInlineStart:L===0?void 0:u.GUTTER,marginInlineEnd:L===b-1?P:void 0},children:Xn(j)},Yn(j,L))),n.jsx(Ee,{children:r})]})}),ps=2,hs=6,Go=1,gs=u.CONTROL_HEIGHT-Go*2,ms=2,Kn=3,bs=4,vs=6,ys=u.GLYPH,ws=3;function Ss(t,e){return e?g.DISABLED:t?g.ON_SELECTED:g.CHROME}function Is(t){const{options:e,value:r,defaultValue:i,onChange:s,label:l,labelledBy:c,name:p,disabled:x=!1,disabledReason:f,hybrid:h=!1,width:m,trailing:b,onFocus:y,onBlur:R}=t,T=xt(),E=e.length,z=at({name:l,disabled:x,disabledReason:f}),[I]=e,[S,P]=X.useUncontrolled({value:r,defaultValue:i,finalValue:I===void 0?"":I.value,onChange:s}),j=a.useRef(void 0);Pe(E<ps||E>hs?`IconGroupRow was given ${String(E)} ${E===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??(E<=ws?u.FIELD:u.BODY),k=L==="fill",U=H=>{var v;if(x||H.key!=="Home"&&H.key!=="End")return;const B=e.filter(w=>w.disabled!==!0),A=H.key==="Home"?B[0]:B[B.length-1];if(A===void 0)return;H.preventDefault(),P(A.value,H),(v=Array.from(H.currentTarget.querySelectorAll('input[type="radio"]')).find(w=>w.value===A.value))==null||v.focus()},Y=e.map(H=>{const B=H.value===S,A=x||H.disabled===!0,N=T||h&&B;return{value:H.value,disabled:H.disabled,label:n.jsxs(o.Box,{component:"span","data-testid":"icon-group-button","data-value":H.value,"data-active":B?"true":"false",title:H.label,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",gap:N?bs:0,paddingInline:N?vs:0,width:"100%",minWidth:0,color:Ss(B,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:H.icon}),N?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:H.label}):n.jsx(o.VisuallyHidden,{children:H.label})]})}});return n.jsxs(o.Box,{"data-testid":"icon-group-row",title:z.title,"data-disabled":x?"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:Y,value:S,onChange:H=>{const B=j.current;j.current=void 0,P(H,B)},onChangeCapture:H=>{j.current=H},onKeyDown:U,onFocus:y,onBlur:R,name:p,disabled:x,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:k?"1 1 auto":"0 0 auto",width:k?"100%":L,minWidth:0,height:u.CONTROL_HEIGHT,padding:Go,gap:ms,backgroundColor:g.SURFACE,overflow:"visible"},control:{flex:"1 1 auto",minWidth:ys},label:{display:"flex",alignItems:"center",justifyContent:"center",height:gs,padding:0,borderRadius:Kn,fontSize:"var(--mantine-font-size-sm)"},innerLabel:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",minWidth:0},indicator:{backgroundColor:g.SELECTED,borderRadius:Kn,boxShadow:"none"}}}),z.description!==void 0&&n.jsx(o.VisuallyHidden,{id:z.describedBy,children:z.description}),n.jsx(Ee,{children:b})]})}const Cs=12,Es=1.5,qn=1.4,Zn=4,Ts=20,Jn=220,Qn=2,eo=new RegExp("\\p{Sentence_Terminal}","u"),Rs=/[.!?]/u,to=/\s/u;function zs(t){const e=Array.from(t);let r=0,i=0,s=0;for(;i<e.length;){if(!eo.test(e[i])){i+=1;continue}let c=i;for(;c+1<e.length&&eo.test(e[c+1]);)c+=1;const p=e[c+1],x=Rs.test(e[c]);i=c+1,(!x||p===void 0||to.test(p))&&(r+=1,s=i)}return e.slice(s).some(c=>!to.test(c))?r+1:r}function Ps(t){return Array.from(t).length}function As(t,e){if(t!=="reading"||typeof e!="string")return;const r=Ps(e);if(r>Jn)return`ProseBlock was given a reading of ${String(r)} characters, and a reading is at most ${String(Jn)} characters. Shorten it, or it has stopped being a reading and become an explanation.`;const i=zs(e);if(i>Qn)return`ProseBlock was given a reading of ${String(i)} sentences, and a reading is at most ${String(Qn)} sentences. Delete any sentence that repeats what is already on screen, and move the rest into an InfoCircle.`}function js(t,e){if(!(e===void 0||t==="runRecord"))return`ProseBlock was given onDetails on the "${t}" shape, and it belongs to "runRecord". A reading and a departure line carry no chevron, so the handler is ignored.`}function Ls({variant:t,children:e,onDetails:r,busy:i,live:s}){const l=ne(),c=_e(),p=a.useId();Pe(As(t,e)),Pe(js(t,r));const x=Ue(s,i);if(t==="reading")return n.jsx(o.Text,{...x,"data-testid":"prose-block","data-variant":t,style:{fontSize:Cs,lineHeight:Es,color:g.PROSE},children:e});if(t==="departure")return n.jsxs(o.Box,{...x,role:"note","aria-label":l.departure,"data-testid":"prose-block","data-variant":t,style:{display:"flex",alignItems:"flex-start",gap:Zn},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(ie,{name:"warning",size:u.GLYPH})}),n.jsx(o.Text,{span:!0,size:"sm","data-testid":"prose-block-text",style:{lineHeight:qn,color:g.VALUE},children:e})]});const f=typeof e=="string"?e:void 0;return n.jsxs(o.Box,{...x,"data-testid":"prose-block","data-variant":t,style:{display:"flex",alignItems:"center",gap:Zn,blockSize:Ts},children:[n.jsx(o.Text,{span:!0,size:"sm",truncate:"end",id:p,title:f,"data-testid":"prose-block-text",style:{flex:"1 1 auto",minInlineSize:0,lineHeight:qn,color:g.CHROME},children:e}),r!==void 0&&n.jsx(o.UnstyledButton,{type:"button",title:l.details,"aria-label":l.details,"aria-describedby":p,"data-testid":"prose-block-details",onClick:r,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(ie,{name:he(c)?"chevronLeft":"chevronRight",size:u.CHEVRON})})]})}const $t=4,Os=4,_s=`polygon(0 calc(100% - ${Os}px), 100% 0, 100% 100%, 0 100%)`,Hs=120,Ns=`linear-gradient(to right, ${g.SURFACE}, ${g.ACCENT})`,ks={sqrt:"scaleSqrt",linear:"scaleLinear",log:"scaleLog"},no={flex:"0 0 auto",lineHeight:1,color:g.CHROME,whiteSpace:"nowrap"};function Ds({min:t,max:e,label:r,variant:i="size",gradient:s,scale:l,busy:c,live:p,onScaleClick:x,trailing:f}){const h=ne(),m=_e(),b=a.useId(),y=i==="color",R=l===void 0?void 0:ks[l],T=R===void 0?void 0:h[R],E=`${b}-label`,z=`${b}-min`,I=`${b}-max`,S=`${b}-scale`,P=[r===void 0?void 0:E,z,I,T===void 0?void 0:S].filter(k=>k!==void 0);let j=null;R!==void 0&&T!==void 0&&(x===void 0?j=n.jsx(o.Box,{"data-testid":"ramp-row-scale","aria-hidden":"true",title:T,style:{flex:"0 0 auto",width:u.TRAIL,height:u.CONTROL_HEIGHT,display:"flex",alignItems:"center",justifyContent:"center",color:g.CHROME},children:n.jsx(Je,{name:R})}):j=n.jsx(Ro,{label:T,icon:n.jsx(Je,{name:R}),onClick:x}));const L=ft(f)?f:j;return n.jsxs(o.Box,{"data-testid":"ramp-row","data-variant":i,"data-scale":l,style:{display:"flex",alignItems:"center",gap:$t,height:u.ROW_PITCH},children:[n.jsxs(o.Box,{"data-testid":"ramp-row-figure",role:"img","aria-labelledby":P.join(" "),...Ue(p,c),style:{flex:"1 1 auto",minWidth:0,display:"flex",alignItems:"center",gap:$t},children:[r!==void 0&&n.jsx(o.VisuallyHidden,{"data-testid":"ramp-row-a11y-label",id:E,children:r}),n.jsx(o.Text,{span:!0,size:"sm",id:z,"data-testid":"ramp-row-min",style:no,children:t}),n.jsx(o.Box,{"data-testid":"ramp-row-ramp","data-variant":i,"aria-hidden":"true",style:{flex:"1 1 auto",minWidth:Hs,height:u.GLYPH,boxSizing:"border-box",background:y?s??Ns:g.CHROME,borderRadius:y?"var(--mantine-radius-xs)":void 0,border:y?`1px solid ${g.BORDER}`:void 0,clipPath:y?void 0:_s,...vr(m)}}),n.jsx(o.Text,{span:!0,size:"sm",id:I,"data-testid":"ramp-row-max",style:no,children:e}),T!==void 0&&n.jsx(o.VisuallyHidden,{"data-testid":"ramp-row-a11y-scale",id:S,children:T})]}),n.jsx(o.Box,{style:{flex:"0 0 auto",display:"flex",marginInlineStart:u.TRAIL_GAP-$t},children:n.jsx(Ee,{children:L})})]})}const Ms=4,Gs=`${String(u.TOGGLE_PITCH)}px`,Bs=2;function Fs({label:t,checked:e,defaultChecked:r,onChange:i,control:s="checkbox",trailing:l,disabled:c=!1,disabledReason:p,bound:x=!1,boundDescription:f,onFocus:h,onBlur:m}){const b=ne(),[y,R]=X.useUncontrolled({value:e,defaultValue:r,finalValue:!1,onChange:i}),T=j=>{R(j.currentTarget.checked,j)},E={root:{flex:"1 1 auto",minWidth:0},body:{alignItems:"center",minWidth:0},labelWrapper:{minWidth:0},label:{display:"block",height:u.TOGGLE_PITCH,paddingInlineStart:Ms,fontSize:"var(--mantine-font-size-sm)",lineHeight:Gs,color:c?g.DISABLED:g.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},z=f??b.fieldBound,I=at({name:t,enabledTitle:t,disabled:c,disabledReason:p,extraDescriptions:x?[z]:void 0}),S={title:I.title},P=x?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(Je,{name:"attribute",filled:!0})}):null;return n.jsxs(o.Box,{"data-testid":"toggle-row","data-control":s,"data-checked":y?"true":"false","data-disabled":c?"true":void 0,"data-bound":x?"true":void 0,style:{display:"flex",alignItems:"center",boxSizing:"border-box",gap:u.TRAIL_GAP,height:u.TOGGLE_PITCH},children:[s==="switch"?n.jsx(o.Switch,{"data-testid":"toggle-row-control",label:t,checked:y,disabled:c,"aria-describedby":I.describedBy,onChange:T,onFocus:h,onBlur:m,wrapperProps:S,styles:E}):n.jsx(o.Checkbox,{"data-testid":"toggle-row-control",label:t,checked:y,disabled:c,"aria-describedby":I.describedBy,onChange:T,onFocus:h,onBlur:m,wrapperProps:S,styles:E}),I.description!==void 0&&n.jsx(o.VisuallyHidden,{id:I.describedBy,children:I.description}),P,n.jsx(Ee,{children:l})]})}function Vs({children:t,label:e,labelledBy:r}){const i=a.Children.toArray(t).length;return Pe(i<Bs?`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":r===void 0?e:void 0,"aria-labelledby":r,"data-testid":"toggle-row-group","data-rows":i,style:{display:"flex",flexDirection:"column"},children:t})}function Us(t="dark"){return o.useComputedColorScheme(t)}const $s={xs:o.rem(4),sm:o.rem(8),md:o.rem(16),lg:o.rem(24),xl:o.rem(32)},Ws={HEIGHT:24,FONT_SIZE:11,CONTROL_PADDING:8,SECTION_GAP:4};exports.ActionRow=Oa;exports.AdvancedButton=Ro;exports.COMPACT_SIZING=Ws;exports.CompactColorInput=Eo;exports.CompoundRow=ss;exports.ControlGroup=Mr;exports.ControlSection=$r;exports.ControlSubGroup=Xr;exports.DEFAULT_GRADIENT_STOP_COLOR=Et;exports.DataRow=Da;exports.DataRowHeader=Ma;exports.DataTable=ua;exports.FIELD_GLYPH_NAMES=mo;exports.FIELD_LETTERS=bo;exports.FieldGlyph=Je;exports.FieldRow=xs;exports.GradientEditor=va;exports.HistogramRow=Ka;exports.IconGroupRow=Is;exports.InfoCircle=To;exports.LabelsProvider=Ci;exports.MANTINE_SPACING=$s;exports.MAX_ALPHA_HEX=nn;exports.MAX_OPACITY_PERCENT=on;exports.MetricRow=Za;exports.PANEL_GRID=u;exports.PANEL_INK=g;exports.POPOUT_GAP=ao;exports.POPOUT_NESTED_GAP=so;exports.POPOUT_Z_INDEX_BASE=Wt;exports.PanelField=Mo;exports.PanelLabelsProvider=Do;exports.Popout=Ve;exports.PopoutButton=zr;exports.PopoutManager=Co;exports.PopoutRegion=ur;exports.ProseBlock=Ls;exports.RampRow=Ds;exports.RankChip=cn;exports.SWATCH_COLORS_HEXA=go;exports.SegmentedControl=ya;exports.SparklineRow=qa;exports.StyleNumberInput=Ea;exports.StyleSelect=za;exports.ToggleRow=Fs;exports.ToggleRowGroup=Vs;exports.ToggleWithContent=Aa;exports.TrailingSlot=Ee;exports.UI_GLYPH_NAMES=Ji;exports.UiGlyph=ie;exports.compactColors=io;exports.compactDarkColors=oo;exports.compactTheme=Zi;exports.compactThemeOverride=ho;exports.createColorStop=Rt;exports.createDefaultGradientStops=zo;exports.defaultLabels=uo;exports.getActivationMeta=rt;exports.isFieldGlyphName=en;exports.isFieldLetter=tn;exports.isRtl=he;exports.isValidHex=or;exports.opacityToAlphaHex=an;exports.parseAlphaFromHexa=rn;exports.parseHexaColor=tr;exports.parseLocaleNumber=fo;exports.toHexaColor=nr;exports.useActualColorScheme=Us;exports.useCollator=po;exports.useDirection=_e;exports.useLabels=ne;exports.useLocale=$e;exports.useNumberFormatter=Qe;exports.useNumberParser=Qt;exports.useOrdinalFormatter=xo;exports.usePanelLabels=xt;exports.usePopoutManager=pr;exports.usePopoutRegion=So;
|