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