@maxio-com/react-ui-components 9.26.0 → 9.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/skills/maxio-react/references/components-forms-combobox.md +79 -0
- package/dist/temporary-typings/src/components/forms/ComboBox/ComboBox.d.ts.map +1 -1
- package/dist/temporary-typings/src/components/forms/ComboBox/types.d.ts +3 -0
- package/dist/temporary-typings/src/components/forms/ComboBox/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/typings/index.d.ts +3 -0
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react"),t=require("classnames"),a=require("react-aria"),n=require("@react-aria/utils"),l=require("react-aria-components"),r=require("@react-stately/toggle"),i=require("@react-stately/checkbox"),o=require("framer-motion"),s=require("@floating-ui/react-dom-interactions"),c=require("@tanstack/react-table"),m=require("@atlaskit/pragmatic-drag-and-drop/element/adapter"),d=require("@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item"),u=require("@internationalized/date"),p=require("@react-stately/radio"),x=require("@react-stately/toast"),g=require("@react-aria/toast");function b(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(a){if("default"!==a){var n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:function(){return e[a]}})}}),t.default=e,Object.freeze(t)}var f=b(e);function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},h.apply(null,arguments)}const E=["address-card","arrow-down","arrow-down-left","arrow-down-left-long","arrow-down-long","arrow-down-right","arrow-down-right-long","arrow-down-up","arrow-left","arrow-left-long","arrow-left-right","arrow-right","arrow-right-long","arrow-turn-down-right","arrow-up","arrow-up-left","arrow-up-left-long","arrow-up-long","arrow-up-right","arrow-up-right-long","bank","bar-chart","briefcase","building","business-intelligence","calendar","caret-down","caret-left","caret-right","caret-up","chat","check","check-box","check-box-checked","check-box-checked-fill","check-box-indeterminate-fill","check-circle","check-circle-fill","chevron-down","chevron-left","chevron-right","chevron-up","chevron-up-down","circle","circle-half-stroke-small","circle-small-dash","circle-small-fill","circle-small-stroke","clipboard","cog","copy-file","credit-card","cross","cross-circle","cross-circle-fill","dashboard","diamond-small-fill","document","document-blank","dollar","dot-circle-fill","dot-fill","error","error-fill","error-small-fill","graph","home","info-circle","info-circle-fill","line-vertical","list","login","logout","megaphone","menu","menu-chevron-left","menu-chevron-right","notification","notification-unread","pen","plus","plus-circle","plus-circle-fill","question-circle","question-circle-fill","recently-viewed","search","square-small-fill","trash","triangle-small-fill","user","warning-circle","warning-circle-fill"],v=["anrok","dropbox","hubspot","numeral","oracle","quotapath","sage","sphere","taxjar"],_=["avalara","pipedrive","quickbooks","salesforce","xero"],w=({variant:a,color:n,className:l,size:r})=>{const i=(e,t)=>t.includes(e),o=i(a,E)||i(a,v),s=i(a,_),c=t({"fa-kit":o,"fa-kit-duotone":s,"fa-sharp fa-regular":!o&&!s,[`fa-${a}`]:!0,[`fa-${r}`]:r,[`maxio-icon--${n}`]:n&&!i(a,v)&&!i(a,_)},l);return e.createElement("i",{className:c})},N=({item:n,isSelected:l,truncateLabel:r=!1,role:i="option",small:o=!1})=>{const s=e.useRef(null),c=e.useRef(!1),m=a.useId();if(e.useEffect(()=>{l&&c.current&&s.current?.focus()},[l]),e.useEffect(()=>{c.current=!0},[]),"divider"===n.type)return e.createElement("div",{className:"maxio-action-list__divider",role:"separator","aria-hidden":"true"});const{leadingIconName:d,leadingIconClassName:u,trailingIconName:p,label:x,description:g,link:b}=n,f=t("maxio-action-list__label",{"maxio-truncate":r});return e.createElement("a",h({"aria-labelledby":m},b,{className:t("maxio-action-list__content",b.className,{"maxio-action-list__content--size-small":o}),tabIndex:l?0:-1,ref:s,role:i}),d&&e.createElement(w,{variant:d,className:t("maxio-action-list__leading-icon",u)}),e.createElement("span",{className:f,id:m},x),g&&e.createElement("span",{className:"maxio-action-list__description"},g),p&&e.createElement(w,{variant:p,className:"maxio-action-list__trailing-icon"}))},y=(e,t,a)=>0===e?e:1===e&&"divider"===t[e-1].type?a||e:"divider"===t[e-1].type?y(e-1,t,a||e):e-1,C=({items:a,isShadowed:n=!0,itemProps:l={},className:r,truncateLabels:i=!1,small:o=!1,...s})=>{const c=t("maxio-action-list",r,{"maxio-action-list--shadow":n}),[m,d]=e.useState(()=>a.findIndex(e=>"divider"!==e.type));return 0===a.length?null:e.createElement("div",h({className:c,onKeyDown:e=>{if("Space"===e.code||"Enter"===e.code){const e=a[m];e&&"divider"!==e.type&&window.open(e.link.href,e.link.target||"_self")}"ArrowUp"===e.code&&(e.preventDefault(),d(e=>y(e,a))),"ArrowDown"===e.code&&(e.preventDefault(),d(e=>((e,t)=>{const a=t.findIndex((t,a)=>"divider"!==t.type&&a>e);return-1===a?e:a})(e,a)))},role:"listbox"},s),a.map((t,a)=>e.createElement(N,h({item:t,truncateLabel:i,key:`listbox-${t.id}`,isSelected:a===m,small:o},l))))},I=({className:a,children:n,disabled:l,external:r,icon:i,size:o="sm",underline:s,variant:c,...m})=>{const d=t("maxio-link",{[`maxio-link--${o}`]:o,"maxio-link--disabled":l,[`maxio-link--${c}`]:c,"maxio-link--underline":s},a),u=r?"_blank":"_self";return e.createElement("a",h({className:d,target:u},m),n,i&&e.createElement(w,{variant:i,className:"maxio-link__icon"}))},R=({size:a="md",white:n=!1,className:l})=>{const r=t("maxio-loading-spinner",l,`maxio-loading-spinner--${a}`,{"maxio-loading-spinner--white":n});return e.createElement("div",{className:r,role:"status","aria-label":"loading"})},k=e.forwardRef(({fullWidth:l=!1,leadingElement:r,trailingElement:i,icon:o,variant:s="primary",size:c,...m},d)=>{const u=n.useObjectRef(d),{linkProps:p}=a.useLink({...m},u),x=t("maxio-button",m.className,{[`maxio-button--${c}`]:c,[`maxio-button--${s}`]:s,"maxio-button--full-width":l});return e.createElement("a",h({},p,{ref:u,className:x,href:m.href}),r&&e.cloneElement(r,{...e.isValidElement(r)&&{className:"maxio-button__leading-element"}}),m.children,(i||o)&&e.cloneElement(i||o,{...e.isValidElement(i||o)&&{className:"maxio-button__trailing-element"}}))}),S=e.forwardRef(({disabled:l,loading:r=!1,fullWidth:i=!1,leadingElement:o,trailingElement:s,icon:c,variant:m="primary",size:d,...u},p)=>{const x=n.useObjectRef(p),{buttonProps:g}=a.useButton({...u,isDisabled:l,formAction:"string"==typeof u.formAction?u.formAction:void 0},x),b=["primary","danger"].includes(m),f=t("maxio-button",u.className,{[`maxio-button--${d}`]:d,[`maxio-button--${m}`]:m,"maxio-button--loading":r,"maxio-button--full-width":i});return e.createElement("button",h({},g,{className:f,ref:x}),o&&e.cloneElement(o,{...e.isValidElement(o)&&{className:"maxio-button__leading-element"}}),u.children,!r&&(s||c)&&e.cloneElement(s||c,{...e.isValidElement(s||c)&&{className:"maxio-button__trailing-element"}}),r&&e.createElement(R,{className:"maxio-button__trailing-element",size:"md",white:b}))}),P=e.forwardRef((t,a)=>(e=>"href"in e)(t)?e.createElement(k,h({},t,{ref:a})):e.createElement(S,h({},t,{ref:a}))),T=({"aria-label":a,className:n,...l})=>e.createElement(P,h({"aria-label":a,className:t("maxio-button--icon",n)},l),null),D=({children:a,title:n,linkText:l,linkExternal:r,href:i,display:o="inline",sentiment:s="info",onDismiss:c,className:m})=>{if(!a&&!n)return console.warn("Alert component requires either children or title prop to be rendered"),null;const d=t("maxio-alert",{[`maxio-alert--${s}`]:"info"!==s&&s},m),u={success:"check-circle-fill",warning:"warning-circle-fill",danger:"error-fill",info:"info-circle-fill"}[s],p=t("maxio-alert__content",{"maxio-alert__content--block":"block"===o});return e.createElement("div",{className:d},e.createElement(w,{variant:u,className:"maxio-alert__icon","aria-hidden":"true"}),e.createElement("section",{className:"maxio-alert__container"},e.createElement("div",{className:p},n&&e.createElement("span",{className:"maxio-alert__title"},n),a&&e.createElement("span",{className:"maxio-alert__message"},a),l&&i&&e.createElement(I,h({className:"maxio-alert__link",href:i,variant:"high-contrast",underline:!0},r?{external:!0}:{}),l))),c&&e.createElement(T,{icon:e.createElement(w,{variant:"cross"}),"aria-label":"Dismiss Notification",variant:"ghost",onClick:c,className:"maxio-alert__dismiss"}))},M=e.createContext({}),O=({children:t})=>{const[a,n]=e.useState(!1),l=e.useId(),r=e.useId();return e.createElement(M.Provider,{value:{controlsId:l,buttonId:r,isOpen:a,onClose:()=>n(!1),onOpen:()=>n(!0),onToggle:()=>n(e=>!e)}},t)};function $(){const t=e.useContext(M);if(!t||"object"==typeof t&&0===Object.keys(t).length)throw new Error("useMenu hook must be used within a MenuProvider");return t}const L=({children:t})=>{const{isOpen:a,onToggle:n,onClose:l}=$();return e.createElement("details",{open:a,onToggle:n,className:"maxio-action-menu"},"function"==typeof t?t({isOpen:a,onClose:l}):t)},B=({children:a,className:n,href:l,...r})=>{const i=l?e.createElement(I,{size:"sm",href:l},a):a;return e.createElement("li",h({className:t("maxio-breadcrumbs__item",n)},r),i)},z="Breadcrumbs requires at least one BreadcrumbsItem as children",A='Last BreadcrumbsItem should not have "href" prop. It is the current page.',F="Breadcrumbs only accepts BreadcrumbsItem as children",V=({children:a,arrowPosition:n,size:l="regular",maxWidth:r=160})=>e.createElement("div",{"data-testid":"tooltip",className:t("maxio-tooltip",`maxio-tooltip--${l}`,{[`maxio-tooltip--arrow-${n}`]:n})},e.createElement("div",{className:"maxio-tooltip__content",style:{maxWidth:r}},a)),H={click:s.useClick,hover:e=>s.useHover(e,{delay:100}),focus:s.useFocus,dismiss:s.useDismiss},W=(e,t)=>t.map(t=>H[t](e)),j=({placement:t="top",isActive:a=!1,interactions:n=["hover"],floatingElementOffset:l=0,onOverlayUpdate:r,autoHideMs:i})=>{const o=e.useRef(null),{strategy:c,x:m,y:d,context:u,floating:p,reference:x}=s.useFloating({placement:t,open:a,onOpenChange:e=>r(e),middleware:[s.offset(l)],whileElementsMounted:s.autoUpdate}),{getReferenceProps:g,getFloatingProps:b}=s.useInteractions([...W(u,n),s.useRole(u,{role:"tooltip"})]);e.useEffect(()=>{o.current&&clearTimeout(o.current),a&&i&&(o.current=window.setTimeout(()=>r(!1),i))},[a,i]);return{isActive:a,refs:{floating:p,reference:x},floatingElementCSSPosition:{position:c,top:d??0,left:m??0},getReferenceProps:g,getFloatingProps:b}};function q(t,a=0){const n=e.useRef((new Date).getTime()),l=e.useRef((new Date).getTime()),[r,i]=e.useState(!1);return e.useEffect(()=>{const e=()=>{n.current=(new Date).getTime(),i(!0)},r=()=>{l.current=(new Date).getTime(),window.setTimeout(()=>{n.current-l.current<=0&&i(!1)},a)},o=t&&t.current;return o&&(o.addEventListener("mouseenter",e),o.addEventListener("mouseleave",r)),()=>{o&&(o.removeEventListener("mouseenter",e),o.removeEventListener("mouseleave",r))}},[t]),r}function G(t=500){const[a,n]=e.useState(()=>{if("undefined"==typeof window)return{windowWitdh:0,windowHeight:0};const{innerWidth:e,innerHeight:t}=window;return{windowWitdh:e,windowHeight:t}}),l=e.useRef(null);return e.useEffect(()=>{if("undefined"==typeof window)return;const e=()=>{const{innerWidth:e,innerHeight:a}=window;window.clearTimeout(l.current??void 0),l.current=window.setTimeout(()=>{n({windowWitdh:e,windowHeight:a})},t)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[t]),a}function U(t){const[a,l]=e.useState(()=>t.current?.clientWidth??0),r=()=>{const e=t.current?.clientWidth??0;l(t=>0===e&&t>0?t:e)};return e.useLayoutEffect(r,[t]),n.useResizeObserver({ref:t,onResize:r}),a}const K=({children:a,usePortal:n=!1,isActive:l=!1,placement:r="top",interactions:i=["hover"],role:c="tooltip",renderOverlay:m,floatingElementOffset:d,motionSettings:u={},autoHideMs:p,onOverlayUpdate:x,className:g})=>{const{getReferenceProps:b,getFloatingProps:f,refs:{floating:E,reference:v},floatingElementCSSPosition:_}=j({isActive:l,onOverlayUpdate:x,autoHideMs:p,floatingElementOffset:d,interactions:i,placement:r}),w=e.createElement(o.AnimatePresence,null,l&&e.createElement(o.motion.div,h({ref:E,style:_},u,f()),m()));return e.createElement(e.Fragment,null,e.createElement("div",h({ref:v,className:t("maxio-inline-flex",g)},b(),{"data-testid":"overlay-trigger"}),a),n?e.createElement(s.FloatingPortal,{id:"maxio-ui-portal"},w):w)},Z={top:"bottom",right:"left",bottom:"top",left:"right","top-start":"bottom-left","top-end":"bottom-right","right-start":"left-top","right-end":"left-bottom","bottom-start":"top-left","bottom-end":"top-right","left-start":"right-top","left-end":"right-bottom"},Y=({children:t,interactions:a=["hover"],placement:n="right",maxWidth:l=160,size:r="regular",renderContent:i,autoHideMs:o,isVisible:s,usePortal:c,className:m,onVisibilityUpdate:d,floatingElementOffset:u=5})=>{const[p,x]=e.useState(!1),g=void 0!==s,b=e.useRef(null),f=e.useCallback(e=>{b.current&&clearTimeout(b.current),b.current=window.setTimeout(()=>{g||x(e),d&&d(e)},50)},[g,d]),h=e.useMemo(()=>(e=>{const t=e.startsWith("top")||e.startsWith("bottom")?"Y":"X",a=`translate${t}(${e.startsWith("bottom")||e.startsWith("right")?"-":""}10px)`;return{initial:{opacity:0,visibility:"hidden",transform:a},animate:{opacity:1,visibility:"visible",transform:`translate${t}(0px)`},exit:{opacity:0,visibility:"hidden",transform:a},transition:{ease:[.4,0,.5,1],duration:.2}}})(n),[n]);return e.useEffect(()=>()=>{b.current&&clearTimeout(b.current)},[]),e.createElement(K,{role:"tooltip",className:m,floatingElementOffset:u,motionSettings:h,isActive:g?s:p,onOverlayUpdate:f,autoHideMs:o,usePortal:c,placement:n,interactions:a,renderOverlay:()=>e.createElement(V,{size:r,arrowPosition:Z[n],maxWidth:l},i())},t)},Q="maxio-copy-to-clipboard--subtle",X="maxio-copy-to-clipboard--xs",J={idle:"copy-file",copied:"check",error:"error"},ee="row-controls",te="row-actions",ae=({children:a,pattern:n,size:l,isExpandable:r,isUsingCustomRow:i})=>{const[o,s]=e.useState(!1),[c,m]=e.useState(!1),d=n&&i&&r,u=t("maxio-data-table",{"maxio-data-table--pattern":n&&!d,"maxio-data-table--expanded-child-pattern":d,"maxio-data-table--with-custom-row":i,[`maxio-data-table--${l}`]:l,"maxio-data-table--with-pinned-left-border":o,"maxio-data-table--with-pinned-right-border":c});return e.createElement("div",{className:"maxio-data-table-wrapper",onScroll:e=>{const t=e.target;s(t.scrollLeft>0),m(t.scrollWidth-t.clientWidth-t.scrollLeft>0)}},e.createElement("table",{className:u},a))},ne=({children:t})=>e.createElement("thead",null,t),le=({children:t})=>e.createElement("tbody",null,t),re=({children:a,table:n,header:l,className:r,enableExpanding:i,...o})=>{const s=l?.column,c=s?.getCanSort?.(),m=s?.getToggleSortingHandler?.(),d=l?.isPlaceholder,u=s?.columnDef?.meta?.align,p=s?.columnDef?.meta?.width,x=s?.columnDef?.meta?.controls,g=s?.columnDef?.meta?.actions,b=s?.getIsPinned(),f=s?.getIsSorted(),E="asc"===f,v=t("maxio-data-table__cell",r,{[`maxio-data-table__cell--pinned-${b}`]:b,"maxio-data-table__cell--sortable":c,"maxio-data-table__cell--active":f,[`maxio-data-table__cell--${u}`]:u,"maxio-data-table__cell--controls":x,"maxio-data-table__cell--actions":g}),_={...p?{width:p}:{},..."left"===b?{left:s?.getStart("left")}:"right"===b?{right:s?.getAfter("right")}:{}},N=((e,t)=>e&&t?"arrow-up":e&&!t?"arrow-down":"arrow-down-up")(!!f,E),y=n?.getToggleAllRowsExpandedHandler(),C=n?.getIsAllRowsExpanded?.(),I=l?.headerGroup.headers[0].id===ee?1:0,R=i&&l?.index===I;return d?null:e.createElement("th",h({scope:"col",role:"columnheader","aria-sort":f?E?"ascending":"descending":"none",className:v,onClick:m,colSpan:l?.colSpan,style:_},o),e.createElement("div",{className:"maxio-data-table__cell-flex"},!0===i&&R&&e.createElement(T,{size:"sm",variant:"ghost",icon:e.createElement(w,{size:"xs",variant:C?"chevron-down":"chevron-right"}),onClick:y,"aria-label":C?"Collapse all rows":"Expand all rows","data-open":C,className:"maxio-data-table__expand-button"}),a,c&&e.createElement(w,{variant:N,className:"maxio-data-table__sort-icon"})))},ie=e=>e.subRows??[],oe=(e,t)=>Object.assign({},e,{subRows:t}),se=(e,t,a=[])=>{for(let n=0;n<e.length;n+=1){const l=e[n],r=[...a,n];if(l===t)return r;const i=se(ie(l),t,r);if(i)return i}return null},ce=(e,t)=>{const[a,...n]=t,l=e[a];if(!l)return null;const r=[...e];if(0===n.length)return r.splice(a,1),{data:r,item:l};const i=ce(ie(l),n);return i?(r[a]=oe(l,i.data),{data:r,item:i.item}):null},me=(e,t,a,n)=>{const l=[...e];if(0===t.length)return l.splice(a,0,n),l;const[r,...i]=t,o=e[r];if(!o)return null;const s=me(ie(o),i,a,n);return s?(l[r]=oe(o,s),l):null},de=(e,t)=>{let a,n=e;for(const e of t){if(a=n[e],!a)return;n=ie(a)}return a},ue="maxio-data-table-row",pe=e.createContext(null),xe=()=>e.useContext(pe),ge=e=>e.type===ue&&"string"==typeof e.instanceId&&"string"==typeof e.rowId,be=e=>{const t=(e=>{const t=d.extractInstruction(e);return t&&"instruction-blocked"!==t.type?"reorder-above"===t.type?"before":"reorder-below"===t.type?"after":"make-child"===t.type?"inside":null:null})(e);return"string"==typeof e.rowId&&t?{rowId:e.rowId,position:t}:null},fe=({availability:t,children:a,data:n,enableExpanding:l,getRowReorderLabel:r,onRowReorder:i,rowReorderMode:o,table:s})=>{const c=`maxio-data-table-${e.useId()}`,[u,p]=e.useState(""),[x,g]=e.useState(null),[b,f]=e.useState(null),h=e.useRef(null),E=e.useCallback(e=>s.getCoreRowModel().rowsById[e],[s]),v=e.useCallback(e=>r?.(e)??e.id,[r]),_=e.useCallback((e,t)=>{const a=E(e),r=E(t.rowId);if(!a||!r)return null;const i=((e,t,a,n,l)=>{if(t.id===a.id||!((e,t,a,n)=>"all"===n||("siblings"===n?"inside"!==a&&(e.parentId??null)===(t.parentId??null):"inside"===a?e.depth===t.depth+1:e.depth===t.depth))(t,a,n,l))return null;const r=se(e,t.original),i=se(e,a.original);if(!r||!i||(s=i,(o=r).length<s.length&&o.every((e,t)=>s[t]===e)))return null;var o,s;const c=ce(e,r);if(!c)return null;const m=((e,t)=>{const a=[...e],n=t.length-1;return n>=0&&e.length>n&&t.slice(0,n).every((t,a)=>e[a]===t)&&t[n]<e[n]&&(a[n]-=1),a})(i,r),d=m[m.length-1];if(void 0===d)return null;const u="inside"===n?m:m.slice(0,-1),p=de(c.data,m);if(!p)return null;const x="inside"===n?ie(p).length:d+("after"===n?1:0),g={parentRowId:"inside"===n?a.id:a.parentId??null,index:x},b={parentRowId:t.parentId??null,index:t.index};if(b.parentRowId===g.parentRowId&&b.index===g.index)return null;const f=me(c.data,u,x,c.item);return f?{data:f,source:b,destination:g}:null})(n,a,r,t.position,o);return i&&!l&&null!==i.destination.parentRowId&&i.destination.parentRowId!==i.source.parentRowId?null:i},[n,l,E,o]),w=e.useCallback(e=>{h.current=e,g(e)},[]),N=e.useCallback((e,t)=>{const a=E(e),n=E(t.rowId),l=_(e,t);return a&&n&&l?(i({...l,row:a,rowId:a.id,targetRow:n,targetRowId:n.id,position:t.position}),p(`${v(a)} moved ${r=v(n),o=t.position,"inside"===o?`inside ${r}`:`${o} ${r}`}.`),!0):(p("That row cannot be moved to this position."),!1);var r,o},[v,_,E,i]),y=e.useCallback((e,{input:t,element:a,source:n})=>{const l={rowId:e.id,instanceId:c},r=d.attachInstruction(l,{element:a,input:t,currentLevel:e.depth,indentPerLevel:24,mode:"standard"}),i=be(r),o=ge(n.data)&&n.data.instanceId===c&&Boolean(i&&_(n.data.rowId,i));return{...r,isValid:o}},[_,c]),C=e.useCallback((e,a)=>{if(!t.available)return()=>{};const n=e=>{const t=e.isValid?be(e):null;w(t)};return m.dropTargetForElements({element:a,canDrop:({source:t})=>ge(t.data)&&t.data.instanceId===c&&t.data.rowId!==e.id&&!e.getParentRows().some(e=>e.id===t.data.rowId),getData:t=>y(e,t),onDragEnter:({self:e})=>n(e.data),onDrag:({self:e})=>n(e.data),onDragLeave:()=>{h.current?.rowId===e.id&&w(null)}})},[t,y,c,w]),I=e.useCallback((e,a)=>{const n=a.closest("tr");return t.available&&n instanceof HTMLElement?m.draggable({element:n,dragHandle:a,getInitialData:()=>({type:ue,instanceId:c,rowId:e.id})}):()=>{}},[t,c]);e.useEffect(()=>{if(t.available)return m.monitorForElements({canMonitor:({source:e})=>ge(e.data)&&e.data.instanceId===c,onDragStart:({source:e})=>{if(!ge(e.data))return;const t=E(e.data.rowId);f(e.data.rowId),t&&p(`${v(t)} grabbed. Choose a destination.`)},onDrop:({source:e,location:t})=>{if(ge(e.data)){const a=t.current.dropTargets[0]?.data,n=!0===a?.isValid?be(a):null;n?N(e.data.rowId,n):p("Row move cancelled.")}f(null),w(null)}})},[N,t,v,E,c,w]),e.useEffect(()=>{if("inside"!==x?.position)return;const e=E(x.rowId);if(!e?.getCanExpand()||e.getIsExpanded())return;const t=window.setTimeout(()=>e.toggleExpanded(!0),500);return()=>window.clearTimeout(t)},[x,E]);const R=e.useCallback(e=>{if(!t.available)return[];const a=e.parentId?E(e.parentId):null,n=a?.subRows??s.getCoreRowModel().rows,l=n.findIndex(t=>t.id===e.id);if(-1===l)return[];const r=n[l-1],i=n[l+1],o=n[0],c=n[n.length-1],m=[];if(l>1&&o&&m.push({id:"top",label:"Move to top",target:{rowId:o.id,position:"before"}}),r&&m.push({id:"up",label:"Move up",target:{rowId:r.id,position:"before"}}),i&&m.push({id:"down",label:"Move down",target:{rowId:i.id,position:"after"}}),l<n.length-2&&c&&m.push({id:"bottom",label:"Move to bottom",target:{rowId:c.id,position:"after"}}),a){let e=a;for(;e.parentId;){const t=E(e.parentId);if(!t)break;e=t}m.push({id:"move-to-root",label:"Move to root",target:{rowId:e.id,position:"after"}})}return s.getCoreRowModel().flatRows.forEach(t=>{t.id!==e.parentId&&m.push({id:`move-to:${t.id}`,label:`Move to ${v(t)}`,target:{rowId:t.id,position:"inside"}})}),m.filter(t=>Boolean(_(e.id,t.target)))},[t,v,_,E,s]),k=e.useCallback(e=>{if(!t.available)return!1;const a=e.parentId?E(e.parentId):null;return(a?.subRows??s.getCoreRowModel().rows).length>1||"siblings"!==o&&("all"===o?Boolean(a):!(!l||0===e.depth)&&s.getCoreRowModel().flatRows.some(t=>t.depth===e.depth-1&&t.id!==e.parentId))},[t,l,E,o,s]),S=e.useMemo(()=>({activeTarget:x,availability:t,draggingRowId:b,getActions:R,getLabel:v,hasActions:k,moveRow:N,registerHandle:I,registerRow:C}),[x,t,N,b,R,v,k,I,C]);return e.createElement(pe.Provider,{value:S},a,e.createElement("span",{className:"maxio-data-table__live-region",role:"status","aria-live":"polite","aria-atomic":"true"},u))},he=({children:n,row:l,isChild:r,isHeader:i,className:o,onRowAction:s,...c})=>{const m=l?.getIsSelected?.(),d=l?.getCanExpand?.()&&l?.getIsExpanded?.(),u=Boolean(l&&s&&!i&&!r),p=e.useRef(null),x=xe(),g=x?.registerRow,b=e.useRef(null),f=e=>{b.current=e.target},{pressProps:E}=a.usePress({isDisabled:!u,onPress:e=>{const t=b.current??e.target;b.current=null,l&&s&&!(e=>e instanceof Element&&Boolean(e.closest("a,button,input,select,textarea,label,.maxio-data-table__cell--controls,.maxio-data-table__cell--actions")))(t)&&s(l)}}),{focusProps:v,isFocused:_}=a.useFocusRing(),w=t({"maxio-data-table__row":!i,"maxio-data-table__header-row":i,"maxio-data-table__row--active":m||_,"maxio-data-table__row--expanded":d,"maxio-data-table__row--expanded-child":r,"maxio-data-table__row--actionable":u,"maxio-data-table__row--dragging":Boolean(l)&&x?.draggingRowId===l?.id,[`maxio-data-table__row--drop-${x?.activeTarget?.position}`]:Boolean(l)&&x?.activeTarget?.rowId===l?.id},o);e.useEffect(()=>{if(l&&g&&p.current&&!i&&!r)return g(l,p.current)},[r,i,g,l]);const N=u?a.mergeProps({onClickCapture:f,onKeyDownCapture:f,tabIndex:0},E,v,c):c;return e.createElement("tr",h({},N,{ref:p,className:w,tabIndex:u?N.tabIndex:c.tabIndex}),n)},Ee=e.createContext({}),ve=e.forwardRef(({checked:a,disabled:n,invalid:l,indeterminate:r,className:i,inputProps:o,error:s,label:c},m)=>{const d=t("maxio-checkbox",{"maxio-checkbox--checked":a,"maxio-checkbox--disabled":n,"maxio-checkbox--error":l,"maxio-checkbox--indeterminate":r},i);return e.createElement("label",{className:d},e.createElement("input",h({type:"checkbox",role:"checkbox",className:"maxio-checkbox__input",ref:m},o)),e.createElement("span",{className:"maxio-checkbox__control"},s&&e.createElement("span",{className:"maxio-checkbox__control-error"})),c&&e.createElement("span",{className:"maxio-checkbox__label"},c))});ve.displayName="InnerCheckbox";const _e=({label:t,error:n=!1,className:l,indeterminate:i,value:o="",disabled:s,readOnly:c,defaultChecked:m,checked:d,...u})=>{const p=e.useRef(null),x=e.useContext(Ee),{inputProps:g,isDisabled:b,isInvalid:f,isSelected:E}=x&&Object.keys(x).length>0?a.useCheckboxGroupItem({value:o,"aria-label":t??u["aria-label"],isDisabled:s,isInvalid:n,isIndeterminate:i,isReadOnly:c,...u},x,p):a.useCheckbox({"aria-label":t??u["aria-label"],isDisabled:s,isInvalid:n,isIndeterminate:i,isReadOnly:c,value:o,...u},r.useToggleState({...u,isSelected:d,defaultSelected:m}),p);return e.createElement(ve,h({inputProps:g,checked:E,disabled:b,invalid:f,indeterminate:i,className:l,error:n,label:t,ref:p},u))},we=({children:a,className:n,...l})=>e.createElement("div",h({className:t("maxio-form-helper-text",n)},l),a),Ne=({children:a,className:n,...l})=>e.createElement("div",h({className:t("maxio-form-error",n)},l),e.createElement(w,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),e.createElement("div",{className:"maxio-form-error__text"},a)),ye=({table:t,enableRowSelection:a,enableRowReordering:n})=>{const l=t?.getToggleAllPageRowsSelectedHandler?.(),r=t?.getIsAllPageRowsSelected?.()||t?.getIsAllRowsSelected?.(),i=t?.getIsSomePageRowsSelected?.();return a?e.createElement(e.Fragment,null,n&&e.createElement("span",{className:"maxio-button maxio-button--sm maxio-button--ghost maxio-button--icon","aria-hidden":"true",style:{visibility:"hidden"}}),e.createElement(_e,{"aria-label":"Select all rows",onChange:e=>{l("boolean"==typeof e?{target:{checked:e}}:e)},checked:r,indeterminate:!r&&i})):null},Ce=({className:a,hideArrow:n=!1,children:r,offset:i=4,...o})=>e.createElement(l.Popover,h({},o,{className:t("maxio-popover",a),offset:i}),e.createElement(e.Fragment,null,!n&&e.createElement(l.OverlayArrow,{className:"maxio-popover__arrow"},e.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12","aria-hidden":!0},e.createElement("path",{d:"M0 0 L6 6 L12 0"}))),r)),Ie=({row:t})=>{const a=xe(),n=a?.registerHandle,r=a?.getActions,i=a?.hasActions,o=e.useRef(null),[s,c]=e.useState(!1),m=a?.draggingRowId===t.id,d=a?.getLabel(t)??t.id,u=e.useMemo(()=>i?.(t)??!1,[i,t]),p=e.useMemo(()=>s?r?.(t)??[]:[],[r,s,t]),x=(a&&!a.availability.available?a.availability.message:void 0)??(u?void 0:`No moves are available for ${d}.`);e.useEffect(()=>{if(n&&o.current&&!x)return n(t,o.current)},[n,t,x]),e.useEffect(()=>{x&&c(!1)},[x]);const g=e.createElement(l.Button,{ref:o,type:"button",className:"maxio-button maxio-button--sm maxio-button--ghost maxio-button--icon maxio-data-table__drag-handle","aria-label":`Reorder ${d}`,"aria-pressed":m,"aria-disabled":!!x||void 0,onPress:()=>{x||c(!0)}},e.createElement("i",{className:"fa-sharp fa-solid fa-grip-dots-vertical "+(x?"maxio-icon--disabled":"maxio-icon--secondary")}));return x?e.createElement(l.TooltipTrigger,{delay:0,closeDelay:0},g,e.createElement(l.Tooltip,{placement:"bottom start",offset:8,className:"maxio-tooltip maxio-tooltip--arrow-top-left"},e.createElement("div",{className:"maxio-tooltip__content"},x))):e.createElement(l.MenuTrigger,{trigger:"longPress",isOpen:s,onOpenChange:c},g,e.createElement(Ce,{placement:"bottom start",hideArrow:!0},e.createElement(l.Menu,{autoFocus:"first",className:"maxio-data-table__reorder-menu",items:p,onAction:e=>{const n=p.find(t=>t.id===e);n&&(a?.moveRow(t.id,n.target),requestAnimationFrame(()=>o.current?.focus()))}},t=>e.createElement(l.MenuItem,{id:t.id,textValue:t.label,className:"maxio-data-table__reorder-menu-item"},t.label))))},Re=({row:t,enableRowSelection:a,enableRowReordering:n})=>{const l=t?.getToggleSelectedHandler?.(),r=t?.getIsSelected?.()||t?.getIsAllSubRowsSelected?.(),i=t?.getIsSomeSelected?.(),o=t.id||t.index;return e.createElement(e.Fragment,null,n&&e.createElement(Ie,{row:t}),a&&e.createElement(_e,{"aria-label":`Select row ${o}`,onChange:l,checked:r,indeterminate:i}))},ke=({children:t})=>e.createElement("div",{className:"maxio-data-table__cell-flex"},t),Se=({row:a,cell:n,children:l,className:r,...i})=>{const o=n?.column,s=o?.columnDef?.meta?.align,c=o?.columnDef?.meta?.controls,m=o?.columnDef?.meta?.actions,d=o?.getIsPinned(),u=t("maxio-data-table__cell",r,{[`maxio-data-table__cell--pinned-${d}`]:d,[`maxio-data-table__cell--${s}`]:s,"maxio-data-table__cell--controls":c,"maxio-data-table__cell--actions":m}),p="left"===d?{left:o?.getStart("left")}:"right"===d?{right:o?.getAfter("right")}:{};return e.createElement("td",h({className:u,style:p},i),l)},Pe=({row:t,SubRowComponent:a,pattern:n,enableExpanding:l,onRowAction:r})=>{const i=a&&t.getParentRow()&&t.getParentRow().getIsExpanded(),o=i&&t.getVisibleCells()[0].column.columnDef.id===ee,s=i&&t.getVisibleCells()[t.getVisibleCells().length-1].column.columnDef.id===te,m=[s,o].filter(Boolean).length,d=t.getVisibleCells().length-m,u=t.getParentRow()?.index??t.index,p=n&&a&&u%2==1?"maxio-data-table__row--with-pattern":void 0,x=t.getCanExpand?.(),g=t?.getToggleExpandedHandler?.(),b=t?.getIsExpanded?.(),f=x&&l?0:1.75,h=t.getVisibleCells()[0].column.columnDef.id===ee?1:0,E=t.getVisibleCells().find(({column:e})=>{const{actions:t,controls:a}=e.columnDef.meta??{};return!t&&!a}),v=r&&E?E.id:void 0;return e.createElement(e.Fragment,{key:t.id},i?e.createElement(he,{key:`${t.id}-sub`,row:t,isChild:!0,className:p},o&&e.createElement(Se,{className:"maxio-data-table__cell--pinned-left"}),e.createElement(Se,{colSpan:d},a(t)),s&&e.createElement(Se,{className:"maxio-data-table__cell--pinned-right"})):e.createElement(he,{key:`${t.id}-parent`,row:t,className:p,onRowAction:r,"aria-labelledby":v},t.getVisibleCells().map(a=>{const n=l&&a.column.getIndex()===h;return e.createElement(Se,{key:a.id,row:t,cell:a,id:a.id},e.createElement("div",{className:"maxio-data-table__cell-flex",style:l&&n?{paddingLeft:`${t?.depth+f}rem`}:void 0},l&&x&&n&&e.createElement(T,{size:"sm",variant:"ghost",icon:e.createElement(w,{size:"xs",variant:b?"chevron-down":"chevron-right"}),onClick:g,"aria-label":b?"Collapse row":"Expand row","data-open":b,className:"maxio-data-table__expand-button"}),c.flexRender(a.column.columnDef.cell,a.getContext())))})))},Te={available:!0},De={available:!1,reason:"filtering",message:"Reordering is unavailable while the table is filtered."},Me={available:!1,reason:"grouping",message:"Reordering is unavailable while the table is grouped."},Oe={available:!1,reason:"pagination",message:"Reordering is unavailable while the table is paginated."},$e=(e=[])=>e.filter(e=>e!==ee&&e!==te),Le=[],Be=e=>e.subRows,ze={sm:"h3",md:"h2",lg:"h1"},Ae=({children:a,size:n="sm",className:l,...r})=>{const i=ze[n],o=t(`maxio-heading-${n}`,l);return e.createElement(i,h({className:o},r),a)},Fe=({as:a="div",children:n,compact:l=!1,size:r="md",className:i,...o})=>{const s=a,c=t({[`maxio-body-${r}`]:!l,[`maxio-body-${r}-compact`]:l},i);return e.createElement(s,h({className:c},o),n)},Ve=({basis:a,flex:n,flexDirection:l,wrap:r,grow:i,shrink:o,gap:s,gapX:c,gapY:m,className:d,children:u,alignItems:p,justifyContent:x,...g})=>{const b=t("maxio-flex",{[`maxio-flex-${n}`]:n,[`maxio-basis-${a}`]:void 0!==a,[`maxio-flex-${l}`]:l,[`maxio-flex-${r}`]:r,"maxio-grow":i,"maxio-grow-0":!1===i,"maxio-shrink":o,"maxio-shrink-0":!1===o,[`maxio-gap-${s}`]:void 0!==s,[`maxio-gap-x-${c}`]:void 0!==c,[`maxio-gap-y-${m}`]:void 0!==m,[`maxio-items-${p}`]:p,[`maxio-justify-${x}`]:x},d);return e.createElement("div",h({className:b},g),u)},He=({className:a,children:n,items:r,render:i,renderEmptyState:o,isLoading:s=!1,onLoadMore:c,scrollOffset:m,showSelectAll:d=!1,...u})=>e.createElement(l.ListBox,h({},u,{items:r,renderEmptyState:s?void 0:o,className:l.composeRenderProps(a,e=>t("maxio-listbox",e)),render:(t,a)=>{const{selectionManager:n}=a.state,l=i?i(t,a):e.createElement("div",t);if("multiple"!==n.selectionMode||!d)return l;if(0===[...n.collection.getKeys()].filter(e=>{const t=n.collection.getItem(e);return"item"===t?.type&&n.canSelectItem(e)}).length)return l;const r=n.isSelectAll,o=r&&n.disallowEmptySelection;return e.createElement("div",null,e.createElement("div",{className:"maxio-listbox__select-all"},e.createElement(P,{type:"button",variant:"ghost",trailingElement:e.createElement(w,{variant:r?"check":""}),fullWidth:!0,"aria-pressed":r,disabled:o,onClick:()=>n.toggleSelectAll()},"Select all")),l)}}),c||s?e.createElement(e.Fragment,null,e.createElement(l.Collection,{items:r,dependencies:u.dependencies},n),e.createElement(l.ListBoxLoadMoreItem,{className:"maxio-listbox__load-more",isLoading:s,onLoadMore:s?void 0:c,scrollOffset:m},e.createElement(R,null))):n);He.displayName="ListBox";const We=({className:a,...n})=>{const r=n.textValue||("string"==typeof n.children?n.children:void 0);return e.createElement(l.ListBoxItem,h({},n,{textValue:r,className:t("maxio-listbox__item",a)}),l.composeRenderProps(n.children,(t,{isSelected:a})=>e.createElement(e.Fragment,null,e.createElement("div",{className:"maxio-listbox__content"},"string"==typeof t?e.createElement(Fe,{size:"sm"},t):t),a&&e.createElement(w,{variant:"check"}))))};We.displayName="ListBox.Item";const je=({className:a,...n})=>e.createElement(l.ListBoxSection,h({},n,{className:t("maxio-listbox__section",a)}));je.displayName="ListBox.Section";const qe=({className:a,...n})=>e.createElement(l.Header,h({},n,{className:t("maxio-listbox__header",a)}));qe.displayName="ListBox.Header";const Ge=Object.assign(He,{Item:We,Section:je,Header:qe}),Ue=({isDisabled:a=!1,isInvalid:n=!1,isReadOnly:r=!1,size:i="md",label:o,description:s,errorMessage:c,leadingElement:m=null,fullWidth:d,className:u,placeholder:p,renderEmptyState:x,selectionMode:g,children:b,...f})=>{const E=e.useRef(null),v=e.useRef(null),[_,N]=e.useState(),[y,C]=e.useState(0),I=!!c,R=n||I,k=b,S=e.useCallback(()=>{const e=E.current;if(!e)return;const t=v.current,a=t?t.getBoundingClientRect().left-e.getBoundingClientRect().left:0;C(e=>e===-a?e:-a),N(t=>{const a=`${e.offsetWidth}px`;return t?.["--trigger-width"]===a?t:{"--trigger-width":a}})},[]);e.useEffect(()=>{const e=E.current;if(!e)return;if(S(),"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(S);return t.observe(e),()=>t.disconnect()},[S]);const P=t("maxio-text-field",`maxio-text-field--${i}`,{"maxio-text-field--disabled":a,"maxio-text-field--error":R,"maxio-text-field--readonly":r,"maxio-text-field--full-width":d},u);return e.createElement(l.ComboBox,h({},f,{isDisabled:a,isInvalid:R,isReadOnly:r,selectionMode:g,className:P}),o&&e.createElement(l.Label,{className:"maxio-text-field__label"},o),e.createElement("div",{ref:E,className:"maxio-text-field__items"},m&&e.createElement("div",{className:"maxio-text-field__leading-element"},m),e.createElement(l.Input,{ref:v,className:"maxio-text-field__input",placeholder:p}),e.createElement("div",{className:"maxio-text-field__trailing-element"},e.createElement(l.Button,{className:t("maxio-button","maxio-button--ghost","maxio-button--icon","maxio-button--sm")},e.createElement(w,{variant:"chevron-up-down"})))),s&&!I&&e.createElement(l.Text,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},s),c&&e.createElement(l.FieldError,{className:"maxio-form-error"},t=>e.createElement(e.Fragment,null,e.createElement(w,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),e.createElement("div",{className:"maxio-form-error__text"},"function"==typeof c?c(t):c))),e.createElement(Ce,{hideArrow:!0,className:"maxio-combobox__popover",crossOffset:y,style:_},e.createElement(Ge,{renderEmptyState:x},k)))};Ue.displayName="ComboBox";const Ke=t=>e.createElement(Ge.Item,t);Ke.displayName="ComboBox.Item";const Ze=t=>e.createElement(Ge.Section,t);Ze.displayName="ComboBox.Section";const Ye=t=>e.createElement(Ge.Header,t);Ye.displayName="ComboBox.Header";const Qe=Object.assign(Ue,{Item:Ke,Section:Ze,Header:Ye}),Xe=e.createContext({}),Je=e.forwardRef(({isDisabled:a=!1,isInvalid:n=!1,isReadOnly:r=!1,size:i="md",label:o,description:s,errorMessage:c,leadingElement:m=null,trailingElement:d=null,fullWidth:u,className:p,...x},g)=>{const b=t("maxio-text-field",`maxio-text-field--${i}`,{"maxio-text-field--disabled":a,"maxio-text-field--error":n,"maxio-text-field--readonly":r,"maxio-text-field--full-width":u},p);return e.createElement(l.TextField,h({},x,{isDisabled:a,isReadOnly:r,isInvalid:n,className:b}),o&&e.createElement(l.Label,{className:"maxio-text-field__label"},o),e.createElement("div",{className:"maxio-text-field__items"},m&&e.createElement("div",{className:"maxio-text-field__leading-element"},m),e.createElement(l.Input,{ref:g,className:"maxio-text-field__input"}),d&&e.createElement("div",{className:"maxio-text-field__trailing-element"},d)),s&&!(n&&c)&&e.createElement(l.Text,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},s),c&&e.createElement(l.FieldError,{className:"maxio-form-error"},e.createElement(w,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),e.createElement("div",{className:"maxio-form-error__text"},c)))});Je.displayName="TextField";const et=e.forwardRef(({isDisabled:a=!1,isInvalid:n=!1,isReadOnly:r=!1,size:i="md",label:o,description:s,errorMessage:c,fullWidth:m,className:d,...u},p)=>{const x=t("maxio-text-area",`maxio-text-area--${i}`,{"maxio-text-area--disabled":a,"maxio-text-area--error":n,"maxio-text-area--readonly":r,"maxio-text-area--full-width":m},d);return e.createElement(l.TextField,h({},u,{isDisabled:a,isReadOnly:r,isInvalid:n,className:x}),o&&e.createElement(l.Label,{className:"maxio-form-label"},o),e.createElement(l.TextArea,{ref:p,className:"maxio-text-area__input"}),s&&!(n&&c)&&e.createElement(l.Text,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},s),c&&e.createElement(l.FieldError,{className:"maxio-form-error"},e.createElement(w,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),e.createElement("div",{className:"maxio-form-error__text"},c)))});et.displayName="TextArea";const tt=e.forwardRef(({disabled:n=!1,invalid:l=!1,readOnly:r=!1,size:i="md",label:o,helperText:s,showErrorMessage:c=!0,errorMessage:m,leadingElement:d=null,trailingElement:u=null,fullWidth:p,className:x,...g},b)=>{const f=e.useRef(null);e.useImperativeHandle(b,()=>f.current),e.useEffect(()=>{console.warn("TextInput is deprecated. Please use TextField instead.")},[]);const{spellCheck:E,...v}=g,_={...v,label:o,description:s,errorMessage:m,defaultValue:g.defaultValue?.toString(),value:g.value?.toString(),isDisabled:n,isReadOnly:r,isInvalid:l},{labelProps:w,inputProps:N,descriptionProps:y,errorMessageProps:C}=a.useTextField(_,f),I=t("maxio-text-field",`maxio-text-field--${i}`,{"maxio-text-field--disabled":n,"maxio-text-field--error":l,"maxio-text-field--readonly":r,"maxio-text-field--full-width":p},x),R=l&&m&&c;return e.createElement("div",{className:I},o&&e.createElement("label",h({className:"maxio-text-field__label"},w),o),e.createElement("div",{className:"maxio-text-field__items"},d&&e.createElement("div",{className:"maxio-text-field__leading-element"},d),e.createElement("input",h({ref:f,type:"text",className:"maxio-text-field__input"},N,{spellCheck:E})),u&&e.createElement("div",{className:"maxio-text-field__trailing-element"},u)),s&&!R&&e.createElement("div",h({className:"maxio-form-helper-text"},y),s),R&&e.createElement(Ne,C,m))});tt.displayName="TextInput";const at=({options:n,label:l,size:r="md",inline:i=!1,disabled:o=!1,helperText:s,errorMessage:c,fullWidth:m=!1,...d})=>{const u=t("maxio-select",`maxio-select--${r}`,{"maxio-select--disabled":o,"maxio-select--inline":i,"maxio-select--error":!!c,"maxio-select--full-width":m}),p=a.useId();return e.createElement("div",{className:u},l&&e.createElement("label",{htmlFor:p,className:"maxio-select__label"},l),e.createElement("div",{className:"maxio-select__input-container"},e.createElement("select",h({id:p,className:"maxio-select__input",disabled:o},d),n.map(t=>e.createElement("option",{key:`option-${t.value}`,value:t.value,disabled:t.disabled},t.label))),e.createElement(w,{variant:"chevron-up-down"})),!!c&&e.createElement(Ne,null,c),s&&!c&&e.createElement("div",{className:"maxio-form-helper-text"},s))},nt=({slot:t,displayValue:a})=>{const n=e.createElement(l.DateInput,{slot:t,className:"maxio-date-field__input"},t=>e.createElement(l.DateSegment,{segment:t,className:"maxio-date-field__segment"}));return null==a?n:e.createElement("div",{className:"maxio-date-field__endpoint"},e.createElement("div",{hidden:!0},n),e.createElement("span",{className:"maxio-date-field__endpoint-value"},a))},lt=({className:a,errorMessage:n,...r})=>e.createElement(l.Calendar,h({},r,{visibleDuration:{months:1},className:l.composeRenderProps(a,e=>t("maxio-calendar",e))}),e.createElement("header",{className:"maxio-calendar__header"},e.createElement(l.Heading,{className:"maxio-calendar__heading"}),e.createElement(l.Button,{slot:"previous",className:"maxio-button maxio-button--ghost maxio-button--icon"},e.createElement(w,{variant:"chevron-left"})),e.createElement(l.Button,{slot:"next",className:"maxio-button maxio-button--ghost maxio-button--icon"},e.createElement(w,{variant:"chevron-right"}))),e.createElement(l.CalendarGrid,{className:"maxio-calendar__grid"},e.createElement(l.CalendarGridHeader,null,t=>e.createElement(l.CalendarHeaderCell,{className:"maxio-calendar__weekday"},t)),e.createElement(l.CalendarGridBody,null,t=>e.createElement(l.CalendarCell,{date:t,className:"maxio-calendar__cell"}))),n&&e.createElement(l.Text,{slot:"errorMessage",className:"maxio-calendar__error"},n)),rt=({presets:t,label:a="Presets",isDisabled:n,isPresetDisabled:r,onSelect:i})=>t?.length?e.createElement(l.Group,{"aria-label":a,className:"maxio-date-field__presets"},t.map((t,a)=>e.createElement(l.Button,{key:a,className:"maxio-button maxio-button--ghost",isDisabled:n||t.isDisabled||null!==t.value&&r(t.value),onPress:()=>i(t.value)},t.label))):null,it=(e,t)=>!!(t.minValue&&e.compare(t.minValue)<0||t.maxValue&&e.compare(t.maxValue)>0||t.isDateUnavailable?.(e)),ot=({className:a,errorMessage:n,...r})=>{const{direction:i}=l.useLocale();return e.createElement(l.RangeCalendar,h({},r,{visibleDuration:{months:1},className:l.composeRenderProps(a,e=>t("maxio-calendar","maxio-calendar--range",e))}),e.createElement("header",{className:"maxio-calendar__header"},e.createElement(l.Heading,{className:"maxio-calendar__heading"}),e.createElement(l.Button,{slot:"previous",className:"maxio-button maxio-button--ghost maxio-button--icon"},e.createElement(w,{variant:"rtl"===i?"chevron-right":"chevron-left"})),e.createElement(l.Button,{slot:"next",className:"maxio-button maxio-button--ghost maxio-button--icon"},e.createElement(w,{variant:"rtl"===i?"chevron-left":"chevron-right"}))),e.createElement(l.CalendarGrid,{className:"maxio-calendar__grid"},e.createElement(l.CalendarGridHeader,null,t=>e.createElement(l.CalendarHeaderCell,{className:"maxio-calendar__weekday"},t)),e.createElement(l.CalendarGridBody,null,t=>e.createElement(l.CalendarCell,{date:t,className:"maxio-calendar__cell"}))),n&&e.createElement(l.Text,{slot:"errorMessage",className:"maxio-calendar__error"},n))},st=(e,t)=>null==e?null==t:null!=t&&0===e.compare(t),ct=({className:a,size:n="md",fullWidth:r=!1,selectionMode:i="single",orientation:o="horizontal",disallowEmptySelection:s=!0,...c})=>e.createElement(l.ToggleButtonGroup,h({},c,{selectionMode:i,orientation:o,disallowEmptySelection:s,className:l.composeRenderProps(a,e=>t("maxio-segmented-control",`maxio-segmented-control--${n}`,{"maxio-segmented-control--full-width":r},e))}));ct.displayName="SegmentedControl";const mt=({className:a,children:n,...r})=>e.createElement(l.ToggleButton,h({},r,{className:l.composeRenderProps(a,e=>t("maxio-segmented-control__item",e))}),l.composeRenderProps(n,t=>e.createElement(e.Fragment,null,e.createElement(l.SelectionIndicator,{className:"maxio-segmented-control__selection-indicator","data-selected":!0}),t)));mt.displayName="SegmentedControl.Item";const dt=Object.assign(ct,{Item:mt}),ut=({leadingIcon:t,trailingIcon:a,type:n="menu",children:l,leadingIconClassName:r,isTooltipVisible:i=!1})=>e.createElement(e.Fragment,null,t&&e.createElement(Y,{usePortal:!0,isVisible:i,renderContent:()=>l,floatingElementOffset:12},e.createElement("span",{className:"maxio-side-nav__icon"},e.createElement(w,{variant:t,className:r}))),e.createElement("span",{className:`maxio-side-nav__${n}-title`,"data-testid":"maxio-sidebar-section-name"},l),a&&e.createElement("span",{className:"maxio-side-nav__menu-chevron"},e.createElement(w,{variant:a}))),pt=e=>"heading"!==e.type,xt=e=>{const t=(e=>e.flat().filter(pt).map(e=>e.items).flat().find(e=>e?.isCurrent))(e);return t?e.map(e=>e.map(e=>pt(e)&&e.items?.includes(t)?{...e,isOpen:!0}:e)):e},gt=e.createContext({}),bt=()=>e.useContext(gt),ft=({children:t,isOpen:a,onChange:n,withIcons:l=!0,sections:r,shouldToggleSidebar:i=!0,topDropdownItems:o,collapseBreakpoint:s=800})=>{const c=e.useRef(!1),[m,d]=e.useState(()=>!i||("boolean"==typeof a?a:"undefined"==typeof window||window.innerWidth>s)),[u,p]=e.useState(()=>xt(r)),{windowWitdh:x}=G(200);e.useEffect(()=>{c.current&&n?.(m)},[m,n]),e.useEffect(()=>{c.current=!0},[]),e.useEffect(()=>{!function(e){if(!i)return;e<s&&m&&g()}(x)},[x]),e.useEffect(()=>{"boolean"==typeof a&&d(a)},[a]);const g=()=>{d(!1)};return e.createElement(gt.Provider,{value:{sections:u,topDropdownItems:o,onSectionOpen:e=>{p(t=>t.map(t=>t.map(t=>pt(t)?{...t,isOpen:t?.name===e&&!t.isOpen}:t)))},isOpen:m,onOpen:()=>{d(!0)},onClose:g,withIcons:l,shouldToggleSidebar:i}},t)},ht=()=>{const{onOpen:t,topDropdownItems:a,isOpen:n}=bt(),{mainItem:l,otherItems:r,actions:i}=a,o=e.useRef(null),s=q(o),c=({id:e,title:t,icon:a,iconClass:n,url:l,...r})=>({id:e,label:t,leadingIconName:a,leadingIconClassName:n,link:{href:l,...r}}),{items:m,itemsCount:d}=e.useMemo(()=>({itemsCount:r.length+i.length,items:[...r.map(c),r?.length>0&&i?.length>0?{type:"divider",id:"item-divider"}:null,...i.map(c)].filter(e=>null!=e)}),[i,r]);return e.createElement(e.Fragment,null,0===d?e.createElement("a",{className:"maxio-side-nav__menu-button maxio-side-nav__menu-button--large",href:l.url,onClick:t},e.createElement("span",{className:"maxio-side-nav__menu-title"},l.title)):e.createElement("details",{className:"maxio-action-menu maxio-side-nav--action-menu"},e.createElement("summary",{onClick:t,className:"maxio-side-nav__menu-button","aria-haspopup":"true",ref:o},l.url?e.createElement(e.Fragment,null,e.createElement(ut,{type:"menu",isTooltipVisible:!n&&s,leadingIcon:l.icon,trailingIcon:"chevron-up-down",leadingIconClassName:l.iconClass},l.title)):e.createElement(ut,{type:"menu",trailingIcon:"chevron-up-down"},l.title)),e.createElement(C,{truncateLabels:!0,className:"maxio-action-menu__content","aria-label":"Action list",items:m,small:!0})))},Et=({section:t})=>{const{isOpen:a,withIcons:n}=bt(),l=e.useRef(null),r=q(l);return e.createElement("li",{className:"maxio-side-nav__item","data-key":t.key,"data-testid":"maxio-sidebar-section"},e.createElement("a",{className:"maxio-side-nav__link","aria-current":t.isCurrent?"page":void 0,role:"button",href:t.href,ref:l},e.createElement(ut,{isTooltipVisible:r&&!a,type:"menu",leadingIcon:n?t.icon:void 0},t.name)))},vt=({section:a})=>{const{onOpen:n,onSectionOpen:l,isOpen:r,withIcons:i}=bt(),o=e.useRef(null),s=q(o);if(!pt(a))return e.createElement("li",{className:"maxio-side-nav__item-header"},a.title);return a.Component?e.createElement(a.Component,{section:a}):a.href?e.createElement(Et,{section:a}):e.createElement("li",{className:t("maxio-side-nav__item",{"maxio-side-nav__item--icon":i}),"data-testid":"maxio-sidebar-section"},e.createElement("button",{className:"maxio-side-nav__menu-button",ref:o,"aria-expanded":a.isOpen?"true":"false",type:"button",onClick:()=>{l(a.name),n()}},e.createElement(ut,{type:"menu",isTooltipVisible:!r&&s,leadingIcon:i?a.icon:void 0,trailingIcon:a.items?.length?"chevron-down":void 0},a.name)),e.createElement("ul",{className:"maxio-side-nav__menu"},a.items?.map(t=>e.createElement("li",{key:`section-sub-item-${t.name}`,className:"maxio-side-nav__item","data-testid":"maxio-section-item"},e.createElement("a",{className:"maxio-side-nav__link",href:t.href,"aria-current":t.isCurrent?"page":void 0},e.createElement("span",{className:"maxio-side-nav__link-title"},t.name))))))},_t=()=>{const{sections:t}=bt();return e.createElement(e.Fragment,null,t.map((t,a)=>e.createElement("ul",{role:"list",className:"maxio-side-nav__items",key:`section-list-${a}`},t.map((t,n)=>e.createElement(vt,{key:`section-list-item-${t.type}-${a}-${n}`,section:t})))))},wt=()=>{const{onClose:t,shouldToggleSidebar:a}=bt();return e.createElement("div",{className:"maxio-side-nav__logo-container"},e.createElement("a",{className:"maxio-side-nav__brand",href:"/","aria-label":"Maxio"}),a&&e.createElement("button",{className:"maxio-side-nav__menu-toggle","aria-label":"toggle sidebar",onClick:t},e.createElement(w,{variant:"sidebar"})))},Nt=()=>{const{isOpen:a}=bt();return e.createElement("nav",{className:t("maxio-side-nav",{"maxio-side-nav--collapsed":!a})},e.createElement(wt,null),e.createElement(ht,null),e.createElement("div",{className:"maxio-side-nav__items-container"},e.createElement(_t,null)))},yt=({disabled:a=!1,value:n=0,className:r,id:i,isCurrent:o,...s})=>{const c="icon"===s.type,m=({isSelected:e})=>t("maxio-tabs__tab",r,{"maxio-tabs__tab--active":e,"maxio-tabs__tab--disabled":a,"maxio-tabs__tab--icon":c});if("icon"===s.type){const{icon:t,...r}=s;return e.createElement(l.Tab,h({id:n,isDisabled:a},r,{className:m}),e.createElement("div",{className:"maxio-tabs__tab__content"},t))}const{children:d,rightIcon:u,...p}=s;return e.createElement(l.Tab,h({id:n,isDisabled:a},p,{className:m}),e.createElement("div",{className:"maxio-tabs__tab__content"},d,u||null))},Ct=e.createContext({variant:"line",withDivider:!1}),It=({children:t,variant:a="line",withDivider:n=!1})=>e.createElement(Ct.Provider,{value:{variant:a,withDivider:n}},t),Rt=({children:a,value:n,className:r,id:i,...o})=>e.createElement(l.TabPanel,h({id:n,className:t("maxio-tabs__panel",r)},o),a),kt=({children:a,className:n,...l})=>e.createElement("div",h({className:t("maxio-card__header",n)},l),a);kt.displayName="Card.Header";const St=({children:a,className:n,...l})=>e.createElement("div",h({className:t("maxio-card__body",n)},l),a);St.displayName="Card.Body";const Pt=({children:a,className:n,...l})=>e.createElement("div",h({className:t("maxio-card__footer",n)},l),a);Pt.displayName="Card.Footer";const Tt=({children:a,className:n,variant:l="primary",...r})=>e.createElement("div",h({className:t("maxio-card",`maxio-card--${l}`,n)},r),a);Tt.displayName="Card";const Dt=Object.assign(Tt,{Header:kt,Body:St,Footer:Pt});var Mt,Ot,$t,Lt;function Bt(){return Bt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},Bt.apply(null,arguments)}const zt=e=>f.createElement("svg",Bt({xmlns:"http://www.w3.org/2000/svg","data-name":"Maxio Logo SVG",viewBox:"0 0 1036 240"},e),Mt||(Mt=f.createElement("path",{d:"M59.32 11.3 70.64 0l40.74 40.35v70.99H40.89L0 70.52l11.15-11.14 36.2 36.15h30.07l3.07-3.39-50.91-51.15 10.99-10.97 51.24 50.83 3.72-3.38V47.13zM180.68 11.3 169.36 0l-40.73 40.35v70.99h70.48L240 70.51l-11.15-11.14-36.2 36.15h-30.06l-3.07-3.39 50.91-51.15-10.99-10.97-51.24 50.83-3.72-3.38V47.12l36.2-35.83ZM59.32 228.7l11.31 11.29 40.74-40.35v-70.99H40.89L0 169.48l11.15 11.14 36.2-36.15h30.07l3.07 3.39-50.92 51.15 10.99 10.97 51.24-50.83 3.72 3.38v30.34zM180.68 228.7l-11.32 11.29-40.73-40.35v-70.99h70.48L240 169.48l-11.15 11.14-36.2-36.15h-30.06l-3.07 3.39 50.91 51.15-10.99 10.97-51.24-50.83-3.72 3.38v30.34zM1015.27 139.55c0-29.94-23.74-53.46-52.11-53.46s-52.11 23.52-52.11 53.46 23.74 53.46 52.11 53.46 52.11-23.52 52.11-53.46m20.32.95c-.5 40.27-32.73 72.76-72.43 72.76h-.94c-39.58-.52-71.5-33.32-71.5-73.71s32.43-73.71 72.44-73.71h.94c39.57.52 71.5 33.32 71.5 73.71v.95Z"})),Ot||(Ot=f.createElement("path",{fillRule:"evenodd",d:"M870.39 24h-20.33v20.33h20.33zm0 40.67h-20.33v148.59h20.33z"})),$t||($t=f.createElement("path",{fillRule:"evenodd",d:"M850.05 24h20.33v20.33h-20.33zM695.01 82.85l50.83 56.28v6.53l-50.28 55.67 15.23 13.2 49.22-54.49h4.71l49.22 54.49 15.23-13.2-50.28-55.67v-6.53l50.83-56.28-15.23-13.2-50.15 55.52h-3.96l-50.15-55.52L695 82.85ZM660.49 78.64c-9.41-9.28-23.26-13.97-41.02-13.97-31.13 0-52.44 18.93-58.09 44.86l-.28 1.27 19.33 3.72.31-1.14c2.39-8.91 6.66-16.54 13.04-21.94 6.36-5.39 14.91-8.63 26.02-8.63s19.12 3.25 24.76 8.96c5.64 5.72 8.73 14.06 8.73 24.53v6.11L616.62 130l-3.26.68c-16.14 3.47-29.79 7.84-39.59 14.45-10.54 7.11-16.64 16.83-16.64 30.62 0 12.51 4.51 22.62 12.5 29.59 7.96 6.95 19.25 10.67 32.63 10.67 22.27 0 41.87-12.03 51.04-27.03v25.55h21.39v-95.3c0-17.6-4.77-31.3-14.19-40.58Zm-40.09 68.13c-12.86 2.77-23.05 5.42-30.03 9.63-3.46 2.09-6.08 4.54-7.84 7.54s-2.71 6.62-2.71 11.15c0 6.38 2.1 12.12 6.32 16.27 4.22 4.14 10.7 6.82 19.7 6.82 26.85 0 47.46-20.48 47.46-51.36v-7.2l-32.9 7.14Z"})),Lt||(Lt=f.createElement("path",{d:"M434.8 188.74h4.54l61.73-164.33.15-.41h35.57v189.35H515.9V55.37h-4.33l-59.7 157.57-.15.41h-29.29l-61.2-157.98h-4.35v157.98H336V24h35.57z"}))),At=a=>{const{size:n="sm",className:l,variant:r="lockup",alt:i="maxio logo"}=a,o="mark"===r,s="number"==typeof n;return e.createElement(zt,{role:"img",viewBox:o?"0 0 240 240":"0 0 1036 240","aria-label":i,height:s?n:void 0,className:t("maxio-logo",!s&&`maxio-logo--${n}`,o&&"maxio-logo--mark",l)})},Ft=({state:a,...n})=>{const l=e.useRef(null),{toastProps:r,contentProps:i,titleProps:o,closeButtonProps:s}=g.useToast(n,a,l),{closable:c=!0,underline:m=!0,external:d=!1}=n.toast.content,u=t("maxio-toast",{[`maxio-toast--${n.toast.content.sentiment}`]:n.toast.content.sentiment}),p={default:"info-circle-fill",success:"check-circle-fill",warning:"warning-circle-fill",danger:"error-fill",info:"info-circle-fill"}[n.toast.content.sentiment||"default"];return e.createElement("div",h({className:u,"data-maxio-mode":"dark"},r,{ref:l}),e.createElement(w,{variant:p,className:"maxio-toast__icon"}),e.createElement("div",h({className:"maxio-toast__container"},i),e.createElement("div",h({className:"maxio-toast__content"},o),n.toast.content.title&&e.createElement("span",{className:"maxio-toast__title"},n.toast.content.title),n.toast.content.message&&e.createElement("span",{className:"maxio-toast__message"},n.toast.content.message),n.toast.content.link?.text&&n.toast.content.link?.href&&e.createElement(I,{href:n.toast.content.link.href,underline:m,external:d},n.toast.content.link.text))),c&&e.createElement(T,h({variant:"ghost",icon:e.createElement(w,{variant:"cross"}),"aria-label":"Dismiss Notification",className:"maxio-toast__dismiss"},s)))},Vt=({state:t,...a})=>{const n=e.useRef(null),{regionProps:l}=g.useToastRegion(a,t,n);return e.createElement("div",h({},l,{ref:n,className:a.className,style:{display:"flex",flexDirection:"column",gap:"10px"}}),t.visibleToasts.map(a=>e.createElement(Ft,{key:a.key,toast:a,state:t})))},Ht=e.createContext(null);class Wt extends x.ToastQueue{}const jt=({...t})=>{const n=e.useRef(null),{buttonProps:l}=a.useButton(t,n);return e.createElement("button",h({},l,{className:"maxio-chip__dismiss-button"}),e.createElement(w,{variant:"cross-circle-fill",className:"maxio-chip__icon"}))},qt={success:"maxio-auth-layout__heading--success",danger:"maxio-auth-layout__heading--danger"};Object.defineProperty(exports,"DialogTrigger",{enumerable:!0,get:function(){return l.DialogTrigger}}),Object.defineProperty(exports,"Pressable",{enumerable:!0,get:function(){return l.Pressable}}),Object.defineProperty(exports,"createColumnHelper",{enumerable:!0,get:function(){return c.createColumnHelper}}),exports.ActionList=C,exports.Alert=D,exports.AuthLayout=({children:a,heading:n,description:l,sentiment:r="success",leadingElement:i=null,alert:o,topAddon:s=null,footer:c})=>e.createElement("div",{className:"maxio-auth-layout"},e.createElement(Ve,{alignItems:"center",justifyContent:"between"},e.createElement(At,{size:"md"}),s),o&&e.createElement(D,{display:"block",title:o.title,sentiment:o.sentiment},o.children),e.createElement(Dt,{variant:"secondary"},e.createElement(Dt.Body,null,e.createElement(Ve,{flexDirection:"col",gap:6},e.createElement(Ve,{flexDirection:"col",gap:2},e.createElement(Ve,{alignItems:"center",gap:2},i,e.createElement(Ae,{size:"lg",className:t("maxio-auth-layout__heading",qt[r])},n)),l&&e.createElement(Ve,{style:{color:"var(--maxio-color-text-tertiary)"}},e.createElement(Fe,{size:"sm",className:"maxio-auth-layout__description"},l))),a)),c&&e.createElement(Dt.Footer,null,c))),exports.Avatar=({className:a,src:n,alt:l="avatar"})=>e.createElement("img",{className:t("maxio-avatar",a),alt:l,src:n}),exports.Banner=({children:a,title:n,linkText:l,linkExternal:r,href:i,display:o="inline",sentiment:s="info",onDismiss:c,className:m})=>{if(!a&&!n)return console.warn("Banner component requires either children or title prop to be rendered"),null;const d=t("maxio-banner",{[`maxio-banner--${s}`]:"info"!==s&&s,className:m}),u={success:"check-circle-fill",warning:"warning-circle-fill",danger:"error-fill",info:"info-circle-fill"}[s],p=t("maxio-banner__content",{"maxio-banner__content--block":"block"===o});return e.createElement("div",{className:d,"aria-live":"assertive"},e.createElement(w,{variant:u,className:"maxio-banner__icon","aria-hidden":"true"}),e.createElement("section",{className:"maxio-banner__container"},e.createElement("div",{className:p},n&&e.createElement("span",{className:"maxio-banner__title"},n),a&&e.createElement("span",{className:"maxio-banner__message"},a),l&&i&&e.createElement(I,h({href:i},"warning"!==s&&{variant:"inverse"},{underline:!0},r?{external:!0}:{}),l))),c&&e.createElement(T,{icon:e.createElement(w,{variant:"cross"}),"aria-label":"Dismiss Notification",variant:"ghost",onClick:c,className:"maxio-banner__dismiss"}))},exports.Body=Fe,exports.Breadcrumbs=({className:a,children:n,...l})=>{const r=e.Children.count(n);if(0===r)throw new Error(z);const i=e.Children.map(n,(t,a)=>{if(e.isValidElement(t)&&t.type===B){if(a===r-1&&t.props.href)throw new Error(A);return e.cloneElement(t,{"aria-current":a===r-1?"page":void 0})}throw new Error(F)});return e.createElement("nav",h({"aria-label":"Breadcrumb"},l),e.createElement("ol",{className:t("maxio-breadcrumbs",a)},i))},exports.BreadcrumbsItem=B,exports.Button=P,exports.Calendar=lt,exports.Card=Dt,exports.Checkbox=_e,exports.CheckboxGroup=({helperText:n,className:l,errorMessage:r,children:o,disabled:s,label:c,defaultValue:m,name:d,...u})=>{const p=i.useCheckboxGroupState({defaultValue:m,name:d,errorMessage:r,description:n,label:c,isDisabled:s,isInvalid:!!r,...u}),{groupProps:x,labelProps:g,descriptionProps:b,errorMessageProps:f,isInvalid:E}=a.useCheckboxGroup({"aria-label":(c??u["aria-label"])?.toString(),isDisabled:s,isInvalid:!!r,...u},p),v=t("maxio-checkbox-group",{"maxio-checkbox-group--disabled":s},l),_=n&&!r;return e.createElement("div",h({className:v},x),c&&e.createElement("label",h({className:"maxio-checkbox-group__label"},g),c),e.createElement(Ee.Provider,{value:p},o),_&&e.createElement(we,b,n),r&&E&&e.createElement(Ne,f,r))},exports.Chip=({label:n,onDismiss:l,dismissLabel:i,leadingIcon:o,trailingIcon:s,title:c,...m})=>{const d=e.useRef(null),u=r.useToggleState(m),{buttonProps:p}=a.useToggleButton(m,u,d),x=t("maxio-chip",{"maxio-chip--selected":u?.isSelected}),g=t("maxio-chip__button",{"maxio-chip--dismissible":l});return e.createElement("div",{className:x},e.createElement("button",h({className:g,ref:d},p,{title:c}),o&&e.createElement(w,{variant:o,className:"maxio-chip__icon"}),e.createElement("span",{className:"maxio-chip__label"},n),s&&!l&&e.createElement(w,{variant:s,className:"maxio-chip__icon"})),l&&e.createElement(jt,{onPress:l,"aria-label":i}))},exports.Code=({as:a="div",children:n,className:l,...r})=>{const i=a,o=t("maxio-code",l);return e.createElement(i,h({className:o},r),n)},exports.ComboBox=Qe,exports.CopyToClipboard=({value:n,copyLabel:l="Copy",copiedLabel:r="Copied!",copyErrorLabel:i="Copy failed",size:o="md",variant:s="ghost",disabled:c,resetAfterMs:m=2e3,tooltipPlacement:d="top",onCopy:u,onCopyError:p,onClick:x,className:g,...b})=>{const{feedbackState:f,feedbackLabel:E,announcement:v,handleCopy:_}=((t,{copyLabel:a,copiedLabel:n,copyErrorLabel:l,resetAfterMs:r,onCopy:i,onCopyError:o,onClick:s})=>{const[c,m]=e.useState(null),d=e.useRef(null),u=e.useRef(0),p=e.useRef(!0),x=e.useRef(0),g=e.useRef(t),b=e.useCallback(()=>{null!==d.current&&(clearTimeout(d.current),d.current=null)},[]),f=e.useCallback(()=>{b(),m(null)},[b]),h=e.useCallback((e,t)=>{b(),m({state:e,value:t,announceId:++u.current}),d.current=window.setTimeout(f,r)},[b,r,f]);e.useEffect(()=>{g.current=t,f()},[f,t]),e.useEffect(()=>(p.current=!0,()=>{p.current=!1,b()}),[b]);const E=e.useCallback(async e=>{s?.(e);const a=++x.current,n=t,l=()=>!p.current||a!==x.current||n!==g.current;try{await navigator.clipboard.writeText(n)}catch(e){return l()||h("error",n),void o?.(e)}l()||h("copied",n),i?.(n)},[s,i,o,h,t]),v=c?.value===t?c.state:"idle",_={idle:a,copied:n,error:l}[v];return{feedbackState:v,feedbackLabel:_,announcement:"idle"!==v&&c?{id:c.announceId,message:_}:null,handleCopy:E}})(n,{copyLabel:l,copiedLabel:r,copyErrorLabel:i,resetAfterMs:m,onCopy:u,onCopyError:p,onClick:x});return e.createElement(e.Fragment,null,e.createElement(Y,{interactions:["hover","focus"],placement:d,size:"small",renderContent:()=>E},e.createElement(T,h({},b,{"aria-label":l,className:t(g,{[Q]:"subtle"===s,[X]:"xs"===o}),variant:"subtle"===s?"ghost":s,size:"xs"===o?void 0:o,disabled:c,onClick:_,trailingElement:e.createElement(w,{variant:J[f]})}))),e.createElement(a.VisuallyHidden,null,e.createElement("span",{role:"status","aria-live":"polite","aria-atomic":"true"},v&&e.createElement("span",{key:v.id},v.message))))},exports.DataTable=({pattern:t,size:a="md",SubRowComponent:n,onExpand:l,onSelect:r,onSort:i,enableSorting:o=!1,enableRowSelection:s=!1,enableExpanding:m,columns:d,actions:u,actionsColumnSize:p,onRowAction:x,enableRowReordering:g=!1,getRowReorderLabel:b,onRowReorder:f,rowReorderMode:E="siblings",getRowId:v,getSubRows:_,state:w,...N})=>{const y=g?void 0:n,C=!g&&o,I=(({columns:t,HeaderControls:a,RowControls:n,RowActions:l,actions:r,actionsColumnSize:i,enableExpanding:o,enableRowSelection:s,enableRowReordering:c})=>e.useMemo(()=>{const m={id:ee,size:s&&c?72:40,header:t=>e.createElement(a,h({},t,{enableExpanding:o,enableRowSelection:s,enableRowReordering:c})),cell:t=>e.createElement(n,h({},t,{enableExpanding:o,enableRowSelection:s,enableRowReordering:c})),meta:{controls:!0,width:(s&&c?72:40)+"px"}},d=r&&l?{id:te,size:i??40,header:"",cell:t=>e.createElement(l,null,r(t.row,t.table)),meta:{actions:!0}}:null;let u=[...t];return(s||c)&&(u=[m,...u]),d&&(u=[...u,d]),u},[r,i,l,o,s,c,t,a,n]))({columns:d,HeaderControls:ye,RowControls:Re,RowActions:ke,actions:u,actionsColumnSize:p,enableRowSelection:s,enableRowReordering:g,enableExpanding:Boolean(m)}),R=c.useReactTable({state:{...w,...g&&{sorting:Le},columnPinning:{left:[...s||g?[ee]:[],...$e(w?.columnPinning?.left)],right:[...$e(w?.columnPinning?.right),...u?[te]:[]]}},getCoreRowModel:c.getCoreRowModel(),enableRowSelection:s,enableExpanding:Boolean(m),...!N.manualExpanding&&{getExpandedRowModel:c.getExpandedRowModel()},...!N.manualSorting&&!g&&{getSortedRowModel:c.getSortedRowModel()},columns:I,getRowId:v,...N,getSubRows:g?Be:_??Be,enableSorting:C,...g&&{getSortedRowModel:void 0}}),k=R.getCanSomeRowsExpand(),S=R.getState(),P=(({columnFilters:e,globalFilter:t,grouping:a,hasPagination:n})=>e.length>0||null!=t&&""!==t?De:a.length>0?Me:n?Oe:Te)({columnFilters:S.columnFilters,globalFilter:S.globalFilter,grouping:S.grouping,hasPagination:Boolean(N.getPaginationRowModel||N.manualPagination)});e.useEffect(()=>{l?.(S.expanded)},[l,S.expanded]),e.useEffect(()=>{r?.(S.rowSelection)},[r,S.rowSelection]),e.useEffect(()=>{g||i?.(S.sorting)},[g,i,S.sorting]);const T=e.createElement(ae,{pattern:t,size:a,isExpandable:k,isUsingCustomRow:Boolean(y)},e.createElement(ne,null,R.getHeaderGroups().map(t=>e.createElement(he,{key:t.id,table:R,isHeader:!0},t.headers.map(t=>e.createElement(re,{key:t.id,table:R,header:t,enableExpanding:m},c.flexRender(t.column.columnDef.header,t.getContext())))))),e.createElement(le,null,R.getRowModel().rows.map(a=>e.createElement(Pe,{key:a.id,row:a,pattern:t,SubRowComponent:y,enableExpanding:m,onRowAction:x}))));return g&&v&&f?e.createElement(fe,{availability:P,data:N.data,enableExpanding:Boolean(m),getRowReorderLabel:b,onRowReorder:f,rowReorderMode:E,table:R},T):T},exports.DateField=({label:a,description:n,errorMessage:r,className:i,...o})=>e.createElement(l.DateField,h({},o,{className:l.composeRenderProps(i,(e,a)=>t("maxio-text-field","maxio-date-field",{"maxio-text-field--disabled":a.isDisabled,"maxio-text-field--error":a.isInvalid,"maxio-text-field--readonly":a.isReadOnly},e))}),null!=a&&e.createElement(l.Label,{className:"maxio-text-field__label"},a),e.createElement("div",{className:"maxio-text-field__items"},e.createElement("div",{className:"maxio-text-field__input"},e.createElement(nt,null))),null!=n&&e.createElement(l.Text,{slot:"description",className:"maxio-form-helper-text"},n),e.createElement(l.FieldError,{className:"maxio-form-error"},r)),exports.DatePicker=({label:a,description:n,errorMessage:r,className:i,presets:o,presetsLabel:s,...c})=>{const m=o?.find(e=>null===e.value)?.label;return e.createElement(l.DatePicker,h({},c,{className:l.composeRenderProps(i,(e,a)=>t("maxio-text-field","maxio-date-field",{"maxio-text-field--disabled":a.isDisabled,"maxio-text-field--error":a.isInvalid,"maxio-text-field--readonly":a.isReadOnly},e))}),({state:t,isDisabled:i,isReadOnly:d})=>e.createElement(e.Fragment,null,null!=a&&e.createElement(l.Label,{className:"maxio-text-field__label"},a),e.createElement(l.Group,{className:"maxio-text-field__items"},e.createElement("div",{className:"maxio-text-field__input"},e.createElement(nt,{displayValue:null===t.value?m:void 0})),e.createElement("div",{className:"maxio-text-field__trailing-element"},e.createElement(l.Button,{className:"maxio-button maxio-button--sm maxio-button--ghost maxio-button--icon"},e.createElement(w,{variant:"calendar"})))),null!=n&&e.createElement(l.Text,{slot:"description",className:"maxio-form-helper-text"},n),e.createElement(l.FieldError,{className:"maxio-form-error"},r),e.createElement(Ce,{hideArrow:!0,className:"maxio-date-field__popover"},e.createElement(l.Dialog,{className:"maxio-date-field__dialog"},e.createElement(lt,null),e.createElement(rt,{presets:o,label:s,isDisabled:i||d,isPresetDisabled:e=>it(e,c),onSelect:e=>{t.setValue(e),t.setOpen(!1)}})))))},exports.DateRangePicker=({label:a,description:n,errorMessage:r,className:i,presets:o,presetsLabel:s,...c})=>e.createElement(l.DateRangePicker,h({},c,{className:l.composeRenderProps(i,(e,a)=>t("maxio-text-field","maxio-date-field",{"maxio-text-field--disabled":a.isDisabled,"maxio-text-field--error":a.isInvalid,"maxio-text-field--readonly":a.isReadOnly},e))}),({state:t,isDisabled:i,isReadOnly:m})=>{const d=((e,t)=>{if(null==e?.start||null==e?.end)return t?.find(t=>st(t.value?.start,e?.start)&&st(t.value?.end,e?.end))?.label})(t.value,o);return e.createElement(e.Fragment,null,null!=a&&e.createElement(l.Label,{className:"maxio-text-field__label"},a),e.createElement(l.Group,{className:"maxio-text-field__items"},e.createElement("div",{className:"maxio-text-field__input"},e.createElement(nt,{slot:"start",displayValue:null==t.value?.start?d:void 0}),e.createElement("span",{"aria-hidden":"true",className:"maxio-body-sm"},"→"),e.createElement(nt,{slot:"end",displayValue:null==t.value?.end?d:void 0})),e.createElement("div",{className:"maxio-text-field__trailing-element"},e.createElement(l.Button,{className:"maxio-button maxio-button--sm maxio-button--ghost maxio-button--icon"},e.createElement(w,{variant:"calendar"})))),null!=n&&e.createElement(l.Text,{slot:"description",className:"maxio-form-helper-text"},n),e.createElement(l.FieldError,{className:"maxio-form-error"},r),e.createElement(Ce,{hideArrow:!0,className:"maxio-date-field__popover"},e.createElement(l.Dialog,{className:"maxio-date-field__dialog"},e.createElement(ot,null),e.createElement(rt,{presets:o,label:s,isDisabled:i||m,isPresetDisabled:e=>((e,t)=>{const a=e.start?u.toCalendarDate(e.start):null,n={...t,isDateUnavailable:e=>t.isDateUnavailable?.(e,a)??!1};if(null!=e.start&&null!=e.end&&e.start.compare(e.end)>0||null!=e.start&&it(e.start,{...t,isDateUnavailable:e=>t.isDateUnavailable?.(e,null)??!1})||null!=e.end&&it(e.end,n))return!0;if(e.start&&e.end&&t.isDateUnavailable&&!t.allowsNonContiguousRanges){const n=u.toCalendarDate(e.end);for(let l=u.toCalendarDate(e.start).add({days:1});l.compare(n)<0;l=l.add({days:1}))if(t.isDateUnavailable(l,a))return!0}return!1})(e,c),onSelect:e=>((e,t)=>{!t||null!=t.start&&null!=t.end?t?.start&&t.end?e.setValue({start:t.start,end:t.end}):e.setValue(null):(e.setValue(null),e.setDateTime("start",t.start),e.setDateTime("end",t.end)),e.setOpen(!1)})(t,e)}))))}),exports.Display=({as:a="div",children:n,size:l="md",className:r,...i})=>{const o=a,s=t(`maxio-display-${l}`,r);return e.createElement(o,h({className:s},i),n)},exports.Drawer=({open:a,onOpenChange:n,placement:r="right",backdrop:i="dim",size:o="md",className:s,title:c,description:m,children:d,footer:u})=>{const p=e.useId(),x={"data-placement":r,"data-size":o};return e.createElement(l.ModalOverlay,{isOpen:a,onOpenChange:n,isDismissable:!0,className:t("maxio-drawer__backdrop",{"maxio-drawer__backdrop--dim":"dim"===i})},e.createElement(l.Modal,h({className:t("maxio-drawer",s)},x),e.createElement(l.Dialog,{className:"maxio-drawer__dialog","aria-labelledby":p},({close:t})=>e.createElement(e.Fragment,null,e.createElement("div",{className:"maxio-drawer__header"},e.createElement("div",{className:"maxio-drawer__title-group"},e.createElement(Ae,{id:p,size:"md",className:"maxio-drawer__title"},c),m&&e.createElement("p",{className:"maxio-drawer__description"},m)),e.createElement(T,{"aria-label":"Close",onClick:t,icon:e.createElement(w,{variant:"cross"}),variant:"ghost",size:"sm",className:"maxio-drawer__close"})),e.createElement("div",{className:"maxio-drawer__body"},d),null!=u&&e.createElement("div",{className:"maxio-drawer__footer"},u)))))},exports.EmptyState=({hasActiveFilters:a=!1,title:n,headingLevel:l="h2",description:r,actions:i,className:o,...s})=>{const c=t("maxio-empty-state",o),m=l,d=!n&&!r?a?"We couldn't find any items matching your criteria. Try adjusting your search or filters to see more results.":"There is no data to display yet.":r;return e.createElement("div",h({className:c},s),e.createElement(Ve,{flexDirection:"col",alignItems:"center",gap:4,className:"maxio-empty-state__content"},e.createElement(Ve,{flexDirection:"col",alignItems:"center",gap:2,className:"maxio-empty-state__copy"},n&&e.createElement(m,{className:"maxio-heading-lg"},n),d&&e.createElement(Fe,{size:"sm",className:"maxio-empty-state__description"},d)),i&&e.createElement(Ve,{alignItems:"center",gap:2},i)))},exports.Flex=Ve,exports.FormErrorMessage=Ne,exports.FormHelperText=we,exports.GlobalToastProvider=({children:t,toastQueue:a,...n})=>{const l=x.useToastQueue(a),r=e.useCallback(()=>{l.visibleToasts.forEach(e=>{a.close(e.key)})},[l.visibleToasts,a]),i=e.useMemo(()=>({addToast:a.add.bind(a),removeToast:a.clear.bind(a),removeAllToasts:r,state:l}),[a,r,l]);return e.createElement(Ht.Provider,{value:i},t,l.visibleToasts.length>0&&e.createElement(Vt,h({},n,{state:l})))},exports.Grid=({children:a,templateColumns:n,templateRows:l,autoColumns:r,autoRows:i,inline:o,column:s,columnStart:c,columnEnd:m,row:d,rowStart:u,rowEnd:p,gap:x,gapX:g,gapY:b,className:f,justifyContent:E,alignItems:v,..._})=>{const w=t(f,{"maxio-grid":!o,"maxio-inline-grid":o,[`maxio-grid-cols-${n}`]:n,[`maxio-grid-rows-${l}`]:l,[`maxio-auto-cols-${r}`]:r,[`maxio-auto-rows-${i}`]:i,["maxio-col-"+("auto"===s?"auto":`span-${s}`)]:s,[`maxio-col-start-${c}`]:c,[`maxio-col-end-${m}`]:m,["maxio-row-"+("auto"===d?"auto":`span-${d}`)]:d,[`maxio-row-start-${u}`]:u,[`maxio-row-end-${p}`]:p,[`maxio-gap-${x}`]:void 0!==x,[`maxio-gap-x-${g}`]:void 0!==g,[`maxio-gap-y-${b}`]:void 0!==b,[`maxio-justify-${E}`]:E,[`maxio-items-${v}`]:v});return e.createElement("div",h({className:w||void 0},_),a)},exports.Heading=Ae,exports.Icon=w,exports.IconButton=T,exports.Label=({as:a="div",children:n,size:l="sm",className:r,...i})=>{const o=a,s=t(`maxio-label-${l}`,r);return e.createElement(o,h({className:s},i),n)},exports.Link=I,exports.ListBox=Ge,exports.LoadingSpinner=R,exports.Logo=At,exports.Menu=({children:t})=>e.createElement(O,null,e.createElement(L,null,t)),exports.MenuButton=({children:a,iconName:n="chevron-down","aria-label":l,size:r="md",variant:i="secondary"})=>{const o=t({"maxio-action-menu__chevron":"chevron-down"===n}),s=t("maxio-button",`maxio-button--${i}`,`maxio-button--${r}`,{"maxio-button--icon":n&&!a}),{isOpen:c,buttonId:m,controlsId:d}=$();return e.createElement("summary",{className:s,"aria-haspopup":"true","aria-label":l,"aria-expanded":c,"aria-controls":d,id:m},a&&e.createElement("span",null,a),n&&e.createElement(w,{variant:n,className:`${o} maxio-button__trailing-element`}))},exports.MenuList=({items:a,alignItemsEnd:n=!1})=>{const l=t("maxio-action-menu__content",{"maxio-action-menu__content--align-end":n}),{controlsId:r,buttonId:i}=$();return e.createElement("div",{className:l,role:"presentation"},e.createElement(C,{role:"menu",itemProps:{role:"menuitem"},id:r,"aria-labelledby":i,items:a}))},exports.OverlayTrigger=K,exports.Pagination=({size:t="md",onChange:a,totalItems:n=0,itemsPerPage:l=30,currentPage:r=1,pageSizeOptions:i,manualPageInput:o=!1})=>{const[s,c]=e.useState(r),[m,d]=e.useState(l),[u,p]=e.useState(r.toString());e.useEffect(()=>{p(s.toString())},[s]);const x=Math.ceil(n/m),g=s<x,b=s>1,f=m*(s-1)+1,h=Math.min(m*s,n),E=i.map(e=>({label:e.toString(),value:e.toString()})),v=Array.from({length:x},(e,t)=>t+1).map(e=>({label:e.toString(),value:e.toString()})),_=e=>{c(e),a?.({currentPage:e,itemsPerPage:m})},N=e=>{const t=parseInt(e,10);if(isNaN(t))return void p(s.toString());const a=Math.max(1,Math.min(t,x));p(a.toString()),_(a)};return e.createElement("div",{className:"maxio-pagination"},e.createElement("div",{className:"maxio-pagination__items-per-page"},e.createElement("label",{htmlFor:"items-per-page-large",className:"maxio-pagination__label"},"Items per page"),e.createElement(at,{inline:!0,size:t,options:E,onChange:e=>{return t=Number(e.target.value),d(t),c(1),void a?.({currentPage:1,itemsPerPage:t});var t},value:m,id:"items-per-page-large"})),e.createElement("div",{className:"maxio-pagination__total-items"},e.createElement("span",null,f,"–",h," of ",n," items")),e.createElement("div",{className:"maxio-pagination__current-page"},o?e.createElement(tt,{className:"maxio-pagination__page-input",value:u,min:1,max:x,onChange:e=>(e=>{p(e)})(e),onBlur:e=>{N(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&(N(e.currentTarget.value),e.currentTarget.blur())},"aria-label":"Page number",size:t,type:"number",onWheel:e=>e.preventDefault()}):e.createElement(at,{inline:!0,size:t,"aria-label":"Select page",onChange:e=>_(Number(e.target.value)),value:s,options:v,id:"page-index-large"}),e.createElement("div",{className:"maxio-pagination__label"},"of ",x," pages")),e.createElement("div",{className:"maxio-pagination__controls"},e.createElement(Y,{onVisibilityUpdate:()=>{},renderContent:()=>"Previous",floatingElementOffset:9,placement:"top",size:"small"},e.createElement(T,{icon:e.createElement(w,{variant:"chevron-left"}),size:t,variant:"ghost",onClick:()=>_(s-1),"aria-label":"Previous",disabled:!b})),e.createElement(Y,{onVisibilityUpdate:()=>{},renderContent:()=>"Next",floatingElementOffset:9,placement:"top",size:"small"},e.createElement(T,{icon:e.createElement(w,{variant:"chevron-right"}),size:t,variant:"ghost",onClick:()=>_(s+1),"aria-label":"Next",disabled:!g}))))},exports.Popover=Ce,exports.ProgressBar=({label:n,helperText:l,size:r="md",variant:i="default",status:o,value:s,maxValue:c=100})=>{const m=a.useId(),d=a.useId(),u=o&&!!n&&!!s&&!("inline"===i),p=l&&!("inline"===i),x=l&&"inline"===i,{progressBarProps:g,labelProps:b}=a.useProgressBar({maxValue:c,value:s,label:n}),f=t("maxio-progress-bar",{"maxio-progress-bar--lg":"lg"===r,"maxio-progress-bar--success":s&&!("inline"===i)&&"success"===o,"maxio-progress-bar--error":s&&!("inline"===i)&&"error"===o,"maxio-progress-bar--indent":"indent"===i,"maxio-progress-bar--inline":"inline"===i,"maxio-progress-bar--indeterminate":void 0===s});return e.createElement("div",h({className:f},g),e.createElement("div",h({id:m,className:"maxio-progress-bar__label"},b),n),x&&e.createElement("div",{id:d,className:"maxio-progress-bar__helper-text"},l),e.createElement("div",{className:"maxio-progress-bar__track"},e.createElement("div",{className:"maxio-progress-bar__progress",style:{"--tw-scale-x":`${s}%`}})),u&&e.createElement("div",{className:`maxio-progress-bar__${o}-icon`}),p&&e.createElement("div",{id:d,className:"maxio-progress-bar__helper-text"},l))},exports.Radio=({indent:n=!1,disabled:l=!1,invalid:r=!1,label:i,...o})=>{const s=e.useRef(null),c=e.useContext(Xe),{inputProps:m,isDisabled:d}=a.useRadio({...o,value:(o.value||"").toString(),"aria-label":o["aria-label"]||i,isDisabled:l},c,s),u=t("maxio-radio",{"maxio-radio--indent":n,"maxio-radio--disabled":d||c.isDisabled,"maxio-radio--error":r||c.isInvalid});return e.createElement("label",{className:u},e.createElement("input",h({ref:s,role:"radio",type:"radio",className:"maxio-radio__input"},m,{name:c.name||m.name})),e.createElement("span",{className:"maxio-radio__control"}),e.createElement("span",{className:"maxio-radio__label"},i))},exports.RadioGroup=({children:t,label:n,errorMessage:l,helperText:r,disabled:i=!1,invalid:o=!1,name:s,defaultValue:c,...m})=>{const d=p.useRadioGroupState({isDisabled:i,isInvalid:o,description:r,name:s,label:n,errorMessage:l,defaultValue:c,...m}),{radioGroupProps:u,labelProps:x,descriptionProps:g,errorMessageProps:b}=a.useRadioGroup({"aria-label":m["aria-label"]||n,...m},d);return e.createElement(e.Fragment,null,e.createElement("div",h({className:"maxio-radio-group"},u),n&&e.createElement("label",h({className:"maxio-radio-group__label"},x),n),e.createElement(Xe.Provider,{value:d},t),o&&l&&e.createElement(Ne,b,l),r&&!o&&e.createElement(we,g,r)))},exports.RangeCalendar=ot,exports.SegmentedControl=dt,exports.Select=at,exports.SideNav=({withIcons:t=!0,shouldToggleSidebar:a=!1,topDropdownItems:n,sections:l=[],collapseBreakpoint:r=800,isOpen:i,onChange:o})=>e.createElement(ft,{isOpen:i,onChange:o,collapseBreakpoint:r,withIcons:t,shouldToggleSidebar:a,topDropdownItems:n,sections:l},e.createElement(Nt,null)),exports.Tab=yt,exports.TabList=({children:a,className:n,ariaLabel:r,overflow:i="none",moreLabel:o="More",...s})=>{const{variant:c,withDivider:m}=e.useContext(Ct),d=e.useContext(l.TabListStateContext),u=e.useId(),[p,x]=e.useState(!1),g=t("maxio-tabs",n,{"maxio-tabs--contained":"contained"===c,"maxio-tabs--divider":m}),b=e.Children.map(a,e=>e);(b??[]).forEach(t=>{if(!e.isValidElement(t)||t.type!==yt)throw new Error("You can only pass <Tab /> component as children")});const f="auto"===i&&!!b?.length,{ref:E,moreButtonRef:v,overflowIndexes:_,handleKeyDownCapture:N}=(({overflowEnabled:t,childrenArray:a})=>{const n=e.useRef(null),r=e.useRef(null),i=e.useRef(null),[o,s]=e.useState(null),c=U(n),m=e.useContext(l.TabListStateContext),d=null!=m?.selectedKey?Number(m.selectedKey):null,[u,p]=e.useState([]);e.useLayoutEffect(()=>{if(!t||!o)return void p((a??[]).map((e,t)=>t));const{visibleIndexes:e}=((e,t,a,n)=>{const l=e.map((e,t)=>t);if(e.reduce((e,t)=>e+t,0)<=t)return{visibleIndexes:l,overflowIndexes:[]};const r=[];let i=a;for(const a of l){if(i+e[a]>t)break;i+=e[a],r.push(a)}if(null!==n&&!r.includes(n)){for(i+=e[n];i>t&&r.length>0;)i-=e[r.pop()];r.push(n)}r.sort((e,t)=>e-t);const o=l.filter(e=>!r.includes(e));return{visibleIndexes:r,overflowIndexes:o}})(o.tabWidths,c,o.moreButtonWidth,i.current??d);e.length===(a??[]).length&&(i.current=null),p(e)},[t,o,c]),e.useLayoutEffect(()=>{t&&o&&null!==d&&p(e=>(e.includes(d)||(i.current=d),((e,t,a,n,l)=>{if(e.includes(l))return e;const r=[...e,l].sort((e,t)=>e-t);let i=n+r.reduce((e,a)=>e+t[a],0);for(;i>a&&r.length>1;){const e=r.length-1,a=r[e]===l?e-1:e,[n]=r.splice(a,1);i-=t[n]}return r})(e,o.tabWidths,c,o.moreButtonWidth,d)))},[d]);const x=t?(a??[]).map((e,t)=>t).filter(e=>!u.includes(e)):[],g=((e,t)=>e.filter(e=>!t?.[e]?.props.disabled))(u,a);e.useLayoutEffect(()=>{if(!t||!n.current)return void s(e=>null===e?e:null);const e=Array.from(n.current.querySelectorAll('[role="tab"]')),l=r.current?.getBoundingClientRect().width??0;s(t=>{const n=(a??[]).map((a,n)=>{const l=e[n]?.getBoundingClientRect().width??0;return l>0?l:t?.tabWidths[n]??0}),r=l>0?l:t?.moreButtonWidth??0,i=t?.tabWidths.length===n.length&&t.tabWidths.every((e,t)=>e===n[t]);return t&&i&&t.moreButtonWidth===r?t:{tabWidths:n,moreButtonWidth:r}})},[a,t]);const b=e=>{void 0!==e&&(m?.selectionManager.setFocused(!0),m?.selectionManager.setFocusedKey(e),m?.setSelectedKey(e),n.current?.querySelector(`[role="tab"][data-key="${e}"]`)?.focus())};return{ref:n,moreButtonRef:r,visibleIndexes:u,overflowIndexes:x,handleKeyDownCapture:e=>{if(0===x.length)return;const t=document.activeElement===r.current,a=m?.selectionManager.focusedKey,n=t?-1:g.indexOf(Number(a));if(t||-1!==n)switch(e.key){case"ArrowRight":if(t)return;return e.preventDefault(),e.stopPropagation(),void(n<g.length-1?b(g[n+1]):r.current?.focus());case"ArrowLeft":return e.preventDefault(),e.stopPropagation(),void(t?b(g[g.length-1]):n>0&&b(g[n-1]));case"Home":if(t)return;return e.preventDefault(),e.stopPropagation(),void b(g[0]);case"End":if(t)return;return e.preventDefault(),e.stopPropagation(),void b(g[g.length-1])}}}})({overflowEnabled:f,childrenArray:b}),y=e.createElement("span",{className:"maxio-tabs__tab__content"},o,e.createElement(w,{variant:"chevron-down",className:"maxio-tabs__more__chevron"})),C=_.map(e=>{return`#${t=u,"undefined"!=typeof CSS&&"function"==typeof CSS.escape?CSS.escape(t):t.replace(/[^a-zA-Z0-9_-]/g,"\\$&")} [role="tablist"] > .maxio-tabs__tab:nth-child(${e+1})`;var t});return e.createElement("div",{id:u,className:g,ref:E,onKeyDownCapture:N},C.length>0&&e.createElement("style",null,`${C.join(", ")} { display: none; }`),e.createElement(l.TabList,h({"aria-label":r,className:"maxio-contents"},s),(b??[]).map((t,a)=>e.cloneElement(t,{key:a,value:a}))),f&&_.length>0&&e.createElement(l.MenuTrigger,{isOpen:p,onOpenChange:x},e.createElement(l.Button,{ref:v,className:"maxio-tabs__tab maxio-tabs__more__trigger","aria-label":o},y),p&&e.createElement(Ce,{hideArrow:!0,placement:"bottom end",className:"maxio-tabs__more__menu"},e.createElement(l.Menu,{"aria-label":`${o} tabs`,onAction:e=>{d?.setSelectedKey(e),requestAnimationFrame(()=>{E.current?.querySelector(`[role="tab"][data-key="${e}"]`)?.focus()})}},_.map(t=>{const a=b[t],{disabled:n,type:r,"aria-label":i,"aria-labelledby":o}=a.props,s="icon"===r?a.props.icon:a.props.children;return e.createElement(l.MenuItem,{key:t,id:t,isDisabled:!!n,"aria-label":i,"aria-labelledby":o,className:"maxio-tabs__more__item"},s)})))))},exports.TabPanel=Rt,exports.TabPanels=({children:t})=>{const a=e.Children.map(t,(t,a)=>{if(!e.isValidElement(t)||t.type!==Rt)throw new Error("You can only pass <TabPanel /> component as children");return e.cloneElement(t,{key:a,value:a})});return e.createElement(l.TabPanels,{className:"maxio-tabs__panels"},a)},exports.Tabs=({children:t,variant:a="line",withDivider:n=!1,defaultIndex:r=0,index:i,onChange:o})=>e.createElement(l.Tabs,{className:"maxio-tabs-container",selectedKey:i,defaultSelectedKey:r,onSelectionChange:e=>o?.(Number(e))},e.createElement(It,{variant:a,withDivider:n},t)),exports.Tag=({children:a,size:n,sentiment:l,kind:r="primary",leadingIcon:i,trailingIcon:o})=>{const s=t("maxio-tag",`maxio-tag--${r}`,!!l&&`maxio-tag--${l}`,!!n&&`maxio-tag--${n}`);return e.createElement("div",{className:s},i&&e.createElement(w,{variant:i,className:"maxio-tag__icon"}),e.createElement("span",{className:"maxio-tag__label"},a),o&&e.createElement(w,{variant:o,className:"maxio-tag__icon"}))},exports.TextArea=et,exports.TextField=Je,exports.TextInput=tt,exports.Tile=({children:a,className:n,href:l,onClick:r,target:i,disabled:o})=>{const s=l||r;if(!s)return e.createElement("div",{className:"maxio-tile"},a);const c=t("maxio-tile",n,{"maxio-tile--clickable":s,"maxio-tile--disabled":o});return e.createElement("a",{className:c,href:l,target:i,onClick:e=>{o&&l&&e.preventDefault(),!o&&r&&r()}},a)},exports.ToastProvider=({children:t,...a})=>{const{maxVisibleToasts:n=5,...l}=a,r=x.useToastState({maxVisibleToasts:n,...l});return e.useEffect(()=>{console.warn("ToastProvider is deprecated. Please use the global toast API instead.")},[]),e.createElement(e.Fragment,null,t(r),r.visibleToasts.length>0&&e.createElement(Vt,h({},a,{state:r})))},exports.ToastQueue=Wt,exports.Toggle=({defaultChecked:a,checked:n,onChange:l,disabled:r,valueDescription:i,valueDescriptionPosition:o,className:s,name:c,id:m,...d})=>{const u=e.useId(),p="boolean"==typeof a,x=m||u,g="left"===o?"row":"row-reverse",b=i&&o,f=e.useCallback(e=>{if("Enter"===e.code||"Space"===e.code){e.preventDefault();const t=e.currentTarget.checked;p&&(e.currentTarget.checked=!t),l&&l(!t,e)}},[p,l]),h=d["aria-label"]||(b?void 0:i);return e.createElement("div",{className:t("maxio-toggle",s,{"maxio-toggle--disabled":r}),style:{display:"inline-flex",flexDirection:g},"data-testid":"toggle-container"},b?e.createElement("label",{className:"maxio-toggle__label",htmlFor:x},i):null,e.createElement("div",{className:"maxio-toggle__container"},e.createElement("input",{type:"checkbox",defaultChecked:a,checked:n,onChange:e=>{l&&l(e.target.checked,e)},onKeyDown:f,disabled:r,className:"maxio-toggle__checkbox",id:x,name:c,"aria-label":h}),e.createElement("div",{className:"maxio-toggle__track",role:"switch","aria-checked":n,"aria-hidden":"true"},e.createElement("div",{className:"maxio-toggle__handle"}),e.createElement("span",{className:"maxio-toggle__icon"},e.createElement("i",{className:"maxio-toggle__icon-on"})),e.createElement("span",{className:"maxio-toggle__icon"},e.createElement("i",{className:"maxio-toggle__icon-off"})))))},exports.Tooltip=V,exports.TooltipTrigger=Y,exports.TopBar=({children:t,actions:a,sideNavIsClosed:n,openSideNav:l})=>e.createElement("nav",{className:"maxio-top-bar"},n&&e.createElement(T,{"aria-label":"Open Side Navigation",variant:"ghost",icon:e.createElement(w,{variant:"sidebar"}),onClick:l}),e.createElement(Ve,{grow:!0,justifyContent:"end"},t),a),exports.useElementResizeObserver=U,exports.useHover=q,exports.useOverlayTrigger=j,exports.useToast=()=>{const t=e.useContext(Ht);if(!t)throw new Error("useToast must be used within a GlobalToastProvider. Please wrap your app with <GlobalToastProvider> to use the global toast API.");return t},exports.useWindowSize=G;
|
|
1
|
+
"use strict";var e=require("react"),t=require("classnames"),a=require("react-aria"),n=require("@react-aria/utils"),l=require("react-aria-components"),r=require("@react-stately/toggle"),i=require("@react-stately/checkbox"),o=require("framer-motion"),s=require("@floating-ui/react-dom-interactions"),c=require("@tanstack/react-table"),m=require("@atlaskit/pragmatic-drag-and-drop/element/adapter"),d=require("@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item"),u=require("@internationalized/date"),p=require("@react-stately/radio"),x=require("@react-stately/toast"),g=require("@react-aria/toast");function b(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(a){if("default"!==a){var n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:function(){return e[a]}})}}),t.default=e,Object.freeze(t)}var f=b(e);function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},h.apply(null,arguments)}const E=["address-card","arrow-down","arrow-down-left","arrow-down-left-long","arrow-down-long","arrow-down-right","arrow-down-right-long","arrow-down-up","arrow-left","arrow-left-long","arrow-left-right","arrow-right","arrow-right-long","arrow-turn-down-right","arrow-up","arrow-up-left","arrow-up-left-long","arrow-up-long","arrow-up-right","arrow-up-right-long","bank","bar-chart","briefcase","building","business-intelligence","calendar","caret-down","caret-left","caret-right","caret-up","chat","check","check-box","check-box-checked","check-box-checked-fill","check-box-indeterminate-fill","check-circle","check-circle-fill","chevron-down","chevron-left","chevron-right","chevron-up","chevron-up-down","circle","circle-half-stroke-small","circle-small-dash","circle-small-fill","circle-small-stroke","clipboard","cog","copy-file","credit-card","cross","cross-circle","cross-circle-fill","dashboard","diamond-small-fill","document","document-blank","dollar","dot-circle-fill","dot-fill","error","error-fill","error-small-fill","graph","home","info-circle","info-circle-fill","line-vertical","list","login","logout","megaphone","menu","menu-chevron-left","menu-chevron-right","notification","notification-unread","pen","plus","plus-circle","plus-circle-fill","question-circle","question-circle-fill","recently-viewed","search","square-small-fill","trash","triangle-small-fill","user","warning-circle","warning-circle-fill"],v=["anrok","dropbox","hubspot","numeral","oracle","quotapath","sage","sphere","taxjar"],_=["avalara","pipedrive","quickbooks","salesforce","xero"],w=({variant:a,color:n,className:l,size:r})=>{const i=(e,t)=>t.includes(e),o=i(a,E)||i(a,v),s=i(a,_),c=t({"fa-kit":o,"fa-kit-duotone":s,"fa-sharp fa-regular":!o&&!s,[`fa-${a}`]:!0,[`fa-${r}`]:r,[`maxio-icon--${n}`]:n&&!i(a,v)&&!i(a,_)},l);return e.createElement("i",{className:c})},N=({item:n,isSelected:l,truncateLabel:r=!1,role:i="option",small:o=!1})=>{const s=e.useRef(null),c=e.useRef(!1),m=a.useId();if(e.useEffect(()=>{l&&c.current&&s.current?.focus()},[l]),e.useEffect(()=>{c.current=!0},[]),"divider"===n.type)return e.createElement("div",{className:"maxio-action-list__divider",role:"separator","aria-hidden":"true"});const{leadingIconName:d,leadingIconClassName:u,trailingIconName:p,label:x,description:g,link:b}=n,f=t("maxio-action-list__label",{"maxio-truncate":r});return e.createElement("a",h({"aria-labelledby":m},b,{className:t("maxio-action-list__content",b.className,{"maxio-action-list__content--size-small":o}),tabIndex:l?0:-1,ref:s,role:i}),d&&e.createElement(w,{variant:d,className:t("maxio-action-list__leading-icon",u)}),e.createElement("span",{className:f,id:m},x),g&&e.createElement("span",{className:"maxio-action-list__description"},g),p&&e.createElement(w,{variant:p,className:"maxio-action-list__trailing-icon"}))},y=(e,t,a)=>0===e?e:1===e&&"divider"===t[e-1].type?a||e:"divider"===t[e-1].type?y(e-1,t,a||e):e-1,C=({items:a,isShadowed:n=!0,itemProps:l={},className:r,truncateLabels:i=!1,small:o=!1,...s})=>{const c=t("maxio-action-list",r,{"maxio-action-list--shadow":n}),[m,d]=e.useState(()=>a.findIndex(e=>"divider"!==e.type));return 0===a.length?null:e.createElement("div",h({className:c,onKeyDown:e=>{if("Space"===e.code||"Enter"===e.code){const e=a[m];e&&"divider"!==e.type&&window.open(e.link.href,e.link.target||"_self")}"ArrowUp"===e.code&&(e.preventDefault(),d(e=>y(e,a))),"ArrowDown"===e.code&&(e.preventDefault(),d(e=>((e,t)=>{const a=t.findIndex((t,a)=>"divider"!==t.type&&a>e);return-1===a?e:a})(e,a)))},role:"listbox"},s),a.map((t,a)=>e.createElement(N,h({item:t,truncateLabel:i,key:`listbox-${t.id}`,isSelected:a===m,small:o},l))))},I=({className:a,children:n,disabled:l,external:r,icon:i,size:o="sm",underline:s,variant:c,...m})=>{const d=t("maxio-link",{[`maxio-link--${o}`]:o,"maxio-link--disabled":l,[`maxio-link--${c}`]:c,"maxio-link--underline":s},a),u=r?"_blank":"_self";return e.createElement("a",h({className:d,target:u},m),n,i&&e.createElement(w,{variant:i,className:"maxio-link__icon"}))},R=({size:a="md",white:n=!1,className:l})=>{const r=t("maxio-loading-spinner",l,`maxio-loading-spinner--${a}`,{"maxio-loading-spinner--white":n});return e.createElement("div",{className:r,role:"status","aria-label":"loading"})},k=e.forwardRef(({fullWidth:l=!1,leadingElement:r,trailingElement:i,icon:o,variant:s="primary",size:c,...m},d)=>{const u=n.useObjectRef(d),{linkProps:p}=a.useLink({...m},u),x=t("maxio-button",m.className,{[`maxio-button--${c}`]:c,[`maxio-button--${s}`]:s,"maxio-button--full-width":l});return e.createElement("a",h({},p,{ref:u,className:x,href:m.href}),r&&e.cloneElement(r,{...e.isValidElement(r)&&{className:"maxio-button__leading-element"}}),m.children,(i||o)&&e.cloneElement(i||o,{...e.isValidElement(i||o)&&{className:"maxio-button__trailing-element"}}))}),S=e.forwardRef(({disabled:l,loading:r=!1,fullWidth:i=!1,leadingElement:o,trailingElement:s,icon:c,variant:m="primary",size:d,...u},p)=>{const x=n.useObjectRef(p),{buttonProps:g}=a.useButton({...u,isDisabled:l,formAction:"string"==typeof u.formAction?u.formAction:void 0},x),b=["primary","danger"].includes(m),f=t("maxio-button",u.className,{[`maxio-button--${d}`]:d,[`maxio-button--${m}`]:m,"maxio-button--loading":r,"maxio-button--full-width":i});return e.createElement("button",h({},g,{className:f,ref:x}),o&&e.cloneElement(o,{...e.isValidElement(o)&&{className:"maxio-button__leading-element"}}),u.children,!r&&(s||c)&&e.cloneElement(s||c,{...e.isValidElement(s||c)&&{className:"maxio-button__trailing-element"}}),r&&e.createElement(R,{className:"maxio-button__trailing-element",size:"md",white:b}))}),P=e.forwardRef((t,a)=>(e=>"href"in e)(t)?e.createElement(k,h({},t,{ref:a})):e.createElement(S,h({},t,{ref:a}))),T=({"aria-label":a,className:n,...l})=>e.createElement(P,h({"aria-label":a,className:t("maxio-button--icon",n)},l),null),D=({children:a,title:n,linkText:l,linkExternal:r,href:i,display:o="inline",sentiment:s="info",onDismiss:c,className:m})=>{if(!a&&!n)return console.warn("Alert component requires either children or title prop to be rendered"),null;const d=t("maxio-alert",{[`maxio-alert--${s}`]:"info"!==s&&s},m),u={success:"check-circle-fill",warning:"warning-circle-fill",danger:"error-fill",info:"info-circle-fill"}[s],p=t("maxio-alert__content",{"maxio-alert__content--block":"block"===o});return e.createElement("div",{className:d},e.createElement(w,{variant:u,className:"maxio-alert__icon","aria-hidden":"true"}),e.createElement("section",{className:"maxio-alert__container"},e.createElement("div",{className:p},n&&e.createElement("span",{className:"maxio-alert__title"},n),a&&e.createElement("span",{className:"maxio-alert__message"},a),l&&i&&e.createElement(I,h({className:"maxio-alert__link",href:i,variant:"high-contrast",underline:!0},r?{external:!0}:{}),l))),c&&e.createElement(T,{icon:e.createElement(w,{variant:"cross"}),"aria-label":"Dismiss Notification",variant:"ghost",onClick:c,className:"maxio-alert__dismiss"}))},M=e.createContext({}),O=({children:t})=>{const[a,n]=e.useState(!1),l=e.useId(),r=e.useId();return e.createElement(M.Provider,{value:{controlsId:l,buttonId:r,isOpen:a,onClose:()=>n(!1),onOpen:()=>n(!0),onToggle:()=>n(e=>!e)}},t)};function $(){const t=e.useContext(M);if(!t||"object"==typeof t&&0===Object.keys(t).length)throw new Error("useMenu hook must be used within a MenuProvider");return t}const L=({children:t})=>{const{isOpen:a,onToggle:n,onClose:l}=$();return e.createElement("details",{open:a,onToggle:n,className:"maxio-action-menu"},"function"==typeof t?t({isOpen:a,onClose:l}):t)},B=({children:a,className:n,href:l,...r})=>{const i=l?e.createElement(I,{size:"sm",href:l},a):a;return e.createElement("li",h({className:t("maxio-breadcrumbs__item",n)},r),i)},z="Breadcrumbs requires at least one BreadcrumbsItem as children",A='Last BreadcrumbsItem should not have "href" prop. It is the current page.',F="Breadcrumbs only accepts BreadcrumbsItem as children",V=({children:a,arrowPosition:n,size:l="regular",maxWidth:r=160})=>e.createElement("div",{"data-testid":"tooltip",className:t("maxio-tooltip",`maxio-tooltip--${l}`,{[`maxio-tooltip--arrow-${n}`]:n})},e.createElement("div",{className:"maxio-tooltip__content",style:{maxWidth:r}},a)),H={click:s.useClick,hover:e=>s.useHover(e,{delay:100}),focus:s.useFocus,dismiss:s.useDismiss},W=(e,t)=>t.map(t=>H[t](e)),j=({placement:t="top",isActive:a=!1,interactions:n=["hover"],floatingElementOffset:l=0,onOverlayUpdate:r,autoHideMs:i})=>{const o=e.useRef(null),{strategy:c,x:m,y:d,context:u,floating:p,reference:x}=s.useFloating({placement:t,open:a,onOpenChange:e=>r(e),middleware:[s.offset(l)],whileElementsMounted:s.autoUpdate}),{getReferenceProps:g,getFloatingProps:b}=s.useInteractions([...W(u,n),s.useRole(u,{role:"tooltip"})]);e.useEffect(()=>{o.current&&clearTimeout(o.current),a&&i&&(o.current=window.setTimeout(()=>r(!1),i))},[a,i]);return{isActive:a,refs:{floating:p,reference:x},floatingElementCSSPosition:{position:c,top:d??0,left:m??0},getReferenceProps:g,getFloatingProps:b}};function q(t,a=0){const n=e.useRef((new Date).getTime()),l=e.useRef((new Date).getTime()),[r,i]=e.useState(!1);return e.useEffect(()=>{const e=()=>{n.current=(new Date).getTime(),i(!0)},r=()=>{l.current=(new Date).getTime(),window.setTimeout(()=>{n.current-l.current<=0&&i(!1)},a)},o=t&&t.current;return o&&(o.addEventListener("mouseenter",e),o.addEventListener("mouseleave",r)),()=>{o&&(o.removeEventListener("mouseenter",e),o.removeEventListener("mouseleave",r))}},[t]),r}function G(t=500){const[a,n]=e.useState(()=>{if("undefined"==typeof window)return{windowWitdh:0,windowHeight:0};const{innerWidth:e,innerHeight:t}=window;return{windowWitdh:e,windowHeight:t}}),l=e.useRef(null);return e.useEffect(()=>{if("undefined"==typeof window)return;const e=()=>{const{innerWidth:e,innerHeight:a}=window;window.clearTimeout(l.current??void 0),l.current=window.setTimeout(()=>{n({windowWitdh:e,windowHeight:a})},t)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[t]),a}function U(t){const[a,l]=e.useState(()=>t.current?.clientWidth??0),r=()=>{const e=t.current?.clientWidth??0;l(t=>0===e&&t>0?t:e)};return e.useLayoutEffect(r,[t]),n.useResizeObserver({ref:t,onResize:r}),a}const K=({children:a,usePortal:n=!1,isActive:l=!1,placement:r="top",interactions:i=["hover"],role:c="tooltip",renderOverlay:m,floatingElementOffset:d,motionSettings:u={},autoHideMs:p,onOverlayUpdate:x,className:g})=>{const{getReferenceProps:b,getFloatingProps:f,refs:{floating:E,reference:v},floatingElementCSSPosition:_}=j({isActive:l,onOverlayUpdate:x,autoHideMs:p,floatingElementOffset:d,interactions:i,placement:r}),w=e.createElement(o.AnimatePresence,null,l&&e.createElement(o.motion.div,h({ref:E,style:_},u,f()),m()));return e.createElement(e.Fragment,null,e.createElement("div",h({ref:v,className:t("maxio-inline-flex",g)},b(),{"data-testid":"overlay-trigger"}),a),n?e.createElement(s.FloatingPortal,{id:"maxio-ui-portal"},w):w)},Z={top:"bottom",right:"left",bottom:"top",left:"right","top-start":"bottom-left","top-end":"bottom-right","right-start":"left-top","right-end":"left-bottom","bottom-start":"top-left","bottom-end":"top-right","left-start":"right-top","left-end":"right-bottom"},Y=({children:t,interactions:a=["hover"],placement:n="right",maxWidth:l=160,size:r="regular",renderContent:i,autoHideMs:o,isVisible:s,usePortal:c,className:m,onVisibilityUpdate:d,floatingElementOffset:u=5})=>{const[p,x]=e.useState(!1),g=void 0!==s,b=e.useRef(null),f=e.useCallback(e=>{b.current&&clearTimeout(b.current),b.current=window.setTimeout(()=>{g||x(e),d&&d(e)},50)},[g,d]),h=e.useMemo(()=>(e=>{const t=e.startsWith("top")||e.startsWith("bottom")?"Y":"X",a=`translate${t}(${e.startsWith("bottom")||e.startsWith("right")?"-":""}10px)`;return{initial:{opacity:0,visibility:"hidden",transform:a},animate:{opacity:1,visibility:"visible",transform:`translate${t}(0px)`},exit:{opacity:0,visibility:"hidden",transform:a},transition:{ease:[.4,0,.5,1],duration:.2}}})(n),[n]);return e.useEffect(()=>()=>{b.current&&clearTimeout(b.current)},[]),e.createElement(K,{role:"tooltip",className:m,floatingElementOffset:u,motionSettings:h,isActive:g?s:p,onOverlayUpdate:f,autoHideMs:o,usePortal:c,placement:n,interactions:a,renderOverlay:()=>e.createElement(V,{size:r,arrowPosition:Z[n],maxWidth:l},i())},t)},Q="maxio-copy-to-clipboard--subtle",X="maxio-copy-to-clipboard--xs",J={idle:"copy-file",copied:"check",error:"error"},ee="row-controls",te="row-actions",ae=({children:a,pattern:n,size:l,isExpandable:r,isUsingCustomRow:i})=>{const[o,s]=e.useState(!1),[c,m]=e.useState(!1),d=n&&i&&r,u=t("maxio-data-table",{"maxio-data-table--pattern":n&&!d,"maxio-data-table--expanded-child-pattern":d,"maxio-data-table--with-custom-row":i,[`maxio-data-table--${l}`]:l,"maxio-data-table--with-pinned-left-border":o,"maxio-data-table--with-pinned-right-border":c});return e.createElement("div",{className:"maxio-data-table-wrapper",onScroll:e=>{const t=e.target;s(t.scrollLeft>0),m(t.scrollWidth-t.clientWidth-t.scrollLeft>0)}},e.createElement("table",{className:u},a))},ne=({children:t})=>e.createElement("thead",null,t),le=({children:t})=>e.createElement("tbody",null,t),re=({children:a,table:n,header:l,className:r,enableExpanding:i,...o})=>{const s=l?.column,c=s?.getCanSort?.(),m=s?.getToggleSortingHandler?.(),d=l?.isPlaceholder,u=s?.columnDef?.meta?.align,p=s?.columnDef?.meta?.width,x=s?.columnDef?.meta?.controls,g=s?.columnDef?.meta?.actions,b=s?.getIsPinned(),f=s?.getIsSorted(),E="asc"===f,v=t("maxio-data-table__cell",r,{[`maxio-data-table__cell--pinned-${b}`]:b,"maxio-data-table__cell--sortable":c,"maxio-data-table__cell--active":f,[`maxio-data-table__cell--${u}`]:u,"maxio-data-table__cell--controls":x,"maxio-data-table__cell--actions":g}),_={...p?{width:p}:{},..."left"===b?{left:s?.getStart("left")}:"right"===b?{right:s?.getAfter("right")}:{}},N=((e,t)=>e&&t?"arrow-up":e&&!t?"arrow-down":"arrow-down-up")(!!f,E),y=n?.getToggleAllRowsExpandedHandler(),C=n?.getIsAllRowsExpanded?.(),I=l?.headerGroup.headers[0].id===ee?1:0,R=i&&l?.index===I;return d?null:e.createElement("th",h({scope:"col",role:"columnheader","aria-sort":f?E?"ascending":"descending":"none",className:v,onClick:m,colSpan:l?.colSpan,style:_},o),e.createElement("div",{className:"maxio-data-table__cell-flex"},!0===i&&R&&e.createElement(T,{size:"sm",variant:"ghost",icon:e.createElement(w,{size:"xs",variant:C?"chevron-down":"chevron-right"}),onClick:y,"aria-label":C?"Collapse all rows":"Expand all rows","data-open":C,className:"maxio-data-table__expand-button"}),a,c&&e.createElement(w,{variant:N,className:"maxio-data-table__sort-icon"})))},ie=e=>e.subRows??[],oe=(e,t)=>Object.assign({},e,{subRows:t}),se=(e,t,a=[])=>{for(let n=0;n<e.length;n+=1){const l=e[n],r=[...a,n];if(l===t)return r;const i=se(ie(l),t,r);if(i)return i}return null},ce=(e,t)=>{const[a,...n]=t,l=e[a];if(!l)return null;const r=[...e];if(0===n.length)return r.splice(a,1),{data:r,item:l};const i=ce(ie(l),n);return i?(r[a]=oe(l,i.data),{data:r,item:i.item}):null},me=(e,t,a,n)=>{const l=[...e];if(0===t.length)return l.splice(a,0,n),l;const[r,...i]=t,o=e[r];if(!o)return null;const s=me(ie(o),i,a,n);return s?(l[r]=oe(o,s),l):null},de=(e,t)=>{let a,n=e;for(const e of t){if(a=n[e],!a)return;n=ie(a)}return a},ue="maxio-data-table-row",pe=e.createContext(null),xe=()=>e.useContext(pe),ge=e=>e.type===ue&&"string"==typeof e.instanceId&&"string"==typeof e.rowId,be=e=>{const t=(e=>{const t=d.extractInstruction(e);return t&&"instruction-blocked"!==t.type?"reorder-above"===t.type?"before":"reorder-below"===t.type?"after":"make-child"===t.type?"inside":null:null})(e);return"string"==typeof e.rowId&&t?{rowId:e.rowId,position:t}:null},fe=({availability:t,children:a,data:n,enableExpanding:l,getRowReorderLabel:r,onRowReorder:i,rowReorderMode:o,table:s})=>{const c=`maxio-data-table-${e.useId()}`,[u,p]=e.useState(""),[x,g]=e.useState(null),[b,f]=e.useState(null),h=e.useRef(null),E=e.useCallback(e=>s.getCoreRowModel().rowsById[e],[s]),v=e.useCallback(e=>r?.(e)??e.id,[r]),_=e.useCallback((e,t)=>{const a=E(e),r=E(t.rowId);if(!a||!r)return null;const i=((e,t,a,n,l)=>{if(t.id===a.id||!((e,t,a,n)=>"all"===n||("siblings"===n?"inside"!==a&&(e.parentId??null)===(t.parentId??null):"inside"===a?e.depth===t.depth+1:e.depth===t.depth))(t,a,n,l))return null;const r=se(e,t.original),i=se(e,a.original);if(!r||!i||(s=i,(o=r).length<s.length&&o.every((e,t)=>s[t]===e)))return null;var o,s;const c=ce(e,r);if(!c)return null;const m=((e,t)=>{const a=[...e],n=t.length-1;return n>=0&&e.length>n&&t.slice(0,n).every((t,a)=>e[a]===t)&&t[n]<e[n]&&(a[n]-=1),a})(i,r),d=m[m.length-1];if(void 0===d)return null;const u="inside"===n?m:m.slice(0,-1),p=de(c.data,m);if(!p)return null;const x="inside"===n?ie(p).length:d+("after"===n?1:0),g={parentRowId:"inside"===n?a.id:a.parentId??null,index:x},b={parentRowId:t.parentId??null,index:t.index};if(b.parentRowId===g.parentRowId&&b.index===g.index)return null;const f=me(c.data,u,x,c.item);return f?{data:f,source:b,destination:g}:null})(n,a,r,t.position,o);return i&&!l&&null!==i.destination.parentRowId&&i.destination.parentRowId!==i.source.parentRowId?null:i},[n,l,E,o]),w=e.useCallback(e=>{h.current=e,g(e)},[]),N=e.useCallback((e,t)=>{const a=E(e),n=E(t.rowId),l=_(e,t);return a&&n&&l?(i({...l,row:a,rowId:a.id,targetRow:n,targetRowId:n.id,position:t.position}),p(`${v(a)} moved ${r=v(n),o=t.position,"inside"===o?`inside ${r}`:`${o} ${r}`}.`),!0):(p("That row cannot be moved to this position."),!1);var r,o},[v,_,E,i]),y=e.useCallback((e,{input:t,element:a,source:n})=>{const l={rowId:e.id,instanceId:c},r=d.attachInstruction(l,{element:a,input:t,currentLevel:e.depth,indentPerLevel:24,mode:"standard"}),i=be(r),o=ge(n.data)&&n.data.instanceId===c&&Boolean(i&&_(n.data.rowId,i));return{...r,isValid:o}},[_,c]),C=e.useCallback((e,a)=>{if(!t.available)return()=>{};const n=e=>{const t=e.isValid?be(e):null;w(t)};return m.dropTargetForElements({element:a,canDrop:({source:t})=>ge(t.data)&&t.data.instanceId===c&&t.data.rowId!==e.id&&!e.getParentRows().some(e=>e.id===t.data.rowId),getData:t=>y(e,t),onDragEnter:({self:e})=>n(e.data),onDrag:({self:e})=>n(e.data),onDragLeave:()=>{h.current?.rowId===e.id&&w(null)}})},[t,y,c,w]),I=e.useCallback((e,a)=>{const n=a.closest("tr");return t.available&&n instanceof HTMLElement?m.draggable({element:n,dragHandle:a,getInitialData:()=>({type:ue,instanceId:c,rowId:e.id})}):()=>{}},[t,c]);e.useEffect(()=>{if(t.available)return m.monitorForElements({canMonitor:({source:e})=>ge(e.data)&&e.data.instanceId===c,onDragStart:({source:e})=>{if(!ge(e.data))return;const t=E(e.data.rowId);f(e.data.rowId),t&&p(`${v(t)} grabbed. Choose a destination.`)},onDrop:({source:e,location:t})=>{if(ge(e.data)){const a=t.current.dropTargets[0]?.data,n=!0===a?.isValid?be(a):null;n?N(e.data.rowId,n):p("Row move cancelled.")}f(null),w(null)}})},[N,t,v,E,c,w]),e.useEffect(()=>{if("inside"!==x?.position)return;const e=E(x.rowId);if(!e?.getCanExpand()||e.getIsExpanded())return;const t=window.setTimeout(()=>e.toggleExpanded(!0),500);return()=>window.clearTimeout(t)},[x,E]);const R=e.useCallback(e=>{if(!t.available)return[];const a=e.parentId?E(e.parentId):null,n=a?.subRows??s.getCoreRowModel().rows,l=n.findIndex(t=>t.id===e.id);if(-1===l)return[];const r=n[l-1],i=n[l+1],o=n[0],c=n[n.length-1],m=[];if(l>1&&o&&m.push({id:"top",label:"Move to top",target:{rowId:o.id,position:"before"}}),r&&m.push({id:"up",label:"Move up",target:{rowId:r.id,position:"before"}}),i&&m.push({id:"down",label:"Move down",target:{rowId:i.id,position:"after"}}),l<n.length-2&&c&&m.push({id:"bottom",label:"Move to bottom",target:{rowId:c.id,position:"after"}}),a){let e=a;for(;e.parentId;){const t=E(e.parentId);if(!t)break;e=t}m.push({id:"move-to-root",label:"Move to root",target:{rowId:e.id,position:"after"}})}return s.getCoreRowModel().flatRows.forEach(t=>{t.id!==e.parentId&&m.push({id:`move-to:${t.id}`,label:`Move to ${v(t)}`,target:{rowId:t.id,position:"inside"}})}),m.filter(t=>Boolean(_(e.id,t.target)))},[t,v,_,E,s]),k=e.useCallback(e=>{if(!t.available)return!1;const a=e.parentId?E(e.parentId):null;return(a?.subRows??s.getCoreRowModel().rows).length>1||"siblings"!==o&&("all"===o?Boolean(a):!(!l||0===e.depth)&&s.getCoreRowModel().flatRows.some(t=>t.depth===e.depth-1&&t.id!==e.parentId))},[t,l,E,o,s]),S=e.useMemo(()=>({activeTarget:x,availability:t,draggingRowId:b,getActions:R,getLabel:v,hasActions:k,moveRow:N,registerHandle:I,registerRow:C}),[x,t,N,b,R,v,k,I,C]);return e.createElement(pe.Provider,{value:S},a,e.createElement("span",{className:"maxio-data-table__live-region",role:"status","aria-live":"polite","aria-atomic":"true"},u))},he=({children:n,row:l,isChild:r,isHeader:i,className:o,onRowAction:s,...c})=>{const m=l?.getIsSelected?.(),d=l?.getCanExpand?.()&&l?.getIsExpanded?.(),u=Boolean(l&&s&&!i&&!r),p=e.useRef(null),x=xe(),g=x?.registerRow,b=e.useRef(null),f=e=>{b.current=e.target},{pressProps:E}=a.usePress({isDisabled:!u,onPress:e=>{const t=b.current??e.target;b.current=null,l&&s&&!(e=>e instanceof Element&&Boolean(e.closest("a,button,input,select,textarea,label,.maxio-data-table__cell--controls,.maxio-data-table__cell--actions")))(t)&&s(l)}}),{focusProps:v,isFocused:_}=a.useFocusRing(),w=t({"maxio-data-table__row":!i,"maxio-data-table__header-row":i,"maxio-data-table__row--active":m||_,"maxio-data-table__row--expanded":d,"maxio-data-table__row--expanded-child":r,"maxio-data-table__row--actionable":u,"maxio-data-table__row--dragging":Boolean(l)&&x?.draggingRowId===l?.id,[`maxio-data-table__row--drop-${x?.activeTarget?.position}`]:Boolean(l)&&x?.activeTarget?.rowId===l?.id},o);e.useEffect(()=>{if(l&&g&&p.current&&!i&&!r)return g(l,p.current)},[r,i,g,l]);const N=u?a.mergeProps({onClickCapture:f,onKeyDownCapture:f,tabIndex:0},E,v,c):c;return e.createElement("tr",h({},N,{ref:p,className:w,tabIndex:u?N.tabIndex:c.tabIndex}),n)},Ee=e.createContext({}),ve=e.forwardRef(({checked:a,disabled:n,invalid:l,indeterminate:r,className:i,inputProps:o,error:s,label:c},m)=>{const d=t("maxio-checkbox",{"maxio-checkbox--checked":a,"maxio-checkbox--disabled":n,"maxio-checkbox--error":l,"maxio-checkbox--indeterminate":r},i);return e.createElement("label",{className:d},e.createElement("input",h({type:"checkbox",role:"checkbox",className:"maxio-checkbox__input",ref:m},o)),e.createElement("span",{className:"maxio-checkbox__control"},s&&e.createElement("span",{className:"maxio-checkbox__control-error"})),c&&e.createElement("span",{className:"maxio-checkbox__label"},c))});ve.displayName="InnerCheckbox";const _e=({label:t,error:n=!1,className:l,indeterminate:i,value:o="",disabled:s,readOnly:c,defaultChecked:m,checked:d,...u})=>{const p=e.useRef(null),x=e.useContext(Ee),{inputProps:g,isDisabled:b,isInvalid:f,isSelected:E}=x&&Object.keys(x).length>0?a.useCheckboxGroupItem({value:o,"aria-label":t??u["aria-label"],isDisabled:s,isInvalid:n,isIndeterminate:i,isReadOnly:c,...u},x,p):a.useCheckbox({"aria-label":t??u["aria-label"],isDisabled:s,isInvalid:n,isIndeterminate:i,isReadOnly:c,value:o,...u},r.useToggleState({...u,isSelected:d,defaultSelected:m}),p);return e.createElement(ve,h({inputProps:g,checked:E,disabled:b,invalid:f,indeterminate:i,className:l,error:n,label:t,ref:p},u))},we=({children:a,className:n,...l})=>e.createElement("div",h({className:t("maxio-form-helper-text",n)},l),a),Ne=({children:a,className:n,...l})=>e.createElement("div",h({className:t("maxio-form-error",n)},l),e.createElement(w,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),e.createElement("div",{className:"maxio-form-error__text"},a)),ye=({table:t,enableRowSelection:a,enableRowReordering:n})=>{const l=t?.getToggleAllPageRowsSelectedHandler?.(),r=t?.getIsAllPageRowsSelected?.()||t?.getIsAllRowsSelected?.(),i=t?.getIsSomePageRowsSelected?.();return a?e.createElement(e.Fragment,null,n&&e.createElement("span",{className:"maxio-button maxio-button--sm maxio-button--ghost maxio-button--icon","aria-hidden":"true",style:{visibility:"hidden"}}),e.createElement(_e,{"aria-label":"Select all rows",onChange:e=>{l("boolean"==typeof e?{target:{checked:e}}:e)},checked:r,indeterminate:!r&&i})):null},Ce=({className:a,hideArrow:n=!1,children:r,offset:i=4,...o})=>e.createElement(l.Popover,h({},o,{className:t("maxio-popover",a),offset:i}),e.createElement(e.Fragment,null,!n&&e.createElement(l.OverlayArrow,{className:"maxio-popover__arrow"},e.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12","aria-hidden":!0},e.createElement("path",{d:"M0 0 L6 6 L12 0"}))),r)),Ie=({row:t})=>{const a=xe(),n=a?.registerHandle,r=a?.getActions,i=a?.hasActions,o=e.useRef(null),[s,c]=e.useState(!1),m=a?.draggingRowId===t.id,d=a?.getLabel(t)??t.id,u=e.useMemo(()=>i?.(t)??!1,[i,t]),p=e.useMemo(()=>s?r?.(t)??[]:[],[r,s,t]),x=(a&&!a.availability.available?a.availability.message:void 0)??(u?void 0:`No moves are available for ${d}.`);e.useEffect(()=>{if(n&&o.current&&!x)return n(t,o.current)},[n,t,x]),e.useEffect(()=>{x&&c(!1)},[x]);const g=e.createElement(l.Button,{ref:o,type:"button",className:"maxio-button maxio-button--sm maxio-button--ghost maxio-button--icon maxio-data-table__drag-handle","aria-label":`Reorder ${d}`,"aria-pressed":m,"aria-disabled":!!x||void 0,onPress:()=>{x||c(!0)}},e.createElement("i",{className:"fa-sharp fa-solid fa-grip-dots-vertical "+(x?"maxio-icon--disabled":"maxio-icon--secondary")}));return x?e.createElement(l.TooltipTrigger,{delay:0,closeDelay:0},g,e.createElement(l.Tooltip,{placement:"bottom start",offset:8,className:"maxio-tooltip maxio-tooltip--arrow-top-left"},e.createElement("div",{className:"maxio-tooltip__content"},x))):e.createElement(l.MenuTrigger,{trigger:"longPress",isOpen:s,onOpenChange:c},g,e.createElement(Ce,{placement:"bottom start",hideArrow:!0},e.createElement(l.Menu,{autoFocus:"first",className:"maxio-data-table__reorder-menu",items:p,onAction:e=>{const n=p.find(t=>t.id===e);n&&(a?.moveRow(t.id,n.target),requestAnimationFrame(()=>o.current?.focus()))}},t=>e.createElement(l.MenuItem,{id:t.id,textValue:t.label,className:"maxio-data-table__reorder-menu-item"},t.label))))},Re=({row:t,enableRowSelection:a,enableRowReordering:n})=>{const l=t?.getToggleSelectedHandler?.(),r=t?.getIsSelected?.()||t?.getIsAllSubRowsSelected?.(),i=t?.getIsSomeSelected?.(),o=t.id||t.index;return e.createElement(e.Fragment,null,n&&e.createElement(Ie,{row:t}),a&&e.createElement(_e,{"aria-label":`Select row ${o}`,onChange:l,checked:r,indeterminate:i}))},ke=({children:t})=>e.createElement("div",{className:"maxio-data-table__cell-flex"},t),Se=({row:a,cell:n,children:l,className:r,...i})=>{const o=n?.column,s=o?.columnDef?.meta?.align,c=o?.columnDef?.meta?.controls,m=o?.columnDef?.meta?.actions,d=o?.getIsPinned(),u=t("maxio-data-table__cell",r,{[`maxio-data-table__cell--pinned-${d}`]:d,[`maxio-data-table__cell--${s}`]:s,"maxio-data-table__cell--controls":c,"maxio-data-table__cell--actions":m}),p="left"===d?{left:o?.getStart("left")}:"right"===d?{right:o?.getAfter("right")}:{};return e.createElement("td",h({className:u,style:p},i),l)},Pe=({row:t,SubRowComponent:a,pattern:n,enableExpanding:l,onRowAction:r})=>{const i=a&&t.getParentRow()&&t.getParentRow().getIsExpanded(),o=i&&t.getVisibleCells()[0].column.columnDef.id===ee,s=i&&t.getVisibleCells()[t.getVisibleCells().length-1].column.columnDef.id===te,m=[s,o].filter(Boolean).length,d=t.getVisibleCells().length-m,u=t.getParentRow()?.index??t.index,p=n&&a&&u%2==1?"maxio-data-table__row--with-pattern":void 0,x=t.getCanExpand?.(),g=t?.getToggleExpandedHandler?.(),b=t?.getIsExpanded?.(),f=x&&l?0:1.75,h=t.getVisibleCells()[0].column.columnDef.id===ee?1:0,E=t.getVisibleCells().find(({column:e})=>{const{actions:t,controls:a}=e.columnDef.meta??{};return!t&&!a}),v=r&&E?E.id:void 0;return e.createElement(e.Fragment,{key:t.id},i?e.createElement(he,{key:`${t.id}-sub`,row:t,isChild:!0,className:p},o&&e.createElement(Se,{className:"maxio-data-table__cell--pinned-left"}),e.createElement(Se,{colSpan:d},a(t)),s&&e.createElement(Se,{className:"maxio-data-table__cell--pinned-right"})):e.createElement(he,{key:`${t.id}-parent`,row:t,className:p,onRowAction:r,"aria-labelledby":v},t.getVisibleCells().map(a=>{const n=l&&a.column.getIndex()===h;return e.createElement(Se,{key:a.id,row:t,cell:a,id:a.id},e.createElement("div",{className:"maxio-data-table__cell-flex",style:l&&n?{paddingLeft:`${t?.depth+f}rem`}:void 0},l&&x&&n&&e.createElement(T,{size:"sm",variant:"ghost",icon:e.createElement(w,{size:"xs",variant:b?"chevron-down":"chevron-right"}),onClick:g,"aria-label":b?"Collapse row":"Expand row","data-open":b,className:"maxio-data-table__expand-button"}),c.flexRender(a.column.columnDef.cell,a.getContext())))})))},Te={available:!0},De={available:!1,reason:"filtering",message:"Reordering is unavailable while the table is filtered."},Me={available:!1,reason:"grouping",message:"Reordering is unavailable while the table is grouped."},Oe={available:!1,reason:"pagination",message:"Reordering is unavailable while the table is paginated."},$e=(e=[])=>e.filter(e=>e!==ee&&e!==te),Le=[],Be=e=>e.subRows,ze={sm:"h3",md:"h2",lg:"h1"},Ae=({children:a,size:n="sm",className:l,...r})=>{const i=ze[n],o=t(`maxio-heading-${n}`,l);return e.createElement(i,h({className:o},r),a)},Fe=({as:a="div",children:n,compact:l=!1,size:r="md",className:i,...o})=>{const s=a,c=t({[`maxio-body-${r}`]:!l,[`maxio-body-${r}-compact`]:l},i);return e.createElement(s,h({className:c},o),n)},Ve=({basis:a,flex:n,flexDirection:l,wrap:r,grow:i,shrink:o,gap:s,gapX:c,gapY:m,className:d,children:u,alignItems:p,justifyContent:x,...g})=>{const b=t("maxio-flex",{[`maxio-flex-${n}`]:n,[`maxio-basis-${a}`]:void 0!==a,[`maxio-flex-${l}`]:l,[`maxio-flex-${r}`]:r,"maxio-grow":i,"maxio-grow-0":!1===i,"maxio-shrink":o,"maxio-shrink-0":!1===o,[`maxio-gap-${s}`]:void 0!==s,[`maxio-gap-x-${c}`]:void 0!==c,[`maxio-gap-y-${m}`]:void 0!==m,[`maxio-items-${p}`]:p,[`maxio-justify-${x}`]:x},d);return e.createElement("div",h({className:b},g),u)},He=({className:a,children:n,items:r,render:i,renderEmptyState:o,isLoading:s=!1,onLoadMore:c,scrollOffset:m,showSelectAll:d=!1,...u})=>e.createElement(l.ListBox,h({},u,{items:r,renderEmptyState:s?void 0:o,className:l.composeRenderProps(a,e=>t("maxio-listbox",e)),render:(t,a)=>{const{selectionManager:n}=a.state,l=i?i(t,a):e.createElement("div",t);if("multiple"!==n.selectionMode||!d)return l;if(0===[...n.collection.getKeys()].filter(e=>{const t=n.collection.getItem(e);return"item"===t?.type&&n.canSelectItem(e)}).length)return l;const r=n.isSelectAll,o=r&&n.disallowEmptySelection;return e.createElement("div",null,e.createElement("div",{className:"maxio-listbox__select-all"},e.createElement(P,{type:"button",variant:"ghost",trailingElement:e.createElement(w,{variant:r?"check":""}),fullWidth:!0,"aria-pressed":r,disabled:o,onClick:()=>n.toggleSelectAll()},"Select all")),l)}}),c||s?e.createElement(e.Fragment,null,e.createElement(l.Collection,{items:r,dependencies:u.dependencies},n),e.createElement(l.ListBoxLoadMoreItem,{className:"maxio-listbox__load-more",isLoading:s,onLoadMore:s?void 0:c,scrollOffset:m},e.createElement(R,null))):n);He.displayName="ListBox";const We=({className:a,...n})=>{const r=n.textValue||("string"==typeof n.children?n.children:void 0);return e.createElement(l.ListBoxItem,h({},n,{textValue:r,className:t("maxio-listbox__item",a)}),l.composeRenderProps(n.children,(t,{isSelected:a})=>e.createElement(e.Fragment,null,e.createElement("div",{className:"maxio-listbox__content"},"string"==typeof t?e.createElement(Fe,{size:"sm"},t):t),a&&e.createElement(w,{variant:"check"}))))};We.displayName="ListBox.Item";const je=({className:a,...n})=>e.createElement(l.ListBoxSection,h({},n,{className:t("maxio-listbox__section",a)}));je.displayName="ListBox.Section";const qe=({className:a,...n})=>e.createElement(l.Header,h({},n,{className:t("maxio-listbox__header",a)}));qe.displayName="ListBox.Header";const Ge=Object.assign(He,{Item:We,Section:je,Header:qe}),Ue=({isDisabled:a=!1,isInvalid:n=!1,isReadOnly:r=!1,size:i="md",label:o,description:s,errorMessage:c,leadingElement:m=null,fullWidth:d,className:u,placeholder:p,renderEmptyState:x,isLoading:g=!1,onLoadMore:b,scrollOffset:f,allowsEmptyCollection:E=Boolean(g||b||x),selectionMode:v,children:_,...N})=>{const y=e.useRef(null),C=e.useRef(null),[I,R]=e.useState(),[k,S]=e.useState(0),P=!!c,T=n||P,D=_,M=e.useCallback(()=>{const e=y.current;if(!e)return;const t=C.current,a=t?t.getBoundingClientRect().left-e.getBoundingClientRect().left:0;S(e=>e===-a?e:-a),R(t=>{const a=`${e.offsetWidth}px`;return t?.["--trigger-width"]===a?t:{"--trigger-width":a}})},[]);e.useEffect(()=>{const e=y.current;if(!e)return;if(M(),"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(M);return t.observe(e),()=>t.disconnect()},[M]);const O=t("maxio-text-field",`maxio-text-field--${i}`,{"maxio-text-field--disabled":a,"maxio-text-field--error":T,"maxio-text-field--readonly":r,"maxio-text-field--full-width":d},u);return e.createElement(l.ComboBox,h({},N,{isDisabled:a,isInvalid:T,isReadOnly:r,selectionMode:v,allowsEmptyCollection:E,className:O}),o&&e.createElement(l.Label,{className:"maxio-text-field__label"},o),e.createElement("div",{ref:y,className:"maxio-text-field__items"},m&&e.createElement("div",{className:"maxio-text-field__leading-element"},m),e.createElement(l.Input,{ref:C,className:"maxio-text-field__input",placeholder:p}),e.createElement("div",{className:"maxio-text-field__trailing-element"},e.createElement(l.Button,{className:t("maxio-button","maxio-button--ghost","maxio-button--icon","maxio-button--sm")},e.createElement(w,{variant:"chevron-up-down"})))),s&&!P&&e.createElement(l.Text,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},s),c&&e.createElement(l.FieldError,{className:"maxio-form-error"},t=>e.createElement(e.Fragment,null,e.createElement(w,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),e.createElement("div",{className:"maxio-form-error__text"},"function"==typeof c?c(t):c))),e.createElement(Ce,{hideArrow:!0,className:"maxio-combobox__popover",crossOffset:k,style:I},e.createElement(Ge,{items:N.items??N.defaultItems,renderEmptyState:x,isLoading:g,onLoadMore:b,scrollOffset:f},D)))};Ue.displayName="ComboBox";const Ke=t=>e.createElement(Ge.Item,t);Ke.displayName="ComboBox.Item";const Ze=t=>e.createElement(Ge.Section,t);Ze.displayName="ComboBox.Section";const Ye=t=>e.createElement(Ge.Header,t);Ye.displayName="ComboBox.Header";const Qe=Object.assign(Ue,{Item:Ke,Section:Ze,Header:Ye}),Xe=e.createContext({}),Je=e.forwardRef(({isDisabled:a=!1,isInvalid:n=!1,isReadOnly:r=!1,size:i="md",label:o,description:s,errorMessage:c,leadingElement:m=null,trailingElement:d=null,fullWidth:u,className:p,...x},g)=>{const b=t("maxio-text-field",`maxio-text-field--${i}`,{"maxio-text-field--disabled":a,"maxio-text-field--error":n,"maxio-text-field--readonly":r,"maxio-text-field--full-width":u},p);return e.createElement(l.TextField,h({},x,{isDisabled:a,isReadOnly:r,isInvalid:n,className:b}),o&&e.createElement(l.Label,{className:"maxio-text-field__label"},o),e.createElement("div",{className:"maxio-text-field__items"},m&&e.createElement("div",{className:"maxio-text-field__leading-element"},m),e.createElement(l.Input,{ref:g,className:"maxio-text-field__input"}),d&&e.createElement("div",{className:"maxio-text-field__trailing-element"},d)),s&&!(n&&c)&&e.createElement(l.Text,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},s),c&&e.createElement(l.FieldError,{className:"maxio-form-error"},e.createElement(w,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),e.createElement("div",{className:"maxio-form-error__text"},c)))});Je.displayName="TextField";const et=e.forwardRef(({isDisabled:a=!1,isInvalid:n=!1,isReadOnly:r=!1,size:i="md",label:o,description:s,errorMessage:c,fullWidth:m,className:d,...u},p)=>{const x=t("maxio-text-area",`maxio-text-area--${i}`,{"maxio-text-area--disabled":a,"maxio-text-area--error":n,"maxio-text-area--readonly":r,"maxio-text-area--full-width":m},d);return e.createElement(l.TextField,h({},u,{isDisabled:a,isReadOnly:r,isInvalid:n,className:x}),o&&e.createElement(l.Label,{className:"maxio-form-label"},o),e.createElement(l.TextArea,{ref:p,className:"maxio-text-area__input"}),s&&!(n&&c)&&e.createElement(l.Text,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},s),c&&e.createElement(l.FieldError,{className:"maxio-form-error"},e.createElement(w,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),e.createElement("div",{className:"maxio-form-error__text"},c)))});et.displayName="TextArea";const tt=e.forwardRef(({disabled:n=!1,invalid:l=!1,readOnly:r=!1,size:i="md",label:o,helperText:s,showErrorMessage:c=!0,errorMessage:m,leadingElement:d=null,trailingElement:u=null,fullWidth:p,className:x,...g},b)=>{const f=e.useRef(null);e.useImperativeHandle(b,()=>f.current),e.useEffect(()=>{console.warn("TextInput is deprecated. Please use TextField instead.")},[]);const{spellCheck:E,...v}=g,_={...v,label:o,description:s,errorMessage:m,defaultValue:g.defaultValue?.toString(),value:g.value?.toString(),isDisabled:n,isReadOnly:r,isInvalid:l},{labelProps:w,inputProps:N,descriptionProps:y,errorMessageProps:C}=a.useTextField(_,f),I=t("maxio-text-field",`maxio-text-field--${i}`,{"maxio-text-field--disabled":n,"maxio-text-field--error":l,"maxio-text-field--readonly":r,"maxio-text-field--full-width":p},x),R=l&&m&&c;return e.createElement("div",{className:I},o&&e.createElement("label",h({className:"maxio-text-field__label"},w),o),e.createElement("div",{className:"maxio-text-field__items"},d&&e.createElement("div",{className:"maxio-text-field__leading-element"},d),e.createElement("input",h({ref:f,type:"text",className:"maxio-text-field__input"},N,{spellCheck:E})),u&&e.createElement("div",{className:"maxio-text-field__trailing-element"},u)),s&&!R&&e.createElement("div",h({className:"maxio-form-helper-text"},y),s),R&&e.createElement(Ne,C,m))});tt.displayName="TextInput";const at=({options:n,label:l,size:r="md",inline:i=!1,disabled:o=!1,helperText:s,errorMessage:c,fullWidth:m=!1,...d})=>{const u=t("maxio-select",`maxio-select--${r}`,{"maxio-select--disabled":o,"maxio-select--inline":i,"maxio-select--error":!!c,"maxio-select--full-width":m}),p=a.useId();return e.createElement("div",{className:u},l&&e.createElement("label",{htmlFor:p,className:"maxio-select__label"},l),e.createElement("div",{className:"maxio-select__input-container"},e.createElement("select",h({id:p,className:"maxio-select__input",disabled:o},d),n.map(t=>e.createElement("option",{key:`option-${t.value}`,value:t.value,disabled:t.disabled},t.label))),e.createElement(w,{variant:"chevron-up-down"})),!!c&&e.createElement(Ne,null,c),s&&!c&&e.createElement("div",{className:"maxio-form-helper-text"},s))},nt=({slot:t,displayValue:a})=>{const n=e.createElement(l.DateInput,{slot:t,className:"maxio-date-field__input"},t=>e.createElement(l.DateSegment,{segment:t,className:"maxio-date-field__segment"}));return null==a?n:e.createElement("div",{className:"maxio-date-field__endpoint"},e.createElement("div",{hidden:!0},n),e.createElement("span",{className:"maxio-date-field__endpoint-value"},a))},lt=({className:a,errorMessage:n,...r})=>e.createElement(l.Calendar,h({},r,{visibleDuration:{months:1},className:l.composeRenderProps(a,e=>t("maxio-calendar",e))}),e.createElement("header",{className:"maxio-calendar__header"},e.createElement(l.Heading,{className:"maxio-calendar__heading"}),e.createElement(l.Button,{slot:"previous",className:"maxio-button maxio-button--ghost maxio-button--icon"},e.createElement(w,{variant:"chevron-left"})),e.createElement(l.Button,{slot:"next",className:"maxio-button maxio-button--ghost maxio-button--icon"},e.createElement(w,{variant:"chevron-right"}))),e.createElement(l.CalendarGrid,{className:"maxio-calendar__grid"},e.createElement(l.CalendarGridHeader,null,t=>e.createElement(l.CalendarHeaderCell,{className:"maxio-calendar__weekday"},t)),e.createElement(l.CalendarGridBody,null,t=>e.createElement(l.CalendarCell,{date:t,className:"maxio-calendar__cell"}))),n&&e.createElement(l.Text,{slot:"errorMessage",className:"maxio-calendar__error"},n)),rt=({presets:t,label:a="Presets",isDisabled:n,isPresetDisabled:r,onSelect:i})=>t?.length?e.createElement(l.Group,{"aria-label":a,className:"maxio-date-field__presets"},t.map((t,a)=>e.createElement(l.Button,{key:a,className:"maxio-button maxio-button--ghost",isDisabled:n||t.isDisabled||null!==t.value&&r(t.value),onPress:()=>i(t.value)},t.label))):null,it=(e,t)=>!!(t.minValue&&e.compare(t.minValue)<0||t.maxValue&&e.compare(t.maxValue)>0||t.isDateUnavailable?.(e)),ot=({className:a,errorMessage:n,...r})=>{const{direction:i}=l.useLocale();return e.createElement(l.RangeCalendar,h({},r,{visibleDuration:{months:1},className:l.composeRenderProps(a,e=>t("maxio-calendar","maxio-calendar--range",e))}),e.createElement("header",{className:"maxio-calendar__header"},e.createElement(l.Heading,{className:"maxio-calendar__heading"}),e.createElement(l.Button,{slot:"previous",className:"maxio-button maxio-button--ghost maxio-button--icon"},e.createElement(w,{variant:"rtl"===i?"chevron-right":"chevron-left"})),e.createElement(l.Button,{slot:"next",className:"maxio-button maxio-button--ghost maxio-button--icon"},e.createElement(w,{variant:"rtl"===i?"chevron-left":"chevron-right"}))),e.createElement(l.CalendarGrid,{className:"maxio-calendar__grid"},e.createElement(l.CalendarGridHeader,null,t=>e.createElement(l.CalendarHeaderCell,{className:"maxio-calendar__weekday"},t)),e.createElement(l.CalendarGridBody,null,t=>e.createElement(l.CalendarCell,{date:t,className:"maxio-calendar__cell"}))),n&&e.createElement(l.Text,{slot:"errorMessage",className:"maxio-calendar__error"},n))},st=(e,t)=>null==e?null==t:null!=t&&0===e.compare(t),ct=({className:a,size:n="md",fullWidth:r=!1,selectionMode:i="single",orientation:o="horizontal",disallowEmptySelection:s=!0,...c})=>e.createElement(l.ToggleButtonGroup,h({},c,{selectionMode:i,orientation:o,disallowEmptySelection:s,className:l.composeRenderProps(a,e=>t("maxio-segmented-control",`maxio-segmented-control--${n}`,{"maxio-segmented-control--full-width":r},e))}));ct.displayName="SegmentedControl";const mt=({className:a,children:n,...r})=>e.createElement(l.ToggleButton,h({},r,{className:l.composeRenderProps(a,e=>t("maxio-segmented-control__item",e))}),l.composeRenderProps(n,t=>e.createElement(e.Fragment,null,e.createElement(l.SelectionIndicator,{className:"maxio-segmented-control__selection-indicator","data-selected":!0}),t)));mt.displayName="SegmentedControl.Item";const dt=Object.assign(ct,{Item:mt}),ut=({leadingIcon:t,trailingIcon:a,type:n="menu",children:l,leadingIconClassName:r,isTooltipVisible:i=!1})=>e.createElement(e.Fragment,null,t&&e.createElement(Y,{usePortal:!0,isVisible:i,renderContent:()=>l,floatingElementOffset:12},e.createElement("span",{className:"maxio-side-nav__icon"},e.createElement(w,{variant:t,className:r}))),e.createElement("span",{className:`maxio-side-nav__${n}-title`,"data-testid":"maxio-sidebar-section-name"},l),a&&e.createElement("span",{className:"maxio-side-nav__menu-chevron"},e.createElement(w,{variant:a}))),pt=e=>"heading"!==e.type,xt=e=>{const t=(e=>e.flat().filter(pt).map(e=>e.items).flat().find(e=>e?.isCurrent))(e);return t?e.map(e=>e.map(e=>pt(e)&&e.items?.includes(t)?{...e,isOpen:!0}:e)):e},gt=e.createContext({}),bt=()=>e.useContext(gt),ft=({children:t,isOpen:a,onChange:n,withIcons:l=!0,sections:r,shouldToggleSidebar:i=!0,topDropdownItems:o,collapseBreakpoint:s=800})=>{const c=e.useRef(!1),[m,d]=e.useState(()=>!i||("boolean"==typeof a?a:"undefined"==typeof window||window.innerWidth>s)),[u,p]=e.useState(()=>xt(r)),{windowWitdh:x}=G(200);e.useEffect(()=>{c.current&&n?.(m)},[m,n]),e.useEffect(()=>{c.current=!0},[]),e.useEffect(()=>{!function(e){if(!i)return;e<s&&m&&g()}(x)},[x]),e.useEffect(()=>{"boolean"==typeof a&&d(a)},[a]);const g=()=>{d(!1)};return e.createElement(gt.Provider,{value:{sections:u,topDropdownItems:o,onSectionOpen:e=>{p(t=>t.map(t=>t.map(t=>pt(t)?{...t,isOpen:t?.name===e&&!t.isOpen}:t)))},isOpen:m,onOpen:()=>{d(!0)},onClose:g,withIcons:l,shouldToggleSidebar:i}},t)},ht=()=>{const{onOpen:t,topDropdownItems:a,isOpen:n}=bt(),{mainItem:l,otherItems:r,actions:i}=a,o=e.useRef(null),s=q(o),c=({id:e,title:t,icon:a,iconClass:n,url:l,...r})=>({id:e,label:t,leadingIconName:a,leadingIconClassName:n,link:{href:l,...r}}),{items:m,itemsCount:d}=e.useMemo(()=>({itemsCount:r.length+i.length,items:[...r.map(c),r?.length>0&&i?.length>0?{type:"divider",id:"item-divider"}:null,...i.map(c)].filter(e=>null!=e)}),[i,r]);return e.createElement(e.Fragment,null,0===d?e.createElement("a",{className:"maxio-side-nav__menu-button maxio-side-nav__menu-button--large",href:l.url,onClick:t},e.createElement("span",{className:"maxio-side-nav__menu-title"},l.title)):e.createElement("details",{className:"maxio-action-menu maxio-side-nav--action-menu"},e.createElement("summary",{onClick:t,className:"maxio-side-nav__menu-button","aria-haspopup":"true",ref:o},l.url?e.createElement(e.Fragment,null,e.createElement(ut,{type:"menu",isTooltipVisible:!n&&s,leadingIcon:l.icon,trailingIcon:"chevron-up-down",leadingIconClassName:l.iconClass},l.title)):e.createElement(ut,{type:"menu",trailingIcon:"chevron-up-down"},l.title)),e.createElement(C,{truncateLabels:!0,className:"maxio-action-menu__content","aria-label":"Action list",items:m,small:!0})))},Et=({section:t})=>{const{isOpen:a,withIcons:n}=bt(),l=e.useRef(null),r=q(l);return e.createElement("li",{className:"maxio-side-nav__item","data-key":t.key,"data-testid":"maxio-sidebar-section"},e.createElement("a",{className:"maxio-side-nav__link","aria-current":t.isCurrent?"page":void 0,role:"button",href:t.href,ref:l},e.createElement(ut,{isTooltipVisible:r&&!a,type:"menu",leadingIcon:n?t.icon:void 0},t.name)))},vt=({section:a})=>{const{onOpen:n,onSectionOpen:l,isOpen:r,withIcons:i}=bt(),o=e.useRef(null),s=q(o);if(!pt(a))return e.createElement("li",{className:"maxio-side-nav__item-header"},a.title);return a.Component?e.createElement(a.Component,{section:a}):a.href?e.createElement(Et,{section:a}):e.createElement("li",{className:t("maxio-side-nav__item",{"maxio-side-nav__item--icon":i}),"data-testid":"maxio-sidebar-section"},e.createElement("button",{className:"maxio-side-nav__menu-button",ref:o,"aria-expanded":a.isOpen?"true":"false",type:"button",onClick:()=>{l(a.name),n()}},e.createElement(ut,{type:"menu",isTooltipVisible:!r&&s,leadingIcon:i?a.icon:void 0,trailingIcon:a.items?.length?"chevron-down":void 0},a.name)),e.createElement("ul",{className:"maxio-side-nav__menu"},a.items?.map(t=>e.createElement("li",{key:`section-sub-item-${t.name}`,className:"maxio-side-nav__item","data-testid":"maxio-section-item"},e.createElement("a",{className:"maxio-side-nav__link",href:t.href,"aria-current":t.isCurrent?"page":void 0},e.createElement("span",{className:"maxio-side-nav__link-title"},t.name))))))},_t=()=>{const{sections:t}=bt();return e.createElement(e.Fragment,null,t.map((t,a)=>e.createElement("ul",{role:"list",className:"maxio-side-nav__items",key:`section-list-${a}`},t.map((t,n)=>e.createElement(vt,{key:`section-list-item-${t.type}-${a}-${n}`,section:t})))))},wt=()=>{const{onClose:t,shouldToggleSidebar:a}=bt();return e.createElement("div",{className:"maxio-side-nav__logo-container"},e.createElement("a",{className:"maxio-side-nav__brand",href:"/","aria-label":"Maxio"}),a&&e.createElement("button",{className:"maxio-side-nav__menu-toggle","aria-label":"toggle sidebar",onClick:t},e.createElement(w,{variant:"sidebar"})))},Nt=()=>{const{isOpen:a}=bt();return e.createElement("nav",{className:t("maxio-side-nav",{"maxio-side-nav--collapsed":!a})},e.createElement(wt,null),e.createElement(ht,null),e.createElement("div",{className:"maxio-side-nav__items-container"},e.createElement(_t,null)))},yt=({disabled:a=!1,value:n=0,className:r,id:i,isCurrent:o,...s})=>{const c="icon"===s.type,m=({isSelected:e})=>t("maxio-tabs__tab",r,{"maxio-tabs__tab--active":e,"maxio-tabs__tab--disabled":a,"maxio-tabs__tab--icon":c});if("icon"===s.type){const{icon:t,...r}=s;return e.createElement(l.Tab,h({id:n,isDisabled:a},r,{className:m}),e.createElement("div",{className:"maxio-tabs__tab__content"},t))}const{children:d,rightIcon:u,...p}=s;return e.createElement(l.Tab,h({id:n,isDisabled:a},p,{className:m}),e.createElement("div",{className:"maxio-tabs__tab__content"},d,u||null))},Ct=e.createContext({variant:"line",withDivider:!1}),It=({children:t,variant:a="line",withDivider:n=!1})=>e.createElement(Ct.Provider,{value:{variant:a,withDivider:n}},t),Rt=({children:a,value:n,className:r,id:i,...o})=>e.createElement(l.TabPanel,h({id:n,className:t("maxio-tabs__panel",r)},o),a),kt=({children:a,className:n,...l})=>e.createElement("div",h({className:t("maxio-card__header",n)},l),a);kt.displayName="Card.Header";const St=({children:a,className:n,...l})=>e.createElement("div",h({className:t("maxio-card__body",n)},l),a);St.displayName="Card.Body";const Pt=({children:a,className:n,...l})=>e.createElement("div",h({className:t("maxio-card__footer",n)},l),a);Pt.displayName="Card.Footer";const Tt=({children:a,className:n,variant:l="primary",...r})=>e.createElement("div",h({className:t("maxio-card",`maxio-card--${l}`,n)},r),a);Tt.displayName="Card";const Dt=Object.assign(Tt,{Header:kt,Body:St,Footer:Pt});var Mt,Ot,$t,Lt;function Bt(){return Bt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},Bt.apply(null,arguments)}const zt=e=>f.createElement("svg",Bt({xmlns:"http://www.w3.org/2000/svg","data-name":"Maxio Logo SVG",viewBox:"0 0 1036 240"},e),Mt||(Mt=f.createElement("path",{d:"M59.32 11.3 70.64 0l40.74 40.35v70.99H40.89L0 70.52l11.15-11.14 36.2 36.15h30.07l3.07-3.39-50.91-51.15 10.99-10.97 51.24 50.83 3.72-3.38V47.13zM180.68 11.3 169.36 0l-40.73 40.35v70.99h70.48L240 70.51l-11.15-11.14-36.2 36.15h-30.06l-3.07-3.39 50.91-51.15-10.99-10.97-51.24 50.83-3.72-3.38V47.12l36.2-35.83ZM59.32 228.7l11.31 11.29 40.74-40.35v-70.99H40.89L0 169.48l11.15 11.14 36.2-36.15h30.07l3.07 3.39-50.92 51.15 10.99 10.97 51.24-50.83 3.72 3.38v30.34zM180.68 228.7l-11.32 11.29-40.73-40.35v-70.99h70.48L240 169.48l-11.15 11.14-36.2-36.15h-30.06l-3.07 3.39 50.91 51.15-10.99 10.97-51.24-50.83-3.72 3.38v30.34zM1015.27 139.55c0-29.94-23.74-53.46-52.11-53.46s-52.11 23.52-52.11 53.46 23.74 53.46 52.11 53.46 52.11-23.52 52.11-53.46m20.32.95c-.5 40.27-32.73 72.76-72.43 72.76h-.94c-39.58-.52-71.5-33.32-71.5-73.71s32.43-73.71 72.44-73.71h.94c39.57.52 71.5 33.32 71.5 73.71v.95Z"})),Ot||(Ot=f.createElement("path",{fillRule:"evenodd",d:"M870.39 24h-20.33v20.33h20.33zm0 40.67h-20.33v148.59h20.33z"})),$t||($t=f.createElement("path",{fillRule:"evenodd",d:"M850.05 24h20.33v20.33h-20.33zM695.01 82.85l50.83 56.28v6.53l-50.28 55.67 15.23 13.2 49.22-54.49h4.71l49.22 54.49 15.23-13.2-50.28-55.67v-6.53l50.83-56.28-15.23-13.2-50.15 55.52h-3.96l-50.15-55.52L695 82.85ZM660.49 78.64c-9.41-9.28-23.26-13.97-41.02-13.97-31.13 0-52.44 18.93-58.09 44.86l-.28 1.27 19.33 3.72.31-1.14c2.39-8.91 6.66-16.54 13.04-21.94 6.36-5.39 14.91-8.63 26.02-8.63s19.12 3.25 24.76 8.96c5.64 5.72 8.73 14.06 8.73 24.53v6.11L616.62 130l-3.26.68c-16.14 3.47-29.79 7.84-39.59 14.45-10.54 7.11-16.64 16.83-16.64 30.62 0 12.51 4.51 22.62 12.5 29.59 7.96 6.95 19.25 10.67 32.63 10.67 22.27 0 41.87-12.03 51.04-27.03v25.55h21.39v-95.3c0-17.6-4.77-31.3-14.19-40.58Zm-40.09 68.13c-12.86 2.77-23.05 5.42-30.03 9.63-3.46 2.09-6.08 4.54-7.84 7.54s-2.71 6.62-2.71 11.15c0 6.38 2.1 12.12 6.32 16.27 4.22 4.14 10.7 6.82 19.7 6.82 26.85 0 47.46-20.48 47.46-51.36v-7.2l-32.9 7.14Z"})),Lt||(Lt=f.createElement("path",{d:"M434.8 188.74h4.54l61.73-164.33.15-.41h35.57v189.35H515.9V55.37h-4.33l-59.7 157.57-.15.41h-29.29l-61.2-157.98h-4.35v157.98H336V24h35.57z"}))),At=a=>{const{size:n="sm",className:l,variant:r="lockup",alt:i="maxio logo"}=a,o="mark"===r,s="number"==typeof n;return e.createElement(zt,{role:"img",viewBox:o?"0 0 240 240":"0 0 1036 240","aria-label":i,height:s?n:void 0,className:t("maxio-logo",!s&&`maxio-logo--${n}`,o&&"maxio-logo--mark",l)})},Ft=({state:a,...n})=>{const l=e.useRef(null),{toastProps:r,contentProps:i,titleProps:o,closeButtonProps:s}=g.useToast(n,a,l),{closable:c=!0,underline:m=!0,external:d=!1}=n.toast.content,u=t("maxio-toast",{[`maxio-toast--${n.toast.content.sentiment}`]:n.toast.content.sentiment}),p={default:"info-circle-fill",success:"check-circle-fill",warning:"warning-circle-fill",danger:"error-fill",info:"info-circle-fill"}[n.toast.content.sentiment||"default"];return e.createElement("div",h({className:u,"data-maxio-mode":"dark"},r,{ref:l}),e.createElement(w,{variant:p,className:"maxio-toast__icon"}),e.createElement("div",h({className:"maxio-toast__container"},i),e.createElement("div",h({className:"maxio-toast__content"},o),n.toast.content.title&&e.createElement("span",{className:"maxio-toast__title"},n.toast.content.title),n.toast.content.message&&e.createElement("span",{className:"maxio-toast__message"},n.toast.content.message),n.toast.content.link?.text&&n.toast.content.link?.href&&e.createElement(I,{href:n.toast.content.link.href,underline:m,external:d},n.toast.content.link.text))),c&&e.createElement(T,h({variant:"ghost",icon:e.createElement(w,{variant:"cross"}),"aria-label":"Dismiss Notification",className:"maxio-toast__dismiss"},s)))},Vt=({state:t,...a})=>{const n=e.useRef(null),{regionProps:l}=g.useToastRegion(a,t,n);return e.createElement("div",h({},l,{ref:n,className:a.className,style:{display:"flex",flexDirection:"column",gap:"10px"}}),t.visibleToasts.map(a=>e.createElement(Ft,{key:a.key,toast:a,state:t})))},Ht=e.createContext(null);class Wt extends x.ToastQueue{}const jt=({...t})=>{const n=e.useRef(null),{buttonProps:l}=a.useButton(t,n);return e.createElement("button",h({},l,{className:"maxio-chip__dismiss-button"}),e.createElement(w,{variant:"cross-circle-fill",className:"maxio-chip__icon"}))},qt={success:"maxio-auth-layout__heading--success",danger:"maxio-auth-layout__heading--danger"};Object.defineProperty(exports,"DialogTrigger",{enumerable:!0,get:function(){return l.DialogTrigger}}),Object.defineProperty(exports,"Pressable",{enumerable:!0,get:function(){return l.Pressable}}),Object.defineProperty(exports,"createColumnHelper",{enumerable:!0,get:function(){return c.createColumnHelper}}),exports.ActionList=C,exports.Alert=D,exports.AuthLayout=({children:a,heading:n,description:l,sentiment:r="success",leadingElement:i=null,alert:o,topAddon:s=null,footer:c})=>e.createElement("div",{className:"maxio-auth-layout"},e.createElement(Ve,{alignItems:"center",justifyContent:"between"},e.createElement(At,{size:"md"}),s),o&&e.createElement(D,{display:"block",title:o.title,sentiment:o.sentiment},o.children),e.createElement(Dt,{variant:"secondary"},e.createElement(Dt.Body,null,e.createElement(Ve,{flexDirection:"col",gap:6},e.createElement(Ve,{flexDirection:"col",gap:2},e.createElement(Ve,{alignItems:"center",gap:2},i,e.createElement(Ae,{size:"lg",className:t("maxio-auth-layout__heading",qt[r])},n)),l&&e.createElement(Ve,{style:{color:"var(--maxio-color-text-tertiary)"}},e.createElement(Fe,{size:"sm",className:"maxio-auth-layout__description"},l))),a)),c&&e.createElement(Dt.Footer,null,c))),exports.Avatar=({className:a,src:n,alt:l="avatar"})=>e.createElement("img",{className:t("maxio-avatar",a),alt:l,src:n}),exports.Banner=({children:a,title:n,linkText:l,linkExternal:r,href:i,display:o="inline",sentiment:s="info",onDismiss:c,className:m})=>{if(!a&&!n)return console.warn("Banner component requires either children or title prop to be rendered"),null;const d=t("maxio-banner",{[`maxio-banner--${s}`]:"info"!==s&&s,className:m}),u={success:"check-circle-fill",warning:"warning-circle-fill",danger:"error-fill",info:"info-circle-fill"}[s],p=t("maxio-banner__content",{"maxio-banner__content--block":"block"===o});return e.createElement("div",{className:d,"aria-live":"assertive"},e.createElement(w,{variant:u,className:"maxio-banner__icon","aria-hidden":"true"}),e.createElement("section",{className:"maxio-banner__container"},e.createElement("div",{className:p},n&&e.createElement("span",{className:"maxio-banner__title"},n),a&&e.createElement("span",{className:"maxio-banner__message"},a),l&&i&&e.createElement(I,h({href:i},"warning"!==s&&{variant:"inverse"},{underline:!0},r?{external:!0}:{}),l))),c&&e.createElement(T,{icon:e.createElement(w,{variant:"cross"}),"aria-label":"Dismiss Notification",variant:"ghost",onClick:c,className:"maxio-banner__dismiss"}))},exports.Body=Fe,exports.Breadcrumbs=({className:a,children:n,...l})=>{const r=e.Children.count(n);if(0===r)throw new Error(z);const i=e.Children.map(n,(t,a)=>{if(e.isValidElement(t)&&t.type===B){if(a===r-1&&t.props.href)throw new Error(A);return e.cloneElement(t,{"aria-current":a===r-1?"page":void 0})}throw new Error(F)});return e.createElement("nav",h({"aria-label":"Breadcrumb"},l),e.createElement("ol",{className:t("maxio-breadcrumbs",a)},i))},exports.BreadcrumbsItem=B,exports.Button=P,exports.Calendar=lt,exports.Card=Dt,exports.Checkbox=_e,exports.CheckboxGroup=({helperText:n,className:l,errorMessage:r,children:o,disabled:s,label:c,defaultValue:m,name:d,...u})=>{const p=i.useCheckboxGroupState({defaultValue:m,name:d,errorMessage:r,description:n,label:c,isDisabled:s,isInvalid:!!r,...u}),{groupProps:x,labelProps:g,descriptionProps:b,errorMessageProps:f,isInvalid:E}=a.useCheckboxGroup({"aria-label":(c??u["aria-label"])?.toString(),isDisabled:s,isInvalid:!!r,...u},p),v=t("maxio-checkbox-group",{"maxio-checkbox-group--disabled":s},l),_=n&&!r;return e.createElement("div",h({className:v},x),c&&e.createElement("label",h({className:"maxio-checkbox-group__label"},g),c),e.createElement(Ee.Provider,{value:p},o),_&&e.createElement(we,b,n),r&&E&&e.createElement(Ne,f,r))},exports.Chip=({label:n,onDismiss:l,dismissLabel:i,leadingIcon:o,trailingIcon:s,title:c,...m})=>{const d=e.useRef(null),u=r.useToggleState(m),{buttonProps:p}=a.useToggleButton(m,u,d),x=t("maxio-chip",{"maxio-chip--selected":u?.isSelected}),g=t("maxio-chip__button",{"maxio-chip--dismissible":l});return e.createElement("div",{className:x},e.createElement("button",h({className:g,ref:d},p,{title:c}),o&&e.createElement(w,{variant:o,className:"maxio-chip__icon"}),e.createElement("span",{className:"maxio-chip__label"},n),s&&!l&&e.createElement(w,{variant:s,className:"maxio-chip__icon"})),l&&e.createElement(jt,{onPress:l,"aria-label":i}))},exports.Code=({as:a="div",children:n,className:l,...r})=>{const i=a,o=t("maxio-code",l);return e.createElement(i,h({className:o},r),n)},exports.ComboBox=Qe,exports.CopyToClipboard=({value:n,copyLabel:l="Copy",copiedLabel:r="Copied!",copyErrorLabel:i="Copy failed",size:o="md",variant:s="ghost",disabled:c,resetAfterMs:m=2e3,tooltipPlacement:d="top",onCopy:u,onCopyError:p,onClick:x,className:g,...b})=>{const{feedbackState:f,feedbackLabel:E,announcement:v,handleCopy:_}=((t,{copyLabel:a,copiedLabel:n,copyErrorLabel:l,resetAfterMs:r,onCopy:i,onCopyError:o,onClick:s})=>{const[c,m]=e.useState(null),d=e.useRef(null),u=e.useRef(0),p=e.useRef(!0),x=e.useRef(0),g=e.useRef(t),b=e.useCallback(()=>{null!==d.current&&(clearTimeout(d.current),d.current=null)},[]),f=e.useCallback(()=>{b(),m(null)},[b]),h=e.useCallback((e,t)=>{b(),m({state:e,value:t,announceId:++u.current}),d.current=window.setTimeout(f,r)},[b,r,f]);e.useEffect(()=>{g.current=t,f()},[f,t]),e.useEffect(()=>(p.current=!0,()=>{p.current=!1,b()}),[b]);const E=e.useCallback(async e=>{s?.(e);const a=++x.current,n=t,l=()=>!p.current||a!==x.current||n!==g.current;try{await navigator.clipboard.writeText(n)}catch(e){return l()||h("error",n),void o?.(e)}l()||h("copied",n),i?.(n)},[s,i,o,h,t]),v=c?.value===t?c.state:"idle",_={idle:a,copied:n,error:l}[v];return{feedbackState:v,feedbackLabel:_,announcement:"idle"!==v&&c?{id:c.announceId,message:_}:null,handleCopy:E}})(n,{copyLabel:l,copiedLabel:r,copyErrorLabel:i,resetAfterMs:m,onCopy:u,onCopyError:p,onClick:x});return e.createElement(e.Fragment,null,e.createElement(Y,{interactions:["hover","focus"],placement:d,size:"small",renderContent:()=>E},e.createElement(T,h({},b,{"aria-label":l,className:t(g,{[Q]:"subtle"===s,[X]:"xs"===o}),variant:"subtle"===s?"ghost":s,size:"xs"===o?void 0:o,disabled:c,onClick:_,trailingElement:e.createElement(w,{variant:J[f]})}))),e.createElement(a.VisuallyHidden,null,e.createElement("span",{role:"status","aria-live":"polite","aria-atomic":"true"},v&&e.createElement("span",{key:v.id},v.message))))},exports.DataTable=({pattern:t,size:a="md",SubRowComponent:n,onExpand:l,onSelect:r,onSort:i,enableSorting:o=!1,enableRowSelection:s=!1,enableExpanding:m,columns:d,actions:u,actionsColumnSize:p,onRowAction:x,enableRowReordering:g=!1,getRowReorderLabel:b,onRowReorder:f,rowReorderMode:E="siblings",getRowId:v,getSubRows:_,state:w,...N})=>{const y=g?void 0:n,C=!g&&o,I=(({columns:t,HeaderControls:a,RowControls:n,RowActions:l,actions:r,actionsColumnSize:i,enableExpanding:o,enableRowSelection:s,enableRowReordering:c})=>e.useMemo(()=>{const m={id:ee,size:s&&c?72:40,header:t=>e.createElement(a,h({},t,{enableExpanding:o,enableRowSelection:s,enableRowReordering:c})),cell:t=>e.createElement(n,h({},t,{enableExpanding:o,enableRowSelection:s,enableRowReordering:c})),meta:{controls:!0,width:(s&&c?72:40)+"px"}},d=r&&l?{id:te,size:i??40,header:"",cell:t=>e.createElement(l,null,r(t.row,t.table)),meta:{actions:!0}}:null;let u=[...t];return(s||c)&&(u=[m,...u]),d&&(u=[...u,d]),u},[r,i,l,o,s,c,t,a,n]))({columns:d,HeaderControls:ye,RowControls:Re,RowActions:ke,actions:u,actionsColumnSize:p,enableRowSelection:s,enableRowReordering:g,enableExpanding:Boolean(m)}),R=c.useReactTable({state:{...w,...g&&{sorting:Le},columnPinning:{left:[...s||g?[ee]:[],...$e(w?.columnPinning?.left)],right:[...$e(w?.columnPinning?.right),...u?[te]:[]]}},getCoreRowModel:c.getCoreRowModel(),enableRowSelection:s,enableExpanding:Boolean(m),...!N.manualExpanding&&{getExpandedRowModel:c.getExpandedRowModel()},...!N.manualSorting&&!g&&{getSortedRowModel:c.getSortedRowModel()},columns:I,getRowId:v,...N,getSubRows:g?Be:_??Be,enableSorting:C,...g&&{getSortedRowModel:void 0}}),k=R.getCanSomeRowsExpand(),S=R.getState(),P=(({columnFilters:e,globalFilter:t,grouping:a,hasPagination:n})=>e.length>0||null!=t&&""!==t?De:a.length>0?Me:n?Oe:Te)({columnFilters:S.columnFilters,globalFilter:S.globalFilter,grouping:S.grouping,hasPagination:Boolean(N.getPaginationRowModel||N.manualPagination)});e.useEffect(()=>{l?.(S.expanded)},[l,S.expanded]),e.useEffect(()=>{r?.(S.rowSelection)},[r,S.rowSelection]),e.useEffect(()=>{g||i?.(S.sorting)},[g,i,S.sorting]);const T=e.createElement(ae,{pattern:t,size:a,isExpandable:k,isUsingCustomRow:Boolean(y)},e.createElement(ne,null,R.getHeaderGroups().map(t=>e.createElement(he,{key:t.id,table:R,isHeader:!0},t.headers.map(t=>e.createElement(re,{key:t.id,table:R,header:t,enableExpanding:m},c.flexRender(t.column.columnDef.header,t.getContext())))))),e.createElement(le,null,R.getRowModel().rows.map(a=>e.createElement(Pe,{key:a.id,row:a,pattern:t,SubRowComponent:y,enableExpanding:m,onRowAction:x}))));return g&&v&&f?e.createElement(fe,{availability:P,data:N.data,enableExpanding:Boolean(m),getRowReorderLabel:b,onRowReorder:f,rowReorderMode:E,table:R},T):T},exports.DateField=({label:a,description:n,errorMessage:r,className:i,...o})=>e.createElement(l.DateField,h({},o,{className:l.composeRenderProps(i,(e,a)=>t("maxio-text-field","maxio-date-field",{"maxio-text-field--disabled":a.isDisabled,"maxio-text-field--error":a.isInvalid,"maxio-text-field--readonly":a.isReadOnly},e))}),null!=a&&e.createElement(l.Label,{className:"maxio-text-field__label"},a),e.createElement("div",{className:"maxio-text-field__items"},e.createElement("div",{className:"maxio-text-field__input"},e.createElement(nt,null))),null!=n&&e.createElement(l.Text,{slot:"description",className:"maxio-form-helper-text"},n),e.createElement(l.FieldError,{className:"maxio-form-error"},r)),exports.DatePicker=({label:a,description:n,errorMessage:r,className:i,presets:o,presetsLabel:s,...c})=>{const m=o?.find(e=>null===e.value)?.label;return e.createElement(l.DatePicker,h({},c,{className:l.composeRenderProps(i,(e,a)=>t("maxio-text-field","maxio-date-field",{"maxio-text-field--disabled":a.isDisabled,"maxio-text-field--error":a.isInvalid,"maxio-text-field--readonly":a.isReadOnly},e))}),({state:t,isDisabled:i,isReadOnly:d})=>e.createElement(e.Fragment,null,null!=a&&e.createElement(l.Label,{className:"maxio-text-field__label"},a),e.createElement(l.Group,{className:"maxio-text-field__items"},e.createElement("div",{className:"maxio-text-field__input"},e.createElement(nt,{displayValue:null===t.value?m:void 0})),e.createElement("div",{className:"maxio-text-field__trailing-element"},e.createElement(l.Button,{className:"maxio-button maxio-button--sm maxio-button--ghost maxio-button--icon"},e.createElement(w,{variant:"calendar"})))),null!=n&&e.createElement(l.Text,{slot:"description",className:"maxio-form-helper-text"},n),e.createElement(l.FieldError,{className:"maxio-form-error"},r),e.createElement(Ce,{hideArrow:!0,className:"maxio-date-field__popover"},e.createElement(l.Dialog,{className:"maxio-date-field__dialog"},e.createElement(lt,null),e.createElement(rt,{presets:o,label:s,isDisabled:i||d,isPresetDisabled:e=>it(e,c),onSelect:e=>{t.setValue(e),t.setOpen(!1)}})))))},exports.DateRangePicker=({label:a,description:n,errorMessage:r,className:i,presets:o,presetsLabel:s,...c})=>e.createElement(l.DateRangePicker,h({},c,{className:l.composeRenderProps(i,(e,a)=>t("maxio-text-field","maxio-date-field",{"maxio-text-field--disabled":a.isDisabled,"maxio-text-field--error":a.isInvalid,"maxio-text-field--readonly":a.isReadOnly},e))}),({state:t,isDisabled:i,isReadOnly:m})=>{const d=((e,t)=>{if(null==e?.start||null==e?.end)return t?.find(t=>st(t.value?.start,e?.start)&&st(t.value?.end,e?.end))?.label})(t.value,o);return e.createElement(e.Fragment,null,null!=a&&e.createElement(l.Label,{className:"maxio-text-field__label"},a),e.createElement(l.Group,{className:"maxio-text-field__items"},e.createElement("div",{className:"maxio-text-field__input"},e.createElement(nt,{slot:"start",displayValue:null==t.value?.start?d:void 0}),e.createElement("span",{"aria-hidden":"true",className:"maxio-body-sm"},"→"),e.createElement(nt,{slot:"end",displayValue:null==t.value?.end?d:void 0})),e.createElement("div",{className:"maxio-text-field__trailing-element"},e.createElement(l.Button,{className:"maxio-button maxio-button--sm maxio-button--ghost maxio-button--icon"},e.createElement(w,{variant:"calendar"})))),null!=n&&e.createElement(l.Text,{slot:"description",className:"maxio-form-helper-text"},n),e.createElement(l.FieldError,{className:"maxio-form-error"},r),e.createElement(Ce,{hideArrow:!0,className:"maxio-date-field__popover"},e.createElement(l.Dialog,{className:"maxio-date-field__dialog"},e.createElement(ot,null),e.createElement(rt,{presets:o,label:s,isDisabled:i||m,isPresetDisabled:e=>((e,t)=>{const a=e.start?u.toCalendarDate(e.start):null,n={...t,isDateUnavailable:e=>t.isDateUnavailable?.(e,a)??!1};if(null!=e.start&&null!=e.end&&e.start.compare(e.end)>0||null!=e.start&&it(e.start,{...t,isDateUnavailable:e=>t.isDateUnavailable?.(e,null)??!1})||null!=e.end&&it(e.end,n))return!0;if(e.start&&e.end&&t.isDateUnavailable&&!t.allowsNonContiguousRanges){const n=u.toCalendarDate(e.end);for(let l=u.toCalendarDate(e.start).add({days:1});l.compare(n)<0;l=l.add({days:1}))if(t.isDateUnavailable(l,a))return!0}return!1})(e,c),onSelect:e=>((e,t)=>{!t||null!=t.start&&null!=t.end?t?.start&&t.end?e.setValue({start:t.start,end:t.end}):e.setValue(null):(e.setValue(null),e.setDateTime("start",t.start),e.setDateTime("end",t.end)),e.setOpen(!1)})(t,e)}))))}),exports.Display=({as:a="div",children:n,size:l="md",className:r,...i})=>{const o=a,s=t(`maxio-display-${l}`,r);return e.createElement(o,h({className:s},i),n)},exports.Drawer=({open:a,onOpenChange:n,placement:r="right",backdrop:i="dim",size:o="md",className:s,title:c,description:m,children:d,footer:u})=>{const p=e.useId(),x={"data-placement":r,"data-size":o};return e.createElement(l.ModalOverlay,{isOpen:a,onOpenChange:n,isDismissable:!0,className:t("maxio-drawer__backdrop",{"maxio-drawer__backdrop--dim":"dim"===i})},e.createElement(l.Modal,h({className:t("maxio-drawer",s)},x),e.createElement(l.Dialog,{className:"maxio-drawer__dialog","aria-labelledby":p},({close:t})=>e.createElement(e.Fragment,null,e.createElement("div",{className:"maxio-drawer__header"},e.createElement("div",{className:"maxio-drawer__title-group"},e.createElement(Ae,{id:p,size:"md",className:"maxio-drawer__title"},c),m&&e.createElement("p",{className:"maxio-drawer__description"},m)),e.createElement(T,{"aria-label":"Close",onClick:t,icon:e.createElement(w,{variant:"cross"}),variant:"ghost",size:"sm",className:"maxio-drawer__close"})),e.createElement("div",{className:"maxio-drawer__body"},d),null!=u&&e.createElement("div",{className:"maxio-drawer__footer"},u)))))},exports.EmptyState=({hasActiveFilters:a=!1,title:n,headingLevel:l="h2",description:r,actions:i,className:o,...s})=>{const c=t("maxio-empty-state",o),m=l,d=!n&&!r?a?"We couldn't find any items matching your criteria. Try adjusting your search or filters to see more results.":"There is no data to display yet.":r;return e.createElement("div",h({className:c},s),e.createElement(Ve,{flexDirection:"col",alignItems:"center",gap:4,className:"maxio-empty-state__content"},e.createElement(Ve,{flexDirection:"col",alignItems:"center",gap:2,className:"maxio-empty-state__copy"},n&&e.createElement(m,{className:"maxio-heading-lg"},n),d&&e.createElement(Fe,{size:"sm",className:"maxio-empty-state__description"},d)),i&&e.createElement(Ve,{alignItems:"center",gap:2},i)))},exports.Flex=Ve,exports.FormErrorMessage=Ne,exports.FormHelperText=we,exports.GlobalToastProvider=({children:t,toastQueue:a,...n})=>{const l=x.useToastQueue(a),r=e.useCallback(()=>{l.visibleToasts.forEach(e=>{a.close(e.key)})},[l.visibleToasts,a]),i=e.useMemo(()=>({addToast:a.add.bind(a),removeToast:a.clear.bind(a),removeAllToasts:r,state:l}),[a,r,l]);return e.createElement(Ht.Provider,{value:i},t,l.visibleToasts.length>0&&e.createElement(Vt,h({},n,{state:l})))},exports.Grid=({children:a,templateColumns:n,templateRows:l,autoColumns:r,autoRows:i,inline:o,column:s,columnStart:c,columnEnd:m,row:d,rowStart:u,rowEnd:p,gap:x,gapX:g,gapY:b,className:f,justifyContent:E,alignItems:v,..._})=>{const w=t(f,{"maxio-grid":!o,"maxio-inline-grid":o,[`maxio-grid-cols-${n}`]:n,[`maxio-grid-rows-${l}`]:l,[`maxio-auto-cols-${r}`]:r,[`maxio-auto-rows-${i}`]:i,["maxio-col-"+("auto"===s?"auto":`span-${s}`)]:s,[`maxio-col-start-${c}`]:c,[`maxio-col-end-${m}`]:m,["maxio-row-"+("auto"===d?"auto":`span-${d}`)]:d,[`maxio-row-start-${u}`]:u,[`maxio-row-end-${p}`]:p,[`maxio-gap-${x}`]:void 0!==x,[`maxio-gap-x-${g}`]:void 0!==g,[`maxio-gap-y-${b}`]:void 0!==b,[`maxio-justify-${E}`]:E,[`maxio-items-${v}`]:v});return e.createElement("div",h({className:w||void 0},_),a)},exports.Heading=Ae,exports.Icon=w,exports.IconButton=T,exports.Label=({as:a="div",children:n,size:l="sm",className:r,...i})=>{const o=a,s=t(`maxio-label-${l}`,r);return e.createElement(o,h({className:s},i),n)},exports.Link=I,exports.ListBox=Ge,exports.LoadingSpinner=R,exports.Logo=At,exports.Menu=({children:t})=>e.createElement(O,null,e.createElement(L,null,t)),exports.MenuButton=({children:a,iconName:n="chevron-down","aria-label":l,size:r="md",variant:i="secondary"})=>{const o=t({"maxio-action-menu__chevron":"chevron-down"===n}),s=t("maxio-button",`maxio-button--${i}`,`maxio-button--${r}`,{"maxio-button--icon":n&&!a}),{isOpen:c,buttonId:m,controlsId:d}=$();return e.createElement("summary",{className:s,"aria-haspopup":"true","aria-label":l,"aria-expanded":c,"aria-controls":d,id:m},a&&e.createElement("span",null,a),n&&e.createElement(w,{variant:n,className:`${o} maxio-button__trailing-element`}))},exports.MenuList=({items:a,alignItemsEnd:n=!1})=>{const l=t("maxio-action-menu__content",{"maxio-action-menu__content--align-end":n}),{controlsId:r,buttonId:i}=$();return e.createElement("div",{className:l,role:"presentation"},e.createElement(C,{role:"menu",itemProps:{role:"menuitem"},id:r,"aria-labelledby":i,items:a}))},exports.OverlayTrigger=K,exports.Pagination=({size:t="md",onChange:a,totalItems:n=0,itemsPerPage:l=30,currentPage:r=1,pageSizeOptions:i,manualPageInput:o=!1})=>{const[s,c]=e.useState(r),[m,d]=e.useState(l),[u,p]=e.useState(r.toString());e.useEffect(()=>{p(s.toString())},[s]);const x=Math.ceil(n/m),g=s<x,b=s>1,f=m*(s-1)+1,h=Math.min(m*s,n),E=i.map(e=>({label:e.toString(),value:e.toString()})),v=Array.from({length:x},(e,t)=>t+1).map(e=>({label:e.toString(),value:e.toString()})),_=e=>{c(e),a?.({currentPage:e,itemsPerPage:m})},N=e=>{const t=parseInt(e,10);if(isNaN(t))return void p(s.toString());const a=Math.max(1,Math.min(t,x));p(a.toString()),_(a)};return e.createElement("div",{className:"maxio-pagination"},e.createElement("div",{className:"maxio-pagination__items-per-page"},e.createElement("label",{htmlFor:"items-per-page-large",className:"maxio-pagination__label"},"Items per page"),e.createElement(at,{inline:!0,size:t,options:E,onChange:e=>{return t=Number(e.target.value),d(t),c(1),void a?.({currentPage:1,itemsPerPage:t});var t},value:m,id:"items-per-page-large"})),e.createElement("div",{className:"maxio-pagination__total-items"},e.createElement("span",null,f,"–",h," of ",n," items")),e.createElement("div",{className:"maxio-pagination__current-page"},o?e.createElement(tt,{className:"maxio-pagination__page-input",value:u,min:1,max:x,onChange:e=>(e=>{p(e)})(e),onBlur:e=>{N(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&(N(e.currentTarget.value),e.currentTarget.blur())},"aria-label":"Page number",size:t,type:"number",onWheel:e=>e.preventDefault()}):e.createElement(at,{inline:!0,size:t,"aria-label":"Select page",onChange:e=>_(Number(e.target.value)),value:s,options:v,id:"page-index-large"}),e.createElement("div",{className:"maxio-pagination__label"},"of ",x," pages")),e.createElement("div",{className:"maxio-pagination__controls"},e.createElement(Y,{onVisibilityUpdate:()=>{},renderContent:()=>"Previous",floatingElementOffset:9,placement:"top",size:"small"},e.createElement(T,{icon:e.createElement(w,{variant:"chevron-left"}),size:t,variant:"ghost",onClick:()=>_(s-1),"aria-label":"Previous",disabled:!b})),e.createElement(Y,{onVisibilityUpdate:()=>{},renderContent:()=>"Next",floatingElementOffset:9,placement:"top",size:"small"},e.createElement(T,{icon:e.createElement(w,{variant:"chevron-right"}),size:t,variant:"ghost",onClick:()=>_(s+1),"aria-label":"Next",disabled:!g}))))},exports.Popover=Ce,exports.ProgressBar=({label:n,helperText:l,size:r="md",variant:i="default",status:o,value:s,maxValue:c=100})=>{const m=a.useId(),d=a.useId(),u=o&&!!n&&!!s&&!("inline"===i),p=l&&!("inline"===i),x=l&&"inline"===i,{progressBarProps:g,labelProps:b}=a.useProgressBar({maxValue:c,value:s,label:n}),f=t("maxio-progress-bar",{"maxio-progress-bar--lg":"lg"===r,"maxio-progress-bar--success":s&&!("inline"===i)&&"success"===o,"maxio-progress-bar--error":s&&!("inline"===i)&&"error"===o,"maxio-progress-bar--indent":"indent"===i,"maxio-progress-bar--inline":"inline"===i,"maxio-progress-bar--indeterminate":void 0===s});return e.createElement("div",h({className:f},g),e.createElement("div",h({id:m,className:"maxio-progress-bar__label"},b),n),x&&e.createElement("div",{id:d,className:"maxio-progress-bar__helper-text"},l),e.createElement("div",{className:"maxio-progress-bar__track"},e.createElement("div",{className:"maxio-progress-bar__progress",style:{"--tw-scale-x":`${s}%`}})),u&&e.createElement("div",{className:`maxio-progress-bar__${o}-icon`}),p&&e.createElement("div",{id:d,className:"maxio-progress-bar__helper-text"},l))},exports.Radio=({indent:n=!1,disabled:l=!1,invalid:r=!1,label:i,...o})=>{const s=e.useRef(null),c=e.useContext(Xe),{inputProps:m,isDisabled:d}=a.useRadio({...o,value:(o.value||"").toString(),"aria-label":o["aria-label"]||i,isDisabled:l},c,s),u=t("maxio-radio",{"maxio-radio--indent":n,"maxio-radio--disabled":d||c.isDisabled,"maxio-radio--error":r||c.isInvalid});return e.createElement("label",{className:u},e.createElement("input",h({ref:s,role:"radio",type:"radio",className:"maxio-radio__input"},m,{name:c.name||m.name})),e.createElement("span",{className:"maxio-radio__control"}),e.createElement("span",{className:"maxio-radio__label"},i))},exports.RadioGroup=({children:t,label:n,errorMessage:l,helperText:r,disabled:i=!1,invalid:o=!1,name:s,defaultValue:c,...m})=>{const d=p.useRadioGroupState({isDisabled:i,isInvalid:o,description:r,name:s,label:n,errorMessage:l,defaultValue:c,...m}),{radioGroupProps:u,labelProps:x,descriptionProps:g,errorMessageProps:b}=a.useRadioGroup({"aria-label":m["aria-label"]||n,...m},d);return e.createElement(e.Fragment,null,e.createElement("div",h({className:"maxio-radio-group"},u),n&&e.createElement("label",h({className:"maxio-radio-group__label"},x),n),e.createElement(Xe.Provider,{value:d},t),o&&l&&e.createElement(Ne,b,l),r&&!o&&e.createElement(we,g,r)))},exports.RangeCalendar=ot,exports.SegmentedControl=dt,exports.Select=at,exports.SideNav=({withIcons:t=!0,shouldToggleSidebar:a=!1,topDropdownItems:n,sections:l=[],collapseBreakpoint:r=800,isOpen:i,onChange:o})=>e.createElement(ft,{isOpen:i,onChange:o,collapseBreakpoint:r,withIcons:t,shouldToggleSidebar:a,topDropdownItems:n,sections:l},e.createElement(Nt,null)),exports.Tab=yt,exports.TabList=({children:a,className:n,ariaLabel:r,overflow:i="none",moreLabel:o="More",...s})=>{const{variant:c,withDivider:m}=e.useContext(Ct),d=e.useContext(l.TabListStateContext),u=e.useId(),[p,x]=e.useState(!1),g=t("maxio-tabs",n,{"maxio-tabs--contained":"contained"===c,"maxio-tabs--divider":m}),b=e.Children.map(a,e=>e);(b??[]).forEach(t=>{if(!e.isValidElement(t)||t.type!==yt)throw new Error("You can only pass <Tab /> component as children")});const f="auto"===i&&!!b?.length,{ref:E,moreButtonRef:v,overflowIndexes:_,handleKeyDownCapture:N}=(({overflowEnabled:t,childrenArray:a})=>{const n=e.useRef(null),r=e.useRef(null),i=e.useRef(null),[o,s]=e.useState(null),c=U(n),m=e.useContext(l.TabListStateContext),d=null!=m?.selectedKey?Number(m.selectedKey):null,[u,p]=e.useState([]);e.useLayoutEffect(()=>{if(!t||!o)return void p((a??[]).map((e,t)=>t));const{visibleIndexes:e}=((e,t,a,n)=>{const l=e.map((e,t)=>t);if(e.reduce((e,t)=>e+t,0)<=t)return{visibleIndexes:l,overflowIndexes:[]};const r=[];let i=a;for(const a of l){if(i+e[a]>t)break;i+=e[a],r.push(a)}if(null!==n&&!r.includes(n)){for(i+=e[n];i>t&&r.length>0;)i-=e[r.pop()];r.push(n)}r.sort((e,t)=>e-t);const o=l.filter(e=>!r.includes(e));return{visibleIndexes:r,overflowIndexes:o}})(o.tabWidths,c,o.moreButtonWidth,i.current??d);e.length===(a??[]).length&&(i.current=null),p(e)},[t,o,c]),e.useLayoutEffect(()=>{t&&o&&null!==d&&p(e=>(e.includes(d)||(i.current=d),((e,t,a,n,l)=>{if(e.includes(l))return e;const r=[...e,l].sort((e,t)=>e-t);let i=n+r.reduce((e,a)=>e+t[a],0);for(;i>a&&r.length>1;){const e=r.length-1,a=r[e]===l?e-1:e,[n]=r.splice(a,1);i-=t[n]}return r})(e,o.tabWidths,c,o.moreButtonWidth,d)))},[d]);const x=t?(a??[]).map((e,t)=>t).filter(e=>!u.includes(e)):[],g=((e,t)=>e.filter(e=>!t?.[e]?.props.disabled))(u,a);e.useLayoutEffect(()=>{if(!t||!n.current)return void s(e=>null===e?e:null);const e=Array.from(n.current.querySelectorAll('[role="tab"]')),l=r.current?.getBoundingClientRect().width??0;s(t=>{const n=(a??[]).map((a,n)=>{const l=e[n]?.getBoundingClientRect().width??0;return l>0?l:t?.tabWidths[n]??0}),r=l>0?l:t?.moreButtonWidth??0,i=t?.tabWidths.length===n.length&&t.tabWidths.every((e,t)=>e===n[t]);return t&&i&&t.moreButtonWidth===r?t:{tabWidths:n,moreButtonWidth:r}})},[a,t]);const b=e=>{void 0!==e&&(m?.selectionManager.setFocused(!0),m?.selectionManager.setFocusedKey(e),m?.setSelectedKey(e),n.current?.querySelector(`[role="tab"][data-key="${e}"]`)?.focus())};return{ref:n,moreButtonRef:r,visibleIndexes:u,overflowIndexes:x,handleKeyDownCapture:e=>{if(0===x.length)return;const t=document.activeElement===r.current,a=m?.selectionManager.focusedKey,n=t?-1:g.indexOf(Number(a));if(t||-1!==n)switch(e.key){case"ArrowRight":if(t)return;return e.preventDefault(),e.stopPropagation(),void(n<g.length-1?b(g[n+1]):r.current?.focus());case"ArrowLeft":return e.preventDefault(),e.stopPropagation(),void(t?b(g[g.length-1]):n>0&&b(g[n-1]));case"Home":if(t)return;return e.preventDefault(),e.stopPropagation(),void b(g[0]);case"End":if(t)return;return e.preventDefault(),e.stopPropagation(),void b(g[g.length-1])}}}})({overflowEnabled:f,childrenArray:b}),y=e.createElement("span",{className:"maxio-tabs__tab__content"},o,e.createElement(w,{variant:"chevron-down",className:"maxio-tabs__more__chevron"})),C=_.map(e=>{return`#${t=u,"undefined"!=typeof CSS&&"function"==typeof CSS.escape?CSS.escape(t):t.replace(/[^a-zA-Z0-9_-]/g,"\\$&")} [role="tablist"] > .maxio-tabs__tab:nth-child(${e+1})`;var t});return e.createElement("div",{id:u,className:g,ref:E,onKeyDownCapture:N},C.length>0&&e.createElement("style",null,`${C.join(", ")} { display: none; }`),e.createElement(l.TabList,h({"aria-label":r,className:"maxio-contents"},s),(b??[]).map((t,a)=>e.cloneElement(t,{key:a,value:a}))),f&&_.length>0&&e.createElement(l.MenuTrigger,{isOpen:p,onOpenChange:x},e.createElement(l.Button,{ref:v,className:"maxio-tabs__tab maxio-tabs__more__trigger","aria-label":o},y),p&&e.createElement(Ce,{hideArrow:!0,placement:"bottom end",className:"maxio-tabs__more__menu"},e.createElement(l.Menu,{"aria-label":`${o} tabs`,onAction:e=>{d?.setSelectedKey(e),requestAnimationFrame(()=>{E.current?.querySelector(`[role="tab"][data-key="${e}"]`)?.focus()})}},_.map(t=>{const a=b[t],{disabled:n,type:r,"aria-label":i,"aria-labelledby":o}=a.props,s="icon"===r?a.props.icon:a.props.children;return e.createElement(l.MenuItem,{key:t,id:t,isDisabled:!!n,"aria-label":i,"aria-labelledby":o,className:"maxio-tabs__more__item"},s)})))))},exports.TabPanel=Rt,exports.TabPanels=({children:t})=>{const a=e.Children.map(t,(t,a)=>{if(!e.isValidElement(t)||t.type!==Rt)throw new Error("You can only pass <TabPanel /> component as children");return e.cloneElement(t,{key:a,value:a})});return e.createElement(l.TabPanels,{className:"maxio-tabs__panels"},a)},exports.Tabs=({children:t,variant:a="line",withDivider:n=!1,defaultIndex:r=0,index:i,onChange:o})=>e.createElement(l.Tabs,{className:"maxio-tabs-container",selectedKey:i,defaultSelectedKey:r,onSelectionChange:e=>o?.(Number(e))},e.createElement(It,{variant:a,withDivider:n},t)),exports.Tag=({children:a,size:n,sentiment:l,kind:r="primary",leadingIcon:i,trailingIcon:o})=>{const s=t("maxio-tag",`maxio-tag--${r}`,!!l&&`maxio-tag--${l}`,!!n&&`maxio-tag--${n}`);return e.createElement("div",{className:s},i&&e.createElement(w,{variant:i,className:"maxio-tag__icon"}),e.createElement("span",{className:"maxio-tag__label"},a),o&&e.createElement(w,{variant:o,className:"maxio-tag__icon"}))},exports.TextArea=et,exports.TextField=Je,exports.TextInput=tt,exports.Tile=({children:a,className:n,href:l,onClick:r,target:i,disabled:o})=>{const s=l||r;if(!s)return e.createElement("div",{className:"maxio-tile"},a);const c=t("maxio-tile",n,{"maxio-tile--clickable":s,"maxio-tile--disabled":o});return e.createElement("a",{className:c,href:l,target:i,onClick:e=>{o&&l&&e.preventDefault(),!o&&r&&r()}},a)},exports.ToastProvider=({children:t,...a})=>{const{maxVisibleToasts:n=5,...l}=a,r=x.useToastState({maxVisibleToasts:n,...l});return e.useEffect(()=>{console.warn("ToastProvider is deprecated. Please use the global toast API instead.")},[]),e.createElement(e.Fragment,null,t(r),r.visibleToasts.length>0&&e.createElement(Vt,h({},a,{state:r})))},exports.ToastQueue=Wt,exports.Toggle=({defaultChecked:a,checked:n,onChange:l,disabled:r,valueDescription:i,valueDescriptionPosition:o,className:s,name:c,id:m,...d})=>{const u=e.useId(),p="boolean"==typeof a,x=m||u,g="left"===o?"row":"row-reverse",b=i&&o,f=e.useCallback(e=>{if("Enter"===e.code||"Space"===e.code){e.preventDefault();const t=e.currentTarget.checked;p&&(e.currentTarget.checked=!t),l&&l(!t,e)}},[p,l]),h=d["aria-label"]||(b?void 0:i);return e.createElement("div",{className:t("maxio-toggle",s,{"maxio-toggle--disabled":r}),style:{display:"inline-flex",flexDirection:g},"data-testid":"toggle-container"},b?e.createElement("label",{className:"maxio-toggle__label",htmlFor:x},i):null,e.createElement("div",{className:"maxio-toggle__container"},e.createElement("input",{type:"checkbox",defaultChecked:a,checked:n,onChange:e=>{l&&l(e.target.checked,e)},onKeyDown:f,disabled:r,className:"maxio-toggle__checkbox",id:x,name:c,"aria-label":h}),e.createElement("div",{className:"maxio-toggle__track",role:"switch","aria-checked":n,"aria-hidden":"true"},e.createElement("div",{className:"maxio-toggle__handle"}),e.createElement("span",{className:"maxio-toggle__icon"},e.createElement("i",{className:"maxio-toggle__icon-on"})),e.createElement("span",{className:"maxio-toggle__icon"},e.createElement("i",{className:"maxio-toggle__icon-off"})))))},exports.Tooltip=V,exports.TooltipTrigger=Y,exports.TopBar=({children:t,actions:a,sideNavIsClosed:n,openSideNav:l})=>e.createElement("nav",{className:"maxio-top-bar"},n&&e.createElement(T,{"aria-label":"Open Side Navigation",variant:"ghost",icon:e.createElement(w,{variant:"sidebar"}),onClick:l}),e.createElement(Ve,{grow:!0,justifyContent:"end"},t),a),exports.useElementResizeObserver=U,exports.useHover=q,exports.useOverlayTrigger=j,exports.useToast=()=>{const t=e.useContext(Ht);if(!t)throw new Error("useToast must be used within a GlobalToastProvider. Please wrap your app with <GlobalToastProvider> to use the global toast API.");return t},exports.useWindowSize=G;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|