PageSourceSearch

https://console.mediasmart.io/_next/static/chunks/6235-d78d8367550f1920.js

js mediasmart.io collected 2026-09-24 09:31:18 UTC 729,982 bytes, 27 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6235],{71206:function(e,t,n){"use strict";let r;n.d(t,{s:function(){return uT}});var l,o,i,a,s,u,c,d,p,h,f,g,m=n(87462),b=n(67294),v=n(45697),y=n.n(v),x=n(3413),w=n(20967),C=n(14696),S=n(17145);let k=b.createContext(void 0);function I(){let e=b.useContext(k);if(void 0===e)throw Error("MUI: Could not find the data grid private context.\nIt looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.\nThis can also happen if you are bundling multiple versions of the data grid.");return e}var R=n(1497),_=n(85893);function E({privateApiRef:e,props:t,children:n}){let r=b.useRef(e.current.getPublicApi());return(0,_.jsx)(R.G.Provider,{value:t,children:(0,_.jsx)(k.Provider,{value:e,children:(0,_.jsx)(S.r.Provider,{value:r,children:n})})})}var M=n(63366),P=n(22316),T=n(14142),Z=n(94780),F=n(33703),D=n(73546),A=n(41796),O=n(77527),z=n(73490);let j={[`.${z._.columnSeparator}, .${z._["columnSeparator--resizing"]}`]:{visibility:"visible",width:"auto"}},L={[`& .${z._.iconButtonContainer}`]:{visibility:"visible",width:"auto"},[`& .${z._.menuIcon}`]:{width:"auto",visibility:"visible"}},H=(0,O.ZP)("div",{name:"MuiDataGrid",slot:"Root",overridesResolver:(e,t)=>[{[`&.${z._.autoHeight}`]:t.autoHeight},{[`&.${z._.aggregationColumnHeader}`]:t.aggregationColumnHeader},{[`&.${z._["aggregationColumnHeader--alignLeft"]}`]:t["aggregationColumnHeader--alignLeft"]},{[`&.${z._["aggregationColumnHeader--alignCenter"]}`]:t["aggregationColumnHeader--alignCenter"]},{[`&.${z._["aggregationColumnHeader--alignRight"]}`]:t["aggregationColumnHeader--alignRight"]},{[`&.${z._.aggregationColumnHeaderLabel}`]:t.aggregationColumnHeaderLabel},{[`&.${z._["root--disableUserSelection"]} .${z._.cell}`]:t["root--disableUserSelection"]},{[`&.${z._.autosizing}`]:t.autosizing},{[`& .${z._.editBooleanCell}`]:t.editBooleanCell},{[`& .${z._["cell--editing"]}`]:t["cell--editing"]},{[`& .${z._["cell--textCenter"]}`]:t["cell--textCenter"]},{[`& .${z._["cell--textLeft"]}`]:t["cell--textLeft"]},{[`& .${z._["cell--textRight"]}`]:t["cell--textRight"]},{[`& .${z._["cell--withRenderer"]}`]:t["cell--withRenderer"]},{[`& .${z._.cell}`]:t.cell},{[`& .${z._["cell--rangeTop"]}`]:t["cell--rangeTop"]},{[`& .${z._["cell--rangeBottom"]}`]:t["cell--rangeBottom"]},{[`& .${z._["cell--rangeLeft"]}`]:t["cell--rangeLeft"]},{[`& .${z._["cell--rangeRight"]}`]:t["cell--rangeRight"]},{[`& .${z._["cell--withRightBorder"]}`]:t["cell--withRightBorder"]},{[`& .${z._.cellContent}`]:t.cellContent},{[`& .${z._.cellCheckbox}`]:t.cellCheckbox},{[`& .${z._.cellSkeleton}`]:t.cellSkeleton},{[`& .${z._.checkboxInput}`]:t.checkboxInput},{[`& .${z._["columnHeader--alignCenter"]}`]:t["columnHeader--alignCenter"]},{[`& .${z._["columnHeader--alignLeft"]}`]:t["columnHeader--alignLeft"]},{[`& .${z._["columnHeader--alignRight"]}`]:t["columnHeader--alignRight"]},{[`& .${z._["columnHeader--dragging"]}`]:t["columnHeader--dragging"]},{[`& .${z._["columnHeader--moving"]}`]:t["columnHeader--moving"]},{[`& .${z._["columnHeader--numeric"]}`]:t["columnHeader--numeric"]},{[`& .${z._["columnHeader--sortable"]}`]:t["columnHeader--sortable"]},{[`& .${z._["columnHeader--sorted"]}`]:t["columnHeader--sorted"]},{[`& .${z._["columnHeader--withRightBorder"]}`]:t["columnHeader--withRightBorder"]},{[`& .${z._.columnHeader}`]:t.columnHeader},{[`& .${z._.headerFilterRow}`]:t.headerFilterRow},{[`& .${z._.columnHeaderCheckbox}`]:t.columnHeaderCheckbox},{[`& .${z._.columnHeaderDraggableContainer}`]:t.columnHeaderDraggableContainer},{[`& .${z._.columnHeaderTitleContainer}`]:t.columnHeaderTitleContainer},{[`& .${z._["columnSeparator--resizable"]}`]:t["columnSeparator--resizable"]},{[`& .${z._["columnSeparator--resizing"]}`]:t["columnSeparator--resizing"]},{[`& .${z._.columnSeparator}`]:t.columnSeparator},{[`& .${z._.filterIcon}`]:t.filterIcon},{[`& .${z._.iconSeparator}`]:t.iconSeparator},{[`& .${z._.menuIcon}`]:t.menuIcon},{[`& .${z._.menuIconButton}`]:t.menuIconButton},{[`& .${z._.menuOpen}`]:t.menuOpen},{[`& .${z._.menuList}`]:t.menuList},{[`& .${z._["row--editable"]}`]:t["row--editable"]},{[`& .${z._["row--editing"]}`]:t["row--editing"]},{[`& .${z._["row--dragging"]}`]:t["row--dragging"]},{[`& .${z._.row}`]:t.row},{[`& .${z._.rowReorderCellPlaceholder}`]:t.rowReorderCellPlaceholder},{[`& .${z._.rowReorderCell}`]:t.rowReorderCell},{[`& .${z._["rowReorderCell--draggable"]}`]:t["rowReorderCell--draggable"]},{[`& .${z._.sortIcon}`]:t.sortIcon},{[`& .${z._.withBorderColor}`]:t.withBorderColor},{[`& .${z._.treeDataGroupingCell}`]:t.treeDataGroupingCell},{[`& .${z._.treeDataGroupingCellToggle}`]:t.treeDataGroupingCellToggle},{[`& .${z._.detailPanelToggleCell}`]:t.detailPanelToggleCell},{[`& .${z._["detailPanelToggleCell--expanded"]}`]:t["detailPanelToggleCell--expanded"]},t.root]})(({theme:e})=>{let t=e.vars?e.vars.palette.TableCell.border:"light"===e.palette.mode?(0,A.$n)((0,A.Fq)(e.palette.divider,1),.88):(0,A._j)((0,A.Fq)(e.palette.divider,1),.68),n=e.shape.borderRadius;return(0,m.Z)({"--unstable_DataGrid-radius":"number"==typeof n?`${n}
1px`:n,"--unstable_DataGrid-headWeight":e.typography.fontWeightMedium,"--unstable_DataGrid-overlayBackground":e.vars?`rgba(${e.vars.palette.background.defaultChannel} / ${e.vars.palette.action.disabledOpacity})`:(0,A.Fq)(e.palette.background.default,e.palette.action.disabledOpacity),"--DataGrid-cellOffsetMultiplier":2,flex:1,boxSizing:"border-box",position:"relative",borderWidth:"1px",borderStyle:"solid",borderColor:t,borderRadius:"var(--unstable_DataGrid-radius)",color:(e.vars||e).palette.text.primary},e.typography.body2,{outline:"none",height:"100%",display:"flex",minWidth:0,minHeight:0,flexDirection:"column",overflowAnchor:"none",[`&.${z._.autoHeight}`]:{height:"auto",[`& .${z._["row--lastVisible"]} .${z._.cell}`]:{borderBottomColor:"transparent"}},[`&.${z._.autosizing}`]:{[`& .${z._.columnHeaderTitleContainerContent} > *`]:{overflow:"visible !important"},[`& .${z._.cell} > *`]:{overflow:"visible !important",whiteSpace:"nowrap"},[`& .${z._.groupingCriteriaCell}`]:{width:"unset"},[`& .${z._.treeDataGroupingCell}`]:{width:"unset"}},[`& .${z._["virtualScrollerContent--overflowed"]} .${z._["row--lastVisible"]} .${z._.cell}`]:{borderBottomColor:"transparent"},[`& .${z._.columnHeader}, & .${z._.cell}`]:{WebkitTapHighlightColor:"transparent",lineHeight:null,padding:"0 10px",boxSizing:"border-box"},[`& .${z._.columnHeader}:focus-within, & .${z._.cell}:focus-within`]:{outline:`solid ${e.vars?`rgba(${e.vars.palette.primary.mainChannel} / 0.5)`:(0,A.Fq)(e.palette.primary.main,.5)} 1px`,outlineWidth:1,outlineOffset:-1},[`& .${z._.columnHeader}:focus, & .${z._.cell}:focus`]:{outline:`solid ${e.palette.primary.main} 1px`},[`& .${z._.columnHeaderCheckbox}, & .${z._.cellCheckbox}`]:{padding:0,justifyContent:"center",alignItems:"center"},[`& .${z._.columnHeader}`]:{position:"relative",display:"flex",alignItems:"center"},[`& .${z._["columnHeader--sorted"]} .${z._.iconButtonContainer}, & .${z._["columnHeader--filtered"]} .${z._.iconButtonContainer}`]:{visibility:"visible",width:"auto"},[`& .${z._.columnHeader}:not(.${z._["columnHeader--sorted"]}) .${z._.sortIcon}`]:{opacity:0,transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.shorter})},[`& .${z._.columnHeaderTitleContainer}`]:{display:"flex",alignItems:"center",minWidth:0,flex:1,whiteSpace:"nowrap",overflow:"hidden",position:"relative"},[`& .${z._.columnHeaderTitleContainerContent}`]:{overflow:"hidden",display:"flex",alignItems:"center"},[`& .${z._["columnHeader--filledGroup"]} .${z._.columnHeaderTitleContainer}`]:{borderBottomWidth:"1px",borderBottomStyle:"solid",boxSizing:"border-box"},[`& .${z._["columnHeader--filledGroup"]}.${z._["columnHeader--showColumnBorder"]} .${z._.columnHeaderTitleContainer}`]:{borderBottom:"none"},[`& .${z._["columnHeader--filledGroup"]}.${z._["columnHeader--showColumnBorder"]}`]:{borderBottomWidth:"1px",borderBottomStyle:"solid",boxSizing:"border-box"},[`& .${z._.headerFilterRow}`]:{borderTop:`1px solid ${t}`},[`& .${z._.sortIcon}, & .${z._.filterIcon}`]:{fontSize:"inherit"},[`& .${z._["columnHeader--sortable"]}`]:{cursor:"pointer"},[`& .${z._["columnHeader--alignCenter"]} .${z._.columnHeaderTitleContainer}`]:{justifyContent:"center"},[`& .${z._["columnHeader--alignRight"]} .${z._.columnHeaderDraggableContainer}, & .${z._["columnHeader--alignRight"]} .${z._.columnHeaderTitleContainer}`]:{flexDirection:"row-reverse"},[`& .${z._["columnHeader--alignCenter"]} .${z._.menuIcon}, & .${z._["columnHeader--alignRight"]} .${z._.menuIcon}`]:{marginRight:"auto",marginLeft:-6},[`& .${z._["columnHeader--alignRight"]} .${z._.menuIcon}, & .${z._["columnHeader--alignRight"]} .${z._.menuIcon}`]:{marginRight:"auto",marginLeft:-10},[`& .${z._["columnHeader--moving"]}`]:{backgroundColor:(e.vars||e).palette.action.hover},[`& .${z._.columnSeparator}`]:{visibility:"hidden",position:"absolute",zIndex:100,display:"flex",flexDirection:"column",justifyContent:"center",color:t},"@media (hover: hover)":{[`& .${z._.columnHeaders}:hover`]:j,[`& .${z._.columnHeader}:hover`]:L,[`& .${z._.columnHeader}:not(.${z._["columnHeader--sorted"]}):hover .${z._.sortIcon}`]:{opacity:.5}},"@media (hover: none)":{[`& .${z._.columnHeaders}`]:j,[`& .${z._.columnHeader}`]:L},[`& .${z._["columnSeparator--sideLeft"]}`]:{left:-12},[`& .${z._["columnSeparator--sideRight"]}`]:{right:-12},[`& .${z._["columnSeparator--resizable"]}`]:{cursor:"col-resize",touchAction:"none","&:hover":{color:(e.vars||e).palette.text.primary,"@media (hover: none)":{color:t}},[`&.${z._["columnSeparator--resizing"]}`]:{color:(e.vars||e).palette.text.primary},"& svg":{pointerEvents:"none"}},[`& .${z._.iconSeparator}`]:{color:"inherit"},[`& .${z._.menuIcon}`]:{width:0,visibility:"hidden",fontSize:20,marginRight:-10,display:"flex",alignItems:"center"},[`.${z._.menuOpen}`]:{visibility:"visible",width:"auto"},[`& .${z._.row}`]:{display:"flex",width:"fit-content",breakInside:"avoid","&:hover, &.Mui-hovered":{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},"&.Mui-selected":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,A.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover, &.Mui-hovered":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(
2                ${e.vars.palette.action.selectedOpacity} + 
3                ${e.vars.palette.action.hoverOpacity}
4              ))`:(0,A.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,A.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity)}}}},[`& .${z._.cell}`]:{display:"flex",alignItems:"center",borderBottom:"1px solid","&.Mu
4i-selected":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,A.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover, &.Mui-hovered":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity+e.palette.action.hoverOpacity})`:(0,A.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,A.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity)}}}},[`&.${z._["root--disableUserSelection"]} .${z._.cell}`]:{userSelect:"none"},[`& .${z._.row}:not(.${z._["row--dynamicHeight"]}) > .${z._.cell}`]:{overflow:"hidden",whiteSpace:"nowrap"},[`& .${z._.cellContent}`]:{overflow:"hidden",textOverflow:"ellipsis"},[`& .${z._.cell}.${z._["cell--selectionMode"]}`]:{cursor:"default"},[`& .${z._.cell}.${z._["cell--editing"]}`]:{padding:1,display:"flex",boxShadow:e.shadows[2],backgroundColor:(e.vars||e).palette.background.paper,"&:focus-within":{outline:`solid ${(e.vars||e).palette.primary.main} 1px`,outlineOffset:"-1px"}},[`& .${z._["row--editing"]}`]:{boxShadow:e.shadows[2]},[`& .${z._["row--editing"]} .${z._.cell}`]:{boxShadow:e.shadows[0],backgroundColor:(e.vars||e).palette.background.paper},[`& .${z._.editBooleanCell}`]:{display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center"},[`& .${z._.booleanCell}[data-value="true"]`]:{color:(e.vars||e).palette.text.secondary},[`& .${z._.booleanCell}[data-value="false"]`]:{color:(e.vars||e).palette.text.disabled},[`& .${z._.actionsCell}`]:{display:"inline-flex",alignItems:"center",gridGap:e.spacing(1)},[`& .${z._.rowReorderCell}`]:{display:"inline-flex",flex:1,alignItems:"center",justifyContent:"center",opacity:(e.vars||e).palette.action.disabledOpacity},[`& .${z._["rowReorderCell--draggable"]}`]:{cursor:"move",opacity:1},[`& .${z._.rowReorderCellContainer}`]:{padding:0,alignItems:"stretch"},[`.${z._.withBorderColor}`]:{borderColor:t},[`& .${z._["cell--withRightBorder"]}`]:{borderRightWidth:"1px",borderRightStyle:"solid"},[`& .${z._["columnHeader--withRightBorder"]}`]:{borderRightWidth:"1px",borderRightStyle:"solid"},[`& .${z._["cell--textLeft"]}`]:{justifyContent:"flex-start"},[`& .${z._["cell--textRight"]}`]:{justifyContent:"flex-end"},[`& .${z._["cell--textCenter"]}`]:{justifyContent:"center"},[`& .${z._.columnHeaderDraggableContainer}`]:{display:"flex",width:"100%",height:"100%"},[`& .${z._.rowReorderCellPlaceholder}`]:{display:"none"},[`& .${z._["columnHeader--dragging"]}, & .${z._["row--dragging"]}`]:{background:(e.vars||e).palette.background.paper,padding:"0 12px",borderRadius:"var(--unstable_DataGrid-radius)",opacity:(e.vars||e).palette.action.disabledOpacity},[`& .${z._["row--dragging"]}`]:{background:(e.vars||e).palette.background.paper,padding:"0 12px",borderRadius:"var(--unstable_DataGrid-radius)",opacity:(e.vars||e).palette.action.disabledOpacity,[`& .${z._.rowReorderCellPlaceholder}`]:{display:"flex"}},[`& .${z._.treeDataGroupingCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${z._.treeDataGroupingCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:e.spacing(2)},[`& .${z._.groupingCriteriaCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${z._.groupingCriteriaCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:e.spacing(2)}})});var B=n(48836),N=n(31509),V=n(90198),$=n(89937);let U=e=>e.columnGrouping,G=(0,$.Xw)(U,e=>{var t;return null!=(t=null==e?void 0:e.unwrappedGroupingModel)?t:{}}),q=(0,$.Xw)(U,e=>{var t;return null!=(t=null==e?void 0:e.lookup)?t:{}}),W=(0,$.Xw)(U,e=>{var t;return null!=(t=null==e?void 0:e.headerStructure)?t:[]}),K=(0,$.P1)(U,e=>{var t;return null!=(t=null==e?void 0:e.maxDepth)?t:0});var Y=n(40670);let X=()=>{var e;let t=I(),n=(0,B.B)(),r=(0,C.P)(t,V.FE),l=(0,C.P)(t,Y.hh),o=(0,C.P)(t,K),i=(0,C.P)(t,Y.J5),a="grid";return null!=(e=n.experimentalFeatures)&&e.ariaV7&&n.treeData&&(a="treegrid"),{role:a,"aria-colcount":r.length,"aria-rowcount":o+1+i+l,"aria-multiselectable":!n.disableMultipleRowSelection}},J=["children","className"],Q=e=>{let{autoHeight:t,density:n,classes:r}=e,l={root:["root",t&&"autoHeight",`root--density${(0,T.Z)(n)}`,"withBorderColor"]};return(0,Z.Z)(l,z.d,r)},ee=b.forwardRef(function(e,t){var n;let r=(0,B.B)(),{children:l,className:o}=e,i=(0,M.Z)(e,J),a=I(),s=(0,C.P)(a,N.Jz),u=b.useRef(null),c=(0,F.Z)(u,t),d=null!=(n=r.experimentalFeatures)&&n.ariaV7?null:X,p="function"==typeof d?d():null,h=(0,m.Z)({},r,{density:s}),f=Q(h);a.current.register("public",{rootElementRef:u});let[g,v]=b.useState(!1);return((0,D.Z)(()=>{v(!0)},[]),g)?(0,_.jsx)(H,(0,m.Z)({ref:c,className:(0,P.Z)(o,f.root),ownerState:h},p,i,{children:l})):null});function et(){var e,t;let n=(0,B.B)();return(0,_.jsxs)(b.Fragment,{children:[(0,_.jsx)(n.slots.preferencesPanel,(0,m.Z)({},null==(e=n.slotProps)?void 0:e.preferencesPanel)),n.slots.toolbar&&(0,_.jsx)(n.slots.toolbar,(0,m.Z)({},null==(t=n.slotProps)?void 0:t.toolbar))]})}var en=n(45098);let er=e=>{let{classes:t}=e;return(0,Z.Z)({root:["main"]},z.d,t)},el=(0,en.Z)("div",{name:"MuiDataGrid",slot:"Main",overridesResolver:(e,t)=>t.main})(()=>({position:"relative",flexGrow:1,display:"flex",flexDirection:"column",overflow:"hidden"})),eo=b.forwardRef((e,t)=>
4{var n;let r=(0,B.B)(),l=er(r),o=null!=(n=r.experimentalFeatures)&&n.ariaV7?X:null,i="function"==typeof o?o():null;return(0,_.jsx)(el,(0,m.Z)({ref:t,className:l.root,ownerState:r},i,{children:e.children}))});var ei=n(61207),ea=n(83614),es=n(35543);let eu=e=>e.columnMenu;function ec(e){let{VirtualScrollerComponent:t,ColumnHeadersProps:n,children:r}=e,l=I(),o=(0,B.B)(),i=b.useRef(null),a=(0,C.P)(l,V.FE),s=(0,C.P)(l,ei.AF),u=(0,C.P)(l,ea.Nl),c=(0,C.P)(l,V.Ag),d=(0,C.P)(l,es.X5),p=(0,C.P)(l,es.d6),h=(0,C.P)(l,es.E5),f=(0,C.P)(l,es.ud),g=(0,C.P)(l,es.Gs),v=(0,C.P)(l,N.CD),y=(0,C.P)(l,K),x=(0,C.P)(l,eu),w=(0,C.P)(l,V.g0),S=(0,C.P)(l,W);(0,D.Z)(()=>{let e;l.current.computeSizeAndPublishResizeEvent();let t=i.current;if("undefined"==typeof ResizeObserver)return()=>{};let n=new ResizeObserver(()=>{e=requestAnimationFrame(()=>{l.current.computeSizeAndPublishResizeEvent()})});return t&&n.observe(t),()=>{e&&window.cancelAnimationFrame(e),t&&n.unobserve(t)}},[l]);let k=b.useRef(null),R=b.useRef(null),E=b.useRef(null);l.current.register("private",{columnHeadersContainerElementRef:R,columnHeadersElementRef:k,virtualScrollerRef:E,mainElementRef:i});let M=!!l.current.getRootDimensions();return(0,_.jsxs)(eo,{ref:i,children:[(0,_.jsx)(o.slots.columnHeaders,(0,m.Z)({ref:R,innerRef:k,visibleColumns:a,filterColumnLookup:s,sortColumnLookup:u,columnPositions:c,columnHeaderTabIndexState:d,columnGroupHeaderTabIndexState:h,columnHeaderFocus:f,columnGroupHeaderFocus:g,densityFactor:v,headerGroupingMaxDepth:y,columnMenuState:x,columnVisibility:w,columnGroupsHeaderStructure:S,hasOtherElementInTabSequence:!(null===h&&null===d&&null===p)},n)),M&&(0,_.jsx)(t,{ref:E}),r]})}function ed(){var e;let t=(0,B.B)();return t.hideFooter?null:(0,_.jsx)(t.slots.footer,(0,m.Z)({},null==(e=t.slotProps)?void 0:e.footer))}var ep=n(24791);function eh(e,t,n){let r=b.useRef(!0);b.useEffect(()=>{r.current=!1,e.current.register(n,t)},[e,n,t]),r.current&&e.current.register(n,t)}let ef=(0,ep.Vu)()&&null!=window.localStorage.getItem("DEBUG"),eg=()=>{},em={debug:eg,info:eg,warn:eg,error:eg},eb=["debug","info","warn","error"];function ev(e,t,n=console){let r=eb.indexOf(t);if(-1===r)throw Error(`MUI: Log level ${t} not recognized.`);return eb.reduce((t,l,o)=>(o>=r?t[l]=(...t)=>{let[r,...o]=t;n[l](`MUI: ${e} - ${r}`,...o)}:t[l]=eg,t),{})}let ey=(e,t)=>{eh(e,{getLogger:b.useCallback(e=>ef?ev(e,"debug",t.logger):t.logLevel?ev(e,t.logLevel.toString(),t.logger):em,[t.logLevel,t.logger])},"private")};class ex{static create(e){return new ex(e)}constructor(e){this.value=void 0,this.listeners=void 0,this.subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)}),this.getSnapshot=()=>this.value,this.update=e=>{this.value=e,this.listeners.forEach(t=>t(e))},this.value=e,this.listeners=new Set}}var ew=n(8596);class eC{constructor(){this.maxListeners=20,this.warnOnce=!1,this.events={}}on(e,t,n={}){let r=this.events[e];r||(r={highPriority:new Map,regular:new Map},this.events[e]=r),n.isFirst?r.highPriority.set(t,!0):r.regular.set(t,!0)}removeListener(e,t){this.events[e]&&(this.events[e].regular.delete(t),this.events[e].highPriority.delete(t))}removeAllListeners(){this.events={}}emit(e,...t){let n=this.events[e];if(!n)return;let r=Array.from(n.highPriority.keys()),l=Array.from(n.regular.keys());for(let e=r.length-1;e>=0;e-=1){let l=r[e];n.highPriority.has(l)&&l.apply(this,t)}for(let e=0;e<l.length;e+=1){let r=l[e];n.regular.has(r)&&r.apply(this,t)}}once(e,t){let n=this;this.on(e,function r(...l){n.removeListener(e,r),t.apply(n,l)})}}let eS=Symbol("mui.api_private"),ek=e=>void 0!==e.isPropagationStopped,eI=0,eR=(e,t)=>{let n=b.useCallback(e=>{if(null==t.localeText[e])throw Error(`Missing translation for key ${e}.`);return t.localeText[e]},[t.localeText]);e.current.register("public",{getLocaleText:n})};var e_=n(19376);let eE=e=>{let t=b.useRef({}),n=b.useRef(!1),r=b.useCallback(e=>{!n.current&&e&&(n.current=!0,Object.values(e.appliers).forEach(e=>{e()}),n.current=!1)},[]),l=b.useCallback((e,n,l)=>{t.current[e]||(t.current[e]={processors:new Map,appliers:{}});let o=t.current[e];return o.processors.get(n)!==l&&(o.processors.set(n,l),r(o)),()=>{t.current[e].processors.set(n,null)}},[r]),o=b.useCallback((e,n,r)=>(t.current[e]||(t.current[e]={processors:new Map,appliers:{}}),t.current[e].appliers[n]=r,()=>{let r=t.current[e].appliers,l=(0,M.Z)(r,[n].map(e_.Z));t.current[e].appliers=l}),[]),i=b.useCallback(e=>{r(t.current[e])},[r]),a=b.useCallback((...e)=>
4{let[n,r,l]=e;return t.current[n]?Array.from(t.current[n].processors.values()).reduce((e,t)=>t?t(e,l):e,r):r},[]);eh(e,{registerPipeProcessor:l,registerPipeApplier:o,requestPipeProcessorsApplication:i},"private"),eh(e,{unstable_applyPipeProcessors:a},"public")},eM="none",eP={rowTreeCreation:"rowTree",filtering:"rowTree",sorting:"rowTree",visibleRowsLookupCreation:"rowTree"},eT=e=>{let t=b.useRef(new Map),n=b.useRef({}),r=b.useCallback((t,r,l)=>{n.current[r]||(n.current[r]={});let o=n.current[r],i=o[t];return o[t]=l,i&&i!==l&&t===e.current.getActiveStrategy(eP[r])&&e.current.publishEvent("activeStrategyProcessorChange",r),()=>{let e=n.current[r],l=(0,M.Z)(e,[t].map(e_.Z));n.current[r]=l}},[e]),l=b.useCallback((t,r)=>{let l=e.current.getActiveStrategy(eP[t]);if(null==l)throw Error("Can't apply a strategy processor before defining an active strategy");let o=n.current[t];if(!o||!o[l])throw Error(`No processor found for processor "${t}" on strategy "${l}"`);return(0,o[l])(r)},[e]),o=b.useCallback(e=>{var n;let r=Array.from(t.current.entries()).find(([,t])=>t.group===e&&t.isAvailable());return null!=(n=null==r?void 0:r[0])?n:eM},[]),i=b.useCallback((n,r,l)=>{t.current.set(r,{group:n,isAvailable:l}),e.current.publishEvent("strategyAvailabilityChange")},[e]);eh(e,{registerStrategyProcessor:r,applyStrategyProcessor:l,getActiveStrategy:o,setStrategyAvailability:i},"private")},eZ=(e,t)=>{let n=b.useRef({}),[,r]=b.useState(),l=b.useCallback(e=>{n.current[e.stateId]=e},[]),o=b.useCallback((r,l)=>{let o;if(o=(0,ep.mf)(r)?r(e.current.state):r,e.current.state===o)return!1;let i=!1,a=[];if(Object.keys(n.current).forEach(t=>{let r=n.current[t],l=r.stateSelector(e.current.state,e.current.instanceId),s=r.stateSelector(o,e.current.instanceId);s!==l&&(a.push({stateId:r.stateId,hasPropChanged:s!==r.propModel}),void 0!==r.propModel&&s!==r.propModel&&(i=!0))}),a.length>1)throw Error(`You're not allowed to update several sub-state in one transaction. You already updated ${a[0].stateId}, therefore, you're not allowed to update ${a.map(e=>e.stateId).join(", ")} in the same transaction.`);if(i||(e.current.state=o,e.current.publishEvent&&e.current.publishEvent("stateChange",o),e.current.store.update(o)),1===a.length){let{stateId:r,hasPropChanged:s}=a[0],u=n.current[r],c=u.stateSelector(o,e.current.instanceId);if(u.propOnChange&&s){let n=t.signature===ew.cG.DataGridPro?{api:e.current,reason:l}:{reason:l};u.propOnChange(c,n)}i||e.current.publishEvent(u.changeEvent,c,{reason:l})}return!i},[e,t.signature]),i=b.useCallback((t,n,r)=>e.current.setState(e=>(0,m.Z)({},e,{[t]:n(e[t])}),r),[e]),a=b.useCallback(()=>r(()=>e.current.state),[e]);eh(e,{setState:o,forceUpdate:a},"public"),eh(e,{updateControlState:i,registerControlState:l},"private")},eF=(e,t)=>{let n=function(e,t){let n=b.useRef(),r=b.useRef();if(r.current||(r.current=function(e){var t;let n=null==(t=e.current)?void 0:t[eS];if(n)return n;let r={},l={state:r,store:ex.create(r),instanceId:{id:eI}};return eI+=1,l.getPublicApi=()=>e.current,l.register=(t,n)=>{Object.keys(n).forEach(r=>{let o=n[r],i=l[r];if((null==i?void 0:i.spying)===!0?i.target=o:l[r]=o,"public"===t){let t=e.current,n=t[r];(null==n?void 0:n.spying)===!0?n.target=o:t[r]=o}})},l.register("private",{caches:{},eventManager:new eC}),l}(n)),!n.current){var l;n.current={get state(){return l.current.state},get store(){return l.current.store},get instanceId(){return l.current.instanceId},[eS]:(l=r).current}}let o=b.useCallback((...e)=>{let[n,l,o={}]=e;if(o.defaultMuiPrevented=!1,ek(o)&&o.isPropagationStopped())return;let i=t.signature===ew.cG.DataGridPro?{api:r.current.getPublicApi()}:{};r.current.eventManager.emit(n,l,o,i)},[r,t.signature]),i=b.useCallback((e,t,n)=>{r.current.eventManager.on(e,t,n);let l=r.current;return()=>{l.eventManager.removeListener(e,t)}},[r]);return eh(r,{subscribeEvent:i,publishEvent:o},"public"),b.useImperativeHandle(e,()=>n.current,[n]),b.useEffect(()=>{let e=r.current;return()=>{e.publishEvent("unmount")}},[r]),r}(e,t);return ey(n,t),eZ(n,t),eE(n),eT(n),eR(n,t),n.current.register("private",{rootProps:t}),n},eD=e=>{let t=b.useRef(!0);t.current&&(t.current=!1,e())}
4,eA=(e,t,n)=>{let r=b.useRef(),l=b.useRef(`mui-${Math.round(1e9*Math.random())}`),o=b.useCallback(()=>{r.current=e.current.registerPipeProcessor(t,l.current,n)},[e,n,t]);eD(()=>{o()});let i=b.useRef(!0);b.useEffect(()=>(i.current?i.current=!1:o(),()=>{r.current&&(r.current(),r.current=null)}),[o])};var eO=n(39410);let ez=e=>{let{classes:t}=e;return b.useMemo(()=>(0,Z.Z)({cellCheckbox:["cellCheckbox"],columnHeaderCheckbox:["columnHeaderCheckbox"]},z.d,t),[t])},ej=(e,t)=>{let n=ez({classes:t.classes}),r=b.useCallback(r=>{let l=(0,m.Z)({},eO.n,{cellClassName:n.cellCheckbox,headerClassName:n.columnHeaderCheckbox,headerName:e.current.getLocaleText("checkboxSelectionHeaderName")}),o=t.checkboxSelection,i=null!=r.lookup[eO.e];return o&&!i?(r.lookup[eO.e]=l,r.orderedFields=[eO.e,...r.orderedFields]):!o&&i?(delete r.lookup[eO.e],r.orderedFields=r.orderedFields.filter(e=>e!==eO.e)):o&&i&&(r.lookup[eO.e]=(0,m.Z)({},l,r.lookup[eO.e])),r},[e,n,t.checkboxSelection]);eA(e,"hydrateColumns",r)},eL=(e,t,n,r)=>{let l=b.useCallback(()=>{e.current.registerStrategyProcessor(t,n,r)},[e,r,n,t]);eD(()=>{l()});let o=b.useRef(!0);b.useEffect(()=>{o.current?o.current=!1:l()},[l])};var eH=n(4260);let eB=e=>{let t={[eH.U5]:(0,m.Z)({},(0,eH.E2)(),{children:e})};for(let n=0;n<e.length;n+=1){let r=e[n];t[r]={id:r,depth:0,parent:eH.U5,type:"leaf",groupingKey:null}}return{groupingName:eM,tree:t,treeDepths:{0:e.length},dataRowIds:e}},eN=({previousTree:e,actions:t})=>{let n=(0,m.Z)({},e),r={};for(let e=0;e<t.remove.length;e+=1){let l=t.remove[e];r[l]=!0,delete n[l]}for(let e=0;e<t.insert.length;e+=1){let r=t.insert[e];n[r]={id:r,depth:0,parent:eH.U5,type:"leaf",groupingKey:null}}let l=n[eH.U5],o=[...l.children,...t.insert];return Object.values(r).length&&(o=o.filter(e=>!r[e])),n[eH.U5]=(0,m.Z)({},l,{children:o}),{groupingName:eM,tree:n,treeDepths:{0:o.length},dataRowIds:o}},eV=e=>"full"===e.updates.type?eB(e.updates.rows):eN({previousTree:e.previousTree,actions:e.updates.actions}),e$=e=>{eL(e,eM,"rowTreeCreation",eV)},eU=(e,t,n)=>{let r=b.useRef(!1);r.current||(t.current.state=e(t.current.state,n,t),r.current=!0)};function eG(e,t){let n=b.useRef(null);if(n.current)return n.current;let r=e.current.getLogger(t);return n.current=r,r}let eq=e=>(0,m.Z)({},e,{headerFiltering:{editing:null,menuOpen:null}}),eW=(e,t)=>{let n=eG(e,"useGridHeaderFiltering"),r=b.useCallback(n=>{e.current.setState(e=>{var r,l;return"DataGrid"===t.signature?e:(0,m.Z)({},e,{headerFiltering:{editing:null!=(r=n.editing)?r:null,menuOpen:null!=(l=n.menuOpen)?l:null}})}),e.current.forceUpdate()},[e,t.signature]),l=b.useCallback(t=>{n.debug(`Starting edit mode on header filter for field: ${t}`),e.current.setHeaderFilterState({editing:t})},[e,n]),o=b.useCallback(()=>{n.debug("Stopping edit mode on header filter"),e.current.setHeaderFilterState({editing:null})},[e,n]),i=b.useCallback(t=>{n.debug(`Opening header filter menu for field: ${t}`),e.current.setHeaderFilterState({menuOpen:t})},[e,n]),a=b.useCallback(()=>{n.debug("Hiding header filter menu for active field");let t=e.current.state.headerFiltering.menuOpen;if(t){let n=(0,V.WH)(e),r=(0,V.g0)(e),l=(0,V.Zi)(e);if(n[t]||(t=l[0]),!1===r[t]){let e=l.filter(e=>e===t||!1!==r[e]),n=e.indexOf(t);t=e[n+1]||e[n-1]}e.current.setHeaderFilterState({menuOpen:null}),e.current.setColumnHeaderFilterFocus(t)}},[e,n]);eh(e,{startHeaderFilterEditMode:l,stopHeaderFilterEditMode:o,showHeaderFilterMenu:i,hideHeaderFilterMenu:a},"public"),eh(e,{setHeaderFilterState:r},"private")};var eK=n(7083),eY=n(48949),eX=n(25136),eJ=n(5059),eQ=n(18745),e0=n(92996),e1=n(10980),e2=n(21640),e3=n(93454),e4=n(75527),e5=n(49630);let e9=["open","target","onClose","children","position","className","onExited"],e6=e=>{let{classes:t}=e;return(0,Z.Z)({root:["menu"]},z.d,t)},e8=(0,O.ZP)(e4.Z,{name:"MuiDataGrid",slot:"Menu",overridesResolver:(e,t)=>t.menu})(({theme:e})=>({zIndex:e.zIndex.modal,[`& .${z._.menuList}`]:{outline:0}})),e7={"bottom-start":"top left","bottom-end":"top right"};function te(e){var t;let{open:n,target:r,onClose:l,children:o,position:i,className:a,onExited:s}=e,u=(0,M.Z)(e,e9),c=(0,e5.l)(),d=(0,B.B)(),p=e6(d),h=b.useRef(null);(0,D.Z)(()=>
4{if(n)h.current=document.activeElement instanceof HTMLElement?document.activeElement:null;else{var e,t;null==(e=h.current)||null==(t=e.focus)||t.call(e),h.current=null}},[n]),b.useEffect(()=>{let e=n?"menuOpen":"menuClose";c.current.publishEvent(e,{target:r})},[c,n,r]);let f=e=>t=>{e&&e(),s&&s(t)},g=e=>{e.target&&(r===e.target||null!=r&&r.contains(e.target))||l(e)};return(0,_.jsx)(e8,(0,m.Z)({as:d.slots.basePopper,className:(0,P.Z)(a,p.root),ownerState:d,open:n,anchorEl:r,transition:!0,placement:i},u,null==(t=d.slotProps)?void 0:t.basePopper,{children:({TransitionProps:e,placement:t})=>(0,_.jsx)(e1.d,{onClickAway:g,mouseEvent:"onMouseDown",children:(0,_.jsx)(e2.Z,(0,m.Z)({},e,{style:{transformOrigin:e7[t]},onExited:f(null==e?void 0:e.onExited),children:(0,_.jsx)(e3.Z,{children:o})}))})}))}let tt=["api","colDef","id","hasFocus","isEditable","field","value","formattedValue","row","rowNode","cellMode","tabIndex","position","focusElementRef"],tn=e=>"function"==typeof e.getActions;function tr(e){var t;let{colDef:n,id:r,hasFocus:l,tabIndex:o,position:i="bottom-end",focusElementRef:a}=e,s=(0,M.Z)(e,tt),[u,c]=b.useState(-1),[d,p]=b.useState(!1),h=(0,e5.l)(),f=b.useRef(null),g=b.useRef(null),v=b.useRef(!1),y=b.useRef({}),x=(0,eQ.Z)(),w=(0,e0.Z)(),C=(0,e0.Z)(),S=(0,B.B)();if(!tn(n))throw Error("MUI: Missing the `getActions` property in the `GridColDef`.");let k=n.getActions(h.current.getRowParams(r)),I=k.filter(e=>!e.props.showInMenu),R=k.filter(e=>e.props.showInMenu),E=I.length+(R.length?1:0);b.useLayoutEffect(()=>{l||Object.entries(y.current).forEach(([e,t])=>{null==t||t.stop({},()=>{delete y.current[e]})})},[l]),b.useEffect(()=>{u<0||!f.current||u>=f.current.children.length||f.current.children[u].focus({preventScroll:!0})},[u]),b.useEffect(()=>{l||(c(-1),v.current=!1)},[l]),b.useImperativeHandle(a,()=>({focus(){v.current||c(k.findIndex(e=>!e.props.disabled))}}),[k]),b.useEffect(()=>{u>=E&&c(E-1)},[u,E]);let P=()=>{p(!1)},T=e=>t=>{y.current[e]=t},Z=(e,t)=>n=>{c(e),v.current=!0,t&&t(n)};return(0,_.jsxs)("div",(0,m.Z)({role:"menu",ref:f,tabIndex:-1,className:z._.actionsCell,onKeyDown:e=>{if(E<=1)return;let t=(e,n)=>{var r;if(e<0||e>k.length)return e;let l=("left"===n?-1:1)*("rtl"===x.direction?-1:1);return null!=(r=k[e+l])&&r.props.disabled?t(e+l,n):e+l},n=u;"ArrowRight"===e.key?n=t(u,"right"):"ArrowLeft"===e.key&&(n=t(u,"left")),n<0||n>=E||n===u||(e.preventDefault(),e.stopPropagation(),c(n))}},s,{children:[I.map((e,t)=>b.cloneElement(e,{key:t,touchRippleRef:T(t),onClick:Z(t,e.props.onClick),tabIndex:u===t?o:-1})),R.length>0&&C&&(0,_.jsx)(S.slots.baseIconButton,(0,m.Z)({ref:g,id:C,"aria-label":h.current.getLocaleText("actionsCellMore"),"aria-haspopup":"menu","aria-expanded":d,"aria-controls":d?w:void 0,role:"menuitem",size:"small",onClick:()=>{p(!0),c(E-1),v.current=!0},touchRippleRef:T(C),tabIndex:u===I.length?o:-1},null==(t=S.slotProps)?void 0:t.baseIconButton,{children:(0,_.jsx)(S.slots.moreActionsIcon,{fontSize:"small"})})),R.length>0&&(0,_.jsx)(te,{open:d,target:g.current,position:i,onClose:P,children:(0,_.jsx)(eJ.Z,{id:w,className:z._.menuList,onKeyDown:e=>{"Tab"===e.key&&e.preventDefault(),["Tab","Escape"].includes(e.key)&&P()},"aria-labelledby":C,variant:"menu",autoFocusItem:!0,children:R.map((e,t)=>b.cloneElement(e,{key:t,closeMenu:P}))})})]}))}let tl="actions",to=(0,m.Z)({},eX.z,{sortable:!1,filterable:!1,aggregable:!1,width:100,align:"center",headerAlign:"center",headerName:"",disableColumnMenu:!0,disableExport:!0,renderCell:e=>(0,_.jsx)(tr,(0,m.Z)({},e)),getApplyQuickFilterFn:void 0,getApplyQuickFilterFnV7:void 0});var ti=((l=ti||{}).Cell="cell",l.Row="row",l),ta=((o=ta||{}).Edit="edit",o.View="view",o),ts=((i=ts||{}).Edit="edit",i.View="view",i),tu=n(41592);let tc=(e,t)=>{let n,r;return t.pagination&&"client"===t.paginationMode?(r=(0,eY.Uj)(e),n=(0,eY.Mk)(e)):r=0===(n=(0,ei.D7)(e)).length?null:{firstRowIndex:0,lastRowIndex:n.length-1},{rows:n,range:r}},td=(e,t)=>{let n=tc(e,t);return b.useMemo(()=>({rows:n.rows,range:n.range}),[n.rows,n.range])},tp="__detail_panel_toggle__";function th(e,t){return e.closest(`.${t}`)}function tf(e){return e.replace(/["\\]/g,"\\$&")}function tg(e){return`.${z._.row}[data-id="${tf(String(e))}"]`}function tm(e){return!(1!==e.target.nodeType||e.currentTarget.contains(e.target))}let tb=(e,t)=>null==e||Array.isArray(e)?e:t&&t[0]===e?t:[e],tv=(e,t)=>
4{var n;return(0,m.Z)({},e,{rowSelection:t.rowSelection&&null!=(n=tb(t.rowSelectionModel))?n:[]})},ty=(e,t)=>{let n=eG(e,"useGridSelection"),r=e=>(...n)=>{t.rowSelection&&e(...n)},l=b.useMemo(()=>tb(t.rowSelectionModel,(0,eK.Y1)(e.current.state)),[e,t.rowSelectionModel]),o=b.useRef(null);e.current.registerControlState({stateId:"rowSelection",propModel:l,propOnChange:t.onRowSelectionModelChange,stateSelector:eK.Y1,changeEvent:"rowSelectionChange"});let{checkboxSelection:i,disableMultipleRowSelection:a,disableRowSelectionOnClick:s,isRowSelectable:u}=t,c=!a||i,d=td(e,t),p=b.useCallback(t=>{var n;let r=t,l=null!=(n=o.current)?n:t,i=e.current.isRowSelected(t);if(i){let t=(0,ei.zn)(e),n=t.findIndex(e=>e===l),o=t.findIndex(e=>e===r);if(n===o)return;r=n>o?t[o+1]:t[o-1]}o.current=t,e.current.selectRowRange({startId:l,endId:r},!i)},[e]),h=b.useCallback(r=>{if(t.signature===ew.cG.DataGrid&&!t.checkboxSelection&&Array.isArray(r)&&r.length>1)throw Error("MUI: `rowSelectionModel` can only contain 1 item in DataGrid.\nYou need to upgrade to DataGridPro or DataGridPremium component to unlock multiple selection.");(0,eK.Y1)(e.current.state)!==r&&(n.debug("Setting selection model"),e.current.setState(e=>(0,m.Z)({},e,{rowSelection:t.rowSelection?r:[]})),e.current.forceUpdate())},[e,n,t.rowSelection,t.signature,t.checkboxSelection]),f=b.useCallback(t=>(0,eK.Y1)(e.current.state).includes(t),[e]),g=b.useCallback(t=>{if(u&&!u(e.current.getRowParams(t)))return!1;let n=e.current.getRowNode(t);return(null==n?void 0:n.type)!=="footer"&&(null==n?void 0:n.type)!=="pinnedRow"},[e,u]),v=b.useCallback(()=>(0,eK.bR)(e),[e]),y=b.useCallback((t,r=!0,l=!1)=>{if(e.current.isRowSelectable(t)){if(o.current=t,l)n.debug(`Setting selection for row ${t}`),e.current.setRowSelectionModel(r?[t]:[]);else{n.debug(`Toggling selection for row ${t}`);let l=(0,eK.Y1)(e.current.state).filter(e=>e!==t);r&&l.push(t),(l.length<2||c)&&e.current.setRowSelectionModel(l)}}},[e,n,c]),x=b.useCallback((t,r=!0,l=!1)=>{let o;n.debug("Setting selection for several rows");let i=t.filter(t=>e.current.isRowSelectable(t));if(l)o=r?i:[];else{let t=(0,m.Z)({},(0,eK.z8)(e));i.forEach(e=>{r?t[e]=e:delete t[e]}),o=Object.values(t)}(o.length<2||c)&&e.current.setRowSelectionModel(o)},[e,n,c]),w=b.useCallback(({startId:t,endId:r},l=!0,o=!1)=>{if(!e.current.getRow(t)||!e.current.getRow(r))return;n.debug(`Expanding selection from row ${t} to row ${r}`);let i=(0,ei.zn)(e),a=i.indexOf(t),s=i.indexOf(r),[u,c]=a>s?[s,a]:[a,s],d=i.slice(u,c+1);e.current.selectRows(d,l,o)},[e,n]);eh(e,{selectRow:y,setRowSelectionModel:h,getSelectedRows:v,isRowSelected:f,isRowSelectable:g},"public"),eh(e,{selectRows:x,selectRowRange:w},t.signature===ew.cG.DataGrid?"private":"public");let C=b.useCallback(()=>{if(t.keepNonExistentRowsSelected)return;let n=(0,eK.Y1)(e.current.state),r=(0,Y.J4)(e),l=(0,m.Z)({},(0,eK.z8)(e)),o=!1;n.forEach(e=>{r[e]||(delete l[e],o=!0)}),o&&e.current.setRowSelectionModel(Object.values(l))},[e,t.keepNonExistentRowsSelected]),S=b.useCallback((t,n)=>{let r=n.metaKey||n.ctrlKey,l=!i&&!r&&!(0,tu.vd)(n),o=!c||l,a=e.current.isRowSelected(t);o?e.current.selectRow(t,!!l||!a,!0):e.current.selectRow(t,!a,!1)},[e,c,i]),k=b.useCallback((t,n)=>{var r;if(s)return;let l=null==(r=n.target.closest(`.${z._.cell}`))?void 0:r.getAttribute("data-field");if(l!==eO.n.field&&l!==tp){if(l){let t=e.current.getColumn(l);if((null==t?void 0:t.type)===tl)return}"pinnedRow"!==e.current.getRowNode(t.id).type&&(n.shiftKey&&(c||i)?p(t.id):S(t.id,n))}},[s,c,i,e,p,S]),I=b.useCallback((e,t)=>{if(c&&t.shiftKey){var n;null==(n=window.getSelection())||n.removeAllRanges()}},[c]),R=b.useCallback((t,n)=>{n.nativeEvent.shiftKey?p(t.id):e.current.selectRow(t.id,t.value)},[e,p]),_=b.useCallback(n=>{let r=t.checkboxSelectionVisibleOnly&&t.pagination?(0,eY.Yp)(e):(0,ei.zn)(e),l=(0,ei.uf)(e);e.current.selectRows(r,n.value,(null==l?void 0:l.items.length)>0)},[e,t.checkboxSelectionVisibleOnly,t.pagination]),E=b.useCallback((t,n)=>{if(!(e.current.getCellMode(t.id,t.field)===ta.Edit||tm(n))){if((0,tu.Ni)(n.key)&&n.shiftKey){let r=(0,es.TR)(e);if(r&&r.id!==t.id){let l,o;n.preventDefault();let i=e.current.isRowSelected(r.id);if(!c){e.current.selectRow(r.id,!i,!0);return}let a=e.current.getRowIndexRelativeToVisibleRows(r.id),s=e.current.getRowIndexRelativeToVisibleRows(t.id);a>s?i?(l=s,o=a-1):(l=s,o=a):(l=i?a+1:a,o=s);let u=d.rows.slice(l,o+1).map(e=>e.id);e.current.selectRows(u,!i);return}}if(" "===n.key&&n.shiftKey){n.preventDefault(),S(t.id,n);return}"a"===n.key&&(n.ctrlKey||n.metaKey)&&(n.preventDefault(),x(e.current.getAllRowIds(),!0))}},[e,S,x,d.rows,c]);(0,ew.zn)(e,"sortedRowsSet",r(C)),(0,ew.zn)(e,"rowClick",r(k)),(0,ew.zn)(e,"rowSelectionCheckboxChange",r(R)),(0,ew.zn)(e,"headerSelectionCheckboxChange",_),(0,ew.zn)(e,"cellMouseDown",r(I)),(0,ew.zn)(e,"cellKeyDown",r(E)),b.useEffect(()=>{void 0!==l&&e.current.setRowSelectionModel(l)},[e,l,t.rowSelection]),b.useEffect(()=>{t.rowSelection||e.current.setRowSelectionModel([])},[e,t.rowSelection]);let M=null!=l;b.useEffect(()=>{if(M||!t.rowSelection)return;let n=(0,eK.Y1)(e.current.state);if(g){let t=n.filter(e=>g(e));t.length<n.length&&e.current.setRowSelectionModel(t)}},[e,g,M,t.rowSelection]),b.useEffect(()=>{if(!t.rowSelection||M)return;let n=(0,eK.Y1)(e.current.state);!c&&n.length>1&&e.current.setRowSelectionModel([])},[e,c,i,M,t.rowSelection])},tx=(e,t,n)=>{let r=b.useRef(),l=b.useRef(`mui-${Math.round(1e9*Math.random())}`),o=b.useCallback(()=>{r.current=e.current.registerPipeApplier(t,l.current,n)},[e,n,t]);eD(()=>{o()});let i=b.useRef(!0);b.useEffect(()=>(i.current?i.current=!1:o(),()=>{r.current&&(r.current(),r.current=null)}),[o])};var tw=n(99588),tC=n(89027),tS=n(99864);let tk=(0,m.Z)({},eX.z,{type:"number",align:"right",headerAlign:"right",sortComparator:tw.GH,valueParser:e=>""===e?null:Number(e),valueFormatter:({value:e})=>
4(0,ep.hj)(e)?e.toLocaleString():e||"",filterOperators:(0,tC.U)(),getApplyQuickFilterFn:(0,tS.ck)(tC.i),getApplyQuickFilterFnV7:tC.i});var tI=n(14773);let tR=["item","applyValue","type","apiRef","focusElementRef","InputProps","isFilterActive","clearButton","tabIndex","disabled"];function t_(e){var t,n;let{item:r,applyValue:l,type:o,apiRef:i,focusElementRef:a,InputProps:s,clearButton:u,tabIndex:c,disabled:d}=e,p=(0,M.Z)(e,tR),h=(0,tI.K)(),[f,g]=b.useState(null!=(t=r.value)?t:""),[v,y]=b.useState(!1),x=(0,e0.Z)(),w=(0,B.B)(),C=b.useCallback(e=>{let t=e.target.value;g(String(t)),y(!0),h.start(w.filterDebounceMs,()=>{l((0,m.Z)({},r,{value:t})),y(!1)})},[l,r,w.filterDebounceMs,h]);return b.useEffect(()=>{var e;g(String(null!=(e=r.value)?e:""))},[r.value]),(0,_.jsx)(w.slots.baseTextField,(0,m.Z)({fullWidth:!0,id:x,label:i.current.getLocaleText("filterPanelInputLabel"),placeholder:i.current.getLocaleText("filterPanelInputPlaceholder"),value:f,onChange:C,variant:"standard",type:o||"text",InputLabelProps:{shrink:!0},inputRef:a,InputProps:(0,m.Z)({},v||u?{endAdornment:v?(0,_.jsx)(w.slots.loadIcon,{fontSize:"small",color:"action"}):u}:{},{disabled:d},s,{inputProps:(0,m.Z)({max:"datetime-local"===o?"9999-12-31T23:59":"9999-12-31",tabIndex:c},null==s?void 0:s.inputProps)})},p,null==(n=w.slotProps)?void 0:n.baseTextField))}let tE=/(\d+)-(\d+)-(\d+)/,tM=/(\d+)-(\d+)-(\d+)T(\d+):(\d+)/;function tP(e,t,n,r){if(!e.value)return null;let[l,o,i,a,s]=e.value.match(n?tM:tE).slice(1).map(Number),u=new Date(l,o-1,i,a||0,s||0).getTime();return e=>!!e&&(r?t(e.getTime(),u):t(new Date(e).setHours(n?e.getHours():0,n?e.getMinutes():0,0,0),u))}let tT=e=>(0,tS.XW)([{value:"is",getApplyFilterFnV7:t=>tP(t,(e,t)=>e===t,e),InputComponent:t_,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"not",getApplyFilterFnV7:t=>tP(t,(e,t)=>e!==t,e),InputComponent:t_,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"after",getApplyFilterFnV7:t=>tP(t,(e,t)=>e>t,e),InputComponent:t_,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"onOrAfter",getApplyFilterFnV7:t=>tP(t,(e,t)=>e>=t,e),InputComponent:t_,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"before",getApplyFilterFnV7:t=>tP(t,(e,t)=>e<t,e,!e),InputComponent:t_,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"onOrBefore",getApplyFilterFnV7:t=>tP(t,(e,t)=>e<=t,e),InputComponent:t_,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"isEmpty",getApplyFilterFnV7:()=>e=>null==e,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFnV7:()=>e=>null!=e,requiresFilterValue:!1}]);var tZ=n(16817);let tF=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","inputProps","isValidating","isProcessingProps","onValueChange"],tD=(0,O.ZP)(tZ.ZP)({fontSize:"inherit"}),tA=e=>{let{classes:t}=e;return(0,Z.Z)({root:["editInputCell"]},z.d,t)};function tO(e){let{id:t,value:n,field:r,colDef:l,hasFocus:o,inputProps:i,onValueChange:a}=e,s=(0,M.Z)(e,tF),u="dateTime"===l.type,c=(0,e5.l)(),d=b.useRef(),p=b.useMemo(()=>{let e,t;return t=null==(e=null==n?null:n instanceof Date?n:new Date((null!=n?n:"").toString()))||Number.isNaN(e.getTime())?"":new Date(e.getTime()-6e4*e.getTimezoneOffset()).toISOString().substr(0,u?16:10),{parsed:e,formatted:t}},[n,u]),[h,f]=b.useState(p),g=tA({classes:(0,B.B)().classes}),v=b.useCallback(e=>{if(""===e)return null;let[t,n]=e.split("T"),[r,l,o]=t.split("-"),i=new Date;if(i.setFullYear(Number(r),Number(l)-1,Number(o)),i.setHours(0,0,0,0),n){let[e,t]=n.split(":");i.setHours(Number(e),Number(t),0,0)}return i},[]),y=b.useCallback(async e=>{let n=e.target.value,l=v(n);a&&await a(e,l),f({parsed:l,formatted:n}),c.current.setEditCellValue({id:t,field:r,value:l},e)},[c,r,t,a,v]);return b.useEffect(()=>{f(e=>{var t,n;return p.parsed!==e.parsed&&(null==(t=p.parsed)?void 0:t.getTime())!==(null==(n=e.parsed)?void 0:n.getTime())?p:e})},[p]),(0,D.Z)(()=>{o&&d.current.focus()},[o]),(0,_.jsx)(tD,(0,m.Z)({inputRef:d,fullWidth:!0,className:g.root,type:u?"datetime-local":"date",inputProps:(0,m.Z)({max:u?"9999-12-31T23:59":"9999-12-31"},i),value:h.formatted,onChange:y},s))}let tz=e=>(0,_.jsx)(tO,(0,m.Z)({},e));function tj({value:e,columnType:t,rowId:n,field:r}){if(!(e instanceof Date))throw Error(`MUI: \`${t}\` column type only accepts \`Date\` objects as values.
5Use \`valueGetter\` to transform the value into a \`Date\` object.
6Row ID: ${n}, field: "${r}".`)}let tL=(0,m.Z)({},eX.z,{type:"date",sortComparator:tw.mA,valueFormatter:function({value:e,field:t,i
6d:n}){return e?(tj({value:e,columnType:"date",rowId:n,field:t}),e.toLocaleDateString()):""},filterOperators:tT(),renderEditCell:tz,pastedValueParser:e=>new Date(e)}),tH=(0,m.Z)({},eX.z,{type:"dateTime",sortComparator:tw.mA,valueFormatter:function({value:e,field:t,id:n}){return e?(tj({value:e,columnType:"dateTime",rowId:n,field:t}),e.toLocaleString()):""},filterOperators:tT(!0),renderEditCell:tz,pastedValueParser:e=>new Date(e)});var tB=n(13836),tN=((a=tN||{}).enterKeyDown="enterKeyDown",a.cellDoubleClick="cellDoubleClick",a.printableKeyDown="printableKeyDown",a.deleteKeyDown="deleteKeyDown",a.pasteKeyDown="pasteKeyDown",a),tV=((s=tV||{}).cellFocusOut="cellFocusOut",s.escapeKeyDown="escapeKeyDown",s.enterKeyDown="enterKeyDown",s.tabKeyDown="tabKeyDown",s.shiftTabKeyDown="shiftTabKeyDown",s),t$=n(54870);let tU=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","hasFocus","isValidating","isProcessingProps","error","onValueChange","initialOpen","getOptionLabel","getOptionValue"],tG=["MenuProps"];function tq(e){var t,n,r;let l;let o=(0,B.B)(),{id:i,value:a,field:s,row:u,colDef:c,hasFocus:d,error:p,onValueChange:h,initialOpen:f=o.editMode===ti.Cell,getOptionLabel:g,getOptionValue:v}=e,y=(0,M.Z)(e,tU),x=(0,e5.l)(),w=b.useRef(),C=b.useRef(),[S,k]=b.useState(f),I=null!=(n=((null==(t=o.slotProps)?void 0:t.baseSelect)||{}).native)&&n,R=(null==(r=o.slotProps)?void 0:r.baseSelect)||{},{MenuProps:E}=R,P=(0,M.Z)(R,tG);if((0,D.Z)(()=>{if(d){var e;null==(e=C.current)||e.focus()}},[d]),!(0,t$.jv)(c)||!(l="function"==typeof(null==c?void 0:c.valueOptions)?null==c?void 0:c.valueOptions({id:i,row:u,field:s}):null==c?void 0:c.valueOptions))return null;let T=v||c.getOptionValue,Z=g||c.getOptionLabel,F=async e=>{if(!(0,t$.jv)(c)||!l)return;k(!1);let t=e.target,n=(0,t$.sk)(t.value,l,T);h&&await h(e,n),await x.current.setEditCellValue({id:i,field:s,value:n},e)};return l&&c?(0,_.jsx)(o.slots.baseSelect,(0,m.Z)({ref:w,inputRef:C,value:a,onChange:F,open:S,onOpen:e=>{e.key&&"Enter"===e.key||k(!0)},MenuProps:(0,m.Z)({onClose:(e,t)=>{if(o.editMode===ti.Row){k(!1);return}if("backdropClick"===t||(0,tu.$o)(e.key)){let t=x.current.getCellParams(i,s);x.current.publishEvent("cellEditStop",(0,m.Z)({},t,{reason:(0,tu.$o)(e.key)?tV.escapeKeyDown:tV.cellFocusOut}))}}},E),error:p,native:I,fullWidth:!0},y,P,{children:l.map(e=>{var t;let n=T(e);return(0,b.createElement)(o.slots.baseSelectOption,(0,m.Z)({},(null==(t=o.slotProps)?void 0:t.baseSelectOption)||{},{native:I,key:n,value:n}),Z(e))})})):null}var tW=n(34604);let tK=e=>"object"==typeof e[0],tY=(0,m.Z)({},eX.z,{type:"singleSelect",getOptionLabel:e=>(0,ep.Kn)(e)?e.label:String(e),getOptionValue:e=>(0,ep.Kn)(e)?e.value:e,valueFormatter(e){let t;let{id:n,field:r,value:l,api:o}=e,i=e.api.getColumn(r);if(!(0,t$.jv)(i)||(t="function"==typeof i.valueOptions?i.valueOptions({id:n,row:n?o.getRow(n):null,field:r}):i.valueOptions,null==l))return"";if(!t)return l;if(!tK(t))return i.getOptionLabel(l);let a=t.find(e=>i.getOptionValue(e)===l);return a?i.getOptionLabel(a):""},renderEditCell:e=>(0,_.jsx)(tq,(0,m.Z)({},e)),filterOperators:(0,tW.d)(),pastedValueParser:(e,t)=>{let n=t.colDef,r=n.valueOptions,l="function"==typeof r?r({field:n.field}):r||[],o=n.getOptionValue;if(l.find(t=>o(t)===e))return e}}),tX="__default__",tJ=["maxWidth","minWidth","width","flex"],tQ=(e,t)=>{let n={},r=0,l=0,o=[];e.orderedFields.forEach(t=>{let i=(0,m.Z)({},e.lookup[t]);if(!1===e.columnVisibilityModel[t])i.computedWidth=0;else{let e;i.flex&&i.flex>0?(r+=i.flex,e=0,o.push(i)):e=(0,ep.uZ)(i.width||eX.z.width,i.minWidth||eX.z.minWidth,i.maxWidth||eX.z.maxWidth),l+=e,i.computedWidth=e}n[t]=i});let i=Math.max(t-l,0);if(r>0&&t>0){let e=function({initialFreeSpace:e,totalFlexUnits:t,flexColumns:n}){let r=new Set(n.map(e=>e.field)),l={all:{},frozenFields:[],freeze:e=>{let t=l.all[e];t&&!0!==t.frozen&&(l.all[e].frozen=!0,l.frozenFields.push(e))}};return!function o(){if(l.frozenFields.length===r.size)return;let i={min:{},max:{}},a=e,s=t,u=0;l.frozenFields.forEach(e=>{a-=l.all[e].computedWidth,s-=l.all[e].flex});for(let e=0;e<n.length;e+=1){let t=n[e];if(l.all[t.field]&&!0===l.all[t.field].frozen)continue;let r=a/s*t.flex;r<t.minWidth?(u+=t.minWidth-r,r=t.minWidth,i.min[t.field]=!0):r>t.maxWidth&&(u+=t.maxWidth-r,r=t.maxWidth,i.max[t.field]=!0),l.all[t.field]={frozen:!1,computedWidth:r,flex:t.flex}}
6u<0?Object.keys(i.max).forEach(e=>{l.freeze(e)}):u>0?Object.keys(i.min).forEach(e=>{l.freeze(e)}):n.forEach(({field:e})=>{l.freeze(e)}),o()}(),l.all}({initialFreeSpace:i,totalFlexUnits:r,flexColumns:o});Object.keys(e).forEach(t=>{n[t].computedWidth=e[t].computedWidth})}return(0,m.Z)({},e,{lookup:n})},t0=(e,t)=>{if(!t)return e;let{orderedFields:n=[],dimensions:r={}}=t,l=Object.keys(r);if(0===l.length&&0===n.length)return e;let o={},i=[];for(let t=0;t<n.length;t+=1){let r=n[t];e.lookup[r]&&(o[r]=!0,i.push(r))}let a=0===i.length?e.orderedFields:[...i,...e.orderedFields.filter(e=>!o[e])],s=(0,m.Z)({},e.lookup);for(let e=0;e<l.length;e+=1){let t=l[e],n=(0,m.Z)({},s[t],{hasBeenResized:!0});Object.entries(r[t]).forEach(([e,t])=>{n[e]=-1===t?1/0:t}),s[t]=n}return(0,m.Z)({},e,{orderedFields:a,lookup:s})};function t1(e,t){let n=e[tX];return t&&e[t]&&(n=e[t]),n}let t2=({apiRef:e,columnsToUpsert:t,initialState:n,columnTypes:r,columnVisibilityModel:l=(0,V.g0)(e),keepOnlyColumnsToUpsert:o=!1})=>{var i,a,s;let u;let c=!e.current.state.columns;if(c)u={orderedFields:[],lookup:{},columnVisibilityModel:l};else{let t=(0,V.wH)(e.current.state);u={orderedFields:o?[]:[...t.orderedFields],lookup:(0,m.Z)({},t.lookup),columnVisibilityModel:l}}let d={};o&&!c&&(d=Object.keys(u.lookup).reduce((e,t)=>(0,m.Z)({},e,{[t]:!1}),{}));let p={};return t.forEach(e=>{let{field:t}=e;p[t]=!0,d[t]=!0;let n=u.lookup[t];null==n?(n=(0,m.Z)({},t1(r,e.type),{field:t,hasBeenResized:!1}),u.orderedFields.push(t)):o&&u.orderedFields.push(t),n&&n.type!==e.type&&(n=(0,m.Z)({},t1(r,e.type),{field:t}));let l=n.hasBeenResized;tJ.forEach(t=>{void 0!==e[t]&&(l=!0,-1===e[t]&&(e[t]=1/0))}),u.lookup[t]=(0,m.Z)({},n,e,{hasBeenResized:l})}),o&&!c&&Object.keys(u.lookup).forEach(e=>{d[e]||delete u.lookup[e]}),tQ(t0(e.current.unstable_applyPipeProcessors("hydrateColumns",u),n),null!=(i=null==(a=(s=e.current).getRootDimensions)||null==(a=a.call(s))?void 0:a.viewportInnerSize.width)?i:0)},t3=e=>t=>(0,m.Z)({},t,{columns:e});function t4({firstColumnToRender:e,apiRef:t,firstRowToRender:n,lastRowToRender:r,visibleRows:l}){let o=e;for(let i=n;i<r;i+=1)if(l[i]){let n=l[i].id,r=t.current.unstable_getCellColSpanInfo(n,e);r&&r.spannedByColSpan&&(o=r.leftVisibleCellIndex)}return o}function t5({firstColumnIndex:e,minColumnIndex:t,columnBuffer:n,firstRowToRender:r,lastRowToRender:l,apiRef:o,visibleRows:i}){return t4({firstColumnToRender:Math.max(e-n,t),apiRef:o,firstRowToRender:r,lastRowToRender:l,visibleRows:i})}function t9(e,t){let n=(0,N.CD)(e),r=K(e);return Math.floor(t*n)*((null!=r?r:0)+1)}var t6=n(27476);let t8={string:eX.z,number:tk,date:tL,dateTime:tH,boolean:tB.p,singleSelect:tY,[tl]:to,[tX]:eX.z},t7=(e,t,n)=>{var r,l,o,i;let a=t2({apiRef:n,columnTypes:t8,columnsToUpsert:t.columns,initialState:null==(r=t.initialState)?void 0:r.columns,columnVisibilityModel:null!=(l=null!=(o=t.columnVisibilityModel)?o:null==(i=t.initialState)||null==(i=i.columns)?void 0:i.columnVisibilityModel)?l:{},keepOnlyColumnsToUpsert:!0});return(0,m.Z)({},e,{columns:a})},ne=(e,t,n)=>(n.current.caches.rows=(0,eH.PO)({rows:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),(0,m.Z)({},e,{rows:(0,eH.IX)({apiRef:n,rowCountProp:t.rowCount,loadingProp:t.loading,previousTree:null,previousTreeDepths:null})})),nt=(e,t)=>{let n=eG(e,"useGridRows"),r=td(e,t),l=b.useRef(Date.now()),o=(0,tI.K)(),i=b.useCallback(t=>{let n=(0,Y.J4)(e)[t];if(n)return n;let r=e.current.getRowNode(t);return r&&(0,eH.wq)(r)?{[eH._1]:t}:null},[e]),a=t.getRowId,s=b.useCallback(e=>eH._1 in e?e[eH._1]:a?a(e):e.id,[a]),u=b.useMemo(()=>r.rows.reduce((e,{id:t},n)=>(e[t]=n,e),{}),[r.rows]),c=b.useCallback(({cache:n,throttle:r})=>{let i=()=>{l.current=Date.now(),e.current.setState(n=>(0,m.Z)({},n,{rows:(0,eH.IX)({apiRef:e,rowCountProp:t.rowCount,loadingProp:t.loading,previousTree:(0,Y.Kd)(e),previousTreeDepths:(0,Y.i$)(e)})})),e.current.publishEvent("rowsSet"),e.current.forceUpdate()};if(o.clear(),e.current.caches.rows=n,!r){i();return}let a=t.throttleRowsMs-(Date.now()-l.current);if(a>0){o.start(a,i);return}i()},[t.throttleRowsMs,t.rowCount,t.loading,e,o]),d=b.useCallback(r=>
6{n.debug(`Updating all rows, new length ${r.length}`);let l=(0,eH.PO)({rows:r,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),o=e.current.caches.rows;l.rowsBeforePartialUpdates=o.rowsBeforePartialUpdates,c({cache:l,throttle:!0})},[n,t.getRowId,t.loading,t.rowCount,c,e]),p=b.useCallback(n=>{if(t.signature===ew.cG.DataGrid&&n.length>1)throw Error("MUI: You can't update several rows at once in `apiRef.current.updateRows` on the DataGrid.\nYou need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.");let r=[];n.forEach(n=>{let l=(0,eH.jI)(n,t.getRowId,"A row was provided without id when calling updateRows():"),o=e.current.getRowNode(l);if((null==o?void 0:o.type)==="pinnedRow"){let t=e.current.caches.pinnedRows,r=t.idLookup[l];r&&(t.idLookup[l]=(0,m.Z)({},r,n))}else r.push(n)}),c({cache:(0,eH.vn)({updates:r,getRowId:t.getRowId,previousCache:e.current.caches.rows}),throttle:!0})},[t.signature,t.getRowId,c,e]),h=b.useCallback(()=>{let t=(0,Y.yM)(e),n=(0,Y.J4)(e);return new Map(t.map(e=>{var t;return[e,null!=(t=n[e])?t:{}]}))},[e]),f=b.useCallback(()=>(0,Y.hh)(e),[e]),g=b.useCallback(()=>(0,Y.yM)(e),[e]),v=b.useCallback(e=>u[e],[u]),y=b.useCallback((t,n)=>{let r=e.current.getRowNode(t);if(!r)throw Error(`MUI: No row with id #${t} found`);if("group"!==r.type)throw Error("MUI: Only group nodes can be expanded or collapsed");let l=(0,m.Z)({},r,{childrenExpanded:n});e.current.setState(e=>(0,m.Z)({},e,{rows:(0,m.Z)({},e.rows,{tree:(0,m.Z)({},e.rows.tree,{[t]:l})})})),e.current.forceUpdate(),e.current.publishEvent("rowExpansionChange",l)},[e]),x=b.useCallback(t=>{var n;return null!=(n=(0,Y.Kd)(e)[t])?n:null},[e]),w=b.useCallback(({skipAutoGeneratedRows:t=!0,groupId:n,applySorting:r,applyFiltering:l})=>{let o;let i=(0,Y.Kd)(e);if(r){let r=i[n];if(!r)return[];let l=(0,ea.aV)(e);o=[];let a=l.findIndex(e=>e===n)+1;for(let e=a;e<l.length&&i[l[e]].depth>r.depth;e+=1){let n=l[e];t&&(0,eH.wq)(i[n])||o.push(n)}}else o=(0,eH.u4)(i,n,t);if(l){let t=(0,ei._g)(e);o=o.filter(e=>!1!==t[e])}return o},[e]),C=b.useCallback((t,r)=>{let l=e.current.getRowNode(t);if(!l)throw Error(`MUI: No row with id #${t} found`);if(l.parent!==eH.U5)throw Error("MUI: The row reordering do not support reordering of grouped rows yet");if("leaf"!==l.type)throw Error("MUI: The row reordering do not support reordering of footer or grouping rows");e.current.setState(l=>{let o=(0,Y.Kd)(l,e.current.instanceId)[eH.U5],i=o.children,a=i.findIndex(e=>e===t);if(-1===a||a===r)return l;n.debug(`Moving row ${t} to index ${r}`);let s=[...i];return s.splice(r,0,s.splice(a,1)[0]),(0,m.Z)({},l,{rows:(0,m.Z)({},l.rows,{tree:(0,m.Z)({},l.rows.tree,{[eH.U5]:(0,m.Z)({},o,{children:s})})})})}),e.current.publishEvent("rowsSet")},[e,n]),S=b.useCallback((n,r)=>{if(t.signature===ew.cG.DataGrid&&r.length>1)throw Error("MUI: You can't replace rows using `apiRef.current.unstable_replaceRows` on the DataGrid.\nYou need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.");if(0===r.length)return;if((0,Y.Lq)(e)>1)throw Error("`apiRef.current.unstable_replaceRows` is not compatible with tree data and row grouping");let l=(0,m.Z)({},(0,Y.Kd)(e)),o=(0,m.Z)({},(0,Y.J4)(e)),i=(0,m.Z)({},(0,Y.Qr)(e)),a=l[eH.U5],s=[...a.children],u=new Set;for(let e=0;e<r.length;e+=1){let a=r[e],c=(0,eH.jI)(a,t.getRowId,"A row was provided without id when calling replaceRows()."),[d]=s.splice(n+e,1,c);u.has(d)||(delete o[d],delete i[d],delete l[d]);let p={id:c,depth:0,parent:eH.U5,type:"leaf",groupingKey:null};o[c]=a,i[c]=c,l[c]=p,u.add(c)}l[eH.U5]=(0,m.Z)({},a,{children:s});let c=s.filter(e=>"leaf"===l[e].type);
6e.current.caches.rows.dataRowIdToModelLookup=o,e.current.caches.rows.dataRowIdToIdLookup=i,e.current.setState(e=>(0,m.Z)({},e,{rows:(0,m.Z)({},e.rows,{dataRowIdToModelLookup:o,dataRowIdToIdLookup:i,dataRowIds:c,tree:l})})),e.current.publishEvent("rowsSet")},[e,t.signature,t.getRowId]),k=b.useCallback(()=>{n.info("Row grouping pre-processing have changed, regenerating the row tree"),c({cache:e.current.caches.rows.rowsBeforePartialUpdates===t.rows?(0,m.Z)({},e.current.caches.rows,{updates:{type:"full",rows:(0,Y.yM)(e)}}):(0,eH.PO)({rows:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),throttle:!1})},[n,e,t.rows,t.getRowId,t.loading,t.rowCount,c]),I=b.useCallback(e=>{"rowTreeCreation"===e&&k()},[k]),R=b.useCallback(()=>{e.current.getActiveStrategy("rowTree")!==(0,Y.Le)(e)&&k()},[e,k]);(0,ew.zn)(e,"activeStrategyProcessorChange",I),(0,ew.zn)(e,"strategyAvailabilityChange",R);let _=b.useCallback(()=>{e.current.setState(n=>{let r=e.current.unstable_applyPipeProcessors("hydrateRows",{tree:(0,Y.Kd)(n,e.current.instanceId),treeDepths:(0,Y.i$)(n,e.current.instanceId),dataRowIds:(0,Y.yM)(n,e.current.instanceId),dataRowIdToModelLo
6okup:(0,Y.J4)(n,e.current.instanceId),dataRowIdToIdLookup:(0,Y.Qr)(n,e.current.instanceId)});return(0,m.Z)({},n,{rows:(0,m.Z)({},n.rows,r,{totalTopLevelRowCount:(0,eH.ZD)({tree:r.tree,rowCountProp:t.rowCount})})})}),e.current.publishEvent("rowsSet"),e.current.forceUpdate()},[e,t.rowCount]);tx(e,"hydrateRows",_),eh(e,{getRow:i,getRowId:s,getRowModels:h,getRowsCount:f,getAllRowIds:g,setRows:d,updateRows:p,getRowNode:x,getRowIndexRelativeToVisibleRows:v,unstable_replaceRows:S},"public"),eh(e,{setRowIndex:C,setRowChildrenExpansion:y,getRowGroupChildren:w},t.signature===ew.cG.DataGrid?"private":"public");let E=b.useRef(!0);b.useEffect(()=>{if(E.current){E.current=!1;return}let r=e.current.caches.rows.rowsBeforePartialUpdates===t.rows,l=e.current.caches.rows.loadingPropBeforePartialUpdates===t.loading,o=e.current.caches.rows.rowCountPropBeforePartialUpdates===t.rowCount;if(r){l||(e.current.setState(e=>(0,m.Z)({},e,{rows:(0,m.Z)({},e.rows,{loading:t.loading})})),e.current.caches.rows.loadingPropBeforePartialUpdates=t.loading,e.current.forceUpdate()),o||(e.current.setState(e=>(0,m.Z)({},e,{rows:(0,m.Z)({},e.rows,{totalRowCount:Math.max(t.rowCount||0,e.rows.totalRowCount),totalTopLevelRowCount:Math.max(t.rowCount||0,e.rows.totalTopLevelRowCount)})})),e.current.caches.rows.rowCountPropBeforePartialUpdates=t.rowCount,e.current.forceUpdate());return}n.debug(`Updating all rows, new length ${t.rows.length}`),c({cache:(0,eH.PO)({rows:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),throttle:!1})},[t.rows,t.rowCount,t.getRowId,t.loading,n,c,e])};var nn=n(59948);let nr=e=>e.editRows;var nl=n(42339);let no=["id","field"],ni=["id","field"],na=(0,nl.b)(["MUI: A call to `processRowUpdate` threw an error which was not handled because `onProcessRowUpdateError` is missing.","To handle the error pass a callback to the `onProcessRowUpdateError` prop, e.g. `<DataGrid onProcessRowUpdateError={(error) => ...} />`.","For more detail, see http://mui.com/components/data-grid/editing/#server-side-persistence."],"error"),ns=(e,t)=>{let[n,r]=b.useState({}),l=b.useRef(n),o=b.useRef({}),{processRowUpdate:i,onProcessRowUpdateError:a,cellModesModel:s,onCellModesModelChange:u}=t,c=e=>(...n)=>{t.editMode===ti.Cell&&e(...n)},d=b.useCallback((t,n)=>{let r=e.current.getCellParams(t,n);if(!e.current.isCellEditable(r))throw Error(`MUI: The cell with id=${t} and field=${n} is not editable.`)},[e]),p=b.useCallback((t,n,r)=>{if(e.current.getCellMode(t,n)!==r)throw Error(`MUI: The cell with id=${t} and field=${n} is not in ${r} mode.`)},[e]),h=b.useCallback((t,n)=>{if(!t.isEditable||t.cellMode===ta.Edit)return;let r=(0,m.Z)({},t,{reason:tN.cellDoubleClick});e.current.publishEvent("cellEditStart",r,n)},[e]),f=b.useCallback((t,n)=>{if(t.cellMode===ta.View||e.current.getCellMode(t.id,t.field)===ta.View)return;let r=(0,m.Z)({},t,{reason:tV.cellFocusOut});e.current.publishEvent("cellEditStop",r,n)},[e]),g=b.useCallback((t,n)=>{if(t.cellMode===ta.Edit){let r;if(229!==n.which&&("Escape"===n.key?r=tV.escapeKeyDown:"Enter"===n.key?r=tV.enterKeyDown:"Tab"===n.key&&(r=n.shiftKey?tV.shiftTabKeyDown:tV.tabKeyDown,n.preventDefault()),r)){let l=(0,m.Z)({},t,{reason:r});e.current.publishEvent("cellEditStop",l,n)}}else if(t.isEditable){let r;if(!e.current.unstable_applyPipeProcessors("canStartEditing",!0,{event:n,cellParams:t,editMode:"cell"}))return;if((0,tu.J2)(n)?r=tN.printableKeyDown:(n.ctrlKey||n.metaKey)&&"v"===n.key?r=tN.pasteKeyDown:"Enter"===n.key?r=tN.enterKeyDown:("Delete"===n.key||"Backspace"===n.key)&&(r=tN.deleteKeyDown),r){let l=(0,m.Z)({},t,{reason:r,key:n.key});e.current.publishEvent("cellEditStart",l,n)}}},[e]),v=b.useCallback(t=>{let{id:n,field:r,reason:l}=t,o={id:n,field:r};(l===tN.printableKeyDown||l===tN.deleteKeyDown||l===tN.pasteKeyDown)&&(o.deleteValue=!0),e.current.startCellEditMode(o)},[e]),y=b.useCallback(t=>{let n;let{id:r,field:l,reason:o}=t;e.current.runPendingEditCellValueMutation(r,l),o===tV.enterKeyDown?n="below":o===tV.tabKeyDown?n="right":o===tV.shiftTabKeyDown&&(n="left"),e.current.stopCellEditMode({id:r,field:l,ignoreModifications:"escapeKeyDown"===o,cellToFocusAfter:n})},[e]);(0,ew.zn)(e,"cellDoubleClick",c(h)),(0,ew.zn)(e,"cellFocusOut",c(f)),(0,ew.zn)(e,"cellKeyDown",c(g)),(0,ew.zn)(e,"cellEditStart",c(v)),(0,ew.zn)(e,"cellEditStop",c(y)),(0,ew.x3)(e,"cellEditStart",t.onCellEditStart),(0,ew.x3)(e,"cellEditStop",t.onCellEditStop);let x=b.useCallback((t,n)=>{let r=nr(e.current.state);return r[t]&&r[t][n]?ta.Edit:ta.View},[e]),w=(0,nn.Z)(n=>{let o=n!==t.cellModesModel;u&&o&&u(n,{}),t.cellModesModel&&o||(r(n),l.current=n,e.current.publishEvent("cellModesModelChange",n))}),C=b.useCallback((e,t,n)=>{let r=(0,m.Z)({},l.current);if(null!==n)r[e]=(0,m.Z)({},r[e],{[t]:(0,m.Z)({},n)});else{let n=r[e],l=(0,M.Z)(n,[t].map(e_.Z));r[e]=l,0===Object.keys(r[e]).length&&delete r[e]}w(r)}
6,[w]),S=b.useCallback((t,n,r)=>{e.current.setState(e=>{let l=(0,m.Z)({},e.editRows);return null!==r?l[t]=(0,m.Z)({},l[t],{[n]:(0,m.Z)({},r)}):(delete l[t][n],0===Object.keys(l[t]).length&&delete l[t]),(0,m.Z)({},e,{editRows:l})}),e.current.forceUpdate()},[e]),k=b.useCallback(e=>{let{id:t,field:n}=e,r=(0,M.Z)(e,no);d(t,n),p(t,n,ta.View),C(t,n,(0,m.Z)({mode:ta.Edit},r))},[d,p,C]),I=(0,nn.Z)(t=>{let{id:n,field:r,deleteValue:l,initialValue:o}=t,i=e.current.getCellValue(n,r);(l||o)&&(i=l?"":o),S(n,r,{value:i,error:!1,isProcessingProps:!1}),e.current.setCellFocus(n,r)}),R=b.useCallback(e=>{let{id:t,field:n}=e,r=(0,M.Z)(e,ni);p(t,n,ta.Edit),C(t,n,(0,m.Z)({mode:ta.View},r))},[p,C]),_=(0,nn.Z)(async t=>{let{id:n,field:r,ignoreModifications:l,cellToFocusAfter:s="none"}=t;p(n,r,ta.Edit),e.current.runPendingEditCellValueMutation(n,r);let u=()=>{S(n,r,null),C(n,r,null),"none"!==s&&e.current.moveFocusToRelativeCell(n,r,s)};if(l){u();return}let{error:c,isProcessingProps:d}=nr(e.current.state)[n][r];if(c||d){o.current[n][r].mode=ta.Edit,C(n,r,{mode:ta.Edit});return}let h=e.current.getRowWithUpdatedValuesFromCellEditing(n,r);if(i){let t=e=>{o.current[n][r].mode=ta.Edit,C(n,r,{mode:ta.Edit}),a?a(e):na()};try{let r=e.current.getRow(n);Promise.resolve(i(h,r)).then(t=>{e.current.updateRows([t]),u()}).catch(t)}catch(e){t(e)}}else e.current.updateRows([h]),u()}),E=b.useCallback(async t=>{var n;let{id:r,field:l,value:o,debounceMs:i,unstable_skipValueParser:a}=t;d(r,l),p(r,l,ta.Edit);let s=e.current.getColumn(l),u=e.current.getRow(r),c=o;s.valueParser&&!a&&(c=s.valueParser(o,e.current.getCellParams(r,l)));let h=nr(e.current.state),f=(0,m.Z)({},h[r][l],{value:c,changeReason:i?"debouncedSetEditCellValue":"setEditCellValue"});if(s.preProcessEditCellProps){let e=o!==h[r][l].value;S(r,l,f=(0,m.Z)({},f,{isProcessingProps:!0})),f=await Promise.resolve(s.preProcessEditCellProps({id:r,row:u,props:f,hasChanged:e}))}return e.current.getCellMode(r,l)!==ta.View&&(h=nr(e.current.state),(f=(0,m.Z)({},f,{isProcessingProps:!1})).value=s.preProcessEditCellProps?h[r][l].value:c,S(r,l,f),!(null!=(n=(h=nr(e.current.state))[r])&&null!=(n=n[l])&&n.error))},[e,d,p,S]),P=b.useCallback((t,n)=>{let r=e.current.getColumn(n),l=nr(e.current.state),o=e.current.getRow(t);if(!l[t]||!l[t][n])return e.current.getRow(t);let{value:i}=l[t][n];return r.valueSetter?r.valueSetter({value:i,row:o}):(0,m.Z)({},o,{[n]:i})},[e]);eh(e,{getCellMode:x,startCellEditMode:k,stopCellEditMode:R},"public"),eh(e,{setCellEditingEditCellValue:E,getRowWithUpdatedValuesFromCellEditing:P},"private"),b.useEffect(()=>{s&&w(s)},[s,w]),(0,D.Z)(()=>{let t=(0,Y.Qr)(e),r=o.current;o.current=(0,ep.I8)(n),Object.entries(n).forEach(([e,n])=>{Object.entries(n).forEach(([n,l])=>{var o,i;let a=(null==(o=r[e])||null==(o=o[n])?void 0:o.mode)||ta.View,s=null!=(i=t[e])?i:e;l.mode===ta.Edit&&a===ta.View?I((0,m.Z)({id:s,field:n},l)):l.mode===ta.View&&a===ta.Edit&&_((0,m.Z)({id:s,field:n},l))})})},[e,n,I,_])};var nu=((u=nu||{}).enterKeyDown="enterKeyDown",u.cellDoubleClick="cellDoubleClick",u.printableKeyDown="printableKeyDown",u.deleteKeyDown="deleteKeyDown",u),nc=((c=nc||{}).rowFocusOut="rowFocusOut",c.escapeKeyDown="escapeKeyDown",c.enterKeyDown="enterKeyDown",c.tabKeyDown="tabKeyDown",c.shiftTabKeyDown="shiftTabKeyDown",c);let nd=["id"],np=["id"],nh=(0,nl.b)(["MUI: A call to `processRowUpdate` threw an error which was not handled because `onProcessRowUpdateError` is missing.","To handle the error pass a callback to the `onProcessRowUpdateError` prop, e.g. `<DataGrid onProcessRowUpdateError={(error) => ...} />`.","For more detail, see http://mui.com/components/data-grid/editing/#server-side-persistence."],"error"),nf=(e,t)=>{let[n,r]=b.useState({}),l=b.useRef(n),o=b.useRef({}),i=b.useRef(null),a=b.useRef(null),{processRowUpdate:s,onProcessRowUpdateError:u,rowModesModel:c,onRowModesModelChange:d}=t,p=e=>(...n)=>{t.editMode===ti.Row&&e(...n)},h=b.useCallback((t,n)=>{let r=e.current.getCellParams(t,n);if(!e.current.isCellEditable(r))throw Error(`MUI: The cell with id=${t} and field=${n} is not editable.`)},[e]),f=b.useCallback((t,n)=>{if(e.current.getRowMode(t)!==n)throw Error(`MUI: The row with id=${t} is not in ${n} mode.`)},[e]),g=b.useCallback((t,n)=>{if(!t.isEditable||e.current.getRowMode(t.id)===ts.Edit)return;let r=e.current.getRowParams(t.id),l=(0,m.Z)({},r,{field:t.field,reason:nu.cellDoubleClick});e.current.publishEvent("rowEditStart",l,n)},[e]),v=b.useCallback(e=>{a.current=e},[]),y=b.useCallback((t,n)=>{t.isEditable&&e.current.getRowMode(t.id)!==ts.View&&(a.current=null,i.current=setTimeout(()=>{var r;if(i.current=null,(null==(r=a.current)?void 0:r.id)!==t.id){if(!e.current.getRow(t.id)||e.current.getRowMode(t.id)===ts.View)return;let r=e.current.getRowParams(t.id),l=(0,m.Z)({},r,{field:t.field,reason:nc.rowFocusOut});e.current.publishEvent("rowEditStop",l,n)}}))},[e]);b.useEffect(()=>()=>{clearTimeout(i.current)},[]);let x=b.useCallback((t,n)=>{if(t.cellMode===ts.Edit){let r;if(229!==n.which){if("Escape"===n.key)r=nc.escapeKeyDown;else if("Enter"===n.key)r=nc.enterKeyDown;else if("Tab"===n.key){let l=(0,V.pK)(e).filter(n=>e.current.getColumn(n).type===tl||e.current.isCellEditable(e.current.getCellParams(t.id,n)));if(n.shiftKey?t.field===l[0]&&(r=nc.shiftTabKeyDown):t.field===l[l.length-1]&&(r=nc.tabKeyDown),n.preventDefault(),!r){let r=l.findIndex(e=>
6e===t.field),o=l[n.shiftKey?r-1:r+1];e.current.setCellFocus(t.id,o)}}if(r){let l=(0,m.Z)({},e.current.getRowParams(t.id),{reason:r,field:t.field});e.current.publishEvent("rowEditStop",l,n)}}}else if(t.isEditable){let r;if(!e.current.unstable_applyPipeProcessors("canStartEditing",!0,{event:n,cellParams:t,editMode:"row"}))return;if((0,tu.J2)(n)?r=nu.printableKeyDown:(n.ctrlKey||n.metaKey)&&"v"===n.key?r=nu.printableKeyDown:"Enter"===n.key?r=nu.enterKeyDown:("Delete"===n.key||"Backspace"===n.key)&&(r=nu.deleteKeyDown),r){let l=e.current.getRowParams(t.id),o=(0,m.Z)({},l,{field:t.field,reason:r});e.current.publishEvent("rowEditStart",o,n)}}},[e]),w=b.useCallback(t=>{let{id:n,field:r,reason:l}=t,o={id:n,fieldToFocus:r};(l===nu.printableKeyDown||l===nu.deleteKeyDown)&&(o.deleteValue=!!r),e.current.startRowEditMode(o)},[e]),C=b.useCallback(t=>{let n;let{id:r,reason:l,field:o}=t;e.current.runPendingEditCellValueMutation(r),l===nc.enterKeyDown?n="below":l===nc.tabKeyDown?n="right":l===nc.shiftTabKeyDown&&(n="left"),e.current.stopRowEditMode({id:r,ignoreModifications:"escapeKeyDown"===l,field:o,cellToFocusAfter:n})},[e]);(0,ew.zn)(e,"cellDoubleClick",p(g)),(0,ew.zn)(e,"cellFocusIn",p(v)),(0,ew.zn)(e,"cellFocusOut",p(y)),(0,ew.zn)(e,"cellKeyDown",p(x)),(0,ew.zn)(e,"rowEditStart",p(w)),(0,ew.zn)(e,"rowEditStop",p(C)),(0,ew.x3)(e,"rowEditStart",t.onRowEditStart),(0,ew.x3)(e,"rowEditStop",t.onRowEditStop);let S=b.useCallback(n=>{if(t.editMode===ti.Cell)return ts.View;let r=nr(e.current.state);return r[n]&&Object.keys(r[n]).length>0?ts.Edit:ts.View},[e,t.editMode]),k=(0,nn.Z)(n=>{let o=n!==t.rowModesModel;d&&o&&d(n,{}),t.rowModesModel&&o||(r(n),l.current=n,e.current.publishEvent("rowModesModelChange",n))}),I=b.useCallback((e,t)=>{let n=(0,m.Z)({},l.current);null!==t?n[e]=(0,m.Z)({},t):delete n[e],k(n)},[k]),R=b.useCallback((t,n)=>{e.current.setState(e=>{let r=(0,m.Z)({},e.editRows);return null!==n?r[t]=n:delete r[t],(0,m.Z)({},e,{editRows:r})}),e.current.forceUpdate()},[e]),_=b.useCallback((t,n,r)=>{e.current.setState(e=>{let l=(0,m.Z)({},e.editRows);return null!==r?l[t]=(0,m.Z)({},l[t],{[n]:(0,m.Z)({},r)}):(delete l[t][n],0===Object.keys(l[t]).length&&delete l[t]),(0,m.Z)({},e,{editRows:l})}),e.current.forceUpdate()},[e]),E=b.useCallback(e=>{let{id:t}=e,n=(0,M.Z)(e,nd);f(t,ts.View),I(t,(0,m.Z)({mode:ts.Edit},n))},[f,I]),P=(0,nn.Z)(t=>{let{id:n,fieldToFocus:r,deleteValue:l,initialValue:o}=t,i=(0,V.Zi)(e).reduce((t,i)=>{if(!e.current.getCellParams(n,i).isEditable)return t;let a=e.current.getCellValue(n,i);return r===i&&(l||o)&&(a=l?"":o),t[i]={value:a,error:!1,isProcessingProps:!1},t},{});R(n,i),r&&e.current.setCellFocus(n,r)}),T=b.useCallback(e=>{let{id:t}=e,n=(0,M.Z)(e,np);f(t,ts.Edit),I(t,(0,m.Z)({mode:ts.View},n))},[f,I]),Z=(0,nn.Z)(t=>{let{id:n,ignoreModifications:r,field:l,cellToFocusAfter:i="none"}=t;e.current.runPendingEditCellValueMutation(n);let a=()=>{"none"!==i&&l&&e.current.moveFocusToRelativeCell(n,l,i),R(n,null),I(n,null)};if(r){a();return}let c=nr(e.current.state),d=e.current.getRow(n);if(Object.values(c[n]).some(e=>e.isProcessingProps)){o.current[n].mode=ts.Edit;return}if(Object.values(c[n]).some(e=>e.error)){o.current[n].mode=ts.Edit,I(n,{mode:ts.Edit});return}let p=e.current.getRowWithUpdatedValuesFromRowEditing(n);if(s){let t=e=>{o.current[n].mode=ts.Edit,I(n,{mode:ts.Edit}),u?u(e):nh()};try{Promise.resolve(s(p,d)).then(t=>{e.current.updateRows([t]),a()}).catch(t)}catch(e){t(e)}}else e.current.updateRows([p]),a()}),F=b.useCallback(t=>{let{id:n,field:r,value:l,debounceMs:o,unstable_skipValueParser:i}=t;h(n,r);let a=e.current.getColumn(r),s=e.current.getRow(n),u=l;a.valueParser&&!i&&(u=a.valueParser(l,e.current.getCellParams(n,r)));let c=nr(e.current.state),d=(0,m.Z)({},c[n][r],{value:u,changeReason:o?"debouncedSetEditCellValue":"setEditCellValue"});return a.preProcessEditCellProps||_(n,r,d),new Promise(t=>{let l=[];if(a.preProcessEditCellProps){let o=d.value!==c[n][r].value;_(n,r,d=(0,m.Z)({},d,{isProcessingProps:!0}));let i=c[n],p=(0,M.Z)(i,[r].map(e_.Z)),h=Promise.resolve(a.preProcessEditCellProps({id:n,row:s,props:d,hasChanged:o,otherFieldsProps:p}
6)).then(l=>{if(e.current.getRowMode(n)===ts.View){t(!1);return}c=nr(e.current.state),(l=(0,m.Z)({},l,{isProcessingProps:!1})).value=a.preProcessEditCellProps?c[n][r].value:u,_(n,r,l)});l.push(h)}Object.entries(c[n]).forEach(([o,i])=>{if(o===r)return;let a=e.current.getColumn(o);if(!a.preProcessEditCellProps)return;_(n,o,i=(0,m.Z)({},i,{isProcessingProps:!0}));let u=(c=nr(e.current.state))[n],d=(0,M.Z)(u,[o].map(e_.Z)),p=Promise.resolve(a.preProcessEditCellProps({id:n,row:s,props:i,hasChanged:!1,otherFieldsProps:d})).then(r=>{if(e.current.getRowMode(n)===ts.View){t(!1);return}_(n,o,r=(0,m.Z)({},r,{isProcessingProps:!1}))});l.push(p)}),Promise.all(l).then(()=>{e.current.getRowMode(n)===ts.Edit?t(!(c=nr(e.current.state))[n][r].error):t(!1)})})},[e,h,_]),A=b.useCallback(t=>{let n=nr(e.current.state),r=e.current.getRow(t);if(!n[t])return e.current.getRow(t);let l=(0,m.Z)({},r);return Object.entries(n[t]).forEach(([t,n])=>{let r=e.current.getColumn(t);r.valueSetter?l=r.valueSetter({value:n.value,row:l}):l[t]=n.value}),l},[e]);eh(e,{getRowMode:S,startRowEditMode:E,stopRowEditMode:T},"public"),eh(e,{setRowEditingEditCellValue:F,getRowWithUpdatedValuesFromRowEditing:A},"private"),b.useEffect(()=>{c&&k(c)},[c,k]),(0,D.Z)(()=>{let t=(0,Y.Qr)(e),r=o.current;o.current=(0,ep.I8)(n),Object.entries(n).forEach(([e,n])=>{var l,o;let i=(null==(l=r[e])?void 0:l.mode)||ts.View,a=null!=(o=t[e])?o:e;n.mode===ts.Edit&&i===ts.View?P((0,m.Z)({id:a},n)):n.mode===ts.View&&i===ts.Edit&&Z((0,m.Z)({id:a},n))})},[e,n,P,Z])},ng=e=>(0,m.Z)({},e,{editRows:{}}),nm=(e,t)=>{ns(e,t),nf(e,t);let n=b.useRef({}),{isCellEditable:r}=t,l=b.useCallback(e=>!(0,eH.wq)(e.rowNode)&&!!e.colDef.editable&&!!e.colDef.renderEditCell&&(!r||r(e)),[r]),o=(e,t,r,l)=>{if(!r){l();return}if(n.current[e]||(n.current[e]={}),n.current[e][t]){let[r]=n.current[e][t];clearTimeout(r)}let o=setTimeout(()=>{l(),delete n.current[e][t]},r);n.current[e][t]=[o,()=>{let[r]=n.current[e][t];
6clearTimeout(r),l(),delete n.current[e][t]}]};b.useEffect(()=>{let e=n.current;return()=>{Object.entries(e).forEach(([t,n])=>{Object.keys(n).forEach(n=>{let[r]=e[t][n];clearTimeout(r),delete e[t][n]})})}},[]);let i=b.useCallback((e,t)=>{if(n.current[e]){if(t){if(n.current[e][t]){let[,r]=n.current[e][t];r()}}else Object.keys(n.current[e]).forEach(t=>{let[,r]=n.current[e][t];r()})}},[]),a=b.useCallback(n=>{let{id:r,field:l,debounceMs:i}=n;return new Promise(a=>{o(r,l,i,async()=>{let o=t.editMode===ti.Row?e.current.setRowEditingEditCellValue:e.current.setCellEditingEditCellValue;e.current.getCellMode(r,l)===ta.Edit&&a(await o(n))})})},[e,t.editMode]),s=b.useCallback((n,r)=>t.editMode===ti.Cell?e.current.getRowWithUpdatedValuesFromCellEditing(n,r):e.current.getRowWithUpdatedValuesFromRowEditing(n),[e,t.editMode]),u=b.useCallback((t,n)=>{var r,l;return null!=(r=null==(l=nr(e.current.state)[t])?void 0:l[n])?r:null},[e]);eh(e,{isCellEditable:l,setEditCellValue:a,getRowWithUpdatedValues:s,unstable_getEditCellMeta:u},"public"),eh(e,{runPendingEditCellValueMutation:i},"private")};var nb=n(82690);let nv=e=>(0,m.Z)({},e,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null},tabIndex:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}),ny=(e,t)=>{let n=eG(e,"useGridFocus"),r=b.useRef(null),l=b.useCallback((t,n)=>{t&&e.current.getRow(t.id)&&e.current.publishEvent("cellFocusOut",e.current.getCellParams(t.id,t.field),n)},[e]),o=b.useCallback((t,r)=>{let o=(0,es.TR)(e);((null==o?void 0:o.id)!==t||(null==o?void 0:o.field)!==r)&&(e.current.setState(e=>(n.debug(`Focusing on cell with id=${t} and field=${r}`),(0,m.Z)({},e,{tabIndex:{cell:{id:t,field:r},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null},focus:{cell:{id:t,field:r},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}))),e.current.forceUpdate(),e.current.getRow(t)&&(o&&l(o,{}),e.current.publishEvent("cellFocusIn",e.current.getCellParams(t,r))))},[e,n,l]),i=b.useCallback((t,r={})=>{l((0,es.TR)(e),r),e.current.setState(e=>(n.debug(`Focusing on column header with colIndex=${t}`),(0,m.Z)({},e,{tabIndex:{columnHeader:{field:t},columnHeaderFilter:null,cell:null,columnGroupHeader:null},focus:{columnHeader:{field:t},columnHeaderFilter:null,cell:null,columnGroupHeader:null}}))),e.current.forceUpdate()},[e,n,l]),a=b.useCallback((t,r={})=>{l((0,es.TR)(e),r),e.current.setState(e=>(n.debug(`Focusing on column header filter with colIndex=${t}`),(0,m.Z)({},e,{tabIndex:{columnHeader:null,columnHeaderFilter:{field:t},cell:null,columnGroupHeader:null},focus:{columnHeader:null,columnHeaderFilter:{field:t},cell:null,columnGroupHeader:null}}))),e.current.forceUpdate()},[e,n,l]),s=b.useCallback((t,n,r={})=>{let l=(0,es.TR)(e);l&&e.current.publishEvent("cellFocusOut",e.current.getCellParams(l.id,l.field),r),e.current.setState(e=>(0,m.Z)({},e,{tabIndex:{columnGroupHeader:{field:t,depth:n},columnHeader:null,columnHeaderFilter:null,cell:null},focus:{columnGroupHeader:{field:t,depth:n},columnHeader:null,columnHeaderFilter:null,cell:null}})),e.current.forceUpdate()},[e]),u=b.useCallback(()=>(0,es.Gs)(e),[e]),c=b.useCallback((n,r,l)=>{let o=e.current.getColumnIndex(r),i=(0,V.FE)(e),a=tc(e,{pagination:t.pagination,paginationMode:t.paginationMode}),s=(0,Y.Kf)(e),u=[].concat(s.top||[],a.rows,s.bottom||[]),c=u.findIndex(e=>e.id===n);"right"===l?o+=1:"left"===l?o-=1:c+=1,o>=i.length?(c+=1)<u.length&&(o=0):o<0&&(c-=1)>=0&&(o=i.length-1),c=(0,ep.uZ)(c,0,u.length-1);let d=u[c];if(!d)return;let p=e.current.unstable_getCellColSpanInfo(d.id,o);p&&p.spannedByColSpan&&("left"===l||"below"===l?o=p.leftVisibleCellIndex:"right"===l&&(o=p.rightVisibleCellIndex)),o=(0,ep.uZ)(o,0,i.length-1);let h=i[o];e.current.setCellFocus(d.id,h.field)},[e,t.pagination,t.paginationMode]),d=b.useCallback(({id:t,field:n})=>{e.current.setCellFocus(t,n)},[e]),p=b.useCallback((t,n)=>{"Enter"===n.key||"Tab"===n.key||"Shift"===n.key||(0,tu.Ni)(n.key)||e.current.setCellFocus(t.id,t.field)},[e]),h=b.useCallback(({field:t},n)=>{n.target===n.currentTarget&&e.current.setColumnHeaderFocus(t,n)},[e]),f=b.useCallback(({fields:t,depth:n},r)=>{if(r.target!==r.currentTarget)return;let l=(0,es.Gs)(e);null!==l&&l.depth===n&&t.includes(l.field)||e.current.setColumnGroupHeaderFocus(t[0],n,r)},[e]),g=b.useCallback((t,r)=>{var l;null!=(l=r.relatedTarget)&&l.className.includes(z._.columnHeader)||(n.debug("Clearing focus"),e.current.setState(e=>(0,m.Z)({},e,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}})))},[n,e]),v=b.useCallback(e=>{r.current=e},[]),y=b.useCallback(t=>{let n=r.current;r.current=null;let o=(0,es.TR)(e);
6if(!e.current.unstable_applyPipeProcessors("canUpdateFocus",!0,{event:t,cell:n}))return;if(!o){n&&e.current.setCellFocus(n.id,n.field);return}if((null==n?void 0:n.id)===o.id&&(null==n?void 0:n.field)===o.field)return;let i=e.current.getCellElement(o.id,o.field);null!=i&&i.contains(t.target)||(n?e.current.setCellFocus(n.id,n.field):(e.current.setState(e=>(0,m.Z)({},e,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}})),e.current.forceUpdate(),l(o,t)))},[e,l]),x=b.useCallback(t=>{if("view"===t.cellMode)return;let n=(0,es.TR)(e);((null==n?void 0:n.id)!==t.id||(null==n?void 0:n.field)!==t.field)&&e.current.setCellFocus(t.id,t.field)},[e]),w=b.useCallback(()=>{let t=(0,es.TR)(e);t&&!e.current.getRow(t.id)&&e.current.setState(e=>(0,m.Z)({},e,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}))},[e]),C=(0,nn.Z)(()=>{let n=(0,es.TR)(e);if(!n)return;let r=tc(e,{pagination:t.pagination,paginationMode:t.paginationMode});if(r.rows.find(e=>e.id===n.id))return;let l=(0,V.FE)(e);e.current.setState(e=>(0,m.Z)({},e,{tabIndex:{cell:{id:r.rows[0].id,field:l[0].field},columnGroupHeader:null,columnHeader:null,columnHeaderFilter:null}}))});eh(e,{setCellFocus:o,setColumnHeaderFocus:i,setColumnHeaderFilterFocus:a},"public"),eh(e,{moveFocusToRelativeCell:c,setColumnGroupHeaderFocus:s,getColumnGroupHeaderFocus:u},"private"),b.useEffect(()=>{let t=(0,nb.Z)(e.current.rootElementRef.current);return t.addEventListener("mouseup",y),()=>{t.removeEventListener("mouseup",y)}},[e,y]),(0,ew.zn)(e,"columnHeaderBlur",g),(0,ew.zn)(e,"cellDoubleClick",d),(0,ew.zn)(e,"cellMouseDown",v),(0,ew.zn)(e,"cellKeyDown",p),(0,ew.zn)(e,"cellModeChange",x),(0,ew.zn)(e,"columnHeaderFocus",h),(0,ew.zn)(e,"columnGroupHeaderFocus",f),(0,ew.zn)(e,"rowsSet",w),(0,ew.zn)(e,"paginationModelChange",C)},nx=(e,t)=>{var n,r,l;let o=null!=(n=null!=(r=t.sortModel)?r:null==(l=t.initialState)||null==(l=l.sorting)?void 0:l.sortModel)?n:[];return(0,m.Z)({},e,{sorting:{sortModel:(0,tw.Te)(o,t.disableMultipleColumnsSorting),sortedRows:[]}})},nw=(e,t)=>{var n;let r=eG(e,"useGridSorting");e.current.registerControlState({stateId:"sortModel",propModel:t.sortModel,propOnChange:t.onSortModelChange,stateSelector:ea.Gm,changeEvent:"sortModelChange"});let l=b.useCallback((t,n)=>{let r=(0,ea.Gm)(e),l=r.findIndex(e=>e.field===t),o=[...r];return l>-1?n?o.splice(l,1,n):o.splice(l,1):o=[...r,n],o},[e]),o=b.useCallback((n,r)=>{var l,o;let i=(0,ea.Gm)(e).find(e=>e.field===n.field);if(i){let e=void 0===r?(0,tw.vY)(null!=(o=n.sortingOrder)?o:t.sortingOrder,i.sort):r;return null==e?void 0:(0,m.Z)({},i,{sort:e})}return{field:n.field,sort:void 0===r?(0,tw.vY)(null!=(l=n.sortingOrder)?l:t.sortingOrder):r}},[e,t.sortingOrder]),i=b.useCallback((e,n)=>null==n||!1===n.sortable?e:(n.sortingOrder||t.sortingOrder).some(e=>!!e)?[...e,"columnMenuSortItem"]:e,[t.sortingOrder]),a=b.useCallback(()=>{e.current.setState(n=>{if("server"===t.sortingMode)return r.debug("Skipping sorting rows as sortingMode = server"),(0,m.Z)({},n,{sorting:(0,m.Z)({},n.sorting,{sortedRows:(0,eH.u4)((0,Y.Kd)(e),eH.U5,!1)})});let l=(0,ea.Gm)(n,e.current.instanceId),o=(0,tw.oX)(l,e),i=e.current.applyStrategyProcessor("sorting",{sortRowList:o});return(0,m.Z)({},n,{sorting:(0,m.Z)({},n.sorting,{sortedRows:i})})}),e.current.publishEvent("sortedRowsSet"),e.current.forceUpdate()},[e,r,t.sortingMode]),s=b.useCallback(n=>{(0,ea.Gm)(e)!==n&&(r.debug("Setting sort model"),e.current.setState((0,tw.E8)(n,t.disableMultipleColumnsSorting)),e.current.forceUpdate(),e.current.applySorting())},[e,r,t.disableMultipleColumnsSorting]),u=b.useCallback((n,r,i)=>{let a;if(!n.sortable)return;let s=o(n,r);a=!i||t.disableMultipleColumnsSorting?s?[s]:[]:l(n.field,s),e.current.setSortModel(a)},[e,l,o,t.disableMultipleColumnsSorting]),c=b.useCallback(()=>(0,ea.Gm)(e),[e]),d=b.useCallback(()=>(0,ea.sX)(e).map(e=>e.model),[e]),p=b.useCallback(()=>(0,ea.aV)(e),[e]),h=b.useCallback(t=>e.current.getSortedRowIds()[t],[e]);eh(e,{getSortModel:c,getSortedRows:d,getSortedRowIds:p,getRowIdFromRowIndex:h,setSortModel:s,sortColumn:u,applySorting:a},"public");let f=b.useCallback((n,r)=>{var l;let o=(0,ea.Gm)(e);return!r.exportOnlyDirtyModels||null!=t.sortModel||(null==(l=t.initialState)||null==(l=l.sorting)?void 0:l.sortModel)!=null||o.length>0?(0,m.Z)({},n,{sorting:{sortModel:o}}):n},[e,t.sortModel,null==(n=t.initialState)||null==(n=n.sorting)?void 0:n.sortModel]),g=b.useCallback((n,r)=>{var l;let o=null==(l=r.stateToRestore.sorting)?void 0:l.sortModel;return null==o?n:(e.current.setState((0,tw.E8)(o,t.disableMultipleColumnsSorting)),(0,m.Z)({},n,{callbacks:[...n.callbacks,e.current.applySorting]}))},[e,t.disableMultipleColumnsSorting]),v=b.useCallback(t=>{let n=(0,Y.Kd)(e),r=n[eH.U5],l=t.sortRowList?t.sortRowList(r.children.map(e=>n[e])):[...r.children];return null!=r.footerId&&l.push(r.footerId),l},[e]);eA(e,"exportState",f),eA(e,"restoreState",g),eL(e,eM,"sorting",v);let y=b.useCallback(({colDef:e},t)=>{u(e,void 0,t.shiftKey||t.metaKey||t.ctrlKey)},[u]),x=b.useCallback(({colDef:e},t)=>{!(0,tu.r$)(t.key)||t.ctrlKey||t.metaKey||u(e,void 0,t.shiftKey)},[u]),w=b.useCallback(()=>{let t=(0,ea.Gm)(e),n=(0,V.WH)(e);if(t.length>0){let r=t.filter(e=>n[e.field]);r.length<t.length&&e.current.setSortModel(r)}},[e]),C=b.useCallback(t=>{"sorting"===t&&e.current.applySorting()},[e]);eA(e,"columnMenu",i),(0,ew.zn)(e,"columnHeaderClick",y),(0,ew.zn)(e,"columnHeaderKeyDown",x),(0,ew.zn)(e,"rowsSet",e.current.applySorting),(0,ew.zn)(e,"columnsChange",w),(0,ew.zn)(e,"activeStrategyProcessorChange",C),eD(()=>{e.current.applySorting()}),(0,D.Z)(()=>{void 0!==t.sortModel&&e.current.setSortModel(t.sortModel)},[e,t.sortModel])};var nC=n(10269);let nS=(e,t)=>{var n,r;return(0,m.Z)({},e,{preferencePanel:null!=(n=null==(r=t.initialState)?void 0:r.preferencePanel)?n:{open:!1}})},nk=(e,t)=>{var n;let r=eG(e,"useGridPreferencesPanel"),l=b.useRef(),o=b.useRef(),i=b.useCallback(()=>{r.debug("Hiding Preferences Panel");let t=(0,nC.e)(e.current.state);t.openedPanelValue&&e.current.publishEvent("preferencePanelClose",{openedPanelValue:t.openedPanelValue}),e.current.setState(e=>(0,m.Z)({},e,{preferencePanel:{open:!1}})),e.current.forceUpdate()},[e,r]),a=b.useCallback(()=>{o.current=setTimeout(()=>clearTimeout(l.current),0)},[]),s=b.useCallback(()=>{l.current=setTimeout(i,100)},[i]),u=b.useCallback((t,n,l)=>{r.debug("Opening Preferences Panel"),a(),e.current.setState(e=>(0,m.Z)({},e,{preferencePanel:(0,m.Z)({},e.preferencePanel,{open:!0,openedPanelValue:t,panelId:n,labelId:l})})),e.current.publishEvent("preferencePanelOpen",{openedPanelValue:t}),e.current.forceUpdate()},[r,a,e]);eh(e,{showPreferences:u,hidePreferences:s},"public");let c=b.useCallback((n,r)=>{var l;let o=(0,nC.e)(e.current.state);return!r.exportOnlyDirtyModels||(null==(l=t.initialState)?void 0:l.preferencePanel)!=null||o.open?(0,m.Z)({},n,{preferencePanel:o}):n},[e,null==(n=t.initialState)?void 0:n.preferencePanel]),d=b.useCallback((t,n)=>{let r=n.stateToRestore.preferencePanel;return null!=r&&e.current.setState(e=>(0,m.Z)({},e,{preferencePanel:r})),t},[e]);eA(e,"exportState",c),eA(e,"restoreState",d),b.useEffect(()=>()=>{clearTimeout(l.current),clearTimeout(o.current)},[])};var nI=n(44815),nR=n(10693),n_=n(67746),nE=n(98991);let nM=(e,t,n)=>{var r,l,o;let i=null!=(r=null!=(l=t.filterModel)?l:null==(o=t.initialState)||null==(o=o.filter)?void 0:o.filterModel)?r:(0,n_.c)();return(0,m.Z)({},e,{filter:{filterModel:(0,nE.NF)(i,t.disableMultipleColumnsFiltering,n),filteredRowsLookup:{},filteredDescendantCountLookup:{}},visibleRowsLookup:{}})},nP=e=>e.filteredRowsLookup;function nT(e,t){return e.current.applyStrategyProcessor("visibleRowsLookupCreation",{tree:t.rows.tree,filteredRowsLookup:t.filter.filteredRowsLookup})}function nZ(){return(0,nI.PW)(Object.values)}let nF=(e,t)=>{var n,r;let l=eG(e,"useGridFilter");e.current.registerControlState({stateId:"filter",propModel:t.filterModel,propOnChange:t.onFilterModelChange,stateSelector:ei.uf,changeEvent:"filterModelChange"});let o=b.useCallback(()=>{e.current.setState(n=>{let r=(0,ei.uf)(n,e.current.instanceId),l="client"===t.filterMode?(0,nE.tY)(r,e,t.disableEval):null,o=e.current.applyStrategyProcessor("filtering",{isRowMatchingFilters:l,filterModel:null!=r?r:(0,n_.c)()}),i=(0,m.Z)({},n,{filter:(0,m.Z)({},n.filter,o)}
6),a=nT(e,i);return(0,m.Z)({},i,{visibleRowsLookup:a})}),e.current.publishEvent("filteredRowsSet")},[e,t.filterMode,t.disableEval]),i=b.useCallback((e,n)=>null==n||!1===n.filterable||t.disableColumnFilter?e:[...e,"columnMenuFilterItem"],[t.disableColumnFilter]),a=b.useCallback(()=>{o(),e.current.forceUpdate()},[e,o]),s=b.useCallback(t=>{let n=(0,ei.uf)(e),r=[...n.items],l=r.findIndex(e=>e.id===t.id);-1===l?r.push(t):r[l]=t,e.current.setFilterModel((0,m.Z)({},n,{items:r}),"upsertFilterItem")},[e]),u=b.useCallback(t=>{let n=(0,ei.uf)(e),r=[...n.items];t.forEach(e=>{let n=t.findIndex(t=>t.id===e.id);-1===n?r.push(e):r[n]=e}),e.current.setFilterModel((0,m.Z)({},n,{items:t}),"upsertFilterItems")},[e]),c=b.useCallback(t=>{let n=(0,ei.uf)(e),r=n.items.filter(e=>e.id!==t.id);r.length!==n.items.length&&e.current.setFilterModel((0,m.Z)({},n,{items:r}),"deleteFilterItem")},[e]),d=b.useCallback((n,r,o)=>{if(l.debug("Displaying filter panel"),n){let r;let l=(0,ei.uf)(e),o=l.items.filter(t=>{var n;if(void 0!==t.value)return!Array.isArray(t.value)||0!==t.value.length;let r=null==(n=e.current.getColumn(t.field).filterOperators)?void 0:n.find(e=>e.value===t.operator);return void 0!==(null==r?void 0:r.requiresFilterValue)&&(null==r||!r.requiresFilterValue)}),i=o.find(e=>e.field===n),a=e.current.getColumn(n);r=i?o:t.disableMultipleColumnsFiltering?[(0,nE.p3)({field:n,operator:a.filterOperators[0].value},e)]:[...o,(0,nE.p3)({field:n,operator:a.filterOperators[0].value},e)],e.current.setFilterModel((0,m.Z)({},l,{items:r}))}e.current.showPreferences(t6.y.filters,r,o)},[e,l,t.disableMultipleColumnsFiltering]),p=b.useCallback(()=>{l.debug("Hiding filter panel"),e.current.hidePreferences()},[e,l]),h=b.useCallback(t=>{let n=(0,ei.uf)(e);n.logicOperator!==t&&e.current.setFilterModel((0,m.Z)({},n,{logicOperator:t}),"changeLogicOperator")},[e]),f=b.useCallback(t=>{let n=(0,ei.uf)(e);(0,ep.xb)(n.quickFilterValues,t)||e.current.setFilterModel((0,m.Z)({},n,{quickFilterValues:[...t]}))},[e]),g={setFilterLogicOperator:h,unstable_applyFilters:a,deleteFilterItem:c,upsertFilterItem:s,upsertFilterItems:u,setFilterModel:b.useCallback((n,r)=>{(0,ei.uf)(e)!==n&&(l.debug("Setting filter model"),e.current.updateControlState("filter",(0,nE.S)(n,t.disableMultipleColumnsFiltering,e),r),e.current.unstable_applyFilters())},[e,l,t.disableMultipleColumnsFiltering]),showFilterPanel:d,hideFilterPanel:p,setQuickFilterValues:f,ignoreDiacritics:t.ignoreDiacritics};eh(e,g,"public");let v=b.useCallback((n,r)=>{var l;let o=(0,ei.uf)(e);return r.exportOnlyDirtyModels&&null==t.filterModel&&(null==(l=t.initialState)||null==(l=l.filter)?void 0:l.filterModel)==null&&(0,ep.xb)(o,(0,n_.c)())?n:(0,m.Z)({},n,{filter:{filterModel:o}})},[e,t.filterModel,null==(n=t.initialState)||null==(n=n.filter)?void 0:n.filterModel]),y=b.useCallback((n,r)=>{var l;let o=null==(l=r.stateToRestore.filter)?void 0:l.filterModel;return null==o?n:(e.current.updateControlState("filter",(0,nE.S)(o,t.disableMultipleColumnsFiltering,e),"restoreState"),(0,m.Z)({},n,{callbacks:[...n.callbacks,e.current.unstable_applyFilters]}))},[e,t.disableMultipleColumnsFiltering]),x=b.useCallback((e,n)=>{if(n===t6.y.filters){var r;let e=t.slots.filterPanel;return(0,_.jsx)(e,(0,m.Z)({},null==(r=t.slotProps)?void 0:r.filterPanel))}return e},[t.slots.filterPanel,null==(r=t.slotProps)?void 0:r.filterPanel]),{getRowId:w}=t,C=(0,nR.A)(nZ),S=b.useCallback(n=>{if("client"!==t.filterMode||!n.isRowMatchingFilters)return{filteredRowsLookup:{},filteredDescendantCountLookup:{}};let r=(0,Y.J4)(e),l={},{isRowMatchingFilters:o}=n,i={},a={passingFilterItems:null,passingQuickFilterValues:null}
6,s=C.current(e.current.state.rows.dataRowIdToModelLookup);for(let t=0;t<s.length;t+=1){let r=s[t],u=w?w(r):r.id;o(r,void 0,a);let c=(0,nE.W$)([a.passingFilterItems],[a.passingQuickFilterValues],n.filterModel,e,i);l[u]=c}let u="auto-generated-group-footer-root";return r[u]&&(l[u]=!0),{filteredRowsLookup:l,filteredDescendantCountLookup:{}}},[e,t.filterMode,w,C]);eA(e,"columnMenu",i),eA(e,"exportState",v),eA(e,"restoreState",y),eA(e,"preferencePanel",x),eL(e,eM,"filtering",S),eL(e,eM,"visibleRowsLookupCreation",nP);let k=b.useCallback(()=>{l.debug("onColUpdated - GridColumns changed, applying filters");let t=(0,ei.uf)(e),n=(0,V.xs)(e),r=t.items.filter(e=>e.field&&n[e.field]);r.length<t.items.length&&e.current.setFilterModel((0,m.Z)({},t,{items:r}))},[e,l]),I=b.useCallback(t=>{"filtering"===t&&e.current.unstable_applyFilters()},[e]),R=b.useCallback(()=>{e.current.setState(t=>(0,m.Z)({},t,{visibleRowsLookup:nT(e,t)})),e.current.forceUpdate()},[e]);(0,ew.zn)(e,"rowsSet",o),(0,ew.zn)(e,"columnsChange",k),(0,ew.zn)(e,"activeStrategyProcessorChange",I),(0,ew.zn)(e,"rowExpansionChange",R),(0,ew.zn)(e,"columnVisibilityModelChange",()=>{let t=(0,ei.uf)(e);t.quickFilterValues&&t.quickFilterExcludeHiddenColumns&&e.current.unstable_applyFilters()}),eD(()=>{e.current.unstable_applyFilters()}),(0,D.Z)(()=>{void 0!==t.filterModel&&e.current.setFilterModel(t.filterModel)},[e,l,t.filterModel])},nD={compact:.7,comfortable:1.3,standard:1},nA=(e,t)=>(0,m.Z)({},e,{density:{value:t.density,factor:nD[t.density]}}),nO=(e,t)=>{let n=eG(e,"useDensity"),r=b.useCallback(t=>{n.debug(`Set grid density to ${t}`),e.current.setState(e=>{let n=(0,N.EH)(e),r={value:t,factor:nD[t]};return(0,ep.xb)(n,r)?e:(0,m.Z)({},e,{density:r})}),e.current.forceUpdate()},[n,e]);b.useEffect(()=>{e.current.setDensity(t.density)},[e,t.density]),eh(e,{setDensity:r},"public")};var nz=n(44932);let nj=(e,t,n)=>{var r;let l=e.paginationModel,o=e.rowCount,i=null!=(r=null==n?void 0:n.pageSize)?r:l.pageSize,a=(0,nz.tR)(o,i);n&&((null==n?void 0:n.page)!==l.page||(null==n?void 0:n.pageSize)!==l.pageSize)&&(l=n);let s=(0,nz.NZ)(l.page,a);return s!==l.page&&(l=(0,m.Z)({},l,{page:s})),(0,nz.Ip)(l.pageSize,t),l},nL=(e,t)=>{var n;let r=eG(e,"useGridPaginationModel"),l=(0,C.P)(e,N.CD),o=Math.floor(t.rowHeight*l);e.current.registerControlState({stateId:"paginationModel",propModel:t.paginationModel,propOnChange:t.onPaginationModelChange,stateSelector:eY.O$,changeEvent:"paginationModelChange"});let i=b.useCallback(t=>{let n=(0,eY.O$)(e);t!==n.page&&(r.debug(`Setting page to ${t}`),e.current.setPaginationModel({page:t,pageSize:n.pageSize}))},[e,r]),a=b.useCallback(t=>{let n=(0,eY.O$)(e);t!==n.pageSize&&(r.debug(`Setting page size to ${t}`),e.current.setPaginationModel({pageSize:t,page:n.page}))},[e,r]),s=b.useCallback(n=>{n!==(0,eY.O$)(e)&&(r.debug("Setting 'paginationModel' to",n),e.current.setState(e=>(0,m.Z)({},e,{pagination:(0,m.Z)({},e.pagination,{paginationModel:nj(e.pagination,t.signature,n)})})))},[e,r,t.signature]);eh(e,{setPage:i,setPageSize:a,setPaginationModel:s},"public");let u=b.useCallback((n,r)=>{var l;let o=(0,eY.O$)(e);return r.exportOnlyDirtyModels&&null==t.paginationModel&&(null==(l=t.initialState)||null==(l=l.pagination)?void 0:l.paginationModel)==null&&(0===o.page||o.pageSize===(0,nz.dG)(t.autoPageSize))?n:(0,m.Z)({},n,{pagination:(0,m.Z)({},n.pagination,{paginationModel:o})})},[e,t.paginationModel,null==(n=t.initialState)||null==(n=n.pagination)?void 0:n.paginationModel,t.autoPageSize]),c=b.useCallback((n,r)=>{var l,o;let i=null!=(l=r.stateToRestore.pagination)&&l.paginationModel?(0,m.Z)({},(0,nz.Xd)(t.autoPageSize),null==(o=r.stateToRestore.pagination)?void 0:o.paginationModel):(0,eY.O$)(e);return e.current.setState(e=>(0,m.Z)({},e,{pagination:(0,m.Z)({},e.pagination,{paginationModel:nj(e.pagination,t.signature,i)})})),n},[e,t.autoPageSize,t.signature]);eA(e,"exportState",u),eA(e,"restoreState",c);let d=b.useCallback(()=>{if(!t.autoPageSize)return;let n=e.current.getRootDimensions()||{viewportInnerSize:{height:0}},r=(0,eH.oq)(e),l=Math.floor((n.viewportInnerSize.height-r.top-r.bottom)/o);e.current.setPageSize(l)},[e,t.autoPageSize,o]),p=b.useCallback(t=>{if(null==t)return;let n=(0,eY.O$)(e),r=(0,eY.UB)(e);n.page>r-1&&e.current.setPage(Math.max(0,r-1))},[e]);(0,ew.zn)(e,"viewportInnerSizeChange",d),(0,ew.zn)(e,"paginationModelChange",()=>{var t;let n=(0,eY.O$)(e);null!=(t=e.current.virtualScrollerRef)&&t.current&&e.current.scrollToIndexes({rowIndex:n.page*n.pageSize})}),(0,ew.zn)(e,"rowCountChange",p),b.useEffect(()=>{e.current.setState(e=>(0,m.Z)({},e,{pagination:(0,m.Z)({},e.pagination,{paginationModel:nj(e.pagination,t.signature,t.paginationModel)})}))},[e,t.paginationModel,t.paginationMode,t.signature]),b.useEffect(d,[d])},nH=(e,t)=>{var n;let r=eG(e,"useGridRowCount"),l=(0,C.P)(e,ei.xf),o=(0,C.P)(e,eY.RM);e.current.registerControlState({stateId:"paginationRowCount",propModel:t.rowCount,propOnChange:t.onRowCountChange,stateSelector:eY.RM,changeEvent:"rowCountChange"});let i=b.useCallback(t=>{o!==t&&(r.debug("Setting 'rowCount' to",t),e.current.setState(e=>(0,m.Z)({},e,{pagination:(0,m.Z)({},e.pagination,{rowCount:t})})))},[e,r,o]);eh(e,{setRowCount:i},"public");let a=b.useCallback((n,r)=>{var l;let o=(0,eY.RM)(e);
6return r.exportOnlyDirtyModels&&null==t.rowCount&&(null==(l=t.initialState)||null==(l=l.pagination)?void 0:l.rowCount)==null?n:(0,m.Z)({},n,{pagination:(0,m.Z)({},n.pagination,{rowCount:o})})},[e,t.rowCount,null==(n=t.initialState)||null==(n=n.pagination)?void 0:n.rowCount]),s=b.useCallback((t,n)=>{var r;let l=null!=(r=n.stateToRestore.pagination)&&r.rowCount?n.stateToRestore.pagination.rowCount:(0,eY.RM)(e);return e.current.setState(e=>(0,m.Z)({},e,{pagination:(0,m.Z)({},e.pagination,{rowCount:l})})),t},[e]);eA(e,"exportState",a),eA(e,"restoreState",s),b.useEffect(()=>{},[t.rowCount,t.paginationMode]),b.useEffect(()=>{"client"===t.paginationMode?e.current.setRowCount(l):null!=t.rowCount&&e.current.setRowCount(t.rowCount)},[e,l,t.paginationMode,t.rowCount])},nB=(e,t)=>{var n,r,l,o,i;let a=(0,m.Z)({},(0,nz.Xd)(t.autoPageSize),null!=(n=t.paginationModel)?n:null==(r=t.initialState)||null==(r=r.pagination)?void 0:r.paginationModel);(0,nz.Ip)(a.pageSize,t.signature);let s=null!=(l=null!=(o=t.rowCount)?o:null==(i=t.initialState)||null==(i=i.pagination)?void 0:i.rowCount)?l:0;return(0,m.Z)({},e,{pagination:{paginationModel:a,rowCount:s}})},nN=(e,t)=>{nL(e,t),nH(e,t)};var nV=n(39336),n$=n(84324);let nU=["field","align","width","contentWidth"],nG=e=>{let{align:t,classes:n}=e,r={root:["cell","cellSkeleton",`cell--text${(0,T.Z)(t)}`,"withBorderColor"]};return(0,Z.Z)(r,z.d,n)};var nq=n(79533);let nW=["className"],nK=e=>{let{classes:t}=e;return(0,Z.Z)({root:["iconButtonContainer"]},z.d,t)},nY=(0,en.Z)("div",{name:"MuiDataGrid",slot:"IconButtonContainer",overridesResolver:(e,t)=>t.iconButtonContainer})(()=>({display:"flex",visibility:"hidden",width:0})),nX=b.forwardRef(function(e,t){let{className:n}=e,r=(0,M.Z)(e,nW),l=(0,B.B)(),o=nK(l);return(0,_.jsx)(nY,(0,m.Z)({ref:t,className:(0,P.Z)(o.root,n),ownerState:l},r))}),nJ=e=>{let{classes:t}=e;return(0,Z.Z)({icon:["filterIcon"]},z.d,t)},nQ=["className","selectedRowCount"],n0=e=>{let{classes:t}=e;return(0,Z.Z)({root:["selectedRowCount"]},z.d,t)},n1=(0,en.Z)("div",{name:"MuiDataGrid",slot:"SelectedRowCount",overridesResolver:(e,t)=>t.selectedRowCount})(({theme:e})=>({alignItems:"center",display:"flex",margin:e.spacing(0,2),visibility:"hidden",width:0,height:0,[e.breakpoints.up("sm")]:{visibility:"visible",width:"auto",height:"auto"}})),n2=b.forwardRef(function(e,t){let{className:n,selectedRowCount:r}=e,l=(0,M.Z)(e,nQ),o=(0,e5.l)(),i=(0,B.B)(),a=n0(i),s=o.current.getLocaleText("footerRowSelected")(r);return(0,_.jsx)(n1,(0,m.Z)({ref:t,className:(0,P.Z)(a.root,n),ownerState:i},l,{children:s}))}),n3=["className"],n4=e=>{let{classes:t}=e;return(0,Z.Z)({root:["footerContainer","withBorderColor"]},z.d,t)},n5=(0,en.Z)("div",{name:"MuiDataGrid",slot:"FooterContainer",overridesResolver:(e,t)=>t.footerContainer})({display:"flex",justifyContent:"space-between",alignItems:"center",minHeight:52,borderTop:"1px solid"}),n9=b.forwardRef(function(e,t){let{className:n}=e,r=(0,M.Z)(e,n3),l=(0,B.B)(),o=n4(l);return(0,_.jsx)(n5,(0,m.Z)({ref:t,className:(0,P.Z)(o.root,n),ownerState:l},r))}),n6=b.forwardRef(function(e,t){var n,r;let l=(0,e5.l)(),o=(0,B.B)(),i=(0,C.P)(l,Y.G$),a=(0,C.P)(l,eK.xD),s=(0,C.P)(l,ei.xf),u=!o.hideFooterSelectedRowCount&&a>0?(0,_.jsx)(n2,{selectedRowCount:a}):(0,_.jsx)("div",{}),c=o.hideFooterRowCount||o.pagination?null:(0,_.jsx)(o.slots.footerRowCount,(0,m.Z)({},null==(n=o.slotProps)?void 0:n.footerRowCount,{rowCount:i,visibleRowCount:s})),d=o.pagination&&!o.hideFooterPagination&&o.slots.pagination&&(0,_.jsx)(o.slots.pagination,(0,m.Z)({},null==(r=o.slotProps)?void 0:r.pagination));return(0,_.jsxs)(n9,(0,m.Z)({ref:t},e,{children:[u,c,d]}))}),n8=["className","rowCount","visibleRowCount"],n7=e=>{let{classes:t}=e;return(0,Z.Z)({root:["rowCount"]},z.d,t)},re=(0,en.Z)("div",{name:"MuiDataGrid",slot:"RowCount",overridesResolver:(e,t)=>t.rowCount})(({theme:e})=>({alignItems:"center",display:"flex",margin:e.spacing(0,2)})),rt=b.forwardRef(function(e,t){let{className:n,rowCount:r,visibleRowCount:l}=e,o=(0,M.Z)(e,n8),i=(0,e5.l)(),a=(0,B.B)(),s=n7(a);if(0===r)return null;let u=l<r?i.current.getLocaleText("footerTotalVisibleRows")(l,r):r.toLocaleStr
6ing();return(0,_.jsxs)(re,(0,m.Z)({ref:t,className:(0,P.Z)(s.root,n),ownerState:a},o,{children:[i.current.getLocaleText("footerTotalRows")," ",u]}))}),rn=b.forwardRef(function(e,t){var n,r,l;let o=(0,e5.l)(),i=(0,C.P)(o,V.d$),a=(0,B.B)(),s=(0,C.P)(o,nC.e),u=o.current.unstable_applyPipeProcessors("preferencePanel",null,null!=(n=s.openedPanelValue)?n:t6.y.filters);return(0,_.jsx)(a.slots.panel,(0,m.Z)({ref:t,as:a.slots.basePopper,open:i.length>0&&s.open,id:s.panelId,"aria-labelledby":s.labelId},null==(r=a.slotProps)?void 0:r.panel,e,null==(l=a.slotProps)?void 0:l.basePopper,{children:u}))});var rr=n(97182),rl=n(74784);let ro=b.forwardRef(function(e,t){return(0,_.jsx)(rl.n,(0,m.Z)({ref:t},e,{children:(0,_.jsx)(rr.Z,{})}))}),ri=b.forwardRef(function(e,t){let n=(0,e5.l)().current.getLocaleText("noRowsLabel");return(0,_.jsx)(rl.n,(0,m.Z)({ref:t},e,{children:n}))});var ra=n(8780),rs=n(90712),ru=n(44001),rc=n(15972),rd=n(40096),rp=n(2101),rh=n(66643);let rf=b.createContext(),rg=b.createContext();var rm=n(1588),rb=n(34867);function rv(e){return(0,rb.ZP)("MuiTableCell",e)}let ry=(0,rm.Z)("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),rx=["align","className","component","padding","scope","size","sortDirection","variant"],rw=e=>{let{classes:t,variant:n,align:r,padding:l,size:o,stickyHeader:i}=e,a={root:["root",n,i&&"stickyHeader","inherit"!==r&&"align".concat((0,rh.Z)(r)),"normal"!==l&&"padding".concat((0,rh.Z)(l)),"size".concat((0,rh.Z)(o))]};return(0,Z.Z)(a,rv,t)},rC=(0,O.ZP)("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],t["size".concat((0,rh.Z)(n.size))],"normal"!==n.padding&&t["padding".concat((0,rh.Z)(n.padding))],"inherit"!==n.align&&t["align".concat((0,rh.Z)(n.align))],n.stickyHeader&&t.stickyHeader]}})(e=>{let{theme:t,ownerState:n}=e;return(0,m.Z)({},t.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:t.vars?"1px solid ".concat(t.vars.palette.TableCell.border):"1px solid\n    ".concat("light"===t.palette.mode?(0,rp.$n)((0,rp.Fq)(t.palette.divider,1),.88):(0,rp._j)((0,rp.Fq)(t.palette.divider,1),.68)),textAlign:"left",padding:16},"head"===n.variant&&{color:(t.vars||t).palette.text.primary,lineHeight:t.typography.pxToRem(24),fontWeight:t.typography.fontWeightMedium},"body"===n.variant&&{color:(t.vars||t).palette.text.primary},"footer"===n.variant&&{color:(t.vars||t).palette.text.secondary,lineHeight:t.typography.pxToRem(21),fontSize:t.typography.pxToRem(12)},"small"===n.size&&{padding:"6px 16px",["&.".concat(ry.paddingCheckbox)]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}},"checkbox"===n.padding&&{width:48,padding:"0 0 0 4px"},"none"===n.padding&&{padding:0},"left"===n.align&&{textAlign:"left"},"center"===n.align&&{textAlign:"center"},"right"===n.align&&{textAlign:"right",flexDirection:"row-reverse"},"justify"===n.align&&{textAlign:"justify"},n.stickyHeader&&{position:"sticky",top:0,zIndex:2,backgroundColor:(t.vars||t).palette.background.default})}),rS=b.forwardRef(function(e,t){let n;let r=(0,ru.i)({props:e,name:"MuiTableCell"}),{align:l="inherit",className:o,component:i,padding:a,scope:s,size:u,sortDirection:c,variant:d}=r,p=(0,M.Z)(r,rx),h=b.useContext(rf),f=b.useContext(rg),g=f&&"head"===f.variant,v=s;"td"===(n=i||(g?"th":"td"))?v=void 0:!v&&g&&(v="col");let y=d||f&&f.variant,x=(0,m.Z)({},r,{align:l,component:n,padding:a||(h&&h.padding?h.padding:"normal"),size:u||(h&&h.size?h.size:"medium"),sortDirection:c,stickyHeader:"head"===y&&h&&h.stickyHeader,variant:y}),w=rw(x),C=null;return c&&(C="asc"===c?"ascending":"descending"),(0,_.jsx)(rC,(0,m.Z)({as:n,ref:t,className:(0,ra.Z)(w.root,o),"aria-sort":C,scope:v,ownerState:x},p))});var rk=n(88539),rI=n(82056),rR=n(91194),r_=n(59367),rE=n(52857),rM=n(30139),rP=(0,rM.Z)((0,_.jsx)("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage"),rT=(0,rM.Z)((0,_.jsx)("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage");let rZ=["backIconButtonProps","count","disabled","getItemAriaLabel","nextIconButtonProps","onPageChange","page","rowsPerPage","showFirstButton","showLastButton","slots","slotProps"],rF=b.forwardRef(function(e,t){var n,r,l,o,i,a,s,u;let{backIconButtonProps:c,count:d,disabled:p=!1,getItemAriaLabel:h,nextIconButtonProps:f,onPageChange:g,page:b,rowsPerPage:v,showFirstButton:y,showLastButton:x,slots:w={},slotProps:C={}}=e,S=(0,M.Z)(e,rZ),k=(0,rI.V)(),I=null!=(n=w.firstButton)?n:rE.Z,R=null!=(r=w.lastButton)?r:rE.Z,E=null!=(l=w.nextButton)?l:rE.Z,P=null!=(o=w.previousButton)?o:rE.Z,T=null!=(i=w.firstButtonIcon)?i:rT,Z=null!=(a=w.lastButtonIcon)?a:rP,F=null!=(s=w.nextButtonIcon)?s:r_.Z,D=null!=(u=w.previousButtonIcon)?u:rR.Z,A=k?R:I,O=k?E:P,z=k?P:E,j=k?I:R,L=k?C.lastButton:C.firstButton,H=k?C.nextButton:C.previousButton,B=k?C.previousButton:C.nextButton,N=k?C.firstButton:C.lastButton;return(0,_.jsxs)("div",(0,m.Z)({ref:t},S,{children:[y&&(0,_.jsx)(A,(0,m.Z)({onClick:e=>{g(e,0)},disabled:p||0===b,"aria-label":h("first",b),title:h("first",b)},L,{children:k?(0,_.jsx)(Z,(0,m.Z)({},C.lastButtonIcon)):(0,_.jsx)(T,(0,m.Z)({},C.firstButtonIcon))})),(0,_.jsx)(O,(0,m.Z)({onClick:e=>{g(e,b-1)},disabled:p||0===b,color:"inherit","aria-label":h("previous",b),title:h("previous",b)},null!=H?H:c,{children:k?(0,_.jsx)(F,(0,m.Z)({},C.nextButtonIcon)):(0,_.jsx)(D,(0,m.Z)({},C.previousButtonIcon))})),(0,_.jsx)(z,(0,m.Z)({onClick:e=>{g(e,b+1)},disabled:p||-1!==d&&b>=Math.ceil(d/v)-1,color:"inherit","aria-label":h("next",b),title:h("next",b)},null!=B?B:f,{children:k?(0,_.jsx)(D,(0,m.Z)({},C.previousButtonIcon)):(0,_.jsx)(F,(0,m.Z)({},C.nextButtonIcon))})),x&&(0,_.jsx)(j,(0,m.Z)({onClick:e=>{g(e,Math.max(0,Math.ceil(d/v)-1))},disabled:p||b>=Math.ceil(d/v)-1,"aria-label":h("last",b),title:h("last",b)},N,{children:k?(0,_.jsx)(T,(0,m.Z)({},C.firstButtonIcon)):(0,_.jsx)(Z,(0,m.Z)({},C.lastButtonIcon))}))]}))});var rD=n(42783);function rA(e){return(0,rb.ZP)("MuiTablePagination",e)}let rO=(0,rm.Z)("MuiTablePagination",["root","toolbar","spacer","selectLabel","selectRoot","select","selectIcon","input","menuItem","displayedRows","actions"]),rz=["ActionsComponent","backIconButtonProps","className","colSpan","component","count","disabled","getItemAriaLabel","labelDisplayedRows","labelRowsPerPage","nextIconButtonProps","onPageChange","onRowsPerPageChange","page","rowsPerPage","rowsPerPageOptions","SelectProps","
6showFirstButton","showLastButton","slotProps","slots"],rj=(0,O.ZP)(rS,{name:"MuiTablePagination",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let{theme:t}=e;return{overflow:"auto",color:(t.vars||t).palette.text.primary,fontSize:t.typography.pxToRem(14),"&:last-child":{padding:0}}}),rL=(0,O.ZP)(rk.Z,{name:"MuiTablePagination",slot:"Toolbar",overridesResolver:(e,t)=>(0,m.Z)({["& .".concat(rO.actions)]:t.actions},t.toolbar)})(e=>{let{theme:t}=e;return{minHeight:52,paddingRight:2,["".concat(t.breakpoints.up("xs")," and (orientation: landscape)")]:{minHeight:52},[t.breakpoints.up("sm")]:{minHeight:52,paddingRight:2},["& .".concat(rO.actions)]:{flexShrink:0,marginLeft:20}}}),rH=(0,O.ZP)("div",{name:"MuiTablePagination",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})({flex:"1 1 100%"}),rB=(0,O.ZP)("p",{name:"MuiTablePagination",slot:"SelectLabel",overridesResolver:(e,t)=>t.selectLabel})(e=>{let{theme:t}=e;return(0,m.Z)({},t.typography.body2,{flexShrink:0})}),rN=(0,O.ZP)(rd.Z,{name:"MuiTablePagination",slot:"Select",overridesResolver:(e,t)=>(0,m.Z)({["& .".concat(rO.selectIcon)]:t.selectIcon,["& .".concat(rO.select)]:t.select},t.input,t.selectRoot)})({color:"inherit",fontSize:"inherit",flexShrink:0,marginRight:32,marginLeft:8,["& .".concat(rO.select)]:{paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right"}}),rV=(0,O.ZP)(rc.Z,{name:"MuiTablePagination",slot:"MenuItem",overridesResolver:(e,t)=>t.menuItem})({}),r$=(0,O.ZP)("p",{name:"MuiTablePagination",slot:"DisplayedRows",overridesResolver:(e,t)=>t.displayedRows})(e=>{let{theme:t}=e;return(0,m.Z)({},t.typography.body2,{flexShrink:0})});function rU(e){let{from:t,to:n,count:r}=e;return"".concat(t,"–").concat(n," of ").concat(-1!==r?r:"more than ".concat(n))}function rG(e){return"Go to ".concat(e," page")}let rq=e=>{let{classes:t}=e;return(0,Z.Z)({root:["root"],toolbar:["toolbar"],spacer:["spacer"],selectLabel:["selectLabel"],select:["select"],input:["input"],selectIcon:["selectIcon"],menuItem:["menuItem"],displayedRows:["displayedRows"],actions:["actions"]},rA,t)},rW=b.forwardRef(function(e,t){var n;let r;let l=(0,ru.i)({props:e,name:"MuiTablePagination"}),{ActionsComponent:o=rF,backIconButtonProps:i,className:a,colSpan:s,component:u=rS,count:c,disabled:d=!1,getItemAriaLabel:p=rG,labelDisplayedRows:h=rU,labelRowsPerPage:f="Rows per page:",nextIconButtonProps:v,onPageChange:y,onRowsPerPageChange:x,page:w,rowsPerPage:C,rowsPerPageOptions:S=[10,25,50,100],SelectProps:k={},showFirstButton:I=!1,showLastButton:R=!1,slotProps:E={},slots:P={}}=l,T=(0,M.Z)(l,rz),Z=rq(l),F=null!=(n=null==E?void 0:E.select)?n:k,D=F.native?"option":rV;(u===rS||"td"===u)&&(r=s||1e3);let A=(0,rD.Z)(F.id),O=(0,rD.Z)(F.labelId);return(0,_.jsx)(rj,(0,m.Z)({colSpan:r,ref:t,as:u,ownerState:l,className:(0,ra.Z)(Z.root,a)},T,{children:(0,_.jsxs)(rL,{className:Z.toolbar,children:[(0,_.jsx)(rH,{className:Z.spacer}),S.length>1&&(0,_.jsx)(rB,{className:Z.selectLabel,id:O,children:f}),S.length>1&&(0,_.jsx)(rN,(0,m.Z)({variant:"standard"},!F.variant&&{input:g||(g=(0,_.jsx)(tZ.ZP,{}))},{value:C,onChange:x,id:A,labelId:O},F,{classes:(0,m.Z)({},F.classes,{root:(0,ra.Z)(Z.input,Z.selectRoot,(F.classes||{}).root),select:(0,ra.Z)(Z.select,(F.classes||{}).select),icon:(0,ra.Z)(Z.selectIcon,(F.classes||{}).icon)}),disabled:d,children:S.map(e=>(0,b.createElement)(D,(0,m.Z)({},!(0,rs.Z)(D)&&{ownerState:l},{className:Z.menuItem,key:e.label?e.label:e,value:e.value?e.value:e}),e.label?e.label:e))})),(0,_.jsx)(r$,{className:Z.displayedRows,children:h({from:0===c?0:w*C+1,to:-1===c?(w+1)*C:-1===C?c:Math.min(c,(w+1)*C),count:-1===c?-1:c,page:w})}),(0,_.jsx)(o,{className:Z.actions,backIconButtonProps:i,count:c,nextIconButtonProps:v,onPageChange:y,page:w,rowsPerPage:C,showFirstButton:I,showLastButton:R,slotProps:E.actions,slots:P.actions,getItemAriaLabel:p,disabled:d})]})}))}),rK=(0,O.ZP)(rW)(({theme:e})=>({[`& .${rO.selectLabel}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"block"}},[`& .${rO.input}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"inline-flex"}}})),rY=b.forwardRef(function(e,t){let n=(0,e5.l)(),r=(0,B.B)(),l=(0,C.P)(n,eY.O$),o=(0,C.P)(n,eY.RM),i=b.useMemo(()=>Math.floor(o/(l.pageSize||1)),[o,l.pageSize]),a=b.useCallback(e=>{let t=Number(e.target.value);n.current.setPageSize(t)},[n]),s=b.useCallback((e,t)=>{n.current.setPage(t)},[n]),u=(e=>{for(let t=0;t<r.pageSizeOptions.length;t+=1){let n=r.pageSizeOptions[t];if("number"==typeof n){if(n===e)return!0}else if(n.value===e)return!0}return!1})(l.pageSize)?r.pageSizeOptions:[];return(0,_.jsx)(rK,(0,m.Z)({ref:t,component:"div",count:o,page:l.page<=i?l.page:i,rowsPerPageOptions:u,rowsPerPage:l.pageSize,onPageChange:s,onRowsPerPageChange:a},n.current.getLocaleText("MuiTablePagination"),e))});var rX=n(69107);let rJ=["className"],rQ=e=>{let{classes:t}=e;return(0,Z.Z)({root:["panelContent"]},z.d,t)},r0=(0,en.Z)("div",{name:"MuiDataGrid",slot:"PanelContent",overridesResolver:(e,t)=>t.panelContent})({display:"flex",flexDirection:"column",overflow:"auto",flex:"1 1",maxHeight:400});function r1(e){let{className:t}=e,n=(0,M.Z)(e,rJ),r=(0,B.B)(),l=rQ(r);return(0,_.jsx)(r0,(0,m.Z)({className:(0,P.Z)(t,l.root),ownerState:r},n))}let r2=["className"],r3=e=>{let{classes:t}=e;return(0,Z.Z)({root:["panelFooter"]},z.d,t)},r4=(0,en.Z)("div",{name:"MuiDataGrid",slot:"PanelFooter",overridesResolver:(e,t)=>t.panelFooter})(({theme:e})=>({padding:e.spacing(.5),display:"flex",justifyContent:"space-between"}));function r5(e){let{className:t}=e,n=(0,M.Z)(e,r2),r=(0,B.B)(),l=r3(r);return(0,_.jsx)(r4,(0,m.Z)({className:(0,P.Z)(t,l.root),ownerState:r},n))}var r9=n(54753);let r6=["className","slotProps"],r8=e=>{let{classes:t}=e;return(0,Z.Z)({root:["panelWrapper"]},z.d,t)},r7=(0,O.ZP)("div",{name:"MuiDataGrid",slot:"PanelWrapper",overridesResolver:(e,t)=>t.panelWrapper})({display:"flex",flexDirection:"column",flex:1,"&:focus":{outline:0}}),le=()=>!0,lt=b.forwardRef(function(e,t){let{className:n,slotProps:r={}}=e,l=(0,M.Z)(e,r6),o=(0,B.B)(),i=r8(o);return(0,_.jsx)(r9.Z,(0,m.Z)({open:!0,disableEnforceFocus:!0,isEnabled:le}
6,r.TrapFocus,{children:(0,_.jsx)(r7,(0,m.Z)({ref:t,tabIndex:-1,className:(0,P.Z)(n,i.root),ownerState:o},l))}))}),ln=["item","hasMultipleFilters","deleteFilter","applyFilterChanges","multiFilterOperator","showMultiFilterOperators","disableMultiFilterOperator","applyMultiFilterOperatorChanges","focusElementRef","logicOperators","columnsSort","filterColumns","deleteIconProps","logicOperatorInputProps","operatorInputProps","columnInputProps","valueInputProps","children"],lr=["InputComponentProps"],ll=e=>{let{classes:t}=e;return(0,Z.Z)({root:["filterForm"],deleteIcon:["filterFormDeleteIcon"],logicOperatorInput:["filterFormLogicOperatorInput"],columnInput:["filterFormColumnInput"],operatorInput:["filterFormOperatorInput"],valueInput:["filterFormValueInput"]},z.d,t)},lo=(0,O.ZP)("div",{name:"MuiDataGrid",slot:"FilterForm",overridesResolver:(e,t)=>t.filterForm})(({theme:e})=>({display:"flex",padding:e.spacing(1)})),li=(0,O.ZP)("div",{name:"MuiDataGrid",slot:"FilterFormDeleteIcon",overridesResolver:(e,t)=>t.filterFormDeleteIcon})(({theme:e})=>({flexShrink:0,justifyContent:"flex-end",marginRight:e.spacing(.5),marginBottom:e.spacing(.2)})),la=(0,O.ZP)("div",{name:"MuiDataGrid",slot:"FilterFormLogicOperatorInput",overridesResolver:(e,t)=>t.filterFormLogicOperatorInput})({minWidth:55,marginRight:5,justifyContent:"end"}),ls=(0,O.ZP)("div",{name:"MuiDataGrid",slot:"FilterFormColumnInput",overridesResolver:(e,t)=>t.filterFormColumnInput})({width:150}),lu=(0,O.ZP)("div",{name:"MuiDataGrid",slot:"FilterFormOperatorInput",overridesResolver:(e,t)=>t.filterFormOperatorInput})({width:120}),lc=(0,O.ZP)("div",{name:"MuiDataGrid",slot:"FilterFormValueInput",overridesResolver:(e,t)=>t.filterFormValueInput})({width:190}),ld=e=>{switch(e){case rX.G.And:return"filterPanelOperatorAnd";case rX.G.Or:return"filterPanelOperatorOr";default:throw Error("MUI: Invalid `logicOperator` property in the `GridFilterPanel`.")}},lp=e=>e.headerName||e.field,lh=new Intl.Collator,lf=b.forwardRef(function(e,t){var n,r,l,o,i,a,s,u,c,d;let{item:p,hasMultipleFilters:h,deleteFilter:f,applyFilterChanges:g,multiFilterOperator:v,showMultiFilterOperators:y,disableMultiFilterOperator:x,applyMultiFilterOperatorChanges:w,focusElementRef:S,logicOperators:k=[rX.G.And,rX.G.Or],columnsSort:I,filterColumns:R,deleteIconProps:E={},logicOperatorInputProps:Z={},operatorInputProps:F={},columnInputProps:D={},valueInputProps:A={}}=e,O=(0,M.Z)(e,ln),z=(0,e5.l)(),j=(0,C.P)(z,V.qH),L=(0,C.P)(z,ei.uf),H=(0,e0.Z)(),N=(0,e0.Z)(),$=(0,e0.Z)(),U=(0,e0.Z)(),G=(0,B.B)(),q=ll(G),W=b.useRef(null),K=b.useRef(null),Y=h&&k.length>0,X=(null==(n=G.slotProps)?void 0:n.baseFormControl)||{},J=null==(l=((null==(r=G.slotProps)?void 0:r.baseSelect)||{}).native)||l,Q=(null==(o=G.slotProps)?void 0:o.baseInputLabel)||{},ee=(null==(i=G.slotProps)?void 0:i.baseSelectOption)||{},{InputComponentProps:et}=A,en=(0,M.Z)(A,lr),er=b.useMemo(()=>{if(void 0===R||"function"!=typeof R)return j;let e=R({field:p.field,columns:j,currentFilters:(null==L?void 0:L.items)||[]});return j.filter(t=>e.includes(t.field))},[R,null==L?void 0:L.items,j,p.field]),el=b.useMemo(()=>{switch(I){case"asc":return er.sort((e,t)=>lh.compare(lp(e),lp(t)));case"desc":return er.sort((e,t)=>-lh.compare(lp(e),lp(t)));default:return er}},[er,I]),eo=p.field?z.current.getColumn(p.field):null,ea=b.useMemo(()=>{var e;return p.operator&&eo?null==(e=eo.filterOperators)?void 0:e.find(e=>e.value===p.operator):null},[p,eo]),es=b.useCallback(e=>{let t=e.target.value,n=z.current.getColumn(t);if(n.field===eo.field)return;let r=n.filterOperators.find(e=>e.value===p.operator)||n.filterOperators[0],l=!r.InputComponent||r.InputComponent!==(null==ea?void 0:ea.InputComponent)||n.type!==eo.type;g((0,m.Z)({},p,{field:t,operator:r.value,value:l?void 0:p.value}))},[z,g,p,eo,ea]),eu=b.useCallback(e=>{let t=e.target.value,n=null==eo?void 0:eo.filterOperators.find(e=>e.value===t),r=!(null!=n&&n.InputComponent)||(null==n?void 0:n.InputComponent)!==(null==ea?void 0:ea.InputComponent);g((0,m.Z)({},p,{operator:t,value:r?void 0:p.value}))},[g,p,eo,ea]),ec=b.useCallback(e=>{w(e.target.value===rX.G.And.toString()?rX.G.And:rX.G.Or)},[w]);return b.useImperativeHandle(S,()=>({focus:()=>
6{if(null!=ea&&ea.InputComponent){var e;null==W||null==(e=W.current)||e.focus()}else K.current.focus()}}),[ea]),(0,_.jsxs)(lo,(0,m.Z)({ref:t,className:q.root,"data-id":p.id,ownerState:G},O,{children:[(0,_.jsx)(li,(0,m.Z)({variant:"standard",as:G.slots.baseFormControl},X,E,{className:(0,P.Z)(q.deleteIcon,X.className,E.className),ownerState:G,children:(0,_.jsx)(G.slots.baseIconButton,(0,m.Z)({"aria-label":z.current.getLocaleText("filterPanelDeleteIconLabel"),title:z.current.getLocaleText("filterPanelDeleteIconLabel"),onClick:()=>{G.disableMultipleColumnsFiltering?void 0===p.value?f(p):g((0,m.Z)({},p,{value:void 0})):f(p)},size:"small"},null==(a=G.slotProps)?void 0:a.baseIconButton,{children:(0,_.jsx)(G.slots.filterPanelDeleteIcon,{fontSize:"small"})}))})),(0,_.jsx)(la,(0,m.Z)({variant:"standard",as:G.slots.baseFormControl},X,Z,{sx:(0,m.Z)({display:Y?"flex":"none",visibility:y?"visible":"hidden"},X.sx||{},Z.sx||{}),className:(0,P.Z)(q.logicOperatorInput,X.className,Z.className),ownerState:G,children:(0,_.jsx)(G.slots.baseSelect,(0,m.Z)({inputProps:{"aria-label":z.current.getLocaleText("filterPanelLogicOperator")},value:v,onChange:ec,disabled:!!x||1===k.length,native:J},null==(s=G.slotProps)?void 0:s.baseSelect,{children:k.map(e=>(0,b.createElement)(G.slots.baseSelectOption,(0,m.Z)({},ee,{native:J,key:e.toString(),value:e.toString()}),z.current.getLocaleText(ld(e))))}))})),(0,_.jsxs)(ls,(0,m.Z)({variant:"standard",as:G.slots.baseFormControl},X,D,{className:(0,P.Z)(q.columnInput,X.className,D.className),ownerState:G,children:[(0,_.jsx)(G.slots.baseInputLabel,(0,m.Z)({},Q,{htmlFor:H,id:N,children:z.current.getLocaleText("filterPanelColumns")})),(0,_.jsx)(G.slots.baseSelect,(0,m.Z)({labelId:N,id:H,label:z.current.getLocaleText("filterPanelColumns"),value:p.field||"",onChange:es,native:J},null==(u=G.slotProps)?void 0:u.baseSelect,{children:el.map(e=>(0,b.createElement)(G.slots.baseSelectOption,(0,m.Z)({},ee,{native:J,key:e.field,value:e.field}),lp(e)))}))]})),(0,_.jsxs)(lu,(0,m.Z)({variant:"standard",as:G.slots.baseFormControl},X,F,{className:(0,P.Z)(q.operatorInput,X.className,F.className),ownerState:G,children:[(0,_.jsx)(G.slots.baseInputLabel,(0,m.Z)({},Q,{htmlFor:$,id:U,children:z.current.getLocaleText("filterPanelOperator")})),(0,_.jsx)(G.slots.baseSelect,(0,m.Z)({labelId:U,label:z.current.getLocaleText("filterPanelOperator"),id:$,value:p.operator,onChange:eu,native:J,inputRef:K},null==(c=G.slotProps)?void 0:c.baseSelect,{children:null==eo||null==(d=eo.filterOperators)?void 0:d.map(e=>(0,b.createElement)(G.slots.baseSelectOption,(0,m.Z)({},ee,{native:J,key:e.value,value:e.value}),e.label||z.current.getLocaleText(`filterOperator${(0,T.Z)(e.value)}`)))}))]})),(0,_.jsx)(lc,(0,m.Z)({variant:"standard",as:G.slots.baseFormControl},X,en,{className:(0,P.Z)(q.valueInput,X.className,en.className),ownerState:G,children:null!=ea&&ea.InputComponent?(0,_.jsx)(ea.InputComponent,(0,m.Z)({apiRef:z,item:p,applyValue:g,focusElementRef:W},ea.InputComponentProps,et)):null}))]}))}),lg=["logicOperators","columnsSort","filterFormProps","getColumnForNewFilter","children","disableAddFilterButton","disableRemoveAllButton"],lm=e=>({field:e.field,operator:e.filterOperators[0].value,id:Math.round(1e5*Math.random())}),lb=b.forwardRef(function(e,t){var n,r;let l=(0,e5.l)(),o=(0,B.B)(),i=(0,C.P)(l,ei.uf),a=(0,C.P)(l,V.qH),s=b.useRef(null),u=b.useRef(null),{logicOperators:c=[rX.G.And,rX.G.Or],columnsSort:d,filterFormProps:p,getColumnForNewFilter:h,disableAddFilterButton:f=!1,disableRemoveAllButton:g=!1}=e,v=(0,M.Z)(e,lg),y=l.current.upsertFilterItem,x=b.useCallback(e=>{l.current.setFilterLogicOperator(e)},[l]),w=b.useCallback(()=>{let e;if(h&&"function"==typeof h){let t=h({currentFilters:(null==i?void 0:i.items)||[],columns:a});if(null===t)return null;e=a.find(({field:e})=>e===t)}else e=a.find(e=>{var t;return null==(t=e.filterOperators)?void 0:t.length});return e?lm(e):null},[null==i?void 0:i.items,a,h]),S=b.useCallback(()=>{if(void 0===h||"function"!=typeof h)return w();let e=h({currentFilters:i.items.length?i.items:[w()].filter(Boolean),columns:a});if(null===e)return null;let t=a.find(({field:t})=>t===e);return t?lm(t):null},[i.items,a,h,w]),k=b.useMemo(()=>i.items.length?i.items:(u.current||(u.current=w()),u.current?[u.current]:[]),[i.items,w]),I=k.length>1,R=b.useCallback(e=>{let t=1===k.length;l.current.deleteFilterItem(e),t&&l.current.hideFilterPanel()},[l,k.length]);return b.useEffect(()=>{c.length>0&&i.logicOperator&&!c.includes(i.logicOperator)&&x(c[0])},[c,x,i.logicOperator]),b.useEffect(()=>{k.length>0&&s.current.focus()},[k.length]),(0,_.jsxs)(lt,(0,m.Z)({ref:t},v,{children:[(0,_.jsx)(r1,{children:k.map((e,t)=>(0,_.jsx)(lf,(0,m.Z)({item:e,applyFilterChanges:y,deleteFilter:R,hasMultipleFilters:I,showMultiFilterOperators:t>0,multiFilterOperator:i.logicOperator,disableMultiFilterOperator:1!==t,applyMultiFilterOperatorChanges:x,focusElementRef:t===k.length-1?s:null,logicOperators:c,columnsSort:d},p),null==e.id?t:e.id))}),o.disableMultipleColumnsFiltering||f&&g?null:(0,_.jsxs)(r5,{children:[f?(0,_.jsx)("span",{}):(0,_.jsx)(o.slots.baseButton,(0,m.Z)({onClick:()=>{let e=S();e&&l.current.upsertFilterItems([...k,e])},startIcon:(0,_.jsx)(o.slots.filterPanelAddIcon,{})},null==(n=o.slotProps)?void 0:n.baseButton,{children:l.current.getLocaleText("filterPanelAddFilter")})),g?null:(0,_.jsx)(o.slots.baseButton,(0,m.Z)({onClick:()=>{1===k.length&&void 0===k[0].value&&(l.current.deleteFilterItem(k[0]),l.current.hideFilterPanel()),l.current.setFilterModel((0,m.Z)({},i,{items:[]}))},startIcon:(0,_.jsx)(o.slots.filterPanelRemoveAllIcon,{})},null==(r=o.slotProps)?void 0:r.baseButton,{children:l.current.getLocaleText("filterPanelRemoveAll")}))]})]}))});var lv=n(71230),ly=n(65806);let lx=["className"],lw=e=>{let{classes:t}=e;return(0,Z.Z)({root:["panelHeader"]},z.d,t)},lC=(0,en.Z)("div",{name:"MuiDataGrid",slot:"PanelHeader",overridesResolver:(e,t)=>t.panelHeader})(({theme:e})=>({padding:e.spacing(1)}));function lS(e){let{className:t}=e,n=(0,M.Z)(e,lx),r=(0,B.B)(),l=lw(r);return(0,_.jsx)(lC,(0,m.Z)({className:(0,P.Z)(t,l.root),ownerState:r},n))}
6let lk=["sort","searchPredicate","autoFocusSearchField","disableHideAllButton","disableShowAllButton","getTogglableColumns"],lI=e=>{let{classes:t}=e;return(0,Z.Z)({root:["columnsPanel"],columnsPanelRow:["columnsPanelRow"]},z.d,t)},lR=(0,O.ZP)("div",{name:"MuiDataGrid",slot:"ColumnsPanel",overridesResolver:(e,t)=>t.columnsPanel})({padding:"8px 0px 8px 8px"}),l_=(0,O.ZP)("div",{name:"MuiDataGrid",slot:"ColumnsPanelRow",overridesResolver:(e,t)=>t.columnsPanelRow})(({theme:e})=>({display:"flex",justifyContent:"space-between",padding:"1px 8px 1px 7px",[`& .${lv.Z.root}`]:{marginRight:e.spacing(.5)}})),lE=((0,O.ZP)(rE.Z)({justifyContent:"flex-end"}),new Intl.Collator),lM=(e,t)=>(e.headerName||e.field).toLowerCase().indexOf(t)>-1,lP=["children","className","classes"],lT=(0,rm.Z)("MuiDataGrid",["panel","paper"]),lZ=(0,O.ZP)(e4.Z,{name:"MuiDataGrid",slot:"Panel",overridesResolver:(e,t)=>t.panel})(({theme:e})=>({zIndex:e.zIndex.modal})),lF=(0,O.ZP)(e3.Z,{name:"MuiDataGrid",slot:"Paper",overridesResolver:(e,t)=>t.paper})(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,minWidth:300,maxHeight:450,display:"flex"})),lD=b.forwardRef((e,t)=>{let{children:n,className:r}=e,l=(0,M.Z)(e,lP),o=(0,e5.l)(),i=(0,B.B)(),[a,s]=b.useState(!1),u=b.useCallback(()=>{o.current.hidePreferences()},[o]),c=b.useCallback(e=>{(0,tu.$o)(e.key)&&o.current.hidePreferences()},[o]),d=b.useMemo(()=>[{name:"flip",enabled:!0,options:{rootBoundary:"document"}},{name:"isPlaced",enabled:!0,phase:"main",fn:()=>{s(!0)},effect:()=>()=>{s(!1)}}],[]),[p,h]=b.useState(null);return(b.useEffect(()=>{var e;let t=null==(e=o.current.rootElementRef)||null==(e=e.current)?void 0:e.querySelector(`.${z._.columnHeaders}`);t&&h(t)},[o]),p)?(0,_.jsx)(lZ,(0,m.Z)({ref:t,placement:"bottom-start",className:(0,P.Z)(r,lT.panel),ownerState:i,anchorEl:p,modifiers:d},l,{children:(0,_.jsx)(e1.d,{mouseEvent:"onMouseUp",onClickAway:u,children:(0,_.jsx)(lF,{className:lT.paper,ownerState:i,elevation:8,onKeyDown:c,children:a&&n})})})):null});var lA=n(31774);function lO(e){return b.memo(e,lA.w)}class lz extends Error{}
6let lj=["changeReason","unstable_updateValueOnRender"],lL=["column","rowId","editCellState","align","children","colIndex","height","width","className","showRightBorder","extendRowFullWidth","row","colSpan","disableDragEvents","isNotVisible","onClick","onDoubleClick","onMouseDown","onMouseUp","onMouseOver","onKeyDown","onKeyUp","onDragEnter","onDragOver","style"],lH=["changeReason","unstable_updateValueOnRender"],lB={id:-1,field:"__unset__",row:{},rowNode:{id:-1,depth:0,type:"leaf",parent:-1,groupingKey:null},colDef:{type:"string",field:"__unset__",computedWidth:0},cellMode:ta.View,hasFocus:!1,tabIndex:-1,value:null,formattedValue:"__unset__",isEditable:!1,api:{}},lN=e=>{let{align:t,showRightBorder:n,isEditable:r,isSelected:l,isSelectionMode:o,classes:i}=e,a={root:["cell",`cell--text${(0,T.Z)(t)}`,r&&"cell--editable",l&&"selected",n&&"cell--withRightBorder",o&&!r&&"cell--selectionMode","withBorderColor"],content:["cellContent"]};return(0,Z.Z)(a,z.d,i)},lV=lO(b.forwardRef((e,t)=>{let n;let{column:r,rowId:l,editCellState:o}=e,i=(0,e5.l)(),a=(0,B.B)(),s=r.field,u=(0,C.P)(i,()=>{try{let e=i.current.getCellParams(l,s);return e.api=i.current,e}catch(e){if(e instanceof lz)return lB;throw e}},C.v),c=(0,C.P)(i,()=>i.current.unstable_applyPipeProcessors("isCellSelected",!1,{id:l,field:s}));if(u===lB)return null;let{cellMode:d,hasFocus:p,isEditable:h,value:f,formattedValue:g}=u,v="actions"===r.type,y="view"!==d&&h||v?-1:u.tabIndex,{classes:x,getCellClassName:w}=a,S=i.current.unstable_applyPipeProcessors("cellClassName",[],{id:l,field:s});if(r.cellClassName&&S.push("function"==typeof r.cellClassName?r.cellClassName(u):r.cellClassName),w&&S.push(w(u)),null==o&&r.renderCell&&(n=r.renderCell(u),S.push(z._["cell--withRenderer"]),S.push(null==x?void 0:x["cell--withRenderer"])),null!=o&&r.renderEditCell){let e=i.current.getRowWithUpdatedValues(l,r.field),t=(0,M.Z)(o,lj),a=(0,m.Z)({},u,{row:e},t);n=r.renderEditCell(a),S.push(z._["cell--editing"]),S.push(null==x?void 0:x["cell--editing"])}let{slots:k}=a,I=k.cell,R=(0,m.Z)({},e,{ref:t,field:s,formattedValue:g,hasFocus:p,isEditable:h,isSelected:c,value:f,cellMode:d,children:n,tabIndex:y,className:(0,P.Z)(S)});return b.createElement(I,R)})),l$=lO(b.forwardRef((e,t)=>{var n,l,o;let i;let{column:a,rowId:s,editCellState:u,align:c,colIndex:d,height:p,width:h,className:f,showRightBorder:g,colSpan:v,disableDragEvents:y,isNotVisible:x,onClick:w,onDoubleClick:S,onMouseDown:k,onMouseUp:I,onMouseOver:R,onKeyDown:E,onKeyUp:T,onDragEnter:Z,onDragOver:D,style:A}=e,O=(0,M.Z)(e,lL),j=(0,e5.l)(),L=(0,B.B)(),H=a.field,N=(0,C.P)(j,()=>{try{let e=j.current.getCellParams(s,H);return e.api=j.current,e}catch(e){if(e instanceof lz)return lB;throw e}},C.v),V=(0,C.P)(j,()=>j.current.unstable_applyPipeProcessors("isCellSelected",!1,{id:s,field:H})),{cellMode:$,hasFocus:U,isEditable:G,value:q,formattedValue:W}=N,K="actions"===a.type&&(null==(n=a.getActions)?void 0:n.call(a,j.current.getRowParams(s)).some(e=>!e.props.disabled)),Y="view"!==$&&G||K?-1:N.tabIndex,{classes:X,getCellClassName:J}=L,Q=j.current.unstable_applyPipeProcessors("cellClassName",[],{id:s,field:H});a.cellClassName&&Q.push("function"==typeof a.cellClassName?a.cellClassName(N):a.cellClassName),J&&Q.push(J(N));let ee=null==W?q:W,et=b.useRef(null),en=(0,F.Z)(t,et),er=b.useRef(null),el=null!=(l=L.unstable_cellSelection)&&l,eo=lN({align:c,showRightBorder:g,isEditable:G,classes:L.classes,isSelected:V,isSelectionMode:el}),ei=b.useCallback(e=>t=>{let n=j.current.getCellParams(s,H||"");j.current.publishEvent(e,n,t),I&&I(t)},[j,H,I,s]),ea=b.useCallback(e=>t=>{let n=j.current.getCellParams(s,H||"");j.current.publishEvent(e,n,t),k&&k(t)},[j,H,k,s]),es=b.useCallback((e,t)=>n=>{if(!j.current.getRow(s))return;let r=j.current.getCellParams(s,H||"");j.current.publishEvent(e,r,n),t&&t(n)},[j,H,s]),eu=b.useMemo(()=>x?(0,m.Z)({padding:0,opacity:0,width:0,border:0},A):(0,m.Z)({minWidth:h,maxWidth:h,minHeight:p,maxHeight:"auto"===p?"none":p},A),[h,p,x,A]);if(b.useEffect(()=>{if(!U||$===ta.Edit)return;let e=(0,nb.Z)(j.current.rootElementRef.current);if(et.current&&!et.current.contains(e.activeElement)){let e=et.current.querySelector('[tabindex="0"]'),t=er.current||e||et.current;if(void 0===r&&document.createElement("div").focus({get preventScroll(){return r=!0,!1}}),r)t.focus({preventScroll:!0});else{let e=j.current.getScrollPosition();t.focus(),j.current.scroll(e)}}},[U,$,j]),N===lB)return null;let ec=O.onFocus;if(null==u&&a.renderCell&&(i=a.renderCell(N),Q.push(z._["cell--withRenderer"]),Q.push(null==X?void 0:X["cell--withRenderer"])),null!=u&&a.renderEditCell){let e=j.current.getRowWithUpdatedValues(s,a.field),t=(0,M.Z)(u,lH),n=(0,m.Z)({},N,{row:e},t);i=a.renderEditCell(n),Q.push(z._["cell--editing"]),Q.push(null==X?void 0:X["cell--editing"])}if(void 0===i){let e=null==ee?void 0:ee.toString();i=(0,_.jsx)("div",{className:eo.content,title:e,role:"presentation",children:e})}b.isValidElement(i)&&K&&(i=b.cloneElement(i,{focusElementRef:er}));let ed=y?null:{onDragEnter:es("cellDragEnter",Z),onDragOver:es("cellDragOver",D)},ep=null==(o=L.experimentalFeatures)?void 0:o.ariaV7;return(0,_.jsx)("div",(0,m.Z)({ref:en,className:(0,P.Z)(f,Q,eo.root),role:ep?"gridcell":"cell","data-field":H,"data-colindex":d,"aria-colindex":d+1,"aria-colspan":v,style:eu,tabIndex:Y,onClick:es("cellClick",w),onDoubleClick:es("cellDoubleClick",S),onMouseOver:es("cellMouseOver",R),onMouseDown:ea("cellMouseDown"),onMouseUp:ei("cellMouseUp"),onKeyDown:es("cellKeyDown",E),onKeyUp:es("cellKeyUp",T)},ed,O,{onFocus:ec,children:i}))})),lU=["selected","hovered","rowId","row","index","style","position","rowHeight","className","visibleColumns","renderedColumns","containerWidth","firstColumnToRender","lastColumnToRender","isLastVisible","focusedCellColumnIndexNotInRange","isNot
6Visible","focusedCell","tabbableCell","onClick","onDoubleClick","onMouseEnter","onMouseLeave","onMouseOut","onMouseOver"],lG=e=>{let{editable:t,editing:n,selected:r,isLastVisible:l,rowHeight:o,classes:i}=e;return(0,Z.Z)({root:["row",r&&"selected",t&&"row--editable",n&&"row--editing",l&&"row--lastVisible","auto"===o&&"row--dynamicHeight"]},z.d,i)};function lq({width:e}){return e?(0,_.jsx)("div",{className:`${z._.cell} ${z._.withBorderColor}`,style:{width:e}}):null}let lW=lO(b.forwardRef(function(e,t){let{selected:n,hovered:r,rowId:l,row:o,index:i,style:a,position:s,rowHeight:u,className:c,visibleColumns:d,renderedColumns:p,containerWidth:h,firstColumnToRender:f,isLastVisible:g=!1,focusedCellColumnIndexNotInRange:v,isNotVisible:y,focusedCell:x,onClick:w,onDoubleClick:S,onMouseEnter:k,onMouseLeave:I,onMouseOut:R,onMouseOver:E}=e,T=(0,M.Z)(e,lU),Z=(0,e5.l)(),D=b.useRef(null),A=(0,B.B)(),O=td(Z,A),j=(0,C.P)(Z,V.iD),L=(0,C.P)(Z,ea.Gm),H=(0,C.P)(Z,Y.Lq),N=(0,C.P)(Z,K),$=(0,C.P)(Z,nr),U=(0,F.Z)(D,t),G=i+N+2,q=lG({selected:n,hovered:r,isLastVisible:g,classes:A.classes,editing:Z.current.getRowMode(l)===ts.Edit,editable:A.editMode===ti.Row,rowHeight:u});b.useLayoutEffect(()=>{"auto"===u&&D.current&&"undefined"==typeof ResizeObserver&&Z.current.unstable_storeRowHeightMeasurement(l,D.current.clientHeight,s)},[Z,u,l,s]),b.useLayoutEffect(()=>{if(O.range){let e=Z.current.getRowIndexRelativeToVisibleRows(l);null!=e&&Z.current.unstable_setLastMeasuredRowIndex(e)}let e=D.current,t="auto"!==u;if(!e||t||"undefined"==typeof ResizeObserver)return;let n=new ResizeObserver(e=>{let[t]=e,n=t.borderBoxSize&&t.borderBoxSize.length>0?t.borderBoxSize[0].blockSize:t.contentRect.height;Z.current.unstable_storeRowHeightMeasurement(l,n,s)});return n.observe(e),()=>n.disconnect()},[Z,O.range,i,u,l,s]);let W=b.useCallback((e,t)=>n=>{!tm(n)&&Z.current.getRow(l)&&(Z.current.publishEvent(e,Z.current.getRowParams(l),n),t&&t(n))},[Z,l]),X=b.useCallback(e=>{let t=th(e.target,z._.cell),n=null==t?void 0:t.getAttribute("data-field");if(n){if(n===eO.n.field||n===tp||"__reorder__"===n||Z.current.getCellMode(l,n)===ta.Edit)return;let e=Z.current.getColumn(n);if((null==e?void 0:e.type)===tl)return}W("rowClick",w)(e)},[Z,w,W,l]),{slots:J,slotProps:Q,disableColumnReorder:ee}=A,et=J.cell===l$?l$:lV,en=A.rowReordering,er=(e,t)=>{var n,r;let o=ee&&e.disableReorder||!en&&!!L.length&&H>1&&Object.keys($).length>0,i=null!=(n=null==(r=$[l])?void 0:r[e.field])?n:null,a=!1;return void 0!==v&&d[v].field===e.field&&(a=!0),(0,_.jsx)(et,(0,m.Z)({column:e,width:t.width,rowId:l,height:u,showRightBorder:t.showRightBorder,align:e.align||"left",colIndex:t.indexRelativeToAllColumns,colSpan:t.colSpan,disableDragEvents:o,editCellState:i,isNotVisible:a},null==Q?void 0:Q.cell),e.field)},el=(0,C.P)(Z,()=>(0,m.Z)({},Z.current.unstable_getRowInternalSizes(l)),C.v),eo=u;if("auto"===eo&&el){let e=0,t=Object.entries(el).reduce((t,[n,r])=>/^base[A-Z]/.test(n)&&(e+=1,r>t)?r:t,0);t>0&&e>1&&(eo=t)}let ei=b.useMemo(()=>{if(y)return{opacity:0,width:0,height:0};let e=(0,m.Z)({},a,{maxHeight:"auto"===u?"none":u,minHeight:eo});if(null!=el&&el.spacingTop&&(e["border"===A.rowSpacingType?"borderTopWidth":"marginTop"]=el.spacingTop),null!=el&&el.spacingBottom){let t="border"===A.rowSpacingType?"borderBottomWidth":"marginBottom",n=e[t];"number"!=typeof n&&(n=parseInt(n||"0",10)),n+=el.spacingBottom,e[t]=n}return e},[y,u,a,eo,el,A.rowSpacingType]),es=Z.current.unstable_applyPipeProcessors("rowClassName",[],l);if("function"==typeof A.getRowClassName){var eu;let e=i-((null==(eu=O.range)?void 0:eu.firstRowIndex)||0),t=(0,m.Z)({},Z.current.getRowParams(l),{isFirstVisible:0===e,isLastVisible:e===O.rows.length-1,indexRelativeToCurrentPage:e});es.push(A.getRowClassName(t))}let ec=(0,ep.he)(1e4,20,80),ed=Z.current.getRowNode(l);if(!ed)return null;let eh=ed.type,ef=[];for(let e=0;e<p.length;e+=1){let t=p[e],n=f+e;void 0!==v&&x&&(d[v].field===t.field?n=v:n-=1);let r=Z.current.unstable_getCellColSpanInfo(l,n);if(r&&!r.spannedByColSpan){if("skeletonRow"!==eh){let{colSpan:e,width:l}=r.cellProps,o={width:l,colSpan:e,showRightBorder:A.showCellVerticalBorder,indexRelativeToAllColumns:n};ef.push(er(t,o))}else{let{width:e}=r.cellProps,n=Math.round(ec());ef.push((0,_.jsx)(J.skeletonCell,{width:e,contentWidth:n,field:t.field,align:t.align},t.field))}}}let eg=h-j,em=o?{onClick:X,onDoubleClick:W("rowDoubleClick",S),onMouseEnter:W("rowMouseEnter",k),onMouseLeave:W("rowMouseLeave",I),onMouseOut:W("rowMouseOut",R),onMouseOver:W("rowMouseOver",E)}:null;return(0,_.jsxs)("div",(0,m.Z)({ref:U,"data-id":l,"data-rowindex":i,role:"row",className:(0,P.Z)(...es,q.root,c,r&&"Mui-hovered"),"aria-rowindex":G,"aria-selected":n,style:ei},em,T,{children:[ef,eg>0&&(0,_.jsx)(lq,{width:eg})]}))}));var lK=n(73935);let lY=e=>{let{classes:t}=e;return(0,Z.Z)({icon:["sortIcon"]},z.d,t)},lX=b.memo(function(e){var t;let{direction:n,index:r,sortingOrder:l}=e,o=(0,e5.l)(),i=(0,B.B)(),a=lY((0,m.Z)({},e,{classes:i.classes})),s=function(e,t,n,r){let l;let o={};return"asc"===t?l=e.columnSortedAscendingIcon:"desc"===t?l=e.columnSortedDescendingIcon:(l=e.columnUnsortedIcon,o.sortingOrder=r),l?(0,_.jsx)(l,(0,m.Z)({fontSize:"small",className:n},o)):null}(i.slots,n,a.icon,l);if(!s)return null;let u=(0,_.jsx)(i.slots.baseIconButton,(0,m.Z)({tabIndex:-1,"aria-label":o.current.getLocaleText("columnHeaderSortIconLabel"),title:o.current.getLocaleText("columnHeaderSortIconLabel"),size:"small"},null==(t=i.slotProps)?void 0:t.baseIconButton,{children:s}));return(0,_.jsxs)(nX,{children:[null!=r&&(0,_.jsx)(nq.Z,{badgeContent:r,color:"default",children:u}),null==r&&u]})}),lJ=e=>{let{classes:t,open:n}=e;return(0,Z.Z)({root:["menuIcon",n&&"menuOpen"],button:["menuIconButton"]},z.d,t)},lQ=b.memo(e=>{var t,n;let{colDef:r,open:l,columnMenuId:o,columnMenuButtonId:i,iconButtonRef:a}=e,s=(0,e5.l)(),u=(0,B.B)(),c=lJ((0,m.Z)({},e,{classes:u.classes})),d=b.useCallback(e=>{e.preventDefault(),e.stopPropagation(),s.current.toggleColumnMenu(r.field)},[s,r.field]);return(0,_.jsx)("div",{className:c.root,children:(0,_.jsx)(u.slots.baseTooltip,(0,m.Z)({title:s.current.getLocaleText("columnMenuLabel"),enterDelay:1e3},null==(t=u.slotProps)?void 0:t.baseTooltip,{children:(0,_.jsx)(u.slots.baseIconButton,(0,m.Z)({ref:a,tabIndex:-1,
6className:c.button,"aria-label":s.current.getLocaleText("columnMenuLabel"),size:"small",onClick:d,"aria-haspopup":"menu","aria-expanded":l,"aria-controls":l?o:void 0,id:i},null==(n=u.slotProps)?void 0:n.baseIconButton,{children:(0,_.jsx)(u.slots.columnMenuIcon,{fontSize:"small"})}))}))})});function l0({columnMenuId:e,columnMenuButtonId:t,ContentComponent:n,contentComponentProps:r,field:l,open:o,target:i,onExited:a}){let s=(0,e5.l)(),u=s.current.getColumn(l),c=(0,nn.Z)(e=>{e&&(e.stopPropagation(),null!=i&&i.contains(e.target))||s.current.hideColumnMenu()});return i&&u?(0,_.jsx)(te,{placement:`bottom-${"right"===u.align?"start":"end"}`,open:o,target:i,onClose:c,onExited:a,children:(0,_.jsx)(n,(0,m.Z)({colDef:u,hideMenu:c,open:o,id:e,labelledby:t},r))}):null}let l1=["className"],l2=e=>{let{classes:t}=e;return(0,Z.Z)({root:["columnHeaderTitle"]},z.d,t)},l3=(0,en.Z)("div",{name:"MuiDataGrid",slot:"ColumnHeaderTitle",overridesResolver:(e,t)=>t.columnHeaderTitle})({textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",fontWeight:"var(--unstable_DataGrid-headWeight)"}),l4=b.forwardRef(function(e,t){let{className:n}=e,r=(0,M.Z)(e,l1),l=(0,B.B)(),o=l2(l);return(0,_.jsx)(l3,(0,m.Z)({ref:t,className:(0,P.Z)(o.root,n),ownerState:l},r))});function l5(e){var t;let{label:n,description:r}=e,l=(0,B.B)(),o=b.useRef(null),[i,a]=b.useState(""),s=b.useCallback(()=>{if(!r&&null!=o&&o.current){var e;(e=o.current).scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth?a(n):a("")}},[r,n]);return(0,_.jsx)(l.slots.baseTooltip,(0,m.Z)({title:r||i},null==(t=l.slotProps)?void 0:t.baseTooltip,{children:(0,_.jsx)(l4,{onMouseOver:s,ref:o,children:n})}))}let l9=["resizable","resizing","height","side"];var l6=((d=l6||{}).Left="left",d.Right="right",d);let l8=e=>{let{resizable:t,resizing:n,classes:r,side:l}=e,o={root:["columnSeparator",t&&"columnSeparator--resizable",n&&"columnSeparator--resizing",l&&`columnSeparator--side${(0,T.Z)(l)}`],icon:["iconSeparator"]};return(0,Z.Z)(o,z.d,r)},l7=b.memo(function(e){let{height:t,side:n=l6.Right}=e,r=(0,M.Z)(e,l9),l=(0,B.B)(),o=l8((0,m.Z)({},e,{side:n,classes:l.classes})),i=b.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]);return(0,_.jsx)("div",(0,m.Z)({className:o.root,style:{minHeight:t,opacity:l.showColumnVerticalBorder?0:1}},r,{onClick:i,children:(0,_.jsx)(l.slots.columnResizeIcon,{className:o.icon})}))}),oe=["classes","columnMenuOpen","colIndex","height","isResizing","sortDirection","hasFocus","tabIndex","separatorSide","isDraggable","headerComponent","description","elementId","width","columnMenuIconButton","columnMenu","columnTitleIconButtons","headerClassName","label","resizable","draggableContainerProps","columnHeaderSeparatorProps"],ot=b.forwardRef(function(e,t){let{classes:n,columnMenuOpen:r,colIndex:l,height:o,isResizing:i,sortDirection:a,hasFocus:s,tabIndex:u,separatorSide:c,isDraggable:d,headerComponent:p,description:h,width:f,columnMenuIconButton:g=null,columnMenu:v=null,columnTitleIconButtons:y=null,headerClassName:x,label:w,resizable:C,draggableContainerProps:S,columnHeaderSeparatorProps:k}=e,R=(0,M.Z)(e,oe),E=I(),T=(0,B.B)(),Z=b.useRef(null),[D,A]=b.useState(r),O=(0,F.Z)(Z,t),z="none";return null!=a&&(z="asc"===a?"ascending":"descending"),b.useEffect(()=>{D||A(r)},[D,r]),b.useLayoutEffect(()=>{let e=E.current.state.columnMenu;if(s&&!e.open){let e=Z.current.querySelector('[tabindex="0"]')||Z.current;null==e||e.focus(),E.current.columnHeadersContainerElementRef.current.scrollLeft=0}},[E,s]),(0,_.jsxs)("div",(0,m.Z)({ref:O,className:(0,P.Z)(n.root,x),style:{height:o,width:f,minWidth:f,maxWidth:f},role:"columnheader",tabIndex:u,"aria-colindex":l+1,"aria-sort":z,"aria-label":null==p?w:void 0},R,{children:[(0,_.jsxs)("div",(0,m.Z)({className:n.draggableContainer,draggable:d,role:"presentation"},S,{children:[(0,_.jsxs)("div",{className:n.titleContainer,role:"presentation",children:[(0,_.jsx)("div",{className:n.titleContainerContent,children:void 0!==p?p:(0,_.jsx)(l5,{label:w,description:h,columnWidth:f})}),y]}),g]})),(0,_.jsx)(l7,(0,m.Z)({resizable:!T.disableColumnResize&&!!C,resizing:i,height:o,side:c},k)),v]}))}),on=e=>{let{colDef:t,classes:n,isDragging:r,sortDirection:l,showRightBorder:o,filterItemsCounter:i}=e,a="number"===t.type,s={root:["columnHeader","left"===t.headerAlign&&"columnHeader--alignLeft","center"===t.headerAlign&&"columnHeader--alignCenter","right"===t.headerAlign&&"columnHeader--alignRight",t.sortable&&"columnHeader--sortable",r&&"columnHeader--moving",null!=l&&"columnHeader--sorted",null!=i&&i>0&&"columnHeader--filtered",a&&"columnHeader--numeric","withBorderColor",o&&"columnHeader--withRightBorder"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer"],titleContainerContent:["columnHeaderTitleContainerContent"]};return(0,Z.Z)(s,z.d,n)};function or(e){var t,n,r,l;let o;let{colDef:i,columnMenuOpen:a,colIndex:s,headerHeight:u,isResizing:c,sortDirection:d,sortIndex:p,filterItemsCounter:h,hasFocus:f,tabIndex:g,disableReorder:v,separatorSide:y}=e,x=I(),w=(0,B.B)(),C=b.useRef(null),S=(0,e0.Z)(),k=(0,e0.Z)(),R=b.useRef(null),[E,M]=b.useState(a),P=b.useMemo(()=>!w.disableColumnReorder&&!v&&!i.disableReorder,[w.disableColumnReorder,v,i.disableReorder]);i.renderHeader&&(o=i.renderHeader(x.current.getColumnHeaderParams(i.field)));let T=on((0,m.Z)({},e,{classes:w.classes,showRightBorder:w.showColumnVerticalBorder})),Z=b.useCallback(e=>t=>{tm(t)||x.current.publishEvent(e,x.current.getColumnHeaderParams(i.field),t)},[x,i.field]),F=b.useMemo(()=>({onClick:Z("columnHeaderClick"),onDoubleClick:Z("columnHeaderDoubleClick"),onMouseOver:Z("columnHeaderOver"),onMouseOut:Z("columnHeaderOut"),onMouseEnter:Z("columnHeaderEnter"),onMouseLeave:Z("columnHeaderLeave"),onKeyDown:Z("columnHeaderKeyDown"),onFocus:Z("columnHeaderFocus"),onBlur:Z("columnHeaderBlur")}),[Z]),D=b.useMemo(()=>P?{onDragStart:Z("columnHeaderDragStart"),onDragEnter:Z("columnHeaderDragEnter"),onDragOver:Z("columnHeaderDragOver"),onDragEnd:Z("columnHeaderDragEnd")}:{},[P,Z]),A=b.useMemo(()=>({onMouseDown:Z("columnSeparatorMouseDown"),onDoubleClick:Z("columnSeparatorDoubleClick")}),[Z]);b.useEffect(()=>{E||M(a)},[E,a]);let O=b.useCallback(()=>{M(!1)},[]),z=!w.disableColumnMenu&&!i.disableColumnMenu&&(0,_.jsx)(lQ,{colDef:i,columnMenuId:S,columnMenuButtonId:k,open:E,iconButtonRef:R}),j=(0,_.jsx)(l0,{columnMenuId:S,columnMenuButtonId:k,field:i.field,open:a,target:R.current,ContentComponent:w.slots.columnMenu,contentComponentProps:null==(t=w.slotProps)?void 0:t.columnMenu,onExited:O}),L=null!=(n=i.sortingOrder)?n:w.sortingOrder,H=(0,_.jsxs)(b.Fragment,{children:[!w.disableColumnFilter&&(0,_.jsx)(w.slots.columnHeaderFilterIconButton,(0,m.Z)({field:i.field,counter:h},null==(r=w.slotProps)?void 0:r.columnHeaderFilterIconButton)),i.sortable&&!i.hideSortIcons&&(0,_.jsx)(lX,{direction:d,index:p,sortingOrder:L})]});b.useLayoutEffect(()=>{let e=x.current.state.columnMenu;if(f&&!e.open){var t;let e=C.current.querySelector('[tabindex="0"]')||C.current;null==e||e.focus(),null!=(t=x.current.columnHeadersContainerElementRef)&&t.current&&(x.current.columnHeadersContainerElementRef.current.scrollLeft=0)}},[x,f]);let N="function"==typeof i.headerClassName?i.headerClassName({field:i.field,colDef:i}):i.headerClassName,V=null!=(l=i.headerName)?l:i.field;return(0,_.jsx)(ot,(0,m.Z)({ref:C,classes:T,columnMenuOpen:a,colIndex:s,height:u,isResizing:c,sortDirection:d,hasFocus:f,tabIndex:g,separatorSide:y,isDraggable:P,headerComponent:o,description:i.description,elementId:i.field,width:i.computedWidth,columnMenuIconButton:z,columnTitleIconButtons:H,headerClassName:N,label:V,resizable:!w.disableColumnResize&&!!i.resizable,"data-field":i.field,columnMenu:j,draggableContainerProps:D,columnHeaderSeparatorProps:A},F))}let ol=e=>e.rowsMeta,oo=e=>e.virtualization,oi=(0,$.P1)(oo,e=>e.enabled),oa=(0,$.P1)(oo,e=>e.enabledForColumns),os=["style"],ou=["style"];function oc(e,t,n=0,r=t.length){if(t.length<=0)return -1;if(n>=r)return n;let l=n+Math.floor((r-n)/2);return e<=t[l]?oc(e,t,n,l):oc(e,t,l+1,r)}let od=({firstIndex:e,lastIndex:t,buffer:n,minFirstIndex:r,maxLastIndex:l})=>[(0,ep.uZ)(e-n,r,l),(0,ep.uZ)(t+n,r,l)],op=(e,t)=>e===t||e.firstRowIndex===t.firstRowIndex&&e.lastRowIndex===t.lastRowIndex&&e.firstColumnIndex===t.firstColumnIndex&&e.lastColumnIndex===t.lastColumnIndex,oh={maxSize:3},of=e=>{let t=I(),n=(0,B.B)(),r=(0,C.P)(t,V.FE),l=(0,C.P)(t,oi),o=(0,C.P)(t,oa),{ref:i,onRenderZonePositioning:a,renderZoneMinColumnIndex:s=0,renderZoneMaxColumnIndex:u=r.length,getRowProps:c}=e,d=(0,eQ.Z)(),p=(0,C.P)(t,V.Ag),h=(0,C.P)(t,V.iD),f=(0,C.P)(t,es.TR),g=(0,C.P)(t,es.d6),v=(0,C.P)(t,ol),y=(0,C.P)(t,eK.z8),x=td(t,n),w=b.useRef(null),S=b.useRef(null),k=(0,F.Z)(i,S),[R,E]=b.useState(null),P=b.useRef(R),T=b.useRef({top:0,left:0}),[Z,A]=b.useState({width:null,height:null}),O=b.useRef(h),[z,j]=b.useState(null),L=b.useRef(Object.create(null)),H=b.useRef(),N=b.useRef(),$=b.useRef((0,nI.PW)((e,t,n,r,l,o)=>{let i;let a=e.slice(t,n);return o>-1&&(t>o&&o>=r?i=o:n<o&&o<l&&(i=o)),{focusedCellColumnIndexNotInRange:i,renderedColumns:a}},oh)),U=b.useMemo(()=>null!==f?r.findIndex(e=>e.field===f.field):-1,[f,r]),G=b.useCallback(()=>
6{if(!l)return{firstRowIndex:0,lastRowIndex:x.rows.length,firstColumnIndex:0,lastColumnIndex:r.length};let{top:e,left:i}=T.current,a=Math.min(og(t,x,v,e),v.positions.length-1),s=n.autoHeight?a+x.rows.length:og(t,x,v,e+Z.height),u=0,c=p.length;if(o){let e=!1,[r,l]=od({firstIndex:a,lastIndex:s,minFirstIndex:0,maxLastIndex:x.rows.length,buffer:n.rowBuffer});for(let n=r;n<l&&!e;n+=1){let r=x.rows[n];e=t.current.rowHasAutoHeight(r.id)}e||(u=oc(Math.abs(i),p),c=oc(Math.abs(i)+Z.width,p))}return{firstRowIndex:a,lastRowIndex:s,firstColumnIndex:u,lastColumnIndex:c}},[l,o,v,n.autoHeight,n.rowBuffer,x,p,r.length,t,Z]);(0,D.Z)(()=>{l?(S.current.scrollLeft=0,S.current.scrollTop=0):w.current.style.transform="translate3d(0px, 0px, 0px)"},[l]),(0,D.Z)(()=>{A({width:S.current.clientWidth,height:S.current.clientHeight})},[v.currentPageTotalHeight]);let q=b.useCallback(()=>{S.current&&A({width:S.current.clientWidth,height:S.current.clientHeight})},[]);(0,ew.zn)(t,"debouncedResize",q);let W=b.useCallback(e=>{let[r,l]=od({firstIndex:e.firstRowIndex,lastIndex:e.lastRowIndex,minFirstIndex:0,maxLastIndex:x.rows.length,buffer:n.rowBuffer}),[o]=od({firstIndex:e.firstColumnIndex,lastIndex:e.lastColumnIndex,minFirstIndex:s,maxLastIndex:u,buffer:n.columnBuffer}),i=t4({firstColumnToRender:o,apiRef:t,firstRowToRender:r,lastRowToRender:l,visibleRows:x.rows}),c="ltr"===d.direction?1:-1,p=ol(t.current.state).positions[r],h=c*(0,V.Ag)(t)[i];w.current.style.transform=`translate3d(${h}px, ${p}px, 0px)`,"function"==typeof a&&a({top:p,left:h})},[t,x.rows,a,s,u,n.columnBuffer,n.rowBuffer,d.direction]),K=b.useCallback(()=>P.current,[]),Y=b.useCallback(e=>{if(P.current&&op(e,P.current)){W(e);return}E(e),W(e);let[r,l]=od({firstIndex:e.firstRowIndex,lastIndex:e.lastRowIndex,minFirstIndex:0,maxLastIndex:x.rows.length,buffer:n.rowBuffer});t.current.publishEvent("renderedRowsIntervalChange",{firstRowToRender:r,lastRowToRender:l}),P.current=e},[t,E,P,x.rows.length,n.rowBuffer,W]);(0,D.Z)(()=>{if(null==Z.width)return;let e=G();Y(e);let{top:n,left:r}=T.current;t.current.publishEvent("scrollPositionChange",{top:n,left:r,renderContext:e})},[t,G,Z.width,Y]);let X=(0,nn.Z)(e=>{let{scrollTop:r,scrollLeft:o}=e.currentTarget;if(T.current.top=r,T.current.left=o,!P.current||r<0||"ltr"===d.direction&&o<0||"rtl"===d.direction&&o>0)return;let i=l?G():P.current,a=Math.abs(i.firstRowIndex-P.current.firstRowIndex),s=Math.abs(i.lastRowIndex-P.current.lastRowIndex),u=Math.abs(i.firstColumnIndex-P.current.firstColumnIndex),c=Math.abs(i.lastColumnIndex-P.current.lastColumnIndex),p=a>=n.rowThreshold||s>=n.rowThreshold||u>=n.columnThreshold||c>=n.columnThreshold||O.current!==h;t.current.publishEvent("scrollPositionChange",{top:r,left:o,renderContext:p?i:P.current},e),p&&(lK.flushSync(()=>{Y(i)}),O.current=h)}),J=(0,nn.Z)(e=>{t.current.publishEvent("virtualScrollerWheel",{},e)}),Q=(0,nn.Z)(e=>{t.current.publishEvent("virtualScrollerTouchMove",{},e)}),ee=b.useMemo(()=>null!==f?x.rows.findIndex(e=>e.id===f.id):-1,[f,x.rows]);(0,ew.zn)(t,"rowMouseOver",(e,t)=>{var n;t.currentTarget.contains(t.relatedTarget)||j(null!=(n=e.id)?n:null)}),(0,ew.zn)(t,"rowMouseOut",(e,t)=>{t.currentTarget.contains(t.relatedTarget)||j(null)});let et=Z.width&&h>=Z.width,en=b.useMemo(()=>{let e=Math.max(v.currentPageTotalHeight,1),r=!1;null!=S&&S.current&&e<=(null==S?void 0:S.current.clientHeight)&&(r=!0);let l={width:et?h:"auto",height:e,minHeight:r?"100%":"auto"};return n.autoHeight&&0===x.rows.length&&(l.height=(0,eH.ZM)(t,n.rowHeight)),l},[t,S,h,v.currentPageTotalHeight,et,n.autoHeight,n.rowHeight,x.rows.length]);b.useEffect(()=>{t.current.publishEvent("virtualScrollerContentSizeChange")},[t,en]);let er=b.useMemo(()=>{let e={};return et||(e.overflowX="hidden"),n.autoHeight&&(e.overflowY="hidden"),e},[et,n.autoHeight]);return t.current.register("private",{getRenderContext:K}),{renderContext:R,updateRenderZonePosition:W,getRows:(e={renderContext:R})=>{var o,i;let{onRowRender:a,renderContext:d,minFirstColumn:p=s,maxLastColumn:h=u,availableSpace:b=Z.width,rowIndexOffset:v=0,position:w="center"}=e;if(!d||null==b)return null;let C=l?n.rowBuffer:0,S=l?n.columnBuffer:0,[k,I]=od({firstIndex:d.firstRowIndex,lastIndex:d.lastRowIndex,minFirstIndex:0,maxLastIndex:x.rows.length,buffer:C}),E=[];
6if(e.rows)e.rows.forEach(e=>{E.push(e),t.current.calculateColSpan({rowId:e.id,minFirstColumn:p,maxLastColumn:h,columns:r})});else{if(!x.range)return null;for(let e=k;e<I;e+=1){let n=x.rows[e];E.push(n),t.current.calculateColSpan({rowId:n.id,minFirstColumn:p,maxLastColumn:h,columns:r})}}let P=!1;if(ee>-1){let e=x.rows[ee];(k>ee||I<ee)&&(P=!0,ee>k?E.push(e):E.unshift(e),t.current.calculateColSpan({rowId:e.id,minFirstColumn:p,maxLastColumn:h,columns:r}))}let[T,F]=od({firstIndex:d.firstColumnIndex,lastIndex:d.lastColumnIndex,minFirstIndex:p,maxLastIndex:h,buffer:S}),D=t4({firstColumnToRender:T,apiRef:t,firstRowToRender:k,lastRowToRender:I,visibleRows:x.rows}),A=!1;(D>U||F<U)&&(A=!0);let{focusedCellColumnIndexNotInRange:O,renderedColumns:j}=$.current(r,D,F,p,h,A?U:-1),B=(null==(o=n.slotProps)?void 0:o.row)||{},{style:V}=B,G=(0,M.Z)(B,os);(H.current!==c||N.current!==V)&&(L.current=Object.create(null));let q=[],W=!1;for(let e=0;e<E.length;e+=1){let l;let{id:o,model:s}=E[e],u=P&&f.id===o,d=P?k+e===x.rows.length:k+e===x.rows.length-1,p=t.current.rowHasAutoHeight(o)?"auto":t.current.unstable_getRowHeight(o);l=null!=y[o]&&t.current.isRowSelectable(o),a&&a(o);let h=null!==f&&f.id===o?f.field:null,C=void 0!==O&&r[O],S=C&&h?[C,...j]:j,I=null;null!==g&&g.id===o&&(I="view"===t.current.getCellParams(o,g.field).cellMode?g.field:null);let R="function"==typeof c&&c(o,s)||{},{style:T}=R,Z=(0,M.Z)(R,ou);if(!L.current[o]){let e=(0,m.Z)({},T,V);L.current[o]=e}let A=v+((null==x||null==(i=x.range)?void 0:i.firstRowIndex)||0)+k+e;P&&(null==f?void 0:f.id)===o?(A=ee,W=!0):W&&(A-=1),q.push((0,_.jsx)(n.slots.row,(0,m.Z)({row:s,rowId:o,focusedCellColumnIndexNotInRange:O,isNotVisible:u,rowHeight:p,focusedCell:h,tabbableCell:I,renderedColumns:S,visibleColumns:r,firstColumnToRender:D,lastColumnToRender:F,selected:l,index:A,containerWidth:b,isLastVisible:d,position:w},Z,G,{hovered:z===o,style:L.current[o]}),o))}return H.current=c,N.current=V,q},getRootProps:(e={})=>(0,m.Z)({ref:k,onScroll:X,onWheel:J,onTouchMove:Q},e,{style:e.style?(0,m.Z)({},e.style,er):er,role:"presentation"}),getContentProps:({style:e}={})=>({style:e?(0,m.Z)({},e,en):en,role:"presentation"}),getRenderZoneProps:()=>({ref:w,role:"rowgroup"})}};function og(e,t,n,r){var l,o;let i=e.current.getLastMeasuredRowIndex(),a=i===1/0;null!=(l=t.range)&&l.lastRowIndex&&!a&&(a=i>=t.range.lastRowIndex);let s=(0,ep.uZ)(i-((null==(o=t.range)?void 0:o.firstRowIndex)||0),0,n.positions.length);return a||n.positions[s]>=r?oc(r,n.positions):function(e,t,n){let r=1;for(;n<t.length&&Math.abs(t[n])<e;)n+=r,r*=2;return oc(e,t,Math.floor(n/2),Math.min(n,t.length))}(r,n.positions,s)}let om=e=>{let{classes:t,headerAlign:n,isDragging:r,showColumnBorder:l,groupId:o}=e;return(0,Z.Z)({root:["columnHeader","left"===n&&"columnHeader--alignLeft","center"===n&&"columnHeader--alignCenter","right"===n&&"columnHeader--alignRight",r&&"columnHeader--moving",l&&"columnHeader--showColumnBorder",l&&"columnHeader--withRightBorder","withBorderColor",null===o?"columnHeader--emptyGroup":"columnHeader--filledGroup"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer","withBorderColor"],titleContainerContent:["columnHeaderTitleContainerContent"]},z.d,t)};function ob(e){var t;let n;let{groupId:r,width:l,depth:o,maxDepth:i,fields:a,height:s,colIndex:u,hasFocus:c,tabIndex:d,isLastColumn:p}=e,h=(0,B.B)(),f=b.useRef(null),g=(0,e5.l)(),v=(0,C.P)(g,q),y=r?v[r]:{},{headerName:x=null!=r?r:"",description:w="",headerAlign:S}=y,k=r&&(null==(t=v[r])?void 0:t.renderHeaderGroup),I=b.useMemo(()=>({groupId:r,headerName:x,description:w,depth:o,maxDepth:i,fields:a,colIndex:u,isLastColumn:p}),[r,x,w,o,i,a,u,p]);r&&k&&(n=k(I));let R=h.showColumnVerticalBorder,E=(0,m.Z)({},e,{classes:h.classes,showColumnBorder:R,headerAlign:S,depth:o,isDragging:!1}),M=null!=x?x:r,P=(0,e0.Z)(),T=null===r?`empty-group-cell-${P}`:r,Z=om(E);b.useLayoutEffect(()=>{if(c){let e=f.current.querySelector('[tabindex="0"]')||f.current;null==e||e.focus()}},[g,c]);let F=b.useCallback(e=>t=>{tm(t)||g.current.publishEvent(e,I,t)},[g,I]),D=b.useMemo(()=>
6({onKeyDown:F("columnGroupHeaderKeyDown"),onFocus:F("columnGroupHeaderFocus"),onBlur:F("columnGroupHeaderBlur")}),[F]),A="function"==typeof y.headerClassName?y.headerClassName(I):y.headerClassName;return(0,_.jsx)(ot,(0,m.Z)({ref:f,classes:Z,columnMenuOpen:!1,colIndex:u,height:s,isResizing:!1,sortDirection:null,hasFocus:!1,tabIndex:d,isDraggable:!1,headerComponent:n,headerClassName:A,description:w,elementId:T,width:l,columnMenuIconButton:null,columnTitleIconButtons:null,resizable:!1,label:M,"aria-colspan":a.length,"data-fields":`|-${a.join("-|-")}-|`},D))}let ov=(0,O.ZP)("div",{name:"MuiDataGrid",slot:"ColumnHeaderRow",overridesResolver:(e,t)=>t.columnHeaderRow})(()=>({display:"flex"})),oy=e=>{let{innerRef:t,minColumnIndex:n=0,visibleColumns:r,sortColumnLookup:l,filterColumnLookup:o,columnPositions:i,columnHeaderTabIndexState:a,columnGroupHeaderTabIndexState:s,columnHeaderFocus:u,columnGroupHeaderFocus:c,densityFactor:d,headerGroupingMaxDepth:p,columnMenuState:h,columnVisibility:f,columnGroupsHeaderStructure:g,hasOtherElementInTabSequence:v}=e,y=(0,eQ.Z)(),[x,w]=b.useState(""),[S,k]=b.useState(""),R=I(),E=(0,C.P)(R,oa),M=(0,B.B)(),P=b.useRef(null),T=(0,F.Z)(t,P),[Z,D]=b.useState(null),A=b.useRef(Z),O=b.useRef(0),z=td(R,M),j=t9(R,M.columnHeaderHeight),L=Math.floor(M.columnHeaderHeight*d),H=b.useCallback(e=>{Z&&e&&op(Z,e)||D(e)},[Z]);b.useEffect(()=>{var e;null!=(e=R.current.columnHeadersContainerElementRef)&&e.current&&(R.current.columnHeadersContainerElementRef.current.scrollLeft=0)},[R]);let N=b.useRef((0,nI.PW)(t5,{equalityCheck:(e,t)=>["firstColumnIndex","minColumnIndex","columnBuffer"].every(n=>e[n]===t[n])})),V=b.useCallback(e=>{let[t,r]=od({firstIndex:e.firstRowIndex,lastIndex:e.lastRowIndex,minFirstIndex:0,maxLastIndex:z.rows.length,buffer:M.rowBuffer}),l=N.current({firstColumnIndex:e.firstColumnIndex,minColumnIndex:n,columnBuffer:M.columnBuffer,firstRowToRender:t,lastRowToRender:r,apiRef:R,visibleRows:z.rows}),o="ltr"===y.direction?1:-1,a=l>0?O.current-o*i[l]:O.current;P.current.style.transform=`translate3d(${-a}px, 0px, 0px)`},[i,n,M.columnBuffer,R,z.rows,M.rowBuffer,y.direction]);b.useLayoutEffect(()=>{Z&&V(Z)},[Z,V]);let $=b.useCallback(({left:e,renderContext:t=null},n)=>{var r,l;if(!P.current||O.current===e&&(null==(r=A.current)?void 0:r.firstColumnIndex)===(null==t?void 0:t.firstColumnIndex)&&(null==(l=A.current)?void 0:l.lastColumnIndex)===(null==t?void 0:t.lastColumnIndex))return;O.current=e;let o=!1;t===A.current&&A.current?o=!0:(n.target?(lK.flushSync(()=>{H(t)}),o=!0):H(t),A.current=t),t&&o&&V(t)},[V,H]),U=b.useCallback(e=>k(e.field),[]),G=b.useCallback(()=>k(""),[]),q=b.useCallback(e=>w(e.field),[]),W=b.useCallback(()=>w(""),[]);(0,ew.zn)(R,"columnResizeStart",U),(0,ew.zn)(R,"columnResizeStop",G),(0,ew.zn)(R,"columnHeaderDragStart",q),(0,ew.zn)(R,"columnHeaderDragEnd",W),(0,ew.zn)(R,"scrollPositionChange",$);let K=e=>{let{renderContext:t=Z,minFirstColumn:l=n,maxLastColumn:o=r.length}=e||{};if(!t)return null;let[i,a]=od({firstIndex:t.firstRowIndex,lastIndex:t.lastRowIndex,minFirstIndex:0,maxLastIndex:z.rows.length,buffer:M.rowBuffer}),s=E?N.current({firstColumnIndex:t.firstColumnIndex,minColumnIndex:l,columnBuffer:M.columnBuffer,apiRef:R,firstRowToRender:i,lastRowToRender:a,visibleRows:z.rows}):0,u=E?Math.min(t.lastColumnIndex+M.columnBuffer,o):o;return{renderedColumns:r.slice(s,u),firstColumnToRender:s,lastColumnToRender:u,minFirstColumn:l,maxLastColumn:o}},Y={minHeight:j,maxHeight:j,lineHeight:`${L}px`};return{renderContext:Z,getColumnHeaders:(e,t={})=>{let n=K(e);if(null==n)return null;let{renderedColumns:r,firstColumnToRender:i}=n,s=[];for(let e=0;e<r.length;e+=1){let n=r[e],c=i+e,d=0===c,p=null!==a&&a.field===n.field||d&&!v?0:-1,f=null!==u&&u.field===n.field,g=h.open&&h.field===n.field;s.push((0,_.jsx)(or,(0,m.Z)({},l[n.field],{columnMenuOpen:g,filterItemsCounter:o[n.field]&&o[n.field].length,headerHeight:L,isDragging:n.field===x,colDef:n,colIndex:c,isResizing:S===n.field,hasFocus:f,tabIndex:p},t),n.field))}return(0,_.jsx)(ov,{role:"row","aria-rowindex":p+1,ownerState:M,children:s})},getColumnsToRender:K,getColumnGroupHeaders:e=>{if(0===p)return null;let t=K(e);if(null==t||0===t.renderedColumns.length)return null;let{firstColumnToRender:n,lastColumnToRender:l}=t,o=[],i=[];for(let e=0;e<p;e+=1){var a,u;let t=g[e],o=r[n].field,d=null!=(a=R.current.unstable_getColumnGroupPath(o)[e])?a:null,p=t.findIndex(({groupId:e,columnFields:t})=>e===d&&t.includes(o)),h=r[l-1].field,b=null!=(u=R.current.unstable_getColumnGroupPath(h)[e])?u:null,v=t.findIndex(({groupId:e,columnFields:t})=>e===b&&t.includes(h)),y=t.slice(p,v+1).map(e=>(0,m.Z)({},e,{columnFields:e.columnFields.filter(e=>!1!==f[e])})).filter(e=>e.columnFields.length>0),x=y[0].columnFields.indexOf(o),w=y[0].columnFields.slice(0,x).reduce((e,t)=>
6{var n;return e+(null!=(n=R.current.getColumn(t).computedWidth)?n:0)},0),C=n,S=y.map(({groupId:t,columnFields:n})=>{let r=null!==c&&c.depth===e&&n.includes(c.field),l=null!==s&&s.depth===e&&n.includes(s.field)?0:-1,o={groupId:t,width:n.reduce((e,t)=>e+R.current.getColumn(t).computedWidth,0),fields:n,colIndex:C,hasFocus:r,tabIndex:l};return C+=n.length,o});i.push({leftOverflow:w,elements:S})}return i.forEach((e,t)=>{o.push((0,_.jsx)(ov,{style:{height:`${L}px`,transform:`translateX(-${e.leftOverflow}px)`},role:"row","aria-rowindex":t+1,ownerState:M,children:e.elements.map(({groupId:e,width:n,fields:l,colIndex:o,hasFocus:a,tabIndex:s},u)=>(0,_.jsx)(ob,{groupId:e,width:n,fields:l,colIndex:o,depth:t,isLastColumn:o===r.length-l.length,maxDepth:i.length,height:L,hasFocus:a,tabIndex:s},u))},t))}),o},isDragging:!!x,getRootProps:(e={})=>(0,m.Z)({style:Y},e),getInnerProps:()=>({ref:T,role:"rowgroup"}),headerHeight:L}},ox=["className"],ow=e=>{let{classes:t}=e;return(0,Z.Z)({root:["columnHeaders","withBorderColor"]},z.d,t)},oC=(0,en.Z)("div",{name:"MuiDataGrid",slot:"ColumnHeaders",overridesResolver:(e,t)=>t.columnHeaders})({position:"relative",overflow:"hidden",display:"flex",alignItems:"center",boxSizing:"border-box",borderBottom:"1px solid",borderTopLeftRadius:"var(--unstable_DataGrid-radius)",borderTopRightRadius:"var(--unstable_DataGrid-radius)"}),oS=b.forwardRef(function(e,t){let{className:n}=e,r=(0,M.Z)(e,ox),l=(0,B.B)(),o=ow(l);return(0,_.jsx)(oC,(0,m.Z)({ref:t,className:(0,P.Z)(n,o.root),ownerState:l},r,{role:"presentation"}))}),ok=["isDragging","className"],oI=e=>{let{isDragging:t,hasScrollX:n,classes:r}=e;return(0,Z.Z)({root:["columnHeadersInner",t&&"columnHeaderDropZone",n&&"columnHeadersInner--scrollable"]},z.d,r)},oR=(0,en.Z)("div",{name:"MuiDataGrid",slot:"columnHeadersInner",overridesResolver:(e,t)=>[{[`&.${z._.columnHeaderDropZone}`]:t.columnHeaderDropZone},t.columnHeadersInner]})(()=>({display:"flex",alignItems:"flex-start",flexDirection:"column",[`&.${z._.columnHeaderDropZone} .${z._.columnHeaderDraggableContainer}`]:{cursor:"move"},[`&.${z._["columnHeadersInner--scrollable"]} .${z._.columnHeader}:last-child`]:{borderRight:"none"}})),o_=b.forwardRef(function(e,t){var n,r;let{isDragging:l,className:o}=e,i=(0,M.Z)(e,ok),a=(0,e5.l)(),s=(0,B.B)(),u=(0,m.Z)({},s,{isDragging:l,hasScrollX:null!=(n=null==(r=a.current.getRootDimensions())?void 0:r.hasScrollX)&&n}),c=oI(u);return(0,_.jsx)(oR,(0,m.Z)({ref:t,className:(0,P.Z)(o,c.root),ownerState:u},i))}),oE=["innerRef","className","visibleColumns","sortColumnLookup","filterColumnLookup","columnPositions","columnHeaderTabIndexState","columnGroupHeaderTabIndexState","columnHeaderFocus","columnGroupHeaderFocus","densityFactor","headerGroupingMaxDepth","columnMenuState","columnVisibility","columnGroupsHeaderStructure","hasOtherElementInTabSequence"],oM=lO(b.forwardRef(function(e,t){let{innerRef:n,visibleColumns:r,sortColumnLookup:l,filterColumnLookup:o,columnPositions:i,columnHeaderTabIndexState:a,columnGroupHeaderTabIndexState:s,columnHeaderFocus:u,columnGroupHeaderFocus:c,densityFactor:d,headerGroupingMaxDepth:p,columnMenuState:h,columnVisibility:f,columnGroupsHeaderStructure:g,hasOtherElementInTabSequence:b}=e,v=(0,M.Z)(e,oE),{isDragging:y,getRootProps:x,getInnerProps:w,getColumnHeaders:C,getColumnGroupHeaders:S}=oy({innerRef:n,visibleColumns:r,sortColumnLookup:l,filterColumnLookup:o,columnPositions:i,columnHeaderTabIndexState:a,columnGroupHeaderTabIndexState:s,columnHeaderFocus:u,columnGroupHeaderFocus:c,densityFactor:d,headerGroupingMaxDepth:p,columnMenuState:h,columnVisibility:f,columnGroupsHeaderStructure:g,hasOtherElementInTabSequence:b});return(0,_.jsx)(oS,(0,m.Z)({ref:t},x(v),{children:(0,_.jsxs)(o_,(0,m.Z)({isDragging:y},w(),{children:[S(),C()]}))}))}));var oP=n(56912);let oT=["displayOrder"],oZ=e=>{let t=I(),{defaultSlots:n,defaultSlotProps:r,slots:l={},slotProps:o={},hideMenu:i,colDef:a,addDividers:s=!0}=e,u=b.useMemo(()=>(0,m.Z)({},n,l),[n,l]),c=b.useMemo(()=>{if(!o||0===Object.keys(o).length)return r;let e=(0,m.Z)({},o);return Object.entries(r).forEach(([t,n])=>{e[t]=(0,m.Z)({},n,o[t]||{})}),e},[r,o]),d=t.current.unstable_applyPipeProcessors("columnMenu",[],e.colDef),p=b.useMemo(()=>{let e=Object.keys(n);return Object.keys(l).filter(t=>!e.includes(t))},[l,n]);return b.useMemo(()=>{let e=Array.from(new Set([...d,...p])).filter(e=>null!=u[e]).sort((e,t)=>
6{let n=c[e],r=c[t];return(Number.isFinite(null==n?void 0:n.displayOrder)?n.displayOrder:100)-(Number.isFinite(null==r?void 0:r.displayOrder)?r.displayOrder:100)});return e.reduce((t,n,r)=>{let l={colDef:a,onClick:i},o=c[n];if(o){let e=(0,M.Z)(o,oT);l=(0,m.Z)({},l,e)}return s&&r!==e.length-1?[...t,[u[n],l],[oP.Z,{}]]:[...t,[u[n],l]]},[])},[s,a,d,i,u,c,p])},oF=["hideMenu","colDef","id","labelledby","className","children","open"],oD=(0,O.ZP)(eJ.Z)(()=>({minWidth:248})),oA=b.forwardRef(function(e,t){let{hideMenu:n,id:r,labelledby:l,className:o,children:i,open:a}=e,s=(0,M.Z)(e,oF),u=b.useCallback(e=>{(0,tu.id)(e.key)&&e.preventDefault(),(0,tu.Mh)(e.key)&&n(e)},[n]);return(0,_.jsx)(oD,(0,m.Z)({id:r,ref:t,className:(0,P.Z)(z._.menuList,o),"aria-labelledby":l,onKeyDown:u,autoFocus:a},s,{children:i}))});var oO=n(7638),oz=n(32200);function oj(e){let{colDef:t,onClick:n}=e,r=(0,e5.l)(),l=(0,B.B)(),o=1===(0,V.FE)(r).filter(e=>!0!==e.disableColumnMenu).length,i=b.useCallback(e=>{o||(r.current.setColumnVisibility(t.field,!1),n(e))},[r,t.field,n,o]);return l.disableColumnSelector||!1===t.hideable?null:(0,_.jsxs)(rc.Z,{onClick:i,disabled:o,children:[(0,_.jsx)(oO.Z,{children:(0,_.jsx)(l.slots.columnMenuHideIcon,{fontSize:"small"})}),(0,_.jsx)(oz.Z,{children:r.current.getLocaleText("columnMenuHideColumn")})]})}function oL(e){let{onClick:t}=e,n=(0,e5.l)(),r=(0,B.B)(),l=b.useCallback(e=>{t(e),n.current.showPreferences(t6.y.columns)},[n,t]);return r.disableColumnSelector?null:(0,_.jsxs)(rc.Z,{onClick:l,children:[(0,_.jsx)(oO.Z,{children:(0,_.jsx)(r.slots.columnMenuManageColumnsIcon,{fontSize:"small"})}),(0,_.jsx)(oz.Z,{children:n.current.getLocaleText("columnMenuManageColumns")})]})}let oH=["defaultSlots","defaultSlotProps","slots","slotProps"],oB={columnMenuSortItem:function(e){var t;let{colDef:n,onClick:r}=e,l=(0,e5.l)(),o=(0,C.P)(l,ea.Gm),i=(0,B.B)(),a=b.useMemo(()=>{if(!n)return null;let e=o.find(e=>e.field===n.field);return null==e?void 0:e.sort},[n,o]),s=null!=(t=n.sortingOrder)?t:i.sortingOrder,u=b.useCallback(e=>{r(e);let t=e.currentTarget.getAttribute("data-value")||null;l.current.sortColumn(n,t===a?null:t)},[l,n,r,a]);if(!n||!n.sortable||!s.some(e=>!!e))return null;let c=e=>{let t=l.current.getLocaleText(e);return"function"==typeof t?t(n):t};return(0,_.jsxs)(b.Fragment,{children:[s.includes("asc")&&"asc"!==a?(0,_.jsxs)(rc.Z,{onClick:u,"data-value":"asc",children:[(0,_.jsx)(oO.Z,{children:(0,_.jsx)(i.slots.columnMenuSortAscendingIcon,{fontSize:"small"})}),(0,_.jsx)(oz.Z,{children:c("columnMenuSortAsc")})]}):null,s.includes("desc")&&"desc"!==a?(0,_.jsxs)(rc.Z,{onClick:u,"data-value":"desc",children:[(0,_.jsx)(oO.Z,{children:(0,_.jsx)(i.slots.columnMenuSortDescendingIcon,{fontSize:"small"})}),(0,_.jsx)(oz.Z,{children:c("columnMenuSortDesc")})]}):null,s.includes(null)&&null!=a?(0,_.jsxs)(rc.Z,{onClick:u,children:[(0,_.jsx)(oO.Z,{}),(0,_.jsx)(oz.Z,{children:l.current.getLocaleText("columnMenuUnsort")})]}):null]})},columnMenuFilterItem:function(e){let{colDef:t,onClick:n}=e,r=(0,e5.l)(),l=(0,B.B)(),o=b.useCallback(e=>{n(e),r.current.showFilterPanel(t.field)},[r,t.field,n]);return l.disableColumnFilter||!t.filterable?null:(0,_.jsxs)(rc.Z,{onClick:o,children:[(0,_.jsx)(oO.Z,{children:(0,_.jsx)(l.slots.columnMenuFilterIcon,{fontSize:"small"})}),(0,_.jsx)(oz.Z,{children:r.current.getLocaleText("columnMenuFilter")})]})},columnMenuColumnsItem:function(e){return(0,_.jsxs)(b.Fragment,{children:[(0,_.jsx)(oj,(0,m.Z)({},e)),(0,_.jsx)(oL,(0,m.Z)({},e))]})}},oN={columnMenuSortItem:{displayOrder:10},columnMenuFilterItem:{displayOrder:20},columnMenuColumnsItem:{displayOrder:30}},oV=b.forwardRef(function(e,t){let{defaultSlots:n,defaultSlotProps:r,slots:l,slotProps:o}=e,i=(0,M.Z)(e,oH),a=oZ((0,m.Z)({},i,{defaultSlots:n,defaultSlotProps:r,slots:l,slotProps:o}));return(0,_.jsx)(oA,(0,m.Z)({ref:t},i,{children:a.map(([e,t],n)=>(0,_.jsx)(e,(0,m.Z)({},t),n))}))}),o$=b.forwardRef(function(e,t){return(0,_.jsx)(oV,(0,m.Z)({},e,{ref:t,defaultSlots:oB,defaultSlotProps:oN}))}),oU=b.forwardRef(function(e,t){let n=(0,e5.l)().current.getLocaleText("noResultsOverlayLabel");return(0,_.jsx)(rl.n,(0,m.Z)({ref:t},e,{children:n}))});var oG=n(12166),oq=n(26541),oW=n(6897),oK=n(13539),oY=n(84677),oX=n(95611),oJ=n(21038),oQ=n(94143),o0=n(81873);let o1=["sortingOrder"],o2=b.memo(function(e){let{sortingOrder:t}=e,n=(0,M.Z)(e,o1),r=(0,B.B)(),[l]=t,o="asc"===l?r.slots.columnSortedAscendingIcon:r.slots.columnSortedDescendingIcon;return o?(0,_.jsx)(o,(0,m.Z)({},n)):null}),o3=(0,rM.Z)((0,_.jsx)("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"}),"ArrowUpward"),o4=(0,rM.Z)((0,_.jsx)("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward"),o5=(0,rM.Z)((0,_.jsx)("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"KeyboardArrowRight"),o9=(0,rM.Z)((0,_.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),o6=(0,rM.Z)((0,_.jsx)("path",{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"}),"FilterList"),o8=(0,rM.Z)((0,_.jsx)("path",{d:"M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39c.51-.66.04-1.61-.79-1.61H5.04c-.83 0-1.3.95-.79 1.61z"}),"FilterAlt"),o7=(0,rM.Z)((0,_.jsx)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),"Search");(0,rM.Z)((0,_.jsx)("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"}),"Menu"),(0,rM.Z)((0,_.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckCircle");let ie=(0,rM.Z)((0,_.jsx)("path",{d:"M6 5H3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1zm14 0h-3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1zm-7 0h-3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1z"}),"ColumnIcon"),it=(0,rM.Z)((0,_.jsx)("path",{d:"M11 19V5h2v14z"}),"Separator"),ir=(0,rM.Z)((0,_.jsx)("path",{d:"M4 15h16v-2H4v2zm0 4h16v-2H4v2zm0-8h16V9H4v2zm0-6v2h16V5H4z"}),"ViewHeadline"),il=(0,rM.Z)((0,_.jsx)("path",{d:"M21,8H3V4h18V8z M21,10H3v4h18V10z M21,16H3v4h18V16z"}),"TableRows"),io=(0,rM.Z)((0,_.jsx)("path",{d:"M4 18h17v-6H4v6zM4 5v6h17V5H4z"}),"ViewStream"),ii=(0,rM.Z)((0,_.jsx)("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"TripleDotsVertical"),ia=(0,rM.Z)((0,_.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),is=(0,rM.Z)((0,_.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add"),iu=(0,rM.Z)((0,_.jsx)("path",{d:"M19 13H5v-2h14v2z"}),"Remove"),ic=(0,rM.Z)((0,_.jsx)("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"}),"Load"),id=(0,rM.Z)((0,_.jsx)("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"Drag"),ip=(0,rM.Z)((0,_.jsx)("path",{d:"M19 12v7H5v-7H3v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zm-6 .67l2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2z"}),"SaveAlt"),ih=(0,rM.Z)((0,_.jsx)("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check"),ig=(0,rM.Z)((0,_.jsx)("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreVert"),im=(0,rM.Z)((0,_.jsx)("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"}),"VisibilityOff"),ib=(0,rM.Z)((0,_.jsx)("g",{children:(0,_.jsx)("path",{d:"M14.67,5v14H9.33V5H14.67z M15.67,19H21V5h-5.33V19z M8.33,19V5H3v14H8.33z"})}),"ViewColumn"),iv=(0,rM.Z)((0,_.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear");(0,rM.Z)((0,_.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"}),"Delete");let iy=(0,rM.Z)((0,_.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"}),"Delete"),ix=["native"],iw=(0,m.Z)({},{BooleanCellTrueIcon:ih,BooleanCellFalseIcon:ia,ColumnMenuIcon:ii,OpenFilterButtonIcon:o6,FilterPanelDeleteIcon:ia,ColumnFilteredIcon:o8,ColumnSelectorIcon:ie,ColumnUnsortedIcon:o2,ColumnSortedAscendingIcon:o3,ColumnSortedDescendingIcon:o4,ColumnResizeIcon:it,DensityCompactIcon:ir,DensityStandardIcon:il,DensityComfortableIcon:io,ExportIcon:ip,MoreActionsIcon:ig,TreeDataCollapseIcon:o9,TreeDataExpandIcon:o5,GroupingCriteriaCollapseIcon:o9,GroupingCriteriaExpandIcon:o5,DetailPanelExpandIcon:is,DetailPanelCollapseIcon:iu,RowReorderIcon:id,QuickFilterIcon:o7,QuickFilterClearIcon:ia,ColumnMenuHideIcon:im,ColumnMenuSortAscendingIcon:o3,ColumnMenuSortDescendingIcon:o4,ColumnMenuFilterIcon:o8,ColumnMenuManageColumnsIcon:ib,ColumnMenuClearIcon:iv,LoadIcon:ic,FilterPanelAddIcon:is,FilterPanelRemoveAllIcon:iy,ColumnReorderIcon:id}
6,{BaseCheckbox:oG.Z,BaseTextField:oq.Z,BaseFormControl:oW.Z,BaseSelect:rd.Z,BaseSwitch:oK.Z,BaseButton:oY.Z,BaseIconButton:rE.Z,BaseInputAdornment:oX.Z,BaseTooltip:oJ.Z,BasePopper:e4.Z,BaseInputLabel:oQ.Z,BaseSelectOption:function(e){let{native:t}=e,n=(0,M.Z)(e,ix);return t?(0,_.jsx)("option",(0,m.Z)({},n)):(0,_.jsx)(rc.Z,(0,m.Z)({},n))},BaseChip:o0.Z}),iC=(0,m.Z)({},iw,{Cell:l$,SkeletonCell:function(e){let{align:t,width:n,contentWidth:r}=e,l=(0,M.Z)(e,nU),o=nG({classes:(0,B.B)().classes,align:t});return(0,_.jsx)("div",(0,m.Z)({className:o.root,style:{width:n}},l,{children:(0,_.jsx)(n$.Z,{width:`${r}%`})}))},ColumnHeaderFilterIconButton:function(e){var t,n;let{counter:r,field:l,onClick:o}=e,i=(0,e5.l)(),a=(0,B.B)(),s=nJ((0,m.Z)({},e,{classes:a.classes})),u=(0,C.P)(i,nC.e),c=(0,e0.Z)(),d=(0,e0.Z)(),p=b.useCallback(e=>{e.preventDefault(),e.stopPropagation();let{open:t,openedPanelValue:n}=(0,nC.e)(i.current.state);t&&n===t6.y.filters?i.current.hideFilterPanel():i.current.showFilterPanel(void 0,d,c),o&&o(i.current.getColumnHeaderParams(l),e)},[i,l,o,d,c]);if(!r)return null;let h=u.open&&u.labelId===c,f=(0,_.jsx)(a.slots.baseIconButton,(0,m.Z)({id:c,onClick:p,color:"default","aria-label":i.current.getLocaleText("columnHeaderFiltersLabel"),size:"small",tabIndex:-1,"aria-haspopup":"menu","aria-expanded":h,"aria-controls":h?d:void 0},null==(t=a.slotProps)?void 0:t.baseIconButton,{children:(0,_.jsx)(a.slots.columnFilteredIcon,{className:s.icon,fontSize:"small"})}));return(0,_.jsx)(a.slots.baseTooltip,(0,m.Z)({title:i.current.getLocaleText("columnHeaderFiltersTooltipActive")(r),enterDelay:1e3},null==(n=a.slotProps)?void 0:n.baseTooltip,{children:(0,_.jsxs)(nX,{children:[r>1&&(0,_.jsx)(nq.Z,{badgeContent:r,color:"default",children:f}),1===r&&f]})}))},ColumnMenu:o$,ColumnHeaders:oM,Footer:n6,FooterRowCount:rt,Toolbar:null,PreferencesPanel:rn,LoadingOverlay:ro,NoResultsOverlay:oU,NoRowsOverlay:ri,Pagination:rY,FilterPanel:lb,ColumnsPanel:function(e){var t,n,r;let l=(0,e5.l)(),o=b.useRef(null),i=(0,C.P)(l,V.d$),a=(0,C.P)(l,V.g0),s=(0,B.B)(),[u,c]=b.useState(""),d=lI(s),{sort:p,searchPredicate:h=lM,autoFocusSearchField:f=!0,disableHideAllButton:g=!1,disableShowAllButton:v=!1,getTogglableColumns:y}=e,x=(0,M.Z)(e,lk),w=b.useMemo(()=>{switch(p){case"asc":return[...i].sort((e,t)=>lE.compare(e.headerName||e.field,t.headerName||t.field));case"desc":return[...i].sort((e,t)=>-lE.compare(e.headerName||e.field,t.headerName||t.field));default:return i}},[i,p]),S=e=>{let{name:t}=e.target;l.current.setColumnVisibility(t,!1===a[t])},k=b.useCallback(e=>{let t=(0,V.g0)(l),n=(0,m.Z)({},t),r=y?y(i):null;return i.forEach(t=>{t.hideable&&(null==r||r.includes(t.field))&&(e?delete n[t.field]:n[t.field]=!1)}),l.current.setColumnVisibilityModel(n)},[l,i,y]),I=b.useCallback(e=>{c(e.target.value)},[]),R=b.useMemo(()=>{let e=y?y(w):null,t=e?w.filter(({field:t})=>e.includes(t)):w;return u?t.filter(e=>h(e,u.toLowerCase())):t},[w,u,h,y]),E=b.useRef(null);b.useEffect(()=>{f?o.current.focus():E.current&&"function"==typeof E.current.focus&&E.current.focus()},[f]);let P=!1,T=e=>!1===P&&!1!==e.hideable&&(P=!0,!0);return(0,_.jsxs)(lt,(0,m.Z)({},x,{children:[(0,_.jsx)(lS,{children:(0,_.jsx)(s.slots.baseTextField,(0,m.Z)({label:l.current.getLocaleText("columnsPanelTextFieldLabel"),placeholder:l.current.getLocaleText("columnsPanelTextFieldPlaceholder"),inputRef:o,value:u,onChange:I,variant:"standard",fullWidth:!0},null==(t=s.slotProps)?void 0:t.baseTextField))}),(0,_.jsx)(r1,{children:(0,_.jsx)(lR,{className:d.root,ownerState:s,children:R.map(e=>{var t;return(0,_.jsxs)(l_,{className:d.columnsPanelRow,ownerState:s,children:[(0,_.jsx)(ly.Z,{control:(0,_.jsx)(s.slots.baseSwitch,(0,m.Z)({disabled:!1===e.hideable,checked:!1!==a[e.field],onClick:S,name:e.field,size:"small",inputRef:T(e)?E:void 0},null==(t=s.slotProps)?void 0:t.baseSwitch)),label:e.headerName||e.field}),!s.disableColumnReorder&&!1]},e.field)})})}),v&&g?null:(0,_.jsxs)(r5,{children:[g?(0,_.jsx)("span",{}):(0,_.jsx)(s.slots.baseButton,(0,m.Z)({onClick:()=>k(!1)},null==(n=s.slotProps)?void 0:n.baseButton,{disabled:g,children:l.current.getLocaleText("columnsPanelHideAllButton")})),v?null:(0,_.jsx)(s.slots.baseButton,(0,m.Z)({onClick:()=>k(!0)},null==(r=s.slotProps)?void 0:r.baseButton,{disabled:v,children:l.current.getLocaleText("columnsPanelShowAllButton")}))]})]}))},Panel:lD,Row:lW}),iS=e=>{if(void 0!==e)return Object.keys(e).reduce((t,n)=>(0,m.Z)({},t,{[`${n.charAt(0).toLowerCase()}${n.slice(1)}`]:e[n]}),{})},ik={autoHeight:!1,autoPageSize:!1,checkboxSelection:!1,checkboxSelectionVisibleOnly:!1,columnBuffer:3,rowBuffer:3,columnThreshold:3,rowThreshold:3,rowSelection:!0,density:"standard",disableColumnFilter:!1,disableColumnMenu:!1,disableColumnSelector:!1,disableDensitySelector:!1,disableEval:!1,disableMultipleColumnsFiltering:!1,disableMultipleRowSelection:!1,disableMultipleColumnsSorting:!1,disableRowSelectionOnClick:!1,disableVirtualization:!1,editMode:ti.Cell,filterMode:"client",filterDebounceMs:150,columnHeaderHeight:56,hideFooter:!1,hideFooterPagination:!1,hideFooterRowCount:!1,hideFooterSelectedRowCount:!1,ignoreDiacritics:!1,logger:console,logLevel:"error",pagination:!1,paginationMode:"client",rowHeight:52,pageSizeOptions:[25,50,100],rowSpacingType:"margin",showCellVerticalBorder:!1,showColumnVerticalBorder:!1,sortingOrder:["asc","desc",null],sortingMode:"client",throttleRowsMs:0,disableColumnReorder:!1,disableColumnResize:!1,keepNonExistentRowsSelected:!1,keepColumnPositionIfDraggedOutside:!1,unstable_ignoreValueFormatterDuringExport:!1,clipboardCopyCellDelimiter:"	",rowPositionsDebounceMs:166};iS(iC);let iI=e=>(0,m.Z)({},e,{rowsMeta:{currentPageTotalHeight:0,positions:[]}}),iR=(e,t,n)=>"number"==typeof e&&e>0?e:t,i_=(e,t)=>{let{getRowHeight:n,getRowSpacing:r,getEstimatedRowHeight:l}=t,o=b.useRef(Object.create(null)),i=b.useRef(-1),a=b.useRef(!1),s=(0,C.P)(e,N.CD),u=(0,C.P)(e,ei.uf),c=(0,C.P)(e,eY.fL),d=(0,C.P)(e,ea.Gm),p=td(e,t),h=(0,C.P)(e,Y.Kf),f=Math.floor(iR(t.rowHeight,ik.rowHeight,"MUI: The `rowHeight` prop should be a number greater than 0.\nThe default value will be used instead.")*s),g=b.useCallback(()=>{var t,u;a.current=!1;let c=t=>{o.current[t.id]||(o.current[t.id]={sizes:{baseCenter:f},isResized:!1,autoHeight:!1,needsFirstMeasurement:!0});let{isResized:i,needsFirstMeasurement:u,sizes:c}=o.current[t.id],d="number"==typeof f&&f>0?f:52,h=c.baseCenter;if(i)d=h;else if(n){let e=n((0,m.Z)({},t,{densityFactor:s}));if("auto"===e){if(u){let e=l?l((0,m.Z)({},t,{densityFactor:s})):f;d=null!=e?e:f}else d=h;a.current=!0,o.current[t.id].autoHeight=!0}else d=iR(e,f,"MUI: The `getRowHeight` prop should return a number greater than 0 or 'auto'.\nThe default value will be used instead."),o.current[t.id].needsFirstMeasurement=!1,o.current[t.id].autoHeight=!1}else o.current[t.id].needsFirstMeasurement=!1;let g={};for(let e in c)/^base[A-Z]/.test(e)&&(g[e]=c[e]);if(g.baseCenter=d,r){var b,v;let n=e.current.getRowIndexRelativeToVisibleRows(t.id),l=r((0,m.Z)({},t,{isFirstVisible:0===n,isLastVisible:n===p.rows.length-1,indexRelativeToCurrentPage:n}));g.spacingTop=null!=(b=l.top)?b:0,g.spacingBottom=null!=(v=l.bottom)?v:0}let y=e.current.unstable_applyPipeProcessors("rowHeight",g,t);return o.current[t.id].sizes=y,y},d=[],g=p.rows.reduce((e,t)=>
6{d.push(e);let n=0,r=0,l=c(t);for(let e in l){let t=l[e];/^base[A-Z]/.test(e)?n=t>n?t:n:r+=t}return e+n+r},0);null==h||null==(t=h.top)||t.forEach(e=>{c(e)}),null==h||null==(u=h.bottom)||u.forEach(e=>{c(e)}),e.current.setState(e=>(0,m.Z)({},e,{rowsMeta:{currentPageTotalHeight:g,positions:d}})),a.current||(i.current=1/0),e.current.forceUpdate()},[e,p.rows,f,n,r,l,h,s]),v=b.useCallback(e=>{let t=o.current[e];return t?t.sizes.baseCenter:f},[f]),y=b.useCallback((e,t)=>{o.current[e].sizes.baseCenter=t,o.current[e].isResized=!0,o.current[e].needsFirstMeasurement=!1,g()},[g]),x=b.useMemo(()=>(0,nV.Z)(g,t.rowPositionsDebounceMs),[g,t.rowPositionsDebounceMs]),w=b.useCallback((e,t,n)=>{if(!o.current[e]||!o.current[e].autoHeight)return;let r=o.current[e].sizes[`base${(0,T.Z)(n)}`]!==t;o.current[e].needsFirstMeasurement=!1,o.current[e].sizes[`base${(0,T.Z)(n)}`]=t,r&&x()},[x]),S=b.useCallback(e=>{var t;return(null==(t=o.current[e])?void 0:t.autoHeight)||!1},[]),k=b.useCallback(()=>i.current,[]),I=b.useCallback(e=>{a.current&&e>i.current&&(i.current=e)},[]),R=b.useCallback(()=>{o.current={},g()},[g]);b.useEffect(()=>{g()},[f,u,c,d,g]),tx(e,"rowHeight",g),eh(e,{unstable_setLastMeasuredRowIndex:I,unstable_getRowHeight:v,unstable_getRowInternalSizes:e=>{var t;return null==(t=o.current[e])?void 0:t.sizes},unstable_setRowHeight:y,unstable_storeRowHeightMeasurement:w,resetRowHeights:R},"public"),eh(e,{getLastMeasuredRowIndex:k,rowHasAutoHeight:S},"private")},iE=e=>(0,m.Z)({},e,{columnMenu:{open:!1}}),iM=e=>{let t=eG(e,"useGridColumnMenu"),n=b.useCallback(n=>{e.current.setState(e=>e.columnMenu.open&&e.columnMenu.field===n?e:(t.debug("Opening Column Menu"),(0,m.Z)({},e,{columnMenu:{open:!0,field:n}})))&&(e.current.hidePreferences(),e.current.forceUpdate())},[e,t]),r=b.useCallback(()=>{let n=eu(e.current.state);if(n.field){let t=(0,V.WH)(e),r=(0,V.g0)(e),l=(0,V.Zi)(e),o=n.field;if(t[o]||(o=l[0]),!1===r[o]){let e=l.filter(e=>e===o||!1!==r[e]),t=e.indexOf(o);o=e[t+1]||e[t-1]}e.current.setColumnHeaderFocus(o)}e.current.setState(e=>e.columnMenu.open||void 0!==e.columnMenu.field?(t.debug("Hiding Column Menu"),(0,m.Z)({},e,{columnMenu:(0,m.Z)({},e.columnMenu,{open:!1,field:void 0})})):e)&&e.current.forceUpdate()},[e,t]),l=b.useCallback(l=>{t.debug("Toggle Column Menu");let o=eu(e.current.state);o.open&&o.field===l?r():n(l)},[e,t,n,r]);eh(e,{showColumnMenu:n,hideColumnMenu:r,toggleColumnMenu:l},"public"),(0,ew.zn)(e,"columnResizeStart",r),(0,ew.zn)(e,"virtualScrollerWheel",e.current.hideColumnMenu),(0,ew.zn)(e,"virtualScrollerTouchMove",e.current.hideColumnMenu)};function iP(e){return void 0!==e.field}let iT=(e,t,n)=>{if(iP(e)){if(void 0!==n[e.field])throw Error(`MUI: columnGroupingModel contains duplicated field
7column field ${e.field} occurs two times in the grouping model:
8- ${n[e.field].join(" > ")}
9- ${t.join(" > ")}`);n[e.field]=t;return}let{groupId:r,children:l}=e;l.forEach(e=>{iT(e,[...t,r],n)})},iZ=e=>{if(!e)return{};let t={};return e.forEach(e=>{iT(e,[],t)}),t},iF=(e,t,n)=>{let r=e=>{var n;return null!=(n=t[e])?n:[]},l=[],o=Math.max(...e.map(e=>r(e).length)),i=(e,t,n)=>(0,ep.xb)(r(e).slice(0,n+1),r(t).slice(0,n+1)),a=(e,t)=>!!(null!=n&&n.left&&n.left.includes(e)&&!n.left.includes(t)||null!=n&&n.right&&!n.right.includes(e)&&n.right.includes(t));for(let t=0;t<o;t+=1){let n=e.reduce((e,n)=>{var l;let o=null!=(l=r(n)[t])?l:null;if(0===e.length)return[{columnFields:[n],groupId:o}];let s=e[e.length-1],u=s.columnFields[s.columnFields.length-1];return s.groupId!==o||!i(u,n,t)||a(u,n)?[...e,{columnFields:[n],groupId:o}]:[...e.slice(0,e.length-1),{columnFields:[...s.columnFields,n],groupId:o}]},[]);l.push(n)}return l},iD=["groupId","children"],iA=e=>{let t={};return e.forEach(e=>{if(iP(e))return;let{groupId:n,children:r}=e,l=(0,M.Z)(e,iD);if(!n)throw Error("MUI: An element of the columnGroupingModel does not have either `field` or `groupId`.");r||console.warn(`MUI: group groupId=${n} has no children.`);let o=(0,m.Z)({},l,{groupId:n}),i=iA(r);if(void 0!==i[n]||void 0!==t[n])throw Error(`MUI: The groupId ${n} is used multiple times in the columnGroupingModel.`);t=(0,m.Z)({},t,i,{[n]:o})}),(0,m.Z)({},t)}
9,iO=(e,t,n)=>{var r,l,o,i;if(!(null!=(r=t.experimentalFeatures)&&r.columnGrouping))return e;let a=(0,V.Zi)(n),s=(0,V.pK)(n),u=iA(null!=(l=t.columnGroupingModel)?l:[]),c=iZ(null!=(o=t.columnGroupingModel)?o:[]),d=iF(a,c,null!=(i=n.current.state.pinnedColumns)?i:{}),p=0===s.length?0:Math.max(...s.map(e=>{var t,n;return null!=(t=null==(n=c[e])?void 0:n.length)?t:0}));return(0,m.Z)({},e,{columnGrouping:{lookup:u,unwrappedGroupingModel:c,headerStructure:d,maxDepth:p}})},iz=(e,t)=>{var n;let r=b.useCallback(t=>{var n;return null!=(n=G(e)[t])?n:[]},[e]),l=b.useCallback(()=>q(e),[e]);eh(e,{unstable_getColumnGroupPath:r,unstable_getAllGroupDetails:l},"public");let o=b.useCallback(()=>{var n;let r=iZ(null!=(n=t.columnGroupingModel)?n:[]);e.current.setState(e=>{var t,n,l;let o=iF(null!=(t=null==(n=e.columns)?void 0:n.orderedFields)?t:[],r,null!=(l=e.pinnedColumns)?l:{});return(0,m.Z)({},e,{columnGrouping:(0,m.Z)({},e.columnGrouping,{headerStructure:o})})})},[e,t.columnGroupingModel]),i=b.useCallback(n=>{var r,l,o,i;if(!(null!=(r=t.experimentalFeatures)&&r.columnGrouping))return;let a=null!=(l=null==(o=(i=e.current).getPinnedColumns)?void 0:o.call(i))?l:{},s=(0,V.Zi)(e),u=(0,V.pK)(e),c=iA(null!=n?n:[]),d=iZ(null!=n?n:[]),p=iF(s,d,a),h=0===u.length?0:Math.max(...u.map(e=>{var t,n;return null!=(t=null==(n=d[e])?void 0:n.length)?t:0}));e.current.setState(e=>(0,m.Z)({},e,{columnGrouping:{lookup:c,unwrappedGroupingModel:d,headerStructure:p,maxDepth:h}}))},[e,null==(n=t.experimentalFeatures)?void 0:n.columnGrouping]);(0,ew.zn)(e,"columnIndexChange",o),(0,ew.zn)(e,"columnsChange",()=>{i(t.columnGroupingModel)}),(0,ew.zn)(e,"columnVisibilityModelChange",()=>{i(t.columnGroupingModel)}),b.useEffect(()=>{i(t.columnGroupingModel)},[i,t.columnGroupingModel])},ij=(e,t)=>{let n={enabled:!t.disableVirtualization,enabledForColumns:!0};return(0,m.Z)({},e,{virtualization:n})},iL=e=>e.headerFiltering,iH=(0,$.P1)(iL,e=>e.editing),iB=(0,$.P1)(iL,e=>e.menuOpen),iN=({currentColIndex:e,firstColIndex:t,lastColIndex:n,direction:r})=>{if("rtl"===r){if(e<n)return e+1}else if("ltr"===r&&e>t)return e-1;return null},iV=({currentColIndex:e,firstColIndex:t,lastColIndex:n,direction:r})=>{if("rtl"===r){if(e>t)return e-1}else if("ltr"===r&&e<n)return e+1;return null},i$=(e,t)=>{let n=eG(e,"useGridKeyboardNavigation"),r=td(e,t).rows,l=(0,eQ.Z)(),o=b.useMemo(()=>(function(e,t){let n=(0,Y.Kf)(e)||{};return[...n.top||[],...t,...n.bottom||[]]})(e,r),[e,r]),i="DataGrid"!==t.signature&&t.unstable_headerFilters,a=b.useCallback((t,r,l="left")=>{let o=(0,ei.D7)(e),i=e.current.unstable_getCellColSpanInfo(r,t);i&&i.spannedByColSpan&&("left"===l?t=i.leftVisibleCellIndex:"right"===l&&(t=i.rightVisibleCellIndex));let a=o.findIndex(e=>e.id===r);n.debug(`Navigating to cell row ${a}, col ${t}`),e.current.scrollToIndexes({colIndex:t,rowIndex:a});let s=e.current.getVisibleColumns()[t].field;e.current.setCellFocus(r,s)},[e,n]),s=b.useCallback((t,r)=>{n.debug(`Navigating to header col ${t}`),e.current.scrollToIndexes({colIndex:t});let l=e.current.getVisibleColumns()[t].field;e.current.setColumnHeaderFocus(l,r)},[e,n]),u=b.useCallback((t,r)=>{n.debug(`Navigating to header filter col ${t}`),e.current.scrollToIndexes({colIndex:t});let l=e.current.getVisibleColumns()[t].field;e.current.setColumnHeaderFilterFocus(l,r)},[e,n]),c=b.useCallback((t,r,l)=>{n.debug(`Navigating to header col ${t}`),e.current.scrollToIndexes({colIndex:t});let{field:o}=e.current.getVisibleColumns()[t];e.current.setColumnGroupHeaderFocus(o,r,l)},[e,n]),d=b.useCallback(e=>{var t;return null==(t=o[e])?void 0:t.id},[o]),p=b.useCallback((t,n)=>{let r=n.currentTarget.querySelector(`.${z._.columnHeaderTitleContainerContent}`);if(r&&r.contains(n.target)&&t.field!==eO.n.field||!e.current.getRootDimensions())return;let p=e.current.getViewportPageSize(),h=t.field?e.current.getColumnIndex(t.field):0,f=o.length>0?0:null,g=o.length-1,m=(0,V.FE)(e).length-1,b=K(e),v=!0;switch(n.key){case"ArrowDown":null!==f&&(i?u(h,n):a(h,d(f)));break;case"ArrowRight":{let e=iV({currentColIndex:h,firstColIndex:0,lastColIndex:m,direction:l.direction});null!==e&&s(e,n);break}case"ArrowLeft":{let e=iN({currentColIndex:h,firstColIndex:0,lastColIndex:m,direction:l.direction});null!==e&&s(e,n);break}case"ArrowUp":b>0&&c(h,b-1,n);break;case"PageDown":null!==f&&null!==g&&a(h,d(Math.min(f+p,g)));break;case"Home":s(0,n);break;case"End":s(m,n);break;case"Enter":(n.ctrlKey||n.metaKey)&&e.current.toggleColumnMenu(t.field);break;case" ":break;default:v=!1}v&&n.preventDefault()},[e,o.length,i,u,a,d,l.direction,s,c]),h=b.useCallback((t,n)=>{if(!e.current.getRootDimensions())return;let r=iH(e)===t.field,i=iB(e)===t.field;if(r||i||!(0,tu.Ni)(n.key))return;let c=e.current.getViewportPageSize(),p=t.field?e.current.getColumnIndex(t.field):0,h=o.length-1,f=(0,V.FE)(e).length-1,g=!0;switch(n.key){case"ArrowDown":{let e=d(0);null!=e&&a(p,e);break}case"ArrowRight":{let e=iV({currentColIndex:p,firstColIndex:0,lastColIndex:f,direction:l.direction});null!==e&&u(e,n);break}case"ArrowLeft":{let r=iN({currentColIndex:p,firstColIndex:0,lastColIndex:f,direction:l.direction});null!==r?u(r,n):e.current.setColumnHeaderFilterFocus(t.field,n);break}case"ArrowUp":s(p,n);break;case"PageDown":null!==h&&a(p,d(Math.min(0+c,h)));break;case"Home":u(0,n);break;case"End":u(f,n);break;case" ":break;default:g=!1}g&&n.preventDefault()},[e,o.length,u,l.direction,s,a,d]),f=b.useCallback((t,n)=>{if(!e.current.getRootDimensions())return;let r=(0,es.Gs)(e);if(null===r)return;let{field:l,depth:i}=r,{fields:u,depth:p,maxDepth:h}=t,f=e.current.getViewportPageSize(),g=e.current.getColumnIndex(l),m=l?e.current.getColumnIndex(l):0,b=o.length-1,v=(0,V.FE)(e).length-1,y=!0;switch(n.key){case"ArrowDown":p===h-1?s(g,n):c(g,i+1,n);break;case"ArrowUp":p>0&&c(g,i-1,n);break;case"ArrowRight":{let e=u.length-u.indexOf(l)-1;g+e+1<=v&&c(g+e+1,i,n);break}case"ArrowLeft":{let e=u.indexOf(l);g-e-1>=0&&c(g-e-1,i,n);break}case"PageDown":null!==b&&a(m,d(Math.min(0+f,b)));break;case"Home":c(0,i,n);break;case"End":c(v,i,n);break;case" ":break;default:y=!1}y&&n.preventDefault()},[e,o.length,s,c,a,d]),g=b.useCallback((t,n)=>{if(tm(n))return;let r=e.current.getCellParams(t.id,t.field);if(r.cellMode===ta.Edit||!(0,tu.Ni)(n.key)||!e.current.unstable_applyPipeProcessors("canU
9pdateFocus",!0,{event:n,cell:r}))return;let c=e.current.getRootDimensions();if(0===o.length||!c)return;let p=l.direction,h=e.current.getViewportPageSize(),f=t.field?e.current.getColumnIndex(t.field):0,g=o.findIndex(e=>e.id===t.id),m=o.length-1,b=(0,V.FE)(e).length-1,v=!0;switch(n.key){case"ArrowDown":g<m&&a(f,d(g+1));break;case"ArrowUp":g>0?a(f,d(g-1)):i?u(f,n):s(f,n);break;case"ArrowRight":{let e=iV({currentColIndex:f,firstColIndex:0,lastColIndex:b,direction:p});null!==e&&a(e,d(g),"rtl"===p?"left":"right");break}case"ArrowLeft":{let e=iN({currentColIndex:f,firstColIndex:0,lastColIndex:b,direction:p});null!==e&&a(e,d(g),"rtl"===p?"right":"left");break}case"Tab":n.shiftKey&&f>0?a(f-1,d(g),"left"):!n.shiftKey&&f<b&&a(f+1,d(g),"right");break;case" ":{if(t.field===tp)break;let e=t.colDef;if(e&&"treeDataGroup"===e.type)break;!n.shiftKey&&g<m&&a(f,d(Math.min(g+h,m)));break}case"PageDown":g<m&&a(f,d(Math.min(g+h,m)));break;case"PageUp":{let e=Math.max(g-h,0);e!==g&&e>=0?a(f,d(e)):s(f,n);break}case"Home":n.ctrlKey||n.metaKey||n.shiftKey?a(0,d(0)):a(0,d(g));break;case"End":n.ctrlKey||n.metaKey||n.shiftKey?a(b,d(m)):a(b,d(g));break;default:v=!1}v&&n.preventDefault()},[e,o,l.direction,a,d,i,u,s]);eA(e,"canStartEditing",b.useCallback((e,{event:t})=>" "!==t.key&&e,[])),(0,ew.zn)(e,"columnHeaderKeyDown",p),(0,ew.zn)(e,"headerFilterKeyDown",h),(0,ew.zn)(e,"columnGroupHeaderKeyDown",f),(0,ew.zn)(e,"cellKeyDown",g)},iU=e=>{let t=b.useRef({}),n=b.useCallback((e,n,r)=>{let l=t.current;l[e]||(l[e]={}),l[e][n]=r},[]),r=b.useCallback((e,n)=>{var r;return null==(r=t.current[e])?void 0:r[n]},[]),l=b.useCallback(t=>{let{columnIndex:r,rowId:l,minFirstColumnIndex:o,maxLastColumnIndex:i,columns:a}=t,s=a.length,u=a[r],c="function"==typeof u.colSpan?u.colSpan(e.current.getCellParams(l,u.field)):u.colSpan;if(!c||1===c)return n(l,r,{spannedByColSpan:!1,cellProps:{colSpan:1,width:u.computedWidth}}),{colSpan:1};let d=u.computedWidth;for(let e=1;e<c;e+=1){let t=r+e;t>=o&&t<i&&(d+=a[t].computedWidth,n(l,r+e,{spannedByColSpan:!0,rightVisibleCellIndex:Math.min(r+c,s-1),leftVisibleCellIndex:r})),n(l,r,{spannedByColSpan:!1,cellProps:{colSpan:c,width:d}})}return{colSpan:c}},[e,n]),o=b.useCallback(({rowId:e,minFirstColumn:t,maxLastColumn:n,columns:r})=>{for(let o=t;o<n;o+=1){let i=l({columnIndex:o,rowId:e,minFirstColumnIndex:t,maxLastColumnIndex:n,columns:r});i.colSpan>1&&(o+=i.colSpan-1)}},[l]);eh(e,{unstable_getCellColSpanInfo:r},"public"),eh(e,{calculateColSpan:o},"private");let i=b.useCallback(()=>{t.current={}},[]);(0,ew.zn)(e,"columnOrderChange",i)};function iG(e){let{clientHeight:t,scrollTop:n,offsetHeight:r,offsetTop:l}=e,o=l+r;return r>t?l:o-t>n?o-t:l<n?l:void 0}let iq=(e,t)=>{let n=(0,eQ.Z)(),r=eG(e,"useGridScroll"),l=e.current.columnHeadersElementRef,o=e.current.virtualScrollerRef,i=(0,C.P)(e,ei.D7),a=b.useCallback(n=>{var l,a,s;let u=(0,Y.hh)(e),c=(0,V.FE)(e);if(null!=n.rowIndex&&0===u||0===c.length)return!1;r.debug(`Scrolling to cell at row ${n.rowIndex}, col: ${n.colIndex} `);let d={};if(null!=n.colIndex){let t;let r=(0,V.Ag)(e);if(void 0!==n.rowIndex){let r=null==(l=i[n.rowIndex])?void 0:l.id,o=e.current.unstable_getCellColSpanInfo(r,n.colIndex);o&&!o.spannedByColSpan&&(t=o.cellProps.width)}void 0===t&&(t=c[n.colIndex].computedWidth),d.left=iG({clientHeight:o.current.clientWidth,scrollTop:Math.abs(o.current.scrollLeft),offsetHeight:t,offsetTop:r[n.colIndex]})}if(null!=n.rowIndex){let r=ol(e.current.state),l=(0,eY.bu)(e),i=(0,eY.B_)(e),u=t.pagination?n.rowIndex-l*i:n.rowIndex,c=r.positions[u+1]?r.positions[u+1]-r.positions[u]:r.currentPageTotalHeight-r.positions[u],p=(null==(a=o.current.querySelector(`.${z._["pinnedRows--top"]}`))?void 0:a.clientHeight)||0,h=(null==(s=o.current.querySelector(`.${z._["pinnedRows--bottom"]}`))?void 0:s.clientHeight)||0;d.top=iG({clientHeight:o.current.clientHeight-p-h,scrollTop:o.current.scrollTop,offsetHeight:c,offsetTop:r.positions[u]})}return(d=e.current.unstable_applyPipeProcessors("scrollToIndexes",d,n)).left,e.current.scroll(d),!0},[r,e,o,t.pagination,i]);eh(e,{scroll:b.useCallback(e=>{if(o.current&&null!=e.left&&l.current){let t="rtl"===n.direction?-1:1;l.current.scrollLeft=e.left,o.current.scrollLeft=t*e.left,r.debug(`Scrolling left: ${e.left}`)}o.current&&null!=e.top&&(o.current.scrollTop=e.top,r.debug(`Scrolling top: ${e.top}`)),r.debug("Scrolling, updating container, and viewport")},[o,n.direction,l,r]),scrollToIndexes:a,getScrollPosition:b.useCallback(()=>null!=o&&o.current?{top:o.current.scrollTop,left:o.current.scrollLeft}:{top:0,left:0},[o])},"public")};function iW(e,t){if("string"==typeof e&&(t.shouldAppendQuotes||t.escapeFormulas)){let n=e.replace(/"/g,'""');return[t.delimiter,"\n","\r",'"'].some(t=>e.includes(t))?`"${n}"`:t.escapeFormulas&&["=","+","-","@","	","\r"].includes(n[0])?`'${n}`:n}return e}let iK=(e,t)=>{let n;let{csvOptions:r,ignoreValueFormatter:l}=t;if(l){var o,i;let t=e.colDef.type;n="number"===t?String(e.value):"date"===t||"dateTime"===t?null==(i=e.value)?void 0:i.toISOString():"function"==typeof(null==(o=e.value)?void 0:o.toString)?e.value.toString():e.value}else n=e.formattedValue;return iW(n,r)};(0,nl.b)(["MUI: When the value of a field is an object or a `renderCell` is provided, the CSV export might not display the value correctly.","You can provide a `valueFormatter` with a string representation to be used."]);class iY{constructor(e){this.options=void 0,this.rowString="",this.isEmpty=!0,this.options=e}addValue(e){this.isEmpty||(this.rowString+=this.options.csvOptions.delimiter),null==e?this.rowString+="":"function"==typeof this.options.sanitizeCellValue?this.rowString+=this.options.sanitizeCellValue(e,this.options.csvOptions):this.rowString+=e,this.isEmpty=!1}getRowString(){return this.rowString}}let iX=({id:e,columns:t,getCellParams:n,csvOptions:r,ignoreValueFormatter:l})=>{let o=new iY({csvOptions:r});return t.forEach(t=>{let i=n(e,t.field);o.addValue(iK(i,{ignoreValueFormatter:l,csvOptions:r}))}),o.getRowString()},iJ=({apiRef:e,options:t})=>{let n=(0,V.d$)(e);
9return t.fields?t.fields.reduce((e,t)=>{let r=n.find(e=>e.field===t);return r&&e.push(r),e},[]):(t.allColumns?n:(0,V.FE)(e)).filter(e=>!e.disableExport)},iQ=({apiRef:e})=>{var t,n;let r=(0,ei.Lp)(e),l=(0,Y.Kd)(e),o=e.current.getSelectedRows(),i=r.filter(e=>"footer"!==l[e].type),a=(0,Y.Kf)(e),s=(null==a||null==(t=a.top)?void 0:t.map(e=>e.id))||[],u=(null==a||null==(n=a.bottom)?void 0:n.map(e=>e.id))||[];return(i.unshift(...s),i.push(...u),o.size>0)?i.filter(e=>o.has(e)):i},i0=["hideMenu","options"],i1=["hideMenu","options"];function i2(e){let t=(0,e5.l)(),{hideMenu:n,options:r}=e,l=(0,M.Z)(e,i0);return(0,_.jsx)(rc.Z,(0,m.Z)({onClick:()=>{t.current.exportDataAsCsv(r),null==n||n()}},l,{children:t.current.getLocaleText("toolbarExportCSV")}))}function i3(e){let t=(0,e5.l)(),{hideMenu:n,options:r}=e,l=(0,M.Z)(e,i1);return(0,_.jsx)(rc.Z,(0,m.Z)({onClick:()=>{t.current.exportDataAsPrint(r),null==n||n()}},l,{children:t.current.getLocaleText("toolbarExportPrint")}))}let i4=(e,t)=>{let n=eG(e,"useGridCsvExport"),r=t.unstable_ignoreValueFormatterDuringExport,l=("object"==typeof r?null==r?void 0:r.csvExport:r)||!1,o=b.useCallback((t={})=>{var r,o,i,a,s;return n.debug("Get data as CSV"),function(e){let{columns:t,rowIds:n,csvOptions:r,ignoreValueFormatter:l,apiRef:o}=e,i=n.reduce((e,n)=>`${e}${iX({id:n,columns:t,getCellParams:o.current.getCellParams,ignoreValueFormatter:l,csvOptions:r})}\r
10`,"").trim();if(!r.includeHeaders)return i;let a=t.filter(e=>e.field!==eO.n.field),s=[];if(r.includeColumnGroupsHeaders){let e=o.current.unstable_getAllGroupDetails(),t=0,n=a.reduce((e,n)=>{let r=o.current.unstable_getColumnGroupPath(n.field);return e[n.field]=r,t=Math.max(t,r.length),e},{});for(let l=0;l<t;l+=1){let t=new iY({csvOptions:r,sanitizeCellValue:iW});s.push(t),a.forEach(r=>{let o=e[(n[r.field]||[])[l]];t.addValue(o?o.headerName||o.groupId:"")})}}let u=new iY({csvOptions:r,sanitizeCellValue:iW});a.forEach(e=>{u.addValue(e.headerName||e.field)}),s.push(u);let c=`${s.map(e=>e.getRowString()).join("\r\n")}\r
11`;return`${c}${i}`.trim()}({columns:iJ({apiRef:e,options:t}),rowIds:(null!=(r=t.getRowsToExport)?r:iQ)({apiRef:e}),csvOptions:{delimiter:t.delimiter||",",shouldAppendQuotes:null==(o=t.shouldAppendQuotes)||o,includeHeaders:null==(i=t.includeHeaders)||i,includeColumnGroupsHeaders:null==(a=t.includeColumnGroupsHeaders)||a,escapeFormulas:null==(s=t.escapeFormulas)||s},ignoreValueFormatter:l,apiRef:e})},[n,e,l]),i=b.useCallback(e=>{n.debug("Export data as CSV");let t=o(e);!function(e,t="csv",n=document.title||"untitled"){let r=`${n}.${t}`;if("download"in HTMLAnchorElement.prototype){let t=URL.createObjectURL(e),n=document.createElement("a");n.href=t,n.download=r,n.click(),setTimeout(()=>{URL.revokeObjectURL(t)});return}throw Error("MUI: exportAs not supported")}(new Blob([null!=e&&e.utf8WithBom?new Uint8Array([239,187,191]):"",t],{type:"text/csv"}),"csv",null==e?void 0:e.fileName)},[n,o]);eh(e,{getDataAsCsv:o,exportDataAsCsv:i},"public"),eA(e,"exportMenu",b.useCallback((e,t)=>{var n;return null!=(n=t.csvOptions)&&n.disableToolbarButton?e:[...e,{component:(0,_.jsx)(i2,{options:t.csvOptions}),componentName:"csvExport"}]},[]))},i5=(e,t)=>{let n=eG(e,"useGridPrintExport"),r=b.useRef(null),l=b.useRef(null),o=b.useRef({}),i=b.useRef([]);b.useEffect(()=>{r.current=(0,nb.Z)(e.current.rootElementRef.current)},[e]);let a=b.useCallback((t,n,r)=>new Promise(l=>{let o=iJ({apiRef:e,options:{fields:t,allColumns:n}}).map(e=>e.field),i=(0,V.d$)(e),a={};i.forEach(e=>{a[e.field]=o.includes(e.field)}),r&&(a[eO.n.field]=!0),e.current.setColumnVisibilityModel(a),l()}),[e]),s=b.useCallback(t=>{let n=t({apiRef:e}).map(t=>e.current.getRow(t));e.current.setRows(n)},[e]),u=b.useCallback((n,l)=>{var o,i,a,s;let u=(0,m.Z)({copyStyles:!0,hideToolbar:!1,hideFooter:!1,includeCheckboxes:!1},l),c=n.contentDocument;if(!c)return;let d=ol(e.current.state),p=e.current.rootElementRef.current,h=p.cloneNode(!0);h.querySelector(`.${z._.main}`).style.overflow="visible",h.style.contain="size",h.querySelector(`.${z._.columnHeaders}`).querySelector(`.${z._.columnHeadersInner}`).style.width="100%";let f=(null==(o=p.querySelector(`.${z._.toolbarContainer}`))?void 0:o.offsetHeight)||0,g=(null==(i=p.querySelector(`.${z._.footerContainer}`))?void 0:i.offsetHeight)||0;u.hideToolbar&&(null==(a=h.querySelector(`.${z._.toolbarContainer}`))||a.remove(),f=0),u.hideFooter&&(null==(s=h.querySelector(`.${z._.footerContainer}`))||s.remove(),g=0);let b=d.currentPageTotalHeight+t9(e,t.columnHeaderHeight)+f+g;if(h.style.height=`${b}px`,h.style.boxSizing="content-box",null!=l&&l.getRowsToExport){let e=h.querySelector(`.${z._.footerContainer}`);e.style.position="absolute",e.style.width="100%",e.style.top=`${b-g}px`}let v=document.createElement("div");v.appendChild(h),c.body.innerHTML=v.innerHTML;let y="function"==typeof u.pageStyle?u.pageStyle():u.pageStyle;
11if("string"==typeof y){let e=c.createElement("style");e.appendChild(c.createTextNode(y)),c.head.appendChild(e)}u.bodyClassName&&c.body.classList.add(...u.bodyClassName.split(" "));let x=[];if(u.copyStyles){let e=p.getRootNode(),t=("ShadowRoot"===e.constructor.name?e:r.current).querySelectorAll("style, link[rel='stylesheet']");for(let e=0;e<t.length;e+=1){let n=t[e];if("STYLE"===n.tagName){let e=c.createElement(n.tagName),t=n.sheet;if(t){let n="";for(let e=0;e<t.cssRules.length;e+=1)"string"==typeof t.cssRules[e].cssText&&(n+=`${t.cssRules[e].cssText}\r
12`);e.appendChild(c.createTextNode(n)),c.head.appendChild(e)}}else if(n.getAttribute("href")){let e=c.createElement(n.tagName);for(let t=0;t<n.attributes.length;t+=1){let r=n.attributes[t];r&&e.setAttribute(r.nodeName,r.nodeValue||"")}x.push(new Promise(t=>{e.addEventListener("load",()=>t())})),c.head.appendChild(e)}}}Promise.all(x).then(()=>{n.contentWindow.print()})},[e,r,t.columnHeaderHeight]),c=b.useCallback(t=>{var n;r.current.body.removeChild(t),e.current.restoreState(l.current||{}),null!=(n=l.current)&&null!=(n=n.columns)&&n.columnVisibilityModel||e.current.setColumnVisibilityModel(o.current),e.current.unstable_setVirtualization(!0),e.current.setRows(i.current),l.current=null,o.current={},i.current=[]},[e]),d=b.useCallback(async d=>{if(n.debug("Export data as Print"),!e.current.rootElementRef.current)throw Error("MUI: No grid root element available.");l.current=e.current.exportState(),o.current=(0,V.g0)(e);let p=(0,Y.J4)(e);if(i.current=(0,Y.yM)(e).map(e=>p[e]),t.pagination){let t={page:0,pageSize:(0,ei.IQ)(e)};e.current.setState(e=>(0,m.Z)({},e,{pagination:(0,m.Z)({},e.pagination,{paginationModel:nj(e.pagination,"DataGridPro",t)})})),e.current.forceUpdate()}await a(null==d?void 0:d.fields,null==d?void 0:d.allColumns,null==d?void 0:d.includeCheckboxes),null!=d&&d.getRowsToExport&&s(d.getRowsToExport),e.current.unstable_setVirtualization(!1),await new Promise(e=>{requestAnimationFrame(()=>{e()})});let h=function(e){let t=document.createElement("iframe");return t.style.position="absolute",t.style.width="0px",t.style.height="0px",t.title=e||document.title,t}(null==d?void 0:d.fileName);h.onload=()=>{u(h,d),h.contentWindow.matchMedia("print").addEventListener("change",e=>{!1===e.matches&&c(h)})},r.current.body.appendChild(h)},[t,n,e,u,c,a,s]);eh(e,{exportDataAsPrint:d},"public"),eA(e,"exportMenu",b.useCallback((e,t)=>{var n;return null!=(n=t.printOptions)&&n.disableToolbarButton?e:[...e,{component:(0,_.jsx)(i3,{options:t.printOptions}),componentName:"printExport"}]},[]))},i9=(e,t,n,r,l)=>{let o=eG(e,"useNativeEventListener"),[i,a]=b.useState(!1),s=b.useRef(r),u=b.useCallback(e=>s.current&&s.current(e),[]);b.useEffect(()=>{s.current=r},[r]),b.useEffect(()=>{let r;(r=(0,ep.mf)(t)?t():t&&t.current?t.current:null)&&n&&!i&&(o.debug(`Binding native ${n} event`),r.addEventListener(n,u,l),a(!0),e.current.subscribeEvent("unmount",()=>{o.debug(`Clearing native ${n} event`),r.removeEventListener(n,u,l)}))},[t,u,n,i,o,l,e])};function i6(e){let t=document.createElement("span");t.style.whiteSpace="pre",t.style.userSelect="all",t.style.opacity="0px",t.textContent=e,document.body.appendChild(t);let n=document.createRange();n.selectNode(t);let r=window.getSelection();r.removeAllRanges(),r.addRange(n);try{document.execCommand("copy")}finally{document.body.removeChild(t)}}let i8=(e,t)=>{let n=t.unstable_ignoreValueFormatterDuringExport,r=("object"==typeof n?null==n?void 0:n.clipboardExport:n)||!1,l=t.clipboardCopyCellDelimiter,o=b.useCallback(t=>{var n,o,i;if(!((t.ctrlKey||t.metaKey)&&"c"===t.key)||(n=t.target,null!=(o=window.getSelection())&&o.toString()||n&&(n.selectionEnd||0)-(n.selectionStart||0)>0))return;let a="";if(e.current.getSelectedRows().size>0)a=e.current.getDataAsCsv({includeHeaders:!1,delimiter:l,shouldAppendQuotes:!1,escapeFormulas:!1});else{let t=(0,es.TR)(e);t&&(a=iK(e.current.getCellParams(t.id,t.field),{csvOptions:{delimiter:l,shouldAppendQuotes:!1,escapeFormulas:!1},ignoreValueFormatter:r}))}(a=e.current.unstable_applyPipeProcessors("clipboardCopy",a))&&(i=a,navigator.clipboard?navigator.clipboard.writeText(i).catch(()=>{i6(i)}):i6(i),e.current.publishEvent("clipboardCopy",a))},[e,r,l]);i9(e,e.current.rootElementRef,"keydown",o),(0,ew.x3)(e,"clipboardCopy",t.onClipboardCopy)};var i7=n(74161);let ae=({content:e,container:t,scrollBarSize:n})=>{let r=e.width>t.width,l=e.height>t.height,o=!1,i=!1;return(r||l)&&(o=r,(i=e.height+(o?n:0)>t.height)&&(o=e.width+n>t.width)),{hasScrollX:o,hasScrollY:i}},at=e=>{let t=b.useCallback((t={})=>e.current.unstable_applyPipeProcessors("exportState",{},t),[e]),n=b.useCallback(t=>{e.current.unstable_applyPipeProcessors("restoreState",{callbacks:[]},{stateToRestore:t}
12).callbacks.forEach(e=>{e()}),e.current.forceUpdate()},[e]);eh(e,{exportState:t,restoreState:n},"public")},an=(e,t)=>{let n=(0,C.P)(e,V.FE),r=td(e,t),l=Math.max((0,C.P)(e,ol).currentPageTotalHeight,1),o=b.useRef(!1),i=b.useCallback(i=>{let a=e.current.getRootDimensions();if(!a||"client"!==t.rowsLoadingMode)return;let s=i.top+a.viewportOuterSize.height,u=e.current.getViewportPageSize();if(s<l-t.scrollEndThreshold&&(o.current=!1),s>=l-t.scrollEndThreshold&&!o.current){let t={visibleColumns:n,viewportPageSize:u,visibleRowsCount:r.rows.length};e.current.publishEvent("rowsScrollEnd",t),o.current=!0}},[l,t.scrollEndThreshold,t.rowsLoadingMode,n,e,r.rows.length]),a=b.useCallback(({left:e,top:t})=>{i({left:e,top:t})},[i]);(0,ew.zn)(e,"scrollPositionChange",a),(0,ew.x3)(e,"rowsScrollEnd",t.onRowsScrollEnd)},ar=(0,$.P1)(e=>e.columnReorder,e=>e.dragCol),al="left",ao="right",ai=(e,t)=>e.x<=t.x?ao:al,aa=(e,t)=>e.x!==t.x||e.y!==t.y,as=e=>{let{classes:t}=e;return(0,Z.Z)({columnHeaderDragging:["columnHeader--dragging"]},z.d,t)},au=e=>(0,m.Z)({},e,{columnReorder:{dragCol:""}}),ac=(e,t)=>{let n=eG(e,"useGridColumnReorder"),r=b.useRef(null),l=b.useRef({x:0,y:0}),o=b.useRef(null),i=b.useRef({}),a=b.useRef(),s=as({classes:t.classes}),u=(0,eQ.Z)();b.useEffect(()=>()=>{clearTimeout(a.current)},[]);let c=b.useCallback((l,u)=>{if(t.disableColumnReorder||l.colDef.disableReorder)return;n.debug(`Start dragging col ${l.field}`),u.stopPropagation(),r.current=u.currentTarget,r.current.classList.add(s.columnHeaderDragging),u.dataTransfer&&(u.dataTransfer.effectAllowed="move"),e.current.setState(e=>(0,m.Z)({},e,{columnReorder:(0,m.Z)({},e.columnReorder,{dragCol:l.field})})),e.current.forceUpdate(),a.current=setTimeout(()=>{r.current.classList.remove(s.columnHeaderDragging)}),o.current=e.current.getColumnIndex(l.field,!1);let c=e.current.unstable_getColumnGroupPath(l.field),d=o.current,p=e.current.getAllColumns(),h=e.current.unstable_getAllGroupDetails(),f=t=>{let n=p[t].field;return e.current.unstable_getColumnGroupPath(n)},g=null;c.forEach(e=>{var t;!(null!=(t=h[e])&&t.freeReordering)&&(d>0&&f(d-1).includes(e)?g=e:d+1<p.length&&f(d+1).includes(e)&&(g=e))}),i.current={};for(let e=0;e<p.length;e+=1){let t=e<=d?e-1:e,n=e<d?e:e+1;if(null!==g){let r=!1;t>=0&&f(t).includes(g)?r=!0:n<p.length&&f(n).includes(g)&&(r=!0),r||(i.current[e]=!0)}t>=0&&n<p.length&&f(n).forEach(n=>{if(f(t).includes(n)&&!c.includes(n)){var r;null!=(r=h[n])&&r.freeReordering||(i.current[e]=!0)}})}},[t.disableColumnReorder,s.columnHeaderDragging,n,e]),d=b.useCallback((e,t)=>{t.preventDefault(),t.stopPropagation()},[]),p=b.useCallback((t,r)=>{let o=ar(e);if(!o)return;n.debug(`Dragging over col ${t.field}`),r.preventDefault(),r.stopPropagation();let a={x:r.clientX,y:r.clientY};if(t.field!==o&&aa(l.current,a)){let n=e.current.getColumnIndex(t.field,!1),r=e.current.getColumnIndex(t.field,!0),s=e.current.getColumn(t.field),c=e.current.getColumnIndex(o,!1),d=e.current.getVisibleColumns(),p=e.current.getAllColumns(),h=ai(l.current,a),f=h===al&&("rtl"===u.direction?c<n:n<c),g=h===ao&&("rtl"===u.direction?n<c:c<n);if(f||g){let t;let l=0;if(t=!s.disableReorder||(f?r>0&&!d[r-1].disableReorder:r<d.length-1&&!d[r+1].disableReorder),i.current[n]){let e;let o=n+l;if(f)for(e=r>0?d[r-1].field:null;o>0&&p[o].field!==e&&i.current[o];)l-=1,o=n+l;else for(e=r+1<d.length?d[r+1].field:null;o<p.length-1&&p[o].field!==e&&i.current[o];)l+=1,o=n+l;(i.current[o]||p[o].field===e)&&(t=!1)}e.current.unstable_applyPipeProcessors("canBeReordered",t,{targetIndex:r})&&e.current.setColumnIndex(o,n+l)}l.current=a}},[e,n,u.direction]),h=b.useCallback((l,i)=>{let s=ar(e);if(!t.disableColumnReorder&&s){if(n.debug("End dragging col"),i.preventDefault(),i.stopPropagation(),clearTimeout(a.current),r.current=null,"none"!==i.dataTransfer.dropEffect||t.keepColumnPositionIfDraggedOutside){let t={column:e.current.getColumn(s),targetIndex:e.current.getColumnIndexRelativeToVisibleColumns(s),oldIndex:o.current};e.current.publishEvent("columnOrderChange",t)}else e.current.setColumnIndex(s,o.current),o.current=null;e.current.setState(e=>(0,m.Z)({},e,{columnReorder:(0,m.Z)({},e.columnReorder,{dragCol:""})})),e.current.forceUpdate()}},[t.disableColumnReorder,t.keepColumnPositionIfDraggedOutside,n,e]);(0,ew.zn)(e,"columnHeaderDragStart",c),(0,ew.zn)(e,"columnHeaderDragEnter",d),(0,ew.zn)(e,"columnHeaderDragOver",p),(0,ew.zn)(e,"columnHeaderDragEnd",h),(0,ew.zn)(e,"cellDragEnter",d),(0,ew.zn)(e,"cellDragOver",p),(0,ew.x3)(e,"columnOrderChange",t.onColumnOrderChange)};var ad=n(80229);function ap(e,t){var n;return Array.from(null!=(n=e.querySelectorAll(`[data-fields*="|-${t}-|"]`))?n:[])}function ah(e,t){var n,r;if(!th(e,z._.root))throw Error("MUI: The root element is not found.");let l=e.getAttribute("aria-colindex");if(!l)return[];let o=Number(l)-1,i=[];return null!=(n=t.virtualScrollerRef)&&n.current?((null==(r=t.virtualScrollerRef)?void 0:r.current.querySelectorAll(`:scope > div > div > .${z._.row}
12`)).forEach(e=>{let n=e.getAttribute("data-id");if(!n)return;let r=o,l=t.unstable_getCellColSpanInfo(n,o);l&&l.spannedByColSpan&&(r=l.leftVisibleCellIndex);let a=e.querySelector(`[data-colindex="${r}"]`);a&&i.push(a)}),i):[]}let af={includeHeaders:!0,includeOutliers:!1,outliersFactor:1.5,expand:!1},ag=!1;function am(){return void 0===ag&&("undefined"!=typeof CSS&&"function"==typeof CSS.supports?ag=CSS.supports("touch-action","none"):ag=!0),ag}function ab(e,t){if(void 0!==t&&e.changedTouches){for(let n=0;n<e.changedTouches.length;n+=1){let r=e.changedTouches[n];if(r.identifier===t)return{x:r.clientX,y:r.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function av(e,t,n,r){let l=e;return"Right"===r?l+=t-n.left:l+=n.right-t,l}function ay(e,t,n){return"Left"===n?e-t.left:t.right-e}function ax(e,t){let n=e.classList.contains(z._["columnSeparator--sideRight"])?"Right":"Left";return"rtl"===t?"Right"===n?"Left":"Right":n}function aw(e){e.preventDefault(),e.stopImmediatePropagation()}let aC=e=>(0,m.Z)({},e,{columnResize:{resizingColumnField:""}}),aS=(e,t)=>{let n=eG(e,"useGridColumnResize"),r=b.useRef(),l=b.useRef(),o=b.useRef(),i=b.useRef(),a=b.useRef(),s=(0,eQ.Z)(),u=b.useRef(),c=b.useRef(),d=(0,tI.K)(),p=b.useRef(),h=e=>{n.debug(`Updating width to ${e} for col ${r.current.field}`);let t=e-l.current.offsetWidth;r.current.computedWidth=e,r.current.width=e,r.current.flex=0,l.current.style.width=`${e}px`,l.current.style.minWidth=`${e}px`,l.current.style.maxWidth=`${e}px`;let s=o.current;s&&(s.style.width=`${e}px`,s.style.minWidth=`${e}px`,s.style.maxWidth=`${e}px`),[...a.current,...i.current].forEach(n=>{let r;r="1"===n.getAttribute("aria-colspan")?`${e}px`:`${n.offsetWidth+t}px`,n.style.width=r,n.style.minWidth=r,n.style.maxWidth=r})},f=t=>{S(),r.current&&(e.current.setColumnWidth(r.current.field,r.current.width),n.debug(`Updating col ${r.current.field} with new width: ${r.current.width}`)),d.start(0,()=>{e.current.publishEvent("columnResizeStop",null,t)})},g=(0,nn.Z)(f),v=(0,nn.Z)(t=>{if(0===t.buttons){g(t);return}let n=av(u.current,t.clientX,l.current.getBoundingClientRect(),c.current);h(n=(0,ep.uZ)(n,r.current.minWidth,r.current.maxWidth));let o={element:l.current,colDef:r.current,width:n};e.current.publishEvent("columnResize",o,t)}),y=(0,nn.Z)(e=>{ab(e,p.current)&&f(e)}),x=(0,nn.Z)(t=>{let n=ab(t,p.current);if(!n)return;if("mousemove"===t.type&&0===t.buttons){y(t);return}let o=av(u.current,n.x,l.current.getBoundingClientRect(),c.current);h(o=(0,ep.uZ)(o,r.current.minWidth,r.current.maxWidth));let i={element:l.current,colDef:r.current,width:o};e.current.publishEvent("columnResize",i,t)}),w=(0,nn.Z)(t=>{var o,d,h,f;if(!th(t.target,z._["columnSeparator--resizable"]))return;am()||t.preventDefault();let g=t.changedTouches[0];null!=g&&(p.current=g.identifier),l.current=th(t.target,z._.columnHeader);let m=l.current.getAttribute("data-field"),b=e.current.getColumn(m);i.current=ap(null==(o=e.current.columnHeadersContainerElementRef)?void 0:o.current,m),n.debug(`Start Resize on col ${b.field}`),e.current.publishEvent("columnResizeStart",{field:m},t),r.current=b,l.current=(h=null==(d=e.current.columnHeadersElementRef)?void 0:d.current,f=b.field,h.querySelector(`[data-field="${f}"]`)),a.current=ah(l.current,e.current),c.current=ax(t.target,s.direction),u.current=ay(g.clientX,l.current.getBoundingClientRect(),c.current);let v=(0,nb.Z)(t.currentTarget);v.addEventListener("touchmove",x),v.addEventListener("touchend",y)}),S=b.useCallback(()=>{let t=(0,nb.Z)(e.current.rootElementRef.current);t.body.style.removeProperty("cursor"),t.removeEventListener("mousemove",v),t.removeEventListener("mouseup",g),t.removeEventListener("touchmove",x),t.removeEventListener("touchend",y),setTimeout(()=>{t.removeEventListener("click",aw,!0)},100),l.current&&(l.current.style.pointerEvents="unset")},[e,l,v,g,x,y]),k=b.useCallback(({field:t})=>{e.current.setState(e=>(0,m.Z)({},e,{columnResize:(0,m.Z)({},e.columnResize,{resizingColumnField:t})})),e.current.forceUpdate()},[e]),I=b.useCallback(()=>{e.current.setState(e=>(0,m.Z)({},e,{columnResize:(0,m.Z)({},e.columnResize,{resizingColumnField:""})})),e.current.forceUpdate()},[e]),R=(0,nn.Z)(({colDef:t},d)=>{var p,h,f;if(0!==d.button||!d.currentTarget.classList.contains(z._["columnSeparator--resizable"]))return;d.preventDefault(),n.debug(`Start Resize on col ${t.field}`),e.current.publishEvent("columnResizeStart",{field:t.field},d),r.current=t,l.current=null==(p=e.current.columnHeadersContainerElementRef)?void 0:p.current.querySelector(`[data-field="${t.field}"]`);let m=null==(h=e.current.headerFiltersElementRef)?void 0:h.current;m&&(o.current=m.querySelector(`[data-field="${t.field}"]`)),i.current=ap(null==(f=e.current.columnHeadersContainerElementRef)?void 0:f.current,t.field),a.current=ah(l.current,e.current);let b=(0,nb.Z)(e.current.rootElementRef.current);b.body.style.cursor="col-resize",c.current=ax(d.currentTarget,s.direction),u.current=ay(d.clientX,l.current.getBoundingClientRect(),c.current),b.addEventListener("mousemove",v),b.addEventListener("mouseup",g),b.addEventListener("click",aw,!0)}),_=(0,nn.Z)((n,r)=>{if(t.disableAutosize||0!==r.button)return;let l=e.current.state.columns.lookup[n.field];!1!==l.resizable&&e.current.autosizeColumns((0,m.Z)({},t.autosizeOptions,{columns:[l.field]}))}),E=function(e){let t=b.useRef(),n=()=>oa(e),r=(0,C.P)(e,n);return b.useEffect(()=>{t.current&&!1===r&&(t.current.resolve(),t.current=void 0)}),()=>{if(!t.current){if(!1===n())return Promise.resolve();t.current=function(){let e,t;let n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n}()}return t.current}}(e),M=b.useRef(!1),P=b.useCallback(async t=>{var n,r,l,o;if(!(null==(n=e.current.rootElementRef)?void 0:n.current)||M.current)return;M.current=!0;let i=(0,V.wH)(e.current.state),a=(0,m.Z)({},af,t,{columns:null!=(r=null==t?void 0:t.columns)?r:i.orderedFields});a.columns=a.columns.filter(e=>!1!==i.columnVisibilityModel[e]);let s=a.columns.map(t=>e.current.state.columns.lookup[t]);try{e.current.unstable_setColumnVirtualization(!1),await E();let t=function(e,t,n){let r={},l=e.current.rootElementRef.current;
12return l.classList.add(z._.autosizing),n.forEach(n=>{let l=(function(e,t){let n=e.virtualScrollerRef.current,r=e=>`:scope > div > div > div > [data-field="${t}"][role="${e}"]`;return Array.from(n.querySelectorAll(`${r("cell")}, ${r("gridcell")}`))})(e.current,n.field).map(e=>{var t,n;let r=window.getComputedStyle(e,null);return parseInt(r.paddingLeft,10)+parseInt(r.paddingRight,10)+(null!=(t=null==(n=e.firstElementChild)?void 0:n.getBoundingClientRect().width)?t:0)}),o=t.includeOutliers?l:function(e,t){if(e.length<4)return e;let n=e.slice();n.sort((e,t)=>e-t);let r=n[Math.floor(.25*n.length)],l=n[Math.floor(.75*n.length)-1],o=l-r,i=o<5?5:o*t;return n.filter(e=>e>r-i&&e<l+i)}(l,t.outliersFactor);if(t.includeHeaders){let t=function(e,t){var n;let r=null==(n=e.columnHeadersContainerElementRef)?void 0:n.current;return r?r.querySelector(`:scope > div > div > [data-field="${t}"][role="columnheader"]`):null}(e.current,n.field);if(t){let e=t.querySelector(`.${z._.columnHeaderTitle}`),n=t.querySelector(`.${z._.columnHeaderTitleContainerContent}`),r=window.getComputedStyle(t,null),l=parseInt(r.paddingLeft,10)+parseInt(r.paddingRight,10),i=(null!=e?e:n).scrollWidth+1;o.push(l+i)}}let i=n.minWidth!==-1/0&&void 0!==n.minWidth,a=n.maxWidth!==1/0&&void 0!==n.maxWidth,s=i?n.minWidth:0,u=a?n.maxWidth:1/0,c=0===o.length?0:Math.max(...o);r[n.field]=(0,ep.uZ)(c,s,u)}),l.classList.remove(z._.autosizing),r}(e,a,s),n=s.map(e=>(0,m.Z)({},e,{width:t[e.field],computedWidth:t[e.field]}));if(a.expand){let r=i.orderedFields.map(e=>i.lookup[e]).filter(e=>!1!==i.columnVisibilityModel[e.field]).reduce((e,n)=>{var r,l;return e+(null!=(r=null!=(l=t[n.field])?l:n.computedWidth)?r:n.width)},0),a=(null!=(l=null==(o=e.current.getRootDimensions())?void 0:o.viewportInnerSize.width)?l:0)-r;if(a>0){let e=a/(n.length||1);n.forEach(t=>{t.width+=e,t.computedWidth+=e})}}e.current.updateColumns(n)}finally{e.current.unstable_setColumnVirtualization(!0),M.current=!1}},[e,E]);b.useEffect(()=>S,[S]),(0,ad.F)(()=>{t.autosizeOnMount&&Promise.resolve().then(()=>{e.current.autosizeColumns(t.autosizeOptions)})}),i9(e,()=>{var t;return null==(t=e.current.columnHeadersElementRef)?void 0:t.current},"touchstart",w,{passive:am()}),eh(e,{autosizeColumns:P},"public"),(0,ew.zn)(e,"columnResizeStop",I),(0,ew.zn)(e,"columnResizeStart",k),(0,ew.zn)(e,"columnSeparatorMouseDown",R),(0,ew.zn)(e,"columnSeparatorDoubleClick",_),(0,ew.x3)(e,"columnResize",t.onColumnResize),(0,ew.x3)(e,"columnWidthChange",t.onColumnWidthChange)},ak=e=>{let t=b.useCallback((t,n)=>{"treeDataGroup"!==e.current.getCellParams(t.id,t.field).colDef.type||" "!==n.key||n.shiftKey||"group"!==t.rowNode.type||e.current.setRowChildrenExpansion(t.id,!t.rowNode.childrenExpanded)},[e]);(0,ew.zn)(e,"cellKeyDown",t)},aI=(0,m.Z)({},eX.z,{type:"treeDataGroup",sortable:!1,filterable:!1,disableColumnMenu:!0,disableReorder:!0,align:"left",width:200,valueGetter:e=>"group"===e.rowNode.type||"leaf"===e.rowNode.type?e.rowNode.groupingKey:void 0}),aR={field:"__tree_data_group__",editable:!1,groupable:!1},a_="tree-data",aE=e=>{let{apiRef:t,rowTree:n,disableChildrenFiltering:r,isRowMatchingFilters:l}=e,o={},i={},a={},s={passingFilterItems:null,passingQuickFilterValues:null},u=(c,d,p)=>{let h,f;r&&c.depth>0?h=null:l&&"footer"!==c.type?(l(t.current.getRow(c.id),void 0,s),h=(0,nE.W$)([s.passingFilterItems],[s.passingQuickFilterValues],e.filterModel,e.apiRef,a)):h=!0;let g=0;switch("group"===c.type&&c.children.forEach(e=>{var t;let r=u(n[e],null!=(t=h)?t:d,p&&!!c.childrenExpanded);g+=r}),h){case!0:f=!0;break;case!1:f=g>0;break;default:f=d}return(o[c.id]=f,f)?(i[c.id]=g,"footer"===c.type)?g:g+1:0},c=Object.values(n);for(let e=0;e<c.length;e+=1){let t=c[e];0===t.depth&&u(t,!0,!0)}return{filteredRowsLookup:o,filteredDescendantCountLookup:i}};var aM=n(60990);let aP=B.B;var aT=n(91807);let aZ=e=>{let{classes:t}=e;return(0,Z.Z)({root:["treeDataGroupingCell"],toggle:["treeDataGroupingCellToggle"]},z.d,t)};function aF(e){var t,n;let{id:r,field:l,formattedValue:o,rowNode:i,hideDescendantCount:a,offsetMultiplier:s=2}=e,u=aP(),c=(0,aT.l)(),d=aZ({classes:u.classes}),p=null!=(t=(0,C.P)(c,ei.J5)[i.id])?t:0,h=i.childrenExpanded?u.slots.treeDataCollapseIcon:u.slots.treeDataExpandIcon;return(0,_.jsxs)(aM.Z,{className:d.root,sx:{ml:i.depth*s},children:[(0,_.jsx)("div",{className:d.toggle,children:p>0&&(0,_.jsx)(u.slots.baseIconButton,(0,m.Z)({size:"small",onClick:e=>{c.current.setRowChildrenExpansion(r,!i.childrenExpanded),c.current.setCellFocus(r,l),e.stopPropagation()},tabIndex:-1,"aria-label":i.childrenExpanded?c.current.getLocaleText("treeDataCollapse"):c.current.getLocaleText("treeDataExpand")},null==u||null==(n=u.slotProps)?void 0:n.baseIconButton,{children:(0,_.jsx)(h,{fontSize:"inherit"})}))}),(0,_.jsxs)("span",{children:[void 0===o?i.groupingKey:o,!a&&p>0?` (${p})`:""]})]})}let aD=e=>{let t=e.map(e=>`${e.field}/${e.key}`).join("-");return`auto-generated-row-${t}`},aA=({id:e,tree:t})=>{let n=[],r=t[e];for(;r.id!==eH.U5;
12)n.push({field:"leaf"===r.type?null:r.groupingField,key:r.groupingKey}),r=t[r.parent];return n.reverse(),n},aO=(e,t,n)=>{let r;return r=e.id===eH.U5||(n?n(e):-1===t||t>e.depth),e.childrenExpanded=r,e},az=(e,t,n,r)=>{var l,o,i,a;t[e.id]=e,n[e.depth]=(null!=(l=n[e.depth])?l:0)+1;let s=t[e.parent];if("group"===e.type||"leaf"===e.type){let n=null!=(o=e.groupingField)?o:"__no_field__",l=null!=(i=e.groupingKey)?i:"__no_key__",u=null==(a=s.childrenFromPath)?void 0:a[n];null!==r&&r[s.id]===t[s.id]?s.children=[...s.children,e.id]:s.children.push(e.id),null==u?s.childrenFromPath[n]={[l.toString()]:e.id}:u[l.toString()]=e.id}else"footer"===e.type&&(s.footerId=e.id)},aj=({node:e,tree:t,treeDepths:n})=>{delete t[e.id];let r=e.depth,l=n[r];1===l?delete n[r]:n[r]=l-1;let o=t[e.parent];if("footer"===e.type)t[o.id]=(0,m.Z)({},o,{footerId:null});else{var i,a;let n=null!=(i=e.groupingField)?i:"__no_field__",r=null!=(a=e.groupingKey)?a:"__no_key__",l=o.children.filter(t=>t!==e.id),s=o.childrenFromPath;delete s[n][r.toString()],t[o.id]=(0,m.Z)({},o,{children:l,childrenFromPath:s})}},aL=({node:e,updatedNode:t,previousTree:n,tree:r,treeDepths:l})=>{e.children.forEach(e=>{r[e]=(0,m.Z)({},r[e],{parent:t.id})}),aj({node:e,tree:r,treeDepths:l}),az((0,m.Z)({},e,t),r,l,n)},aH=()=>({value:{},addAction(e,t){this.value[e]||(this.value[e]={}),this.value[e][t]=!0}}),aB=({tree:e,filteredRowsLookup:t})=>{if(!t)return{};let n={},r=(l,o)=>{let i=t[l.id];"group"===l.type&&l.children.forEach(t=>{r(e[t],o&&!!l.childrenExpanded)}),n[l.id]=i&&o,"group"===l.type&&null!=l.footerId&&(n[l.footerId]=i&&o&&!!l.childrenExpanded)},l=Object.values(e);for(let e=0;e<l.length;e+=1){let t=l[e];0===t.depth&&r(t,!0)}return n},aN=({id:e,path:t,updatedGroupsManager:n,previousTree:r,tree:l,treeDepths:o,onDuplicatePath:i,isGroupExpandedByDefault:a,defaultGroupingExpansionDepth:s})=>{let u=eH.U5;for(let d=0;d<t.length;d+=1){var c;let{key:p,field:h}=t[d],f=null!=h?h:"__no_field__",g=null!=p?p:"__no_key__",m=null==(c=l[u].childrenFromPath)||null==(c=c[f])?void 0:c[g.toString()];if(d===t.length-1){if(null==m){let t={type:"leaf",id:e,depth:d,parent:u,groupingKey:p};null==n||n.addAction(u,"insertChildren"),az(t,l,o,r)}else{let a=l[m];"group"===a.type&&a.isAutoGenerated?(null==n||n.addAction(u,"removeChildren"),null==n||n.addAction(u,"insertChildren"),aL({tree:l,previousTree:r,treeDepths:o,node:a,updatedNode:{id:e,isAutoGenerated:!1}})):null==i||i(m,e,t)}}else if(null==m){let e=aD(t.slice(0,d+1)),i={type:"group",id:e,parent:u,depth:d,isAutoGenerated:!0,groupingKey:p,groupingField:h,children:[],childrenFromPath:{},childrenExpanded:!1};null==n||n.addAction(u,"insertChildren"),az(aO(i,s,a),l,o,r),u=e}else{let e=l[m];if("group"!==e.type){let t={type:"group",id:e.id,parent:e.parent,depth:e.depth,isAutoGenerated:!1,groupingKey:p,groupingField:h,children:[],childrenFromPath:{},childrenExpanded:!1};l[m]=aO(t,s,a)}u=e.id}}},aV=e=>{let t=[],n={[eH.U5]:(0,eH.E2)()},r={};for(let l=0;l<e.nodes.length;l+=1){let o=e.nodes[l];t.push(o.id),aN({tree:n,previousTree:e.previousTree,id:o.id,path:o.path,onDuplicatePath:e.onDuplicatePath,treeDepths:r,isGroupExpandedByDefault:e.isGroupExpandedByDefault,defaultGroupingExpansionDepth:e.defaultGroupingExpansionDepth})}return{tree:n,treeDepths:r,groupingName:e.groupingName,dataRowIds:t}};class a${constructor(e,t){this.next=void 0,this.data=void 0,this.next=t,this.data=e}insertAfter(e){if(!e.first||!e.last)return;let t=this.next;this.next=e.first,e.last.next=t}}class aU{constructor(e,t){this.first=void 0,this.last=void 0,this.first=e,this.last=t}data(){let e=[];return this.forEach(t=>{e.push(t.data)}),e}forEach(e){let t=this.first;for(;null!==t;)e(t),t=t.next}static from(e){if(0===e.length)return new aU(null,null);let t=0,n=new a$(e[0],null),r=n;for(;t+1<e.length;){let n=new a$(e[t+=1],null);r.next=n,r=n}return new aU(n,r)}}let aG=e=>{let{rowTree:t,disableChildrenSorting:n,sortRowList:r,shouldRenderGroupBelowLeaves:l}=e,o=new Map,i=e=>{let a;if(r&&(!n||-1===e.depth)){for(let n=0;n<e.children.length;n+=1){let r=t[e.children[n]];"group"===r.type&&i(r)}a=r(e.children.map(e=>t[e]))}else if(l){let n=[],r=[];for(let l=0;l<e.children.length;l+=1){let o=e.children[l],a=t[o];"group"===a.type?(i(a),r.push(o)):"leaf"===a.type&&n.push(o)}a=[...n,...r]}else{for(let n=0;n<e.children.length;n+=1){let r=t[e.children[n]];"group"===r.type&&i(r)}a=[...e.children]}null!=e.footerId&&a.push(e.footerId),o.set(e.id,a)};i(t[eH.U5]);let a=aU.from(o.get(eH.U5));
12return a.forEach(e=>{let t=o.get(e.data);null!=t&&t.length&&e.insertAfter(aU.from(t))}),a.data()},aq=({node:e,tree:t,treeDepths:n,updatedGroupsManager:r})=>{aj({node:e,tree:t,treeDepths:n}),"group"===e.type&&null!=e.footerId&&aj({node:t[e.footerId],tree:t,treeDepths:n});let l=t[e.parent];null==r||r.addAction(l.id,"removeChildren"),l.id!==eH.U5&&0===l.children.length&&(l.isAutoGenerated?aq({node:l,tree:t,treeDepths:n}):t[l.id]={type:"leaf",id:l.id,depth:l.depth,parent:l.parent,groupingKey:l.groupingKey})},aW=({node:e,tree:t,treeDepths:n,updatedGroupsManager:r})=>{null==r||r.addAction(e.parent,"removeChildren"),null==r||r.addAction(e.parent,"insertChildren"),aL({previousTree:null,tree:t,treeDepths:n,node:e,updatedNode:{id:aD(aA({id:e.id,tree:t})),isAutoGenerated:!0}})},aK=({id:e,tree:t,treeDepths:n,updatedGroupsManager:r})=>{let l=t[e];"group"===l.type&&l.children.length>0?aW({node:l,tree:t,treeDepths:n,updatedGroupsManager:r}):aq({node:l,tree:t,treeDepths:n,updatedGroupsManager:r})},aY=e=>{let t=(0,m.Z)({},e.previousTree),n=(0,m.Z)({},e.previousTreeDepth),r=aH();for(let l=0;l<e.nodes.inserted.length;l+=1){let{id:o,path:i}=e.nodes.inserted[l];aN({previousTree:e.previousTree,tree:t,treeDepths:n,updatedGroupsManager:r,id:o,path:i,onDuplicatePath:e.onDuplicatePath,isGroupExpandedByDefault:e.isGroupExpandedByDefault,defaultGroupingExpansionDepth:e.defaultGroupingExpansionDepth})}for(let l=0;l<e.nodes.removed.length;l+=1)aK({tree:t,treeDepths:n,updatedGroupsManager:r,id:e.nodes.removed[l]});for(let l=0;l<e.nodes.modified.length;l+=1){let{id:o,path:i}=e.nodes.modified[l],a=aA({tree:t,id:o});(0,ep.xb)(a,i)?null==r||r.addAction(t[o].parent,"modifyChildren"):(aK({tree:t,treeDepths:n,updatedGroupsManager:r,id:o}),aN({previousTree:e.previousTree,tree:t,treeDepths:n,updatedGroupsManager:r,id:o,path:i,onDuplicatePath:e.onDuplicatePath,isGroupExpandedByDefault:e.isGroupExpandedByDefault,defaultGroupingExpansionDepth:e.defaultGroupingExpansionDepth}))}let l=(0,eH.u4)(t,eH.U5,!0);return{tree:t,treeDepths:n,groupingName:e.groupingName,dataRowIds:l,updatedGroupsManager:r}},aX=["hideDescendantCount"],aJ=(e,t)=>{let n=b.useCallback(()=>{e.current.setStrategyAvailability("rowTree",a_,t.treeData?()=>!0:()=>!1)},[e,t.treeData]),r=b.useCallback(()=>{var n;let r=t.groupingColDef,l=null!=(n="function"==typeof r?r({groupingName:a_,fields:[]}):r)?n:{},{hideDescendantCount:o}=l,i=(0,M.Z)(l,aX),a=(0,m.Z)({},aI,{renderCell:e=>(0,_.jsx)(aF,(0,m.Z)({},e,{hideDescendantCount:o})),headerName:e.current.getLocaleText("treeDataGroupingHeaderName")});return(0,m.Z)({},a,i,aR)},[e,t.groupingColDef]),l=b.useCallback(e=>{let n=aR.field,l=t.treeData,o=e.lookup[n];if(l){let t=r();if(o&&(t.width=o.width,t.flex=o.flex),e.lookup[n]=t,null==o){let t=e.orderedFields[0]===eO.e?1:0;e.orderedFields=[...e.orderedFields.slice(0,t),n,...e.orderedFields.slice(t)]}}else!l&&o&&(delete e.lookup[n],e.orderedFields=e.orderedFields.filter(e=>e!==n));return e},[t.treeData,r]),o=b.useCallback(e=>{if(!t.getTreeDataPath)throw Error("MUI: No getTreeDataPath given.");let n=n=>
12({id:n,path:t.getTreeDataPath(e.dataRowIdToModelLookup[n]).map(e=>({key:e,field:null}))});return"full"===e.updates.type?aV({previousTree:e.previousTree,nodes:e.updates.rows.map(n),defaultGroupingExpansionDepth:t.defaultGroupingExpansionDepth,isGroupExpandedByDefault:t.isGroupExpandedByDefault,groupingName:a_,onDuplicatePath:(e,t,n)=>{throw Error(`MUI: The path returned by \`getTreeDataPath\` should be unique.
13The rows with id #${e} and #${t} have the same.
14Path: ${JSON.stringify(n.map(e=>e.key))}.`)}}):aY({nodes:{inserted:e.updates.actions.insert.map(n),modified:e.updates.actions.modify.map(n),removed:e.updates.actions.remove},previousTree:e.previousTree,previousTreeDepth:e.previousTreeDepths,defaultGroupingExpansionDepth:t.defaultGroupingExpansionDepth,isGroupExpandedByDefault:t.isGroupExpandedByDefault,groupingName:a_})},[t.getTreeDataPath,t.defaultGroupingExpansionDepth,t.isGroupExpandedByDefault]),i=b.useCallback(n=>aE({rowTree:(0,Y.Kd)(e),isRowMatchingFilters:n.isRowMatchingFilters,disableChildrenFiltering:t.disableChildrenFiltering,filterModel:n.filterModel,apiRef:e}),[e,t.disableChildrenFiltering]),a=b.useCallback(n=>aG({rowTree:(0,Y.Kd)(e),sortRowList:n.sortRowList,disableChildrenSorting:t.disableChildrenSorting,shouldRenderGroupBelowLeaves:!1}),[e,t.disableChildrenSorting]);eA(e,"hydrateColumns",l),eL(e,a_,"rowTreeCreation",o),eL(e,a_,"filtering",i),eL(e,a_,"sorting",a),eL(e,a_,"visibleRowsLookupCreation",aB),eD(()=>{n()});let s=b.useRef(!0);b.useEffect(()=>{s.current?s.current=!1:n()},[n])};var aQ=((p=aQ||{}).left="left",p.right="right",p);let a0=e=>e.pinnedColumns,a1=(0,en.Z)("div",{name:"MuiDataGrid",slot:"OverlayWrapper",shouldForwardProp:e=>"overlayType"!==e,overridesResolver:(e,t)=>t.overlayWrapper})(({overlayType:e})=>({position:"sticky",top:0,left:0,width:0,height:0,zIndex:"loadingOverlay"===e?5:4})),a2=(0,en.Z)("div",{name:"MuiDataGrid",slot:"OverlayWrapperInner",shouldForwardProp:e=>"overlayType"!==e,overridesResolver:(e,t)=>t.overlayWrapperInner})({}),a3=e=>{let{classes:t}=e;return(0,Z.Z)({root:["overlayWrapper"],inner:["overlayWrapperInner"]},z.d,t)};function a4(e){var t,n;let r=(0,e5.l)(),l=(0,B.B)(),[o,i]=b.useState(()=>{var e,t;return null!=(e=null==(t=r.current.getRootDimensions())?void 0:t.viewportInnerSize)?e:null}),a=b.useCallback(()=>{var e,t;i(null!=(e=null==(t=r.current.getRootDimensions())?void 0:t.viewportInnerSize)?e:null)},[r]);(0,D.Z)(()=>r.current.subscribeEvent("viewportInnerSizeChange",a),[r,a]);let s=null!=(t=null==o?void 0:o.height)?t:0;l.autoHeight&&0===s&&(s=(0,eH.ZM)(r,l.rowHeight));let u=a3((0,m.Z)({},e,{classes:l.classes}));return o?(0,_.jsx)(a1,{className:(0,P.Z)(u.root),overlayType:e.overlayType,children:(0,_.jsx)(a2,(0,m.Z)({className:(0,P.Z)(u.inner),style:{height:s,width:null!=(n=null==o?void 0:o.width)?n:0}},e))}):null}function a5(){var e,t,n;let r=(0,e5.l)(),l=(0,B.B)(),o=(0,C.P)(r,Y.hh),i=(0,C.P)(r,ei.IQ),a=(0,C.P)(r,Y.Vk),s=null,u="";return(a||0!==o||(s=(0,_.jsx)(l.slots.noRowsOverlay,(0,m.Z)({},null==(e=l.slotProps)?void 0:e.noRowsOverlay)),u="noRowsOverlay"),!a&&o>0&&0===i&&(s=(0,_.jsx)(l.slots.noResultsOverlay,(0,m.Z)({},null==(t=l.slotProps)?void 0:t.noResultsOverlay)),u="noResultsOverlay"),a&&(s=(0,_.jsx)(l.slots.loadingOverlay,(0,m.Z)({},null==(n=l.slotProps)?void 0:n.loadingOverlay)),u="loadingOverlay"),null===s)?null:(0,_.jsx)(a4,{overlayType:u,children:s})}let a9=e=>{let{classes:t}=e;return(0,Z.Z)({root:["virtualScroller"]},z.d,t)},a6=(0,en.Z)("div",{name:"MuiDataGrid",slot:"VirtualScroller",overridesResolver:(e,t)=>t.virtualScroller})({overflow:"auto",height:"100%",position:"relative","@media print":{overflow:"hidden"},zIndex:0}),a8=b.forwardRef(function(e,t){let n=(0,B.B)(),r=a9(n);return(0,_.jsx)(a6,(0,m.Z)({ref:t},e,{className:(0,P.Z)(r.root,e.className),ownerState:n}))}),a7=(e,t)=>{let{classes:n}=e;return(0,Z.Z)({root:["virtualScrollerContent",t&&"virtualScrollerContent--overflowed"]},z.d,n)},se=(0,en.Z)("div",{name:"MuiDataGrid",slot:"VirtualScrollerContent",overridesResolver:(e,t)=>t.virtualScrollerContent})({}),st=b.forwardRef(function(e,t){var n;let r=(0,B.B)(),l=!r.autoHeight&&(null==(n=e.style)?void 0:n.minHeight)==="auto",o=a7(r,l);return(0,_.jsx)(se,(0,m.Z)({ref:t},e,{ownerState:r,className:(0,P.Z)(o.root,e.className)}))}),sn=["className"],sr=e=>{let{classes:t}=e;return(0,Z.Z)({root:["virtualScrollerRenderZone"]},z.d,t)},sl=(0,en.Z)("div",{name:"MuiDataGrid",slot:"VirtualScrollerRenderZone",overridesResolver:(e,t)=>t.virtualScrollerRenderZone})({position:"absolute",display:"flex",flexDirection:"column"}),so=b.forwardRef(function(e,t){let{className:n}=e,r=(0,M.Z)(e,sn),l=(0,B.B)(),o=sr(l);return(0,_.jsx)(sl,(0,m.Z)({ref:t,className:(0,P.Z)(o.root,n),ownerState:l},r))}),si=e=>e.detailPanel.expandedRowIds,sa=e=>e.detailPanel.contentCache,ss=e=>e.detailPanel.heightCache,su=(0,$.Xw)(ss,e=>Object.entries(e).reduce((e,[t,{height:n}])=>(e[t]=n||0,e),{})),sc=["rowId","height","style"],sd=(0,O.ZP)("div",{name:"MuiDataGrid",slot:"DetailPanel",overridesResolver:(e,t)=>t.detailPanel})(({theme:e})=>({zIndex:2,width:"100%",position:"absolute",backgroundColor:(e.vars||e).palette.background.default,overflow:"auto"}));function sp(e){let{rowId:t,height:n,style:r={}}=e,l=(0,M.Z)(e,sc),o=I(),i=b.useRef(null),a=aP();b.useLayoutEffect(()=>{"auto"===n&&"undefined"==typeof ResizeObserver&&o.current.storeDetailPanelHeight(t,i.current.clientHeight)},[o,n,t]),b.useLayoutEffect(()=>{if("auto"!==n||"undefined"==typeof ResizeObserver)return;let e=new ResizeObserver(e=>{let[n]=e,r=n.borderBoxSize&&n.borderBoxSize.length>0?n.borderBoxSize[0].blockSize:n.contentRect.height;o.current.storeDetailPanelHeight(t,r)});return e.observe(i.current),()=>e.disconnect()},[o,n,t]);let s=(0,m.Z)({},r,{height:n});return(0,_.jsx)(sd,(0,m.Z)({ref:i,ownerState:a,style:s},l))}
14let sh=["className","disableVirtualization"],sf=(e,t,n)=>{var r,l;if(!Array.isArray(e.left)&&!Array.isArray(e.right)||(null==(r=e.left)?void 0:r.length)===0&&(null==(l=e.right)?void 0:l.length)===0)return[[],[]];let o=(e,t)=>Array.isArray(e)?e.filter(e=>t.includes(e)):[],i=o(e.left,t),a=t.filter(e=>!i.includes(e)),s=o(e.right,a);return n?[s,i]:[i,s]},sg=e=>{let{classes:t}=e;return(0,Z.Z)({leftPinnedColumns:["pinnedColumns","pinnedColumns--left"],rightPinnedColumns:["pinnedColumns","pinnedColumns--right","withBorderColor"],topPinnedRows:["pinnedRows","pinnedRows--top"],bottomPinnedRows:["pinnedRows","pinnedRows--bottom"],pinnedRowsRenderZone:["pinnedRowsRenderZone"],detailPanels:["detailPanels"],detailPanel:["detailPanel"]},z.d,t)},sm=e=>(e<1?5.11916*e**2:4.5*Math.log(e+1)+2)/100,sb=e=>e.vars?"rgba(0 0 0 /  0.21)":(0,A.Fq)(e.palette.common.black,.21),sv=(0,O.ZP)("div",{name:"MuiDataGrid",slot:"DetailPanels",overridesResolver:(e,t)=>t.detailPanels})({position:"relative"}),sy=`linear-gradient(${(0,A.Fq)("#fff",sm(2))}, ${(0,A.Fq)("#fff",sm(2))})`,sx=(0,O.ZP)("div",{name:"MuiDataGrid",slot:"PinnedColumns",overridesResolver:(e,t)=>[{[`&.${z._["pinnedColumns--left"]}`]:t["pinnedColumns--left"]},{[`&.${z._["pinnedColumns--right"]}`]:t["pinnedColumns--right"]},t.pinnedColumns]})(({theme:e,ownerState:t})=>{var n;let r=sb(e);return(0,m.Z)({position:"sticky",overflow:"hidden",zIndex:1,backgroundColor:(e.vars||e).palette.background.default},e.vars?{backgroundImage:null==(n=e.vars.overlays)?void 0:n[2]}:(0,m.Z)({},"dark"===e.palette.mode&&{backgroundImage:sy}),t.side===aQ.left&&{left:0,float:"left",boxShadow:`2px 0px 4px -2px ${r}`},t.side===aQ.right&&{right:0,float:"right",boxShadow:`-2px 0px 4px -2px ${r}`},t.side===aQ.right&&t.showCellVerticalBorder&&{borderLeftWidth:"1px",borderLeftStyle:"solid"})});var sw=((h=sw||{}).top="top",h.bottom="bottom",h);let sC=(0,O.ZP)("div",{name:"MuiDataGrid",slot:"PinnedRows",overridesResolver:(e,t)=>[{[`&.${z._["pinnedRows--top"]}`]:t["pinnedRows--top"]},{[`&.${z._["pinnedRows--bottom"]}`]:t["pinnedRows--bottom"]},t.pinnedRows]})(({theme:e,ownerState:t})=>{var n;let r=sb(e);return(0,m.Z)({position:"sticky",zIndex:4,backgroundColor:(e.vars||e).palette.background.default},e.vars?{backgroundImage:null==(n=e.vars.overlays)?void 0:n[2]}:(0,m.Z)({},"dark"===e.palette.mode&&{backgroundImage:sy}),"top"===t.position&&{top:0,boxShadow:`0px 3px 4px -2px ${r}`},t.position===sw.bottom&&{boxShadow:`0px -3px 4px -2px ${r}`,bottom:0})}),sS=(0,O.ZP)("div")({position:"absolute"}
14),sk=b.forwardRef(function(e,t){let n=(0,M.Z)(e,sh),r=I(),l=aP(),o=(0,C.P)(r,V.pK),i=(0,C.P)(r,si),a=(0,C.P)(r,sa),s=(0,C.P)(r,su),u=b.useRef(null),c=b.useRef(null),d=b.useRef(null),p=b.useRef(null),h=(0,eQ.Z)(),f=b.useCallback(({top:e,left:t})=>{u.current&&(u.current.style.transform=`translate3d(0px, ${e}px, 0px)`),c.current&&(c.current.style.transform=`translate3d(0px, ${e}px, 0px)`),d.current&&(d.current.style.transform=`translate3d(${t}px, 0px, 0px)`),p.current&&(p.current.style.transform=`translate3d(${t}px, 0px, 0px)`)},[]),g=b.useMemo(()=>{let e=new Set;return i.forEach(t=>{e.add(t)}),e},[i]),v=b.useCallback(e=>g.has(e)?{style:{marginBottom:s[e]}}:null,[s,g]),[y,x]=sf((0,C.P)(r,a0),o,"rtl"===h.direction),w=(0,C.P)(r,Y.Kf),S=b.useMemo(()=>(null==w?void 0:w.top)||[],[null==w?void 0:w.top]),k=b.useMemo(()=>(null==w?void 0:w.bottom)||[],[null==w?void 0:w.bottom]),R=(0,m.Z)({},l,{classes:l.classes}),E=sg(R),{renderContext:P,getRows:T,getRootProps:Z,getContentProps:F,getRenderZoneProps:D,updateRenderZonePosition:A}=of((0,m.Z)({ref:t,renderZoneMinColumnIndex:y.length,renderZoneMaxColumnIndex:o.length-x.length,onRenderZonePositioning:f,getRowProps:v},e)),O=b.useCallback(()=>{P&&A(P)},[P,A]);(0,ew.zn)(r,"columnWidthChange",O),(0,ew.zn)(r,"columnOrderChange",O),(0,ew.zn)(r,"rowOrderChange",O);let z=P&&y.length>0?(0,m.Z)({},P,{firstColumnIndex:0,lastColumnIndex:y.length}):null,j=P&&x.length>0?(0,m.Z)({},P,{firstColumnIndex:o.length-x.length,lastColumnIndex:o.length}):null,L=e=>{let t=ol(r.current.state),n=a[e],l=r.current.getRowIndexRelativeToVisibleRows(e);if(b.isValidElement(n)&&void 0!==l){let o=r.current.detailPanelHasAutoHeight(e)?"auto":s[e],i=r.current.unstable_getRowInternalSizes(e),a=(null==i?void 0:i.spacingTop)||0,u=t.positions[l]+r.current.unstable_getRowHeight(e)+a;return(0,_.jsx)(sp,{rowId:e,style:{top:u},height:o,className:E.detailPanel,children:n},e)}return null},H=[],B=T({renderContext:P,rows:S,position:"center"}),N=(0,eH.oq)(r),$=T({renderContext:P,rowIndexOffset:S.length,position:"center",onRowRender:e=>{if(null==l.getDetailPanelContent||!g.has(e))return;let t=L(e);t&&H.push(t)}}),U=T({renderContext:P,rows:k,rowIndexOffset:S.length+($?$.length:0),position:"center"}),G=F(),q={minHeight:G.style.minHeight};return G.style.minHeight&&"100%"===G.style.minHeight&&(G.style.minHeight=`calc(100% - ${N.top}px - ${N.bottom}px)`),(0,_.jsxs)(a8,(0,m.Z)({},Z(n),{children:[(0,_.jsx)(a5,{}),S.length>0?(0,_.jsxs)(sC,{className:E.topPinnedRows,ownerState:(0,m.Z)({},R,{position:sw.top}),style:{width:G.style.width,height:N.top},role:"rowgroup",children:[z&&(0,_.jsx)(sx,{className:E.leftPinnedColumns,ownerState:(0,m.Z)({},R,{side:aQ.left,showCellVerticalBorder:l.showCellVerticalBorder}),children:T({renderContext:z,minFirstColumn:z.firstColumnIndex,maxLastColumn:z.lastColumnIndex,availableSpace:0,rows:S,position:"left"})}),(0,_.jsx)(sS,{className:E.pinnedRowsRenderZone,ref:d,role:"presentation",children:B}),j&&(0,_.jsx)(sx,{className:E.rightPinnedColumns,ownerState:(0,m.Z)({},R,{side:aQ.right,showCellVerticalBorder:l.showCellVerticalBorder}),children:T({renderContext:j,minFirstColumn:j.firstColumnIndex,maxLastColumn:j.lastColumnIndex,availableSpace:0,rows:S,position:"right"})})]}):null,(0,_.jsxs)(st,(0,m.Z)({},G,{children:[z&&(0,_.jsx)(sx,{ref:u,className:E.leftPinnedColumns,ownerState:(0,m.Z)({},R,{side:aQ.left,showCellVerticalBorder:l.showCellVerticalBorder}),style:q,children:T({renderContext:z,minFirstColumn:z.firstColumnIndex,maxLastColumn:z.lastColumnIndex,availableSpace:0,rowIndexOffset:S.length,position:"left"})}),(0,_.jsx)(so,(0,m.Z)({},D(),{children:$})),j&&(0,_.jsx)(sx,{ref:c,ownerState:(0,m.Z)({},R,{side:aQ.right,showCellVerticalBorder:l.showCellVerticalBorder}),className:E.rightPinnedColumns,style:q,children:T({renderContext:j,minFirstColumn:j.firstColumnIndex,maxLastColumn:j.lastColumnIndex,availableSpace:0,rowIndexOffset:S.length,position:"right"})}),H.length>0&&(0,_.jsx)(sv,{className:E.detailPanels,ownerState:R,children:H})]})),k.length>0?(0,_.jsxs)(sC,{className:E.bottomPinnedRows,ownerState:(0,m.Z)({},R,{position:sw.bottom}),style:{width:G.style.width,height:N.bottom},role:"rowgroup",children:[z&&(0,_.jsx)(sx,{className:E.leftPinnedColumns,ownerState:(0,m.Z)({},R,{side:aQ.left,showCellVerticalBorder:l.showCellVerticalBorder}),children:T({renderContext:z,minFirstColumn:z.firstColumnIndex,maxLastColumn:z.lastColumnIndex,availableSpace:0,rows:k,rowIndexOffset:S.length+($?$.length:0),position:"left"})}),(0,_.jsx)(sS,{className:E.pinnedRowsRenderZone,ref:p,role:"presentation",children:U}),j&&(0,_.jsx)(sx,{className:E.rightPinnedColumns,ownerState:(0,m.Z)({},R,{side:aQ.right,showCellVerticalBorder:l.showCellVerticalBorder}),children:T({renderContext:j,minFirstColumn:j.firstColumnIndex,maxLastColumn:j.lastColumnIndex,availableSpace:0,rows:k,rowIndexOffset:S.length+($?$.length:0),position:"right"})})]}):null]}))}),sI=(e,t,n)=>{var r,l;let o;return n.current.caches.columnPinning={orderedFieldsBeforePinningColumns:null},o=t.disableColumnPinning?{}:t.pinnedColumns?t.pinnedColumns:null!=(r=t.initialState)&&r.pinnedColumns?null==(l=t.initialState)?void 0:l.pinnedColumns:{},(0,m.Z)({},e,{pinnedColumns:o})},sR=e=>t=>(0,m.Z)({},t,{pinnedColumns:e}),s_=(e,t)=>{var n;let r=(0,C.P)(e,a0),l=(0,eQ.Z)(),o=b.useCallback((n,o)=>
14{if(t.disableColumnPinning)return n;let[i,a]=sf(r,(0,V.pK)(e),"rtl"===l.direction);if(!o.colIndex||0===i.length&&0===a.length)return n;let s=(0,V.FE)(e),u=(0,V.iD)(e),c=(0,V.Ag)(e),d=e.current.virtualScrollerRef.current.clientWidth,p=Math.abs(e.current.virtualScrollerRef.current.scrollLeft),h=s[o.colIndex].computedWidth,f=c[o.colIndex],g=c[i.length],b=u-c[c.length-a.length],v=f+h;return v-(d-b)>p?(0,m.Z)({},n,{left:v-(d-b)}):f<p+g?(0,m.Z)({},n,{left:f-g}):n},[e,r,t.disableColumnPinning,l.direction]),i=b.useCallback((e,n)=>t.disableColumnPinning||!1===n.pinnable?e:[...e,"columnMenuPinningItem"],[t.disableColumnPinning]),a=b.useCallback((t,{targetIndex:n})=>{let[o,i]=sf(r,(0,V.pK)(e),"rtl"===l.direction);return 0===o.length&&0===i.length?t:(!(o.length>0)||!(n<o.length))&&(i.length>0?!(n>=(0,V.FE)(e).length-i.length)&&t:t)},[e,r,l.direction]),s=b.useCallback((n,r)=>{var l,o,i;let a=a0(e.current.state);return!r.exportOnlyDirtyModels||null!=t.pinnedColumns||(null==(l=t.initialState)?void 0:l.pinnedColumns)!=null||(null!=(o=a.left)?o:[]).length>0||(null!=(i=a.right)?i:[]).length>0?(0,m.Z)({},n,{pinnedColumns:a}):n},[e,t.pinnedColumns,null==(n=t.initialState)?void 0:n.pinnedColumns]),u=b.useCallback((t,n)=>{let r=n.stateToRestore.pinnedColumns;return null!=r&&e.current.setState(sR(r)),t},[e]);eA(e,"scrollToIndexes",o),eA(e,"columnMenu",i),eA(e,"canBeReordered",a),eA(e,"exportState",s),eA(e,"restoreState",u),e.current.registerControlState({stateId:"pinnedColumns",propModel:t.pinnedColumns,propOnChange:t.onPinnedColumnsChange,stateSelector:a0,changeEvent:"pinnedColumnsChange"});let c=b.useCallback(e=>{if(t.disableColumnPinning)throw Error(`MUI: You cannot call \`apiRef.current.${e}\` when \`disableColumnPinning\` is true.`)},[t.disableColumnPinning]),d=b.useCallback((t,n)=>{if(c("pinColumn"),e.current.isColumnPinned(t)===n)return;let l=n===aQ.right?aQ.left:aQ.right,o={[n]:[...r[n]||[],t],[l]:(r[l]||[]).filter(e=>e!==t)};e.current.setPinnedColumns(o)},[e,c,r]),p=b.useCallback(t=>{c("unpinColumn"),e.current.setPinnedColumns({left:(r.left||[]).filter(e=>e!==t),right:(r.right||[]).filter(e=>e!==t)})},[e,c,r.left,r.right]),h=b.useCallback(()=>(c("getPinnedColumns"),a0(e.current.state)),[e,c]),f=b.useCallback(t=>{c("setPinnedColumns"),e.current.setState(sR(t)),e.current.forceUpdate()},[e,c]);eh(e,{pinColumn:d,unpinColumn:p,getPinnedColumns:h,setPinnedColumns:f,isColumnPinned:b.useCallback(e=>(c("isColumnPinned"),(r.left||[]).includes(e))?aQ.left:!!(r.right||[]).includes(e)&&aQ.right,[r.left,r.right,c])},"public");let g=b.useCallback(t=>{if(!e.current.caches.columnPinning.orderedFieldsBeforePinningColumns)return;let{column:n,targetIndex:r,oldIndex:l}=t,o=r>l?1:-1,i=(0,V.Zi)(e)[r-o],a=[...e.current.caches.columnPinning.orderedFieldsBeforePinningColumns],s=a.findIndex(e=>e===n.field),u=s+o,c=a.findIndex(e=>e===i);for(;o>0?s<c:s>c;){for(;e.current.isColumnPinned(a[u]);)u+=o;let t=a[s];a[s]=a[u],a[u]=t,u=(s=u)+o}e.current.caches.columnPinning.orderedFieldsBeforePinningColumns=a},[e]);(0,ew.zn)(e,"columnOrderChange",g),b.useEffect(()=>{t.pinnedColumns&&e.current.setPinnedColumns(t.pinnedColumns)},[e,t.pinnedColumns])},sE=(e,t)=>{let{disableColumnPinning:n,pinnedColumns:r,initialState:l}=t,o=(0,eQ.Z)(),i=a0(e.current.state);null==i&&(i=a0(sI(e.current.state,{disableColumnPinning:n,pinnedColumns:r,initialState:l},e)));let a=b.useRef([]),s=b.useCallback(t=>{let r;if(0===t.orderedFields.length||n)return t;let[l,s]=sf(i,t.orderedFields,"rtl"===o.direction),u=[...l,...s],{orderedFieldsBeforePinningColumns:c}=e.current.caches.columnPinning;if(c){let n=[...r=Array(t.orderedFields.length).fill(null)],l=[...t.orderedFields];a.current.forEach(e=>{if(!u.includes(e)&&t.lookup[e]){let t=c.indexOf(e);r[t]=e,n[t]=e,l.splice(l.indexOf(e),1)}}),u.forEach(e=>{let o=c.indexOf(e);if((-1===o||o>=n.length)&&(o=t.orderedFields.indexOf(e)),null!==n[o])for(o=0;null!==n[o];)o+=1;r[o]=e,n[o]=e,l.splice(l.indexOf(e),1)});let o=0;l.forEach(e=>{for(;null!==n[o];)o+=1;n[o]=e,r[o]=e}),e.current.caches.columnPinning.orderedFieldsBeforePinningColumns=n}else r=[...t.orderedFields],e.current.caches.columnPinning.orderedFieldsBeforePinningColumns=[...t.orderedFields];a.current=u;let d=r.filter(e=>!l.includes(e)&&!s.includes(e));return(0,m.Z)({},t,{orderedFields:[...l,...d,...s]})},[e,n,i,o.direction]);eA(e,"hydrateColumns",s)},sM=e=>{let{classes:t,isExpanded:n}=e;return(0,Z.Z)({root:["detailPanelToggleCell",n&&"detailPanelToggleCell--expanded"]},z.d,t)};function sP(e){var t;let{id:n,value:r}=e,l=aP(),o=(0,aT.l)(),i=sM({classes:l.classes,isExpanded:r}),a=(0,C.P)(o,sa),s=b.isValidElement(a[n]),u=r?l.slots.detailPanelCollapseIcon:l.slots.detailPanelExpandIcon;return(0,_.jsx)(l.slots.baseIconButton,(0,m.Z)({size:"small",tabIndex:-1,disabled:!s,className:i.root,"aria-label":r?o.current.getLocaleText("collapseDetailPanel"):o.current.getLocaleText("exp
14andDetailPanel")},null==(t=l.slotProps)?void 0:t.baseIconButton,{children:(0,_.jsx)(u,{fontSize:"inherit"})}))}let sT="__detail_panel_toggle__",sZ=(0,m.Z)({},eX.z,{field:sT,type:"detailPanelToggle",editable:!1,sortable:!1,filterable:!1,resizable:!1,aggregable:!1,disableColumnMenu:!0,disableReorder:!0,disableExport:!0,align:"left",width:40,valueGetter:e=>si(e.api.state).includes(e.id),renderCell:e=>(0,_.jsx)(sP,(0,m.Z)({},e)),renderHeader:()=>null}),sF=(e,t)=>{var n,r,l;return(0,m.Z)({},e,{detailPanel:{heightCache:{},expandedRowIds:null!=(n=null!=(r=t.detailPanelExpandedRowIds)?r:null==(l=t.initialState)||null==(l=l.detailPanel)?void 0:l.expandedRowIds)?n:[]}})};function sD(e,t,n,r){if("function"!=typeof t)return{};let l=(0,Y.yM)(e),o=l.reduce((n,r)=>{let l=e.current.getRowParams(r);return n[r]=t(l),n},{}),i=l.reduce((t,l)=>{var i;if(null==o[l])return t;let a=n(e.current.getRowParams(l)),s="auto"===a;return t[l]={autoHeight:s,height:s?null==(i=r[l])?void 0:i.height:a},t},{});return{contentCache:o,heightCache:i}}let sA=(e,t)=>{let n=(0,C.P)(e,si),r=(0,C.P)(e,sa),l=b.useCallback((n,l)=>{if(n.field!==sT||null==t.getDetailPanelContent)return;let o=r[n.id];b.isValidElement(o)&&l.target!==l.currentTarget&&e.current.toggleDetailPanel(n.id)},[e,r,t.getDetailPanelContent]),o=b.useCallback((n,r)=>{null!=t.getDetailPanelContent&&n.field===sT&&" "===r.key&&e.current.toggleDetailPanel(n.id)},[e,t.getDetailPanelContent]);(0,ew.zn)(e,"cellClick",l),(0,ew.zn)(e,"cellKeyDown",o),e.current.registerControlState({stateId:"detailPanels",propModel:t.detailPanelExpandedRowIds,propOnChange:t.onDetailPanelExpandedRowIdsChange,stateSelector:si,changeEvent:"detailPanelsExpandedRowIdsChange"});let i=b.useCallback(n=>{if(null==t.getDetailPanelContent)return;let l=r[n];if(!b.isValidElement(l))return;let o=e.current.getExpandedDetailPanels();e.current.setExpandedDetailPanels(o.includes(n)?o.filter(e=>e!==n):[...o,n])},[e,r,t.getDetailPanelContent]),a=b.useCallback(()=>si(e.current.state),[e]),s=b.useCallback(t=>{e.current.setState(e=>(0,m.Z)({},e,{detailPanel:(0,m.Z)({},e.detailPanel,{expandedRowIds:t})})),e.current.forceUpdate()},[e]),u=b.useCallback((t,n)=>{let r=ss(e.current.state);r[t]&&r[t].height!==n&&(e.current.setState(e=>(0,m.Z)({},e,{detailPanel:(0,m.Z)({},e.detailPanel,{heightCache:(0,m.Z)({},r,{[t]:(0,m.Z)({},r[t],{height:n})})})})),e.current.requestPipeProcessorsApplication("rowHeight"))},[e]),c=b.useCallback(t=>{let n=ss(e.current.state);return!!n[t]&&n[t].autoHeight},[e]);eh(e,{toggleDetailPanel:i,getExpandedDetailPanels:a,setExpandedDetailPanels:s},"public"),eh(e,{storeDetailPanelHeight:u,detailPanelHasAutoHeight:c},"private"),b.useEffect(()=>{t.detailPanelExpandedRowIds&&si(e.current.state)!==t.detailPanelExpandedRowIds&&e.current.setExpandedDetailPanels(t.detailPanelExpandedRowIds)},[e,t.detailPanelExpandedRowIds]);let d=b.useCallback(()=>{e.current.setState(n=>(0,m.Z)({},n,{detailPanel:(0,m.Z)({},n.detailPanel,sD(e,t.getDetailPanelContent,t.getDetailPanelHeight,n.detailPanel.heightCache))})),e.current.forceUpdate()},[e,t.getDetailPanelContent,t.getDetailPanelHeight]);(0,ew.zn)(e,"sortedRowsSet",d);let p=b.useRef(),h=b.useRef(),f=b.useCallback(()=>{(t.getDetailPanelContent!==p.current||t.getDetailPanelHeight!==h.current)&&(e.current.setState(n=>(0,m.Z)({},n,{detailPanel:(0,m.Z)({},n.detailPanel,sD(e,t.getDetailPanelContent,t.getDetailPanelHeight,n.detailPanel.heightCache))})),p.current=t.getDetailPanelContent,h.current=t.getDetailPanelHeight)},[e,t.getDetailPanelContent,t.getDetailPanelHeight]),g=b.useCallback((t,r)=>{var l;if(!n||0===n.length||!n.includes(r.id))return t.detail=0,t;f();let o=su(e);return t.detail=null!=(l=o[r.id])?l:0,t},[e,n,f]);eA(e,"rowHeight",g);let v=b.useRef(!0);v.current&&(v.current=!1,f())},sO=(e,t)=>{let n=b.useCallback(n=>(null==t.getDetailPanelContent?n.lookup[sT]&&(delete n.lookup[sT],n.orderedFields=n.orderedFields.filter(e=>e!==sT)):n.lookup[sT]||(n.orderedFields=[sT,...n.orderedFields],n.lookup[sT]=(0,m.Z)({},sZ,{headerName:e.current.getLocaleText("detailPanelToggle")})),n),[e,t.getDetailPanelContent]),r=b.useCallback((n,r)=>null!=t.getDetailPanelContent&&si(e.current.state).includes(r)?[...n,z._["row--detailPanelExpanded"]]:n,[e,t.getDetailPanelContent]);eA(e,"hydrateColumns",n),eA(e,"rowClassName",r)},sz=e=>{let{isDraggable:t,classes:n}=e;return(0,Z.Z)({root:["rowReorderCell",t&&"rowReorderCell--draggable"],placeholder:["rowReorderCellPlaceholder"]},z.d,n)};function sj(e){let t=(0,e5.l)(),n=aP(),r=(0,C.P)(t,ea.Gm),l=(0,C.P)(t,Y.Lq),o=(0,C.P)(t,nr),i=e.row.__reorder__||e.id,a=b.useMemo(()=>!!n.rowReordering&&!r.length&&1===l&&0===Object.keys(o).length,[n.rowReordering,r,l,o]),s=sz({isDraggable:a,classes:n.classes}),u=b.useCallback((n,r)=>l=>{!tm(l)&&t.current.getRow(e.id)&&(t.current.publishEvent(n,t.current.getRowParams(e.id),l),r&&r(l))},[t,e.id]),c=a?{onDragStart:u("rowDragStart"),onDragOver:u("rowDragOver"),onDragEnd:u("rowDragEnd")}:null;return"footer"===e.rowNode.type?null:(0,_.jsxs)("div",(0,m.Z)({className:s.root,draggable:a},c,{children:[(0,_.jsx)(n.slots.rowReorderIcon,{}),(0,_.jsx)("div",{className:s.placeholder,children:i})]}))}let sL=(0,m.Z)({},eX.z,{field:"__reorder__",type:"reorder",sortable:!1,filterable:!1,width:50,align:"center",headerAlign:"center",disableColumnMenu:!0,disableExport:!0,disableReorder:!0,resizable:!1,aggregable:!1,renderHeader:()=>" ",renderCell:e=>"footer"===e.rowNode.type||"pinnedRow"===e.rowNode.type?null:(0,_.jsx)(sj,(0,m.Z)({},e))});var sH=((f=sH||{})[f.UP=0]="UP",f[f.DOWN=1]="DOWN",f);
14let sB=null,sN={previousTargetId:null,dragDirection:null},sV=e=>{let{classes:t}=e;return(0,Z.Z)({rowDragging:["row--dragging"]},z.d,t)},s$=(e,t)=>{let n=eG(e,"useGridRowReorder"),r=(0,C.P)(e,ea.Gm),l=(0,C.P)(e,Y.Lq),o=b.useRef(null),i=b.useRef(null),a=b.useRef(),s=sV({classes:t.classes}),[u,c]=b.useState("");b.useEffect(()=>()=>{clearTimeout(a.current)},[]);let d=b.useMemo(()=>!t.rowReordering||!!r.length||1!==l,[t.rowReordering,r,l]),p=b.useCallback((t,r)=>{let l=nr(e.current.state);d||0!==Object.keys(l).length||(n.debug(`Start dragging row ${t.id}`),r.stopPropagation(),o.current=r.currentTarget,o.current.classList.add(s.rowDragging),c(t.id),a.current=setTimeout(()=>{o.current.classList.remove(s.rowDragging)}),i.current=e.current.getRowIndexRelativeToVisibleRows(t.id),e.current.setCellFocus(t.id,sL.field))},[d,s.rowDragging,n,e]),h=b.useCallback((t,r)=>{if(""===u)return;let l=e.current.getRowNode(t.id);if(!l||"footer"===l.type||"pinnedRow"===l.type)return;n.debug(`Dragging over row ${t.id}`),r.preventDefault(),r.stopPropagation();let o=sB?sB.y-r.clientY:r.clientY;if(t.id!==u){let n=e.current.getRowIndexRelativeToVisibleRows(t.id),r={dragDirection:o>0?sH.DOWN:sH.UP,previousTargetId:t.id},l=r.dragDirection!==sN.dragDirection||r.previousTargetId!==sN.previousTargetId;(null===sN.dragDirection||Math.abs(o)>=1&&l)&&(e.current.setRowIndex(u,n),sN=r)}sB={x:r.clientX,y:r.clientY}},[e,n,u]),f=b.useCallback((t,r)=>{let l=nr(e.current.state);if(""!==u&&!d&&0===Object.keys(l).length){if(n.debug("End dragging row"),r.preventDefault(),r.stopPropagation(),clearTimeout(a.current),o.current=null,sN.dragDirection=null,"none"===r.dataTransfer.dropEffect)e.current.setRowIndex(u,i.current),i.current=null;else{let n={row:e.current.getRow(u),targetIndex:e.current.getRowIndexRelativeToVisibleRows(t.id),oldIndex:i.current};e.current.publishEvent("rowOrderChange",n)}c("")}},[d,n,e,u]);(0,ew.zn)(e,"rowDragStart",p),(0,ew.zn)(e,"rowDragOver",h),(0,ew.zn)(e,"rowDragEnd",f),(0,ew.zn)(e,"cellDragOver",h),(0,ew.x3)(e,"rowOrderChange",t.onRowOrderChange)},sU=e=>{let{classes:t}=e;return b.useMemo(()=>(0,Z.Z)({rowReorderCellContainer:["rowReorderCellContainer"],columnHeaderReorder:["columnHeaderReorder"]},z.d,t),[t])},sG=(e,t)=>{let n=sU({classes:t.classes}),r=b.useCallback(r=>{let l=(0,m.Z)({},sL,{cellClassName:n.rowReorderCellContainer,headerClassName:n.columnHeaderReorder,headerName:e.current.getLocaleText("rowReorderingHeaderName")}),o=t.rowReordering,i=null!=r.lookup[l.field];return o&&i||(o&&!i?(r.lookup[l.field]=l,r.orderedFields=[l.field,...r.orderedFields]):!o&&i&&(delete r.lookup[l.field],r.orderedFields=r.orderedFields.filter(e=>e!==l.field))),r},[e,n,t.rowReordering]);eA(e,"hydrateColumns",r)};function sq({lazyLoadingFeatureFlag:e,rowsLoadingMode:t,gridDimensions:n}){return!e||!n||"server"!==t}let sW=(e,t)=>{var n;let r=td(e,t),l=(0,C.P)(e,ea.Gm),o=(0,C.P)(e,ei.uf),i=b.useRef({firstRowToRender:0,lastRowToRender:0}),{lazyLoading:a}=null!=(n=t.experimentalFeatures)?n:{},s=b.useCallback(()=>{let n=e.current.getRenderContext(),[l,o]=od({firstIndex:n.firstRowIndex,lastIndex:n.lastRowIndex,minFirstIndex:0,maxLastIndex:r.rows.length,buffer:t.rowBuffer});return{firstRowToRender:l,lastRowToRender:o}},[e,t.rowBuffer,r.rows.length]),u=b.useCallback(n=>{let s=e.current.getRootDimensions();if(sq({lazyLoadingFeatureFlag:a,rowsLoadingMode:t.rowsLoadingMode,gridDimensions:s}))return;let u={firstRowToRender:n.firstRowToRender,lastRowToRender:n.lastRowToRender,sortModel:l,filterModel:o};if(i.current.firstRowToRender!==n.firstRowToRender||i.current.lastRowToRender!==n.lastRowToRender){if(0===l.length&&0===o.items.length){let t=function({apiRef:e,visibleRows:t,range:n}){let{firstRowIndex:r,lastRowIndex:l}=n,o=t.slice(n.firstRowIndex,n.lastRowIndex),i=0,a=o.length-1,s=!1;for(;!s&&r<l;){var u,c;let t=(null==(u=e.current.getRowNode(o[i].id))?void 0:u.type)==="skeletonRow",n=(null==(c=e.current.getRowNode(o[a].id))?void 0:c.type)==="skeletonRow";t&&n&&(s=!0),t||(i+=1,r+=1),n||(a-=1,l-=1)}return s?{firstRowIndex:r,lastRowIndex:l}:void 0}({apiRef:e,visibleRows:r.rows,range:{firstRowIndex:n.firstRowToRender,lastRowIndex:n.lastRowToRender}});if(!t)return;u.firstRowToRender=t.firstRowIndex,u.lastRowToRender=t.lastRowIndex}i.current=n,e.current.publishEvent("fetchRows",u)}},[e,t.rowsLoadingMode,l,o,r.rows,a]),c=b.useCallback(n=>{let r=e.current.getRootDimensions();if(sq({lazyLoadingFeatureFlag:a,rowsLoadingMode:t.rowsLoadingMode,gridDimensions:r}))return;e.current.requestPipeProcessorsApplication("hydrateRows");let{firstRowToRender:l,lastRowToRender:i}=s();e.current.publishEvent("fetchRows",{firstRowToRender:l,lastRowToRender:i,sortModel:n,filterModel:o})},[e,t.rowsLoadingMode,o,a,s]),d=b.useCallback(n=>{let r=e.current.getRootDimensions();if(sq({lazyLoadingFeatureFlag:a,rowsLoadingMode:t.rowsLoadingMode,gridDimensions:r}))return;e.current.requestPipeProcessorsApplication("hydrateRows");let{firstRowToRender:o,lastRowToRender:i}=s();e.current.publishEvent("fetchRows",{firstRowToRender:o,lastRowToRender:i,sortModel:l,filterModel:n})},[e,t.rowsLoadingMode,l,a,s]);(0,ew.zn)(e,"renderedRowsIntervalChange",u),(0,ew.zn)(e,"sortModelChange",c),(0,ew.zn)(e,"filterModelChange",d),(0,ew.x3)(e,"fetchRows",t.onFetchRows)},sK=e=>`auto-generated-skeleton-row-root-${e}`,sY=(e,t)=>{var n;let{lazyLoading:r}=null!=(n=t.experimentalFeatures)?n:{};eA(e,"hydrateRows",b.useCallback(e=>{let n=e.tree[eH.U5];if(!r||"server"!==t.rowsLoadingMode||!t.rowCount||n.children.length>=t.rowCount)return e;let l=(0,m.Z)({},e.tree),o=[...n.children];for(let e=0;e<t.rowCount-n.children.length;e+=1){let t=sK(e);o.push(t);let n={type:"skeletonRow",id:t,parent:eH.U5,depth:0};l[t]=n}return l[eH.U5]=(0,m.Z)({},n,{children:o}),(0,m.Z)({},e,{tree:l})},[t.rowCount,t.rowsLoadingMode,r]))};function sX(e,t){var n,r;let l={topIds:[],bottomIds:[],idLookup:{}};
14return null==e||null==(n=e.top)||n.forEach(e=>{let n=(0,eH.jI)(e,t);l.topIds.push(n),l.idLookup[n]=e}),null==e||null==(r=e.bottom)||r.forEach(e=>{let n=(0,eH.jI)(e,t);l.bottomIds.push(n),l.idLookup[n]=e}),l}let sJ=(e,t,n)=>{var r;return n.current.caches.pinnedRows=sX(t.pinnedRows,t.getRowId),(0,m.Z)({},e,{rows:(0,m.Z)({},e.rows,{additionalRowGroups:(0,m.Z)({},null==(r=e.rows)?void 0:r.additionalRowGroups,{pinnedRows:{top:[],bottom:[]}})})})},sQ=(e,t)=>{let n=b.useCallback(n=>{e.current.caches.pinnedRows=sX(n,t.getRowId),e.current.requestPipeProcessorsApplication("hydrateRows")},[e,t.getRowId]);eh(e,{unstable_setPinnedRows:n},"public");let r=b.useRef(!0);b.useEffect(()=>{if(r.current){r.current=!1;return}e.current.unstable_setPinnedRows(t.pinnedRows)},[e,t.pinnedRows])};function s0({groupingParams:e,rowModel:t,rowId:n,position:r,apiRef:l,isAutoGenerated:o}){var i,a;let s=(0,m.Z)({},e.dataRowIdToModelLookup),u=(0,m.Z)({},e.dataRowIdToIdLookup),c=(0,m.Z)({},e.tree),d=(0,m.Z)({},e.treeDepths);az({type:"pinnedRow",id:n,depth:0,parent:eH.U5,isAutoGenerated:o},c,d,null),o||(s[n]=t,u[n]=n),l.current.caches.rows.dataRowIdToModelLo
14okup[n]=(0,m.Z)({},t),l.current.caches.rows.dataRowIdToIdLookup[n]=n;let p=(null==(i=e.additionalRowGroups)?void 0:i.pinnedRows)||{},h={id:n,model:t};return null!=(a=e.additionalRowGroups)&&null!=(a=a.pinnedRows)&&null!=(a=a[r])&&a.includes(h)?(0,m.Z)({},e,{dataRowIdToModelLookup:s,dataRowIdToIdLookup:u,tree:c,treeDepths:d}):(0,m.Z)({},e,{dataRowIdToModelLookup:s,dataRowIdToIdLookup:u,tree:c,treeDepths:d,additionalRowGroups:(0,m.Z)({},e.additionalRowGroups,{pinnedRows:(0,m.Z)({},p,{[r]:[...p[r]||[],h]})})})}let s1=e=>{let t=b.useCallback(t=>{var n,r,l,o;let i=e.current.caches.pinnedRows||{},a=(0,m.Z)({},t,{additionalRowGroups:(0,m.Z)({},t.additionalRowGroups,{pinnedRows:{}})});if(null==(n=i.topIds)||n.forEach(t=>{a=s0({groupingParams:a,rowModel:i.idLookup[t],rowId:t,position:"top",apiRef:e,isAutoGenerated:!1})}),null==(r=i.bottomIds)||r.forEach(t=>{a=s0({groupingParams:a,rowModel:i.idLookup[t],rowId:t,position:"bottom",apiRef:e,isAutoGenerated:!1})}),null!=(l=i.bottomIds)&&l.length||null!=(o=i.topIds)&&o.length){let e=e=>!a.tree[e]||"pinnedRow"!==a.tree[e].type,t=a.tree[eH.U5];a.tree[eH.U5]=(0,m.Z)({},t,{children:t.children.filter(e)}),a.dataRowIds=a.dataRowIds.filter(e)}return a},[e]);eA(e,"hydrateRows",t)},s2=(e,t)=>{let n=eF(e,t);return ej(n,t),sG(n,t),aJ(n,t),sY(n,t),s1(n),sO(n,t),sE(n,t),e$(n),eU(eq,n,t),eU(tv,n,t),eU(sF,n,t),eU(sI,n,t),eU(t7,n,t),eU(sJ,n,t),eU(ne,n,t),eU(ng,n,t),eU(nv,n,t),eU(nx,n,t),eU(nS,n,t),eU(nM,n,t),eU(nA,n,t),eU(au,n,t),eU(aC,n,t),eU(nB,n,t),eU(iI,n,t),eU(iE,n,t),eU(iO,n,t),eU(ij,n,t),eW(n,t),ak(n),i$(n,t),ty(n,t),s_(n,t),sQ(n,t),!function(e,t){var n,r;let l=eG(e,"useGridColumns"),o=b.useRef(t.columns),i=b.useRef(t8);e.current.registerControlState({stateId:"visibleColumns",propModel:t.columnVisibilityModel,propOnChange:t.onColumnVisibilityModelChange,stateSelector:V.g0,changeEvent:"columnVisibilityModelChange"});let a=b.useCallback(t=>{l.debug("Updating columns state."),e.current.setState(t3(t)),e.current.forceUpdate(),e.current.publishEvent("columnsChange",t.orderedFields)},[l,e]),s=b.useCallback(t=>(0,V.WH)(e)[t],[e]),u=b.useCallback(()=>(0,V.d$)(e),[e]),c=b.useCallback(()=>(0,V.FE)(e),[e]),d=b.useCallback((t,n=!0)=>(n?(0,V.FE)(e):(0,V.d$)(e)).findIndex(e=>e.field===t),[e]),p=b.useCallback(t=>{let n=d(t);return(0,V.Ag)(e)[n]},[e,d]),h=b.useCallback(t=>{(0,V.g0)(e)!==t&&(e.current.setState(n=>(0,m.Z)({},n,{columns:t2({apiRef:e,columnTypes:t8,columnsToUpsert:[],initialState:void 0,columnVisibilityModel:t,keepOnlyColumnsToUpsert:!1})})),e.current.forceUpdate())},[e,t8]),f=b.useCallback(t=>{a(t2({apiRef:e,columnTypes:t8,columnsToUpsert:t,initialState:void 0,keepOnlyColumnsToUpsert:!1}))},[e,a,t8]),g=b.useCallback((t,n)=>{var r;let l=(0,V.g0)(e);if(n!==(null==(r=l[t])||r)){let r=(0,m.Z)({},l,{[t]:n});e.current.setColumnVisibilityModel(r)}},[e]),v=b.useCallback(t=>(0,V.Zi)(e).findIndex(e=>e===t),[e]),y=b.useCallback((t,n)=>{let r=(0,V.Zi)(e),o=v(t);if(o===n)return;l.debug(`Moving column ${t} to index ${n}`);let i=[...r],s=i.splice(o,1)[0];i.splice(n,0,s),a((0,m.Z)({},(0,V.wH)(e.current.state),{orderedFields:i}));let u={column:e.current.getColumn(t),targetIndex:e.current.getColumnIndexRelativeToVisibleColumns(t),oldIndex:o};e.current.publishEvent("columnIndexChange",u)},[e,l,a,v]),x=b.useCallback((t,n)=>{var r,o;l.debug(`Updating column ${t} width to ${n}`);let i=(0,V.wH)(e.current.state),s=i.lookup[t],u=(0,m.Z)({},s,{width:n,hasBeenResized:!0});a(tQ((0,m.Z)({},i,{lookup:(0,m.Z)({},i.lookup,{[t]:u})}),null!=(r=null==(o=e.current.getRootDimensions())?void 0:o.viewportInnerSize.width)?r:0)),e.current.publishEvent("columnWidthChange",{element:e.current.getColumnHeaderElement(t),colDef:u,width:n})},[e,l,a]);eh(e,{getColumn:s,getAllColumns:u,getColumnIndex:d,getColumnPosition:p,getVisibleColumns:c,getColumnIndexRelativeToVisibleColumns:v,updateColumns:f,setColumnVisibilityModel:h,setColumnVisibility:g,setColumnWidth:x},"public"),eh(e,{setColumnIndex:y},t.signature===ew.cG.DataGrid?"private":"public");let w=b.useCallback((n,r)=>{var l,o;let i={},a=(0,V.g0)(e);(!r.exportOnlyDirtyModels||null!=t.columnVisibilityModel||Object.keys(null!=(l=null==(o=t.initialState)||null==(o=o.columns)?void 0:o.columnVisibilityModel)?l:{}).length>0||Object.keys(a).length>0)&&(i.columnVisibilityModel=a),i.orderedFields=(0,V.Zi)(e);let s=(0,V.d$)(e),u={};
14return s.forEach(e=>{if(e.hasBeenResized){let t={};tJ.forEach(n=>{let r=e[n];r===1/0&&(r=-1),t[n]=r}),u[e.field]=t}}),Object.keys(u).length>0&&(i.dimensions=u),(0,m.Z)({},n,{columns:i})},[e,t.columnVisibilityModel,null==(n=t.initialState)?void 0:n.columns]),C=b.useCallback((t,n)=>{var r;let l=null==(r=n.stateToRestore.columns)?void 0:r.columnVisibilityModel,o=n.stateToRestore.columns;if(null==l&&null==o)return t;let i=t2({apiRef:e,columnTypes:t8,columnsToUpsert:[],initialState:o,columnVisibilityModel:l,keepOnlyColumnsToUpsert:!1});return e.current.setState(t3(i)),null!=o&&e.current.publishEvent("columnsChange",i.orderedFields),t},[e,t8]),S=b.useCallback((e,n)=>{if(n===t6.y.columns){var r;let e=t.slots.columnsPanel;return(0,_.jsx)(e,(0,m.Z)({},null==(r=t.slotProps)?void 0:r.columnsPanel))}return e},[t.slots.columnsPanel,null==(r=t.slotProps)?void 0:r.columnsPanel]);eA(e,"columnMenu",b.useCallback(e=>t.disableColumnSelector?e:[...e,"columnMenuColumnsItem"],[t.disableColumnSelector])),eA(e,"exportState",w),eA(e,"restoreState",C),eA(e,"preferencePanel",S);let k=b.useRef(null);(0,ew.zn)(e,"viewportInnerSizeChange",t=>{k.current!==t.width&&(k.current=t.width,a(tQ((0,V.wH)(e.current.state),t.width)))});let I=b.useCallback(()=>{l.info("Columns pipe processing have changed, regenerating the columns"),a(t2({apiRef:e,columnTypes:t8,columnsToUpsert:[],initialState:void 0,keepOnlyColumnsToUpsert:!1}))},[e,l,a,t8]);tx(e,"hydrateColumns",I);let R=b.useRef(!0);b.useEffect(()=>{if(R.current){R.current=!1;return}if(l.info(`GridColumns have changed, new length ${t.columns.length}`),o.current===t.columns&&i.current===t8)return;let n=t2({apiRef:e,columnTypes:t8,initialState:void 0,columnsToUpsert:t.columns,keepOnlyColumnsToUpsert:!0});o.current=t.columns,i.current=t8,a(n)},[l,e,a,t.columns,t8]),b.useEffect(()=>{void 0!==t.columnVisibilityModel&&e.current.setColumnVisibilityModel(t.columnVisibilityModel)},[e,l,t.columnVisibilityModel])}(n,t),nt(n,t),!function(e,t){let{getRowId:n}=t,r=b.useCallback(t=>({field:t,colDef:e.current.getColumn(t)}),[e]),l=b.useCallback(t=>{let n=e.current.getRow(t);if(!n)throw new lz(`No row with id #${t} found`);return{id:t,columns:e.current.getAllColumns(),row:n}},[e]),o=b.useCallback((t,n)=>{let r=e.current.getRow(t),l=e.current.getRowNode(t);if(!r||!l)throw new lz(`No row with id #${t} found`);let o=(0,es.TR)(e),i=(0,es.d6)(e);return{id:t,field:n,row:r,rowNode:l,value:r[n],colDef:e.current.getColumn(n),cellMode:e.current.getCellMode(t,n),api:e.current,hasFocus:null!==o&&o.field===n&&o.id===t,tabIndex:i&&i.field===n&&i.id===t?0:-1}},[e]),i=b.useCallback((t,n)=>{let r=e.current.getColumn(n),l=e.current.getCellValue(t,n),o=e.current.getRow(t),i=e.current.getRowNode(t);if(!o||!i)throw new lz(`No row with id #${t} found`);let a=(0,es.TR)(e),s=(0,es.d6)(e),u={id:t,field:n,row:o,rowNode:i,colDef:r,cellMode:e.current.getCellMode(t,n),hasFocus:null!==a&&a.field===n&&a.id===t,tabIndex:s&&s.field===n&&s.id===t?0:-1,value:l,formattedValue:l,isEditable:!1};return r&&r.valueFormatter&&(u.formattedValue=r.valueFormatter({id:t,field:u.field,value:u.value,api:e.current})),u.isEditable=r&&e.current.isCellEditable(u),u},[e]),a=b.useCallback((t,n)=>{let r=e.current.getColumn(n);if(!r||!r.valueGetter){let r=e.current.getRow(t);if(!r)throw new lz(`No row with id #${t} found`);return r[n]}return r.valueGetter(o(t,n))},[e,o]),s=b.useCallback((e,t)=>{var r;let l=eH._1 in e?e[eH._1]:null!=(r=null==n?void 0:n(e))?r:e.id,i=t.field;return t&&t.valueGetter?t.valueGetter(o(l,i)):e[i]},[o,n]),u=b.useCallback((t,r)=>{var l;let o=s(t,r);if(!r||!r.valueFormatter)return o;let i=null!=(l=n?n(t):t.id)?l:t[eH._1],a=r.field;return r.valueFormatter({id:i,field:a,value:o,api:e.current})},[e,n,s]),c=b.useCallback(t=>e.current.rootElementRef.current?e.current.rootElementRef.current.querySelector(`[role="columnheader"][data-field="${tf(t)}"]`):null,[e]),d=b.useCallback(t=>e.current.rootElementRef.current?e.current.rootElementRef.current.querySelector(tg(t)):null,[e]),p=b.useCallback((t,n)=>e.current.rootElementRef.current?function(e,{id:t,field:n}){let r=tg(t),l=`.${z._.cell}[data-field="${tf(n)}"]`,o=`${r} ${l}`;return e.querySelector(o)}(e.current.rootElementRef.current,{id:t,field:n}):null,[e]);eh(e,{getCellValue:a,getCellParams:i,getCellElement:p,getRowValue:s,getRowFormattedValue:u,getRowParams:l,getRowElement:d,getColumnHeaderParams:r,getColumnHeaderElement:c},"public")}(n,t),sA(n,t),iU(n),iz(n,t),nm(n,t),ny(n,t),nk(n,t),nF(n,t),nw(n,t),nO(n,t),ac(n,t),aS(n,t),nN(n,t),i_(n,t),s$(n,t),iq(n,t),an(n,t),sW(n,t),iM(n),i4(n,t),i5(n,t),i8(n,t),!function(e,t){let n=eG(e,"useResizeContainer"),r=b.useRef(!1),l=b.useRef(null),o=b.useRef(null),i=(0,C.P)(e,ol),a=(0,C.P)(e,N.CD),s=Math.floor(t.rowHeight*a),u=t9(e,t.columnHeaderHeight),c=b.useCallback(()=>{var n;let r,a,s,c;let d=null==(n=e.current.rootElementRef)?void 0:n.current,p=(0,V.iD)(e),h=(0,eH.oq)(e);if(!l.current)return;if(null!=t.scrollbarSize)r=t.scrollbarSize;else if(p&&d){let e=(0,nb.Z)(d).createElement("div");e.style.width="99px",e.style.height="99px",e.style.position="absolute",e.style.overflow="scroll",e.className="scrollDiv",d.appendChild(e),r=e.offsetWidth-e.clientWidth,d.removeChild(e)}else r=0;if(t.autoHeight)c=!1,s=Math.round(p)>Math.round(l.current.width),a={width:l.current.width,height:i.currentPageTotalHeight+(s?r:0)};else{a={width:l.current.width,height:Math.max(l.current.height-u,0)};let e=ae({content:{width:Math.round(p),height:i.currentPageTotalHeight},container:{width:Math.round(a.width),height:a.height-h.top-h.bottom},scrollBarSize:r});c=e.hasScrollY,s=e.hasScrollX}let f={width:a.width-(c?r:0),height:a.height-(s?r:0)},g={viewportOuterSize:a,viewportInnerSize:f,hasScrollX:s,hasScrollY:c,scrollBarSize:r},m=o.current;o.current=g,(g.viewportInnerSize.width!==(null==m?void 0:m.viewportInnerSize.width)||g.viewportInnerSize.height!==(null==m?void 0:m.viewportInnerSize.height))&&e.current.publishEvent("viewportInnerSizeChange",g.viewportInnerSize)},[e,t.scrollbarSize,t.autoHeight,i.currentPageTotalHeight,u]),[d,p]=b.useState(),h=b.useMemo(()=>(0,nV.Z)(p,60),[]),f=b.useRef();(0,D.Z)(()=>{d&&(c(),e.current.publishEvent("debouncedResize",l.current))},[e,d,c]);let g=b.useCallback(()=>{e.current.computeSizeAndPublishResizeEvent()},[e]),m=b.useCallback(()=>o.current,[]),v=b.useCallback(()=>{let n=e.current.getRootDimensions();if(!n)return 0;let r=tc(e,{pagination:t.pagination,paginationMode:t.paginationMode});if(t.getRowHeight){let t=e.current.getRenderContext();return Math.min(t.lastRowIndex-t.firstRowIndex-1,r.rows.length)}return Math.min(Math.floor(n.viewportInnerSize.height/s),r.rows.length)},[e,t.pagination,t.paginationMode,t.getRowHeight,s]),y=b.useCallback(()=>{var t,n,r;let l=null==(t=e.current.mainElementRef)?void 0:t.current;if(!l)return;let o=(0,i7.Z)(l).getComputedStyle(l),i=parseFloat(o.height)||0,a=parseFloat(o.width)||0,s=i!==(null==(n=f.current)?void 0:n.height),u=a!==(null==(r=f.current)?void 0:r.width);if(!f.current||s||u){let t={width:a,height:i};e.current.publishEvent("resize",t),f.current=t}},[e]);eh(e,{resize:g,getRootDimensions:m},"public"),eh(e,{getViewportPageSize:v,updateGridDimensionsRef:c,computeSizeAndPublishResizeEvent:y},"private");let x=b.useRef(!0),w=b.useCallback(e=>{l.current=e;let o=/jsdom/.test(window.navigator.userAgent);if(0!==e.height||r.current||t.autoHeight||o||(n.error("The parent DOM element of the data grid has an empty he
14ight.\nPlease make sure that this element has an intrinsic height.\nThe grid displays with a height of 0px.\n\nMore details: https://mui.com/r/x-data-grid-no-dimensions."),r.current=!0),0!==e.width||r.current||o||(n.error("The parent DOM element of the data grid has an empty width.\nPlease make sure that this element has an intrinsic width.\nThe grid displays with a width of 0px.\n\nMore details: https://mui.com/r/x-data-grid-no-dimensions."),r.current=!0),x.current){p(e),x.current=!1;return}h(e)},[t.autoHeight,h,n]);(0,D.Z)(()=>c(),[c]),(0,ew.x3)(e,"sortedRowsSet",c),(0,ew.x3)(e,"paginationModelChange",c),(0,ew.x3)(e,"columnsChange",c),(0,ew.zn)(e,"resize",w),(0,ew.x3)(e,"debouncedResize",t.onResize)}(n,t),(0,ew.x3)(n,"columnHeaderClick",t.onColumnHeaderClick),(0,ew.x3)(n,"columnHeaderDoubleClick",t.onColumnHeaderDoubleClick),(0,ew.x3)(n,"columnHeaderOver",t.onColumnHeaderOver),(0,ew.x3)(n,"columnHeaderOut",t.onColumnHeaderOut),(0,ew.x3)(n,"columnHeaderEnter",t.onColumnHeaderEnter),(0,ew.x3)(n,"columnHeaderLeave",t.onColumnHeaderLeave),(0,ew.x3)(n,"cellClick",t.onCellClick),(0,ew.x3)(n,"cellDoubleClick",t.onCellDoubleClick),(0,ew.x3)(n,"cellKeyDown",t.onCellKeyDown),(0,ew.x3)(n,"preferencePanelClose",t.onPreferencePanelClose),(0,ew.x3)(n,"preferencePanelOpen",t.onPreferencePanelOpen),(0,ew.x3)(n,"menuOpen",t.onMenuOpen),(0,ew.x3)(n,"menuClose",t.onMenuClose),(0,ew.x3)(n,"rowDoubleClick",t.onRowDoubleClick),(0,ew.x3)(n,"rowClick",t.onRowClick),(0,ew.x3)(n,"stateChange",t.onStateChange),at(n),!function(e,t){let n=t=>{e.current.setState(e=>(0,m.Z)({},e,{virtualization:(0,m.Z)({},e.virtualization,{enabled:t})}))};eh(e,{unstable_setVirtualization:n,unstable_setColumnVirtualization:t=>{e.current.setState(e=>(0,m.Z)({},e,{virtualization:(0,m.Z)({},e.virtualization,{enabledForColumns:t})}))}},"public"),b.useEffect(()=>{n(!t.disableVirtualization)},[t.disableVirtualization])}(n,t),n};var s3=n(29567);let s4={noRowsLabel:"No rows",noResultsOverlayLabel:"No results found.",toolbarDensity:"Density",toolbarDensityLabel:"Density",toolbarDensityCompact:"Compact",toolbarDensityStandard:"Standard",toolbarDensityComfortable:"Comfortable",toolbarColumns:"Columns",toolbarColumnsLabel:"Select columns",toolbarFilters:"Filters",toolbarFiltersLabel:"Show filters",toolbarFiltersTooltipHide:"Hide filters",toolbarFiltersTooltipShow:"Show filters",toolbarFiltersTooltipActive:e=>1!==e?`${e} active filters`:`${e} active filter`,toolbarQuickFilterPlaceholder:"Search…",toolbarQuickFilterLabel:"Search",toolbarQuickFilterDeleteIconLabel:"Clear",toolbarExport:"Export",toolbarExportLabel:"Export",toolbarExportCSV:"Download as CSV",toolbarExportPrint:"Print",toolbarExportExcel:"Download as Excel",columnsPanelTextFieldLabel:"Find column",columnsPanelTextFieldPlaceholder:"Column title",columnsPanelDragIconLabel:"Reorder column",columnsPanelShowAllButton:"Show all",columnsPanelHideAllButton:"Hide all",filterPanelAddFilter:"Add filter",filterPanelRemoveAll:"Remove all",filterPanelDeleteIconLabel:"Delete",filterPanelLogicOperator:"Logic operator",filterPanelOperator:"Operator",filterPanelOperatorAnd:"And",filterPanelOperatorOr:"Or",filterPanelColumns:"Columns",filterPanelInputLabel:"Value",filterPanelInputPlaceholder:"Filter value",filterOperatorContains:"contains",filterOperatorEquals:"equals",filterOperatorStartsWith:"starts with",filterOperatorEndsWith:"ends with",filterOperatorIs:"is",filterOperatorNot:"is not",filterOperatorAfter:"is after",filterOperatorOnOrAfter:"is on or after",filterOperatorBefore:"is before",filterOperatorOnOrBefore:"is on or before",filterOperatorIsEmpty:"is empty",filterOperatorIsNotEmpty:"is not empty",filterOperatorIsAnyOf:"is any of","filterOperator=":"=","filterOperator!=":"!=","filterOperator>":">","filterOperator>=":">=","filterOperator<":"<","filterOperator<=":"<=",headerFilterOperatorContains:"Contains",headerFilterOperatorEquals:"Equals",headerFilterOperatorStartsWith:"Starts with",headerFilterOperatorEndsWith:"Ends with",headerFilterOperatorIs:"Is",headerFilterOperatorNot:"Is not",headerFilterOperatorAfter:"Is after",headerFilterOperatorOnOrAfter:"Is on or after",headerFilterOperatorBefore:"Is before",headerFilterOperatorOnOrBefore:"Is on or before",headerFilterOperatorIsEmpty:"Is empty",headerFilterOperatorIsNotEmpty:"Is not empty",headerFilterOperatorIsAnyOf:"Is any of","headerFilterOperator=":"Equals","headerFilterOperator!=":"Not equals","headerFilterOperator>":"Greater than","headerFilterOperator>=":"Greater than or equal to","headerFilterOperator<":"Less than","headerFilterOperator<=":"Less than or equal to",filterValueAny:"any",filterValueTrue:"true",filterValueFalse:"false",columnMenuLabel:"Menu",columnMenuShowColumns:"Show columns",columnMenuManageColumns:"Manage columns",columnMenuFilter:"Filter",columnMenuHideColumn:"Hide column",columnMenuUnsort:"Unsort",columnMenuSortAsc:"Sort by ASC",columnMenuSortDesc:"Sort by DESC",columnHeaderFiltersTooltipActive:e=>1!==e?`${e} active filters`:`${e} active filter`,columnHeaderFiltersLabel:"Show filters",columnHeaderSortIconLabel:"Sort",footerRowSelected:e=>
141!==e?`${e.toLocaleString()} rows selected`:`${e.toLocaleString()} row selected`,footerTotalRows:"Total Rows:",footerTotalVisibleRows:(e,t)=>`${e.toLocaleString()} of ${t.toLocaleString()}`,checkboxSelectionHeaderName:"Checkbox selection",checkboxSelectionSelectAllRows:"Select all rows",checkboxSelectionUnselectAllRows:"Unselect all rows",checkboxSelectionSelectRow:"Select row",checkboxSelectionUnselectRow:"Unselect row",booleanCellTrueLabel:"yes",booleanCellFalseLabel:"no",actionsCellMore:"more",pinToLeft:"Pin to left",pinToRight:"Pin to right",unpin:"Unpin",treeDataGroupingHeaderName:"Group",treeDataExpand:"see children",treeDataCollapse:"hide children",groupingColumnHeaderName:"Group",groupColumn:e=>`Group by ${e}`,unGroupColumn:e=>`Stop grouping by ${e}`,detailPanelToggle:"Detail panel toggle",expandDetailPanel:"Expand",collapseDetailPanel:"Collapse",MuiTablePagination:{},rowReorderingHeaderName:"Row reordering",aggregationMenuItemHeader:"Aggregation",aggregationFunctionLabelSum:"sum",aggregationFunctionLabelAvg:"avg",aggregationFunctionLabelMin:"min",aggregationFunctionLabelMax:"max",aggregationFunctionLabelSize:"size"},s5=["components","componentsProps"],s9=(0,m.Z)({},oB,{columnMenuPinningItem:function(e){let{colDef:t,onClick:n}=e,r=(0,aT.l)(),l=aP(),o=(0,eQ.Z)(),i=b.useCallback(e=>l=>{r.current.pinColumn(t.field,e),n(l)},[r,t.field,n]),a=(0,_.jsxs)(rc.Z,{onClick:i(aQ.left),children:[(0,_.jsx)(oO.Z,{children:(0,_.jsx)(l.slots.columnMenuPinLeftIcon,{fontSize:"small"})}),(0,_.jsx)(oz.Z,{children:r.current.getLocaleText("pinToLeft")})]}),s=(0,_.jsxs)(rc.Z,{onClick:i(aQ.right),children:[(0,_.jsx)(oO.Z,{children:(0,_.jsx)(l.slots.columnMenuPinRightIcon,{fontSize:"small"})}),(0,_.jsx)(oz.Z,{children:r.current.getLocaleText("pinToRight")})]});if(!t)return null;let u=r.current.isColumnPinned(t.field);if(u){let e=u===aQ.right?aQ.left:aQ.right,o=e===aQ.right?"pinToRight":"pinToLeft",a=u===aQ.right?l.slots.columnMenuPinLeftIcon:l.slots.columnMenuPinRightIcon;return(0,_.jsxs)(b.Fragment,{children:[(0,_.jsxs)(rc.Z,{onClick:i(e),children:[(0,_.jsx)(oO.Z,{children:(0,_.jsx)(a,{fontSize:"small"})}),(0,_.jsx)(oz.Z,{children:r.current.getLocaleText(o)})]}),(0,_.jsxs)(rc.Z,{onClick:e=>{r.current.unpinColumn(t.field),n(e)},children:[(0,_.jsx)(oO.Z,{}),(0,_.jsx)(oz.Z,{children:r.current.getLocaleText("unpin")})]})]})}return"rtl"===o.direction?(0,_.jsxs)(b.Fragment,{children:[s,a]}):(0,_.jsxs)(b.Fragment,{children:[a,s]})}}),s6=(0,m.Z)({},oN,{columnMenuPinningItem:{displayOrder:15}}),s8=b.forwardRef(function(e,t){return(0,_.jsx)(oV,(0,m.Z)({ref:t},e,{defaultSlots:s9,defaultSlotProps:s6}))}),s7=["getColumnsToRender","getRootProps"],ue=e=>{let{classes:t}=e;return b.useMemo(()=>(0,Z.Z)({headerFilterRow:["headerFilterRow"]},z.d,t),[t])},ut=(0,en.Z)("div",{name:"MuiDataGrid",slot:"HeaderFilterRow",overridesResolver:(e,t)=>t.headerFilterRow})(()=>({display:"flex"})),un=Object.create(null),ur=e=>{let t=I(),{headerGroupingMaxDepth:n,hasOtherElementInTabSequence:r}=e,l=(0,C.P)(t,es.uT),o=oy((0,m.Z)({},e,{hasOtherElementInTabSequence:r||null!==l})),{getColumnsToRender:i,getRootProps:a}=o,s=(0,M.Z)(o,s7),u=b.useRef(null);t.current.register("private",{headerFiltersElementRef:u});let c=b.useRef(null),d=aP(),p=ue(d),h=!d.unstable_headerFilters,f=Math.floor(d.columnHeaderHeight*e.densityFactor),g=(0,C.P)(t,ei.uf),v=t9(t,d.columnHeaderHeight)+(h?0:f),y=(0,C.P)(t,es.Y$),x=b.useCallback(e=>{let t=null==g?void 0:g.items.find(t=>t.field===e.field&&"isAnyOf"!==t.operator);if(null!=t)return t;let n=un[e.field];if(null!=n)return n;let r=lm(e);return un[e.field]=r,r},[g]),w={minHeight:v,maxHeight:v,lineHeight:`${f}px`};return(0,m.Z)({},s,{getColumnFilters:(t,r={})=>{if(h)return null;let o=i(t);if(null==o)return null;let{renderedColumns:a,firstColumnToRender:s}=o,g=[];for(let t=0;t<a.length;t+=1){var b,v,w;let n=a[t],o=s+t,i=(null==y?void 0:y.field)===n.field,u=0===o,p=(null==l?void 0:l.field)===n.field||u&&!e.hasOtherElementInTabSequence?0:-1,h="function"==typeof n.headerClassName?n.headerClassName({field:n.field,colDef:n}):n.headerClassName,C=null!=(b=null==(v=n.filterOperators)?void 0:v.filter(e=>"isAnyOf"!==e.value))?b:[],S=x(n);g.push((0,_.jsx)(d.slots.headerFilterCell,(0,m.Z)({colIndex:o,height:f,width:n.computedWidth,colDef:n,hasFocus:i,tabIndex:p,headerFilterMenuRef:c,headerClassName:h,filterOperators:C,"data-field":n.field,item:S},null==(w=d.slotProps)?void 0:w.headerFilterCell,r),`${n.field}-filter`))}return(0,_.jsx)(ut,{ref:u,ownerState:d,className:p.headerFilterRow,role:"row","aria-rowindex":n+2,children:g})},getRootProps:h?a:(e={})=>(0,m.Z)({style:w},e)})};var ul=function(){for(var e,t,n=0,r="",l=arguments.length;n<l;n++)(e=arguments[n])&&(t=function e(t){var n,r,l="";if("string"==typeof t||"number"==typeof t)l+=t;else if("object"==typeof t){if(Array.isArray(t)){var o=t.length;for(n=0;n<o;n++)t[n]&&(r=e(t[n]))&&(l&&(l+=" "),l+=r)}else for(r in t)t[r]&&(l&&(l+=" "),l+=r)}return l}(e))&&(r&&(r+=" "),r+=t);return r};let uo=e=>{let{scrollDirection:t,classes:n}=e,r={root:["scrollArea",`scrollArea--${t}`]};return(0,Z.Z)(r,z.d,n)},ui=(0,en.Z)("div",{name:"MuiDataGrid",slot:"ScrollArea",overridesResolver:(e,t)=>[{[`&.${z._["scrollArea--left"]}`]:t["scrollArea--left"]},{[`&.${z._["scrollArea--right"]}`]:t["scrollArea--right"]},t.scrollArea]})(()=>({position:"absolute",top:0,zIndex:101,width:20,bottom:0,[`&.${z._["scrollArea--left"]}`]:{left:0},[`&.${z._["scrollArea--right"]}`]:{right:0}})),ua=b.memo(function(e){let{scrollDirection:t}=e,n=b.useRef(null),r=(0,e5.l)(),l=(0,tI.K)(),[o,i]=b.useState(!1),[a,s]=b.useState(!0),u=(0,C.P)(r,N.CD),c=(0,C.P)(r,V.iD),d=b.useRef({left:0,top:0}),p=aP(),h=(0,m.Z)({},p,{scrollDirection:t}),f=uo(h),g=t9(r,p.columnHeaderHeight),v=Math.floor(p.columnHeaderHeight*u),y=b.useCallback(e=>{d.current=e;let n=r.current.getRootDimensions();s(()=>
14{if("left"===t)return d.current.left>0;if("right"===t){let e=c-n.viewportInnerSize.width;return d.current.left<e}return!1})},[r,c,t]),x=b.useCallback(e=>{let o;if(e.preventDefault(),"left"===t)o=e.clientX-n.current.getBoundingClientRect().right;else if("right"===t)o=Math.max(1,e.clientX-n.current.getBoundingClientRect().left);else throw Error("MUI: Wrong drag direction");o=(o-1)*1.5+1,l.start(0,()=>{r.current.scroll({left:d.current.left+o,top:d.current.top})})},[t,r,l]),w=(0,nn.Z)(()=>{i(!0)}),S=(0,nn.Z)(()=>{i(!1)});return((0,ew.zn)(r,"scrollPositionChange",y),(0,ew.zn)(r,"columnHeaderDragStart",w),(0,ew.zn)(r,"columnHeaderDragEnd",S),o&&a)?(0,_.jsx)(ui,{ref:n,className:ul(f.root),ownerState:h,onDragOver:x,style:{height:v,top:g-v}}):null}),us=["style","className","innerRef","visibleColumns","sortColumnLookup","filterColumnLookup","columnPositions","columnHeaderTabIndexState","columnGroupHeaderTabIndexState","columnHeaderFocus","columnGroupHeaderFocus","densityFactor","headerGroupingMaxDepth","columnMenuState","columnVisibility","columnGroupsHeaderStructure","hasOtherElementInTabSequence","pinnedColumns"],uu=e=>{let{leftPinnedColumns:t,rightPinnedColumns:n,classes:r}=e,l={leftPinnedColumns:["pinnedColumnHeaders",t&&t.length>0&&"pinnedColumnHeaders--left"],rightPinnedColumns:["pinnedColumnHeaders",n&&n.length>0&&"pinnedColumnHeaders--right","withBorderColor"]};return(0,Z.Z)(l,z.d,r)},uc=e=>(e<1?5.11916*e**2:4.5*Math.log(e+1)+2)/100,ud=(0,O.ZP)("div",{name:"MuiDataGrid",slot:"PinnedColumnHeaders",overridesResolver:(e,t)=>[{[`&.${z._["pinnedColumnHeaders--left"]}`]:t["pinnedColumnHeaders--left"]},{[`&.${z._["pinnedColumnHeaders--right"]}`]:t["pinnedColumnHeaders--right"]},t.pinnedColumnHeaders]})(({theme:e,ownerState:t})=>{var n;return(0,m.Z)({position:"absolute",top:0,overflow:"hidden",zIndex:1,display:"flex",flexDirection:"column",boxShadow:e.shadows[2],backgroundColor:(e.vars||e).palette.background.default},e.vars?{backgroundImage:null==(n=e.vars.overlays)?void 0:n[2]}:(0,m.Z)({},"dark"===e.palette.mode&&{backgroundImage:`linear-gradient(${(0,A.Fq)("#fff",uc(2))}, ${(0,A.Fq)("#fff",uc(2))})`}),t.side===aQ.left&&{left:0},t.side===aQ.right&&{right:0},t.side===aQ.right&&t.showCellVerticalBorder&&{borderLeftWidth:"1px",borderLeftStyle:"solid"})});ud.propTypes={ownerState:y().object.isRequired};let up=b.forwardRef(function(e,t){let{className:n,innerRef:r,visibleColumns:l,sortColumnLookup:o,filterColumnLookup:i,columnPositions:a,columnHeaderTabIndexState:s,columnGroupHeaderTabIndexState:u,columnHeaderFocus:c,columnGroupHeaderFocus:d,densityFactor:p,headerGroupingMaxDepth:h,columnMenuState:f,columnVisibility:g,columnGroupsHeaderStructure:v,hasOtherElementInTabSequence:y,pinnedColumns:x}=e,w=(0,M.Z)(e,us),C=aP(),S=(0,aT.l)(),[k,I]=b.useState(0),R=(0,eQ.Z)(),E=(0,nn.Z)(()=>{let e=S.current.getRootDimensions();if(!e)return;let t=e.hasScrollY?e.scrollBarSize:0;k!==t&&I(t)});(0,ew.zn)(S,"virtualScrollerContentSizeChange",E);let P=b.useMemo(()=>l.map(({field:e})=>e),[l]),[T,Z]=sf(x,P,"rtl"===R.direction),{isDragging:F,renderContext:D,getRootProps:A,getInnerProps:O,getColumnHeaders:z,getColumnFilters:j,getColumnGroupHeaders:L}=ur({innerRef:r,visibleColumns:l,sortColumnLookup:o,filterColumnLookup:i,columnPositions:a,columnHeaderTabIndexState:s,hasOtherElementInTabSequence:y,columnGroupHeaderTabIndexState:u,columnHeaderFocus:c,columnGroupHeaderFocus:d,densityFactor:p,headerGroupingMaxDepth:h,columnMenuState:f,columnVisibility:g,columnGroupsHeaderStructure:v,minColumnIndex:T.length}),H=(0,m.Z)({},C,{leftPinnedColumns:T,rightPinnedColumns:Z,classes:C.classes}),B=uu(H),N=D&&T.length?(0,m.Z)({},D,{firstColumnIndex:0,lastColumnIndex:T.length}):null,V=D&&Z.length?(0,m.Z)({},D,{firstColumnIndex:P.length-Z.length,lastColumnIndex:P.length}):null,$=O(),U={role:$.role};return(0,_.jsxs)(oS,(0,m.Z)({ref:t,className:n},A(w),{children:[N&&(0,_.jsxs)(ud,(0,m.Z)({className:B.leftPinnedColumns,ownerState:(0,m.Z)({},H,{side:aQ.left,showCellVerticalBorder:C.showCellVerticalBorder})},U,{children:[L({renderContext:N,minFirstColumn:N.firstColumnIndex,maxLastColumn:N.lastColumnIndex}),z({renderContext:N,minFirstColumn:N.firstColumnIndex,maxLastColumn:N.lastColumnIndex},{disableReorder:!0}),j({renderContext:N,minFirstColumn:N.firstColumnIndex,maxLastColumn:N.lastColumnIndex})]})),(0,_.jsx)(ua,{scrollDirection:"left"}),(0,_.jsxs)(o_,(0,m.Z)({isDragging:F},$,{children:[L({renderContext:D,minFirstColumn:T.length,maxLastColumn:P.length-Z.length}),z({renderContext:D,minFirstColumn:T.length,maxLastColumn:P.length-Z.length}),j({renderContext:D,minFirstColumn:T.length,maxLastColumn:P.length-Z.length})]})),(0,_.jsx)(ua,{scrollDirection:"right"}),V&&(0,_.jsxs)(ud,(0,m.Z)({ownerState:(0,m.Z)({},H,{side:aQ.right,showCellVerticalBorder:C.showCellVerticalBorder}),className:B.rightPinnedColumns,style:{paddingRight:k}},U,{children:[L({renderContext:V,minFirstColumn:V.firstColumnIndex,maxLastColumn:V.lastColumnIndex}),z({renderContext:V,minFirstColumn:V.firstColumnIndex,maxLastColumn:V.lastColumnIndex},{disableReorder:!0,separatorSide:l6.Left}),j({renderContext:V,minFirstColumn:V.firstColumnIndex,maxLastColumn:V.lastColumnIndex})]}))]}))}),uh=["operators","item","field","buttonRef","headerFilterMenuRef"],uf={width:22,height:22,margin:"auto 0 10px 5px"};function ug(e){var t;let{operators:n,item:r,field:l,buttonRef:o,headerFilterMenuRef:i}=e,a=(0,M.Z)(e,uh),s=(0,e0.Z)(),u=(0,e0.Z)(),c=aP(),d=(0,e5.l)(),p=!!(iB(d)===l&&i.current);return c.slots.headerFilterMenu?(0,_.jsxs)(b.Fragment,{children:[(0,_.jsx)(c.slots.baseIconButton,(0,m.Z)({id:s,ref:o,"aria-label":d.current.getLocaleText("filterPanelOperator"),title:d.current.getLocaleText("filterPanelOperator"),"aria-controls":u,"aria-expanded":p?"true":void 0,"aria-haspopup":"true",tabIndex:-1,size:"small",onClick:e=>{i.current=e.currentTarget,d.current.showHeaderFilterMenu(l)},sx:uf},null==(t=c.slotProps)?void 0:t.baseIconButton,{children:(0,_.jsx)(c.slots.openFilterButtonIcon,{fontSize:"small"})})),(0,_.jsx)(c.slots.headerFilterMenu,(0,m.Z)({field:l,open:p,item:r,target:i.current,operators:n,labelledBy:s,id:u},a))]}):null}let um={padding:"2px"};function ub({onClick:e}){var t;let n=aP();return(0,_.jsx)(n.slots.baseIconButton,(0,m.Z)({tabIndex:-1,"aria-label":"Clear filter",size:"small",onClick:e,sx:um},null==(t=n.slotProps)?void 0:t.baseIconButton,{children:(0,_.jsx)(n.slots.columnMenuClearIcon,{fontSize:"inherit"})}))}let uv=["colIndex","height","hasFocus","filterOperators","width","headerClassName","colDef","item","headerFilterMenuRef","InputComponentProps","
14showClearIcon"],uy=e=>{let{colDef:t,classes:n,showColumnVerticalBorder:r}=e,l={root:["columnHeader","left"===t.headerAlign&&"columnHeader--alignLeft","center"===t.headerAlign&&"columnHeader--alignCenter","right"===t.headerAlign&&"columnHeader--alignRight","withBorderColor",r&&"columnHeader--withRightBorder"]};return(0,Z.Z)(l,z.d,n)},ux={'& input[value=""]:not(:focus)':{color:"transparent"}},uw=b.forwardRef((e,t)=>{var n,r,l;let o;let{colIndex:i,height:a,hasFocus:s,filterOperators:u,width:c,headerClassName:d,colDef:p,item:h,headerFilterMenuRef:f,InputComponentProps:g,showClearIcon:v=!0}=e,y=(0,M.Z)(e,uv),x=I(),w=(0,V.pK)(x),C=aP(),S=b.useRef(null),k=(0,F.Z)(t,S),R=b.useRef(null),E=b.useRef(null),P=iH(x)===p.field,Z=iB(x)===p.field,D=u[0],A=p.filterable?D.InputComponent:null,O=b.useCallback(e=>{if(h.value&&!e.value){x.current.deleteFilterItem(e);return}x.current.upsertFilterItem(e)},[x,h]),z=b.useCallback(()=>{x.current.deleteFilterItem(h)},[x,h]);p.renderHeaderFilter&&(o=p.renderHeaderFilter(e)),b.useLayoutEffect(()=>{if(s&&!Z){var e;let t=S.current.querySelector('[tabindex="0"]');P&&A&&(t=R.current);let n=t||S.current;null==n||n.focus(),null!=(e=x.current.columnHeadersContainerElementRef)&&e.current&&(x.current.columnHeadersContainerElementRef.current.scrollLeft=0)}},[A,x,s,P,Z]);let j=b.useCallback(e=>{if(!(Z||(0,tu.Ni)(e.key)))switch(e.key){case"Escape":P&&x.current.stopHeaderFilterEditMode();break;case"Enter":if(P){x.current.stopHeaderFilterEditMode();break}if(e.metaKey||e.ctrlKey){f.current=E.current,x.current.showHeaderFilterMenu(p.field);break}x.current.startHeaderFilterEditMode(p.field);break;case"Tab":if(P){var t;let n=null!=(t=w[i+(e.shiftKey?-1:1)])?t:null;n&&(x.current.startHeaderFilterEditMode(n),x.current.setColumnHeaderFilterFocus(n,e))}break;default:if(P||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)break;x.current.startHeaderFilterEditMode(p.field)}},[x,p.field,i,w,f,P,Z]),L=b.useCallback((e,t)=>n=>{x.current.publishEvent(e,x.current.getColumnHeaderParams(p.field),n),t&&t(n)},[x,p.field]),H=b.useCallback(e=>{s||(R.current&&R.current.contains(e.target)&&R.current.focus(),x.current.setColumnHeaderFilterFocus(p.field,e))},[x,p.field,s]),B=b.useMemo(()=>({onKeyDown:L("headerFilterKeyDown",j),onClick:L("headerFilterClick"),onMouseDown:L("headerFilterMouseDown",H),onBlur:L("headerFilterBlur")}),[H,j,L]),N=uy((0,m.Z)({},C,{colDef:p})),$=(null==u||null==(n=u.find(({value:e})=>h.operator===e))?void 0:n.requiresFilterValue)===!1,U=!!(null==h?void 0:h.value)||$,G=null!=(r=D.headerLabel)?r:x.current.getLocaleText(`headerFilterOperator${(0,T.Z)(h.operator)}`),q=U||s;return(0,_.jsxs)("div",(0,m.Z)({className:ul(N.root,d),ref:k,style:{height:a,width:c,minWidth:c,maxWidth:c},role:"columnheader","aria-colindex":i+1,"aria-label":null==o?null!=(l=p.headerName)?l:p.field:void 0},y,B,{children:[o,A&&void 0===o?(0,_.jsxs)(b.Fragment,{children:[(0,_.jsx)(A,(0,m.Z)({apiRef:x,item:h,inputRef:R,applyValue:O,onFocus:()=>x.current.startHeaderFilterEditMode(p.field),onBlur:e=>{var t;x.current.stopHeaderFilterEditMode(),null!=(t=e.relatedTarget)&&t.className.includes("columnHeader")||x.current.setState(e=>(0,m.Z)({},e,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}))},label:(0,T.Z)(G),placeholder:"",isFilterActive:q,clearButton:v&&U?(0,_.jsx)(ub,{onClick:z}):null,disabled:$,tabIndex:-1,InputLabelProps:null,sx:"date"===p.type||"dateTime"===p.type?ux:void 0},$?{value:""}:{},null==D?void 0:D.InputComponentProps,g)),(0,_.jsx)(ug,{operators:u,item:h,field:p.field,applyFilterChanges:O,headerFilterMenuRef:f,buttonRef:E})]}):null]}))}),uC=(0,rM.Z)((0,_.jsx)("g",{transform:"rotate(-30 15 10)",children:(0,_.jsx)("path",{d:"M16,9V4l1,0c0.55,0,1-0.45,1-1v0c0-0.55-0.45-1-1-1H7C6.45,2,6,2.45,6,3v0 c0,0.55,0.45,1,1,1l1,0v5c0,1.66-1.34,3-3,3h0v2h5.97v7l1,1l1-1v-7H19v-2h0C17.34,12,16,10.66,16,9z",fillRule:"evenodd"})}),"PushPinRight"),uS=(0,rM.Z)((0,_.jsx)("g",{transform:"rotate(30 8 12)",children:(0,_.jsx)("path",{d:"M16,9V4l1,0c0.55,0,1-0.45,1-1v0c0-0.55-0.45-1-1-1H7C6.45,2,6,2.45,6,3v0 c0,0.55,0.45,1,1,1l1,0v5c0,1.66-1.34,3-3,3h0v2h5.97v7l1,1l1-1v-7H19v-2h0C17.34,12,16,10.66,16,9z",fillRule:"evenodd"})}),"PushPinLeft"),uk=(0,m.Z)({},{ColumnMenuPinRightIcon:uC,ColumnMenuPinLeftIcon:uS}),uI=(0,m.Z)({},iC,uk,{ColumnMenu:s8,ColumnHeaders:up,HeaderFilterCell:uw,HeaderFilterMenu:function({open:e,field:t,target:n,applyFilterChanges:r,operators:l,item:o,id:i,labelledBy:a}){let s=(0,e5.l)(),u=b.useCallback(()=>{s.current.hideHeaderFilterMenu()},[s]),c=b.useCallback(e=>{"Tab"===e.key&&e.preventDefault(),("Escape"===e.key||"Tab"===e.key)&&u()},[u]);return n?(0,_.jsx)(te,{placement:"bottom-end",open:e,target:n,onClose:u,children:(0,_.jsx)(eJ.Z,{"aria-labelledby":a,id:i,onKeyDown:c,children:l.map((n,l)=>{var i;
14let a=null!=(i=null==n?void 0:n.headerLabel)?i:s.current.getLocaleText(`headerFilterOperator${(0,T.Z)(n.value)}`);return(0,_.jsx)(rc.Z,{onClick:()=>{r((0,m.Z)({},o,{operator:n.value})),u()},autoFocus:0===l&&e,selected:n.value===o.operator,children:a},`${t}-${n.value}`)})})}):null}}),uR=(0,m.Z)({},ik,{scrollEndThreshold:80,treeData:!1,defaultGroupingExpansionDepth:0,autosizeOnMount:!1,disableAutosize:!1,disableColumnPinning:!1,keepColumnPositionIfDraggedOutside:!1,disableChildrenFiltering:!1,disableChildrenSorting:!1,rowReordering:!1,rowsLoadingMode:"client",getDetailPanelHeight:()=>500,unstable_headerFilters:!1}),u_=iS(uI),uE=e=>{var t;let[n,r,l]=(t=(0,s3.Z)({props:e,name:"MuiDataGrid"}),b.useMemo(()=>{let{components:e,componentsProps:n}=t;return[e,n,function(e){var t;let n=Object.keys(e);if(!n.some(e=>e.startsWith("aria-")||e.startsWith("data-")))return e;let r={},l=null!=(t=e.forwardedProps)?t:{};for(let t=0;t<n.length;t+=1){let o=n[t];o.startsWith("aria-")||o.startsWith("data-")?l[o]=e[o]:r[o]=e[o]}return r.forwardedProps=l,r}((0,M.Z)(t,s5))]},[t])),o=b.useMemo(()=>(0,m.Z)({},s4,l.localeText),[l.localeText]),i=b.useMemo(()=>(function({defaultSlots:e,slots:t,components:n}){let r=null!=t?t:n?iS(n):null;if(!r||0===Object.keys(r).length)return e;let l=(0,m.Z)({},e);return Object.keys(r).forEach(e=>{void 0!==r[e]&&(l[e]=r[e])}),l})({defaultSlots:u_,slots:l.slots,components:n}),[n,l.slots]);return b.useMemo(()=>{var e;return(0,m.Z)({},uR,l,{localeText:o,slots:i,slotProps:null!=(e=l.slotProps)?e:r,signature:"DataGridPro"})},[l,o,i,r])},uM="MTcyMTI1MzYwMDAwMA==",uP=b.forwardRef(function(e,t){let n=uE(e),r=s2(n.apiRef,n);(0,x.O)("x-data-grid-pro",uM);let l=(0,C.P)(r,a0);return(0,_.jsx)(E,{privateApiRef:r,props:n,children:(0,_.jsxs)(ee,(0,m.Z)({className:n.className,style:n.style,sx:n.sx,ref:t},n.forwardedProps,{children:[(0,_.jsx)(et,{}),(0,_.jsx)(ec,{VirtualScrollerComponent:sk,ColumnHeadersProps:{pinnedColumns:l},children:(0,_.jsx)(w.l,{packageName:"x-data-grid-pro",releaseInfo:uM})}),(0,_.jsx)(ed,{})]}))})}),uT=b.memo(uP);uP.propTypes={apiRef:y().shape({current:y().object.isRequired}),"aria-label":y().string,"aria-labelledby":y().string,autoHeight:y().bool,autoPageSize:y().bool,autosizeOnMount:y().bool,autosizeOptions:y().shape({columns:y().arrayOf(y().string),expand:y().bool,includeHeaders:y().bool,includeOutliers:y().bool,outliersFactor:y().number}),cellModesModel:y().object,checkboxSelection:y().bool,checkboxSelectionVisibleOnly:y().bool,classes:y().object,clipboardCopyCellDelimiter:y().string,columnBuffer:y().number,columnGroupingModel:y().arrayOf(y().object),columnHeaderHeight:y().number,columns:y().arrayOf(y().object).isRequired,columnThreshold:y().number,columnVisibilityModel:y().object,components:y().object,componentsProps:y().object,defaultGroupingExpansionDepth:y().number,density:y().oneOf(["comfortable","compact","standard"]),detailPanelExpandedRowIds:y().arrayOf(y().oneOfType([y().number,y().string]).isRequired),disableAutosize:y().bool,disableChildrenFiltering:y().bool,disableChildrenSorting:y().bool,disableColumnFilter:y().bool,disableColumnMenu:y().bool,disableColumnPinning:y().bool,disableColumnReorder:y().bool,disableColumnResize:y().bool,disableColumnSelector:y().bool,disableDensitySelector:y().bool,disableEval:y().bool,disableMultipleColumnsFiltering:y().bool,disableMultipleColumnsSorting:y().bool,disableMultipleRowSelection:y().bool,disableRowSelectionOnClick:y().bool,disableVirtualization:y().bool,editMode:y().oneOf(["cell","row"]),experimentalFeatures:y().shape({ariaV7:y().bool,columnGrouping:y().bool,lazyLoading:y().bool,warnIfFocusStateIsNotSynced:y().bool}),filterDebounceMs:y().number,filterMode:y().oneOf(["client","server"]),filterModel:y().shape({items:y().arrayOf(y().shape({field:y().string.isRequired,id:y().oneOfType([y().number,y().string]),operator:y().string.isRequired,value:y().any})).isRequired,logicOperator:y().oneOf(["and","or"]),quickFilterExcludeHiddenColumns:y().bool,quickFilterLogicOperator:y().oneOf(["and","or"]),quickFilterValues:y().array}),forwardedProps:y().object,getCellClassName:y().func,getDetailPanelContent:y().func,getDetailPanelHeight:y().func,getEstimatedRowHeight:y().func,getRowClassName:y().func,getRowHeight:y().func,getRowId:y().func,getRowSpacing:y().func,getTreeDataPath:y().func,groupingColDef:y().oneOfType([y().func,y().object]),hideFooter:y().bool,hideFooterPagination:y().bool,hideFooterRowCount:y().bool,hideFooterSelectedRowCount:y().bool,ignoreDiacritics:y().bool,initialState:y().object,isCellEditable:y().func,isGroupExpandedByDefault:y().func,isRowSelectable:y().func,keepColumnPositionIfDraggedOutside:y().bool,keepNonExistentRowsSelected:y().bool,loading:y().bool,localeText:y().object,logger:y().shape({debug:y().func.isRequired,error:y().func.isRequired,info:y().func.isRequired,warn:y().func.isRequired}),logLevel:y().oneOf(["debug","error","info","warn",!1]),nonce:y().string,onCellClick:y().func,onCellDoubleClick:y().func,onCellEditStart:y().func,onCellEditStop:y().func,onCellKeyDown:y().func,onCellModesModelChange:y().func,onClipboardCopy:y().func,onColumnHeaderClick:y().func,onColumnHeaderDoubleClick:y().func,onColumnHeaderEnter:y().func,onColumnHeaderLeave:y().func,onColumnHeaderOut:y().func,onColumnHeaderOver:y().func,onColumnOrderChange:y().func,onColumnResize:y().func,onColumnVisibilityModelChange:y().func,onColumnWidthChange:y().func,onDetailPanelExpandedRowIdsChange:y().func,onFetchRows:y().func,onFilterModelChange:y().func,onMenuClose:y().func,onMenuOpen:y().func,onPaginationModelChange:y().func,onPinnedColumnsChange:y().func,onPreferencePanelClose:y().func,onPreferencePanelOpen:y().func,onProcessRowUpdateError:y().func,onResize:y().func,onRowClick:y().func,onRowCountChange:y().func,onRowDoubleClick:y().func,onRowEditStart:y().func,onRowEditStop:y().func,onRowModesModelChange:y().func,onRowOrderChange:y().func,onRowSelectionModelChange:y().func,onRowsScrollEnd:y().func,onSortModelChange:y().func,onStateChange:y().func,pageSizeOptions:y().arrayOf(y().oneOfType([y().number,y().shape({label:y().string.isRequired,value:y().number.isRequired})]).isRequired),pagination:y().bool,paginationMode:y().oneOf(["client","server"]),paginationModel:y().shape({page:y().number.isRequired,pageSize:y().number.isRequired}),pinnedColumns:y().shape({left:y().arrayOf(y().string),right:y().arrayOf(y().string)}),pinnedRows:y().shape({bottom:y().arrayOf(y().object),top:y().arrayOf(y().object)}),processRowUpdate:y().func,rowBuffer:y().number,rowCount:y().number,rowHeight:y().number,rowModesModel:y().object,rowPositionsDebounceMs:y().number,rowReordering:y().bool,rows:y().arrayOf(y().object).isRequired,rowSelection:y().bool,rowSelectionModel:y().oneOfType([y().arrayOf(y().oneOfType([y().number,y().string]).isRequired),y().number,y().string]),rowsLoadingMode:y().oneOf(["client","server"]),rowSpacingType:y().oneOf(["border","margin"]),rowThreshold:y().number,scrollbarSize:y().number,scrollEndThreshold:y().number,showCellVerticalBorder:y().bool,showColumnVerticalBorder:y().bool,slotProps:y().object,slots:y().object,sortingMode:y().oneOf(["client","server"]),sortingOrder:y().arrayOf(y().oneOf(["asc","desc"])),sortModel:y().arrayOf(y().shape({field:y().string.isRequired,sort:y().oneOf(["asc","desc"])})),sx:y().oneOfType([y().arrayOf(y().oneOfType([y().func,y().object,y().bool])),y().func,y().object]),throttleRowsMs:y().number,treeData:y().bool,unstable_headerFilters:y().bool,unstable_ignoreValueFormatterDuringExport:y().oneOfType([y().shape({clipboardExport:y().bool,csvExport:y().bool}),y().bool])}},91807:function(e,t,n){"use strict";n.d(t,{l:function(){return r}});let r=n(49630).l},13836:function(e,t,n){"use strict";n.d(t,{p:function(){return E}});
14var r=n(87462),l=n(25136),o=n(63366),i=n(67294),a=n(94780),s=n(73490),u=n(48836),c=n(49630),d=n(4260),p=n(85893);let h=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","hasFocus","tabIndex"],f=e=>{let{classes:t}=e;return(0,a.Z)({root:["booleanCell"]},s.d,t)},g=i.memo(function(e){let{value:t}=e,n=(0,o.Z)(e,h),l=(0,c.l)(),a=(0,u.B)(),s=f({classes:a.classes}),d=i.useMemo(()=>t?a.slots.booleanCellTrueIcon:a.slots.booleanCellFalseIcon,[a.slots.booleanCellFalseIcon,a.slots.booleanCellTrueIcon,t]);return(0,p.jsx)(d,(0,r.Z)({fontSize:"small",className:s.root,titleAccess:l.current.getLocaleText(t?"booleanCellTrueLabel":"booleanCellFalseLabel"),"data-value":!!t},n))});var m=n(22316),b=n(92996),v=n(73546);let y=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","hasFocus","isValidating","isProcessingProps","error","onValueChange"],x=e=>{let{classes:t}=e;return(0,a.Z)({root:["editBooleanCell"]},s.d,t)};function w(e){var t;let{id:n,value:l,field:a,className:s,hasFocus:d,onValueChange:h}=e,f=(0,o.Z)(e,y),g=(0,c.l)(),w=i.useRef(null),C=(0,b.Z)(),[S,k]=i.useState(l),I=(0,u.B)(),R=x({classes:I.classes}),_=i.useCallback(async e=>{let t=e.target.checked;h&&await h(e,t),k(t),await g.current.setEditCellValue({id:n,field:a,value:t},e)},[g,a,n,h]);return i.useEffect(()=>{k(l)},[l]),(0,v.Z)(()=>{d&&w.current.focus()},[d]),(0,p.jsx)("label",(0,r.Z)({htmlFor:C,className:(0,m.Z)(R.root,s)},f,{children:(0,p.jsx)(I.slots.baseCheckbox,(0,r.Z)({id:C,inputRef:w,checked:!!S,onChange:_,size:"small"},null==(t=I.slotProps)?void 0:t.baseCheckbox))}))}var C=n(99588),S=n(77527);let k=["item","applyValue","apiRef","focusElementRef","isFilterActive","clearButton","tabIndex","label","variant","InputLabelProps"],I=(0,S.ZP)("div")({display:"flex",alignItems:"center",width:"100%","& button":{margin:"auto 0px 5px 5px"}});var R=n(99864);let _=e=>{switch(e.toLowerCase().trim()){case"true":case"yes":case"1":return!0;case"false":case"no":case"0":case"null":case"undefined":return!1;default:return}},E=(0,r.Z)({},l.z,{type:"boolean",align:"center",headerAlign:"center",renderCell:e=>(0,d.wq)(e.rowNode)?"":(0,p.jsx)(g,(0,r.Z)({},e)),renderEditCell:e=>(0,p.jsx)(w,(0,r.Z)({},e)),sortComparator:C.GH,valueFormatter:function({value:e,api:t}){return e?t.getLocaleText("booleanCellTrueLabel"):t.getLocaleText("booleanCellFalseLabel")},filterOperators:(0,R.XW)([{value:"is",getApplyFilterFnV7:e=>{if(!e.value)return null;let t="true"===e.value;return e=>!!e===t},InputComponent:function(e){var t,n,l,a;let{item:s,applyValue:c,apiRef:d,focusElementRef:h,clearButton:f,tabIndex:g,label:m,variant:v="standard"}=e,y=(0,o.Z)(e,k),[x,w]=i.useState(s.value||""),C=(0,u.B)(),S=(0,b.Z)(),R=(0,b.Z)(),_=(null==(t=C.slotProps)?void 0:t.baseSelect)||{},E=null==(n=_.native)||n,M=(null==(l=C.slotProps)?void 0:l.baseSelectOption)||{},P=i.useCallback(e=>{let t=e.target.value;w(t),c((0,r.Z)({},s,{value:t}))},[c,s]);i.useEffect(()=>{w(s.value||"")},[s.value]);let T=null!=m?m:d.current.getLocaleText("filterPanelInputLabel");return(0,p.jsxs)(I,{children:[(0,p.jsxs)(C.slots.baseFormControl,{fullWidth:!0,children:[(0,p.jsx)(C.slots.baseInputLabel,(0,r.Z)({},null==(a=C.slotProps)?void 0:a.baseInputLabel,{id:S,shrink:!0,variant:v,children:T})),(0,p.jsxs)(C.slots.baseSelect,(0,r.Z)({labelId:S,id:R,label:T,value:x,onChange:P,variant:v,notched:"outlined"===v||void 0,native:E,displayEmpty:!0,inputProps:{ref:h,tabIndex:g}},y,_,{children:[(0,p.jsx)(C.slots.baseSelectOption,(0,r.Z)({},M,{native:E,value:"",children:d.current.getLocaleText("filterValueAny")})),(0,p.jsx)(C.slots.baseSelectOption,(0,r.Z)({},M,{native:E,value:"true",children:d.current.getLocaleText("filterValueTrue")})),(0,p.jsx)(C.slots.baseSelectOption,(0,r.Z)({},M,{native:E,value:"false",children:d.current.getLocaleText("filterValueFalse")}))]}))]}),f]})}}]),getApplyQuickFilterFn:void 0,getApplyQuickFilterFnV7:void 0,aggregable:!1,pastedValueParser:e=>_(e)})},39410:function(e,t,n){"use strict";n.d(t,{n:function(){return R},e:function(){return I}});
14var r=n(87462),l=n(67294),o=n(63366),i=n(94780),a=n(33703),s=n(41592),u=n(49630),c=n(48836),d=n(73490),p=n(85893);let h=["field","id","value","formattedValue","row","rowNode","colDef","isEditable","cellMode","hasFocus","tabIndex","api"],f=e=>{let{classes:t}=e;return(0,i.Z)({root:["checkboxInput"]},d.d,t)},g=l.forwardRef(function(e,t){var n;let{field:i,id:d,value:g,rowNode:m,hasFocus:b,tabIndex:v}=e,y=(0,o.Z)(e,h),x=(0,u.l)(),w=(0,c.B)(),C=f({classes:w.classes}),S=l.useRef(null),k=l.useRef(null),I=(0,a.Z)(S,t),R=x.current.getCellElement(d,i);l.useLayoutEffect(()=>{0===v&&R&&(R.tabIndex=-1)},[R,v]),l.useEffect(()=>{if(b){var e;let t=null==(e=S.current)?void 0:e.querySelector("input");null==t||t.focus({preventScroll:!0})}else k.current&&k.current.stop({})},[b]);let _=l.useCallback(e=>{(0,s.Xq)(e.key)&&e.stopPropagation()},[]);if("footer"===m.type||"pinnedRow"===m.type)return null;let E=x.current.isRowSelectable(d),M=x.current.getLocaleText(g?"checkboxSelectionUnselectRow":"checkboxSelectionSelectRow");return(0,p.jsx)(w.slots.baseCheckbox,(0,r.Z)({ref:I,tabIndex:v,checked:g,onChange:e=>{let t={value:e.target.checked,id:d};x.current.publishEvent("rowSelectionCheckboxChange",t,e)},className:C.root,inputProps:{"aria-label":M},onKeyDown:_,disabled:!E,touchRippleRef:k},null==(n=w.slotProps)?void 0:n.baseCheckbox,y))});var m=n(14696),b=n(35543),v=n(7083),y=n(61207),x=n(48949);let w=["field","colDef"],C=e=>{let{classes:t}=e;return(0,i.Z)({root:["checkboxInput"]},d.d,t)},S=l.forwardRef(function(e,t){var n;let i=(0,o.Z)(e,w),[,a]=l.useState(!1),s=(0,u.l)(),d=(0,c.B)(),h=C({classes:d.classes}),f=(0,m.P)(s,b.X5),g=(0,m.P)(s,v.Y1),S=(0,m.P)(s,y.zn),k=(0,m.P)(s,x.Yp),I=l.useMemo(()=>"function"!=typeof d.isRowSelectable?g:g.filter(e=>!!s.current.getRow(e)&&d.isRowSelectable(s.current.getRowParams(e))),[s,d.isRowSelectable,g]),R=l.useMemo(()=>(d.pagination&&d.checkboxSelectionVisibleOnly?k:S).reduce((e,t)=>(e[t]=!0,e),{}),[d.pagination,d.checkboxSelectionVisibleOnly,k,S]),_=l.useMemo(()=>I.filter(e=>R[e]).length,[I,R]),E=_>0&&_<Object.keys(R).length,M=_>0,P=null!==f&&f.field===e.field?0:-1;l.useLayoutEffect(()=>{let t=s.current.getColumnHeaderElement(e.field);0===P&&t&&(t.tabIndex=-1)},[P,s,e.field]);let T=l.useCallback(e=>{" "===e.key&&s.current.publishEvent("headerSelectionCheckboxChange",{value:!M})},[s,M]),Z=l.useCallback(()=>{a(e=>!e)},[]);l.useEffect(()=>s.current.subscribeEvent("rowSelectionChange",Z),[s,Z]);let F=s.current.getLocaleText(M?"checkboxSelectionUnselectAllRows":"checkboxSelectionSelectAllRows");return(0,p.jsx)(d.slots.baseCheckbox,(0,r.Z)({ref:t,indeterminate:E,checked:M,onChange:e=>{let t={value:e.target.checked};s.current.publishEvent("headerSelectionCheckboxChange",t)},className:h.root,inputProps:{"aria-label":F},tabIndex:P,onKeyDown:T},null==(n=d.slotProps)?void 0:n.baseCheckbox,i))});var k=n(13836);let I="__check__",R=(0,r.Z)({},k.p,{field:I,type:"checkboxSelection",width:50,resizable:!1,sortable:!1,filterable:!1,aggregable:!1,disableColumnMenu:!0,disableReorder:!0,disableExport:!0,getApplyQuickFilterFn:void 0,getApplyQuickFilterFnV7:void 0,valueGetter:e=>void 0!==(0,v.z8)(e.api.state,e.api.instanceId)[e.id],renderHeader:e=>(0,p.jsx)(S,(0,r.Z)({},e)),renderCell:e=>(0,p.jsx)(g,(0,r.Z)({},e))})},89027:function(e,t,n){"use strict";n.d(t,{U:function(){return s},i:function(){return a}});var r=n(30715),l=n(17613),o=n(99864);let i=e=>null==e?null:Number(e),a=(0,o.OT)(e=>null==e||Number.isNaN(e)||""===e?null:t=>i(t)===i(e)),s=()=>(0,o.XW)([{value:"=",getApplyFilterFnV7:e=>null==e.value||Number.isNaN(e.value)?null:t=>i(t)===e.value,InputComponent:r.r,InputComponentProps:{type:"number"}},{value:"!=",getApplyFilterFnV7:e=>null==e.value||Number.isNaN(e.value)?null:t=>i(t)!==e.value,InputComponent:r.r,InputComponentProps:{type:"number"}},{value:">",getApplyFilterFnV7:e=>null==e.value||Number.isNaN(e.value)?null:t=>null!=t&&i(t)>e.value,InputComponent:r.r,InputComponentProps:{type:"number"}},{value:">=",getApplyFilterFnV7:e=>null==e.value||Number.isNaN(e.value)?null:t=>null!=t&&i(t)>=e.value,InputComponent:r.r,InputComponentProps:{type:"number"}},{value:"<",getApplyFilterFnV7:e=>null==e.value||Number.isNaN(e.value)?null:t=>null!=t&&i(t)<e.value,InputComponent:r.r,InputComponentProps:{type:"number"}},{value:"<=",getApplyFilterFnV7:e=>null==e.value||Number.isNaN(e.value)?null:t=>null!=t&&i(t)<=e.value,InputComponent:r.r,InputComponentProps:{type:"number"}},{value:"isEmpty",getApplyFilterFnV7:()=>e=>null==e,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFnV7:()=>e=>null!=e,requiresFilterValue:!1},{value:"isAnyOf",getApplyFilterFnV7:e=>Array.isArray(e.value)&&0!==e.value.length?t=>null!=t&&e.value.includes(Number(t)):null,InputComponent:l.S,InputComponentProps:{type:"number"}}])},34604:function(e,t,n){"use strict";n.d(t,{d:function(){return S}});var r=n(63366),l=n(87462),o=n(67294),i=n(92996),a=n(77527),s=n(48836),u=n(54870),c=n(85893);let d=["item","applyValue","type","apiRef","focusElementRef","getOptionLabel","getOptionValue","placeholder","tabIndex","label","variant","isFilterActive","clearButton","InputLabelProps"],p=({column:{valueOptions:e,field:t},OptionComponent:n,getOptionLabel:r,getOptionValue:i,isSelectNative:a,baseSelectOptionProps:s})=>("function"==typeof e?["",...e({field:t})]:["",...e||[]]).map(e=>{let t=i(e),u=r(e);return(0,o.createElement)(n,(0,l.Z)({},s,{native:a,key:t,value:t}),u)}),h=(0,a.ZP)("div")({display:"flex",alignItems:"flex-end",width:"100%","& button":{margin:"auto 0px 5px 5px"}});function f(e){var t,n,a,f,g,m,b,v;let{item:y,applyValue:x,type:w,apiRef:C,focusElementRef:S,getOptionLabel:k,getOptionValue:I,placeholder:R,tabIndex:_,label:E,variant:M="standard",clearButton:P}
14=e,T=(0,r.Z)(e,d),[Z,F]=o.useState(null!=(t=y.value)?t:""),D=(0,i.Z)(),A=(0,i.Z)(),O=(0,s.B)(),z=null==(n=null==(a=O.slotProps)||null==(a=a.baseSelect)?void 0:a.native)||n,j=null;if(y.field){let e=C.current.getColumn(y.field);(0,u.jv)(e)&&(j=e)}let L=I||(null==(f=j)?void 0:f.getOptionValue),H=k||(null==(g=j)?void 0:g.getOptionLabel),B=o.useMemo(()=>{if(j)return"function"==typeof j.valueOptions?j.valueOptions({field:j.field}):j.valueOptions},[j]),N=o.useCallback(e=>{let t=e.target.value;F(String(t=(0,u.sk)(t,B,L))),x((0,l.Z)({},y,{value:t}))},[B,L,x,y]);if(o.useEffect(()=>{var e;let t;if(void 0!==B){if((t=(0,u.sk)(y.value,B,L))!==y.value){x((0,l.Z)({},y,{value:t}));return}}else t=y.value;F(String(t=null!=(e=t)?e:""))},[y,B,x,L]),!(0,u.jv)(j)||!(0,u.jv)(j))return null;let V=null!=E?E:C.current.getLocaleText("filterPanelInputLabel");return(0,c.jsxs)(h,{children:[(0,c.jsxs)(O.slots.baseFormControl,{children:[(0,c.jsx)(O.slots.baseInputLabel,(0,l.Z)({},null==(m=O.slotProps)?void 0:m.baseInputLabel,{id:A,htmlFor:D,shrink:!0,variant:M,children:V})),(0,c.jsx)(O.slots.baseSelect,(0,l.Z)({id:D,label:V,labelId:A,value:Z,onChange:N,variant:M,type:w||"text",inputProps:{tabIndex:_,ref:S,placeholder:null!=R?R:C.current.getLocaleText("filterPanelInputPlaceholder")},native:z,notched:"outlined"===M||void 0},T,null==(b=O.slotProps)?void 0:b.baseSelect,{children:p({column:j,OptionComponent:O.slots.baseSelectOption,getOptionLabel:H,getOptionValue:L,isSelectNative:z,baseSelectOptionProps:null==(v=O.slotProps)?void 0:v.baseSelectOption})}))]}),P]})}var g=n(87415),m=n(46070);let b=["item","applyValue","type","apiRef","focusElementRef","color","error","helperText","size","variant","getOptionLabel","getOptionValue"],v=(0,g.D)();function y(e){var t,n;let{item:a,applyValue:d,apiRef:p,focusElementRef:h,color:f,error:g,helperText:y,size:x,variant:w="standard",getOptionLabel:C,getOptionValue:S}=e,k=(0,r.Z)(e,b),I={color:f,error:g,helperText:y,size:x,variant:w},R=(0,i.Z)(),_=(0,s.B)(),E=null;if(a.field){let e=p.current.getColumn(a.field);(0,u.jv)(e)&&(E=e)}let M=S||(null==(t=E)?void 0:t.getOptionValue),P=C||(null==(n=E)?void 0:n.getOptionLabel),T=o.useCallback((e,t)=>M(e)===M(t),[M]),Z=o.useMemo(()=>{var e;return null!=(e=E)&&e.valueOptions?"function"==typeof E.valueOptions?E.valueOptions({field:E.field}):E.valueOptions:[]},[E]),F=o.useMemo(()=>null==Z?void 0:Z.map(M),[Z,M]),D=o.useMemo(()=>Array.isArray(a.value)?void 0!==Z?a.value.map(e=>null==F?void 0:F.findIndex(t=>t===e)).filter(e=>e>=0).map(e=>Z[e]):a.value:[],[a.value,Z,F]);o.useEffect(()=>{Array.isArray(a.value)&&D.length===a.value.length||d((0,l.Z)({},a,{value:D.map(M)}))},[a,D,d,M]);let A=o.useCallback((e,t)=>{d((0,l.Z)({},a,{value:t.map(M)}))},[d,a,M]);return(0,c.jsx)(m.Z,(0,l.Z)({multiple:!0,options:Z,isOptionEqualToValue:T,filterOptions:v,id:R,value:D,onChange:A,getOptionLabel:P,renderTags:(e,t)=>e.map((e,n)=>(0,c.jsx)(_.slots.baseChip,(0,l.Z)({variant:"outlined",size:"small",label:P(e)},t({index:n})))),renderInput:e=>{var t;return(0,c.jsx)(_.slots.baseTextField,(0,l.Z)({},e,{label:p.current.getLocaleText("filterPanelInputLabel"),placeholder:p.current.getLocaleText("filterPanelInputPlaceholder"),InputLabelProps:(0,l.Z)({},e.InputLabelProps,{shrink:!0}),inputRef:h,type:"singleSelect"},I,null==(t=_.slotProps)?void 0:t.baseTextField))}},k))}var x=n(24791),w=n(99864);let C=e=>null!=e&&(0,x.Kn)(e)?e.value:e,S=()=>(0,w.XW)([{value:"is",getApplyFilterFnV7:e=>null==e.value||""===e.value?null:t=>C(t)===C(e.value),InputComponent:f},{value:"not",getApplyFilterFnV7:e=>null==e.value||""===e.value?null:t=>C(t)!==C(e.value),InputComponent:f},{value:"isAnyOf",getApplyFilterFnV7:e=>{if(!Array.isArray(e.value)||0===e.value.length)return null;let t=e.value.map(C);return e=>t.includes(C(e))},InputComponent:y}])},25136:function(e,t,n){"use strict";n.d(t,{z:function(){return I}});var r=n(63366),l=n(87462),o=n(67294),i=n(94780),a=n(73546),s=n(77527),u=n(16817),c=n(73490),d=n(48836),p=n(49630),h=n(85893);let f=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","isValidating","debounceMs","isProcessingProps","onValueChange"],g=e=>{let{classes:t}=e;return(0,i.Z)({root:["editInputCell"]},c.d,t)},m=(0,s.ZP)(u.ZP,{name:"MuiDataGrid",slot:"EditInputCell",overridesResolver:(e,t)=>t.editInputCell})(({theme:e})=>(0,l.Z)({},e.typography.body2,{padding:"1px 0","& input":{padding:"0 16px",height:"100%"}})),b=o.forwardRef((e,t)=>
14{let n=(0,d.B)(),{id:i,value:s,field:u,colDef:c,hasFocus:b,debounceMs:v=200,isProcessingProps:y,onValueChange:x}=e,w=(0,r.Z)(e,f),C=(0,p.l)(),S=o.useRef(),[k,I]=o.useState(s),R=g(n),_=o.useCallback(async e=>{let t=e.target.value;x&&await x(e,t);let n=C.current.getColumn(u),r=t;n.valueParser&&(r=n.valueParser(t,C.current.getCellParams(i,u))),I(r),C.current.setEditCellValue({id:i,field:u,value:r,debounceMs:v,unstable_skipValueParser:!0},e)},[C,v,u,i,x]),E=C.current.unstable_getEditCellMeta(i,u);return o.useEffect(()=>{(null==E?void 0:E.changeReason)!=="debouncedSetEditCellValue"&&I(s)},[E,s]),(0,a.Z)(()=>{b&&S.current.focus()},[b]),(0,h.jsx)(m,(0,l.Z)({ref:t,inputRef:S,className:R.root,ownerState:n,fullWidth:!0,type:"number"===c.type?c.type:"text",value:null!=k?k:"",onChange:_,endAdornment:y?(0,h.jsx)(n.slots.loadIcon,{fontSize:"small",color:"action"}):void 0},w))});var v=n(99588),y=n(30715),x=n(24791),w=n(17613),C=n(99864),S=n(98991);let k=(0,C.OT)(e=>{if(!e)return null;let t=RegExp((0,x.hr)(e),"i");return(e,n,r,l)=>{let o=l.current.getRowFormattedValue(n,r);return l.current.ignoreDiacritics&&(o=(0,S.GS)(o)),null!=o&&t.test(o.toString())}}),I={width:100,minWidth:50,maxWidth:1/0,hideable:!0,sortable:!0,resizable:!0,filterable:!0,groupable:!0,pinnable:!0,aggregable:!0,editable:!1,sortComparator:v.Id,type:"string",align:"left",filterOperators:((e=!1)=>(0,C.XW)([{value:"contains",getApplyFilterFnV7:t=>{if(!t.value)return null;let n=e?t.value:t.value.trim(),r=RegExp((0,x.hr)(n),"i");return e=>null!=e&&r.test(String(e))},InputComponent:y.r},{value:"equals",getApplyFilterFnV7:t=>{if(!t.value)return null;let n=e?t.value:t.value.trim(),r=new Intl.Collator(void 0,{sensitivity:"base",usage:"search"});return e=>null!=e&&0===r.compare(n,e.toString())},InputComponent:y.r},{value:"startsWith",getApplyFilterFnV7:t=>{if(!t.value)return null;let n=e?t.value:t.value.trim(),r=RegExp(`^${(0,x.hr)(n)}.*$`,"i");return e=>null!=e&&r.test(e.toString())},InputComponent:y.r},{value:"endsWith",getApplyFilterFnV7:t=>{if(!t.value)return null;let n=e?t.value:t.value.trim(),r=RegExp(`.*${(0,x.hr)(n)}$`,"i");return e=>null!=e&&r.test(e.toString())},InputComponent:y.r},{value:"isEmpty",getApplyFilterFnV7:()=>e=>""===e||null==e,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFnV7:()=>e=>""!==e&&null!=e,requiresFilterValue:!1},{value:"isAnyOf",getApplyFilterFnV7:t=>{if(!Array.isArray(t.value)||0===t.value.length)return null;let n=e?t.value:t.value.map(e=>e.trim()),r=new Intl.Collator(void 0,{sensitivity:"base",usage:"search"});return e=>null!=e&&n.some(t=>0===r.compare(t,e.toString()||""))},InputComponent:w.S}]))(),renderEditCell:e=>(0,h.jsx)(b,(0,l.Z)({},e)),getApplyQuickFilterFn:(0,C.ck)(k),getApplyQuickFilterFnV7:k}},99864:function(e,t,n){"use strict";n.d(t,{MN:function(){return i},OT:function(){return o},V1:function(){return l},XW:function(){return a},ck:function(){return s}});var r=n(87462);let l={current:null};function o(e){return e.isInternal=!0,e}function i(e){return void 0!==e&&!0===e.isInternal}function a(e){return e.map(e=>{var t;return(0,r.Z)({},e,{getApplyFilterFn:(t=e.getApplyFilterFnV7,o((e,n)=>{let r=t(e,n);return r?e=>r(e.value,e.row,n,l.current):r})),getApplyFilterFnV7:o(e.getApplyFilterFnV7)})})}function s(e){return o((t,n,r)=>{let l=e(t,n,r);return l?e=>l(e.value,e.row,n,r):l})}},17145:function(e,t,n){"use strict";n.d(t,{r:function(){return r}});let r=n(67294).createContext(void 0)},74784:function(e,t,n){"use strict";n.d(t,{n:function(){return g}});var r=n(87462),l=n(63366),o=n(67294),i=n(22316),a=n(94780),s=n(45098),u=n(73490),c=n(48836),d=n(85893);let p=["className"],h=e=>{let{classes:t}=e;return(0,a.Z)({root:["overlay"]},u.d,t)},f=(0,s.Z)("div",{name:"MuiDataGrid",slot:"Overlay",overridesResolver:(e,t)=>t.overlay})({width:"100%",height:"100%",display:"flex",alignSelf:"center",alignItems:"center",justifyContent:"center",backgroundColor:"var(--unstable_DataGrid-overlayBackground)"}),g=o.forwardRef(function(e,t){let{className:n}=e,o=(0,l.Z)(e,p),a=(0,c.B)(),s=h(a);return(0,d.jsx)(f,(0,r.Z)({ref:t,className:(0,i.Z)(s.root,n),ownerState:a},o))})},42176:function(e,t,n){"use strict";n.d(t,{D:function(){return g}});var r=n(87462),l=n(63366),o=n(67294),i=n(22316),a=n(45098),s=n(94780),u=n(73490),c=n(48836),d=n(85893);let p=["className","children"],h=e=>{let{classes:t}=e;return(0,s.Z)({root:["toolbarContainer"]},u.d,t)},f=(0,a.Z)("div",{name:"MuiDataGrid",slot:"ToolbarContainer",overridesResolver:(e,t)=>t.toolbarContainer})(({theme:e})=>({display:"flex",alignItems:"center",flexWrap:"wrap",gap:e.spacing(1),padding:e.spacing(.5,.5,0)})),g=o.forwardRef(function(e,t){let{className:n,children:o}=e,a=(0,l.Z)(e,p),s=(0,c.B)(),u=h(s);return o?(0,d.jsx)(f,(0,r.Z)({ref:t,className:(0,i.Z)(n,u.root),ownerState:s},a,{children:o})):null})},17613:function(e,t,n){"use strict";n.d(t,{S:function(){return d}});var r=n(87462),l=n(63366),o=n(67294),i=n(46070),a=n(92996),s=n(48836),u=n(85893);let c=["item","applyValue","type","apiRef","focusElementRef","color","error","helperText","size","variant"];function d(e){let{item:t,applyValue:n,type:d,apiRef:p,focusElementRef:h,color:f,error:g,helperText:m,size:b,variant:v}=e,y=(0,l.Z)(e,c),x={color:f,error:g,helperText:m,size:b,variant:v},[w,C]=o.useState(t.value||[]),S=(0,a.Z)(),k=(0,s.B)();o.useEffect(()=>{var e;C((null!=(e=t.value)?e:[]).map(String))},[t.value]);let I=o.useCallback((e,l)=>{C(l.map(String)),n((0,r.Z)({},t,{value:[...l]}))},[n,t]);return(0,u.jsx)(i.Z,(0,r.Z)({multiple:!0,freeSolo:!0,options:[],filterOptions:(e,t)=>{let{inputValue:n}=t;return null==n||""===n?[]:[n]},id:S,value:w,onChange:I,renderTags:(e,t)=>e.map((e,n)=>(0,u.jsx)(k.slots.baseChip,(0,r.Z)({variant:"outlined",size:"small",label:e},t({index:n})))),renderInput:e=>{var t;return(0,u.jsx)(k.slots.baseTextField,(0,r.Z)({},e,{label:p.current.getLocaleText("filterPanelInputLabel"),placeholder:p.current.getLocaleText("filterPanelInputPlaceholder"),InputLabelProps:(0,r.Z)({},e.InputLabelProps,{shrink:!0}),inputRef:h,type:d||"text"},x,null==(t=k.slotProps)?void 0:t.baseTextField))}},y))}},30715:function(e,t,n){"use strict";n.d(t,{r:function(){return d}});var r=n(87462),l=n(63366),o=n(67294),i=n(92996),a=n(14773),s=n(48836),u=n(85893);let c=["item","applyValue","type","apiRef","focusElementRef","tabIndex","disabled","isFilterActive","clearButton","InputProps","variant"];function d(e){var t,n;let{item:d,applyValue:p,type:h,apiRef:f,focusElementRef:g,tabIndex:m,disabled:b,clearButton:v,InputProps:y,variant:x="standard"}=e,w=(0,l.Z)(e,c),C=(0,a.K)(),[S,k]=o.useState(null!=(t=d.value)?t:""),[I,R]=o.use
14State(!1),_=(0,i.Z)(),E=(0,s.B)(),M=o.useCallback(e=>{let{value:t}=e.target;k(String(t)),R(!0),C.start(E.filterDebounceMs,()=>{p((0,r.Z)({},d,{value:t,fromInput:_})),R(!1)})},[_,p,d,E.filterDebounceMs,C]);return o.useEffect(()=>{if(d.fromInput!==_||void 0===d.value){var e;k(String(null!=(e=d.value)?e:""))}},[_,d]),(0,u.jsx)(E.slots.baseTextField,(0,r.Z)({id:_,label:f.current.getLocaleText("filterPanelInputLabel"),placeholder:f.current.getLocaleText("filterPanelInputPlaceholder"),value:S,onChange:M,variant:x,type:h||"text",InputProps:(0,r.Z)({},I||v?{endAdornment:I?(0,u.jsx)(E.slots.loadIcon,{fontSize:"small",color:"action"}):v}:{},{disabled:b},y,{inputProps:(0,r.Z)({tabIndex:m},null==y?void 0:y.inputProps)}),InputLabelProps:{shrink:!0},inputRef:g},w,null==(n=E.slotProps)?void 0:n.baseTextField))}},54870:function(e,t,n){"use strict";function r(e){return(null==e?void 0:e.type)==="singleSelect"}function l(e,t,n){if(void 0===t)return;let r=t.find(t=>String(n(t))===String(e));return n(r)}n.d(t,{jv:function(){return r},sk:function(){return l}})},6132:function(e,t,n){"use strict";n.d(t,{S:function(){return f}});var r=n(87462),l=n(63366),o=n(67294),i=n(42783),a=n(14696),s=n(10269),u=n(27476),c=n(49630),d=n(48836),p=n(85893);let h=["onClick"],f=o.forwardRef(function(e,t){var n;let{onClick:o}=e,f=(0,l.Z)(e,h),g=(0,i.Z)(),m=(0,i.Z)(),b=(0,c.l)(),v=(0,d.B)(),y=(0,a.P)(b,s.e);if(v.disableColumnSelector)return null;let x=y.open&&y.panelId===m;return(0,p.jsx)(v.slots.baseButton,(0,r.Z)({ref:t,id:g,size:"small","aria-label":b.current.getLocaleText("toolbarColumnsLabel"),"aria-haspopup":"menu","aria-expanded":x,"aria-controls":x?m:void 0,startIcon:(0,p.jsx)(v.slots.columnSelectorIcon,{})},f,{onClick:e=>{y.open&&y.openedPanelValue===u.y.columns?b.current.hidePreferences():b.current.showPreferences(u.y.columns,m,g),null==o||o(e)}},null==(n=v.slotProps)?void 0:n.baseButton,{children:b.current.getLocaleText("toolbarColumns")}))})},50853:function(e,t,n){"use strict";n.d(t,{M:function(){return S}});var r=n(87462),l=n(63366),o=n(67294),i=n(77527),a=n(94780),s=n(92996),u=n(14142),c=n(79533),d=n(90198),p=n(14696),h=n(61207),f=n(10269),g=n(27476),m=n(49630),b=n(48836),v=n(73490),y=n(85893);let x=["componentsProps"],w=e=>{let{classes:t}=e;return(0,a.Z)({root:["toolbarFilterList"]},v.d,t)},C=(0,i.ZP)("ul",{name:"MuiDataGrid",slot:"ToolbarFilterList",overridesResolver:(e,t)=>t.toolbarFilterList})(({theme:e})=>({margin:e.spacing(1,1,.5),padding:e.spacing(0,1)})),S=o.forwardRef(function(e,t){var n,i;let{componentsProps:a={}}=e,v=(0,l.Z)(e,x),S=a.button||{},k=(0,m.l)(),I=(0,b.B)(),R=(0,p.P)(k,h.DY),_=(0,p.P)(k,d.WH),E=(0,p.P)(k,f.e),M=w(I),P=(0,s.Z)(),T=(0,s.Z)(),Z=o.useMemo(()=>{if(E.open)return k.current.getLocaleText("toolbarFiltersTooltipHide");if(0===R.length)return k.current.getLocaleText("toolbarFiltersTooltipShow");let e=e=>_[e.field].filterOperators.find(t=>t.value===e.operator).label||k.current.getLocaleText(`filterOperator${(0,u.Z)(e.operator)}`).toString(),t=e=>{let{getValueAsString:t}=_[e.field].filterOperators.find(t=>t.value===e.operator);return t?t(e.value):e.value};return(0,y.jsxs)("div",{children:[k.current.getLocaleText("toolbarFiltersTooltipActive")(R.length),(0,y.jsx)(C,{className:M.root,ownerState:I,children:R.map((n,l)=>(0,r.Z)({},_[n.field]&&(0,y.jsx)("li",{children:`${_[n.field].headerName||n.field}
15                  ${e(n)}
16                  ${null!=n.value?t(n):""}`},l)))})]})},[k,I,E.open,R,_,M]);if(I.disableColumnFilter)return null;let F=E.open&&E.panelId===T;return(0,y.jsx)(I.slots.baseTooltip,(0,r.Z)({title:Z,enterDelay:1e3},v,null==(n=I.slotProps)?void 0:n.baseTooltip,{children:(0,y.jsx)(I.slots.baseButton,(0,r.Z)({ref:t,id:P,size:"small","aria-label":k.current.getLocaleText("toolbarFiltersLabel"),"aria-controls":F?T:void 0,"aria-expanded":F,"aria-haspopup":!0,startIcon:(0,y.jsx)(c.Z,{badgeContent:R.length,color:"primary",children:(0,y.jsx)(I.slots.openFilterButtonIcon,{})})},S,{onClick:e=>{var t;let{open:n,openedPanelValue:r}=E;n&&r===g.y.filters?k.current.hidePreferences():k.current.showPreferences(g.y.filters,T,P),null==(t=S.onClick)||t.call(S,e)}},null==(i=I.slotProps)?void 0:i.baseButton,{children:k.current.getLocaleText("toolbarFilters")}))}
16))})},73490:function(e,t,n){"use strict";n.d(t,{_:function(){return o},d:function(){return l}});var r=n(34867);function l(e){return(0,r.ZP)("MuiDataGrid",e)}let o=(0,n(1588).Z)("MuiDataGrid",["actionsCell","aggregationColumnHeader","aggregationColumnHeader--alignLeft","aggregationColumnHeader--alignCenter","aggregationColumnHeader--alignRight","aggregationColumnHeaderLabel","autoHeight","autosizing","booleanCell","cell--editable","cell--editing","cell--textCenter","cell--textLeft","cell--textRight","cell--withRenderer","cell--rangeTop","cell--rangeBottom","cell--rangeLeft","cell--rangeRight","cell--selectionMode","cell","cellContent","cellCheckbox","cellSkeleton","checkboxInput","columnHeader--alignCenter","columnHeader--alignLeft","columnHeader--alignRight","columnHeader--dragging","columnHeader--moving","columnHeader--numeric","columnHeader--sortable","columnHeader--sorted","columnHeader--filtered","columnHeader","columnHeaderCheckbox","columnHeaderDraggableContainer","columnHeaderDropZone","columnHeaderTitle","columnHeaderTitleContainer","columnHeaderTitleContainerContent","columnGroupHeader","columnHeader--filledGroup","columnHeader--emptyGroup","columnHeader--showColumnBorder","columnHeaders","columnHeadersInner","columnHeadersInner--scrollable","columnSeparator--resizable","columnSeparator--resizing","columnSeparator--sideLeft","columnSeparator--sideRight","columnSeparator","columnsPanel","columnsPanelRow","detailPanel","detailPanels","detailPanelToggleCell","detailPanelToggleCell--expanded","footerCell","panel","panelHeader","panelWrapper","panelContent","panelFooter","paper","editBooleanCell","editInputCell","filterForm","filterFormDeleteIcon","filterFormLogicOperatorInput","filterFormColumnInput","filterFormOperatorInput","filterFormValueInput","filterIcon","footerContainer","headerFilterRow","iconButtonContainer","iconSeparator","main","menu","menuIcon","menuIconButton","menuOpen","menuList","overlay","overlayWrapper","overlayWrapperInner","root","root--densityStandard","root--densityComfortable","root--densityCompact","root--disableUserSelection","row","row--editable","row--editing","row--lastVisible","row--dragging","row--dynamicHeight","row--detailPanelExpanded","rowReorderCellPlaceholder","rowCount","rowReorderCellContainer","rowReorderCell","rowReorderCell--draggable","scrollArea--left","scrollArea--right","scrollArea","selectedRowCount","sortIcon","toolbarContainer","toolbarFilterList","virtualScroller","virtualScrollerContent","virtualScrollerContent--overflowed","virtualScrollerRenderZone","pinnedColumns","pinnedColumns--left","pinnedColumns--right","pinnedColumnHeaders","pinnedColumnHeaders--left","pinnedColumnHeaders--right","withBorderColor","cell--withRightBorder","columnHeader--withRightBorder","treeDataGroupingCell","treeDataGroupingCellToggle","groupingCriteriaCell","groupingCriteriaCellToggle","pinnedRows","pinnedRows--top","pinnedRows--bottom","pinnedRowsRenderZone"])},1497:function(e,t,n){"use strict";n.d(t,{G:function(){return r}});let r=n(67294).createContext(void 0)},90198:function(e,t,n){"use strict";n.d(t,{Ag:function(){return d},FE:function(){return u},WH:function(){return i},Zi:function(){return o},d$:function(){return a},g0:function(){return s},iD:function(){return p},pK:function(){return c},qH:function(){return h},wH:function(){return l},xs:function(){return f}});var r=n(89937);let l=e=>e.columns,o=(0,r.P1)(l,e=>e.orderedFields),i=(0,r.P1)(l,e=>e.lookup),a=(0,r.Xw)(o,i,(e,t)=>e.map(e=>t[e])),s=(0,r.P1)(l,e=>e.columnVisibilityModel),u=(0,r.Xw)(a,s,(e,t)=>e.filter(e=>!1!==t[e.field])),c=(0,r.Xw)(u,e=>e.map(e=>e.field)),d=(0,r.Xw)(u,e=>{let t=[],n=0;for(let r=0;r<e.length;r+=1)t.push(n),n+=e[r].computedWidth;return t}),p=(0,r.P1)(u,d,(e,t)=>{let n=e.length;return 0===n?0:t[n-1]+e[n-1].computedWidth}),h=(0,r.Xw)(a,e=>e.filter(e=>e.filterable)),f=(0,r.Xw)(a,e=>e.reduce((e,t)=>(t.filterable&&(e[t.field]=t),e),{}))},31509:function(e,t,n){"use strict";n.d(t,{CD:function(){return i},EH:function(){return l},Jz:function(){return o}});var r=n(89937);let l=e=>e.density,o=(0,r.P1)(l,e=>e.value),i=(0,r.P1)(l,e=>e.factor)},61207:function(e,t,n){"use strict";n.d(t,{AF:function(){return y},D7:function(){return d},DY:function(){return v},IQ:function(){return m},J5:function(){return c},Lp:function(){return f},_g:function(){return u},a4:function(){return g},uf:function(){return s},xf:function(){return b},zn:function(){return p}});var r=n(89937),l=n(83614),o=n(90198),i=n(40670);let a=e=>e.filter,s=(0,r.P1)(a,e=>e.filterModel);(0,r.P1)(s,e=>e.quickFilterValues);let u=(0,r.P1)(a,e=>e.filteredRowsLookup),c=(0,r.P1)(a,e=>e.filteredDescendantCountLookup),d=(0,r.Xw)(e=>e.visibleRowsLookup,l.sX,(e,t)=>t.filter(t=>!1!==e[t.id])),p=(0,r.Xw)(d,e=>e.map(e=>e.id)),h=(0,r.Xw)(u,l.sX,(e,t)=>t.filter(t=>!1!==e[t.id])),f=(0,r.Xw)(h,e=>e.map(e=>e.id)),g=(0,r.Xw)(d,i.Kd,i.Lq,(e,t,n)=>n<2?e:e.filter(e=>{var n;return(null==(n=t[e.id])?void 0:n.depth)===0})),m=(0,r.P1)(d,e=>e.length),b=(0,r.P1)(g,e=>e.length),v=(0,r.Xw)(s,o.WH,(e,t)=>{var n;return null==(n=e.items)?void 0:n.filter(e=>{var n,r;if(!e.field)return!1;let l=t[e.field];if(!(null!=l&&l.filterOperators)||(null==l||null==(n=l.filterOperators)?void 0:n.length)===0)return!1;let o=l.filterOperators.find(t=>t.value===e.operator);return!!o&&(!o.InputComponent||null!=e.value&&(null==(r=e.value)?void 0:r.toString())!=="")})}),y=(0,r.Xw)(v,e=>e.reduce((e,t)=>
16(e[t.field]?e[t.field].push(t):e[t.field]=[t],e),{}))},67746:function(e,t,n){"use strict";n.d(t,{c:function(){return l}});var r=n(69107);let l=()=>({items:[],logicOperator:r.G.And,quickFilterValues:[],quickFilterLogicOperator:r.G.And})},98991:function(e,t,n){"use strict";let r;n.d(t,{tY:function(){return C},p3:function(){return d},S:function(){return m},W$:function(){return I},GS:function(){return b},NF:function(){return g}});var l=n(87462),o=n(69107),i=n(99864),a=n(67746),s=n(42339);function u(e){return{current:e.current.getPublicApi()}}var c=n(90198);let d=(e,t)=>{let n=(0,l.Z)({},e);if(null==n.id&&(n.id=Math.round(1e5*Math.random())),null==n.operator){let e=(0,c.WH)(t)[n.field];n.operator=e&&e.filterOperators[0].value}return n},p=(0,s.b)(["MUI: The `filterModel` can only contain a single item when the `disableMultipleColumnsFiltering` prop is set to `true`.","If you are using the community version of the `DataGrid`, this prop is always `true`."],"error"),h=(0,s.b)("MUI: The `id` field is required on `filterModel.items` when you use multiple filters.","error"),f=(0,s.b)("MUI: The `operator` field is required on `filterModel.items`, one or more of your filtering item has no `operator` provided.","error"),g=(e,t,n)=>{let r;let o=e.items.length>1;o&&t?(p(),r=[e.items[0]]):r=e.items;let i=o&&r.some(e=>null==e.id),a=r.some(e=>null==e.operator);return(i&&h(),a&&f(),a||i)?(0,l.Z)({},e,{items:r.map(e=>d(e,n))}):e.items!==r?(0,l.Z)({},e,{items:r}):e},m=(e,t,n)=>r=>(0,l.Z)({},r,{filterModel:g(e,t,n)}),b=e=>"string"==typeof e?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e,v=(e,t)=>{let n;if(!e.field||!e.operator)return null;let r=t.current.getColumn(e.field);if(!r)return null;if(r.valueParser){var o;let t=r.valueParser;n=Array.isArray(e.value)?null==(o=e.value)?void 0:o.map(e=>t(e)):t(e.value)}else n=e.value;let{ignoreDiacritics:a}=t.current.rootProps;a&&(n=b(n));let s=(0,l.Z)({},e,{value:n}),c=r.filterOperators;if(!(null!=c&&c.length))throw Error(`MUI: No filter operators found for column '${r.field}'.`);let d=c.find(e=>e.value===s.operator);if(!d)throw Error(`MUI: No filter operator found for column '${r.field}' and operator value '${s.operator}'.`);let p=!(0,i.MN)(d.getApplyFilterFn),h=!(0,i.MN)(d.getApplyFilterFnV7),f=u(t);if(d.getApplyFilterFnV7&&!(p&&!h)){let e=d.getApplyFilterFnV7(s,r);return"function"!=typeof e?null:{v7:!0,item:s,fn:n=>{let l=t.current.getRowValue(n,r);return a&&(l=b(l)),e(l,n,r,f)}}}let g=d.getApplyFilterFn(s,r);return"function"!=typeof g?null:{v7:!1,item:s,fn:e=>{let n=t.current.getCellParams(e,s.field);i.V1.current=f,a&&(n.value=b(n.value));let r=g(n);return i.V1.current=null,r}}},y=1,x=(e,t,n)=>{let{items:l}=e,o=l.map(e=>v(e,t)).filter(e=>!!e);if(0===o.length)return null;if(n||!function(){if(void 0!==r)return r;try{r=Function("return true")()}catch(e){r=!1}return r}())return(e,n)=>{let r={};for(let l=0;l<o.length;l+=1){let i=o[l];(!n||n(i.item.field))&&(r[i.item.id]=i.v7?i.fn(e):i.fn(t.current.getRowId(e)))}return r};let i=Function("getRowId","appliers","row","shouldApplyFilter",`"use strict";
17${o.map((e,t)=>`const shouldApply${t} = !shouldApplyFilter || shouldApplyFilter(${JSON.stringify(e.item.field)});`).join("\n")}
18
19const result$$ = {
20${o.map((e,t)=>`  ${JSON.stringify(String(e.item.id))}: !shouldApply${t}
21    ? false
22    : ${e.v7?`appliers[${t}].fn(row)`:`appliers[${t}].fn(getRowId(row))`},`).join("\n")}
23};
24
25return result$$;`.replaceAll("$$",String(y)));return y+=1,(e,n)=>i(t.current.getRowId,o,e,n)},w=(e,t)=>{var n,r,l;let o=null!=(n=null==(r=e.quickFilterValues)?void 0:r.filter(Boolean))?n:[];if(0===o.length)return null;let a=null!=(l=e.quickFilterExcludeHiddenColumns)&&l?(0,c.pK)(t):(0,c.Zi)(t),s=[],{ignoreDiacritics:d}=t.current.rootProps,p=u(t);return a.forEach(e=>{let n=t.current.getColumn(e),r=null==n?void 0:n.getApplyQuickFilterFn,l=null==n?void 0:n.getApplyQuickFilterFnV7,a=!(0,i.MN)(r),u=!(0,i.MN)(l);l&&!(a&&!u)?s.push({column:n,appliers:o.map(e=>({v7:!0,fn:l(d?b(e):e,n,p)}))}):r&&s.push({column:n,appliers:o.map(e=>({v7:!1,fn:r(d?b(e):e,n,p)}))})}),function(e,n){let r={},l={};e:for(let a=0;a<o.length;a+=1){let u=o[a];for(let o=0;o<s.length;o+=1){let{column:c,appliers:h}=s[o],{field:f}=c;if(n&&!n(f))continue;let g=h[a],m=t.current.getRowValue(e,c);if(null!==g.fn){if(g.v7){if(d&&(m=b(m)),g.fn(m,e,c,p)){r[u]=!0;continue e}}else{var i;let n=null!=(i=l[f])?i:t.current.getCellParams(t.current.getRowId(e),f);
25if(d&&(n.value=b(n.value)),l[f]=n,g.fn(n)){r[u]=!0;continue e}}}}r[u]=!1}return r}},C=(e,t,n)=>{let r=x(e,t,n),l=w(e,t);return function(e,t,n){var o,i;n.passingFilterItems=null!=(o=null==r?void 0:r(e,t))?o:null,n.passingQuickFilterValues=null!=(i=null==l?void 0:l(e,t))?i:null}},S=e=>null!=e,k=(e,t,n)=>(e.cleanedFilterItems||(e.cleanedFilterItems=n.filter(e=>null!==v(e,t))),e.cleanedFilterItems),I=(e,t,n,r,l)=>{var i,s;let u=k(l,r,n.items),c=e.filter(S),d=t.filter(S);if(c.length>0){let e=e=>c.some(t=>t[e.id]);if((null!=(i=n.logicOperator)?i:(0,a.c)().logicOperator)===o.G.And){if(!u.every(e))return!1}else if(!u.some(e))return!1}if(d.length>0&&null!=n.quickFilterValues){let e=e=>d.some(t=>t[e]);if((null!=(s=n.quickFilterLogicOperator)?s:(0,a.c)().quickFilterLogicOperator)===o.G.And){if(!n.quickFilterValues.every(e))return!1}else if(!n.quickFilterValues.some(e))return!1}return!0}},35543:function(e,t,n){"use strict";n.d(t,{E5:function(){return h},Gs:function(){return s},TR:function(){return o},X5:function(){return d},Y$:function(){return a},d6:function(){return c},uT:function(){return p},ud:function(){return i}});var r=n(89937);let l=e=>e.focus,o=(0,r.P1)(l,e=>e.cell),i=(0,r.P1)(l,e=>e.columnHeader),a=(0,r.P1)(l,e=>e.columnHeaderFilter),s=(0,r.P1)(l,e=>e.columnGroupHeader),u=e=>e.tabIndex,c=(0,r.P1)(u,e=>e.cell),d=(0,r.P1)(u,e=>e.columnHeader),p=(0,r.P1)(u,e=>e.columnHeaderFilter),h=(0,r.P1)(u,e=>e.columnGroupHeader)},48949:function(e,t,n){"use strict";n.d(t,{B_:function(){return d},Mk:function(){return f},O$:function(){return s},RM:function(){return u},UB:function(){return p},Uj:function(){return h},Yp:function(){return g},bu:function(){return c},fL:function(){return a}});var r=n(89937),l=n(61207),o=n(40670),i=n(44932);let a=e=>e.pagination,s=(0,r.P1)(a,e=>e.paginationModel),u=(0,r.P1)(a,e=>e.rowCount),c=(0,r.P1)(s,e=>e.page),d=(0,r.P1)(s,e=>e.pageSize),p=(0,r.P1)(d,u,(e,t)=>(0,i.tR)(t,e)),h=(0,r.Xw)(s,o.Kd,o.Lq,l.D7,l.a4,(e,t,n,r,l)=>{let o=l.length,i=Math.min(e.pageSize*e.page,o-1),a=Math.min(i+e.pageSize-1,o-1);if(-1===i||-1===a)return null;if(n<2)return{firstRowIndex:i,lastRowIndex:a};let s=l[i],u=a-i+1,c=r.findIndex(e=>e.id===s.id),d=c,p=0;for(;d<r.length&&p<=u;){var h;let e=null==(h=t[r[d].id])?void 0:h.depth;void 0===e?d+=1:((p<u||e>0)&&(d+=1),0===e&&(p+=1))}return{firstRowIndex:c,lastRowIndex:d-1}}),f=(0,r.Xw)(l.D7,h,(e,t)=>t?e.slice(t.firstRowIndex,t.lastRowIndex+1):[]),g=(0,r.Xw)(l.zn,h,(e,t)=>t?e.slice(t.firstRowIndex,t.lastRowIndex+1):[])},44932:function(e,t,n){"use strict";n.d(t,{Ip:function(){return u},NZ:function(){return s},Xd:function(){return a},dG:function(){return o},tR:function(){return i}});var r=n(42339),l=n(8596);let o=e=>e?0:100,i=(e,t)=>t>0&&e>0?Math.ceil(e/t):0;(0,r.b)(["MUI: the 'rowCount' prop is undefined while using paginationMode='server'","For more detail, see http://mui.com/components/data-grid/pagination/#basic-implementation"],"error");let a=e=>({page:0,pageSize:e?0:100}),s=(e,t=0)=>0===t?e:Math.max(Math.min(e,t-1),0),u=(e,t)=>{if(t===l.cG.DataGrid&&e>100)throw Error("MUI: `pageSize` cannot exceed 100 in the MIT version of the DataGrid.\nYou need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.")}},10269:function(e,t,n){"use strict";n.d(t,{e:function(){return r}});let r=e=>e.preferencePanel},27476:function(e,t,n){"use strict";n.d(t,{y:function(){return l}});var r,l=((r=l||{}).filters="filters",r.columns="columns",r)},7083:function(e,t,n){"use strict";n.d(t,{Y1:function(){return o},bR:function(){return a},xD:function(){return i},z8:function(){return s}});var r=n(89937),l=n(40670);let o=e=>e.rowSelection,i=(0,r.P1)(o,e=>e.length),a=(0,r.Xw)(o,l.J4,(e,t)=>new Map(e.map(e=>[e,t[e]]))),s=(0,r.Xw)(o,e=>e.reduce((e,t)=>(e[t]=t,e),{}))},40670:function(e,t,n){"use strict";n.d(t,{G$:function(){return a},J4:function(){return s},J5:function(){return b},Kd:function(){return c},Kf:function(){return m},Le:function(){return d},Lq:function(){return h},Qr:function(){return u},Vk:function(){return i},hh:function(){return o},i$:function(){return p},yM:function(){return f}});var r=n(89937);let l=e=>e.rows,o=(0,r.P1)(l,e=>e.totalRowCount),i=(0,r.P1)(l,e=>e.loading),a=(0,r.P1)(l,e=>e.totalTopLevelRowCount),s=(0,r.P1)(l,e=>
25e.dataRowIdToModelLookup),u=(0,r.P1)(l,e=>e.dataRowIdToIdLookup),c=(0,r.P1)(l,e=>e.tree),d=(0,r.P1)(l,e=>e.groupingName),p=(0,r.P1)(l,e=>e.treeDepths),h=(0,r.Xw)(l,e=>{let t=Object.entries(e.treeDepths);return 0===t.length?1:t.filter(([,e])=>e>0).map(([e])=>Number(e)).sort((e,t)=>t-e)[0]+1}),f=(0,r.P1)(l,e=>e.dataRowIds),g=(0,r.P1)(l,e=>null==e?void 0:e.additionalRowGroups),m=(0,r.Xw)(g,e=>{var t,n;let r=null==e?void 0:e.pinnedRows;return{bottom:null==r||null==(t=r.bottom)?void 0:t.map(e=>{var t;return{id:e.id,model:null!=(t=e.model)?t:{}}}),top:null==r||null==(n=r.top)?void 0:n.map(e=>{var t;return{id:e.id,model:null!=(t=e.model)?t:{}}})}}),b=(0,r.P1)(m,e=>{var t,n;return((null==e||null==(t=e.top)?void 0:t.length)||0)+((null==e||null==(n=e.bottom)?void 0:n.length)||0)})},4260:function(e,t,n){"use strict";n.d(t,{E2:function(){return s},IX:function(){return p},PO:function(){return c},U5:function(){return i},ZD:function(){return d},ZM:function(){return b},_1:function(){return a},jI:function(){return u},oq:function(){return m},u4:function(){return f},vn:function(){return g},wq:function(){return h}});var r=n(87462),l=n(40670),o=n(31509);let i="auto-generated-group-node-root",a=Symbol("mui.id_autogenerated"),s=()=>({type:"group",id:i,depth:-1,groupingField:null,groupingKey:null,isAutoGenerated:!0,children:[],childrenFromPath:{},childrenExpanded:!0,parent:null}),u=(e,t,n)=>{let r=t?t(e):e.id;return!function(e,t,n="A row was provided without id in the rows prop:"){if(null==e)throw Error(["MUI: The data grid component requires all rows to have a unique `id` property.","Alternatively, you can use the `getRowId` prop to specify a custom id for each row.",n,JSON.stringify(t)].join("\n"))}(r,e,n),r},c=({rows:e,getRowId:t,loading:n,rowCount:r})=>{let l={type:"full",rows:[]},o={},i={};for(let n=0;n<e.length;n+=1){let r=e[n],a=u(r,t);o[a]=r,i[a]=a,l.rows.push(a)}return{rowsBeforePartialUpdates:e,loadingPropBeforePartialUpdates:n,rowCountPropBeforePartialUpdates:r,updates:l,dataRowIdToIdLookup:i,dataRowIdToModelLo
25okup:o}},d=({tree:e,rowCountProp:t=0})=>{let n=e[i];return Math.max(t,n.children.length+(null==n.footerId?0:1))},p=({apiRef:e,rowCountProp:t=0,loadingProp:n,previousTree:l,previousTreeDepths:o})=>{let i=e.current.caches.rows,{tree:a,treeDepths:s,dataRowIds:u,groupingName:c}=e.current.applyStrategyProcessor("rowTreeCreation",{previousTree:l,previousTreeDepths:o,updates:i.updates,dataRowIdToIdLookup:i.dataRowIdToIdLookup,dataRowIdToModelLookup:i.dataRowIdToModelLookup}),p=e.current.unstable_applyPipeProcessors("hydrateRows",{tree:a,treeDepths:s,dataRowIdToIdLookup:i.dataRowIdToIdLookup,dataRowIds:u,dataRowIdToModelLookup:i.dataRowIdToModelLookup});return e.current.caches.rows.updates={type:"partial",actions:{insert:[],modify:[],remove:[]},idToActionLookup:{}},(0,r.Z)({},p,{totalRowCount:Math.max(t,p.dataRowIds.length),totalTopLevelRowCount:d({tree:p.tree,rowCountProp:t}),groupingName:c,loading:n})},h=e=>"skeletonRow"===e.type||"footer"===e.type||"group"===e.type&&e.isAutoGenerated||"pinnedRow"===e.type&&e.isAutoGenerated,f=(e,t,n)=>{let r=e[t];if("group"!==r.type)return[];let l=[];for(let t=0;t<r.children.length;t+=1){let o=r.children[t];n&&h(e[o])||l.push(o);let i=f(e,o,n);for(let e=0;e<i.length;e+=1)l.push(i[e])}return n||null==r.footerId||l.push(r.footerId),l},g=({previousCache:e,getRowId:t,updates:n})=>{var l,o,i;if("full"===e.updates.type)throw Error("MUI: Unable to prepare a partial update if a full update is not applied yet");let a=new Map;n.forEach(e=>{let n=u(e,t,"A row was provided without id when calling updateRows():");a.has(n)?a.set(n,(0,r.Z)({},a.get(n),e)):a.set(n,e)});let s={type:"partial",actions:{insert:[...null!=(l=e.updates.actions.insert)?l:[]],modify:[...null!=(o=e.updates.actions.modify)?o:[]],remove:[...null!=(i=e.updates.actions.remove)?i:[]]},idToActionLookup:(0,r.Z)({},e.updates.idToActionLookup)},c=(0,r.Z)({}
25,e.dataRowIdToModelLookup),d=(0,r.Z)({},e.dataRowIdToIdLookup),p={insert:{},modify:{},remove:{}};a.forEach((e,t)=>{let n=s.idToActionLookup[t];if("delete"===e._action){if("remove"===n||!c[t])return;null!=n&&(p[n][t]=!0),s.actions.remove.push(t),delete c[t],delete d[t];return}let l=c[t];if(l){"remove"===n?(p.remove[t]=!0,s.actions.modify.push(t)):null==n&&s.actions.modify.push(t),c[t]=(0,r.Z)({},l,e);return}"remove"===n?(p.remove[t]=!0,s.actions.insert.push(t)):null==n&&s.actions.insert.push(t),c[t]=e,d[t]=t});let h=Object.keys(p);for(let e=0;e<h.length;e+=1){let t=h[e],n=p[t];Object.keys(n).length>0&&(s.actions[t]=s.actions[t].filter(e=>!n[e]))}return{dataRowIdToModelLookup:c,dataRowIdToIdLookup:d,updates:s,rowsBeforePartialUpdates:e.rowsBeforePartialUpdates,loadingPropBeforePartialUpdates:e.loadingPropBeforePartialUpdates,rowCountPropBeforePartialUpdates:e.rowCountPropBeforePartialUpdates}};function m(e){var t,n;let r=(0,l.Kf)(e);return{top:(null==r||null==(t=r.top)?void 0:t.reduce((t,n)=>t+=e.current.unstable_getRowHeight(n.id),0))||0,bottom:(null==r||null==(n=r.bottom)?void 0:n.reduce((t,n)=>t+=e.current.unstable_getRowHeight(n.id),0))||0}}function b(e,t){let n=(0,o.CD)(e);return`var(--DataGrid-overlayHeight, ${2*Math.floor(t*n)}px)`}},83614:function(e,t,n){"use strict";n.d(t,{Gm:function(){return s},Nl:function(){return u},aV:function(){return i},sX:function(){return a}});var r=n(89937),l=n(40670);let o=e=>e.sorting,i=(0,r.P1)(o,e=>e.sortedRows),a=(0,r.Xw)(i,l.J4,(e,t)=>e.map(e=>{var n;return{id:e,model:null!=(n=t[e])?n:{}}})),s=(0,r.P1)(o,e=>e.sortModel),u=(0,r.Xw)(s,e=>e.reduce((t,n,r)=>(t[n.field]={sortDirection:n.sort,sortIndex:e.length>1?r+1:void 0},t),{}))},99588:function(e,t,n){"use strict";n.d(t,{E8:function(){return i},GH:function(){return g},Id:function(){return f},Te:function(){return o},mA:function(){return m},oX:function(){return c},vY:function(){return d}});var r=n(87462);let l=(0,n(42339).b)(["MUI: The `sortModel` can only contain a single item when the `disableMultipleColumnsSorting` prop is set to `true`.","If you are using the community version of the `DataGrid`, this prop is always `true`."],"error"),o=(e,t)=>t&&e.length>1?(l(),[e[0]]):e,i=(e,t)=>n=>(0,r.Z)({},n,{sorting:(0,r.Z)({},n.sorting,{sortModel:o(e,t)})}),a=e=>"desc"===e,s=(e,t)=>{let n=t.current.getColumn(e.field);return n?{getSortCellParams:e=>({id:e,field:n.field,rowNode:t.current.getRowNode(e),value:t.current.getCellValue(e,n.field),api:t.current}),comparator:a(e.sort)?(...e)=>-1*n.sortComparator(...e):n.sortComparator}:null},u=(e,t,n)=>e.reduce((e,r,l)=>{if(0!==e)return e;let o=t.params[l],i=n.params[l];return e=r.comparator(o.value,i.value,o,i)},0),c=(e,t)=>{let n=e.map(e=>s(e,t)).filter(e=>!!e);return 0===n.length?null:e=>e.map(e=>({node:e,params:n.map(t=>t.getSortCellParams(e.id))})).sort((e,t)=>u(n,e,t)).map(e=>e.node.id)},d=(e,t)=>{let n=e.indexOf(t);return t&&-1!==n&&n+1!==e.length?e[n+1]:e[0]},p=(e,t)=>null==e&&null!=t?-1:null==t&&null!=e?1:null==e&&null==t?0:null,h=new Intl.Collator,f=(e,t)=>{let n=p(e,t);return null!==n?n:"string"==typeof e?h.compare(e.toString(),t.toString()):e-t},g=(e,t)=>{let n=p(e,t);return null!==n?n:Number(e)-Number(t)},m=(e,t)=>{let n=p(e,t);return null!==n?n:e>t?1:e<t?-1:0}},49630:function(e,t,n){"use strict";n.d(t,{l:function(){return o}});var r=n(67294),l=n(17145);function o(){let e=r.useContext(l.r);if(void 0===e)throw Error("MUI: Could not find the data grid context.\nIt looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.\nThis can also happen if you are bundling multiple versions of the data grid.");return e}},8596:function(e,t,n){"use strict";let r;n.d(t,{cG:function(){return u},zn:function(){return d},x3:function(){return h}});var l,o,i=n(67294);class a{constructor(e=1e3){this.timeouts=new Map,this.cleanupTimeout=1e3,this.cleanupTimeout=e}register(e,t,n){this.timeouts||(this.timeouts=new Map);let r=setTimeout(()=>{"function"==typeof t&&t(),this.timeouts.delete(n.cleanupToken)},this.cleanupTimeout);this.timeouts.set(n.cleanupToken,r)}unregister(e){let t=this.timeouts.get(e.cleanupToken);t&&(this.timeouts.delete(e.cleanupToken),clearTimeout(t))}
25reset(){this.timeouts&&(this.timeouts.forEach((e,t)=>{this.unregister({cleanupToken:t})}),this.timeouts=void 0)}}class s{constructor(){this.registry=new FinalizationRegistry(e=>{"function"==typeof e&&e()})}register(e,t,n){this.registry.register(e,t,n)}unregister(e){this.registry.unregister(e)}reset(){}}var u=((l=u||{}).DataGrid="DataGrid",l.DataGridPro="DataGridPro",l);class c{}let d=(o={registry:null},r=0,function(e,t,n,l){null===o.registry&&(o.registry="undefined"!=typeof FinalizationRegistry?new s:new a);let[u]=i.useState(new c),d=i.useRef(null),p=i.useRef();p.current=n;let h=i.useRef(null);!d.current&&p.current?(d.current=e.current.subscribeEvent(t,(e,t,n)=>{if(!t.defaultMuiPrevented){var r;null==(r=p.current)||r.call(p,e,t,n)}},l),r+=1,h.current={cleanupToken:r},o.registry.register(u,()=>{var e;null==(e=d.current)||e.call(d),d.current=null,h.current=null},h.current)):!p.current&&d.current&&(d.current(),d.current=null,h.current&&(o.registry.unregister(h.current),h.current=null)),i.useEffect(()=>(!d.current&&p.current&&(d.current=e.current.subscribeEvent(t,(e,t,n)=>{if(!t.defaultMuiPrevented){var r;null==(r=p.current)||r.call(p,e,t,n)}},l)),h.current&&o.registry&&(o.registry.unregister(h.current),h.current=null),()=>{var e;null==(e=d.current)||e.call(d),d.current=null}),[e,t,l])}),p={isFirst:!0};function h(e,t,n){d(e,t,n,p)}},48836:function(e,t,n){"use strict";n.d(t,{B:function(){return o}});var r=n(67294),l=n(1497);let o=()=>{let e=r.useContext(l.G);if(!e)throw Error("MUI: useGridRootProps should only be used inside the DataGrid, DataGridPro or DataGridPremium component.");return e}},14696:function(e,t,n){"use strict";n.d(t,{P:function(){return p},v:function(){return c}});var r=n(67294),l=n(10693),o=n(80229),i=n(42339),a=n(31774);function s(e,t){return t.acceptsApiRef?t(e):t(e.current.state)}(0,i.b)(["MUI: `useGridSelector` has been called before the initialization of the state.","This hook can only be used inside the context of the grid."]);let u=Object.is,c=a.w,d=()=>({state:null,equals:null,selector:null}),p=(e,t,n=u)=>{let i=(0,l.A)(d),a=null!==i.current.selector,[c,p]=r.useState(a?null:s(e,t));return i.current.state=c,i.current.equals=n,i.current.selector=t,(0,o.F)(()=>e.current.store.subscribe(()=>{let t=s(e,i.current.selector);i.current.equals(i.current.state,t)||(i.current.state=t,p(t))})),c}},10693:function(e,t,n){"use strict";n.d(t,{A:function(){return o}});var r=n(67294);let l={};function o(e,t){let n=r.useRef(l);return n.current===l&&(n.current=e(t)),n}},80229:function(e,t,n){"use strict";n.d(t,{F:function(){return o}});var r=n(67294);let l=[];function o(e){r.useEffect(e,l)}},14773:function(e,t,n){"use strict";n.d(t,{K:function(){return i}});var r=n(10693),l=n(80229);class o{constructor(){this.currentId=0,this.clear=()=>{0!==this.currentId&&(clearTimeout(this.currentId),this.currentId=0)},this.disposeEffect=()=>this.clear}static create(){return new o}start(e,t){this.clear(),this.currentId=setTimeout(t,e)}}function i(){let e=(0,r.A)(o.create).current;return(0,l.F)(e.disposeEffect),e}},69107:function(e,t,n){"use strict";n.d(t,{G:function(){return l}});var r,l=((r=l||{}).And="and",r.Or="or",r)},89937:function(e,t,n){"use strict";n.d(t,{P1:function(){return s},Xw:function(){return u}});var r=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return function(){for(var t,r=arguments.length,l=Array(r),o=0;o<r;o++)l[o]=arguments[o];var i=0,a={memoizeOptions:void 0},s=l.pop();if("object"==typeof s&&(a=s,s=l.pop()),"function"!=typeof s)throw Error("createSelector expects an output function after the inputs, but received: ["+typeof s+"]");var u=a.memoizeOptions,c=void 0===u?n:u,d=Array.isArray(c)?c:[c],p=function(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every(function(e){return"function"==typeof e}))throw Error("createSelector expects all input-selectors to be functions, but received the following types: ["+t.map(function(e){return"function"==typeof e?"function "+(e.name||"unnamed")+"()":typeof e}).join(", ")+"]");return t}(l),h=e.apply(void 0,[function(){return i++,s.apply(null,arguments)}].concat(d)),f=e(function(){for(var e=[],n=p.length,r=0;r<n;r++)e.push(p[r].apply(null,arguments));return t=h.apply(null,e)});return Object.assign(f,{resultFunc:s,memoizedResultFunc:h,dependencies:p,lastResult:function(){return t},recomputations:function(){return i},resetRecomputations:function(){return i=0}}),f}}(n(44815).PW),l=n(42339);let o={cache:new WeakMap};function i(e){return"current"in e&&"instanceId"in e.current}(0,l.b)(["MUI: A selector was called without passing the instance ID, which may impact the performance of the grid.","To fix, call it with `apiRef`, e.g. `mySelector(apiRef)`, or pass the instance ID explicitly, e.g. `mySelector(state, apiRef.current.instanceId)`."]);let a={id:"default"},s=(e,t,n,r,l,o,...s)=>{let u;if(s.length>0)throw Error("Unsupported number of selectors");if(e&&t&&n&&r&&l&&o)u=(s,u)=>{let c=i(s),d=null!=u?u:c?s.current.instanceId:a,p=c?s.current.state:s,h=e(p,d),f=t(p,d);return o(h,f,n(p,d),r(p,d),l(p,d))};else if(e&&t&&n&&r&&l)u=(o,s)=>{let u=i(o),c=null!=s?s:u?o.current.instanceId:a,d=u?o.current.state:o,p=e(d,c);return l(p,t(d,c),n(d,c),r(d,c))};else if(e&&t&&n&&r)u=(l,o)=>{let s=i(l),u=null!=o?o:s?l.current.instanceId:a,c=s?l.current.state:l;return r(e(c,u),t(c,u),n(c,u))};else if(e&&t&&n)u=(r,l)=>{let o=i(r),s=null!=l?l:o?r.current.instanceId:a,u=o?r.current.state:r;return n(e(u,s),t(u,s))};else if(e&&t)u=(n,r)=>{let l=i(n),o=null!=r?r:l?n.current.instanceId:a;return t(e(l?n.current.state:n,o))};else throw Error("Missing arguments");return u.acceptsApiRef=!0,u},u=(...e)=>{let t=(...t)=>{var n,l,s;let[u,c]=t,d=i(u),p=d?u.current.instanceId:null!=c?c:a,h=d?u.current.state:u,{cache:f}=o;if(f.get(p)&&null!=(n=f.get(p))&&n.get(e))return null==(s=f.get(p))?void 0:s.get(e)(h,p);let g=r(...e);return f.get(p)||f.set(p,new Map),null==(l=f.get(p))||l.set(e,g),g(h,p)};return t.acceptsApiRef=!0,t}},31774:function(e,t,n){"use strict";n.d(t,{w:function(){return l}});let r=Object.is;function l(e,t){if(e===t)return!0;
25if(!(e instanceof Object)||!(t instanceof Object))return!1;let n=0,l=0;for(let l in e)if(n+=1,!r(e[l],t[l])||!(l in t))return!1;for(let e in t)l+=1;return n===l}},41592:function(e,t,n){"use strict";n.d(t,{$o:function(){return r},J2:function(){return c},Mh:function(){return h},Ni:function(){return d},Xq:function(){return i},id:function(){return o},r$:function(){return l},vd:function(){return p}});let r=e=>"Escape"===e,l=e=>"Enter"===e,o=e=>"Tab"===e,i=e=>" "===e,a=e=>0===e.indexOf("Arrow"),s=e=>"Home"===e||"End"===e,u=e=>0===e.indexOf("Page");function c(e){return 1===e.key.length&&!e.ctrlKey&&!e.metaKey}let d=e=>s(e)||a(e)||u(e)||i(e),p=e=>!!e.key,h=e=>o(e)||r(e)},24791:function(e,t,n){"use strict";function r(e){return"number"==typeof e&&!Number.isNaN(e)}function l(e){return"function"==typeof e}function o(e){return"object"==typeof e&&null!==e}function i(){try{let e="__some_random_key_you_are_not_going_to_use__";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}}function a(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}n.d(t,{I8:function(){return c},Kn:function(){return o},Vu:function(){return i},he:function(){return u},hj:function(){return r},hr:function(){return a},mf:function(){return l},uZ:function(){return s},xb:function(){return function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;if(Array.isArray(t)){let r=t.length;if(r!==n.length)return!1;for(let l=0;l<r;l+=1)if(!e(t[l],n[l]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;let r=Array.from(t.entries());for(let e=0;e<r.length;e+=1)if(!n.has(r[e][0]))return!1;for(let t=0;t<r.length;t+=1){let l=r[t];if(!e(l[1],n.get(l[0])))return!1}return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;let e=Array.from(t.entries());for(let t=0;t<e.length;t+=1)if(!n.has(e[t][0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){let e=t.length;if(e!==n.length)return!1;for(let r=0;r<e;r+=1)if(t[r]!==n[r])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();let r=Object.keys(t),l=r.length;if(l!==Object.keys(n).length)return!1;for(let e=0;e<l;e+=1)if(!Object.prototype.hasOwnProperty.call(n,r[e]))return!1;for(let o=0;o<l;o+=1){let l=r[o];if(!e(t[l],n[l]))return!1}return!0}return t!=t&&n!=n}}});let s=(e,t,n)=>Math.max(t,Math.min(n,e));function u(e,t,n){var r;let l=(r=e,()=>{let e=r+=1831565813;return e=Math.imul(e^e>>>15,1|e),(((e^=e+Math.imul(e^e>>>7,61|e))^e>>>14)>>>0)/4294967296});return()=>t+(n-t)*l()}function c(e){return"function"==typeof structuredClone?structuredClone(e):JSON.parse(JSON.stringify(e))}},42339:function(e,t,n){"use strict";n.d(t,{b:function(){return r}});let r=(e,t="warning")=>{let n=!1,r=Array.isArray(e)?e.join("\n"):e;return()=>{n||(n=!0,"error"===t?console.error(r):console.warn(r))}}},94470:function(e){"use strict";var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,l=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},i=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,l=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!l&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},a=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(l)return l(e,n).value}return e[n]};e.exports=function e(){var t,n,r,l,u,c,d=arguments[0],p=1,h=arguments.length,f=!1;for("boolean"==typeof d&&(f=d,d=arguments[1]||{},p=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});p<h;++p)if(t=arguments[p],null!=t)for(n in t)r=s(d,n),d!==(l=s(t,n))&&(f&&l&&(i(l)||(u=o(l)))?(u?(u=!1,c=r&&o(r)?r:[]):c=r&&i(r)?r:{},a(d,{name:n,newValue:e(f,c,l)})):void 0!==l&&a(d,{name:n,newValue:l}));return d}},85321:function(e){"use strict";var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;
25\s]*/,s=/^\s+|\s+$/g;function u(e){return e?e.replace(s,""):""}e.exports=function(e,s){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];s=s||{};var c=1,d=1;function p(e){var t=e.match(n);t&&(c+=t.length);var r=e.lastIndexOf("\n");d=~r?e.length-r:d+e.length}function h(){var e={line:c,column:d};return function(t){return t.position=new f(e),m(r),t}}function f(e){this.start=e,this.end={line:c,column:d},this.source=s.source}function g(t){var n=Error(s.source+":"+c+":"+d+": "+t);if(n.reason=t,n.filename=s.source,n.line=c,n.column=d,n.source=e,s.silent);else throw n}function m(t){var n=t.exec(e);if(n){var r=n[0];return p(r),e=e.slice(r.length),n}}function b(e){var t;for(e=e||[];t=v();)!1!==t&&e.push(t);return e}function v(){var t=h();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;""!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return g("End of comment missing");var r=e.slice(2,n-2);return d+=2,p(r),e=e.slice(n),d+=2,t({type:"comment",comment:r})}}return f.prototype.content=e,m(r),function(){var e,n=[];for(b(n);e=function(){var e=h(),n=m(l);if(n){if(v(),!m(o))return g("property missing ':'");var r=m(i),s=e({type:"declaration",property:u(n[0].replace(t,"")),value:r?u(r[0].replace(t,"")):""});return m(a),s}}();)!1!==e&&(n.push(e),b(n));return n}()}},13:function(e){e.exports=function(e,t){return null!=e&&t in Object(e)}},2958:function(e,t,n){var r=n(46384),l=n(90939);e.exports=function(e,t,n,o){var i=n.length,a=i,s=!o;if(null==e)return!a;for(e=Object(e);i--;){var u=n[i];if(s&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++i<a;){var c=(u=n[i])[0],d=e[c],p=u[1];if(s&&u[2]){if(void 0===d&&!(c in e))return!1}else{var h=new r;if(o)var f=o(d,p,c,e,t,h);if(!(void 0===f?l(p,d,3,o,h):f))return!1}}return!0}},67206:function(e,t,n){var r=n(91573),l=n(16432),o=n(6557),i=n(1469),a=n(39601);e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?i(e)?l(e[0],e[1]):r(e):a(e)}},91573:function(e,t,n){var r=n(2958),l=n(1499),o=n(42634);e.exports=function(e){var t=l(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},16432:function(e,t,n){var r=n(90939),l=n(27361),o=n(79095),i=n(15403),a=n(89162),s=n(42634),u=n(40327);e.exports=function(e,t){return i(e)&&a(t)?s(u(e),t):function(n){var i=l(n,e);return void 0===i&&i===t?o(n,e):r(t,i,3)}}},63012:function(e,t,n){var r=n(97786),l=n(10611),o=n(71811);e.exports=function(e,t,n){for(var i=-1,a=t.length,s={};++i<a;){var u=t[i],c=r(e,u);n(c,u)&&l(s,o(u,e),c)}return s}},40371:function(e){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},79152:function(e,t,n){var r=n(97786);e.exports=function(e){return function(t){return r(t,e)}}},10611:function(e,t,n){var r=n(34865),l=n(71811),o=n(65776),i=n(13218),a=n(40327);e.exports=function(e,t,n,s){if(!i(e))return e;t=l(t,e);for(var u=-1,c=t.length,d=c-1,p=e;null!=p&&++u<c;){var h=a(t[u]),f=n;if("__proto__"===h||"constructor"===h||"prototype"===h)break;if(u!=d){var g=p[h];void 0===(f=s?s(g,h,p):void 0)&&(f=i(g)?g:o(t[u+1])?[]:{})}r(p,h,f),p=p[h]}return e}},1499:function(e,t,n){var r=n(89162),l=n(3674);e.exports=function(e){for(var t=l(e),n=t.length;n--;){var o=t[n],i=e[o];t[n]=[o,i,r(i)]}return t}},222:function(e,t,n){var r=n(71811),l=n(35694),o=n(1469),i=n(65776),a=n(41780),s=n(40327);e.exports=function(e,t,n){t=r(t,e);for(var u=-1,c=t.length,d=!1;++u<c;){var p=s(t[u]);if(!(d=null!=e&&n(e,p)))break;e=e[p]}return d||++u!=c?d:!!(c=null==e?0:e.length)&&a(c)&&i(p,c)&&(o(e)||l(e))}},89162:function(e,t,n){var r=n(13218);e.exports=function(e){return e==e&&!r(e)}},42634:function(e){e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},79095:function(e,t,n){var r=n(13),l=n(222);e.exports=function(e,t){return null!=e&&l(e,t,r)}},35937:function(e,t,n){var r=n(29932),l=n(67206),o=n(63012),i=n(46904);e.exports=function(e,t){if(null==e)return{};var n=r(i(e),function(e){return[e]});return t=l(t),o(e,n,function(e,n){return t(e,n[0])})}},39601:function(e,t,n){var r=n(40371),l=n(79152),o=n(15403),i=n(40327);e.exports=function(e){return o(e)?r(i(e)):l(e)}},71145:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"m20.54 5.23-1.39-1.68C18.88 3.21 18.47 3 18 3H6c-.47 0-.88.21-1.16.55L3.46 5.23C3.17 5.57 3 6.02 3 6.5V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6.5c0-.48-.17-.93-.46-1.27M12 17.5 6.5 12H10v-2h4v2h3.5zM5.12 5l.81-1h12l.94 1z"}),"Archive")},84956:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"}),"ArrowUpward")},62911:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M11.8 10.9c-2.27-.59-3-1.2-3-2.15 0-1.09 1.01-1.85 2.7-1.85 1.78 0 2.44.85 2.5 2.1h2.21c-.07-1.72-1.12-3.3-3.21-3.81V3h-3v2.16c-1.94.42-3.5 1.68-3.5 3.61 0 2.31 1.91 3.46 4.7 4.13 2.5.6 3 1.48 3 2.41 0 .69-.49 1.79-2.7 1.79-2.06 0-2.87-.92-2.98-2.1h-2.2c.12 2.19 1.76 3.42 3.68 3.83V21h3v-2.15c1.95-.37 3.5-1.5 3.5-3.55 0-2.84-2.43-3.81-4.7-4.4"}),"AttachMoney")},66854:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M4 9h4v11H4zm12 4h4v7h-4zm-6-9h4v16h-4z"}),"BarChart")},78882:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H3V5h18zM5 15h14v3H5z"}),"CallToActionOutlined")},4145:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear")},89857:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"}),"ContentCopy")},53990:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2M4 12c0-4.4 3.6-8 8-8 1.8 0 3.5.6 4.9 1.7L5.7 16.9C4.6 15.5 4 13.8 4 12m8 8c-1.8 0-3.5-.6-4.9-1.7L18.3 7.1C19.4 8.5 20 10.2 20 12c0 4.4-3.6 8-8 8"}),"DoDisturb")},62276:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"m18 7-1.41-1.41-6.34 6.34 1.41 1.41zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12zM.41 13.41 6 19l1.41-1.41L1.83 12z"}),"DoneAll")},34279:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Edit")},5076:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M12 3c-4.8 0-9 3.86-9 9 0 2.12.74 4.07 1.97 5.61L3 19.59 4.41 21l1.97-1.97C7.93 20.26 9.88 21 12 21c2.3 0 4.61-.88 6.36-2.64C20.12 16.61 21 14.3 21 12V3zm3.83 9.26-5.16 4.63c-.16.15-.41.14-.56-.01-.14-.14-.16-.36-.04-.52l2.44
25-3.33-4.05-.4c-.44-.04-.63-.59-.3-.89l5.16-4.63c.16-.15.41-.14.56.01.14.14.16.36.04.52l-2.44 3.33 4.05.4c.45.04.63.59.3.89"}),"EnergySavingsLeaf")},37638:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"ErrorOutline")},27236:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M10.09 15.59 11.5 17l5-5-5-5-1.41 1.41L12.67 11H3v2h9.67zM19 3H5c-1.11 0-2 .9-2 2v4h2V5h14v14H5v-4H3v4c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"}),"ExitToApp")},95371:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3zm-1-4-1.41-1.41L13 12.17V4h-2v8.17L8.41 9.59 7 11l5 5z"}),"FileDownloadOutlined")},64329:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M20 19.59V8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c.45 0 .85-.15 1.19-.4l-4.43-4.43c-.8.52-1.74.83-2.76.83-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5c0 1.02-.31 1.96-.83 2.75zM9 13c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3"}),"FindInPage")},36445:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 17h-2v-2h2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25"}),"Help")},83822:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutline")},938:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M14.59 8 12 10.59 9.41 8 8 9.41 10.59 12 8 14.59 9.41 16 12 13.41 14.59 16 16 14.59 13.41 12 16 9.41zM12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"HighlightOff")},96942:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"}),"Home")},73986:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{fillRule:"evenodd",d:"M4 11h16v2H4z"}),"HorizontalRule")},61596:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2M8.5 13.5l2.5 3.01L14.5 12l4.5 6H5z"}),"Image")},62583:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)([(0,o.jsx)("path",{d:"M21 8c-1.45 0-2.26 1.44-1.93 2.51l-3.55 3.56c-.3-.09-.74-.09-1.04 0l-2.55-2.55C12.27 10.45 11.46 9 10 9c-1.45 0-2.27 1.44-1.93 2.52l-4.56 4.55C2.44 15.74 1 16.55 1 18c0 1.1.9 2 2 2 1.45 0 2.26-1.44 1.93-2.51l4.55-4.56c.3.09.74.09 1.04 0l2.55 2.55C12.73 16.55 13.54 18 15 18c1.45 0 2.27-1.44 1.93-2.52l3.56-3.55c1.07.33 2.51-.48 2.51-1.93 0-1.1-.9-2-2-2"},"0"),(0,o.jsx)("path",{d:"m15 9 .94-2.07L18 6l-2.06-.93L15 3l-.92 2.07L12 6l2.08.93zM3.5 11 4 9l2-.5L4 8l-.5-2L3 8l-2 .5L3 9z"},"1")],"Insights")},38918:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown")},14256:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M15.41 16.59 10.83 12l4.58-4.59L14 6l-6 6 6 6z"}),"KeyboardArrowLeft")},31176:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6z"}),"KeyboardArrowRight")},48209:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5"}),"Link")},67303:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1z"}),"Lock")},73029:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 4-8 5-8-5V6l8 5 8-5z"}),"Mail")},82649:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M3 18h13v-2H3zm0-5h10v-2H3zm0-7v2h13V6zm18 9.59L17.42 12 21 8.41 19.59 7l-5 5 5 5z"}),"MenuOpen")},77306:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreVert")},57532:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3z"}),"MusicNote")},81036:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2m6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1z"}),"Notifications")},37911:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M21 3H3c-1.11 0-2 .89-2 2v12c0 1.1.89 2 2 2h5v2h8v-2h5c1.1 0 1.99-.9 1.99-2L23 5c0-1.11-.9-2-2-2m0 14H3V5h18zm-5-6-7 4V7z"}),"OndemandVideo")},31419:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2m0 14H4v-6h16zm0-10H4V6h16z"}),"Payment")},18956:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M21 3H3C2 3 1 4 1 5v14c0 1.1.9 2 2 2h18c1 0 2-1 2-2V5c0-1-1-2-2-2M5 17l3.5-4.5 2.5 3.01L14.5 11l4.5 6z"}),"PhotoSizeSelectActual")},98743:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M8 5v14l11-7z"}),"PlayArrow")},15736:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39"}),"Public")},9642:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)([(0,o.jsx)("path",{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4z"},"0"),(0,o.jsx)("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-5.99 13c-.59 0-1.05-.47-1.05-1.05 0-.59.47-1.04 1.05-1.04.59 0 1.04.45 1.04 1.04-.01.58-.45 1.05-1.04 1.05m2.5-6.17c-.63.93-1.23 1.21-1.56 1.81-.13.24-.18.4-.18 1.18h-1.52c0-.41-.06-1.08.26-1.65.41-.73 1.18-1.16 1.63
25-1.8.48-.68.21-1.94-1.14-1.94-.88 0-1.32.67-1.5 1.23l-1.37-.57C11.51 5.96 12.52 5 13.99 5c1.23 0 2.08.56 2.51 1.26.37.61.58 1.73.01 2.57"},"1")],"Quiz")},60626:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"RemoveRedEye")},25921:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M12 5.99 19.53 19H4.47zM12 2 1 21h22zm1 14h-2v2h2zm0-6h-2v4h2z"}),"ReportProblemOutlined")},83220:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M20 18c1.1 0 1.99-.9 1.99-2L22 6c0-1.11-.9-2-2-2H4c-1.11 0-2 .89-2 2v10c0 1.1.89 2 2 2H0v2h24v-2zM4 16V6h16v10.01zm5.0967-6.0469c0-1.027.836-1.864 1.864-1.864 1.027 0 1.864.837 1.864 1.864 0 1.027-.837 1.864-1.864 1.864-1.028 0-1.864-.837-1.864-1.864m7.032 4.236-2.482-2.482c.331-.505.527-1.107.527-1.754 0-1.772-1.441-3.213-3.213-3.213s-3.214 1.441-3.214 3.213 1.442 3.214 3.214 3.214c.636 0 1.225-.192 1.724-.511l2.489 2.488z"}),"ScreenSearchDesktop")},35299:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"Search")},3748:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M12 5c-3.87 0-7 3.13-7 7h2c0-2.76 2.24-5 5-5s5 2.24 5 5h2c0-3.87-3.13-7-7-7m1 9.29c.88-.39 1.5-1.26 1.5-2.29 0-1.38-1.12-2.5-2.5-2.5S9.5 10.62 9.5 12c0 1.02.62 1.9 1.5 2.29v3.3L7.59 21 9 22.41l3-3 3 3L16.41 21 13 17.59zM12 1C5.93 1 1 5.93 1 12h2c0-4.97 4.03-9 9-9s9 4.03 9 9h2c0-6.07-4.93-11-11-11"}),"SettingsInputAntennaOutlined")},82269:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M6 6h12v12H6z"}),"Stop")},11428:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"m18 12 4-4-4-4v3H3v2h15zM6 12l-4 4 4 4v-3h15v-2H6z"}),"SyncAlt")},59015:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M3 12c0 2.21.91 4.2 2.36 5.64L3 20h6v-6l-2.24 2.24C5.68 15.15 5 13.66 5 12c0-2.61 1.67-4.83 4-5.65V4.26C5.55 5.15 3 8.27 3 12m8 5h2v-2h-2zM21 4h-6v6l2.24-2.24C18.32 8.85 19 10.34 19 12c0 2.61-1.67 4.83-4 5.65v2.09c3.45-.89 6-4.01 6-7.74 0-2.21-.91-4.2-2.36-5.64zm-10 9h2V7h-2z"}),"SyncProblem")},76859:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M21 3H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h5v2h8v-2h5c1.1 0 1.99-.9 1.99-2L23 5c0-1.1-.9-2-2-2m0 14H3V5h18z"}),"Tv")},11591:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8z"}),"Update")},68625:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11z"}),"Videocam")},24247:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m-5 14H4v-4h11zm0-5H4V9h11zm5 5h-4V9h4z"}),"Web")},28948:function(e,t,n){"use strict";var r=n(64836);t.Z=void 0;var l=r(n(33651)),o=n(85893);t.Z=(0,l.default)((0,o.jsx)("path",{d:"M13 13v8h8v-8zM3 21h8v-8H3zM3 3v8h8V3zm13.66-1.31L11 7.34 16.66 13l5.66-5.66z"}),"Widgets")},90633:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(87462),l=n(63366),o=n(67294),i=n(8780),a=n(94780),s=n(77527),u=n(44001),c=n(96788),d=n(1588),p=n(34867);function h(e){return(0,p.ZP)("MuiAlertTitle",e)}(0,d.Z)("MuiAlertTitle",["root"]);var f=n(85893);let g=["className"],m=e=>{let{classes:t}=e;return(0,a.Z)({root:["root"]},h,t)},b=(0,s.ZP)(c.Z,{name:"MuiAlertTitle",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let{theme:t}=e;return{fontWeight:t.typography.fontWeightMedium,marginTop:-2}});var v=o.forwardRef(function(e,t){let n=(0,u.i)({props:e,name:"MuiAlertTitle"}),{className:o}=n,a=(0,l.Z)(n,g),s=m(n);return(0,f.jsx)(b,(0,r.Z)({gutterBottom:!0,component:"div",ownerState:n,ref:t,className:(0,i.Z)(s.root,o)},a))})},36795:function(e,t,n){"use strict";n.d(t,{Z:function(){return x}});var r=n(63366),l=n(87462),o=n(67294),i=n(8780),a=n(94780),s=n(77527),u=n(44001),c=n(66643),d=n(93454),p=n(1588),h=n(34867);function f(e){return(0,h.ZP)("MuiAppBar",e)}(0,p.Z)("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);var g=n(85893);let m=["className","color","enableColorOnDark","position"],b=e=>{let{color:t,position:n,classes:r}=e,l={root:["root","color".concat((0,c.Z)(t)),"position".concat((0,c.Z)(n))]};return(0,a.Z)(l,f,r)},v=(e,t)=>
25e?"".concat(null==e?void 0:e.replace(")",""),", ").concat(t,")"):t,y=(0,s.ZP)(d.Z,{name:"MuiAppBar",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t["position".concat((0,c.Z)(n.position))],t["color".concat((0,c.Z)(n.color))]]}})(e=>{let{theme:t,ownerState:n}=e,r="light"===t.palette.mode?t.palette.grey[100]:t.palette.grey[900];return(0,l.Z)({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0},"fixed"===n.position&&{position:"fixed",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}},"absolute"===n.position&&{position:"absolute",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0},"sticky"===n.position&&{position:"sticky",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0},"static"===n.position&&{position:"static"},"relative"===n.position&&{position:"relative"},!t.vars&&(0,l.Z)({},"default"===n.color&&{backgroundColor:r,color:t.palette.getContrastText(r)},n.color&&"default"!==n.color&&"inherit"!==n.color&&"transparent"!==n.color&&{backgroundColor:t.palette[n.color].main,color:t.palette[n.color].contrastText},"inherit"===n.color&&{color:"inherit"},"dark"===t.palette.mode&&!n.enableColorOnDark&&{backgroundColor:null,color:null},"transparent"===n.color&&(0,l.Z)({backgroundColor:"transparent",color:"inherit"},"dark"===t.palette.mode&&{backgroundImage:"none"})),t.vars&&(0,l.Z)({},"default"===n.color&&{"--AppBar-background":n.enableColorOnDark?t.vars.palette.AppBar.defaultBg:v(t.vars.palette.AppBar.darkBg,t.vars.palette.AppBar.defaultBg),"--AppBar-color":n.enableColorOnDark?t.vars.palette.text.primary:v(t.vars.palette.AppBar.darkColor,t.vars.palette.text.primary)},n.color&&!n.color.match(/^(default|inherit|transparent)$/)&&{"--AppBar-background":n.enableColorOnDark?t.vars.palette[n.color].main:v(t.vars.palette.AppBar.darkBg,t.vars.palette[n.color].main),"--AppBar-color":n.enableColorOnDark?t.vars.palette[n.color].contrastText:v(t.vars.palette.AppBar.darkColor,t.vars.palette[n.color].contrastText)},!["inherit","transparent"].includes(n.color)&&{backgroundColor:"var(--AppBar-background)"},{color:"inherit"===n.color?"inherit":"var(--AppBar-color)"},"transparent"===n.color&&{backgroundImage:"none",backgroundColor:"transparent",color:"inherit"}))});var x=o.forwardRef(function(e,t){let n=(0,u.i)({props:e,name:"MuiAppBar"}),{className:o,color:a="primary",enableColorOnDark:s=!1,position:c="fixed"}=n,d=(0,r.Z)(n,m),p=(0,l.Z)({},n,{color:a,position:c,enableColorOnDark:s}),h=b(p);return(0,g.jsx)(y,(0,l.Z)({square:!0,component:"header",ownerState:p,elevation:4,className:(0,i.Z)(h.root,o,"fixed"===c&&"mui-fixed"),ref:t},d))})},87300:function(e,t,n){"use strict";n.d(t,{Z:function(){return P}});var r=n(87462),l=n(63366),o=n(67294),i=n(8780),a=n(94780),s=n(82963),u=n(77527),c=n(44001),d=n(96788),p=n(2101),h=n(30139),f=n(85893),g=(0,h.Z)((0,f.jsx)("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz"),m=n(8480);let b=["slots","slotProps"],v=(0,u.ZP)(m.Z,{name:"MuiBreadcrumbCollapsed"})(e=>{let{theme:t}=e;return(0,r.Z)({display:"flex",marginLeft:"calc(".concat(t.spacing(1)," * 0.5)"),marginRight:"calc(".concat(t.spacing(1)," * 0.5)")},"light"===t.palette.mode?{backgroundColor:t.palette.grey[100],color:t.palette.grey[700]}:{backgroundColor:t.palette.grey[700],color:t.palette.grey[100]},{borderRadius:2,"&:hover, &:focus":(0,r.Z)({},"light"===t.palette.mode?{backgroundColor:t.palette.grey[200]}:{backgroundColor:t.palette.grey[600]}),"&:active":(0,r.Z)({boxShadow:t.shadows[0]},"light"===t.palette.mode?{backgroundColor:(0,p._4)(t.palette.grey[200],.12)}:{backgroundColor:(0,p._4)(t.palette.grey[600],.12)})})}),y=(0,u.ZP)(g)({width:24,height:16});var x=function(e){let{slots:t={},slotProps:n={}}=e,o=(0,l.Z)(e,b);return(0,f.jsx)("li",{children:(0,f.jsx)(v,(0,r.Z)({focusRipple:!0},o,{ownerState:e,children:(0,f.jsx)(y,(0,r.Z)({as:t.CollapsedIcon,ownerState:e},n.collapsedIcon))}))})},w=n(1588),C=n(34867);function S(e){return(0,C.ZP)("MuiBreadcrumbs",e)}let k=(0,w.Z)("MuiBreadcrumbs",["root","ol","li","separator"]),I=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],R=e=>{let{classes:t}=e;return(0,a.Z)({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},S,t)},_=(0,u.ZP)(d.Z,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,t)=>[{["& .".concat(k.li)]:t.li},t.root]})({}),E=(0,u.ZP)("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(e,t)=>t.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),M=(0,u.ZP)("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(e,t)=>t.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});var P=o.forwardRef(function(e,t){var n,a;let u=(0,c.i)({props:e,name:"MuiBreadcrumbs"}),{children:d,className:p,component:h="nav",slots:g={},slotProps:m={},expandText:b="Show path",itemsAfterCollapse:v=1,itemsBeforeCollapse:y=1,maxItems:w=8,separator:C="/"}=u,S=(0,l.Z)(u,I),[k,P]=o.useState(!1),T=(0,r.Z)({},u,{component:h,expanded:k,expandText:b,itemsAfterCollapse:v,itemsBeforeCollapse:y,maxItems:w,separator:C}),Z=R(T),F=(0,s.Z)({elementType:g.CollapsedIcon,externalSlotProps:m.collapsedIcon,ownerState:T}),D=o.useRef(null),A=o.Children.toArray(d).filter(e=>o.isValidElement(e)).map((e,t)=>(0,f.jsx)("li",{className:Z.li,children:e},"child-".concat(t)));return(0,f.jsx)(_,(0,r.Z)({ref:t,component:h,color:"text.secondary",className:(0,i.Z)(Z.root,p),ownerState:T},S,{children:(0,f.jsx)(E,{className:Z.ol,ref:D,ownerState:T,children:(n=k||w&&A.length<=w?A:y+v>=A.length?A:[...A.slice(0,y),(0,f.jsx)(x,{"aria-label":b,slots:{CollapsedIcon:g.CollapsedIcon},slotProps:{collapsedIcon:F},onClick:()=>{P(!0);let e=D.current.querySelector("a[href],button,[tabindex]");e&&e.focus()}},"ellipsis"),...A.slice(A.length-v,A.length)],a=Z.separator,n.reduce((e,t,r)=>
25(r<n.length-1?e=e.concat(t,(0,f.jsx)(M,{"aria-hidden":!0,className:a,ownerState:T,children:C},"separator-".concat(r))):e.push(t),e),[]))})}))})},10980:function(e,t,n){"use strict";n.d(t,{d:function(){return c}});var r=n(67294),l=n(33703),o=n(59948),i=n(82690),a=n(57907),s=n(85893);function u(e){return e.substring(2).toLowerCase()}function c(e){let{children:t,disableReactTree:n=!1,mouseEvent:c="onClick",onClickAway:d,touchEvent:p="onTouchEnd"}=e,h=r.useRef(!1),f=r.useRef(null),g=r.useRef(!1),m=r.useRef(!1);r.useEffect(()=>(setTimeout(()=>{g.current=!0},0),()=>{g.current=!1}),[]);let b=(0,l.Z)((0,a.Z)(t),f),v=(0,o.Z)(e=>{let t=m.current;m.current=!1;let r=(0,i.Z)(f.current);if(g.current&&f.current&&(!("clientX"in e)||!(r.documentElement.clientWidth<e.clientX)&&!(r.documentElement.clientHeight<e.clientY))){if(h.current){h.current=!1;return}(e.composedPath?e.composedPath().indexOf(f.current)>-1:!r.documentElement.contains(e.target)||f.current.contains(e.target))||!n&&t||d(e)}}),y=e=>n=>{m.current=!0;let r=t.props[e];r&&r(n)},x={ref:b};return!1!==p&&(x[p]=y(p)),r.useEffect(()=>{if(!1!==p){let e=u(p),t=(0,i.Z)(f.current),n=()=>{h.current=!0};return t.addEventListener(e,v),t.addEventListener("touchmove",n),()=>{t.removeEventListener(e,v),t.removeEventListener("touchmove",n)}}},[v,p]),!1!==c&&(x[c]=y(c)),r.useEffect(()=>{if(!1!==c){let e=u(c),t=(0,i.Z)(f.current);return t.addEventListener(e,v),()=>{t.removeEventListener(e,v)}}},[v,c]),(0,s.jsx)(r.Fragment,{children:r.cloneElement(t,x)})}},23647:function(e,t,n){"use strict";n.d(t,{Z:function(){return w}});var r=n(63366),l=n(87462),o=n(67294),i=n(8780),a=n(94780),s=n(8480),u=n(66643),c=n(44001),d=n(1588),p=n(34867);function h(e){return(0,p.ZP)("MuiFab",e)}let f=(0,d.Z)("MuiFab",["root","primary","secondary","extended","circular","focusVisible","disabled","colorInherit","sizeSmall","sizeMedium","sizeLarge","info","error","warning","success"]);var g=n(77527),m=n(83008),b=n(85893);let v=["children","className","color","component","disabled","disableFocusRipple","focusVisibleClassName","size","variant"],y=e=>{let{color:t,variant:n,classes:r,size:o}=e,i={root:["root",n,"size".concat((0,u.Z)(o)),"inherit"===t?"colorInherit":t]},s=(0,a.Z)(i,h,r);return(0,l.Z)({},r,s)},x=(0,g.ZP)(s.Z,{name:"MuiFab",slot:"Root",shouldForwardProp:e=>(0,m.Z)(e)||"classes"===e,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],t["size".concat((0,u.Z)(n.size))],"inherit"===n.color&&t.colorInherit,t[(0,u.Z)(n.size)],t[n.color]]}})(e=>{var t,n;let{theme:r,ownerState:o}=e;return(0,l.Z)({},r.typography.button,{minHeight:36,transition:r.transitions.create(["background-color","box-shadow","border-color"],{duration:r.transitions.duration.short}),borderRadius:"50%",padding:0,minWidth:0,width:56,height:56,zIndex:(r.vars||r).zIndex.fab,boxShadow:(r.vars||r).shadows[6],"&:active":{boxShadow:(r.vars||r).shadows[12]},color:r.vars?r.vars.palette.text.primary:null==(t=(n=r.palette).getContrastText)?void 0:t.call(n,r.palette.grey[300]),backgroundColor:(r.vars||r).palette.grey[300],"&:hover":{backgroundColor:(r.vars||r).palette.grey.A100,"@media (hover: none)":{backgroundColor:(r.vars||r).palette.grey[300]},textDecoration:"none"},["&.".concat(f.focusVisible)]:{boxShadow:(r.vars||r).shadows[6]}},"small"===o.size&&{width:40,height:40},"medium"===o.size&&{width:48,height:48},"extended"===o.variant&&{borderRadius:24,padding:"0 16px",width:"auto",minHeight:"auto",minWidth:48,height:48},"extended"===o.variant&&"small"===o.size&&{width:"auto",padding:"0 8px",borderRadius:17,minWidth:34,he
25ight:34},"extended"===o.variant&&"medium"===o.size&&{width:"auto",padding:"0 16px",borderRadius:20,minWidth:40,height:40},"inherit"===o.color&&{color:"inherit"})},e=>{let{theme:t,ownerState:n}=e;return(0,l.Z)({},"inherit"!==n.color&&"default"!==n.color&&null!=(t.vars||t).palette[n.color]&&{color:(t.vars||t).palette[n.color].contrastText,backgroundColor:(t.vars||t).palette[n.color].main,"&:hover":{backgroundColor:(t.vars||t).palette[n.color].dark,"@media (hover: none)":{backgroundColor:(t.vars||t).palette[n.color].main}}})},e=>{let{theme:t}=e;return{["&.".concat(f.disabled)]:{color:(t.vars||t).palette.action.disabled,boxShadow:(t.vars||t).shadows[0],backgroundColor:(t.vars||t).palette.action.disabledBackground}}});var w=o.forwardRef(function(e,t){let n=(0,c.i)({props:e,name:"MuiFab"}),{children:o,className:a,color:s="default",component:u="button",disabled:d=!1,disableFocusRipple:p=!1,focusVisibleClassName:h,size:f="large",variant:g="circular"}=n,m=(0,r.Z)(n,v),w=(0,l.Z)({},n,{color:s,component:u,disabled:d,disableFocusRipple:p,size:f,variant:g}),C=y(w);return(0,b.jsx)(x,(0,l.Z)({className:(0,i.Z)(C.root,a),component:u,disabled:d,focusRipple:!p,focusVisibleClassName:(0,i.Z)(C.focusVisible,h),ownerState:w,ref:t},m,{classes:C,children:o}))})},88539:function(e,t,n){"use strict";n.d(t,{Z:function(){return b}});var r=n(63366),l=n(87462),o=n(67294),i=n(8780),a=n(94780),s=n(44001),u=n(77527),c=n(1588),d=n(34867);function p(e){return(0,d.ZP)("MuiToolbar",e)}(0,c.Z)("MuiToolbar",["root","gutters","regular","dense"]);var h=n(85893);let f=["className","component","disableGutters","variant"],g=e=>{let{classes:t,disableGutters:n,variant:r}=e;return(0,a.Z)({root:["root",!n&&"gutters",r]},p,t)},m=(0,u.ZP)("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.disableGutters&&t.gutters,t[n.variant]]}})(e=>{let{theme:t,ownerState:n}=e;return(0,l.Z)({position:"relative",display:"flex",alignItems:"center"},!n.disableGutters&&{paddingLeft:t.spacing(2),paddingRight:t.spacing(2),[t.breakpoints.up("sm")]:{paddingLeft:t.spacing(3),paddingRight:t.spacing(3)}},"dense"===n.variant&&{minHeight:48})},e=>{let{theme:t,ownerState:n}=e;return"regular"===n.variant&&t.mixins.toolbar});var b=o.forwardRef(function(e,t){let n=(0,s.i)({props:e,name:"MuiToolbar"}),{className:o,component:a="div",disableGutters:u=!1,variant:c="regular"}=n,d=(0,r.Z)(n,f),p=(0,l.Z)({},n,{component:a,disableGutters:u,variant:c}),b=g(p);return(0,h.jsx)(m,(0,l.Z)({as:a,className:(0,i.Z)(b.root,o),ref:t,ownerState:p},d))})},91194:function(e,t,n){"use strict";n(67294);var r=n(30139),l=n(85893);t.Z=(0,r.Z)((0,l.jsx)("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft")},59367:function(e,t,n){"use strict";n(67294);var r=n(30139),l=n(85893);t.Z=(0,r.Z)((0,l.jsx)("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight")},32903:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return S}});let r=n(38754),l=n(61757),o=n(85893),i=l._(n(67294)),a=r._(n(23867)),s=n(96594),u=n(84229),c=n(23945);n(83179);let d=n(98337);function p(e){return"/"===e[0]?e.slice(1):e}let h={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1},f=new Set,g="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",m=new Map([["default",function(e){var t;let{config:n,src:r,width:l,quality:o}=e,i=o||(null==(t=n.qualities)?void 0:t.reduce((e,t)=>Math.abs(t-75)<Math.abs(e-75)?t:e))||75;return r.endsWith(".svg")&&!n.dangerouslyAllowSVG?r:(0,d.normalizePathTrailingSlash)(n.path)+"?url="+encodeURIComponent(r)+"&w="+l+"&q="+i}],["imgix",function(e){let{config:t,src:n,width:r,quality:l}=e,o=new URL(""+t.path+p(n)),i=o.searchParams;return i.set("auto",i.getAll("auto").join(",")||"format"),i.set("fit",i.get("fit")||"max"),i.set("w",i.get("w")||r.toString()),l&&i.set("q",l.toString()),o.href}
25],["cloudinary",function(e){let{config:t,src:n,width:r,quality:l}=e,o=["f_auto","c_limit","w_"+r,"q_"+(l||"auto")].join(",")+"/";return""+t.path+o+p(n)}],["akamai",function(e){let{config:t,src:n,width:r}=e;return""+t.path+p(n)+"?imwidth="+r}],["custom",function(e){let{src:t}=e;throw Error('Image with src "'+t+'" is missing "loader" prop.\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader')}]]);function b(e){return void 0!==e.default}function v(e){let{config:t,src:n,unoptimized:r,layout:l,width:o,quality:i,sizes:a,loader:s}=e;if(r)return{src:n,srcSet:void 0,sizes:void 0};let{widths:u,kind:c}=function(e,t,n,r){let{deviceSizes:l,allSizes:o}=e;if(r&&("fill"===n||"responsive"===n)){let e=/(^|\s)(1?\d?\d)vw/g,t=[];for(let n;n=e.exec(r);n)t.push(parseInt(n[2]));if(t.length){let e=.01*Math.min(...t);return{widths:o.filter(t=>t>=l[0]*e),kind:"w"}}return{widths:o,kind:"w"}}return"number"!=typeof t||"fill"===n||"responsive"===n?{widths:l,kind:"w"}:{widths:[...new Set([t,2*t].map(e=>o.find(t=>t>=e)||o[o.length-1]))],kind:"x"}}(t,o,l,a),d=u.length-1;return{sizes:a||"w"!==c?a:"100vw",srcSet:u.map((e,r)=>s({config:t,src:n,quality:i,width:e})+" "+("w"===c?e:r+1)+c).join(", "),src:s({config:t,src:n,quality:i,width:u[d]})}}function y(e){return"number"==typeof e?e:"string"==typeof e?parseInt(e,10):void 0}function x(e){var t;let n=(null==(t=e.config)?void 0:t.loader)||"default",r=m.get(n);if(r)return r(e);throw Error('Unknown "loader" found in "next.config.js". Expected: '+s.VALID_LOADERS.join(", ")+". Received: "+n)}function w(e,t,n,r,l,o){e&&e.src!==g&&e["data-loaded-src"]!==t&&(e["data-loaded-src"]=t,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentNode&&(f.add(t),"blur"===r&&o(!0),null==l?void 0:l.current)){let{naturalWidth:t,naturalHeight:n}=e;l.current({naturalWidth:t,naturalHeight:n})}}))}let C=e=>{let{imgAttributes:t,heightInt:n,widthInt:r,qualityInt:l,layout:a,className:s,imgStyle:u,blurStyle:c,isLazy:d,placeholder:p,loading:h,srcString:f,config:g,unoptimized:m,loader:b,onLoadingCompleteRef:y,setBlurComplete:x,setIntersection:C,onLoad:S,onError:k,isVisible:I,noscriptSizes:R,..._}=e;return h=d?"lazy":h,(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("img",{..._,...t,decoding:"async","data-nimg":a,className:s,style:{...u,...c},ref:(0,i.useCallback)(e=>{C(e),(null==e?void 0:e.complete)&&w(e,f,a,p,y,x)},[C,f,a,p,y,x]),onLoad:e=>{w(e.currentTarget,f,a,p,y,x),S&&S(e)},onError:e=>{"blur"===p&&x(!0),k&&k(e)}}),(d||"blur"===p)&&(0,o.jsx)("noscript",{children:(0,o.jsx)("img",{..._,loading:h,decoding:"async","data-nimg":a,style:u,className:s,...v({config:g,src:f,unoptimized:m,layout:a,width:r,quality:l,sizes:R,loader:b})})})]})};function S(e){var t;let n,{src:r,sizes:l,unoptimized:d=!1,priority:p=!1,loading:m,lazyRoot:w=null,lazyBoundary:S,className:k,quality:I,width:R,height:_,style:E,objectFit:M,objectPosition:P,onLoadingComplete:T,placeholder:Z="empty",blurDataURL:F,...D}=e,A=(0,i.useContext)(c.ImageConfigContext),O=(0,i.useMemo)(()=>{var e;let t=h||A||s.imageConfigDefault,n=[...t.deviceSizes,...t.imageSizes].sort((e,t)=>e-t),r=t.deviceSizes.sort((e,t)=>e-t),l=null==(e=t.qualities)?void 0:e.sort((e,t)=>e-t);return{...t,allSizes:n,deviceSizes:r,qualities:l}},[A]),z=l?"responsive":"intrinsic";"layout"in D&&(D.layout&&(z=D.layout),delete D.layout);let j=x;if("loader"in D){if(D.loader){let e=D.loader;j=t=>{let{config:n,...r}=t;return e(r)}}delete D.loader}let L="";if("object"==typeof(t=r)&&(b(t)||void 0!==t.src)){let e=b(r)?r.default:r;if(!e.src)throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received "+JSON.stringify(e));if(F=F||e.blurDataURL,L=e.src,(!z||"fill"!==z)&&(_=_||e.height,R=R||e.width,!e.height||!e.width))throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received "+JSON.stringify(e))}let H=!p&&("lazy"===m||void 0===m);((r="string"==typeof r?r:L).startsWith("data:")||r.startsWith("blob:"))&&(d=!0,H=!1),f.has(r)&&(H=!1),O.unoptimized&&(d=!0);let[B,N]=(0,i.useState)(!1),[V,$,U]=(0,u.useIntersection)({rootRef:w,rootMargin:S||"200px",disabled:!H}),G=!H||$,q={boxSizing:"border-box",display:"block",overflow:"hidden",
25width:"initial",height:"initial",background:"none",opacity:1,border:0,margin:0,padding:0},W={boxSizing:"border-box",display:"block",width:"initial",height:"initial",background:"none",opacity:1,border:0,margin:0,padding:0},K=!1,Y=y(R),X=y(_),J=y(I),Q=Object.assign({},E,{position:"absolute",top:0,left:0,bottom:0,right:0,boxSizing:"border-box",padding:0,border:"none",margin:"auto",display:"block",width:0,height:0,minWidth:"100%",maxWidth:"100%",minHeight:"100%",maxHeight:"100%",objectFit:M,objectPosition:P}),ee="blur"!==Z||B?{}:{backgroundSize:M||"cover",backgroundPosition:P||"0% 0%",filter:"blur(20px)",backgroundImage:'url("'+F+'")'};if("fill"===z)q.display="block",q.position="absolute",q.top=0,q.left=0,q.bottom=0,q.right=0;else if(void 0!==Y&&void 0!==X){let e=X/Y,t=isNaN(e)?"100%":""+100*e+"%";"responsive"===z?(q.display="block",q.position="relative",K=!0,W.paddingTop=t):"intrinsic"===z?(q.display="inline-block",q.position="relative",q.maxWidth="100%",K=!0,W.maxWidth="100%",n="data:image/svg+xml,%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20version=%271.1%27%20width=%27"+Y+"%27%20height=%27"+X+"%27/%3e"):"fixed"===z&&(q.display="inline-block",q.position="relative",q.width=Y,q.height=X)}let et={src:g,srcSet:void 0,sizes:void 0};G&&(et=v({config:O,src:r,unoptimized:d,layout:z,width:Y,quality:J,sizes:l,loader:j}));let en=r,er={imageSrcSet:et.srcSet,imageSizes:et.sizes,crossOrigin:D.crossOrigin,referrerPolicy:D.referrerPolicy},el=i.default.useLayoutEffect,eo=(0,i.useRef)(T),ei=(0,i.useRef)(r);(0,i.useEffect)(()=>{eo.current=T},[T]),el(()=>{ei.current!==r&&(U(),ei.current=r)},[U,r]);let ea={isLazy:H,imgAttributes:et,heightInt:X,widthInt:Y,qualityInt:J,layout:z,className:k,imgStyle:Q,blurStyle:ee,loading:m,config:O,unoptimized:d,placeholder:Z,loader:j,srcString:en,onLoadingCompleteRef:eo,setBlurComplete:N,setIntersection:V,isVisible:G,noscriptSizes:l,...D};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("span",{style:q,children:[K?(0,o.jsx)("span",{style:W,children:n?(0,o.jsx)("img",{style:{display:"block",maxWidth:"100%",width:"initial",height:"initial",background:"none",opacity:1,border:0,margin:0,padding:0},alt:"","aria-hidden":!0,src:n}):null}):null,(0,o.jsx)(C,{...ea})]}),p?(0,o.jsx)(a.default,{children:(0,o.jsx)("link",{rel:"preload",as:"image",href:et.srcSet?void 0:et.src,...er},"__nimg-"+et.src+et.srcSet+et.sizes)}):null]})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},89755:function(e,t,n){e.exports=n(32903)},44815:function(e,t,n){"use strict";n.d(t,{PW:function(){return o}});var r="NOT_FOUND",l=function(e,t){return e===t};function o(e,t){var n,o,i="object"==typeof t?t:{equalityCheck:t},a=i.equalityCheck,s=i.maxSize,u=void 0===s?1:s,c=i.resultEqualityCheck,d=(n=void 0===a?l:a,function(e,t){if(null===e||null===t||e.length!==t.length)return!1;for(var r=e.length,l=0;l<r;l++)if(!n(e[l],t[l]))return!1;return!0}),p=1===u?{get:function(e){return o&&d(o.key,e)?o.value:r},put:function(e,t){o={key:e,value:t}},getEntries:function(){return o?[o]:[]},clear:function(){o=void 0}}:function(e,t){var n=[];function l(e){var l=n.findIndex(function(n){return t(e,n.key)});if(l>-1){var o=n[l];return l>0&&(n.splice(l,1),n.unshift(o)),o.value}return r}return{get:l,put:function(t,o){l(t)===r&&(n.unshift({key:t,value:o}),n.length>e&&n.pop())},getEntries:function(){return n},clear:function(){n=[]}}}(u,d);function h(){var t=p.get(arguments);if(t===r){if(t=e.apply(null,arguments),c){var n=p.getEntries().find(function(e){return c(e.value,t)});n&&(t=n.value)}p.put(arguments,t)}return t}return h.clearCache=function(){return p.clear()},h}},41476:function(e,t,n){"use strict";var r=(this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(n(5174)),l=n(26678);function o(e,t){var n={};return e&&"string"==typeof e&&(0,r.default)(e,function(e,r){e&&r&&(n[(0,l.camelCase)(e,t)]=r)}),n}o.default=o,e.exports=o},26678:function(e,t){"use strict";
25Object.defineProperty(t,"__esModule",{value:!0}),t.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,l=/^[^-]+$/,o=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(e,t){return t.toUpperCase()},s=function(e,t){return"".concat(t,"-")};t.camelCase=function(e,t){var u;return(void 0===t&&(t={}),!(u=e)||l.test(u)||n.test(u))?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(i,s):e.replace(o,s)).replace(r,a))}},5174:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){let n=null;if(!e||"string"!=typeof e)return n;let r=(0,l.default)(e),o="function"==typeof t;return r.forEach(e=>{if("declaration"!==e.type)return;let{property:r,value:l}=e;o?t(r,l,e):l&&((n=n||{})[r]=l)}),n};let l=r(n(85321))},55213:function(e,t,n){"use strict";var r=n(48764).Buffer;let l=void 0!==r,o=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,i=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function a(e,t,n){null==n&&null!==t&&"object"==typeof t&&(n=t,t=void 0),l&&r.isBuffer(e)&&(e=e.toString()),e&&65279===e.charCodeAt(0)&&(e=e.slice(1));let a=JSON.parse(e,t);if(null===a||"object"!=typeof a)return a;let u=n&&n.protoAction||"error",c=n&&n.constructorAction||"error";if("ignore"===u&&"ignore"===c)return a;if("ignore"!==u&&"ignore"!==c){if(!1===o.test(e)&&!1===i.test(e))return a}else if("ignore"!==u&&"ignore"===c){if(!1===o.test(e))return a}else if(!1===i.test(e))return a;return s(a,{protoAction:u,constructorAction:c,safe:n&&n.safe})}function s(e,{protoAction:t="error",constructorAction:n="error",safe:r}={}){let l=[e];for(;l.length;){let e=l;for(let o of(l=[],e)){if("ignore"!==t&&Object.prototype.hasOwnProperty.call(o,"__proto__")){if(!0===r)return null;if("error"===t)throw SyntaxError("Object contains forbidden prototype property");delete o.__proto__}if("ignore"!==n&&Object.prototype.hasOwnProperty.call(o,"constructor")&&null!==o.constructor&&"object"==typeof o.constructor&&Object.prototype.hasOwnProperty.call(o.constructor,"prototype")){if(!0===r)return null;if("error"===n)throw SyntaxError("Object contains forbidden prototype property");delete o.constructor}for(let e in o){let t=o[e];t&&"object"==typeof t&&l.push(t)}}}return e}function u(e,t,n){let{stackTraceLimit:r}=Error;Error.stackTraceLimit=0;try{return a(e,t,n)}finally{Error.stackTraceLimit=r}}e.exports=u,e.exports.default=u,e.exports.parse=u,e.exports.safeParse=function(e,t){let{stackTraceLimit:n}=Error;Error.stackTraceLimit=0;try{return a(e,t,{safe:!0})}catch{return}finally{Error.stackTraceLimit=n}},e.exports.scan=s},58364:function(e,t,n){"use strict";n.d(t,{vE:function(){return b}});var r=n(85893),l=n(67294),o=n(77192),i=n(51466),a=n(1313),s=n(35914),u=n(87235);let c=({index:e,children:t})=>{let n=(0,a.v)({message:(0,s.f)({source:"thread",query:{type:"index",index:e},get:t=>t.thread().message({index:e})}),composer:(0,s.f)({source:"message",query:{},get:t=>t.thread().message({index:e}).composer()})});return(0,r.jsx)(u.Nm,{value:n,children:t})},d=(e,t)=>e.Message===t.Message&&e.EditComposer===t.EditComposer&&e.UserEditComposer===t.UserEditComposer&&e.AssistantEditComposer===t.AssistantEditComposer&&e.SystemEditComposer===t.SystemEditComposer&&e.UserMessage===t.UserMessage&&e.AssistantMessage===t.AssistantMessage&&e.SystemMessage===t.SystemMessage,p=()=>null,h=(e,t,n)=>{switch(t){case"user":if(n)return e.UserEditComposer??e.EditComposer??e.UserMessage??e.Message;return e.UserMessage??e.Message;case"assistant":if(n)return e.AssistantEditComposer??e.EditComposer??e.AssistantMessage??e.Message;return e.AssistantMessage??e.Message;case"system":if(n)return e.SystemEditComposer??e.EditComposer??e.SystemMessage??e.Message;return e.SystemMessage??e.Message??p;default:throw Error(`Unknown message role: ${t}`)}},f=({components:e})=>{let t=h(e,(0,o.x)(e=>e.message.role),(0,o.x)(e=>e.message.composer.isEditing));return(0,r.jsx)(t,{})};(0,l.memo)(({index:e,components:t})=>(0,r.jsx)(c,{index:e,children:(0,r.jsx)(f,{components:t})}),(e,t)=>e.index===t.index&&d(e.components,t.components)).displayName="ThreadPrimitive.MessageByIndex";let g=({children:e})=>{let t=(0,o.x)(e=>e.thread.messages.length);return(0,l.useMemo)(()=>0===t?null:Array.from({length:t},(t,n)=>(0,r.jsx)(c,{index:n,children:(0,r.jsx)(i.g,{getItemState:e=>e.thread().message({index:n}).getState(),children:t=>e({get message(){return t()}})})},n)),[t,e])},m=({components:e,children:t})=>e?(0,r.jsx)(g,{children:()=>(0,r.jsx)(f,{components:e})}):(0,r.jsx)(g,{children:t});m.displayName="ThreadPrimitive.Messages";let b=(0,l.memo)(m,(e,t)=>e.children||t.children?e.children===t.children:d(e.components,t.components))},88466:function(e,t,n){"use strict";n.d(t,{Z:function(){return tX}});var r=n(67294),l=n(19623);class o{_contextProvider=new l.L;registerModelContextProvider(e){return this._contextProvider.registerModelContextProvider(e)}getModelContextProvider(){return this._contextProvider}}var i=n(55213);let a=Symbol("aui.parse-partial-json-object.meta"),s=e=>{if(0===e.length)return{[a]:{state:"partial",partialPath:[]}};try{let t=i.parse(e);if("object"!=typeof t||null===t)throw Error("argsText is expected to be an object");return t[a]={state:"complete",partialPath:[]},t}catch{try{let[t,n]=function(e){let t;let n=["ROOT"],r=-1,l=null,o=[];function i(){void 0!==t&&(o.push(JSON.parse(`"${t}"`)),t=void 0)}function a(e,t,o){switch(e){case'"':r=t,n.pop(),n.push(o),n.push("INSIDE_STRING"),i();break;case"f":case"t":case"n":r=t,l=t,n.pop(),n.push(o),n.push("INSIDE_LITERAL");break;case"-":n.pop(),n.push(o),n.push("INSIDE_NUMBER"),i();break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":r=t,n.pop(),n.push(o),n.push("INSIDE_NUMBER"),i();break;case"{":r=t,n.pop(),n.push(o),n.push("INSIDE_OBJECT_START"),i();break;case"[":r=t,n.pop(),n.push(o),n.push("INSIDE_ARRAY_START"),i()}}function s(e,l){switch(e){case",":n.pop(),n.push("INSIDE_OBJECT_AFTER_COMMA");break;case"}":r=l,n.pop(),t=o.pop()}}function u(e,l){switch(e){case",":n.pop(),n.push("INSIDE_ARRAY_AFTER_COMMA"),t=(Number(t)+1).toString();break;case"]":r=l,n.pop(),t=o.pop()}}for(let i=0;i<e.length;i++){let c=e[i];switch(n[n.length-1]){case"ROOT":a(c,i,"FINISH");break;case"INSIDE_OBJECT_START":switch(c){case'"':n.pop(),n.push("INSIDE_OBJECT_KEY"),t="";break;case"}":r=i,n.pop(),t=o.pop()}break;case"INSIDE_OBJECT_AFTER_COMMA":'"'===c&&(n.pop(),n.push("INSIDE_OBJECT_KEY"),t="");break;case"INSIDE_OBJECT_KEY":switch(c){case'"':n.pop(),n.push("INSIDE_OBJECT_AFTER_KEY");break;case"\\":n.push("INSIDE_STRING_ESCAPE"),t+=c;break;default:t+=c}break;case"INSIDE_OBJECT_AFTER_KEY":":"===c&&(n.pop(),n.push("INSIDE_OBJECT_BEFORE_VALUE"));break;case"INSIDE_OBJECT_BEFORE_VALUE":a(c,i,"INSIDE_OBJECT_AFTER_VALUE");break;case"INSIDE_OBJECT_AFTER_VALUE":s(c,i);break;case"INSIDE_STRING":switch(c){case'"':n.pop(),r=i,t=o.pop();break;case"\\":n.push("INSIDE_STRING_ESCAPE");break;default:r=i}break;case"INSIDE_ARRAY_START":"]"===c?(r=i,n.pop(),t=o.pop()):(r=i,t="0",a(c,i,"INSIDE_ARRAY_AFTER_VALUE"));break;case"INSIDE_ARRAY_AFTER_VALUE":switch(c){case",":n.pop(),n.push("INSIDE_ARRAY_AFTER_COMMA"),t=(Number(t)+1).toString();break;case"]":r=i,n.pop(),t=o.pop();break;default:r=i}break;case"INSIDE_ARRAY_AFTER_COMMA":a(c,i,"INSIDE_ARRAY_AFTER_VALUE");break;case"INSIDE_STRING_ESCAPE":n.pop(),"INSIDE_STRING"===n[n.length-1]?r=i:"INSIDE_OBJECT_KEY"===n[n.length-1]&&(t+=c);break;case"INSIDE_NUMBER":switch(c){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":r=i;break;case"e":case"E":case"-":case".":break;case",":n.pop(),t=o.pop(),"INSIDE_ARRAY_AFTER_VALUE"===n[n.length-1]&&u(c,i),"INSIDE_OBJECT_AFTER_VALUE"===n[n.length-1]&&s(c,i);break;case"}":n.pop(),t=o.pop(),"INSIDE_OBJECT_AFTER_VALUE"===n[n.length-1]&&s(c,i);break;case"]":n.pop(),t=o.pop(),"INSIDE_ARRAY_AFTER_VALUE"===n[n.length-1]&&u(c,i);break;default:n.pop(),t=o.pop()}break;case"INSIDE_LITERAL":{let t=e.substring(l,i+1);"false".startsWith(t)||"true".startsWith(t)||"null".startsWith(t)?r=i:(n.pop(),"INSIDE_OBJECT_AFTER_VALUE"===n[n.length-1]?s(c,i):"INSIDE_ARRAY_AFTER_VALUE"===n[n.length-1]&&u(c,i))}}}let c=e.slice(0,r+1);for(let t=n.length-1;t>=0;t--)switch(n[t]){case"INSIDE_STRING":c+='"';break;case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":c+="}";break;case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":c+="]";break;case"INSIDE_LITERAL":{let t=e.substring(l,e.length);"true".startsWith(t)?c+="true".slice(t.length):"false".startsWith(t)?c+="false".slice(t.length):"null".startsWith(t)&&(c+="null".slice(t.length))}}return[c,o]}(e),r=i.parse(t);if("object"!=typeof r||null===r)throw Error("argsText is expected to be an object");return r[a]={state:"partial",partialPath:n},r}catch{return}}},u=((e,t=21)=>(n=t)=>{let r="",l=0|n;for(;l--;)r+=e[Math.random()*e.length|0];return r})("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",7),c=()=>`__optimistic__${u()}`,d=(e,t)=>{if(e.startsWith("data-"))return{type:"data",name:e.substring(5),data:t}},p=(e,t,n)=>{let{role:r,id:l,createdAt:o,attachments:i,status:a,metadata:c}=e,p={id:l??t,createdAt:o??new Date}
25,h="string"==typeof e.content?[{type:"text",text:e.content}]:e.content,f=({image:e,...t})=>e.match(/^data:image\/(png|jpeg|jpg|gif|webp);base64,(.*)$/)?{...t,image:e}:(console.warn("Invalid image data format detected"),null);if("user"!==r&&i?.length)throw Error("attachments are only supported for user messages");if("assistant"!==r&&a)throw Error("status is only supported for assistant messages");if("assistant"!==r&&c?.steps)throw Error("metadata.steps is only supported for assistant messages");switch(r){case"assistant":return{...p,role:r,content:h.map(e=>{let t=e.type;switch(t){case"text":case"reasoning":if(0===e.text.trim().length)return null;return e;case"file":case"source":case"data":return e;case"image":return f(e);case"tool-call":{let{parentId:t,messages:n,...r}=e,l={...r,toolCallId:e.toolCallId??`tool-${u()}`,...void 0!==t&&{parentId:t},...void 0!==n&&{messages:n}};if(e.args)return{...l,args:e.args,argsText:e.argsText??JSON.stringify(e.args)};return{...l,args:s(e.argsText??"")??{},argsText:e.argsText??""}}default:{let n=d(t,e.data);if(n)return n;throw Error(`Unsupported assistant message part type: ${t}`)}}}).filter(e=>!!e),status:a??n,metadata:{unstable_state:c?.unstable_state??null,unstable_annotations:c?.unstable_annotations??[],unstable_data:c?.unstable_data??[],custom:c?.custom??{},steps:c?.steps??[],...c?.timing&&{timing:c.timing},...c?.submittedFeedback&&{submittedFeedback:c.submittedFeedback}}};case"user":return{...p,role:r,content:h.map(e=>{let t=e.type;switch(t){case"text":case"image":case"audio":case"file":case"data":return e;default:{let n=d(t,e.data);if(n)return n;throw Error(`Unsupported user message part type: ${t}`)}}}),attachments:(i??[]).map(e=>({...e,content:e.content.map(e=>d(e.type,e.data)??e)})),metadata:{custom:c?.custom??{}}};case"system":if(1!==h.length||"text"!==h[0].type)throw Error("System messages must have exactly one text message part.");return{...p,role:r,content:h,metadata:{custom:c?.custom??{}}};default:throw Error(`Unknown message role: ${r}`)}},h=(e,t)=>void 0===t?e.status?.type==="requires-action"&&"tool-calls"===e.status.reason&&e.content.every(e=>"tool-call"!==e.type||!!e.result):e.status?.type==="requires-action"&&"tool-calls"===e.status.reason&&e.content.every(e=>"tool-call"!==e.type||!!e.result||!t.includes(e.toolName)),f=e=>e.content.filter(e=>"text"===e.type).map(e=>e.text).join("\n\n"),g=Symbol("autoStatus"),m=Object.freeze(Object.assign({type:"running"},{[g]:!0})),b=Object.freeze(Object.assign({type:"complete",reason:"unknown"},{[g]:!0})),v=Object.freeze(Object.assign({type:"requires-action",reason:"tool-calls"},{[g]:!0})),y=Object.freeze(Object.assign({type:"requires-action",reason:"interrupt"},{[g]:!0})),x=(e,t,n,r,l)=>e&&l?Object.assign({type:"incomplete",reason:"error",error:l},{[g]:!0}):e&&t?m:n?y:r?v:b,w={fromArray:e=>{let t=e.map(e=>p(e,u(),x(!1,!1,!1,!1,void 0)));return{messages:t.map((e,n)=>({parentId:n>0?t[n-1].id:null,message:e}))}}},C=e=>e.next?C(e.next):"current"in e?e:null;class S{func;_value=null;constructor(e){this.func=e}get value(){return null===this._value&&(this._value=this.func()),this._value}dirty(){this._value=null}}class k{messages=new Map;head=null;root={children:[],next:null};updateLevels(e,t){for(let n of(e.level=t,e.children)){let e=this.messages.get(n);e&&this.updateLevels(e,t+1)}}performOp(e,t,n){let r=t.prev??this.root,l=e??this.root;if("relink"!==n||r!==l){if("link"!==n&&(r.children=r.children.filter(e=>e!==t.current.id),r.next===t)){let e=r.children.at(-1),t=e?this.messages.get(e):null;if(void 0===t)throw Error("MessageRepository(performOp/cut): Fallback sibling message not found. This is likely an internal bug in assistant-ui.");r.next=t}if("cut"!==n){for(let n=e;n;n=n.prev)if(n.current.id===t.current.id)throw Error("MessageRepository(performOp/link): A message with the same id already exists in the parent tree. This error occurs if the same message id is found multiple times. This is likely an internal bug in assistant-ui.");l.children=[...l.children,t.current.id],(C(t)===this.head||null===l.next)&&(l.next=t),t.prev=e;let n=e?e.level+1:0;this.updateLevels(t,n)}}}_messages=new S(()=>{let e=Array((this.head?.level??-1)+1);for(let t=this.head;t;t=t.prev)e[t.level]=t.current;return e});get headId(){return this.head?.current.id??null}getMessages(e){if(void 0===e||e===this.head?.current.id)return this._messages.value;let t=this.messages.get(e);if(!t)throw Error("MessageRepository(getMessages): Head message not found. This is likely an internal bug in assistant-ui.");
25let n=Array(t.level+1);for(let e=t;e;e=e.prev)n[e.level]=e.current;return n}addOrUpdateMessage(e,t){let n=this.messages.get(t.id),r=e?this.messages.get(e):null;if(void 0===r)throw Error("MessageRepository(addOrUpdateMessage): Parent message not found. This is likely an internal bug in assistant-ui.");if(n){n.current=t,this.performOp(r,n,"relink"),this._messages.dirty();return}let l={prev:r,current:t,next:null,children:[],level:r?r.level+1:0};this.messages.set(t.id,l),this.performOp(r,l,"link"),this.head===r&&(this.head=l),this._messages.dirty()}getMessage(e){let t=this.messages.get(e);if(!t)throw Error("MessageRepository(updateMessage): Message not found. This is likely an internal bug in assistant-ui.");return{parentId:t.prev?.current.id??null,message:t.current,index:t.level}}appendOptimisticMessage(e,t){let n;do n=c();while(this.messages.has(n));return this.addOrUpdateMessage(e,p(t,n,{type:"running"})),n}deleteMessage(e,t){let n=this.messages.get(e);if(!n)throw Error("MessageRepository(deleteMessage): Message not found. This is likely an internal bug in assistant-ui.");let r=void 0===t?n.prev:null===t?null:this.messages.get(t);if(void 0===r)throw Error("MessageRepository(deleteMessage): Replacement not found. This is likely an internal bug in assistant-ui.");for(let e of n.children){let t=this.messages.get(e);if(!t)throw Error("MessageRepository(deleteMessage): Child message not found. This is likely an internal bug in assistant-ui.");this.performOp(r,t,"relink")}this.performOp(null,n,"cut"),this.messages.delete(e),this.head===n&&(this.head=C(r??this.root)),this._messages.dirty()}getBranches(e){let t=this.messages.get(e);if(!t)throw Error("MessageRepository(getBranches): Message not found. This is likely an internal bug in assistant-ui.");let{children:n}=t.prev??this.root;return n}switchToBranch(e){let t=this.messages.get(e);if(!t)throw Error("MessageRepository(switchToBranch): Branch not found. This is likely an internal bug in assistant-ui.");(t.prev??this.root).next=t,this.head=C(t),this._messages.dirty()}resetHead(e){if(null===e){this.clear();return}let t=this.messages.get(e);if(!t)throw Error("MessageRepository(resetHead): Branch not found. This is likely an internal bug in assistant-ui.");if(t.children.length>0){let e=t=>{for(let n of t.children){let t=this.messages.get(n);t&&(e(t),this.messages.delete(n))}};e(t),t.children=[],t.next=null}this.head=t;for(let e=t;e;e=e.prev)e.prev?e.prev.next=e:this.root.next=e;this._messages.dirty()}clear(){this.messages.clear(),this.head=null,this.root={children:[],next:null},this._messages.dirty()}export(){let e=[];for(let[,t]of this.messages)e.push({message:t.current,parentId:t.prev?.current.id??null});return{headId:this.head?.current.id??null,messages:e}}import({headId:e,messages:t}){for(let{message:e,parentId:n}of t)this.addOrUpdateMessage(n,e);this.resetHead(e??t.at(-1)?.message.id??null)}}let I=Symbol("skip-update");class R{_subscribers=new Set;subscribe(e){return this._subscribers.add(e),()=>this._subscribers.delete(e)}waitForUpdate(){return new Promise(e=>{let t=this.subscribe(()=>{t(),e()})})}_notifySubscribers(){let e=[];for(let t of this._subscribers)try{t()}catch(t){e.push(t)}if(e.length>0){if(1===e.length)throw e[0];for(let t of e)console.error(t);throw AggregateError(e)}}}class _{_subscriptions=new Set;_connection;get isConnected(){return!!this._connection}notifySubscribers(){for(let e of this._subscriptions)e()}_updateConnection(){this._subscriptions.size>0?this._connection||(this._connection=this._connect()):(this._connection?.(),this._connection=void 0)}subscribe(e){return this._subscriptions.add(e),this._updateConnection(),()=>{this._subscriptions.delete(e),this._updateConnection()}}}class E extends _{binding;get path(){return this.binding.path}constructor(e){super(),this.binding=e;let t=e.getState();if(t===I)throw Error("Entry not available in the store");this._previousState=t}_previousState;getState=()=>(this.isConnected||this._syncState(),this._previousState);_syncState(){let e=this.binding.getState();return!(e===I||function(e,t){if(void 0===e&&void 0===t)return!0;
25if(void 0===e||void 0===t)return!1;for(let n of Object.keys(e))if(!Object.is(e[n],t[n]))return!1;return!0}(e,this._previousState))&&(this._previousState=e,!0)}_connect(){return this.binding.subscribe(()=>{this._syncState()&&this.notifySubscribers()})}}class M extends _{binding;get path(){return this.binding.path}constructor(e){super(),this.binding=e}_previousStateDirty=!0;_previousState;getState=()=>{if(!this.isConnected||this._previousStateDirty){let e=this.binding.getState();e!==I&&(this._previousState=e),this._previousStateDirty=!1}if(void 0===this._previousState)throw Error("Entry not available in the store");return this._previousState};_connect(){return this.binding.subscribe(()=>{this._previousStateDirty=!0,this.notifySubscribers()})}}class P extends _{binding;get path(){return this.binding.path}constructor(e){super(),this.binding=e}getState(){return this.binding.getState()}outerSubscribe(e){return this.binding.subscribe(e)}_connect(){let e=()=>{this.notifySubscribers()},t=this.binding.getState(),n=t?.subscribe(e),r=this.outerSubscribe(()=>{let r=this.binding.getState();r!==t&&(t=r,n?.(),n=r?.subscribe(e),e())});return()=>{r?.(),n?.()}}}class T extends _{config;constructor(e){super(),this.config=e}getState(){return this.config.binding.getState()}outerSubscribe(e){return this.config.binding.subscribe(e)}_connect(){let e=()=>{this.notifySubscribers()},t=this.config.binding.getState(),n=t?.unstable_on(this.config.event,e),r=this.outerSubscribe(()=>{let r=this.config.binding.getState();r!==t&&(t=r,n?.(),n=r?.unstable_on(this.config.event,e))});return()=>{r?.(),n?.()}}}let Z=e=>"complete"===e.status.type;class F extends R{isEditing=!0;get attachmentAccept(){return this.getAttachmentAdapter()?.accept??"*"}_attachments=[];get attachments(){return this._attachments}setAttachments(e){this._attachments=e,this._notifySubscribers()}get isEmpty(){return!this.text.trim()&&!this.attachments.length}_text="";get text(){return this._text}_role="user";get role(){return this._role}_runConfig={};get runConfig(){return this._runConfig}_quote=void 0;get quote(){return this._quote}setQuote(e){this._quote!==e&&(this._quote=e,this._notifySubscribers())}setText(e){if(this._text!==e){if(this._text=e,this._dictation){this._dictationBaseText=e,this._currentInterimText="";let{status:t,inputDisabled:n}=this._dictation;this._dictation=n?{status:t,inputDisabled:n}:{status:t}}this._notifySubscribers()}}setRole(e){this._role!==e&&(this._role=e,this._notifySubscribers())}setRunConfig(e){this._runConfig!==e&&(this._runConfig=e,this._notifySubscribers())}_emptyTextAndAttachments(){this._attachments=[],this._text="",this._notifySubscribers()}async _onClearAttachments(){let e=this.getAttachmentAdapter();if(e){let t=this._attachments.filter(e=>!Z(e));await Promise.all(t.map(t=>e.remove(t)))}}async reset(){if(0===this._attachments.length&&""===this._text&&"user"===this._role&&0===Object.keys(this._runConfig).length&&void 0===this._quote)return;this._role="user",this._runConfig={},this._quote=void 0;let e=this._onClearAttachments();this._emptyTextAndAttachments(),await e}async clearAttachments(){let e=this._onClearAttachments();this.setAttachments([]),await e}async send(e){if(this.isEmpty)return;this._dictationSession&&(this._dictationSession.cancel(),this._cleanupDictation());let t=this.getAttachmentAdapter(),n=this.attachments.length>0?Promise.all(this.attachments.map(async e=>{if(Z(e))return e;if(!t)throw Error("Attachments are not supported");return await t.send(e)})):[],r=this.text,l=this._quote;this._quote=void 0,this._emptyTextAndAttachments();let o={createdAt:new Date,role:this.role,content:r?[{type:"text",text:r}]:[],attachments:await n,runConfig:this.runConfig,metadata:{custom:{...l?{quote:l}:{}}}};this.handleSend(o,e),this._notifyEventSubscribers("send")}cancel(){this.handleCancel()}async addAttachment(e){let t;if(!(e instanceof File)){let t={id:e.id??u(),type:e.type??"document",name:e.name,contentType:e.contentType,content:e.content,status:{type:"complete"}};this._attachments=[...this._attachments,t],this._notifyEventSubscribers("attachmentAdd"),this._notifySubscribers();return}let n=this.getAttachmentAdapter();if(!n)throw Error("Attachments are not supported");if(!function(e,t){if("*"===t)return!0;let n=t.split(",").map(e=>e.trim().toLowerCase()),r=`.${e.name.split(".").pop().toLowerCase()}`,l=e.type.toLowerCase();for(let e of n){if(e.startsWith(".")&&e===r||e.includes("/")&&e===l)return!0;
25if(e.endsWith("/*")){let t=e.split("/")[0];if(l.startsWith(`${t}/`))return!0}}return!1}({name:e.name,type:e.type},n.accept))throw Error(`File type ${e.type||"unknown"} is not accepted. Accepted types: ${n.accept}`);let r=e=>{let t=this._attachments.findIndex(t=>t.id===e.id);-1!==t?this._attachments=[...this._attachments.slice(0,t),e,...this._attachments.slice(t+1)]:this._attachments=[...this._attachments,e],this._notifySubscribers()};try{let l=n.add({file:e});if(Symbol.asyncIterator in l)for await(let e of l)t=e,r(e);else t=await l,r(t)}catch(e){t&&r({...t,status:{type:"incomplete",reason:"error"}});try{this._notifyEventSubscribers("attachmentAddError")}catch{}throw e}let l=t?.status.type==="incomplete"&&"error"===t.status.reason;this._notifyEventSubscribers(l?"attachmentAddError":"attachmentAdd")}async removeAttachment(e){let t=this._attachments.findIndex(t=>t.id===e);if(-1===t)throw Error("Attachment not found");let n=this._attachments[t];if(!Z(n)){let e=this.getAttachmentAdapter();if(!e)throw Error("Attachments are not supported");await e.remove(n)}this._attachments=this._attachments.filter(t=>t.id!==e),this._notifySubscribers()}_dictation;_dictationSession;_dictationUnsubscribes=[];_dictationBaseText="";_currentInterimText="";_dictationSessionIdCounter=0;_activeDictationSessionId;_isCleaningDictation=!1;get dictation(){return this._dictation}_isActiveSession(e,t){return this._activeDictationSessionId===e&&this._dictationSession===t}startDictation(){let e=this.getDictationAdapter();if(!e)throw Error("Dictation adapter not configured");if(this._dictationSession){for(let e of this._dictationUnsubscribes)e();this._dictationUnsubscribes=[],this._dictationSession.stop().catch(()=>{}),this._dictationSession=void 0}let t=e.disableInputDuringDictation??!1;this._dictationBaseText=this._text,this._currentInterimText="";let n=e.listen();this._dictationSession=n;let r=++this._dictationSessionIdCounter;this._activeDictationSessionId=r,this._dictation={status:n.status,inputDisabled:t},this._notifySubscribers();let l=n.onSpeech(e=>{if(!this._isActiveSession(r,n))return;let t=!1!==e.isFinal,l=this._dictationBaseText&&!this._dictationBaseText.endsWith(" ")&&e.transcript?" ":"";if(t){if(this._dictationBaseText=this._dictationBaseText+l+e.transcript,this._currentInterimText="",this._text=this._dictationBaseText,this._dictation){let{transcript:e,...t}=this._dictation;this._dictation=t}this._notifySubscribers()}else this._currentInterimText=l+e.transcript,this._text=this._dictationBaseText+this._currentInterimText,this._dictation&&(this._dictation={...this._dictation,transcript:e.transcript}),this._notifySubscribers()});this._dictationUnsubscribes.push(l);let o=n.onSpeechStart(()=>{this._isActiveSession(r,n)&&(this._dictation={status:{type:"running"},inputDisabled:t,...this._dictation?.transcript&&{transcript:this._dictation.transcript}},this._notifySubscribers())});this._dictationUnsubscribes.push(o);let i=n.onSpeechEnd(()=>{this._cleanupDictation({sessionId:r})});this._dictationUnsubscribes.push(i);let a=setInterval(()=>{this._isActiveSession(r,n)&&"ended"===n.status.type&&this._cleanupDictation({sessionId:r})},100);this._dictationUnsubscribes.push(()=>clearInterval(a))}stopDictation(){if(!this._dictationSession)return;let e=this._dictationSession,t=this._activeDictationSessionId;e.stop().finally(()=>{this._cleanupDictation({sessionId:t})})}_cleanupDictation(e){if(!(e?.sessionId!==void 0&&e.sessionId!==this._activeDictationSessionId)&&!this._isCleaningDictation){this._isCleaningDictation=!0;try{for(let e of this._dictationUnsubscribes)e();this._dictationUnsubscribes=[],this._dictationSession=void 0,this._activeDictationSessionId=void 0,this._dictation=void 0,this._dictationBaseText="",this._currentInterimText="",this._notifySubscribers()}finally{this._isCleaningDictation=!1}}}_eventSubscribers=new Map;_notifyEventSubscribers(e){let t=this._eventSubscribers.get(e);if(t)for(let e of t)e()}unstable_on(e,t){let n=this._eventSubscribers.get(e);return n?n.add(t):this._eventSubscribers.set(e,new Set([t])),()=>{let n=this._eventSubscribers.get(e);n&&n.delete(t)}}}class D extends F{runtime;_canCancel=!1;get canCancel(){return this._canCancel}getAttachmentAdapter(){return this.runtime.adapters?.attachments}getDictationAdapter(){return this.runtime.adapters?.dictation}constructor(e){super(),this.runtime=e,this.connect()}connect(){return this.runtime.subscribe(()=>{this.canCancel!==this.runtime.capabilities.cancel&&(this._canCancel=this.runtime.capabilities.cancel,this._notifySubscribers())})}async handleSend(e,t){this.runtime.append({...e,parentId:this.runtime.messages.at(-1)?.id??null,sourceId:null,startRun:t?.startRun})}async handleCancel(){this.runtime.cancelRun()}}class A extends F{runtime;endEditCallback;get canCancel(){return!0}getAttachmentAdapter(){return this.runtime.adapters?.attachments}getDictationAdapter(){return this.runtime.adapters?.dictation}_nonTextParts;_previousText;_parentId;_sourceId;constructor(e,t,{parentId:n,message:r}){super(),this.runtime=e,this.endEditCallback=t,this._parentId=n,this._sourceId=r.id,this._previousText=f(r),this.setText(this._previousText),this.setRole(r.role),this.setAttachments(r.attachments??[]),this._nonTextParts=r.content.filter(e=>"text"!==e.type),this.setRunConfig({...e.composer.runConfig})}get parentId(){return this._parentId}get sourceId(){return this._sourceId}async handleSend(e,t){(f(e)!==this._previousText||t?.startRun)&&this.runtime.append({...e,content:[...e.content,...this._nonTextParts],parentId:this._parentId,sourceId:this._sourceId,startRun:t?.startRun}),this.handleCancel()}handleCancel(){this.endEditCallback(),this._notifySubscribers()}}class O{_contextProvider;_subscriptions=new Set;_isInitialized=!1;repository=new k;_voiceMessages=[];_voiceGeneration=0;_cachedMergedMessages=null;_cachedVoiceGeneration=-1;_cachedMergedBase=null;
25_markVoiceMessagesDirty(){this._voiceGeneration++,this._cachedMergedMessages=null}_getBaseMessages(){return this.repository.getMessages()}get messages(){if(0===this._voiceMessages.length)return this._getBaseMessages();let e=this._getBaseMessages();return(this._cachedVoiceGeneration!==this._voiceGeneration||this._cachedMergedBase!==e)&&(this._cachedMergedMessages=[...e,...this._voiceMessages],this._cachedVoiceGeneration=this._voiceGeneration,this._cachedMergedBase=e),this._cachedMergedMessages}get state(){let e;for(let t of this.messages)"assistant"===t.role&&(e=t);return e?.metadata.unstable_state??null}composer=new D(this);constructor(e){this._contextProvider=e}getModelContext(){return this._contextProvider.getModelContext()}_editComposers=new Map;getEditComposer(e){return this._editComposers.get(e)}beginEdit(e){if(this._editComposers.has(e))throw Error("Edit already in progress");this._editComposers.set(e,new A(this,()=>this._editComposers.delete(e),this.repository.getMessage(e))),this._notifySubscribers()}getMessageById(e){try{return this.repository.getMessage(e)}catch{let t=this.repository.getMessages(),n=this._voiceMessages.findIndex(t=>t.id===e);if(-1!==n)return{parentId:n>0?this._voiceMessages[n-1].id:t.at(-1)?.id??null,message:this._voiceMessages[n],index:t.length+n};return}}getBranches(e){return this._voiceMessages.some(t=>t.id===e)?[]:this.repository.getBranches(e)}switchToBranch(e){this.repository.switchToBranch(e),this._notifySubscribers()}_notifySubscribers(){for(let e of this._subscriptions)e()}_notifyEventSubscribers(e){let t=this._eventSubscribers.get(e);if(t)for(let e of t)e()}subscribe(e){return this._subscriptions.add(e),()=>this._subscriptions.delete(e)}submitFeedback({messageId:e,type:t}){let n=this.adapters?.feedback;if(!n)throw Error("Feedback adapter not configured");let{message:r,parentId:l}=this.repository.getMessage(e);if(n.submit({message:r,type:t}),"assistant"===r.role){let e={...r,metadata:{...r.metadata,submittedFeedback:{type:t}}};this.repository.addOrUpdateMessage(l,e)}this._notifySubscribers()}_stopSpeaking;speech;speak(e){let t=this.adapters?.speech;if(!t)throw Error("Speech adapter not configured");let{message:n}=this.repository.getMessage(e);this._stopSpeaking?.();let r=t.speak(f(n)),l=r.subscribe(()=>{"ended"===r.status.type?(this._stopSpeaking=void 0,this.speech=void 0):this.speech={messageId:e,status:r.status},this._notifySubscribers()});this.speech={messageId:e,status:r.status},this._notifySubscribers(),this._stopSpeaking=()=>{r.cancel(),l(),this.speech=void 0,this._stopSpeaking=void 0}}stopSpeaking(){if(!this._stopSpeaking)throw Error("No message is being spoken");this._stopSpeaking(),this._notifySubscribers()}_voiceSession;_voiceUnsubs=[];voice;_voiceVolume=0;_voiceVolumeSubscribers=new Set;getVoiceVolume=()=>this._voiceVolume;subscribeVoiceVolume=e=>(this._voiceVolumeSubscribers.add(e),()=>this._voiceVolumeSubscribers.delete(e));connectVoice(){let e=this.adapters?.voice;if(!e)throw Error("Voice adapter not configured");this.disconnectVoice();let t=e.connect({});this._voiceSession=t;let n=[],r="listening";this.voice={status:t.status,isMuted:t.isMuted,mode:r},this._voiceVolume=0,this._notifySubscribers(),n.push(t.onStatusChange(e=>{"ended"===e.type?(this._finishVoiceAssistantMessage(),this._voiceSession=void 0,this.voice=void 0):this.voice={status:e,isMuted:t.isMuted,mode:r},this._notifySubscribers()})),n.push(t.onModeChange(e=>{r=e,this.voice&&(this.voice={...this.voice,mode:e},this._notifySubscribers())})),n.push(t.onVolumeChange(e=>{for(let t of(this._voiceVolume=e,this._voiceVolumeSubscribers))t()})),n.push(t.onTranscript(e=>{this._handleVoiceTranscript(e)})),this._voiceUnsubs=n}_currentAssistantMsg=null;_handleVoiceTranscript(e){if(this.ensureInitialized(),"user"===e.role)this._finishVoiceAssistantMessage(),this._currentAssistantMsg=null,e.isFinal&&(this._voiceMessages.push({id:u(),role:"user",content:[{type:"text",text:e.text}],metadata:{custom:{}},createdAt:new Date,status:{type:"complete",reason:"unknown"},attachments:[]}),this._markVoiceMessagesDirty(),this._notifySubscribers());else{if(this._currentAssistantMsg){let t=this._voiceMessages.indexOf(this._currentAssistantMsg);if(-1===t)return;let n={...this._currentAssistantMsg,content:[{type:"text",text:e.text}],...e.isFinal?{status:{type:"complete",reason:"stop"}}:{}};this._voiceMessages[t]=n,this._currentAssistantMsg=n}else this._currentAssistantMsg={id:u(),role:"assistant",content:[{type:"text",text:e.text}],metadata:{unstable_state:this.state,unstable_annotations:[],unstable_data:[],steps:[],custom:{}},status:{type:"running"},createdAt:new Date},this._voiceMessages.push(this._currentAssistantMsg);e.isFinal&&(this._currentAssistantMsg=null),this._markVoiceMessagesDirt
25y(),this._notifySubscribers()}}_finishVoiceAssistantMessage(){let e=this._voiceMessages.at(-1);if(e?.role==="assistant"&&"running"===e.status.type){let t=this._voiceMessages.length-1;this._voiceMessages[t]={...e,status:{type:"complete",reason:"stop"}},this._markVoiceMessagesDirty(),this._notifySubscribers()}}disconnectVoice(){for(let e of(this._finishVoiceAssistantMessage(),this._currentAssistantMsg=null,this._voiceUnsubs))e();for(let e of(this._voiceUnsubs=[],this._voiceSession?.disconnect(),this._voiceSession=void 0,this.voice=void 0,this._voiceVolume=0,this._voiceVolumeSubscribers))e();this._voiceMessages=[],this._markVoiceMessagesDirty(),this._notifySubscribers()}muteVoice(){if(!this._voiceSession)throw Error("No active voice session");this._voiceSession.mute(),this.voice={...this.voice,isMuted:!0},this._notifySubscribers()}unmuteVoice(){if(!this._voiceSession)throw Error("No active voice session");this._voiceSession.unmute(),this.voice={...this.voice,isMuted:!1},this._notifySubscribers()}ensureInitialized(){this._isInitialized||(this._isInitialized=!0,this._notifyEventSubscribers("initialize"))}export(){return this.repository.export()}import(e){this.ensureInitialized(),this.repository.clear(),this.repository.import(e),this._notifySubscribers()}reset(e){this.import(w.fromArray(e??[]))}_eventSubscribers=new Map;unstable_on(e,t){if("modelContextUpdate"===e)return this._contextProvider.subscribe?.(t)??(()=>{});let n=this._eventSubscribers.get(e);return n?n.add(t):this._eventSubscribers.set(e,new Set([t])),()=>{this._eventSubscribers.get(e).delete(t)}}}class z extends Error{name="AbortError";detach;constructor(e,t){super(t),this.detach=e}}class j extends O{capabilities={switchToBranch:!0,switchBranchDuringRun:!0,edit:!0,reload:!0,cancel:!0,unstable_copy:!0,speech:!1,dictation:!1,voice:!1,attachments:!1,feedback:!1,queue:!1};abortController=null;isDisabled=!1;_isLoading=!1;get isLoading(){return this._isLoading}_suggestions=[];_suggestionsController=null;get suggestions(){return this._suggestions}get adapters(){return this._options.adapters}constructor(e,t){super(e),this.__internal_setOptions(t)}_options;_lastRunConfig={};_getThreadId;__internal_setGetThreadId(e){this._getThreadId=e}_getInitializePromise;__internal_setGetInitializePromise(e){this._getInitializePromise=e}get extras(){}__internal_setOptions(e){if(this._options===e)return;this._options=e;let t=!1,n=e.adapters?.speech!==void 0;this.capabilities.speech!==n&&(this.capabilities.speech=n,t=!0);let r=e.adapters?.dictation!==void 0;this.capabilities.dictation!==r&&(this.capabilities.dictation=r,t=!0);let l=e.adapters?.voice!==void 0;this.capabilities.voice!==l&&(this.capabilities.voice=l,t=!0);let o=e.adapters?.attachments!==void 0;this.capabilities.attachments!==o&&(this.capabilities.attachments=o,t=!0);let i=e.adapters?.feedback!==void 0;this.capabilities.feedback!==i&&(this.capabilities.feedback=i,t=!0),t&&this._notifySubscribers()}_loadPromise;__internal_load(){if(this._loadPromise)return this._loadPromise;let e=this.adapters.history?.load()??Promise.resolve(null);return this._isLoading=!0,this._notifySubscribers(),this._loadPromise=e.then(e=>{if(!e)return;this.repository.import(e),e.messages.length>0&&this.ensureInitialized(),this._notifySubscribers();let t=this.adapters.history?.resume?.bind(this.adapters.history);e.unstable_resume&&t&&this.startRun({parentId:this.repository.headId,sourceId:this.repository.headId,runConfig:this._lastRunConfig},t).catch(()=>{})}).finally(()=>{this._isLoading=!1,this._notifySubscribers()}),this._loadPromise}async append(e){this.ensureInitialized();let t=this._getInitializePromise?.();t&&await t;let n=p(e,u(),{type:"complete",reason:"unknown"});this.repository.addOrUpdateMessage(e.parentId,n),this._options.adapters.history?.append({parentId:e.parentId,message:n,...void 0!==e.runConfig&&{runConfig:e.runConfig}}),e.startRun??"user"===e.role?await this.startRun({parentId:n.id,sourceId:e.sourceId,runConfig:e.runConfig??{}}):(this.repository.resetHead(n.id),this._notifySubscribers())}resumeRun({stream:e,...t}){if(!e)throw Error("You must pass a stream parameter to resume runs.");return this.startRun(t,e)}exportExternalState(){throw Error("Runtime does not support exporting external states.")}importExternalState(){throw Error("Runtime does not support importing external states.")}unstable_loadExternalState(){throw Error("Runtime does not support importing external states.")}async startRun({parentId:e,runConfig:t},n){this.ensureInitialized();let r={id:u(),role:"assistant",status:{type:"running"},content:[],metadata:{unstable_state:this.state,unstable_annotations:[],unstable_data:[],steps:[],custom:{}},createdAt:new Date};this._notifyEventSubscribers("runStart");try{this._suggestions=[],this._suggestionsController?.abort(),this._suggestionsController=null,this._notifySubscribers();do r=await this.performRoundtrip(e,r,t,n),n=void 0;while(h(r,this._options.unstable_humanToolNames))}finally{this._notifyEventSubscribers("runEnd")}this._suggestionsController=new AbortController;let l=this._suggestionsController.signal;if(this.adapters.suggestion&&r.status?.type!=="requires-action"){let e=this.adapters.suggestion?.generate({messages:this.messages});if(Symbol.asyncIterator in e)for await(let t of e){if(l.aborted)break;this._suggestions=t,this._notifySubscribers()}else{let t=await e;if(l.aborted)return;this._suggestions=t,this._notifySubscribers()}}}async performRoundtrip(e,t,n,r){let l=e?this.repository.getMessages(e):[];this.abortController?.abort(),this.abortController=new AbortController;let o=t.content,i=t.metadata?.unstable_annotations,a=t.metadata?.unstable_data,s=t.metadata?.steps,u=t.metadata?.custom,c=n=>{let r=n.metadata?.steps,l=r?[...s??[],...r]:void 0,c=n.metadata?.unstable_annotations,d=n.metadata?.unstable_data,p=c?[...i??[],...c]:void 0,h=d?[...a??[],...d]:void 0;t={...t,...n.content?{content:[...o,...n.content??[]]}:void 0,status:n.status??t.status,...n.metadata?{metadata:{...t.metadata,...n.metadata.unstable_state?{unstable_state:n.metadata.unstable_state}:void 0,...p?{unstable_annotations:p}:void 0,...h?{unstable_data:h}:void 0,...l?{steps:l}:void 0,...n.metadata?.timing?{timing:n.metadata.timing}:void 0,...n.metadata?.custom?{custom:{...u??{},...n.metadata.custom}}:void 0}}:void 0},this.repository.addOrUpdateMessage(e,t),this._notifySubscribers()},d=this._options.maxSteps??2;if((t.metadata?.steps?.length??0)>=d)return c({status:{type:"incomplete",reason:"tool-calls"}}),t;c({status:{type:"running"}}),this.repository.resetHead(t.id),this._notifySubscribers();try{this._lastRunConfig=n??{};let o=this.getModelContext();r=r??this.adapters.chatModel.run.bind(this.adapters.chatModel);let i=this.abortController.signal,a=this._getThreadId?.(),s=r({messages:l,runConfig:this._lastRunConfig,abortSignal:i,context:o,config:o,unstable_assistantMessageId:t.id,unstable_threadId:a,unstable_parentId:e,unstable_getMessage:()=>t});if(Symbol.asyncIterator in s)for await(let e of s){if(i.aborted){c({status:{type:"incomplete",reason:"cancelled"}});break}c(e)}else c(await s);"running"===t.status.type&&c({status:{type:"complete",reason:"unknown"}})}catch(e){if(e instanceof z)c({status:{type:"incomplete",reason:"cancelled"}});else if(e instanceof Error&&"AbortError"===e.name)c({status:{type:"incomplete",reason:"cancelled"}});else throw c({status:{type:"incomplete",reason:"error",error:e instanceof Error?e.message:`[${typeof e}] ${new String(e).toString()}`}}),e}finally{this.abortController=null,("complete"===t.status.type||"incomplete"===t.status.type)&&await this._options.adapters.history?.append({parentId:e,message:t,runConfig:this._lastRunConfig})}return t}detach(){let e=new z(!0);this.abortController?.abort(e),this.abortController=null}cancelRun(){let e=new z(!1);this.abortController?.abort(e),this.abortController=null}addToolResult({messageId:e,toolCallId:t,result:n,isError:r,artifact:l}){let o=this.repository.getMessage(e),{parentId:i}=o,{message:a}=o;if("assistant"!==a.role)throw Error("Tried to add tool result to non-assistant message");
25let s=!1,u=!1,c=a.content.map(e=>"tool-call"!==e.type||e.toolCallId!==t?e:(u=!0,e.result||(s=!0),{...e,result:n,artifact:l,isError:r}));if(!u)throw Error("Tried to add tool result to non-existing tool call");a={...a,content:c},this.repository.addOrUpdateMessage(i,a),s&&h(a,this._options.unstable_humanToolNames)&&this.performRoundtrip(i,a,this._lastRunConfig).catch(()=>{})}resumeToolCall(e){throw Error("Local runtime does not support resuming tool calls.")}}let L=Object.freeze([]),H="__DEFAULT_ID__",B=Object.freeze({[H]:{id:H,remoteId:void 0,externalId:void 0,status:"regular",title:void 0}});class N extends R{_mainThread;constructor(e){super(),this._mainThread=e()}get isLoading(){return!1}getMainThreadRuntimeCore(){return this._mainThread}get newThreadId(){}get threadIds(){return L}get archivedThreadIds(){return L}get mainThreadId(){return H}get threadItems(){return B}getThreadRuntimeCore(){throw Error("Method not implemented.")}getLoadThreadsPromise(){return Promise.resolve()}getItemById(e){if(e===this.mainThreadId)return{status:"regular",id:this.mainThreadId,remoteId:this.mainThreadId,externalId:void 0,title:void 0,isMain:!0};throw Error("Method not implemented")}async switchToThread(){throw Error("Method not implemented.")}switchToNewThread(){throw Error("Method not implemented.")}rename(){throw Error("Method not implemented.")}archive(){throw Error("Method not implemented.")}detach(){throw Error("Method not implemented.")}unarchive(){throw Error("Method not implemented.")}delete(){throw Error("Method not implemented.")}initialize(e){return Promise.resolve({remoteId:e,externalId:void 0})}generateTitle(){throw Error("Method not implemented.")}}class V extends o{threads;Provider=void 0;_options;constructor(e,t){super(),this._options=e,this.threads=new N(()=>new j(this._contextProvider,this._options)),t&&this.threads.getMainThreadRuntimeCore().import(w.fromArray(t))}}class ${_core;_threadListBinding;get path(){return this._core.path}constructor(e,t){this._core=e,this._threadListBinding=t,this.__internal_bindMethods()}__internal_bindMethods(){this.switchTo=this.switchTo.bind(this),this.rename=this.rename.bind(this),this.archive=this.archive.bind(this),this.unarchive=this.unarchive.bind(this),this.delete=this.delete.bind(this),this.initialize=this.initialize.bind(this),this.generateTitle=this.generateTitle.bind(this),this.subscribe=this.subscribe.bind(this),this.unstable_on=this.unstable_on.bind(this),this.getState=this.getState.bind(this),this.detach=this.detach.bind(this)}getState(){return this._core.getState()}switchTo(){let e=this._core.getState();return this._threadListBinding.switchToThread(e.id)}rename(e){let t=this._core.getState();return this._threadListBinding.rename(t.id,e)}archive(){let e=this._core.getState();return this._threadListBinding.archive(e.id)}unarchive(){let e=this._core.getState();return this._threadListBinding.unarchive(e.id)}delete(){let e=this._core.getState();return this._threadListBinding.delete(e.id)}initialize(){let e=this._core.getState();return this._threadListBinding.initialize(e.id)}generateTitle(){let e=this._core.getState();return this._threadListBinding.generateTitle(e.id)}unstable_on(e,t){let n=this._core.getState().isMain,r=this._core.getState().id;return this.subscribe(()=>{let l=this._core.getState(),o=l.isMain,i=l.id;(n!==o||r!==i)&&(n=o,r=i,("switchedTo"!==e||o)&&("switchedAway"===e&&o||t()))})}subscribe(e){return this._core.subscribe(e)}detach(){let e=this._core.getState();this._threadListBinding.detach(e.id)}__internal_getRuntime(){return this}}let U=Symbol("innerMessage");Symbol("innerMessages");class G{_core;get path(){return this._core.path}constructor(e){this._core=e,this.__internal_bindMethods()}__internal_bindMethods(){this.getState=this.getState.bind(this),this.remove=this.remove.bind(this),this.subscribe=this.subscribe.bind(this)}getState(){return this._core.getState()}subscribe(e){return this._core.subscribe(e)}}class q extends G{_composerApi;constructor(e,t){super(e),this._composerApi=t}remove(){let e=this._composerApi.getState();if(!e)throw Error("Composer is not available");return e.removeAttachment(this.getState().id)}}class W extends q{get source(){return"thread-composer"}}class K extends q{get source(){return"edit-composer"}}class Y extends G{get source(){return"message"}constructor(e){super(e)}remove(){throw Error("Message attachments cannot be removed")}}let X=Object.freeze([]),J=Object.freeze({}),Q=e=>Object.freeze({type:"thread",isEditing:e?.isEditing??!1,canCancel:e?.canCancel??!1,isEmpty:e?.isEmpty??!0,attachments:e?.attachments??X,text:e?.text??"",role:e?.role??"user",runConfig:e?.runConfig??J,attachmentAccept:e?.attachmentAccept??"",dictation:e?.dictation,quote:e?.quote,value:e?.text??""}),ee=e=>Object.freeze({type:"edit",isEditing:e?.isEditing??!1,canCancel:e?.canCancel??!1,isEmpty:e?.isEmpty??!0,text:e?.text??"",role:e?.role??"user",attachments:e?.attachments??X,runConfig:e?.runConfig??J,attachmentAccept:e?.attachmentAccept??"",dictation:e?.dictation,quote:e?.quote,parentId:e?.parentId??null,sourceId:e?.sourceId??null,value:e?.text??""});class et{_core;get path(){return this._core.path}constructor(e){this._core=e}__internal_bindMethods(){this.setText=this.setText.bind(this),this.setRunConfig=this.setRunConfig.bind(this),this.get
25State=this.getState.bind(this),this.subscribe=this.subscribe.bind(this),this.addAttachment=this.addAttachment.bind(this),this.reset=this.reset.bind(this),this.clearAttachments=this.clearAttachments.bind(this),this.send=this.send.bind(this),this.cancel=this.cancel.bind(this),this.setRole=this.setRole.bind(this),this.getAttachmentByIndex=this.getAttachmentByIndex.bind(this),this.startDictation=this.startDictation.bind(this),this.stopDictation=this.stopDictation.bind(this),this.setQuote=this.setQuote.bind(this),this.unstable_on=this.unstable_on.bind(this)}setText(e){let t=this._core.getState();if(!t)throw Error("Composer is not available");t.setText(e)}setRunConfig(e){let t=this._core.getState();if(!t)throw Error("Composer is not available");t.setRunConfig(e)}addAttachment(e){let t=this._core.getState();if(!t)throw Error("Composer is not available");return t.addAttachment(e)}reset(){let e=this._core.getState();if(!e)throw Error("Composer is not available");return e.reset()}clearAttachments(){let e=this._core.getState();if(!e)throw Error("Composer is not available");return e.clearAttachments()}send(e){let t=this._core.getState();if(!t)throw Error("Composer is not available");t.send(e)}cancel(){let e=this._core.getState();if(!e)throw Error("Composer is not available");e.cancel()}setRole(e){let t=this._core.getState();if(!t)throw Error("Composer is not available");t.setRole(e)}startDictation(){let e=this._core.getState();if(!e)throw Error("Composer is not available");e.startDictation()}stopDictation(){let e=this._core.getState();if(!e)throw Error("Composer is not available");e.stopDictation()}setQuote(e){let t=this._core.getState();if(!t)throw Error("Composer is not available");t.setQuote(e)}subscribe(e){return this._core.subscribe(e)}_eventSubscriptionSubjects=new Map;unstable_on(e,t){let n=this._eventSubscriptionSubjects.get(e);return n||(n=new T({event:e,binding:this._core}),this._eventSubscriptionSubjects.set(e,n)),n.subscribe(t)}}class en extends et{get path(){return this._core.path}get type(){return"thread"}_getState;constructor(e){let t=new M({path:e.path,getState:()=>Q(e.getState()),subscribe:t=>e.subscribe(t)});super({path:e.path,getState:()=>e.getState(),subscribe:e=>t.subscribe(e)}),this._getState=t.getState.bind(t),this.__internal_bindMethods()}getState(){return this._getState()}getAttachmentByIndex(e){return new W(new E({path:{...this.path,attachmentSource:"thread-composer",attachmentSelector:{type:"index",index:e},ref:`${this.path.ref}.attachments[${e}]`},getState:()=>{let t=this.getState().attachments[e];return t?{...t,source:"thread-composer"}:I},subscribe:e=>this._core.subscribe(e)}),this._core)}}class er extends et{_beginEdit;get path(){return this._core.path}get type(){return"edit"}_getState;constructor(e,t){let n=new M({path:e.path,getState:()=>ee(e.getState()),subscribe:t=>e.subscribe(t)});super({path:e.path,getState:()=>e.getState(),subscribe:e=>n.subscribe(e)}),this._beginEdit=t,this._getState=n.getState.bind(n),this.__internal_bindMethods()}__internal_bindMethods(){super.__internal_bindMethods(),this.beginEdit=this.beginEdit.bind(this)}getState(){return this._getState()}beginEdit(){this._beginEdit()}getAttachmentByIndex(e){return new K(new E({path:{...this.path,attachmentSource:"edit-composer",attachmentSelector:{type:"index",index:e},ref:`${this.path.ref}.attachments[${e}]`},getState:()=>{let t=this.getState().attachments[e];return t?{...t,source:"edit-composer"}:I},subscribe:e=>this._core.subscribe(e)}),this._core)}}let el=Symbol.for("aui.tool-response");class eo{get[el](){return!0}artifact;result;isError;messages;constructor(e){void 0!==e.artifact&&(this.artifact=e.artifact),this.result=e.result,this.isError=e.isError??!1,void 0!==e.messages&&(this.messages=e.messages)}static[Symbol.hasInstance](e){return"object"==typeof e&&null!==e&&el in e}static toResponse(e){return e instanceof eo?e:new eo({result:void 0===e?"<no result>":e})}}class ei{contentBinding;messageApi;threadApi;get path(){return this.contentBinding.path}constructor(e,t,n){this.contentBinding=e,this.messageApi=t,this.threadApi=n,this.__internal_bindMethods()}__internal_bindMethods(){this.addToolResult=this.addToolResult.bind(this),this.resumeToolCall=this.resumeToolCall.bind(this),this.get
25State=this.getState.bind(this),this.subscribe=this.subscribe.bind(this)}getState(){return this.contentBinding.getState()}addToolResult(e){let t=this.contentBinding.getState();if(!t)throw Error("Message part is not available");if("tool-call"!==t.type)throw Error("Tried to add tool result to non-tool message part");if(!this.messageApi)throw Error("Message API is not available. This is likely a bug in assistant-ui.");if(!this.threadApi)throw Error("Thread API is not available");let n=this.messageApi.getState();if(!n)throw Error("Message is not available");let r=t.toolName,l=t.toolCallId,o=eo.toResponse(e);this.threadApi.getState().addToolResult({messageId:n.id,toolName:r,toolCallId:l,result:o.result,artifact:o.artifact,isError:o.isError})}resumeToolCall(e){let t=this.contentBinding.getState();if(!t)throw Error("Message part is not available");if("tool-call"!==t.type)throw Error("Tried to resume tool call on non-tool message part");if(!this.threadApi)throw Error("Thread API is not available");let n=t.toolCallId;this.threadApi.getState().resumeToolCall({toolCallId:n,payload:e})}subscribe(e){return this.contentBinding.subscribe(e)}}let ea=Object.freeze({type:"complete"}),es=(e,t,n)=>{if("assistant"!==e.role)return ea;if("tool-call"===n.type)return n.result?ea:e.status;let r=t===Math.max(0,e.content.length-1);return"requires-action"===e.status.type?ea:r?e.status:ea},eu=(e,t)=>{let n=e.content[t];if(!n)return I;let r=es(e,t,n);return Object.freeze({...n,[U]:n[U],status:r})};class ec{_core;_threadBinding;get path(){return this._core.path}constructor(e,t){this._core=e,this._threadBinding=t,this.composer=new er(new P({path:{...this.path,ref:`${this.path.ref}${this.path.ref}.composer`,composerSource:"edit"},getState:this._getEditComposerRuntimeCore,subscribe:e=>this._threadBinding.subscribe(e)}),()=>this._threadBinding.getState().beginEdit(this._core.getState().id)),this.__internal_bindMethods()}__internal_bindMethods(){this.reload=this.reload.bind(this),this.getState=this.getState.bind(this),this.subscribe=this.subscribe.bind(this),this.getMessagePartByIndex=this.getMessagePartByIndex.bind(this),this.getMessagePartByToolCallId=this.getMessagePartByToolCallId.bind(this),this.getAttachmentByIndex=this.getAttachmentByIndex.bind(this),this.unstable_getCopyText=this.unstable_getCopyText.bind(this),this.speak=this.speak.bind(this),this.stopSpeaking=this.stopSpeaking.bind(this),this.submitFeedback=this.submitFeedback.bind(this),this.switchToBranch=this.switchToBranch.bind(this)}composer;_getEditComposerRuntimeCore=()=>this._threadBinding.getState().getEditComposer(this._core.getState().id);getState(){return this._core.getState()}reload(e={}){let t=this._getEditComposerRuntimeCore(),n=t??this._threadBinding.getState().composer,{runConfig:r=(t??n).runConfig}=e,l=this._core.getState();if("assistant"!==l.role)throw Error("Can only reload assistant messages");this._threadBinding.getState().startRun({parentId:l.parentId,sourceId:l.id,runConfig:r})}speak(){let e=this._core.getState();return this._threadBinding.getState().speak(e.id)}stopSpeaking(){let e=this._core.getState(),t=this._threadBinding.getState();if(t.speech?.messageId===e.id)this._threadBinding.getState().stopSpeaking();else throw Error("Message is not being spoken")}submitFeedback({type:e}){let t=this._core.getState();this._threadBinding.getState().submitFeedback({messageId:t.id,type:e})}switchToBranch({position:e,branchId:t}){let n=this._core.getState();if(t&&e)throw Error("May not specify both branchId and position");if(!t&&!e)throw Error("Must specify either branchId or position");let r=this._threadBinding.getState().getBranches(n.id),l=t;if("previous"===e?l=r[n.branchNumber-2]:"next"===e&&(l=r[n.branchNumber]),!l)throw Error("Branch not found");this._threadBinding.getState().switchToBranch(l)}unstable_getCopyText(){return f(this.getState())}subscribe(e){return this._core.subscribe(e)}getMessagePartByIndex(e){if(e<0)throw Error("Message part index must be >= 0");return new ei(new E({path:{...this.path,ref:`${this.path.ref}${this.path.ref}.content[${e}]`,messagePartSelector:{type:"index",index:e}},getState:()=>eu(this.getState(),e),subscribe:e=>this._core.subscribe(e)}),this._core,this._threadBinding)}getMessagePartByToolCallId(e){return new ei(new E({path:{...this.path,ref:this.path.ref+`${this.path.ref}.content[toolCallId=${JSON.stringify(e)}]`,messagePartSelector:{type:"toolCallId",toolCallId:e}},getState:()=>{let t=this._core.getState(),n=t.content.findIndex(t=>"tool-call"===t.type&&t.toolCallId===e);return -1===n?I:eu(t,n)},subscribe:e=>this._core.subscribe(e)}),this._core,this._threadBinding)}getAttachmentByIndex(e){return new Y(new E({path:{...this.path,ref:`${this.path.ref}${this.path.ref}.attachments[${e}]`,attachmentSource:"message",attachmentSelector:{type:"index",index:e}},getState:()=>{let t=this.getState().attachments,n=t?.[e];return n?{...n,source:"message"}:I},subscribe:e=>this._core.subscribe(e)}))}}let ed=e=>({parentId:e.parentId??null,sourceId:e.sourceId??null,runConfig:e.runConfig??{},...e.stream?{stream:e.stream}:{}}),ep=e=>({parentId:e.parentId??null,sourceId:e.sourceId??null,runConfig:e.runConfig??{}}),eh=(e,t)=>"string"==typeof t?{createdAt:new Date,parentId:e.at(-1)?.id??null,sourceId:null,runConfig:{},role:"user",content:[{type:"text",text:t}],attachments:[],metadata:{custom:{}}}:{createdAt:t.createdAt??new Date,parentId:t.parentId??e.at(-1)?.id??null,sourceId:t.sourceId??null,role:t.role??"user",content:t.content,attachments:t.attachments??[],metadata:t.metadata??{custom:{}},runConfig:t.runConfig??{},startRun:t.startRun},ef=(e,t)=>{let n=e.messages.at(-1);return Object.freeze({threadId:t.id,metadata:t,capabilities:e.capabilities,isDisabled:e.isDisabled,isLoading:e.isLoading,isRunning:n?.role==="assistant"&&"running"===n.status.type,messages:e.messages,state:e.state,suggestions:e.suggestions,extras:e.extras,speech:e.speech,voice:e.voice})};class eg{get path(){return this._threadBinding.path}get __internal_threadBinding(){return this._threadBinding}_threadBinding;constructor(e,t){let n=new E({path:e.path,getState:()=>ef(e.getState(),t.getState()),subscribe:n=>{let r=e.subscribe(n),l=t.subscribe(n);return()=>{r(),l()}}});this._threadBinding={path:e.path,getState:()=>e.getState(),getStateState:()=>n.getState(),outerSubscribe:t=>e.outerSubscribe(t),subscribe:t=>e.subscribe(t)},this.composer=new en(new P({path:{...this.path,ref:`${this.path.ref}.composer`,composerSource:"thread"},getState:()=>this._threadBinding.getState().composer,subscribe:e=>this._threadBinding.subscribe(e)})),this.__internal_bindMethods()}__internal_bindMethods(){this.append=this.append.bind(this),this.resumeRun=this.resumeRun.bind(this),this.unstable_resumeRun=this.unstable_resumeRun.bind(this),this.unstable_loadExternalState=this.unstable_loadExternalState.bind(this),this.importExternalState=this.importExternalState.bind(this),this.exportExternalState=this.exportExternalState.bind(this),this.startRun=this.startRun.bind(this),this.cancelRun=this.cancelRun.bind(this),this.stopSpeaking=this.stopSpeaking.bind(this),this.connectVoice=this.connectVoice.bind(this),this.disconnectVoice=this.disconnectVoice.bind(this),this.muteVoice=this.muteVoice.bind(this),this.unmuteVoice=this.unmuteVoice.bind(this),this.getVoiceVolume=this.getVoiceVolume.bind(this),this.subscribeVoiceVolume=this.subscribeVoiceVolume.bind(this),this.export=this.export.bind(this),this.import=this.import.bind(this),this.reset=this.reset.bind(this),this.getMessageByIndex=this.getMessageByIndex.bind(this),this.getMessageById=this.getMessageById.bind(this),this.subscribe=this.subscribe.bind(this),this.unstable_on=this.unstable_on.bind(this),this.getModelContext=this.getModelContext.bind(this),this.getModelConfig=this.getModelConfig.bind(this),this.get
25State=this.getState.bind(this)}composer;getState(){return this._threadBinding.getStateState()}append(e){this._threadBinding.getState().append(eh(this._threadBinding.getState().messages,e))}subscribe(e){return this._threadBinding.subscribe(e)}getModelContext(){return this._threadBinding.getState().getModelContext()}getModelConfig(){return this.getModelContext()}startRun(e){return this._threadBinding.getState().startRun(ep(null===e||"string"==typeof e?{parentId:e}:e))}resumeRun(e){return this._threadBinding.getState().resumeRun(ed(e))}unstable_resumeRun(e){return this.resumeRun(e)}exportExternalState(){return this._threadBinding.getState().exportExternalState()}importExternalState(e){this._threadBinding.getState().importExternalState(e)}unstable_loadExternalState(e){this._threadBinding.getState().unstable_loadExternalState(e)}cancelRun(){this._threadBinding.getState().cancelRun()}stopSpeaking(){return this._threadBinding.getState().stopSpeaking()}connectVoice(){this._threadBinding.getState().connectVoice()}disconnectVoice(){this._threadBinding.getState().disconnectVoice()}getVoiceVolume(){return this._threadBinding.getState().getVoiceVolume()}subscribeVoiceVolume(e){return this._threadBinding.getState().subscribeVoiceVolume(e)}muteVoice(){this._threadBinding.getState().muteVoice()}unmuteVoice(){this._threadBinding.getState().unmuteVoice()}export(){return this._threadBinding.getState().export()}import(e){this._threadBinding.getState().import(e)}reset(e){this._threadBinding.getState().reset(e)}getMessageByIndex(e){if(e<0)throw Error("Message index must be >= 0");return this._getMessageRuntime({...this.path,ref:`${this.path.ref}.messages[${e}]`,messageSelector:{type:"index",index:e}},()=>{let t=this._threadBinding.getState().messages,n=t[e];if(n)return{message:n,parentId:t[e-1]?.id??null,index:e}})}getMessageById(e){return this._getMessageRuntime({...this.path,ref:`${this.path.ref}.messages[messageId=${JSON.stringify(e)}]`,messageSelector:{type:"messageId",messageId:e}},()=>this._threadBinding.getState().getMessageById(e))}_getMessageRuntime(e,t){return new ec(new E({path:e,getState:()=>{let{message:e,parentId:n,index:r}=t()??{},{messages:l,speech:o}=this._threadBinding.getState();if(!e||void 0===n||void 0===r)return I;let i=this._threadBinding.getState().getBranches(e.id),a=e.metadata.submittedFeedback;return{...e,[U]:e[U],index:r,isLast:l.at(-1)?.id===e.id,parentId:n,branchNumber:i.indexOf(e.id)+1,branchCount:i.length,speech:o?.messageId===e.id?o:void 0,submittedFeedback:a}},subscribe:e=>this._threadBinding.subscribe(e)}),this._threadBinding)}_eventSubscriptionSubjects=new Map;unstable_on(e,t){let n=this._eventSubscriptionSubjects.get(e);return n||(n=new T({event:e,binding:this._threadBinding}),this._eventSubscriptionSubjects.set(e,n)),n.subscribe(t)}}let em=e=>({mainThreadId:e.mainThreadId,newThreadId:e.newThreadId,threadIds:e.threadIds,archivedThreadIds:e.archivedThreadIds,isLoading:e.isLoading,threadItems:e.threadItems}),eb=(e,t)=>{if(void 0===t)return I;let n=e.getItemById(t);return n?{id:n.id,remoteId:n.remoteId,externalId:n.externalId,title:n.title,status:n.status,isMain:n.id===e.mainThreadId}:I};class ev{_core;_runtimeFactory;_getState;constructor(e,t=eg){this._core=e,this._runtimeFactory=t;let n=new M({path:{},getState:()=>em(e),subscribe:t=>e.subscribe(t)});this._getState=n.getState.bind(n),this._mainThreadListItemRuntime=new $(new E({path:{ref:"threadItems[main]",threadSelector:{type:"main"}},getState:()=>eb(this._core,this._core.mainThreadId),subscribe:e=>this._core.subscribe(e)}),this._core),this.main=new t(new P({path:{ref:"threads.main",threadSelector:{type:"main"}},getState:()=>e.getMainThreadRuntimeCore(),subscribe:t=>e.subscribe(t)}),this._mainThreadListItemRuntime),this.__internal_bindMethods()}__internal_bindMethods(){this.switchToThread=this.switchToThread.bind(this),this.switchToNewThread=this.switchToNewThread.bind(this),this.getLoadThreadsPromise=this.getLoadThreadsPromise.bind(this),this.getState=this.getState.bind(this),this.subscribe=this.subscribe.bind(this),this.getById=this.getById.bind(this),this.getItemById=this.getItemById.bind(this),this.getItemByIndex=this.getItemByIndex.bind(this),this.getArchivedItemByIndex=this.getArchivedItemByIndex.bind(this)}switchToThread(e){return this._core.switchToThread(e)}switchToNewThread(){return this._core.switchToNewThread()}getLoadThreadsPromise(){return this._core.getLoadThreadsPromise()}getState(){return this._getState()}subscribe(e){return this._core.subscribe(e)}_mainThreadListItemRuntime;main;get mainItem(){return this._mainThreadListItemRuntime}getById(e){return new this._runtimeFactory(new P({path:{ref:`threads[threadId=${JSON.stringify(e)}]`,threadSelector:{type:"threadId",threadId:e}},getState:()=>this._core.getThreadRuntimeCore(e),subscribe:e=>this._core.subscribe(e)}),this.mainItem)}getItemByIndex(e){return new $(new E({path:{ref:`threadItems[${e}]`,threadSelector:{type:"index",index:e}},getState:()=>eb(this._core,this._core.threadIds[e]),subscribe:e=>this._core.subscribe(e)}),this._core)}getArchivedItemByIndex(e){return new $(new E({path:{ref:`archivedThreadItems[${e}]`,threadSelector:{type:"archiveIndex",index:e}},getState:()=>eb(this._core,this._core.archivedThreadIds[e]),subscribe:e=>this._core.subscribe(e)}),this._core)}getItemById(e){return new $(new E({path:{ref:`threadItems[threadId=${e}]`,threadSelector:{type:"threadId",threadId:e}},getState:()=>eb(this._core,e),subscribe:e=>this._core.subscribe(e)}),this._core)}}class ey{_core;threads;get threadList(){return this.threads}_thread;constructor(e){this._core=e,this.threads=new ev(e.threads),this._thread=this.threads.main,this.__internal_bindMethods()}__internal_bindMethods(){this.switchToNewThread=this.switchToNewThread.bind(this),this.switchToThread=this.switchToThread.bind(this),this.registerModelContextProvider=this.registerModelContextProvider.bind(this),this.registerModelConfigProvider=this.registerModelConfigProvider.bind(this),this.reset=this.reset.bind(this)}get thread(){return this._thread}switchToNewThread(){return this._core.threads.switchToNewThread()}switchToThread(e){return this._core.threads.switchToThread(e)}registerModelContextProvider(e){return this._core.registerModelContextProvider(e)}registerModelConfigProvider(e){return this.registerModelContextProvider(e)}reset({initialMessages:e}={}){return this._core.threads.getMainThreadRuntimeCore().import(w.fromArray(e??[]))}}var ex=n(77192),ew=n(85893);let eC=(e,t,n)=>n.reduce((e,n)=>n?.(e,t)??e,e);class eS extends R{_pendingTransforms=[];_completedOptimistics=[];_baseValue;_cachedValue;constructor(e){super(),this._baseValue=e,this._cachedValue=e}
25_updateState(){this._cachedValue=this._pendingTransforms.reduce((e,t)=>eC(e,t.task,[t.loading,t.optimistic]),this._baseValue),this._notifySubscribers()}get baseValue(){return this._baseValue}get value(){return this._cachedValue}update(e){this._baseValue=e,this._updateState()}async optimisticUpdate(e){let t=e.execute(),n={...e,task:t};try{this._pendingTransforms.push(n),this._updateState();let r=await t;for(let t of(this._baseValue=eC(this._baseValue,r,[e.optimistic,e.then]),this._completedOptimistics))this._baseValue=t(this._baseValue);return e.optimistic&&this._completedOptimistics.push(e.optimistic),r}finally{let e=this._pendingTransforms.indexOf(n);e>-1&&this._pendingTransforms.splice(e,1),0===this._pendingTransforms.length&&(this._completedOptimistics.length=0),this._updateState()}}}let ek=Error("This is the empty thread, a placeholder for the main thread. You cannot perform any actions on this thread instance. This error is probably because you tried to call a thread method in your render function. Call the method inside a `useEffect` hook instead."),eI={getMessageById(){},getBranches:()=>[],switchToBranch(){throw ek},append(){throw ek},startRun(){throw ek},resumeRun(){throw ek},cancelRun(){throw ek},addToolResult(){throw ek},resumeToolCall(){throw ek},speak(){throw ek},stopSpeaking(){throw ek},connectVoice(){throw ek},disconnectVoice(){throw ek},getVoiceVolume:()=>0,subscribeVoiceVolume:()=>()=>{},muteVoice(){throw ek},unmuteVoice(){throw ek},submitFeedback(){throw ek},getModelContext:()=>({}),exportExternalState(){throw ek},importExternalState(){throw ek},unstable_loadExternalState(){throw ek},composer:{attachments:[],attachmentAccept:"*",async addAttachment(){throw ek},async removeAttachment(){throw ek},isEditing:!0,canCancel:!1,isEmpty:!0,text:"",setText(){throw ek},role:"user",setRole(){throw ek},runConfig:{},setRunConfig(){throw ek},async reset(){},async clearAttachments(){},send(){throw ek},cancel(){},dictation:void 0,startDictation(){throw ek},stopDictation(){},quote:void 0,setQuote(){throw ek},subscribe:()=>()=>{},unstable_on:()=>()=>{}},getEditComposer(){},beginEdit(){throw ek},speech:void 0,voice:void 0,capabilities:{switchToBranch:!1,switchBranchDuringRun:!1,edit:!1,reload:!1,cancel:!1,unstable_copy:!1,speech:!1,dictation:!1,voice:!1,attachments:!1,feedback:!1,queue:!1},isDisabled:!1,isLoading:!0,messages:[],state:null,suggestions:[],extras:void 0,subscribe:()=>()=>{},import(){throw ek},export:()=>({messages:[]}),reset(){throw ek},unstable_on:()=>()=>{}},eR=(e,t)=>{let n=e.threadIdMap[t];if(void 0!==n)return e.threadData[n]},e_=(e,t,n)=>{let r=eR(e,t);if(!r)return e;let{id:l,remoteId:o,status:i}=r;if(i===n)return e;let a={...e};switch(i){case"new":a.newThreadId=void 0;break;case"regular":a.threadIds=a.threadIds.filter(e=>e!==l);break;case"archived":a.archivedThreadIds=a.archivedThreadIds.filter(e=>e!==l);break;default:throw Error(`Unsupported state: ${i}`)}switch(n){case"regular":a.threadIds=[l,...a.threadIds];break;case"archived":a.archivedThreadIds=[l,...a.archivedThreadIds];break;case"deleted":a.threadData=Object.fromEntries(Object.entries(a.threadData).filter(([e])=>e!==l)),a.threadIdMap=Object.fromEntries(Object.entries(a.threadIdMap).filter(([e])=>e!==l&&e!==o));break;default:throw Error(`Unsupported state: ${n}`)}return"deleted"!==n&&(a.threadData={...a.threadData,[l]:{...r,status:n}}),a};var eE=n(31993),eM=n(1313),eP=n(87235),eT=n(58726);let eZ=({runtime:e,children:t})=>{let n=(0,eM.v)({threadListItem:(0,eT.O)({runtime:e})});return(0,ew.jsx)(eP.Nm,{value:n,children:t})};class eF extends R{useRuntimeHook;instances=new Map;useAliveThreadsKeysChanged=(0,eE.U)(()=>({}));parent;constructor(e,t){super(),this.parent=t,this.useRuntimeHook=(0,eE.U)(()=>({useRuntime:e}))}startThreadRuntime(e){return this.instances.has(e)||(this.instances.set(e,{}),this.useAliveThreadsKeysChanged.setState({},!0)),new Promise((t,n)=>{let r=()=>{let r=this.instances.get(e);if(r){if(!r.runtime)return;l(),t(r.runtime)}else l(),n(Error("Thread was deleted before runtime was started"))},l=this.subscribe(r);r()})}getThreadRuntimeCore(e){let t=this.instances.get(e);if(t)return t.runtime}stopThreadRuntime(e){this.instances.delete(e),this.useAliveThreadsKeysChanged.setState({},!0)}setRuntimeHook(e){this.useRuntimeHook.getState().useRuntime!==e&&this.useRuntimeHook.setState({useRuntime:e},!0)}_InnerActiveThreadProvider=({threadId:e})=>{let{useRuntime:t}=this.useRuntimeHook(),n=t(),l=n.thread.__internal_threadBinding,o=(0,r.useCallback)(()=>{let t=this.instances.get(e);if(!t)throw Error("Thread not found. This is a bug in assistant-ui.");t.runtime=l.getState(),this._notifySubscribers()},[e,l]),i=(0,r.useRef)(!1);i.current||o(),(0,r.useEffect)(()=>(i.current=!0,o(),l.outerSubscribe(o)),[l,o]);let a=(0,eM.v)(),s=(0,r.useRef)(void 0);return(0,r.useEffect)(()=>{let e=l.getState(),t=e.__internal_setGetInitializePromise;"function"==typeof t&&t.call(e,()=>s.current)},[l]),(0,r.useEffect)(()=>n.threads.main.unstable_on("initialize",()=>{if("new"===a.threadListItem().getState().status){s.current=a.threadListItem().initialize();let e=n.thread.unstable_on("runEnd",()=>{e(),a.threadListItem().generateTitle()})}}),[n,a]),null};_OuterActiveThreadProvider=(0,r.memo)(({threadId:e,provider:t})=>{let n=(0,r.useMemo)(()=>new ev(this.parent).getItemById(e),[e]);return(0,ew.jsx)(eZ,{runtime:n,children:(0,ew.jsx)(t,{children:(0,ew.jsx)(this._InnerActiveThreadProvider,{threadId:e})})})});__internal_RenderThreadRuntimes=({provider:e})=>(this.useAliveThreadsKeysChanged(),Array.from(this.instances.keys()).map(t=>(0,ew.jsx)(this._OuterActiveThreadProvider,{threadId:t,provider:e},t)))}let eD=((e,t=21)=>(n=t)=>{let r="",l=0|n;for(;l--;)r+=e[Math.random()*e.length|0];return r})("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",7);class eA{_state;constructor(e=null){this._state=e}get state(){return this._state}append(e){this._state=e.reduce((e,t)=>
25eA.apply(e,t),this._state)}static apply(e,t){let n=t.type;switch(n){case"set":return eA.updatePath(e,t.path,()=>t.value);case"append-text":return eA.updatePath(e,t.path,e=>{if("string"!=typeof e)throw Error(`Expected string at path [${t.path.join(", ")}]`);return e+t.value});default:throw Error(`Invalid operation type: ${n}`)}}static updatePath(e,t,n){if(0===t.length)return n(e);if("object"!=typeof(e??={}))throw Error(`Invalid path: [${t.join(", ")}]`);let[r,...l]=t;if(Array.isArray(e)){let o=Number(r);if(Number.isNaN(o))throw Error(`Expected array index at [${t.join(", ")}]`);if(o>e.length||o<0)throw Error("Insert array index out of bounds");let i=[...e];return i[o]=this.updatePath(i[o],l,n),i}let o={...e};return o[r]=this.updatePath(o[r],l,n),o}}class eO{_streamStartTime;_firstTokenTime;_totalChunks=0;_toolCallIds=new Set;constructor(){this._streamStartTime=Date.now()}recordChunk(){this._totalChunks++}recordFirstToken(){void 0===this._firstTokenTime&&(this._firstTokenTime=Date.now())}recordToolCallStart(e){this._toolCallIds.add(e)}getTiming(e,t){let n=Date.now()-this._streamStartTime,r=e&&e>0?e:t?Math.ceil(t.length/4):void 0,l=r&&n>0?r/n*1e3:void 0;return{streamStartTime:this._streamStartTime,...void 0!==this._firstTokenTime?{firstTokenTime:this._firstTokenTime-this._streamStartTime}:void 0,totalStreamTime:n,...void 0!==r?{tokenCount:r}:void 0,...void 0!==l?{tokensPerSecond:l}:void 0,totalChunks:this._totalChunks,toolCallCount:this._toolCallIds.size}}}let ez=({unstable_state:e=null}={})=>({role:"assistant",status:{type:"running"},parts:[],get content(){return this.parts},metadata:{unstable_state:e,unstable_data:[],unstable_annotations:[],steps:[],custom:{}}}),ej=(e,t,n)=>{if(0===e.parts.length)throw Error("No parts available to update.");if(1!==t.path.length)throw Error("Nested paths are not supported yet.");let r=t.path[0],l=n(e.parts[r]);return{...e,parts:[...e.parts.slice(0,r),l,...e.parts.slice(r+1)],get content(){return this.parts}}},eL=(e,t)=>{let n=t.part;if("text"===n.type||"reasoning"===n.type){let t={type:n.type,text:"",status:{type:"running"},...n.parentId&&{parentId:n.parentId}};return{...e,parts:[...e.parts,t],get content(){return this.parts}}}if("tool-call"===n.type){let t={type:"tool-call",state:"partial-call",status:{type:"running",isArgsComplete:!1},toolCallId:n.toolCallId,toolName:n.toolName,argsText:"",args:{},...n.parentId&&{parentId:n.parentId}};return{...e,parts:[...e.parts,t],get content(){return this.parts}}}if("source"===n.type){let t={type:"source",sourceType:n.sourceType,id:n.id,url:n.url,...n.title?{title:n.title}:void 0,...n.parentId&&{parentId:n.parentId}};return{...e,parts:[...e.parts,t],get content(){return this.parts}}}if("file"===n.type){let t={type:"file",mimeType:n.mimeType,data:n.data,...n.parentId&&{parentId:n.parentId}};return{...e,parts:[...e.parts,t],get content(){return this.parts}}}if("data"===n.type){let t={type:"data",name:n.name,data:n.data,...n.parentId&&{parentId:n.parentId}};return{...e,parts:[...e.parts,t],get content(){return this.parts}}}throw Error(`Unsupported part type: ${n.type}`)},eH=(e,t)=>ej(e,t,e=>{if("tool-call"!==e.type)throw Error("Last is not a tool call");return"partial-call"!==e.state?e:{...e,state:"call"}}),eB=(e,t)=>ej(e,t,e=>({...e,status:{type:"complete",reason:"unknown"}})),eN=(e,t)=>ej(e,t,e=>{if("text"===e.type||"reasoning"===e.type)return{...e,text:e.text+t.textDelta};if("tool-call"===e.type){let n=e.argsText+t.textDelta,r=s(n)??e.args;return{...e,argsText:n,args:r}}throw Error("text-delta received but part is neither text nor tool-call")}),eV=(e,t)=>ej(e,t,e=>{if("tool-call"===e.type)return{...e,state:"result",...void 0!==t.artifact?{artifact:t.artifact}:{},result:t.result,isError:t.isError??!1,...void 0!==t.messages?{messages:t.messages}:{},status:{type:"complete",reason:"stop"}};throw Error("Result chunk received but part is not a tool-call")}),e$=(e,t)=>{if(e.status?.type==="incomplete"&&e.status?.reason==="error")return e;let n=eU(t);return{...e,status:n}},eU=e=>"tool-calls"===e.finishReason?{type:"requires-action",reason:"tool-calls"}:"stop"===e.finishReason||"unknown"===e.finishReason?{type:"complete",reason:e.finishReason}:{type:"incomplete",reason:e.finishReason},eG=(e,t)=>({...e,metadata:{...e.metadata,unstable_annotations:[...e.metadata.unstable_annotations,...t.annotations]}}),eq=(e,t)=>
25({...e,metadata:{...e.metadata,unstable_data:[...e.metadata.unstable_data,...t.data]}}),eW=(e,t)=>({...e,metadata:{...e.metadata,steps:[...e.metadata.steps,{state:"started",messageId:t.messageId}]}}),eK=(e,t)=>{let n=e.metadata.steps.slice(),r=n.length-1;return n.length>0&&n[r]?.state==="started"?n[r]={...n[r],state:"finished",finishReason:t.finishReason,usage:t.usage,isContinued:t.isContinued}:n.push({state:"finished",messageId:eD(),finishReason:t.finishReason,usage:t.usage,isContinued:t.isContinued}),{...e,metadata:{...e.metadata,steps:n}}},eY=(e,t)=>({...e,status:{type:"incomplete",reason:"error",error:t.error}}),eX=(e,t)=>{let n=new eA(e.metadata.unstable_state);return n.append(t.operations),{...e,metadata:{...e.metadata,unstable_state:n.state}}},eJ=(e,t)=>{let n=0;for(let e of t.metadata.steps)"finished"===e.state&&e.usage&&(n+=e.usage.outputTokens);let r="";for(let e of t.parts)("text"===e.type||"reasoning"===e.type)&&(r+=e.text);return e.getTiming(n>0?n:void 0,r||void 0)},eQ=e=>{let t=!1;return()=>{t||(t=!0,queueMicrotask(()=>{t=!1,e()}))}};class e0 extends TransformStream{constructor({initialMessage:e,throttle:t,onError:n}={}){let r,l=e??ez(),o=new eO,i=t?eQ(()=>{r?.enqueue(l)}):()=>{r?.enqueue(l)};super({start(e){r=e},transform(e){o.recordChunk();let t=e.type;switch(t){case"part-start":l=eL(l,e),"tool-call"===e.part.type&&o.recordToolCallStart(e.part.toolCallId);break;case"tool-call-args-text-finish":l=eH(l,e);break;case"part-finish":l=eB(l,e);break;case"text-delta":l=eN(l,e),o.recordFirstToken();break;case"result":l=eV(l,e);break;case"message-finish":l=e$(l,e);break;case"annotations":l=eG(l,e);break;case"data":l=eq(l,e);break;case"step-start":l=eW(l,e);break;case"step-finish":l=eK(l,e);break;case"error":l=eY(l,e),n?.(e.error);break;case"update-state":l=eX(l,e);break;default:throw Error(`Unsupported chunk type: ${t}`)}"running"!==l.status.type&&(l={...l,metadata:{...l.metadata,timing:eJ(o,l)}}),i()},flush(e){if(l.status?.type==="running"){let t=l.parts?.some(e=>"tool-call"===e.type&&("call"===e.state||"partial-call"===e.state)&&void 0===e.result)??!1;l={...l=e$(l,{type:"message-finish",path:[],finishReason:t?"tool-calls":"unknown",usage:{inputTokens:0,outputTokens:0}}),metadata:{...l.metadata,timing:eJ(o,l)}},e.enqueue(l)}}})}}class e1{readable;constructor(e){this.readable=e,this.readable=e}static fromAssistantStream(e){return new e1(e.pipeThrough(new e0))}async unstable_result(){let e;for await(let t of this)e=t;return e||{role:"assistant",status:{type:"complete",reason:"unknown"},parts:[],content:[],metadata:{unstable_state:null,unstable_data:[],unstable_annotations:[],steps:[],custom:{}}}}[Symbol.asyncIterator](){let e=this.readable.getReader();return{async next(){let{done:t,value:n}=await e.read();return t?{done:!0,value:void 0}:{done:!1,value:n}}}}tee(){let[e,t]=this.readable.tee();return[new e1(e),new e1(t)]}}let e2=(0,r.createContext)(null),e3=({adapters:e,children:t})=>{let n=(0,r.useContext)(e2);return(0,ew.jsx)(e2.Provider,{value:{...n,...e},children:t})},e4=()=>(0,r.useContext)(e2);class e5 extends R{_options;_hookManager;_loadThreadsPromise;_mainThreadId;_state=new eS({isLoading:!0,newThreadId:void 0,threadIds:[],archivedThreadIds:[],threadIdMap:{},threadData:{}});get threadItems(){return this._state.value.threadData}getLoadThreadsPromise(){return this._loadThreadsPromise||(this._loadThreadsPromise=this._state.optimisticUpdate({execute:()=>this._options.adapter.list(),loading:e=>({...e,isLoading:!0}),then:(e,t)=>{let n=[],r=[],l={},o={};for(let e of t.threads){switch(e.status){case"regular":n.push(e.remoteId);break;case"archived":r.push(e.remoteId);break;default:{let t=e.status;throw Error(`Unsupported state: ${t}`)}}let t=e.remoteId;l[e.remoteId]=t,o[t]={id:e.remoteId,remoteId:e.remoteId,externalId:e.externalId,status:e.status,title:e.title,initializeTask:Promise.resolve({remoteId:e.remoteId,externalId:e.externalId})}}return{...e,isLoading:!1,threadIds:n,archivedThreadIds:r,threadIdMap:{...e.threadIdMap,...l},threadData:{...e.threadData,...o}}}}).catch(()=>{this._loadThreadsPromise=void 0,this._state.update({...this._state.baseValue,isLoading:!1})}).then(()=>{})),this._loadThreadsPromise}contextProvider;constructor(e,t){super(),this.contextProvider=t,this._state.subscribe(()=>this._notifySubscribers()),this._hookManager=new eF(e.runtimeHook,this),this.useProvider=(0,eE.U)(()=>({Provider:e.adapter.unstable_Provider??r.Fragment})),this.__internal_setOptions(e),this.switchToNewThread()}_initialThreadLoaded=!1;useProvider;__internal_setOptions(e){if(this._options===e)return;this._options=e;let t=e.adapter.unstable_Provider??r.Fragment;t!==this.useProvider.getState().Provider&&this.useProvider.setState({Provider:t},!0),this._hookManager.setRuntimeHook(e.runtimeHook)}__internal_load(){this.getLoadThreadsPromise();let e=this._options.threadId??this._options.initialThreadId;!this._initialThreadLoaded&&e&&(this._initialThreadLoaded=!0,this.switchToThread(e).catch(()=>{}))}get isLoading(){return this._state.value.isLoading}get threadIds(){return this._state.value.threadIds}get archivedThreadIds(){return this._state.value.archivedThreadIds}get newThreadId(){return this._state.value.newThreadId}get mainThreadId(){return this._mainThreadId}getMainThreadRuntimeCore(){return this._hookManager.getThreadRuntimeCore(this._mainThreadId)||eI}getThreadRuntimeCore(e){let t=this.getItemById(e);if(!t)throw Error("Thread not found");let n=this._hookManager.getThreadRuntimeCore(t.id);if(!n)throw Error("Thread not found");return n}getItemById(e){return eR(this._state.value,e)}async switchToThread(e){let t=this.getItemById(e);if(!t){let n=await this._options.adapter.fetch(e),r=this._state.value,l=n.remoteId,o={...r.threadData,[l]:{id:l,initializeTask:Prom
25ise.resolve({remoteId:n.remoteId,externalId:n.externalId}),remoteId:n.remoteId,externalId:n.externalId,status:n.status,title:n.title}},i={...r.threadIdMap,[n.remoteId]:l},a="regular"===n.status?[...r.threadIds,n.remoteId]:r.threadIds,s="archived"===n.status?[...r.archivedThreadIds,n.remoteId]:r.archivedThreadIds;this._state.update({...r,threadIds:a,archivedThreadIds:s,threadIdMap:i,threadData:o}),t=this.getItemById(e)}if(!t)throw Error("Thread not found");if(this._mainThreadId===t.id)return;let n=this._hookManager.startThreadRuntime(t.id);void 0!==this.mainThreadId?await n:n.then(()=>this._notifySubscribers()),"archived"===t.status&&await this.unarchive(t.id),this._mainThreadId=t.id,this._notifySubscribers()}async switchToNewThread(){for(;void 0!==this._state.baseValue.newThreadId&&void 0===this._state.value.newThreadId;)await this._state.waitForUpdate();let e=this._state.value,t=this._state.value.newThreadId;if(void 0===t){do t=`__LOCALID_${u()}`;while(e.threadIdMap[t]);let n=t;this._state.update({...e,newThreadId:t,threadIdMap:{...e.threadIdMap,[t]:n},threadData:{...e.threadData,[n]:{status:"new",id:t,remoteId:void 0,externalId:void 0,title:void 0}}})}return this.switchToThread(t)}initialize=async e=>{if(this._state.value.newThreadId!==e){let t=this.getItemById(e);if(!t)throw Error("Thread not found");if("new"===t.status)throw Error("Unexpected new state");return t.initializeTask}return this._state.optimisticUpdate({execute:()=>this._options.adapter.initialize(e),optimistic:t=>e_(t,e,"regular"),loading:(t,n)=>({...t,threadData:{...t.threadData,[e]:{...t.threadData[e],initializeTask:n}}}),then:(t,{remoteId:n,externalId:r})=>{let l=eR(t,e);return l?{...t,threadIdMap:{...t.threadIdMap,[n]:e},threadData:{...t.threadData,[e]:{...l,initializeTask:Promise.resolve({remoteId:n,externalId:r}),remoteId:n,externalId:r}}}:t}})};generateTitle=async e=>{let t=this.getItemById(e);if(!t)throw Error("Thread not found");if("new"===t.status)throw Error("Thread is not yet initialized");let{remoteId:n}=await t.initializeTask,r=this._hookManager.getThreadRuntimeCore(t.id);if(!r)return;let l=r.messages,o=await this._options.adapter.generateTitle(n,l);for await(let e of e1.fromAssistantStream(o)){let n=e.parts.filter(e=>"text"===e.type)[0]?.text,r=this._state.baseValue,l=eR(r,t.id);l&&this._state.update({...r,threadData:{...r.threadData,[l.id]:{...l,title:n}}})}};rename(e,t){let n=this.getItemById(e);if(!n)throw Error("Thread not found");if("new"===n.status)throw Error("Thread is not yet initialized");return this._state.optimisticUpdate({execute:async()=>{let{remoteId:e}=await n.initializeTask;return this._options.adapter.rename(e,t)},optimistic:n=>{let r=eR(n,e);return r?{...n,threadData:{...n.threadData,[r.id]:{...r,title:t}}}:n}})}async _ensureThreadIsNotMain(e){if(e===this.newThreadId)throw Error("Cannot ensure new thread is not main");e===this._mainThreadId&&await this.switchToNewThread()}async archive(e){let t=this.getItemById(e);if(!t)throw Error("Thread not found");if("regular"!==t.status)throw Error("Thread is not yet initialized or already archived");return await this._ensureThreadIsNotMain(t.id),this._state.optimisticUpdate({execute:async()=>{let{remoteId:e}=await t.initializeTask;return this._options.adapter.archive(e)},optimistic:e=>e_(e,t.id,"archived")})}unarchive(e){let t=this.getItemById(e);if(!t)throw Error("Thread not found");if("archived"!==t.status)throw Error("Thread is not archived");return this._state.optimisticUpdate({execute:async()=>{try{let{remoteId:e}=await t.initializeTask;return await this._options.adapter.unarchive(e)}catch(e){throw await this._ensureThreadIsNotMain(t.id),e}},optimistic:e=>e_(e,t.id,"regular")})}async delete(e){let t=this.getItemById(e);if(!t)throw Error("Thread not found");if("regular"!==t.status&&"archived"!==t.status)throw Error("Thread is not yet initialized");return await this._ensureThreadIsNotMain(t.id),this._hookManager.stopThreadRuntime(t.id),this._state.optimisticUpdate({execute:async()=>{let{remoteId:e}=await t.initializeTask;return await this._options.adapter.delete(e)},optimistic:e=>e_(e,t.id,"deleted")})}async detach(e){let t=this.getItemById(e);if(!t)throw Error("Thread not found");if("regular"!==t.status&&"archived"!==t.status)throw Error("Thread is not yet initialized");await this._ensureThreadIsNotMain(t.id),this._hookManager.stopThreadRuntime(t.id)}useBoundIds=(0,eE.U)(()=>[]);__internal_RenderComponent=()=>{let e=(0,r.useId)();(0,r.useEffect)(()=>(this.useBoundIds.setState(t=>[...t,e],!0),()=>{this.useBoundIds.setState(t=>t.filter(t=>t!==e),!0)}),[e]);let t=this.useBoundIds(),{Provider:n}=this.useProvider(),l={modelContext:this.contextProvider};return(0===t.length||t[0]===e)&&(0,ew.jsx)(e3,{adapters:l,children:(0,ew.jsx)(this._hookManager.__internal_RenderThreadRuntimes,{provider:n})})}}class e9 extends o{threads;constructor(e){super(),this.threads=new e5(e,this._contextProvider)}get RenderComponent(){return this.threads.__internal_RenderComponent}}let e6=e=>{let[t]=(0,r.useState)(()=>new e9(e));return(0,r.useEffect)(()=>{t.threads.__internal_setOptions(e),t.threads.__internal_load()},[t,e]),(0,r.useMemo)(()=>new ey(t),[t])},e8=e=>{let t=(0,r.useRef)(e.runtimeHook);t.current=e.runtimeHook;let n=(0,r.useRef)(e.threadId??e.initialThreadId),l=(0,r.useCallback)(()=>t.current(),[]),o=(0,r.useMemo)(()=>({adapter:e.adapter,allowNesting:e.allowNesting,initialThreadId:n.current,runtimeHook:l}),[e.adapter,e.allowNesting,l]);if(null!==(0,eM.v)().threadListItem.source){if(!o.allowNesting)throw Error("useRemoteThreadListRuntime cannot be nested inside another RemoteThreadListRuntime. Set allowNesting: true to allow nesting (the inner runtime will become a no-op).");return l()}let i=e6(o),a=(0,r.useRef)(e.threadId);return(0,r.useEffect)(()=>{e.threadId!==a.current&&(a.current=e.threadId,e.threadId?i.threads.switchToThread(e.threadId).catch(()=>{}):i.threads.switchToNewThread().catch(()=>{}))},[i,e.threadId]),i},e7=e=>{try{let t=e.split(".")[1];if(!t)throw Error("Invalid JWT format");let n=t.replace(/-/g,"+").replace(/_/g,"/");for(;n.length%4!=0;)n+="=";let r=atob(n),l=JSON.parse(r).exp;if(!l||"number"!=typeof l)throw Error('JWT does not contain a valid "exp" field');return 1e3*l}catch(e){throw Error(`Unable to determine the token expiry: ${e}`)}};class te{strategy="jwt";cachedToken=null;tokenExpiry=null;#e;constructor(e){this.#e=e}async getAuthHeaders(){let e=Date.now();if(this.cachedToken&&this.tokenExpiry&&this.tokenExpiry-e>3e4)return{Authorization:`Bearer ${this.cachedToken}`};let t=await this.#e();return!!t&&(this.cachedToken=t,this.tokenExpiry=e7(t),{Authorization:`Bearer ${t}`})}readAuthHeaders(e){let t=e.get("Authorization");if(!t)return;let[n,r]=t.split(" ");if("Bearer"!==n||!r)throw Error("Invalid auth header received");this.cachedToken=r,this.tokenExpiry=e7(r)}}class tt{strategy="api-key";#t;#n;#r;constructor(e,t,n){this.#t=e,this.#n=t,this.#r=n}async getAuthHeaders(){return{Authorization:`Bearer ${this.#t}`,"Aui-User-Id":this.#n,"Aui-Workspace-Id":this.#r}}readAuthHeaders(){}}let tn="aui:refresh_token";class tr{strategy="anon";baseUrl;jwtStrategy;constructor(e){this.baseUrl=e,this.jwtStrategy=new te(async()=>{let e=Date.now(),t=localStorage.getItem(tn),n=t?JSON.parse(t):void 0;if(n){if(new Date(n.expires_at).getTime()-e>3e4){let e=await fetch(`${this.baseUrl}/v1/auth/tokens/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refresh_token:n.token})});if(e.ok){let{access_token:t,refresh_token:n}=await e.json();return n&&localStorage.setItem(tn,JSON.stringify(n)),t}}else localStorage.removeItem(tn)}let r=await fetch(`${this.baseUrl}/v1/auth/tokens/anonymous`,{method:"POST"});if(!r.ok)return null;let{access_token:l,refresh_token:o}=await r.json();return l&&o?(localStorage.setItem(tn,JSON.stringify(o)),l):null})}async getAuthHeaders(){return this.jwtStrategy.getAuthHeaders()}readAuthHeaders(e){this.jwtStrategy.readAuthHeaders(e)}}
25class tl extends Error{constructor(e){super(e),this.name="APIError"}}class to{_auth;_baseUrl;constructor(e){if("authToken"in e)this._baseUrl=e.baseUrl,this._auth=new te(e.authToken);else if("apiKey"in e)this._baseUrl="https://backend.assistant-api.com",this._auth=new tt(e.apiKey,e.userId,e.workspaceId);else if("anonymous"in e)this._baseUrl=e.baseUrl,this._auth=new tr(e.baseUrl);else throw Error("Invalid configuration: Must provide authToken, apiKey, or anonymous configuration")}async initializeAuth(){return!!this._auth.getAuthHeaders()}async makeRawRequest(e,t={}){let n=await this._auth.getAuthHeaders();if(!n)throw Error("Authorization failed");let r={...n,...t.headers,"Content-Type":"application/json"},l=new URLSearchParams;if(t.query)for(let[e,n]of Object.entries(t.query))!1!==n&&(!0===n?l.set(e,"true"):l.set(e,n.toString()));let o=new URL(`${this._baseUrl}/v1${e}`);o.search=l.toString();let i=await fetch(o,{method:t.method??"GET",headers:r,body:t.body?JSON.stringify(t.body):null});if(this._auth.readAuthHeaders(i.headers),!i.ok){let e=await i.text();try{let t=JSON.parse(e);throw new tl(t.message)}catch(t){if(t instanceof tl)throw t;throw Error(`Request failed with status ${i.status}, ${e}`)}}return i}async makeRequest(e,t={}){return(await this.makeRawRequest(e,t)).json()}}class ti{cloud;constructor(e){this.cloud=e}async create(){return this.cloud.makeRequest("/auth/tokens",{method:"POST"})}}let ta={toResponse:(e,t)=>new Response(ta.toByteStream(e,t),{headers:t.headers??{}}),fromResponse:(e,t)=>ta.fromByteStream(e.body,t),toByteStream:(e,t)=>e.pipeThrough(t),fromByteStream:(e,t)=>e.pipeThrough(t)},ts=function(){let e,t;let n=new Promise((n,r)=>{e=n,t=r});if(!e||!t)throw Error("Failed to create promise");return{promise:n,resolve:e,reject:t}},tu=()=>{let e,t;let n=[],r=!1,l=l=>{l.promise||(l.promise=l.reader.read().then(({done:o,value:i})=>{l.promise=void 0,o?(n.splice(n.indexOf(l),1),r&&0===n.length&&e.close()):e.enqueue(i),t?.resolve(),t=void 0}).catch(r=>{console.error(r),n.forEach(e=>{e.reader.cancel()}),n.length=0,e.error(r),t?.reject(r),t=void 0}))};return{readable:new ReadableStream({start(t){e=t},pull:()=>
25(t=ts(),n.forEach(e=>{l(e)}),t.promise),cancel(){n.forEach(e=>{e.reader.cancel()}),n.length=0}}),isSealed:()=>r,seal(){r=!0,0===n.length&&e.close()},addStream(e){if(r)throw Error("Cannot add streams after the run callback has settled.");let t={reader:e.getReader()};n.push(t),l(t)},enqueue(e){this.addStream(new ReadableStream({start(t){t.enqueue(e),t.close()}}))}}};class tc{_controller;_isClosed=!1;constructor(e){this._controller=e}append(e){return this._controller.enqueue({type:"text-delta",path:[],textDelta:e}),this}close(){this._isClosed||(this._isClosed=!0,this._controller.enqueue({type:"part-finish",path:[]}),this._controller.close())}}let td=e=>new ReadableStream({start:t=>e.start?.(new tc(t)),pull:t=>e.pull?.(new tc(t)),cancel:t=>e.cancel?.(t)}),tp=()=>{let e;return[td({start(t){e=t}}),e]};class th{_controller;_isClosed=!1;_mergeTask;constructor(e){this._controller=e;let t=td({start:e=>{this._argsTextController=e}}),n=!1;this._mergeTask=t.pipeTo(new WritableStream({write:e=>{switch(e.type){case"text-delta":n=!0,this._controller.enqueue(e);break;case"part-finish":n||this._controller.enqueue({type:"text-delta",textDelta:"{}",path:[]}),this._controller.enqueue({type:"tool-call-args-text-finish",path:[]});break;default:throw Error(`Unexpected chunk type: ${e.type}`)}}}))}get argsText(){return this._argsTextController}_argsTextController;async setResponse(e){this._argsTextController.close(),await Promise.resolve(),this._controller.enqueue({type:"result",path:[],...void 0!==e.artifact?{artifact:e.artifact}:{},result:e.result,isError:e.isError??!1,...void 0!==e.messages?{messages:e.messages}:{}})}async close(){this._isClosed||(this._isClosed=!0,this._argsTextController.close(),await this._mergeTask,this._controller.enqueue({type:"part-finish",path:[]}),this._controller.close())}}let tf=e=>new ReadableStream({start:t=>e.start?.(new th(t)),pull:t=>e.pull?.(new th(t)),cancel:t=>e.cancel?.(t)}),tg=()=>{let e;return[tf({start(t){e=t}}),e]};class tm{value=-1;up(){return++this.value}}class tb extends TransformStream{constructor(e){super({transform(t,n){n.enqueue({...t,path:[e,...t.path]})}})}}class tv extends TransformStream{constructor(e){let t=new tm,n=new Map;super({transform(r,l){"part-start"===r.type&&0===r.path.length&&n.set(t.up(),e.up());let[o,...i]=r.path;if(void 0===o){l.enqueue(r);return}let a=n.get(o);if(void 0===a)throw Error("Path not found");l.enqueue({...r,path:[a,...i]})}})}}class ty{_state;_parentId;constructor(e){this._state=e||{merger:tu(),contentCounter:new tm}}get __internal_isClosed(){return this._state.merger.isSealed()}__internal_getReadable(){return this._state.merger.readable}__internal_subscribeToClose(e){this._state.closeSubscriber=e}_addPart(e,t){this._state.append&&(this._state.append.controller.close(),this._state.append=void 0),this.enqueue({type:"part-start",part:e,path:[]}),this._state.merger.addStream(t.pipeThrough(new tb(this._state.contentCounter.value)))}merge(e){this._state.merger.addStream(e.pipeThrough(new tv(this._state.contentCounter)))}appendText(e){this._state.append?.kind!=="text"&&(this._state.append={kind:"text",controller:this.addTextPart()}),this._state.append.controller.append(e)}appendReasoning(e){this._state.append?.kind!=="reasoning"&&(this._state.append={kind:"reasoning",controller:this.addReasoningPart()}),this._state.append.controller.append(e)}addTextPart(){let[e,t]=tp();return this._addPart({type:"text"},e),t}addReasoningPart(){let[e,t]=tp();return this._addPart({type:"reasoning"},e),t}addToolCallPart(e){let t="string"==typeof e?{toolName:e}:e,n=t.toolName,r=t.toolCallId??eD(),[l,o]=tg();return this._addPart({type:"tool-call",toolName:n,toolCallId:r,...this._parentId&&{parentId:this._parentId}},l),void 0!==t.argsText&&(o.argsText.append(t.argsText),o.argsText.close()),void 0!==t.args&&(o.argsText.append(JSON.stringify(t.args)),o.argsText.close()),void 0!==t.response&&o.setResponse(t.response),o}_finishedPartStream(){return new ReadableStream({start(e){e.enqueue({type:"part-finish",path:[]}),e.close()}})}_withParentIdOption(e){return this._parentId?{...e,parentId:this._parentId}:e}appendSource(e){this._addPart(this._withParentIdOption(e),this._finishedPartStream())}appendFile(e){this._addPart(this._withParentIdOption(e),this._finishedPartStream())}appendData(e){this._addPart(this._withParentIdOption(e),this._finishedPartStream())}enqueue(e){this._state.merger.enqueue(e),"part-start"===e.type&&0===e.path.length&&this._state.contentCounter.up()}withParentId(e){let t=new ty(this._state);return t._parentId=e,t}close(){this._state.append?.controller?.close(),this._state.merger.seal(),this._state.closeSubscriber?.()}}class tx extends TransformStream{constructor(e,t,n){let r;let[l,o]=function(){let e;let{resolve:t,promise:n}=ts();return[function(e){let t=new ty;return(async()=>{try{await e(t)}catch(e){throw t.__internal_isClosed||t.enqueue({type:"error",path:[],error:String(e)}),e}finally{t.__internal_isClosed||t.close()}})(),t.__internal_getReadable()}(r=>((e=r).__internal_subscribeToClose(t),n)),e]}();super({start:t=>(r=l.pipeTo(new WritableStream({write(e){t.enqueue(e)},abort(e){t.error(e)},close(){t.terminate()}})).catch(e=>{t.error(e)}),e.start?.(o)),transform:t=>e.transform?.(t,o),async flush(){await e.flush?.(o),o.close(),await r}},t,n)}}class tw extends TransformStream{constructor(e){super(),Object.defineProperty(this,"readable",{value:e(super.readable),writable:!1})}}
25class tC extends tw{constructor(){super(e=>{let t=new tx({transform(e,t){t.appendText(e)}});return e.pipeThrough(new TextDecoderStream).pipeThrough(t)})}}class tS{cloud;constructor(e){this.cloud=e}__internal_getAssistantOptions(e){return{api:`${this.cloud._baseUrl}/v1/runs/stream`,headers:async()=>{let e=await this.cloud._auth.getAuthHeaders();if(!e)throw Error("Authorization failed");return{...e,Accept:"text/plain"}},body:{assistant_id:e,response_format:"vercel-ai-data-stream/v1",thread_id:"unstable_todo"}}}async stream(e){let t=await this.cloud.makeRawRequest("/runs/stream",{method:"POST",headers:{Accept:"text/plain"},body:e});return ta.fromResponse(t,new tC)}async report(e){return this.cloud.makeRequest("/runs",{method:"POST",body:e})}}class tk{cloud;constructor(e){this.cloud=e}async list(e,t){return this.cloud.makeRequest(`/threads/${encodeURIComponent(e)}/messages`,{query:t})}async create(e,t){return this.cloud.makeRequest(`/threads/${encodeURIComponent(e)}/messages`,{method:"POST",body:t})}async update(e,t,n){return this.cloud.makeRequest(`/threads/${encodeURIComponent(e)}/messages/${encodeURIComponent(t)}`,{method:"PUT",body:n})}}class tI{cloud;messages;constructor(e){this.cloud=e,this.messages=new tk(e)}async list(e){return this.cloud.makeRequest("/threads",{query:e})}async get(e){return this.cloud.makeRequest(`/threads/${encodeURIComponent(e)}`)}async create(e){return this.cloud.makeRequest("/threads",{method:"POST",body:e})}async update(e,t){return this.cloud.makeRequest(`/threads/${encodeURIComponent(e)}`,{method:"PUT",body:t})}async delete(e){return this.cloud.makeRequest(`/threads/${encodeURIComponent(e)}`,{method:"DELETE"})}}class tR{cloud;constructor(e){this.cloud=e}async pdfToImages(e){return this.cloud.makeRequest("/files/pdf-to-images",{method:"POST",body:e})}async generatePresignedUploadUrl(e){return this.cloud.makeRequest("/files/attachments/generate-presigned-upload-url",{method:"POST",body:e})}}class t_{threads;auth;runs;files;telemetry;constructor(e){let t=new to(e);this.threads=new tI(t),this.auth={tokens:new ti(t)},this.runs=new tS(t),this.files=new tR(t);let n=e.telemetry;this.telemetry=!1===n?{enabled:!1}:!0===n||void 0===n?{enabled:!0}:{enabled:!1!==n.enabled,...n}}}class tE{list(){return Promise.resolve({threads:[]})}rename(){return Promise.resolve()}archive(){return Promise.resolve()}unarchive(){return Promise.resolve()}delete(){return Promise.resolve()}initialize(e){return Promise.resolve({remoteId:e,externalId:void 0})}generateTitle(){return Promise.resolve(new ReadableStream)}fetch(e){return Promise.reject(Error("Thread not found"))}}class tM{cloud;idMapping={};constructor(e){this.cloud=e}async append(e,t,n,r,l){let o=n?await this.idMapping[n]??n:null,i=this.cloud.threads.messages.create(e,{parent_id:o,format:r,content:l}).then(({message_id:e})=>(this.idMapping[t]=e,e)).catch(e=>{throw this.idMapping[t]===i&&delete this.idMapping[t],e});return this.idMapping[t]=i,i.then(()=>{})}async update(e,t,n,r){let l=await this.getRemoteId(t);l&&await this.cloud.threads.messages.update(e,l,{content:r})}isPersisted(e){return e in this.idMapping}async getRemoteId(e){let t=this.idMapping[e];if(t)return t}async load(e,t){let{messages:n}=await this.cloud.threads.messages.list(e,t?{format:t}:void 0);for(let e of n)this.idMapping[e.id]=e.id;return n}reset(){this.idMapping={}}}let tP=(e,t)=>({append:async(n,r)=>{let l=t.getId(r.message),o=t.encode(r);return e.append(n,l,r.parentId,t.format,o)},update:e.update?async(n,r,l)=>{let o=t.encode(r);return e.update(n,l,t.format,o)}:void 0,load:async n=>({messages:(await e.load(n,t.format)).filter(e=>e.format===t.format).map(e=>t.decode({id:e.id,parent_id:e.parent_id,format:e.format,content:e.content})).reverse()}),isPersisted:t=>e.isPersisted(t)});function tT(e){let t=e.content,n=p({id:e.id,createdAt:e.created_at,...t},e.id,{type:"complete",reason:"unknown"});return{parentId:e.parent_id,message:n}}let tZ=new WeakMap;class tF{cloudRef;aui;constructor(e,t){this.cloudRef=e,this.aui=t}get _persistence(){let e=this.aui.threadListItem();return tZ.has(e)||tZ.set(e,new tM(this.cloudRef.current)),tZ.get(e)}withFormat(e){let t=this,n=tP(this._persistence,e);return{async append(e){let{remoteId:r}=await t.aui.threadListItem().initialize();await n.append(r,e)},async update(e,r){let l=t.aui.threadListItem().getState().remoteId;l&&await n.update?.(l,e,r)},reportTelemetry(n,r){let l=n.map(t=>e.encode(t));t._reportRunTelemetry(e.format,l,r)},async load(){let e=t.aui.threadListItem().getState().remoteId;return e?n.load(e):{messages:[]}}}}async append({parentId:e,message:t}){let{remoteId:n}=await this.aui.threadListItem().initialize(),r=function(e){let t=e.status?.type==="running"?{type:"incomplete",reason:"cancelled"}:e.status;return{role:e.role,content:e.content.map(e=>{let t=e.type;switch(t){case"text":return{type:"text",text:e.text};case"reasoning":return{type:"reasoning",text:e.text};case"source":return{type:"source",sourceType:e.sourceType,id:e.id,url:e.url,...e.title?{title:e.title}:void 0};case"tool-call":return!function e(t,n=0){return!(n>100)&&(null===t||"string"==typeof t||"boolean"==typeof t||("number"==typeof t?!Number.isNaN(t)&&Number.isFinite(t):Array.isArray(t)?t.every(t=>e(t,n+1)):!(null==t||"object"!=typeof t||Array.isArray(t))&&Object.entries(t).every(([t,r])=>"string"==typeof t&&e(r,n+1))))}(e.result)&&console.warn(`tool-call result is not JSON! ${JSON.stringify(e)}`),{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,...JSON.stringify(e.args)===e.argsText?{args:e.args}:{argsText:e.argsText},...e.result?{result:e.result}:void 0,...e.isError?{isError:!0}:void 0};case"image":return{type:"image",image:e.image};case"file":return{type:"file",data:e.data,mimeType:e.mimeType,...e.filename?{filename:e.filename}:void 0};default:throw Error(`Message part type not supported by aui/v0: ${t}`)}}),metadata:e.metadata,...t?{status:t}:void 0}}(t);await this._persistence.append(n,t.id,e,"aui/v0",r),this.cloudRef.current.telemetry.enabled&&this._maybeReportRun(n,"aui
25/v0",r)}async load(){let e=this.aui.threadListItem().getState().remoteId;return e?{messages:(await this._persistence.load(e,"aui/v0")).filter(e=>"aui/v0"===e.format).map(tT).reverse()}:{messages:[]}}_reportRunTelemetry(e,t,n){if(!this.cloudRef.current.telemetry.enabled)return;let r=this.aui.threadListItem().getState().remoteId;if(!r)return;let l=function(e,t){if("ai-sdk/v6"===e)return function(e){let t;let n=[],r=[],l=[],o=!1,i=0,a=0,s=0,u=0,c=!1,d=!1,p=!1,h=!1;for(let f of e){if("assistant"!==f.role)continue;o=!0;let{textParts:e,toolCalls:g,stepsData:m}=tH(f.parts??[]);n.push(...e),r.push(...g),l.push(...m),f.metadata&&(t=f.metadata);let b=tV(f.metadata);b&&(null!=b.inputTokens&&(i+=b.inputTokens,c=!0),null!=b.outputTokens&&(a+=b.outputTokens,d=!0),null!=b.reasoningTokens&&(s+=b.reasoningTokens,p=!0),null!=b.cachedInputTokens&&(u+=b.cachedInputTokens,h=!0))}return o?tB(n,r,l.length,t,l,{...c?{inputTokens:i}:void 0,...d?{outputTokens:a}:void 0,...p?{reasoningTokens:s}:void 0,...h?{cachedInputTokens:u}:void 0}):null}(t);for(let n=t.length-1;n>=0;n--){let r=tj(e,t[n]);if(r)return r}return null}(e,t);l&&this._sendReport(r,l,n?.durationMs,n?.stepTimestamps)}_maybeReportRun(e,t,n){let r=tj(t,n);r&&this._sendReport(e,r)}_sendReport(e,t,n,r){let l=function(e,t){if(!t)return e;if(!e)return t.map(e=>({...e}));let n=Math.min(e.length,t.length);return e.map((e,r)=>({...e,...r<n?t[r]:void 0}))}(t.steps,r),o={thread_id:e,status:t.status,...null!=t.totalSteps?{total_steps:t.totalSteps}:void 0,...t.toolCalls?{tool_calls:t.toolCalls}:void 0,...l?{steps:l}:void 0,...null!=t.inputTokens?{input_tokens:t.inputTokens}:void 0,...null!=t.outputTokens?{output_tokens:t.outputTokens}:void 0,...null!=t.reasoningTokens?{reasoning_tokens:t.reasoningTokens}:void 0,...null!=t.cachedInputTokens?{cached_input_tokens:t.cachedInputTokens}:void 0,...null!=n?{duration_ms:n}:void 0,...null!=t.outputText?{output_text:t.outputText}:void 0,...t.metadata?{metadata:t.metadata}:void 0,...t.modelId?{model_id:t.modelId}:void 0},{beforeReport:i}=this.cloudRef.current.telemetry,a=i?i(o):o;a&&this.cloudRef.current.runs.report(a).catch(()=>{})}}function tD(e){return e.length<=5e4?e:e.slice(0,5e4)}function tA(e){if(null!=e)try{return tD(JSON.stringify(e))}catch{return}}let tO=/^[A-Za-z0-9+/]{100,}={0,2}$/;function tz(e,t,n,r,l,o){let i={tool_name:e,tool_call_id:t},a=l??tA(n);void 0!==a&&(i.tool_args=a);let s="mcp"===o?function(e){if(null!=e){try{let t="string"==typeof e?JSON.parse(e):e;if(Array.isArray(t)){let e=t.map(e=>{if(e&&"object"==typeof e&&e.type&&("image"===e.type||"audio"===e.type)&&"string"==typeof e.data&&tO.test(e.data.slice(0,200))){let t=(3*e.data.length/4/1024).toFixed(1);return{...e,data:`[${e.type}: ${t}KB]`}}return e});return tD(JSON.stringify(e))}}catch{}return tA(e)}}(r):tA(r);return void 0!==s&&(i.tool_result=s),o&&(i.tool_source=o),i}function tj(e,t){switch(e){case"aui/v0":return function(e){let t,n,r,l;if("assistant"!==e.role)return null;let o=e.content?.filter(e=>"tool-call"===e.type&&e.toolName&&e.toolCallId).map(e=>tz(e.toolName,e.toolCallId,e.args,e.result,e.argsText)),i=e.content?.filter(e=>"text"===e.type&&e.text),a=i&&i.length>0?tD(i.map(e=>e.text).join("")):void 0,s=e.metadata?.steps;if(s&&s.length>0){let e=0,o=0,i=0,a=0,u=!1,c=!1,d=!1,p=!1;for(let t of s)t.usage?.inputTokens!=null&&(e+=t.usage.inputTokens,u=!0),t.usage?.outputTokens!=null&&(o+=t.usage.outputTokens,c=!0),t.usage?.reasoningTokens!=null&&(i+=t.usage.reasoningTokens,d=!0),t.usage?.cachedInputTokens!=null&&(a+=t.usage.cachedInputTokens,p=!0);t=u?e:void 0,n=c?o:void 0,r=d?i:void 0,l=p?a:void 0}let u=e.status?.type,c=u&&tL[u]||"completed",d=e.metadata?.custom,p=e.metadata?.modelId??("string"==typeof e.metadata?.custom?.modelId?e.metadata.custom.modelId:void 0),h=s&&s.length>1?s.map(e=>({...e.usage?.inputTokens!=null?{input_tokens:e.usage.inputTokens}:void 0,...e.usage?.outputTokens!=null?{output_tokens:e.usage.outputTokens}:void 0,...e.usage?.reasoningTokens!=null?{reasoning_tokens:e.usage.reasoningTokens}:void 0,...e.usage?.cachedInputTokens!=null?{cached_input_tokens:e.usage.cachedInputTokens}:void 0})):void 0;return{status:c,...o&&o.length>0?{toolCalls:o}:void 0,...s?.length?{totalSteps:s.length}:void 0,...null!=t?{inputTokens:t}:void 0,...null!=n?{outputTokens:n}:void 0,...null!=r?{reasoningTokens:r}:void 0,...null!=l?{cachedInputTokens:l}:void 0,...null!=a?{outputText:a}:void 0,...d?{metadata:d}:void 0,...h?{steps:h}:void 0,...p?{modelId:p}:void 0}}(t);case"ai-sdk/v6":return function(e){if("assistant"!==e.role)return null;let{textParts:t,toolCalls:n,stepsData:r}=tH(e.parts??[]);return tB(t,n,r.length,e.metadata,r,tV(e.metadata))}(t);default:return null}}let tL={error:"error",incomplete:"incomplete"};function tH(e){let t=[],n=[],r=[],l=null;for(let o of e)if("step-start"===o.type)null!==l&&r.push({tool_calls:l}),l=[];else if("text"===o.type&&o.text)t.push(o.text);else if(o.toolCallId&&("tool-call"===o.type||"dynamic-tool"===o.type?!!o.toolName:o.type.startsWith("tool-")||o.type.startsWith("dynamic-tool-"))){let e=function(e){let t="dynamic-tool"===e.type||e.type.startsWith("dynamic-tool-")?"mcp":void 0;return tz(e.toolName??e.type.slice(5),e.toolCallId,e.args??e.input,e.result??e.output,void 0,t)}(o);n.push(e),null!==l&&l.push(e)}return null!==l&&r.push({tool_calls:l}),{textParts:t,toolCalls:n,stepsData:r}}function tB(e,t,n,r,l,o){let i=e.length>0,a=i?tD(e.join("")):void 0,s=function(e){if(!e)return;if("string"==typeof e.modelId)return e.modelId;let t=e.custom;if("string"==typeof t?.modelId)return t.modelId}(r),u=l&&l.length>1?l.map(e=>({...e.tool_calls.length>0?{tool_calls:e.tool_calls}:void 0})):void 0;return{status:i?"completed":"incomplete",...t.length>0?{toolCalls:t}:void 0,...n>0?{totalSteps:n}:void 0,...o?.inputTokens!=null?{inputTokens:o.inputTokens}:void 0,...o?.outputTokens!=null?{outputTokens:o.outputTokens}:void 0,...o?.reasoningTokens!=null?{reasoningTokens:o.reasoningTokens}:void 0,...o?.cachedInputTokens!=null?{cachedInputTokens:o.cachedInputTokens}:void 0,...null!=a?{outputText:a}:void 0,...r?{metadata:r}:void 0,...u?{steps:u}:void 0,...s?{modelId:s}:void 0}}function tN(e){let t=e.inputTokens??e.promptTokens,n=e.outputTokens??e.completionTokens;if(null!=t||null!=n||null!=e.reasoningTokens||null!=e.cachedInputTokens)return{...null!=t?{inputTokens:t}:void 0,...null!=n?{outputTokens:n}:void 0,...null!=e.reasoningTokens?{reasoningTokens:e.reasoningTokens}:void 0,...null!=e.cachedInputTokens?{cachedInputTokens:e.cachedInputTokens}:void 0}}function tV(e){let t=e?.usage;if(t){let e=tN(t);if(e)return e}let n=e?.steps;if(n&&n.length>0){let e=0,t=0,r=0,l=0,o=!1,i=!1,a=!1,s=!1,u=!1;for(let c of n){if(!c.usage)continue;let n=tN(c.usage);n&&(null!=n.inputTokens&&(e+=n.inputTokens,o=!0),null!=n.outputTokens&&(t+=n.outputTokens,i=!0),null!=n.reasoningTokens&&(r+=n.reasoningTokens,a=!0),null!=n.cachedInputTokens&&(l+=n.cachedInputTokens,s=!0),u=!0)}if(u)return{...o?{inputTokens:e}:void 0,...i?{outputTokens:t}:void 0,...a?{reasoningTokens:r}:void 0,...s?{cachedInputTokens:l}:void 0}}}
25let t$=e=>e.startsWith("image/")?"image":e.startsWith("text/")?"document":"file";class tU{cloud;accept="*";constructor(e){this.cloud=e}uploadedUrls=new Map;async *add({file:e}){let t=crypto.randomUUID(),n={id:t,type:t$(e.type),name:e.name,contentType:e.type,file:e,status:{type:"running",reason:"uploading",progress:0}};yield n;try{let{signedUrl:r,publicUrl:l}=await this.cloud.files.generatePresignedUploadUrl({filename:e.name});await fetch(r,{method:"PUT",body:e,headers:{"Content-Type":e.type},mode:"cors"}),this.uploadedUrls.set(t,l),n={...n,status:{type:"requires-action",reason:"composer-send"}},yield n}catch{n={...n,status:{type:"incomplete",reason:"error"}},yield n}}async remove(e){this.uploadedUrls.delete(e.id)}async send(e){let t;let n=this.uploadedUrls.get(e.id);if(!n)throw Error("Attachment not uploaded");return this.uploadedUrls.delete(e.id),t="image"===e.type?[{type:"image",image:n,filename:e.name}]:[{type:"file",data:n,mimeType:e.contentType??"",filename:e.name}],{...e,status:{type:"complete"},content:t}}}var tG=n(34155);let tq=void 0!==tG&&tG?.env?.NEXT_PUBLIC_ASSISTANT_BASE_URL,tW=tq?new t_({baseUrl:tq,anonymous:!0}):void 0,tK=e=>{let t=(0,r.useRef)(e);(0,r.useEffect)(()=>{t.current=e},[e]);let n=(0,r.useCallback)(function({children:e}){let n=function(e){let t=(0,eM.v)(),[n]=(0,r.useState)(()=>new tF(e,t));return n}({get current(){return t.current.cloud??tW}}),l=t.current.cloud??tW,o=(0,r.useMemo)(()=>new tU(l),[l]),i=(0,r.useMemo)(()=>({history:n,attachments:o}),[n,o]);return(0,ew.jsx)(e3,{adapters:i,children:e})},[]),l=e.cloud??tW;if(!l){let e=new tE;return e.initialize=async e=>{let n=await t.current.create?.();return{remoteId:e,externalId:n?.externalId}},e}return{list:async()=>{let{threads:e}=await l.threads.list();return{threads:e.map(e=>({status:e.is_archived?"archived":"regular",remoteId:e.id,title:e.title,externalId:e.external_id??void 0}))}},initialize:async()=>{let t=e.create?.()??Promise.resolve(),n=await t,r=n?n.externalId:void 0,{thread_id:o}=await l.threads.create({last_message_at:new Date,external_id:r});return{externalId:r,remoteId:o}},rename:async(e,t)=>l.threads.update(e,{title:t}),archive:async e=>l.threads.update(e,{is_archived:!0}),unarchive:async e=>l.threads.update(e,{is_archived:!1}),delete:async t=>(await e.delete?.(t),l.threads.delete(t)),generateTitle:async(e,t)=>{let n=t.map(e=>({...e,content:e.content.filter(e=>"text"===e.type||"tool-call"===e.type)}));return l.runs.stream({thread_id:e,assistant_id:"system/thread_title",messages:n})},fetch:async e=>{let t=await l.threads.get(e);return{status:t.is_archived?"archived":"regular",remoteId:t.id,title:t.title,externalId:t.external_id??void 0}},unstable_Provider:n}},tY=(e,{initialMessages:t,...n})=>{let{modelContext:l,...o}=e4()??{},i={...n,adapters:{...o,...n.adapters,chatModel:e}},[a]=(0,r.useState)(()=>new V(i,t)),s=(0,r.useRef)(void 0);return s.current=(0,ex.x)(e=>e.threadListItem.remoteId),(0,r.useEffect)(()=>{a.threads.getMainThreadRuntimeCore().__internal_setGetThreadId(()=>s.current)},[a]),(0,r.useEffect)(()=>()=>{a.threads.getMainThreadRuntimeCore().detach()},[a]),(0,r.useEffect)(()=>{a.threads.getMainThreadRuntimeCore().__internal_setOptions(i),a.threads.getMainThreadRuntimeCore().__internal_load()}),(0,r.useEffect)(()=>{if(l)return a.registerModelContextProvider(l)},[l,a]),(0,r.useMemo)(()=>new ey(a),[a])},tX=(e,{cloud:t,...n}={})=>e8({runtimeHook:function(){return tY(e,n)},adapter:tK({cloud:t}),allowNesting:!0})},61424:function(e,t,n){"use strict";n.d(t,{C:function(){return o}});var r=n(93784),l=n(70971);let o=e=>{let[,t]=(0,r.G)(e.getState);return(0,l.o)(()=>(t(e.getState()),e.subscribe(()=>{t(e.getState())})),[e]),e.getState()}},58726:function(e,t,n){"use strict";n.d(t,{O:function(){return a}});var r=n(92377),l=n(70971),o=n(37609),i=n(61424);let a=(0,r.v)(({runtime:e})=>{let t=(0,i.C)(e),n=(0,o.Oo)();return(0,l.o)(()=>{let t=[];for(let r of["switchedTo","switchedAway"]){let l=e.unstable_on(r,()=>{n(`threadListItem.${r}`,{threadId:e.getState().id})});t.push(l)}return()=>{for(let e of t)e()}},[e,n]),{getState:()=>t,switchTo:e.switchTo,rename:e.rename,archive:e.archive,unarchive:e.unarchive,delete:e.delete,generateTitle:e.generateTitle,initialize:e.initialize,detach:e.detach,__internal_getRuntime:()=>e}})},19623:function(e,t,n){"use strict";n.d(t,{L:function(){return l}});let r=e=>Array.from(e).map(e=>e.getModelContext()).sort((e,t)=>
25(t.priority??0)-(e.priority??0)).reduce((e,t)=>{if(t.system&&(e.system?e.system+=`
26
27${t.system}`:e.system=t.system),t.tools)for(let[n,r]of Object.entries(t.tools)){let t=e.tools?.[n];if(t&&t!==r)throw Error(`You tried to define a tool with the name ${n}, but it already exists.`);e.tools||(e.tools={}),e.tools[n]=r}return t.config&&(e.config={...e.config,...t.config}),t.callSettings&&(e.callSettings={...e.callSettings,...t.callSettings}),e},{});class l{_providers=new Set;getModelContext(){return r(this._providers)}registerModelContextProvider(e){this._providers.add(e);let t=e.subscribe?.(()=>{this.notifySubscribers()});return this.notifySubscribers(),()=>{this._providers.delete(e),t?.(),this.notifySubscribers()}}_subscribers=new Set;notifySubscribers(){for(let e of this._subscribers)e()}subscribe(e){return this._subscribers.add(e),()=>this._subscribers.delete(e)}}},35520:function(e,t,n){"use strict";n.d(t,{n:function(){return r}});let r=e=>e},67759:function(e,t,n){"use strict";n.d(t,{x:function(){return d}});var r=n(85893),l=n(67294),o=n(31993);let i=e=>{let t=new Map,n=()=>{let n=0;for(let e of t.values())n+=e;e(n)};return{register:()=>{let e=Symbol();return t.set(e,0),{setHeight:r=>{t.get(e)!==r&&(t.set(e,r),n())},unregister:()=>{t.delete(e),n()}}}}},a=(e={})=>{let t=new Set,n=i(e=>{a.setState({height:{...a.getState().height,viewport:e}})}),r=i(e=>{a.setState({height:{...a.getState().height,inset:e}})}),l=i(e=>{a.setState({height:{...a.getState().height,userMessage:e}})}),a=(0,o.U)(()=>({isAtBottom:!0,scrollToBottom:({behavior:e="auto"}={})=>{for(let n of t)n({behavior:e})},onScrollToBottom:e=>(t.add(e),()=>{t.delete(e)}),turnAnchor:e.turnAnchor??"bottom",height:{viewport:0,inset:0,userMessage:0},registerViewport:n.register,registerContentInset:r.register,registerUserMessageHeight:l.register}));return a};var s=n(88507),u=n(35520);let c=e=>{let t=(0,s.cC)({optional:!0}),[n]=(0,l.useState)(()=>a(e));return(0,l.useEffect)(()=>t?.getState().onScrollToBottom(()=>{n.getState().scrollToBottom()}),[t,n]),(0,l.useEffect)(()=>{if(t)return n.subscribe(e=>{t.getState().isAtBottom!==e.isAtBottom&&(0,u.n)(t).setState({isAtBottom:e.isAtBottom})})},[n,t]),(0,l.useEffect)(()=>{let t={turnAnchor:e.turnAnchor??"bottom"};n.getState().turnAnchor!==t.turnAnchor&&(0,u.n)(n).setState(t)},[n,e.turnAnchor]),n},d=({children:e,options:t={}})=>{let n=c(t),[o]=(0,l.useState)(()=>({useThreadViewport:n}));return(0,r.jsx)(s.rY.Provider,{value:o,children:e})}},88507:function(e,t,n){"use strict";n.d(t,{rY:function(){return o},EM:function(){return i},cC:function(){return a}});var r=n(67294),l=n(2367);let o=(0,r.createContext)(null),{useThreadViewport:i,useThreadViewportStore:a}=(0,l.P)(function(e){let t=(0,r.useContext)(o);if(!e?.optional&&!t)throw Error("This component must be used within ThreadPrimitive.Viewport.");return t},"useThreadViewport")},2367:function(e,t,n){"use strict";function r(e,t){function n(n){let r=e(n);return r?r[t]:null}return{[t]:function(e){let t,r=!1;"function"==typeof e?t=e:e&&"object"==typeof e&&(r=!!e.optional,t=e.selector);let l=n({optional:r});return l?t?l(t):l():null},[`${t}Store`]:n}}n.d(t,{P:function(){return r}})},3523:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(67294);let l=e=>{e.__isBound||(e.__internal_bindMethods?.(),e.__isBound=!0)},o=e=>e;function i(e){return function(t){let n,i=!1;"function"==typeof t?n=t:t&&(i=!!t.optional,n=t.selector);
27let a=e({optional:i});return a?function(e,t=o){l(e);let n=(0,r.useSyncExternalStore)(e.subscribe,()=>t(e.getState()),()=>t(e.getState()));return(0,r.useDebugValue)(n),n}(a,n):null}}},35297:function(e,t,n){"use strict";let r;n.d(t,{y:function(){return Y}});var l=n(85893),o=n(67294),i=n(1313),a=n(87235),s=n(92377),u=n(15752),c=n(70971),d=n(5375),p=n(90370),h=n(49700),f=n(5139);let g=(0,n(3632).Q)(e=>{if(void 0===e.key)throw Error("tapClientResource: Element has no key");return(0,u.f)((0,h.GE)(e))});function m(e,t){let n=(0,f.i)(()=>e().map(e=>g(e)),t),r=(0,d.$)(()=>Object.keys(n),[n]),l=(0,d.$)(()=>n.reduce((e,t,n)=>(e[t.key]=n,e),{}),[n]);return{state:(0,d.$)(()=>n.map(e=>e.state),[n]),get:e=>{if("index"in e){if(e.index<0||e.index>=r.length)throw Error(`tapClientLookup: Index ${e.index} out of bounds (length: ${r.length})`);return n[e.index].methods}let t=l[e.key];if(void 0===t)throw Error(`tapClientLookup: Key "${e.key}" not found`);return n[t].methods}}}var b=n(61424),v=n(58726),y=n(37609);let x=(0,s.v)(({runtime:e})=>{let t=(0,b.C)(e);return{getState:()=>t,remove:e.remove,__internal_getRuntime:()=>e}}),w=(0,s.v)(({runtime:e,index:t})=>{let n=(0,d.$)(()=>e.getAttachmentByIndex(t),[e,t]);return(0,u.f)(x({runtime:n}))}),C=(0,s.v)(({threadIdRef:e,messageIdRef:t,runtime:n})=>{let r=(0,b.C)(n),l=(0,y.Oo)();(0,c.o)(()=>{let r=[];for(let o of["send","attachmentAdd"]){let i=n.unstable_on(o,()=>{l(`composer.${o}`,{threadId:e.current,...t&&{messageId:t.current}})});r.push(i)}return r.push(n.unstable_on("attachmentAddError",()=>{let r=n.getState().attachments.findLast(e=>"incomplete"===e.status.type&&"error"===e.status.reason);l("composer.attachmentAddError",{threadId:e.current,...t&&{messageId:t.current},...r&&{attachmentId:r.id}})})),()=>{for(let e of r)e()}},[n,l,e,t]);let o=m(()=>r.attachments.map((e,t)=>(0,p.l)(e.id,w({runtime:n,index:t}))),[r.attachments,n]),i=(0,d.$)(()=>({text:r.text,role:r.role,attachments:o.state,runConfig:r.runConfig,isEditing:r.isEditing,canCancel:r.canCancel,attachmentAccept:r.attachmentAccept,isEmpty:r.isEmpty,type:r.type??"thread",dictation:r.dictation,quote:r.quote,queue:[]}),[r,o.state]);return{getState:()=>i,setText:n.setText,setRole:n.setRole,setRunConfig:n.setRunConfig,addAttachment:n.addAttachment,reset:n.reset,clearAttachments:n.clearAttachments,send:n.send,cancel:n.cancel,beginEdit:n.beginEdit??(()=>{throw Error("beginEdit is not supported in this runtime")}),startDictation:n.startDictation,stopDictation:n.stopDictation,setQuote:n.setQuote,attachment:e=>"id"in e?o.get({key:e.id}):o.get(e),queueItem:()=>{throw Error("Queue is not supported in this runtime")},__internal_getRuntime:()=>n}});var S=n(93784);let k=(0,s.v)(({runtime:e})=>{let t=(0,b.C)(e);return{getState:()=>t,addToolResult:t=>e.addToolResult(t),resumeToolCall:t=>e.resumeToolCall(t),__internal_getRuntime:()=>e}}),I=(0,s.v)(({runtime:e,index:t})=>{let n=(0,d.$)(()=>e.getAttachmentByIndex(t),[e,t]);return(0,u.f)(x({runtime:n}))}),R=(0,s.v)(({runtime:e,index:t})=>{let n=(0,d.$)(()=>e.getMessagePartByIndex(t),[e,t]);return(0,u.f)(k({runtime:n}))}),_=(0,s.v)(({runtime:e,threadIdRef:t})=>{let n=(0,b.C)(e),[r,l]=(0,S.G)(!1),[o,i]=(0,S.G)(!1),a=(0,d.$)(()=>({get current(){return e.getState().id}}),[e]),s=(0,h.XL)(C({runtime:e.composer,threadIdRef:t,messageIdRef:a})),u=m(()=>n.content.map((t,n)=>(0,p.l)("toolCallId"in t&&null!=t.toolCallId?`toolCallId-${t.toolCallId}`:`index-${n}`,R({runtime:e,index:n}))),[n.content,e]),c=m(()=>(n.attachments??[]).map((t,n)=>(0,p.l)(t.id,I({runtime:e,index:n}))),[n.attachments,e]),f=(0,d.$)(()=>({...n,parts:u.state,composer:s.state,isCopied:r,isHovering:o}),[n,u.state,s.state,r,o]);return{getState:()=>f,composer:()=>s.methods,reload:t=>e.reload(t),speak:()=>e.speak(),stopSpeaking:()=>e.stopSpeaking(),submitFeedback:t=>e.submitFeedback(t),switchToBranch:t=>e.switchToBranch(t),getCopyText:()=>e.unstable_getCopyText(),part:e=>"index"in e?u.get({index:e.index}):u.get({key:`toolCallId-${e.toolCallId}`}),attachment:e=>"id"in e?c.get({key:e.id}):c.get(e),setIsCopied:l,setIsHovering:i,__internal_getRuntime:()=>e}}),E=(0,s.v)(({runtime:e,id:t,threadIdRef:n})=>{let r=(0,d.$)(()=>e.getMessageById(t),[e,t]);return(0,u.f)(_({runtime:r,threadIdRef:n}))}),M=(0,s.v)(({runtime:e})=>{let t=(0,b.C)(e),n=(0,y.Oo)();(0,c.o)(()=>{let t=[];for(let r of["runStart","runEnd","initialize","modelContextUpdate"]){let l=e.unstable_on(r,()=>{n(`thread.${r}`,{threadId:e.getState()?.threadId||"unknown"})});t.push(l)}return()=>{for(let e of t)e()}},[e,n]);let r=(0,d.$)(()=>({get current(){return e.getState().threadId}}),[e]),l=(0,h.XL)(C({runtime:e.composer,threadIdRef:r})),o=m(()=>t.messages.map(t=>(0,p.l)(t.id,E({runtime:e,id:t.id,threadIdRef:r}))),[t.messages,e,r]),i=(0,d.$)(()=>({isEmpty:0===o.state.length&&!t.isLoading,isDisabled:t.isDisabled,isLoading:t.isLoading,isRunning:t.isRunning,capabilities:t.capabilities,state:t.state,suggestions:t.suggestions,extras:t.extras,speech:t.speech,voice:t.voice,composer:l.state,messages:o.state}),[t,o,l.state]);return{getState:()=>i,composer:()=>l.methods,append:e.append,startRun:e.startRun,resumeRun:e.resumeRun,unstable_resumeRun:e.resumeRun,cancelRun:e.cancelRun,getModelContext:e.getModelContext,export:e.export,import:e.import,reset:e.reset,stopSpeaking:e.stopSpeaking,connect
27Voice:e.connectVoice,disconnectVoice:e.disconnectVoice,getVoiceVolume:e.getVoiceVolume,subscribeVoiceVolume:e.subscribeVoiceVolume,muteVoice:e.muteVoice,unmuteVoice:e.unmuteVoice,message:e=>"id"in e?o.get({key:e.id}):o.get(e),__internal_getRuntime:()=>e}}),P=(0,s.v)(({runtime:e,id:t})=>{let n=(0,d.$)(()=>e.getItemById(t),[e,t]);return(0,u.f)((0,v.O)({runtime:n}))}),T=(0,s.v)(({runtime:e,__internal_assistantRuntime:t})=>{let n=(0,b.C)(e),r=(0,h.XL)(M({runtime:e.main})),l=m(()=>Object.keys(n.threadItems).map(t=>(0,p.l)(t,P({runtime:e,id:t}))),[n.threadItems,e]),o=(0,d.$)(()=>({mainThreadId:n.mainThreadId,newThreadId:n.newThreadId??null,isLoading:n.isLoading,threadIds:n.threadIds,archivedThreadIds:n.archivedThreadIds,threadItems:l.state,main:r.state}),[n,l.state,r.state]);return{getState:()=>o,thread:()=>r.methods,item:e=>{if("main"===e)return l.get({key:o.mainThreadId});if("id"in e)return l.get({key:e.id});let{index:t,archived:n=!1}=e,r=n?o.archivedThreadIds[t]:o.threadIds[t];return l.get({key:r})},switchToThread:async t=>{await e.switchToThread(t)},switchToNewThread:async()=>{await e.switchToNewThread()},getLoadThreadsPromise:()=>e.getLoadThreadsPromise(),__internal_getAssistantRuntime:()=>t}});var Z=n(35914),F=n(19623);let D=(0,s.v)(()=>{let[e]=(0,S.G)(()=>({version:2})),t=(0,d.$)(()=>new F.L,[]);return{getState:()=>e,getModelContext:()=>t.getModelContext(),subscribe:e=>t.subscribe(e),register:e=>t.registerModelContextProvider(e)}}),A=(0,s.v)(e=>({getState:()=>e})),O=(0,s.v)(e=>{let[t]=(0,S.G)(()=>({suggestions:(e??[]).map(e=>"string"==typeof e?{title:e,label:"",prompt:e}:{title:e.title,label:e.label,prompt:e.prompt})})),n=m(()=>t.suggestions.map((e,t)=>(0,p.l)(t,A(e))),[t.suggestions]);return{getState:()=>t,suggestion:({index:e})=>n.get({index:e})}}),z=(0,s.v)(e=>{let t=(0,y.GG)();return(0,c.o)(()=>e.registerModelContextProvider(t.current.modelContext()),[e,t]),(0,u.f)(T({runtime:e.threads,__internal_assistantRuntime:e}))}),j=(e,t)=>{e.thread??=(0,Z.f)({source:"threads",query:{type:"main"},get:e=>e.threads().thread("main")}),e.threadListItem??=(0,Z.f)({source:"threads",query:{type:"main"},get:e=>e.threads().item("main")}),e.composer??=(0,Z.f)({source:"thread",query:{},get:e=>e.threads().thread("main").composer()}),e.modelContext||null!==t.modelContext.source||(e.modelContext=D()),e.suggestions||null!==t.suggestions.source||(e.suggestions=O())};var L=n(89458),H=n(71770);let B=(0,s.v)(()=>{let[e,t]=(0,S.G)(()=>({renderers:{}}));return{getState:()=>e,setDataUI:(0,H.p)((e,n)=>(t(t=>({...t,renderers:{...t.renderers,[e]:[...t.renderers[e]??[],n]}})),()=>{t(t=>({...t,renderers:{...t.renderers,[e]:t.renderers[e]?.filter(e=>e!==n)??[]}}))}),[])}}),N=(0,s.v)(({toolkit:e})=>{let[t,n]=(0,S.G)(()=>({tools:{}})),r=(0,y.GG)(),l=(0,H.p)((e,t)=>(n(n=>({...n,tools:{...n.tools,[e]:[...n.tools[e]??[],t]}})),()=>{n(n=>({...n,tools:{...n.tools,[e]:n.tools[e]?.filter(e=>e!==t)??[]}}))}),[]);return(0,c.o)(()=>{if(!e)return;let t=[];for(let[n,r]of Object.entries(e))r.render&&t.push(l(n,r.render));let n=Object.entries(e).reduce((e,[t,n])=>{let{render:r,...l}=n;return e[t]=l,e},{});return t.push(r.current.modelContext().register({getModelContext:()=>({tools:n})})),()=>{t.forEach(e=>e())}},[e,l,r]),{getState:()=>t,setToolUI:l}});(0,L.W9)(N,(e,t)=>{e.modelContext||null!==t.modelContext.source||(e.modelContext=D())});let V=(0,s.v)(e=>(0,u.f)(z(e)));(0,L.W9)(V,(e,t)=>{j(e,t),e.tools||null!==t.tools.source||(e.tools=N({})),e.dataRenderers||null!==t.dataRenderers.source||(e.dataRenderers=B())});let $=e=>e._core?.RenderComponent,U=(0,o.memo)(({runtime:e,aui:t=null,children:n})=>{let r=(0,i.v)({threads:V(e)},{parent:t}),o=$(e);return(0,l.jsxs)(a.Nm,{value:r,children:[o&&(0,l.jsx)(o,{}),n]})});var G=n(67759);let q=()=>{if(r)return r;let e=()=>({apis:new Map,nextId:0,listeners:new Set});if("undefined"==typeof window)return r=e();let t=window.__ASSISTANT_UI_DEVTOOLS_HOOK__;if(t)return r=t,t;let n=e();return window.__ASSISTANT_UI_DEVTOOLS_HOOK__=n,r=n,n};class W{static MAX_EVENT_LOGS_PER_API=200;static register(e){let t=q();for(let n of t.apis.values())if(n.api===e)return()=>{};let n=t.nextId++,r=e.on?.("*",e=>{let r=t.apis.get(n);r&&(r.logs.push({time:new Date,event:e.event,data:e.payload}),r.logs.length>W.MAX_EVENT_LOGS_PER_API&&(r.logs=r.logs.slice(-W.MAX_EVENT_LOGS_PER_API)),W.notifyListeners(n))}),l=e.subscribe?.(()=>{W.notifyListeners(n)});return t.apis.set(n,{api:e,logs:[]}),W.notifyListeners(n),()=>{let e=q();e.apis.get(n)&&(r?.(),l?.(),e.apis.delete(n),W.notifyListeners(n))}}
27static notifyListeners(e){q().listeners.forEach(t=>t(e))}}n(34155);let K=()=>{let e=(0,i.v)();return(0,o.useEffect)(()=>{},[e]),null},Y=(0,o.memo)(({children:e,aui:t,runtime:n})=>(0,l.jsxs)(U,{runtime:n,aui:t??null,children:[(0,l.jsx)(K,{}),(0,l.jsx)(G.x,{children:e})]}))},88608:function(e,t,n){"use strict";n.d(t,{UD:function(){return a},tq:function(){return i}});var r=n(1313),l=n(77192),o=n(3523);function i(e){let t=(0,r.v)(),n=(0,l.x)(()=>t.message.source?t.message().__internal_getRuntime?.()??null:null);if(!n&&!e?.optional)throw Error("MessageRuntime is not available");return n}let a=(0,o.Z)(i);(0,o.Z)(e=>i(e)?.composer??null)},91210:function(e,t,n){"use strict";n.d(t,{nn:function(){return a}}),n(67294);var r=n(3523),l=n(1313),o=n(77192);function i(e){let t=(0,l.v)(),n=(0,o.x)(()=>t.thread.source?t.thread().__internal_getRuntime?.()??null:null);if(!n&&!e?.optional)throw Error("ThreadRuntime is not available");return n}let a=(0,r.Z)(i);(0,r.Z)(e=>i(e)?.composer??null)},21556:function(e,t,n){"use strict";n.d(t,{y:function(){return s}});var r=n(37189),l=n(67294),o=n(1313),i=n(77192);let a=()=>{let e=(0,o.v)(),t=(0,i.x)(e=>!e.composer.canCancel);return{cancel:(0,l.useCallback)(()=>{e.composer().cancel()},[e]),disabled:t}},s=(0,r.r)("ComposerPrimitive.Cancel",()=>{let{disabled:e,cancel:t}=a();return e?null:t})},49123:function(e,t,n){"use strict";n.d(t,{g:function(){return A}});var r=n(85893),l=n(36206),o=n(28771),i=n(35213),a=n(67294),s=n(87462),u=n(63366),c=a.useLayoutEffect,d=function(e){var t=a.useRef(e);return c(function(){t.current=e}),t},p=function(e,t){if("function"==typeof e){e(t);return}e.current=t},h=function(e,t){var n=a.useRef();return a.useCallback(function(r){e.current=r,n.current&&p(n.current,null),n.current=t,t&&p(t,r)},[t])},f={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},g=function(e){Object.keys(f).forEach(function(t){e.style.setProperty(t,f[t],"important")})},m=null,b=function(e,t){var n=e.scrollHeight;return"border-box"===t.sizingStyle.boxSizing?n+t.borderSize:n-t.paddingSize},v=function(){},y=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],x=!!document.documentElement.currentStyle,w=function(e){var t=window.getComputedStyle(e);if(null===t)return null;var n=y.reduce(function(e,n){return e[n]=t[n],e},{}),r=n.boxSizing;if(""===r)return null;x&&"border-box"===r&&(n.width=parseFloat(n.width)+parseFloat(n.borderRightWidth)+parseFloat(n.borderLeftWidth)+parseFloat(n.paddingRight)+parseFloat(n.paddingLeft)+"px");var l=parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),o=parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth);return{sizingStyle:n,paddingSize:l,borderSize:o}};function C(e,t,n){var r=d(n);a.useLayoutEffect(function(){var n=function(e){return r.current(e)};if(e)return e.addEventListener(t,n),function(){return e.removeEventListener(t,n)}},[])}var S=function(e,t){C(document.body,"reset",function(n){e.current.form===n.target&&t(n)})},k=function(e){C(window,"resize",e)},I=function(e){C(document.fonts,"loadingdone",e)},R=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],_=a.forwardRef(function(e,t){var n=e.cacheMeasurements,r=e.maxRows,l=e.minRows,o=e.onChange,i=void 0===o?v:o,c=e.onHeightChange,d=void 0===c?v:c,p=(0,u.Z)(e,R),f=void 0!==p.value,y=a.useRef(null),x=h(y,t),C=a.useRef(0),_=a.useRef(),E=function(){var e,t,o,i,a,s,u,c,p,h,f,v=y.current,x=n&&_.current?_.current:w(v);if(x){_.current=x;var S=(e=v.value||v.placeholder||"x",void 0===(t=l)&&(t=1),void 0===(o=r)&&(o=1/0),m||((m=document.createElement("textarea")).setAttribute("tabindex","-1"),m.setAttribute("aria-hidden","true"),g(m)),null===m.parentNode&&document.body.appendChild(m),i=x.paddingSize,a=x.borderSize,u=(s=x.sizingStyle).boxSizing,Object.keys(s).forEac
27h(function(e){m.style[e]=s[e]}),g(m),m.value=e,c=b(m,x),m.value=e,c=b(m,x),m.value="x",h=(p=m.scrollHeight-i)*t,"border-box"===u&&(h=h+i+a),c=Math.max(h,c),f=p*o,"border-box"===u&&(f=f+i+a),[c=Math.min(f,c),p]),k=S[0],I=S[1];C.current!==k&&(C.current=k,v.style.setProperty("height",k+"px","important"),d(k,{rowHeight:I}))}};return a.useLayoutEffect(E),S(y,function(){if(!f){var e=y.current.value;requestAnimationFrame(function(){var t=y.current;t&&e!==t.value&&E()})}}),k(E),I(E),a.createElement("textarea",(0,s.Z)({},p,{onChange:function(e){f||E(),i(e)},ref:x}))}),E=n(79698),M=n(62916),P=n(1313),T=n(77192),Z=n(28841);let F=(0,a.createContext)(null),D=()=>(0,a.useContext)(F),A=(0,a.forwardRef)(({autoFocus:e=!1,asChild:t,render:n,disabled:s,onChange:u,onKeyDown:c,onPaste:d,onSelect:p,submitOnEnter:h,submitMode:f,cancelOnEscape:g=!0,unstable_focusOnRunStart:m=!0,unstable_focusOnScrollToBottom:b=!0,unstable_focusOnThreadSwitched:v=!0,addAttachmentOnPaste:y=!0,...x},w)=>{let C=(0,P.v)(),S=D(),k=f??(!1===h?"none":"enter"),I=(0,T.x)(e=>e.composer.isEditing?e.composer.text:""),R=(0,T.x)(e=>e.thread.isDisabled||e.composer.dictation?.inputDisabled)||s,F=(0,a.useRef)(null),A=(0,o.e)(w,F);!function(e,t=globalThis?.document){let n=(0,E.W)(e);a.useEffect(()=>{let e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{if(!F.current?.contains(e.target))return;if(S){for(let t of S.getPlugins())if(t.handleKeyDown(e))return}if(!g)return;let t=C.composer();t.getState().canCancel&&(t.cancel(),e.preventDefault())});let O=async e=>{if(!y)return;let t=C.thread().getState().capabilities,n=Array.from(e.clipboardData?.files||[]);if(t.attachments&&n.length>0)try{e.preventDefault(),await Promise.all(n.map(e=>C.composer().addAttachment(e)))}catch(e){console.error("Error adding attachment:",e)}},z=e&&!R,j=(0,a.useCallback)(()=>{let e=F.current;e&&z&&(e.focus({preventScroll:!0}),e.setSelectionRange(e.value.length,e.value.length))},[z]);(0,a.useEffect)(()=>j(),[j]),(0,M.b)(()=>{"thread"===C.composer().getState().type&&b&&j()}),(0,a.useEffect)(()=>{if("thread"===C.composer().getState().type&&m)return C.on("thread.runStart",j)},[m,j,C]),(0,a.useEffect)(()=>{if("thread"===C.composer().getState().type&&v)return C.on("threadListItem.switchedTo",j)},[v,j,C]);let L={name:"input",value:I,...x,ref:A,disabled:R,onChange:(0,l.Mj)(u,e=>{if(!C.composer().getState().isEditing)return;(0,Z.A)(()=>{C.composer().setText(e.target.value)});let t=e.target.selectionStart??e.target.value.length;if(S)for(let e of S.getPlugins())e.setCursorPosition(t)}),onKeyDown:(0,l.Mj)(c,e=>{if(!R&&!e.nativeEvent.isComposing){if(S){for(let t of S.getPlugins())if(t.handleKeyDown(e))return}if("Enter"===e.key){let t=C.thread().getState(),n=t.capabilities.queue;if(e.shiftKey&&(e.ctrlKey||e.metaKey)&&n&&"none"!==k&&!C.composer().getState().isEmpty){e.preventDefault(),C.composer().send({steer:!0});return}if(e.shiftKey||t.isRunning&&!n)return;let r=!1;"ctrlEnter"===k?r=e.ctrlKey||e.metaKey:"enter"===k&&(r=!0),r&&(e.preventDefault(),F.current?.closest("form")?.requestSubmit())}}}),onSelect:(0,l.Mj)(p,e=>{let t=e.target,n=t.selectionStart??t.value.length;if(S)for(let e of S.getPlugins())e.setCursorPosition(n)}),onPaste:(0,l.Mj)(d,O)};if(n&&(0,a.isValidElement)(n)){let e=void 0!==x.children?x.children:n.props.children;return(0,r.jsx)(i.fC,{...L,children:(0,a.cloneElement)(n,void 0,e)})}let H=t?i.fC:_;return(0,r.jsx)(H,{...L})});A.displayName="ComposerPrimitive.Input"},77923:function(e,t,n){"use strict";n.d(t,{d:function(){return s}});var r=n(85893),l=n(36206),o=n(99427),i=n(67294),a=n(81756);let s=(0,i.forwardRef)(({onSubmit:e,...t},n)=>{let i=(0,a.C)();return(0,r.jsx)(o.W.form,{...t,ref:n,onSubmit:(0,l.Mj)(e,e=>{e.preventDefault(),i&&i()})})});s.displayName="ComposerPrimitive.Root"},81756:function(e,t,n){"use strict";n.d(t,{n:function(){return u},C:function(){return s}});var r=n(67294),l=n(37189),o=n(1313),i=n(77192);let a=()=>{let e=(0,o.v)(),t=(0,i.x)(e=>e.thread.isRunning&&!e.thread.capabilities.queue||!e.composer.isEditing||e.composer.isEmpty);return{send:(0,r.useCallback)(t=>{e.composer().send(t)},[e]),disabled:t}},s=()=>{let{disabled:e,send:t}=a(),n=(0,r.useCallback)(()=>t(),[t]);return e?null:n},u=(0,l.r)("ComposerPrimitive.Send",s)},22063:function(e,t,n){"use strict";n.d(t,{$:function(){return o}});var r=n(77192);let l=()=>(0,r.x)(e=>e.message.status?.type==="incomplete"&&"error"===e.message.status.reason?e.message.status.error??"An error occurred":void 0),o=({children:e})=>void 0!==l()?e:null;o.displayName="MessagePrimitive.Error"},88434:function(e,t,n){"use strict";n.d(t,{oV:function(){return eo}});var r=n(85893),l=n(67294),o=n(77192),i=n(1313),a=n(51466),s=n(35914),u=n(87235);let c=({index:e,children:t})=>{let n=(0,i.v)({part:(0,s.f)({source:"message",query:{type:"index",index:e},get:t=>t.message().part({index:e})})});return(0,r.jsx)(u.Nm,{value:n,children:t})};var d=n(92377),p=n(5375);let h=(0,d.v)(({text:e,isRunning:t})=>{let n=(0,p.$)(()=>({type:"text",text:e,status:t?{type:"running"}:{type:"complete"}}),[e,t]);return{getState:()=>n,addToolResult:()=>{throw Error("Not supported")},resumeToolCall:()=>{throw Error("Not supported")}}}),f=({text:e,isRunning:t=!1,children:n})=>{let l=(0,i.v)({part:h({text:e,isRunning:t})});return(0,r.jsx)(u.Nm,{value:l,children:n})};var g=n(93784);let m=Object.freeze({type:"complete"}),b=(0,d.v)(({parts:e,getMessagePart:t})=>{let[n,r]=(0,g.G)(!0),l=(0,p.$)(()=>{let t=e[e.length-1];return t?.status??m},[e]),o=(0,p.$)(()=>({parts:e,collapsed:n,status:l}),[e,n,l]);return{getState:()=>o,setCollapsed:r,part:t}}),v=({startIndex:e,endIndex:t,children:n})=>{let l=(0,o.x)(e=>e.message.parts).slice(e,t+1),a=(0,i.v)(),s=(0,i.v)({chainOfThought:b({parts:l,getMessagePart:({index:t})=>{if(t<0||t>=l.length)throw Error(`ChainOfThought part index ${t} is out of bounds (0..${l.length-1})`);return a.message().part({index:e+t})}})});return(0,r.jsx)(u.Nm,{value:s,children:n})},y=e=>{let t=e.message.metadata;if(t&&"object"==typeof t)return t.custom?.quote},x=e=>Symbol.iterator in e,w=e=>"entries"in e,C=(e,t)=>{let n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t
27:new Map(t.entries());if(n.size!==r.size)return!1;for(let[e,t]of n)if(!r.has(e)||!Object.is(t,r.get(e)))return!1;return!0},S=(e,t)=>{let n=e[Symbol.iterator](),r=t[Symbol.iterator](),l=n.next(),o=r.next();for(;!l.done&&!o.done;){if(!Object.is(l.value,o.value))return!1;l=n.next(),o=r.next()}return!!l.done&&!!o.done},k=e=>{let t=-1;return{startGroup:e=>{-1===t&&(t=e)},endGroup:(n,r)=>{-1!==t&&(r.push({type:e,startIndex:t,endIndex:n}),t=-1)},finalize:(n,r)=>{-1!==t&&r.push({type:e,startIndex:t,endIndex:n})}}},I=(e,t)=>{let n=[];if(t){let t=k("chainOfThoughtGroup");for(let r=0;r<e.length;r++){let l=e[r];"tool-call"===l||"reasoning"===l?t.startGroup(r):(t.endGroup(r-1,n),n.push({type:"single",index:r}))}t.finalize(e.length-1,n)}else{let t=k("toolGroup"),r=k("reasoningGroup");for(let l=0;l<e.length;l++){let o=e[l];"tool-call"===o?(r.endGroup(l-1,n),t.startGroup(l)):"reasoning"===o?(t.endGroup(l-1,n),r.startGroup(l)):(t.endGroup(l-1,n),r.endGroup(l-1,n),n.push({type:"single",index:l}))}t.finalize(e.length-1,n),r.finalize(e.length-1,n)}return n},R=e=>{let t=(0,o.x)(function(e){let t=l.useRef(void 0);return n=>{var r;let l=e(n);return Object.is(r=t.current,l)||"object"==typeof r&&null!==r&&"object"==typeof l&&null!==l&&Object.getPrototypeOf(r)===Object.getPrototypeOf(l)&&(x(r)&&x(l)?w(r)&&w(l)?C(r,l):S(r,l):C({entries:()=>Object.entries(r)},{entries:()=>Object.entries(l)}))?t.current:t.current=l}}(e=>e.message.parts.map(e=>e.type)));return(0,l.useMemo)(()=>0===t.length?[]:I(t,e),[t,e])},_=({Fallback:e,...t})=>{let n=(0,o.x)(n=>{let r=n.tools.tools[t.toolName]??e;return Array.isArray(r)?r[0]??e:r});return n?(0,r.jsx)(n,{...t}):null},E=({Fallback:e,...t})=>{let n=(0,o.x)(n=>{let r=n.dataRenderers.renderers[t.name]??e;return Array.isArray(r)?r[0]??e:r});return n?(0,r.jsx)(n,{...t}):null},M={Text:()=>null,Reasoning:()=>null,Source:()=>null,Image:()=>null,File:()=>null,Unstable_Audio:()=>null,ToolGroup:({children:e})=>e,ReasoningGroup:({children:e})=>e},P=({components:{Text:e=M.Text,Reasoning:t=M.Reasoning,Image:n=M.Image,Source:l=M.Source,File:a=M.File,Unstable_Audio:s=M.Unstable_Audio,tools:u={},data:c}={}})=>{let d=(0,i.v)(),p=(0,o.x)(e=>e.part),h=p.type;if("tool-call"===h){let e=d.part().addToolResult,t=d.part().resumeToolCall;if("Override"in u)return(0,r.jsx)(u.Override,{...p,addResult:e,resume:t});let n=u.by_name?.[p.toolName]??u.Fallback;return(0,r.jsx)(_,{...p,Fallback:n,addResult:e,resume:t})}if(p.status?.type==="requires-action")throw Error("Encountered unexpected requires-action status");switch(h){case"text":return(0,r.jsx)(e,{...p});case"reasoning":return(0,r.jsx)(t,{...p});case"source":return(0,r.jsx)(l,{...p});case"image":return(0,r.jsx)(n,{...p});case"file":return(0,r.jsx)(a,{...p});case"audio":return(0,r.jsx)(s,{...p});case"data":{let e=c?.by_name?.[p.name]??c?.Fallback;return(0,r.jsx)(E,{...p,Fallback:e})}default:return console.warn(`Unknown message part type: ${h}`),null}},T=(0,l.memo)(({index:e,components:t})=>(0,r.jsx)(c,{index:e,children:(0,r.jsx)(P,{components:t})}),(e,t)=>e.index===t.index&&e.components?.Text===t.components?.Text&&e.components?.Reasoning===t.components?.Reasoning&&e.components?.Source===t.components?.Source&&e.components?.Image===t.components?.Image&&e.components?.File===t.components?.File&&e.components?.Unstable_Audio===t.components?.Unstable_Audio&&e.components?.tools===t.components?.tools&&e.components?.data===t.components?.data&&e.components?.ToolGroup===t.components?.ToolGroup&&e.components?.ReasoningGroup===t.components?.ReasoningGroup);T.displayName="MessagePrimitive.PartByIndex";let Z=({status:e,component:t})=>(0,r.jsx)(f,{text:"",isRunning:"running"===e.type,children:(0,r.jsx)(t,{type:"text",text:"",status:e})}),F=Object.freeze({type:"complete"}),D=(0,l.memo)(({components:e})=>{let t=(0,o.x)(e=>e.message.status??F);return e?.Empty?(0,r.jsx)(e.Empty,{status:t}):"running"!==t.type?null:(0,r.jsx)(Z,{status:t,component:e?.Text??M.Text})},(e,t)=>e.components?.Empty===t.components?.Empty&&e.components?.Text===t.components?.Text),A=(0,l.memo)(({components:e,enabled:t})=>(0,o.x)(e=>{if(!t||0===e.message.parts.length)return!1;let n=e.message.parts[e.message.parts.length-1];return n?.type!=="text"&&n?.type!=="reasoning"})?(0,r.jsx)(D,{components:e}):null,(e,t)=>e.enabled===t.enabled&&e.components?.Empty===t.components?.Empty&&e.components?.Text===t.components?.Text),O=(0,l.memo)(({Quote:e})=>{let t=(0,o.x)(y);return t?(0,r.jsx)(e,{text:t.text,messageId:t.messageId}):null}),z=()=>{let e=(0,i.v)(),t=(0,o.x)(e=>e.part),n=(0,o.x)(e=>{if("tool-call"!==e.part.type)return null;let t=e.tools.tools[e.part.toolName];return Array.isArray(t)?t[0]??null:t??null});return n&&"tool-call"===t.type?(0,r.jsx)(n,{...t,addResult:e.part().addToolResult,resume:e.part().resumeToolCall}):null},j=()=>{let e=(0,o.x)(e=>e.part),t=(0,o.x)(e=>{if("data"!==e.part.type)return null;let t=e.dataRenderers.renderers[e.part.name];return Array.isArray(t)?t[0]??null:t??null});return t&&"data"===e.type?(0,r.jsx)(t,{...e}):null},L=()=>{let e=(0,o.x)(e=>e.part.type);return"tool-call"===e?(0,r.jsx)(z,{}):"data"===e?(0,r.jsx)(j,{}):null},H=({children:e})=>{let t=(0,i.v)(),n=(0,o.x)(e=>e.message.parts.length);return(0,l.useMemo)(()=>Array.from({length:n},(n,l)=>(0,r.jsx)(c,{index:l,children:(0,r.jsx)(a.g,{getItemState:e=>e.message().part({index:l}).getState(),children:n=>{let o=e({get part(){let e=n();if("tool-call"===e.type){let n=t.tools().getState().tools[e.toolName],o=Array.isArray(n)?!!n[0]:!!n,i=t.message().part({index:l});return{...e,toolUI:o?(0,r.jsx)(z,{}):null,addResult:i.addToolResult,resume:i.resumeToolCall}}if("data"===e.type){let n=t.dataRenderers().getState().renderers[e.name],l=Array.isArray(n)?!!n[0]:!!n;return{...e,dataRendererUI:l?(0,r.jsx)(j,{}):null}}return e}});return null!==o?o:(0,r.jsx)(L,{})}})},l)),[n,e])},B=({components:e,unstable_showEmptyOnNonTextEnd:t=!0,children:n})=>n?(0,r.jsx)(H,{children:n}):(0,r.jsx)(N,{components:e,unstable_showEmptyOnNonTextEnd:t});B.displayName="MessagePrimitive.Parts";let N=({components:e,unstable_showEmptyOnNonTextEnd:t})=>{let n=(0,o.x)(e=>e.message.parts.length),i=R(!!e?.ChainOfThought),a=(0,l.useMemo)(()=>0===n?(0,r.jsx)(D,{components:e}):i.map(t=>{if("single"===t.type)return(0,r.jsx)(T,{index:t.index,components:e},t.index);if("chainOfThoughtGroup"===t.type){let n=e?.ChainOfThought;return n?(0,r.jsx)(v,{startIndex:t.startIndex,endIndex:t.endIndex,children:(0,r.jsx)(n,{})},`chainOfThought-${t.startIndex}`):null}if("toolGroup"===t.type){let n=e?.ToolGroup??M.ToolGroup;return(0,r.jsx)(n,{startIndex:t.startIndex,endIndex:t.endIndex,children:Array.from({length:t.endIndex-t.startIndex+1},(n,l)=>(0,r.jsx)(T,{index:t.startIndex+l,components:e},l))},`tool-${t.startIndex}`)}{let n=e?.ReasoningGroup??M.ReasoningGroup;return(0,r.jsx)(n,{startIndex:t.startIndex,endIndex:t.endIndex,children:Array.from({length:t.endIndex-t.startIndex+1},(n,l)=>(0,r.jsx)(T,{index:t.startIndex+l,components:e},l))},`reasoning-${t.startIndex}`)}}),[i,e,n]);return(0,r.jsxs)(r.Fragment,{children:[e?.Quote&&(0,r.jsx)(O,{Quote:e.Quote}),a,(0,r.jsx)(A,{components:e,enabled:t})]})},V=()=>(0,o.x)(e=>{if("text"!==e.part.type&&"reasoning"!==e.part.type)throw Error("MessagePartText can only be used inside text or reasoning message parts.");return e.part});var $=n(79698),U=n(2367);let G=(0,l.createContext)(null),{useSmoothStatus:q,useSmoothStatusStore:W}=(0,U.P)(function(e){let t=(0,l.useContext)(G);if(!e?.optional&&!t)throw Error("This component must be used within a SmoothContextProvider.");return t},"useSmoothStatus");var K=n(35520);class Y{currentText;setText;animationFrameId=null;lastUpdateTime=Date.now();targetText="";constructor(e,t){this.currentText=e,this.setText=t}start(){null===this.animationFrameId&&(this.lastUpdateTime=Date.now(),this.animate())}stop(){null!==this.animationFrameId&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=null)}animate=()=>{let e=Date.now(),t=e-this.lastUpdateTime,n=this.targetText.length-this.currentText.length,r=Math.min(5,250/n),l=0;for(;t>=r&&l<n;)l++,t-=r;l!==n?this.animationFrameId=requestAnimationFrame(this.animate):this.animationFrameId=null,0!==l&&(this.currentText=this.targetText.slice(0,this.currentText.length+l),this.lastUpdateTime=e-t,this.setText(this.currentText))}}
27let X=Object.freeze({type:"running"}),J=(e,t=!1)=>{let{text:n}=e,r=(0,o.x)(e=>e.message.id),i=(0,l.useRef)(r),[a,s]=(0,l.useState)("running"===e.status.type?"":n),u=W({optional:!0}),c=(0,$.W)(t=>{if(s(t),u){let n=a!==t||"running"===e.status.type?X:e.status;(0,K.n)(u).setState(n,!0)}});(0,l.useEffect)(()=>{if(u){let r=t&&(a!==n||"running"===e.status.type)?X:e.status;(0,K.n)(u).setState(r,!0)}},[u,t,n,a,e.status]);let[d]=(0,l.useState)(new Y(a,c));return(0,l.useEffect)(()=>{if(!t){d.stop();return}if(i.current!==r||!n.startsWith(d.targetText)){i.current=r,"running"===e.status.type?(c(""),d.currentText="",d.targetText=n,d.start()):(c(n),d.currentText=n,d.targetText=n,d.stop());return}d.targetText=n,d.start()},[c,d,r,t,n,e.status.type]),(0,l.useEffect)(()=>()=>{d.stop()},[d]),(0,l.useMemo)(()=>t?{type:"text",text:a,status:n===a?e.status:X}:e,[t,a,e,n])},Q=(0,l.forwardRef)(({smooth:e=!0,component:t="span",...n},l)=>{let{text:o,status:i}=J(V(),e);return(0,r.jsx)(t,{"data-status":i.type,...n,ref:l,children:o})});Q.displayName="MessagePartPrimitive.Text";var ee=n(99427);let et=()=>(0,o.x)(e=>{if("image"!==e.part.type)throw Error("MessagePartImage can only be used inside image message parts.");return e.part}),en=(0,l.forwardRef)((e,t)=>{let{image:n}=et();return(0,r.jsx)(ee.W.img,{src:n,...e,ref:t})});en.displayName="MessagePartPrimitive.Image";var er=n(17469);let el={...M,Text:()=>(0,r.jsxs)("p",{style:{whiteSpace:"pre-line"},children:[(0,r.jsx)(Q,{}),(0,r.jsx)(er.I,{children:(0,r.jsx)("span",{style:{fontFamily:"revert"},children:" ●"})})]}),Image:()=>(0,r.jsx)(en,{})},eo=e=>{if("children"in e)return(0,r.jsx)(B,{children:e.children});let{components:t,...n}=e,l=t?{Text:t.Text??el.Text,Image:t.Image??el.Image,Reasoning:t.Reasoning??M.Reasoning,Source:t.Source??M.Source,File:t.File??M.File,Unstable_Audio:t.Unstable_Audio??M.Unstable_Audio,..."ChainOfThought"in t?{ChainOfThought:t.ChainOfThought}:{tools:t.tools,data:t.data,ToolGroup:t.ToolGroup??M.ToolGroup,ReasoningGroup:t.ReasoningGroup??M.ReasoningGroup},Empty:t.Empty,Quote:t.Quote}:el;return(0,r.jsx)(B,{components:l,...n})};eo.displayName="MessagePrimitive.Parts"},79217:function(e,t,n){"use strict";n.d(t,{i:function(){return v}});var r=n(85893),l=n(99427),o=n(67294),i=n(1313),a=n(77192),s=n(88143),u=n(39881),c=n(28771),d=n(88507),p=n(35213);let h=(0,o.createContext)(!1),f=(e,t)=>{let n=e.match(/^([\d.]+)(em|px|rem)$/);if(!n)return 0;let r=parseFloat(n[1]),l=n[2];return"px"===l?r:"em"===l?r*(parseFloat(getComputedStyle(t).fontSize)||16):"rem"===l?r*(parseFloat(getComputedStyle(document.documentElement).fontSize)||16):0},g=({children:e,fillClampThreshold:t="10em",fillClampOffset:n="6em"})=>{let l=(0,a.x)(e=>e.message.isLast&&"assistant"===e.message.role&&e.message.index>=1&&e.thread.messages.at(e.message.index-1)?.role==="user"),i=(0,d.cC)({optional:!0}),u=(0,o.useContext)(h),c=(0,o.useCallback)(e=>{if(!i||u)return;let r=()=>{let r=i.getState();if("top"===r.turnAnchor&&l){let{viewport:l,inset:o,userMessage:i}=r.height,a=f(t,e),s=f(n,e);e.style.minHeight=`${Math.max(0,l-o-(i<=a?i:s))}px`,e.style.flexShrink="0",e.style.transition="min-height 0s"}else e.style.minHeight="",e.style.flexShrink="",e.style.transition=""};return r(),i.subscribe(r)},[i,l,u,t,n]),g=(0,s.o)(c);return(0,r.jsx)(h.Provider,{value:!0,children:(0,r.jsx)(p.fC,{ref:g,children:e})})};g.displayName="ThreadPrimitive.ViewportSlack";let m=()=>{let e=(0,i.v)(),t=(0,a.x)(()=>e.message()),n=(0,o.useCallback)(e=>{let n=()=>{t.setIsHovering(!0)},r=()=>{t.setIsHovering(!1)};return e.addEventListener("mouseenter",n),e.addEventListener("mouseleave",r),e.matches(":hover")&&queueMicrotask(()=>t.setIsHovering(!0)),()=>{e.removeEventListener("mouseenter",n),e.removeEventListener("mouseleave",r),t.setIsHovering(!1)}},[t]);return(0,s.o)(n)},b=()=>{let e=(0,d.EM)(e=>e.turnAnchor),t=(0,d.EM)(e=>e.registerUserMessageHeight),n=(0,a.x)(t=>"top"===e&&"user"===t.message.role&&t.message.index===t.thread.messages.length-2&&t.thread.messages.at(-1)?.role==="assistant"),r=(0,o.useCallback)(e=>e.offsetHeight,[]);return(0,u.f)(n?t:null,r)},v=(0,o.forwardRef)(({fillClampThreshold:e,fillClampOffset:t,...n},o)=>{let i=m(),s=b(),u=(0,c.e)(o,i,s),d=(0,a.x)(e=>e.message.id);return(0,r.jsx)(g,{fillClampThreshold:e,fillClampOffset:t,children:(0,r.jsx)(l.W.div,{...n,ref:u,"data-message-id":d})})});v.displayName="MessagePrimitive.Root"},17469:function(e,t,n){"use strict";n.d(t,{I:function(){return l}});var r=n(77192);let l=({children:e})=>(0,r.x)(e=>"running"===e.part.status.type)?e:null;l.displayName="MessagePartPrimitive.InProgress"},59915:function(e,t,n){"use strict";n.d(t,{D:function(){return l}});var r=n(77192);let l=({children:e})=>(0,r.x)(e=>e.thread.isEmpty)?e:null;l.displayName="ThreadPrimitive.Empty"},80238:function(e,t,n){"use strict";n.d(t,{u:function(){return o}});var r=n(85893),l=n(99427);let o=(0,n(67294).forwardRef)((e,t)=>(0,r.jsx)(l.W.div,{...e,ref:t}));o.displayName="ThreadPrimitive.Root"},70981:function(e,t,n){"use strict";n.d(t,{X:function(){return i}});var r=n(37189),l=n(67294),o=n(88507);let i=(0,r.r)("ThreadPrimitive.ScrollToBottom",({behavior:e}={})=>{let t=(0,o.EM)(e=>e.isAtBottom),n=(0,o.cC)(),r=(0,l.useCallback)(()=>{n.getState().scrollToBottom({behavior:e})},[n,e]);return t?null:r},["behavior"])},79682:function(e,t,n){"use strict";n.d(t,{W:function(){return S}});var r=n(85893),l=n(28771),o=n(99427),i=n(67294);function a(){throw Error("A function wrapped in useEffectEvent can't be called during rendering.")}i.createContext(!0);let s=()=>!1;var u=n(1313),c=n(66560);let d=(e,t)=>{let n=(0,u.v)(),r=function(e){let t=i.useRef(a);return i.useInsertionEffect(()=>{t.current=e},[e]),(...e)=>(s()&&a(),(0,t.current)(...e))}(t),{scope:l,event:o}=(0,c.l)(e);(0,i.useEffect)(()=>n.on({scope:l,event:o},r),[n,l,o,r])};var p=n(79698),h=n(88143);let f=e=>{let t=(0,p.W)(e),n=(0,i.useCallback)(e=>{let n=new ResizeObserver(()=>{t()}),r=new MutationObserver(e=>{e.some(e=>"attributes"!==e.type||"style"!==e.attributeName)&&t()});return n.observe(e),r.observe(e,{childList:!0,subtree:!0,attributes:!0,characterData:!0}
27),()=>{n.disconnect(),r.disconnect()}},[t]);return(0,h.o)(n)};var g=n(62916),m=n(35520),b=n(88507);let v=({autoScroll:e,scrollToBottomOnRunStart:t=!0,scrollToBottomOnInitialize:n=!0,scrollToBottomOnThreadSwitch:r=!0})=>{let o=(0,i.useRef)(null),a=(0,b.cC)();void 0===e&&(e="top"!==a.getState().turnAnchor);let s=(0,i.useRef)(0),u=(0,i.useRef)(null),c=(0,i.useCallback)(e=>{let t=o.current;t&&(u.current=e,t.scrollTo({top:t.scrollHeight,behavior:e}))},[]),p=()=>{let e=o.current;if(!e)return;let t=a.getState().isAtBottom,n=1>Math.abs(e.scrollHeight-e.scrollTop-e.clientHeight)||e.scrollHeight<=e.clientHeight;!n&&s.current<e.scrollTop||(n&&(u.current=null),(n||null===u.current)&&n!==t&&(0,m.n)(a).setState({isAtBottom:n})),s.current=e.scrollTop},v=f(()=>{let t=u.current;t?c(t):e&&a.getState().isAtBottom&&c("instant"),p()}),y=(0,h.o)(e=>(e.addEventListener("scroll",p),()=>{e.removeEventListener("scroll",p)}));return(0,g.b)(({behavior:e})=>{c(e)}),d("thread.runStart",()=>{t&&(u.current="auto",requestAnimationFrame(()=>{c("auto")}))}),d("thread.initialize",()=>{n&&(u.current="instant",requestAnimationFrame(()=>{c("instant")}))}),d("threadListItem.switchedTo",()=>{r&&(u.current="instant",requestAnimationFrame(()=>{c("instant")}))}),(0,l.e)(v,y,o)};var y=n(67759),x=n(39881);let w=()=>{let e=(0,b.EM)(e=>e.registerViewport),t=(0,i.useCallback)(e=>e.clientHeight,[]);return(0,x.f)(e,t)},C=(0,i.forwardRef)(({autoScroll:e,scrollToBottomOnRunStart:t,scrollToBottomOnInitialize:n,scrollToBottomOnThreadSwitch:i,children:a,...s},u)=>{let c=v({autoScroll:e,scrollToBottomOnRunStart:t,scrollToBottomOnInitialize:n,scrollToBottomOnThreadSwitch:i}),d=w(),p=(0,l.e)(u,c,d);return(0,r.jsx)(o.W.div,{...s,ref:p,children:a})});C.displayName="ThreadPrimitive.ViewportScrollable";let S=(0,i.forwardRef)(({turnAnchor:e,...t},n)=>(0,r.jsx)(y.x,{options:{turnAnchor:e},children:(0,r.jsx)(C,{...t,ref:n})}));S.displayName="ThreadPrimitive.Viewport"},66926:function(e,t,n){"use strict";n.d(t,{N:function(){return u}});var r=n(85893),l=n(28771),o=n(99427),i=n(67294),a=n(39881),s=n(88507);let u=(0,i.forwardRef)((e,t)=>{let n=(0,s.EM)(e=>e.registerContentInset),u=(0,i.useCallback)(e=>{let t=parseFloat(getComputedStyle(e).marginTop)||0;return e.offsetHeight+t},[]),c=(0,a.f)(n,u),d=(0,l.e)(t,c);return(0,r.jsx)(o.W.div,{...e,ref:d})});u.displayName="ThreadPrimitive.ViewportFooter"},99427:function(e,t,n){"use strict";n.d(t,{W:function(){return h}});var r=n(85893),l=n(67294),o=n.t(l,2);n(73935);var i=n(28771),a=Symbol.for("react.lazy"),s=o[" use ".trim().toString()];function u(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===a&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var c=Symbol("radix.slottable");function d(e){return l.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===c}var p=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let n=function(e){let t=function(e){let t=l.forwardRef((e,t)=>{let{children:n,...r}=e;if(u(n)&&"function"==typeof s&&(n=s(n._payload)),l.isValidElement(n)){var o;let e,a;let s=(o=n,(e=Object.getOwnPropertyDescriptor(o.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?o.ref:(e=Object.getOwnPropertyDescriptor(o,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?o.props.ref:o.props.ref||o.ref),u=function(e,t){let n={...t};for(let r in t){let l=e[r],o=t[r];/^on[A-Z]/.test(r)?l&&o?n[r]=(...e)=>{let t=o(...e);return l(...e),t}:l&&(n[r]=l):"style"===r?n[r]={...l,...o}:"className"===r&&(n[r]=[l,o].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==l.Fragment&&(u.ref=t?(0,i.F)(t,s):s),l.cloneElement(n,u)}return l.Children.count(n)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}(e),n=l.forwardRef((e,n)=>{let{children:o,...i}=e;u(o)&&"function"==typeof s&&(o=s(o._payload));let a=l.Children.toArray(o),c=a.find(d);if(c){let e=c.props.children,o=a.map(t=>t!==c?t:l.Children.count(e)>1?l.Children.only(null):l.isValidElement(e)?e.props.children:null);return(0,r.jsx)(t,{...i,ref:n,children:l.isValidElement(e)?l.cloneElement(e,void 0,o):null})}return(0,r.jsx)(t,{...i,ref:n,children:o})});return n.displayName=`${e}.Slot`,n}(`Primitive.${t}`),o=l.forwardRef((e,l)=>{let{asChild:o,...i}=e,a=o?n:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,r.jsx)(a,{...i,ref:l})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});let h=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>
27(e[t]=function(e){let t=p[e],n=(0,l.forwardRef)(({render:e,asChild:n,children:o,...i},a)=>{if(e&&(0,l.isValidElement)(e)){let n=void 0!==o?o:e.props.children;return(0,r.jsx)(t,{asChild:!0,...i,ref:a,children:(0,l.cloneElement)(e,void 0,n)})}return(0,r.jsx)(t,{asChild:n,...i,ref:a,children:o})});return n.displayName=`Primitive.${e}`,n}(t),e),{})},37189:function(e,t,n){"use strict";n.d(t,{r:function(){return a}});var r=n(85893),l=n(67294),o=n(99427),i=n(36206);let a=(e,t,n=[])=>{let a=(0,l.forwardRef)((e,l)=>{let a={},s={};Object.keys(e).forEach(t=>{n.includes(t)?a[t]=e[t]:s[t]=e[t]});let u=t(a)??void 0;return(0,r.jsx)(o.W.button,{...s,type:"button",ref:l,disabled:s.disabled||!u,onClick:(0,i.Mj)(s.onClick,u)})});return a.displayName=e,a}},88143:function(e,t,n){"use strict";n.d(t,{o:function(){return l}});var r=n(67294);let l=e=>{let t=(0,r.useRef)(void 0);return(0,r.useCallback)(n=>{t.current&&t.current(),n&&(t.current=e(n))},[e])}},62916:function(e,t,n){"use strict";n.d(t,{b:function(){return i}});var r=n(79698),l=n(67294),o=n(88507);let i=e=>{let t=(0,r.W)(e),n=(0,o.EM)(e=>e.onScrollToBottom);(0,l.useEffect)(()=>n(t),[n,t])}},39881:function(e,t,n){"use strict";n.d(t,{f:function(){return o}});var r=n(67294),l=n(88143);let o=(e,t)=>{let n=(0,r.useCallback)(n=>{if(!e)return;let r=e(),l=()=>{let e=t?t(n):n.offsetHeight;r.setHeight(e)},o=new ResizeObserver(l);return o.observe(n),l(),()=>{o.disconnect(),r.unregister()}},[e,t]);return(0,l.o)(n)}},35914:function(e,t,n){"use strict";n.d(t,{f:function(){return r}});let r=(0,n(92377).v)(e=>null)},51466:function(e,t,n){"use strict";n.d(t,{g:function(){return s}});var r=n(67294),l=n(77192),o=n(1313);let i=e=>{let t=(0,o.v)(),n=(0,r.useRef)(void 0);return(0,l.x)(()=>(void 0===n.current&&(n.current=e(t)),n.current)),()=>(n.current=void 0,e(t))},a=Object.freeze({});function s({getItemState:e,children:t}){return u(t(i(e)))}let u=e=>{let t="object"==typeof e&&null!=e&&"type"in e?e:null,n=t?.type,l=t?.key,o="object"==typeof t?.props&&null!=t.props&&0===Object.entries(t.props).length?a:t?.props;return(0,r.useMemo)(()=>t,[n,l,o])??e}},89458:function(e,t,n){"use strict";n.d(t,{W9:function(){return l},aj:function(){return o}});let r=Symbol("assistant-ui.transform-scopes");function l(e,t){if(e[r])throw Error("transformScopes is already attached to this resource");e[r]=t}function o(e){return e[r]}},49700:function(e,t,n){"use strict";n.d(t,{GE:function(){return f},Wd:function(){return d},XL:function(){return g}});var r=n(41089),l=n(5375),o=n(15752),i=n(70971),a=n(23280),s=n(95401),u=n(3632);let c=Symbol("assistant-ui.store.getValue"),d=e=>{let t=e[c];if(!t)throw Error("Client scope contains a non-client resource. Ensure your Derived get() returns a client created with tapClientResource(), not a plain resource.");return t.getState?.()},p=new Map;class h extends s.M{outputRef;index;boundFns;cachedReceiver;constructor(e,t){super(),this.outputRef=e,this.index=t}get(e,t,n){if(t===c)return this.outputRef.current;if(t===a.$W)return this.index;let r=(0,s.F)(t,"ClientProxy");if(!1!==r)return r;let l=this.outputRef.current[t];if("function"==typeof l){this.cachedReceiver!==n&&(this.boundFns=new Map,this.cachedReceiver=n);let e=this.boundFns.get(t);if(!e){let r;e=((r=p.get(t))||(r=function(...e){if(!this||"object"!=typeof this)throw Error(`Method "${String(t)}" called without proper context. This may indicate the function was called incorrectly.`);let n=this[c];if(!n)throw Error(`Method "${String(t)}" called on invalid client proxy. Ensure you are calling this method on a valid client instance.`);let r=n[t];if(!r)throw Error(`Method "${String(t)}" is not implemented.`);if("function"!=typeof r)throw Error(`"${String(t)}" is not a function.`);return r(...e)},p.set(t,r)),r).bind(n),this.boundFns.set(t,e)}return e}return l}ownKeys(){return Object.keys(this.outputRef.current)}has(e,t){return t===c||t===a.$W||t in this.outputRef.current}}let f=(0,u.Q)(e=>{let t=(0,r.k)(null),n=(0,a.Ac)().length,s=(0,l.$)(()=>new Proxy({},new h(t,n)),[n]),u=(0,a.Bd)(s,()=>(0,o.f)(e));return t.current||(t.current=u),(0,i.o)(()=>{t.current=u}),{methods:s,state:u.getState?.(),key:e.key}}),g=e=>(0,o.f)(f(e))},66560:function(e,t,n){"use strict";n.d(t,{l:function(){return r}});let r=e=>"string"==typeof e?{scope:e.split(".")[0],event:e}:{scope:e.scope,event:e.event}},1313:function(e,t,n){"use strict";n.d(t,{v:function(){return L}});var r=n(67294),l=n(47375),o=n(86223),i=n(22196);let a=()=>
27{if(!o.y)return null;let e=(0,r.useRef)(0),t=0===e.current;return((0,r.useState)(()=>e.current++),2!==e.current)?null:t?"child":"root"};var s=n(5375),u=n(92377),c=n(28841),d=n(68566),p=n(70971),h=n(12632),f=n(41089);let g=e=>{let t=(0,d.Y)(()=>new c.q(()=>v(null)),[]),n=(0,d.Y)(()=>[],[]),r=(0,s.$)(()=>(e.key,(0,l.uX)(e.type,(0,i.Cj)(e=>{(t.isDirty||e())&&(n.push(e),t.markDirty())}))),[e.type,e.key]);(0,i.$O)(r.root,r.root.committedVersion);let a=(0,l.JH)(r,e.props),u=(0,f.k)(!1),g=(0,f.k)(e.props),m=(0,f.k)(a.output),b=(0,d.Y)(()=>new Set,[]),v=(0,h.$)(e=>{if(null===e&&((0,i.$O)(r.root,2),(0,i.$O)(r.root,1),n.forEach(e=>{o.y&&r.devStrictMode&&e(),e()}),o.y&&r.devStrictMode&&(0,l.JH)(r,g.current),e=(0,l.JH)(r,g.current)),t.isDirty)throw Error("Scheduler is dirty, this should never happen");(0,i.c8)(r.root),n.length=0,u.current&&(0,l.Fh)(r,e),t.isDirty||m.current===e.output||(m.current=e.output,b.forEach(e=>e()))});return(0,p.o)(()=>(u.current=!0,()=>{u.current=!1,(0,l.Zl)(r)}),[r]),(0,p.o)(()=>{g.current=a.props,(0,i.c8)(r.root),(0,l.Fh)(r,a),t.isDirty||m.current===a.output||(m.current=a.output,b.forEach(e=>e()))}),(0,s.$)(()=>({getValue:()=>m.current,subscribe:e=>(b.add(e),()=>b.delete(e))}),[])};var m=n(15752),b=n(5139),v=n(90370),y=n(87235),x=n(35914),w=n(89458);let C=e=>(0,s.$)(()=>e,[...Object.entries(e).flat()]),S=(e,t)=>{let{rootClients:n,derivedClients:r}=function(e,t){let n={...e},r=new Set,l=!0;for(;l;)for(let e of(l=!1,Object.values(n))){if(e.type===x.f||r.has(e.type))continue;r.add(e.type);let o=(0,w.aj)(e.type);if(o){o(n,t),l=!0;break}}let o={},i={};for(let[e,t]of Object.entries(n))t.type===x.f?i[e]=t:o[e]=t;return{rootClients:o,derivedClients:i}}(e,t);return{rootClients:C(n),derivedClients:C(r)}};var k=n(66560);let I=(0,u.v)(()=>(0,d.Y)(()=>{let e=new Map,t=new Set,n=new Set;return{on(n,r){if("*"===n)return t.add(r),()=>t.delete(r);let l=e.get(n);return l||(l=new Set,e.set(n,l)),l.add(r),()=>{l.delete(r),0===l.size&&e.delete(n)}},emit(n,r,l){let o=e.get(n);(o||0!==t.size)&&queueMicrotask(()=>{let e=[];
27if(o)for(let t of o)try{t(r,l)}catch(t){e.push(t)}if(t.size>0){let o={event:n,payload:r};for(let n of t)try{n(o,l)}catch(t){e.push(t)}}if(e.length>0){if(1===e.length)throw e[0];for(let t of e)console.error(t);throw AggregateError(e,"Errors occurred during event emission")}})},subscribe:e=>(n.add(e),()=>n.delete(e)),notifySubscribers(){for(let e of n)try{e()}catch(e){console.error("NotificationManager: subscriber callback error",e)}}}},[]));var R=n(37609),_=n(49700),E=n(23280),M=n(25082);let P=e=>(0,s.$)(()=>e,e),T=(0,u.v)(({element:e,emit:t,clientRef:n})=>{let{methods:r,state:l}=(0,R.kr)({clientRef:n,emit:t},()=>(0,_.XL)(e));return(0,s.$)(()=>({state:l,methods:r}),[r,l])}),Z=(0,u.v)(({element:e,notifications:t,clientRef:n,name:r})=>{let l=g(T({element:e,emit:t.emit,clientRef:n}));return(0,p.o)(()=>l.subscribe(t.notifySubscribers),[l,t]),(0,s.$)(()=>{let e=()=>l.getValue().methods;return Object.defineProperties(e,{source:{value:"root",writable:!1},query:{value:{},writable:!1},name:{value:r,configurable:!0}}),e},[l,r])}),F=(0,u.v)(()=>(0,s.$)(()=>({clients:[],subscribe:void 0,on:void 0}),[])),D=(0,u.v)(({clients:e,clientRef:t})=>{let n=(0,m.f)(I());(0,p.o)(()=>t.parent.subscribe(n.notifySubscribers),[t,n]);let r=P((0,b.i)(()=>Object.keys(e).map(r=>(0,v.l)(r,Z({element:e[r],notifications:n,clientRef:t,name:r}))),[e,n,t]));return(0,s.$)(()=>({clients:r,subscribe:n.subscribe,on:function(e,r){if(!this)throw Error("const { on } = useAui() is not supported. Use aui.on() instead.");let{scope:l,event:o}=(0,k.l)(e);if("*"!==l&&null===this[l].source)throw Error(`Scope "${l}" is not available. Use { scope: "*", event: "${o}" } to listen globally.`);let i=n.on(o,(e,t)=>{if("*"===l){r(e);return}let n=this[l](),o=(0,E.wb)(n);n===t[o]&&r(e)});if("*"!==l&&null===t.parent[l].source)return i;let a=t.parent.on(e,r);return()=>{i(),a()}}}),[r,n,t])}),A=(e,t,n)=>{if("source"in e&&"query"in e)return e;if(n.dep===e)return n.meta;let r=e.getMeta(t.current);return n.meta=r,n.dep=e,r},O=(0,u.v)(({element:e,clientRef:t,name:n})=>{let r=(0,h.$)(()=>e.props);return(0,s.$)(()=>{let e=()=>r().get(t.current),l={};return Object.defineProperties(e,{source:{get:()=>A(r(),t,l).source},query:{get:()=>A(r(),t,l).query},name:{value:n,configurable:!0}}),e},[t,n])}),z=(0,u.v)(({clients:e,clientRef:t})=>P((0,b.i)(()=>Object.keys(e).map(n=>(0,v.l)(n,O({element:e[n],clientRef:t,name:n}))),[e,t]))),j=(0,u.v)(({parent:e,clients:t})=>{let{rootClients:n,derivedClients:r}=S(t,e),l=(0,f.k)({parent:e,current:null}).current;(0,p.o)(()=>{l.current=a});let o=(0,m.f)(Object.keys(n).length>0?D({clients:n,clientRef:l}):F()),i=(0,m.f)(z({clients:r,clientRef:l})),a=(0,s.$)(()=>{let t=Object.create(e===y.Uf?(0,y.db)():e);for(let n of(Object.assign(t,{subscribe:o.subscribe??e.subscribe,on:o.on??e.on,[M.z7]:(0,M.CN)(t)}),o.clients))t[n.name]=n;for(let e of i)t[e.name]=e;return t},[e,o,i]);return null===l.current&&(l.current=a),a});function L(e,{parent:t}={parent:(0,y.G)()}){if(e)return function(e){let t=(0,r.useMemo)(()=>(0,i.Cj)(e=>o(e)),[]),[n,o]=(0,r.useReducer)((e,n)=>((0,i.$O)(t,e),e+(n()?1:0)),0);(0,i.$O)(t,n);let s=a(),u=(0,r.useMemo)(()=>(e.key,(0,l.uX)(e.type,t,void 0,s)),[e.type,e.key,t,s]),c=(0,l.JH)(u,e.props);return(0,r.useLayoutEffect)(()=>()=>(0,l.Zl)(u),[u]),(0,r.useLayoutEffect)(()=>{(0,i.c8)(t),(0,l.Fh)(u,c)}),c.output}(j({parent:t??y.Uf,clients:e}));if(null===t)throw Error("received null parent, this usage is not allowed");return t}},77192:function(e,t,n){"use strict";n.d(t,{x:function(){return i}});var r=n(67294),l=n(1313),o=n(25082);let i=e=>{let t=(0,l.v)(),n=(0,o.jH)(t),i=(0,r.useSyncExternalStore)(t.subscribe,()=>e(n),()=>e(n));if(i===n)throw Error("You tried to return the entire AssistantState. This is not supported due to technical limitations.");return(0,r.useDebugValue)(i),i}},95401:function(e,t,n){"use strict";n.d(t,{F:function(){return l},M:function(){return o}});let r=new Set(["$$typeof","nodeType","then"]),l=(e,t)=>e===Symbol.toStringTag?t:"symbol"==typeof e?void 0:"toJSON"===e?()=>t:!!r.has(e)&&void 0;class o{getOwnPropertyDescriptor(e,t){let n=this.get(e,t);if(void 0!==n)return{value:n,writable:!1,enumerable:!0,configurable:!1}}set(){return!1}setPrototypeOf(){return!1}defineProperty(){return!1}deleteProperty(){return!1}preventExtensions(){return!1}}},25082:function(e,t,n){"use strict";n.d(t,{CN:function(){return a},jH:function(){return s},z7:function(){return o}});var r=n(49700),l=n(95401);let o=Symbol("assistant-ui.store.proxiedAssistantState"),i=e=>"on"===e||"subscribe"===e||"symbol"==typeof e,a=e=>{class t extends l.M{get(t,n){let o=(0,l.F)(n,"AssistantState");return!1!==o?o:i(n)?void 0:(0,r.Wd)(e[n]())}ownKeys(){return Object.keys(e).filter(e=>!i(e))}has(t,n){return!i(n)&&n in e}}return new Proxy({},new t)},s=e=>e[o]},87235:function(e,t,n){"use strict";n.d(t,{G:function(){return f},Nm:function(){return g},Uf:function(){return c},db:function(){return p}});var r=n(85893),l=n(67294),o=n(25082),i=n(95401);let a=()=>()=>{},s=e=>{let t=()=>{throw Error(e)};return t.source=null,t.query=null,t};class u extends i.M{get(e,t){if("subscribe"===t||"on"===t)return a;
27if(t===o.z7)return d;let n=(0,i.F)(t,"DefaultAssistantClient");return!1!==n?n:s("You are using a component or hook that requires an AuiProvider. Wrap your component in an <AuiProvider> component.")}ownKeys(){return["subscribe","on",o.z7]}has(e,t){return"subscribe"===t||"on"===t||t===o.z7}}let c=new Proxy({},new u),d=(0,o.CN)(c),p=()=>new Proxy({},{get(e,t){let n=(0,i.F)(t,"AssistantClient");return!1!==n?n:s(`The current scope does not have a "${String(t)}" property.`)}}),h=(0,l.createContext)(c),f=()=>(0,l.useContext)(h),g=({value:e,children:t})=>(0,r.jsx)(h.Provider,{value:e,children:t})},37609:function(e,t,n){"use strict";n.d(t,{GG:function(){return u},Oo:function(){return c},kr:function(){return a}});var r=n(5386),l=n(12632),o=n(23280);let i=(0,r.NT)(null),a=(e,t)=>(0,r.JS)(i,e,t),s=()=>{let e=(0,r.bw)(i);if(!e)throw Error("AssistantTapContext is not available");return e},u=()=>s().clientRef,c=()=>{let{emit:e}=s(),t=(0,o.Ac)();return(0,l.$)((n,r)=>{e(n,r,t)})}},23280:function(e,t,n){"use strict";n.d(t,{$W:function(){return o},Ac:function(){return s},Bd:function(){return u},wb:function(){return i}});var r=n(5386),l=n(5375);let o=Symbol("assistant-ui.store.clientIndex"),i=e=>e[o],a=(0,r.NT)([]),s=()=>(0,r.bw)(a),u=(e,t)=>{let n=s(),o=(0,l.$)(()=>[...n,e],[n,e]);return(0,r.JS)(a,o,t)}},3632:function(e,t,n){"use strict";n.d(t,{Q:function(){return o}});var r=n(92377),l=n(90370);let o=e=>{let t=(0,r.v)(e);return e=>{let n=t(e);return void 0===e.key?n:(0,l.l)(e.key,n)}}},47375:function(e,t,n){"use strict";function r(e){let t=[];for(let n of e.effectTasks)try{n()}catch(e){t.push(e)}if(t.length>0){if(1===t.length)throw t[0];for(let e of t)console.error(e);throw AggregateError(t,"Errors during commit")}}function l(e){let t=[];for(let n of e.cells)if(n?.type==="effect"&&(n.deps=null,n.cleanup))try{n.cleanup?.()}catch(e){t.push(e)}finally{n.cleanup=void 0}if(t.length>0){if(1===t.length)throw t[0];for(let e of t)console.error(e);throw AggregateError(t,"Errors during cleanup")}}n.d(t,{Fh:function(){return d},uX:function(){return s},JH:function(){return c},Zl:function(){return u}});var o=n(46395),i=n(94875),a=n(86223);function s(e,t,n,r=(0,o.MC)(!1)){return{type:e,root:t,markDirty:n,devStrictMode:r,cells:[],currentIndex:0,renderContext:void 0,isFirstRender:!0,isMounted:!1,isNeverMounted:!0}}function u(e){if(!e.isMounted)throw Error("Tried to unmount a fiber that is already unmounted");e.isMounted=!1,l(e)}function c(e,t){let n={effectTasks:[],props:t,output:void 0};return(0,o.xp)(e,()=>{e.renderContext=n;try{n.output=(0,i.K)(e.type,t)}finally{e.renderContext=void 0}}),n}function d(e,t){e.isMounted=!0,a.y&&e.isNeverMounted&&"root"===e.devStrictMode&&(e.isNeverMounted=!1,r(t),l(e)),e.isNeverMounted=!1,r(t)}},5386:function(e,t,n){"use strict";n.d(t,{JS:function(){return o},NT:function(){return l},bw:function(){return i}});let r=Symbol("tap.Context"),l=e=>({[r]:e}),o=(e,t,n)=>{let l=e[r];e[r]=t;try{return n()}finally{e[r]=l}},i=e=>e[r]},94875:function(e,t,n){"use strict";function r(e,t){let n=e[l];if(!n)throw Error("ResourceElement.type is not a valid Resource");return n(t)}n.d(t,{H:function(){return l},K:function(){return r}});let l=Symbol("fnSymbol")},86223:function(e,t,n){"use strict";n.d(t,{y:function(){return r}});let r=void 0!==n(34155)&&!1},46395:function(e,t,n){"use strict";n.d(t,{MC:function(){return a},NA:function(){return i},xp:function(){return o}});var r=n(86223);let l=null;function o(e,t){e.currentIndex=0;let n=l;l=e;try{if(t(),e.isFirstRender=!1,e.cells.length!==e.currentIndex)throw Error(`Rendered ${e.currentIndex} hooks but expected ${e.cells.length}. Hooks must be called in the exact same order in every render.`)}finally{l=n}}function i(){if(!l)throw Error("No resource fiber available");return l}function a(e){return r.y?l?.devStrictMode?l.isFirstRender?"child":"root":e?"root":null:null}},22196:function(e,t,n){"use strict";n.d(t,{$O:function(){return o},Cj:function(){return r},X0:function(){return i},c8:function(){return l}});let r=e=>({version:0,committedVersion:0,dispatchUpdate:e,changelog:[],dirtyCells:[]}),l=e=>{for(let t of e.dirtyCells)t.dirty=!1,t.queue.clear(),t.current=t.workInProgress;e.committedVersion=e.version,e.changelog.length=0,e.dirtyCells.length=0},o=(e,t)=>{let n=e.version>t;
27if(e.version=t,n){for(let t of e.dirtyCells)t.dirty=!1,t.queue.clear(),t.workInProgress=t.current;if(e.dirtyCells.length=0,t===e.committedVersion)e.changelog.length=0;else{if(e.committedVersion>t)throw Error("Version is less than committed version");for(;e.committedVersion+e.changelog.length>t;)e.changelog.pop();e.changelog.forEach(e=>e()),l(e)}}},i=(e,t)=>{t.dirty||(t.dirty=!0,e.markDirty?.(),e.root.dirtyCells.push(t))}},92377:function(e,t,n){"use strict";n.d(t,{v:function(){return l}});var r=n(94875);function l(e){let t=e=>({type:t,props:e});return t[r.H]=e,t}},28841:function(e,t,n){"use strict";n.d(t,{A:function(){return s},q:function(){return l}});let r={schedulers:new Set([]),isScheduled:!1};class l{_task;_isDirty=!1;constructor(e){this._task=e}get isDirty(){return this._isDirty}markDirty(){this._isDirty=!0,r.schedulers.add(this),o()}runTask(){this._isDirty=!1,this._task()}}let o=()=>{r.isScheduled||(r.isScheduled=!0,a())},i=()=>{try{let e=[],t=0;for(let n of r.schedulers)if(r.schedulers.delete(n),n.isDirty){if(++t>50)throw Error("Maximum update depth exceeded. This can happen when a resource repeatedly calls setState inside tapEffect.");try{n.runTask()}catch(t){e.push(t)}}if(e.length>0){if(1===e.length)throw e[0];for(let t of e)console.error(t);throw AggregateError(e,"Errors occurred during flushSync")}}finally{r.schedulers.clear(),r.isScheduled=!1}},a=(()=>{if("undefined"!=typeof MessageChannel){let e=new MessageChannel;return e.port1.onmessage=i,()=>e.port2.postMessage(null)}return()=>setTimeout(i,0)})(),s=e=>{let t=r;r={schedulers:new Set([]),isScheduled:!0};try{let t=e();return i(),t}finally{r=t}}},90370:function(e,t,n){"use strict";function r(e,t){return{...t,key:e}}n.d(t,{l:function(){return r}})},71770:function(e,t,n){"use strict";n.d(t,{p:function(){return l}});var r=n(5375);let l=(e,t)=>(0,r.$)(()=>e,t)},68566:function(e,t,n){"use strict";n.d(t,{Y:function(){return l}});var r=n(93784);function l(e,t){let[n]=(0,r.G)(e);return n}},12632:function(e,t,n){"use strict";n.d(t,{$:function(){return s}});var r=n(41089),l=n(70971),o=n(86223),i=n(71770),a=n(46395);function s(e){let t=(0,r.k)(e);if((0,l.o)(()=>{t.current=e}),o.y){let e=(0,a.NA)();return(0,i.p)((...n)=>{if(e.renderContext)throw Error("tapEffectEvent cannot be called during render");return t.current(...n)},[e])}return t.current}},70971:function(e,t,n){"use strict";n.d(t,{o:function(){return i}});var r=n(75140),l=n(40432);let o=()=>({type:"effect",cleanup:void 0,deps:null});function i(e,t){let n=(0,l.z)("effect",o);if(!(t&&n.deps&&(0,r.M)(n.deps,t))){if(null!==n.deps&&!!t!=!!n.deps)throw Error("tapEffect called with and without dependencies across re-renders");(0,l.t)(()=>{let r=[];try{n.cleanup?.()}catch(e){r.push(e)}finally{n.cleanup=void 0}try{let t=e();if(void 0!==t&&"function"!=typeof t)throw Error(`An effect function must either return a cleanup function or nothing. Received: ${typeof t}`);n.cleanup=t}catch(e){r.push(e)}if(n.deps=t,r.length>0){if(1===r.length)throw r[0];for(let e of r)console.error(e);throw AggregateError(r,"Errors during commit")}})}}},5375:function(e,t,n){"use strict";n.d(t,{$:function(){return s}});var r=n(86223),l=n(46395),o=n(44277),i=n(75140);let a=()=>{throw Error("Memo reducer should not be called")},s=(e,t)=>{let n=(0,l.NA)(),[s]=(0,o.U)(a,l=>{if(l&&(0,i.M)(l.deps,t))return l;let o=e();return r.y&&n.devStrictMode&&e(),{value:o,deps:t}},null);return s.value}},44277:function(e,t,n){"use strict";n.d(t,{U:function(){return c},W:function(){return u}});var r=n(86223),l=n(46395),o=n(22196),i=n(40432);let a=(e,t)=>{if(e.renderContext)throw Error("Resource updated during render");if(e.isNeverMounted)throw Error("Resource updated before mount");e.root.dispatchUpdate(()=>{let n=t();return!!n&&(n(),e.root.changelog.push(n),!0)})};function s(e,t,n,s){let u=(0,i.z)("reducer",()=>{let t=(0,l.NA)(),i=s?s(n):n;return r.y&&t.devStrictMode&&s&&s(n),{type:"reducer",queue:new Set,dirty:!1,workInProgress:i,current:i,reducer:e,dispatch:n=>{let r={action:n,hasEagerState:!1,eagerState:void 0};a(t,()=>0===t.root.dirtyCells.length&&!r.hasEagerState&&(r.eagerState=e(u.workInProgress,n),r.hasEagerState=!0,Object.is(u.current,r.eagerState))?null:()=>{(0,o.X0)(t,u),u.queue.add(r)})}}}),c=(0,l.NA)(),d=e===u.reducer;for(let t of(u.reducer=e,u.queue))t.hasEagerState&&d||(t.eagerState=e(u.workInProgress,t.action),t.hasEagerState=!0),r.y&&c.devStrictMode&&e(u.workInProgress,t.action),u.workInProgress=t.eagerState;if(u.queue.clear(),t){let e=t(u.workInProgress);
27Object.is(e,u.workInProgress)||((0,o.X0)(c,u),u.workInProgress=e)}return[u.workInProgress,u.dispatch]}function u(e,t,n){return s(e,void 0,t,n)}function c(e,t,n,r){return s(e,t,n,r)}},41089:function(e,t,n){"use strict";n.d(t,{k:function(){return l}});var r=n(93784);function l(e){let[t]=(0,r.G)(()=>({current:e}));return t}},15752:function(e,t,n){"use strict";n.d(t,{f:function(){return s}});var r=n(70971),l=n(47375),o=n(5375),i=n(41089),a=n(46395);function s(e,t){let n=(0,a.NA)(),s=(0,i.k)(0),u=(0,o.$)(()=>(e.key,(0,l.uX)(e.type,n.root,()=>{s.current++,n.markDirty?.()})),[e.type,e.key,n]),c=t?(0,o.$)(()=>(0,l.JH)(u,e.props),[u,...t,s.current]):(0,l.JH)(u,e.props);return(0,r.o)(()=>()=>(0,l.Zl)(u),[u]),(0,r.o)(()=>{(0,l.Fh)(u,c)},[u,c]),c.output}},5139:function(e,t,n){"use strict";n.d(t,{i:function(){return c}});var r=n(70971),l=n(5375),o=n(71770),i=n(47375),a=n(68566),s=n(41089),u=n(46395);function c(e,t){let n=(0,s.k)(0),c=n.current,d=(0,a.Y)(u.NA,[]),p=(0,a.Y)(()=>()=>{n.current++,d.markDirty?.()},[]),h=(0,a.Y)(()=>new Map,[]),f=t?(0,o.p)(e,t):e,g=(0,l.$)(()=>{let e=f(),t=new Set,n=[],r=0;for(let l=0;l<e.length;l++){let o=e[l],a=o.key;if(void 0===a)throw Error(`tapResources did not provide a key for array at index ${l}`);if(t.has(a))throw Error(`Duplicate key ${a} in tapResources`);t.add(a);let s=h.get(a);if(s){if(s.fiber.type!==o.type){let e=(0,i.uX)(o.type,d.root,p),t=(0,i.JH)(e,o.props);s.next=[e,t],n.push(t.output)}else s.next=(0,i.JH)(s.fiber,o.props),n.push(s.next.output)}else{let e=(0,i.uX)(o.type,d.root,p),t=(0,i.JH)(e,o.props);s={fiber:e,next:t},r++,h.set(a,s),n.push(t.output)}}if(h.size>n.length-r)for(let e of h.keys())t.has(e)||(h.get(e).next="delete");return n},[f,c]);return(0,r.o)(()=>()=>{for(let e of h.keys()){let t=h.get(e).fiber;(0,i.Zl)(t)}},[]),(0,r.o)(()=>{for(let[e,t]of h.entries())"delete"===t.next?(t.fiber.isMounted&&(0,i.Zl)(t.fiber),h.delete(e)):Array.isArray(t.next)?((0,i.Zl)(t.fiber),t.fiber=t.next[0],(0,i.Fh)(t.fiber,t.next[1])):(0,i.Fh)(t.fiber,t.next)},[g]),g}},93784:function(e,t,n){"use strict";n.d(t,{G:function(){return i}});var r=n(44277);let l=(e,t)=>"function"==typeof t?t(e):t,o=e=>"function"==typeof e?e():e;function i(e){return(0,r.W)(l,e,o)}},75140:function(e,t,n){"use strict";n.d(t,{M:function(){return r}});let r=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}},40432:function(e,t,n){"use strict";n.d(t,{t:function(){return o},z:function(){return l}});var r=n(46395);let l=(e,t)=>{let n=(0,r.NA)(),l=n.currentIndex++;if(!n.isFirstRender&&l>=n.cells.length)throw Error("Rendered more hooks than during the previous render. Hooks must be called in the exact same order in every render.");let o=n.cells[l];if(o||(o=t(),n.cells[l]=o),o.type!==e)throw Error("Hook order changed between renders");return o},o=e=>{(0,r.NA)().renderContext.effectTasks.push(e)}},22316:function(e,t,n){"use strict";t.Z=function(){for(var e,t,n=0,r="",l=arguments.length;n<l;n++)(e=arguments[n])&&(t=function e(t){var n,r,l="";if("string"==typeof t||"number"==typeof t)l+=t;else if("object"==typeof t){if(Array.isArray(t)){var o=t.length;for(n=0;n<o;n++)t[n]&&(r=e(t[n]))&&(l&&(l+=" "),l+=r)}else for(r in t)t[r]&&(l&&(l+=" "),l+=r)}return l}(e))&&(r&&(r+=" "),r+=t);return r}},36206:function(e,t,n){"use strict";function r(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}n.d(t,{Mj:function(){return r}}),"undefined"!=typeof window&&window.document&&window.document.createElement},28771:function(e,t,n){"use strict";n.d(t,{F:function(){return o},e:function(){return i}});var r=n(67294);function l(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function o(...e){return t=>{let n=!1,r=e.map(e=>{let r=l(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];"function"==typeof n?n():l(e[t],null)}}}}function i(...e){return r.useCallback(o(...e),e)}},79698:function(e,t,n){"use strict";n.d(t,{W:function(){return l}});var r=n(67294);function l(e){let t=r.useRef(e);return r.useEffect(()=>{t.current=e}),r.useMemo(()=>(...e)=>t.current?.(...e),[])}},24345:function(e,t,n){"use strict";function r(){}function l(){}n.d(t,{ok:function(){return r},t1:function(){return l}})},27962:function(e,t,n){"use strict";n.d(t,{B:function(){return l}});let r={};function l(e,t){let n=t||r;return o(e,"boolean"!=typeof n.includeImageAlt||n.includeImageAlt,"boolean"!=typeof n.includeHtml||n.includeHtml)}function o(e,t,n){if(e&&"object"==typeof e){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return i(e.children,t,n)}return Array.isArray(e)?i(e,t,n):""}function i(e,t,n){let r=[],l=-1;for(;++l<e.length;)r[l]=o(e[l],t,n);return r.join("")}},23402:function(e,t,n){"use strict";n.d(t,{w:function(){return o}});var r=n(42761),l=n(15459);let o={partial:!0,tokenize:function(e,t,n){return function(t){return(0,l.xz)(t)?(0,r.f)(e,o,"linePrefix")(t):o(t)};function o(e){return null===e||(0,l.Ch)(e)?t(e):n(e)}}}},42761:function(e,t,n){"use strict";n.d(t,{f:function(){return l}});var r=n(15459);function l(e,t,n,l){let o=l?l-1:Number.POSITIVE_INFINITY,i=0;return function(l){return(0,r.xz)(l)?(e.enter(n),function l(a){return(0,r.xz)(a)&&i++<o?(e.consume(a),l):(e.exit(n),t(a))}(l)):t(l)}}},15459:function(e,t,n){"use strict";n.d(t,{AF:function(){return s},Av:function(){return i},B8:function(){return f},Ch:function(){return c},H$:function(){return l},Xh:function(){return h},jv:function(){return r},n9:function(){return o},pY:function(){return a},sR:function(){return u},xz:function(){return p},z3:function(){return d}});let r=g(/[A-Za-z]/),l=g(/[\dA-Za-z]/),o=g(/[#-'*+\--9=?A-Z^-~]/);function i(e){return null!==e&&(e<32||127===e)}let a=g(/\d/),s=g(/[\dA-Fa-f]/),u=g(/[!-/:-@[-`{-~]/);function c(e){return null!==e&&e<-2}function d(e){return null!==e&&(e<0||32===e)}function p(e){return -2===e||-1===e||32===e}let h=g(/\p{P}|\p{S}/u),f=g(/\s/);function g(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}},21905:function(e,t,n){"use strict";function r(e,t,n,r){let l;let o=e.length,i=0;if(t=t<0?-t>o?0:o+t:t>o?o:t,n=n>0?n:0,r.length<1e4)(l=Array.from(r)).unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);i<r.length;)(l=r.slice(i,i+1e4)).unshift(t,0),e.splice(...l),i+=1e4,t+=1e4}function l(e,t){return e.length>0?(r(e,e.length,0,t),e):t}n.d(t,{V:function(){return l},d:function(){return r}})},62987:function(e,t,n){"use strict";n.d(t,{r:function(){return l}});var r=n(15459);function l(e){return null===e||(0,r.z3)(e)||(0,r.B8)(e)?1:(0,r.Xh)(e)?2:void 0}},4663:function(e,t,n){"use strict";n.d(t,{W:function(){return o}});var r=n(21905);let l={}.hasOwnProperty;function o(e){let t={},n=-1;for(;++n<e.length;)!function(e,t){let n;for(n in t){let o;let i=(l.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];if(a)for(o in a){l.call(i,o)||(i[o]=[]);let e=a[o];!function(e,t){let n=-1,l=[];for(;++n<t.length;)("after"===t[n].add?e:l).push(t[n]);(0,r.d)(e,0,0,l)}(i[o],Array.isArray(e)?e:e?[e]:[])}}}(t,e[n]);return t}},49411:function(e,t,n){"use strict";function r(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}n.d(t,{d:function(){return r}})},63233:function(e,t,n){"use strict";function r(e,t,n){let r=[],l=-1;for(;++l<e.length;){let o=e[l].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}n.d(t,{C:function(){return r}})},35213:function(e,t,n){"use strict";n.d(t,{fC:function(){return i}});var r=n(67294),l=n(28771),o=n(85893),i=function(e){let t=function(e){let t=r.forwardRef((e,t)=>
27{let{children:n,...o}=e;if(r.isValidElement(n)){let e,i;let a=(e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?n.ref:(e=Object.getOwnPropertyDescriptor(n,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?n.props.ref:n.props.ref||n.ref,s=function(e,t){let n={...t};for(let r in t){let l=e[r],o=t[r];/^on[A-Z]/.test(r)?l&&o?n[r]=(...e)=>{let t=o(...e);return l(...e),t}:l&&(n[r]=l):"style"===r?n[r]={...l,...o}:"className"===r&&(n[r]=[l,o].filter(Boolean).join(" "))}return{...e,...n}}(o,n.props);return n.type!==r.Fragment&&(s.ref=t?(0,l.F)(t,a):a),r.cloneElement(n,s)}return r.Children.count(n)>1?r.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}(e),n=r.forwardRef((e,n)=>{let{children:l,...i}=e,a=r.Children.toArray(l),u=a.find(s);if(u){let e=u.props.children,l=a.map(t=>t!==u?t:r.Children.count(e)>1?r.Children.only(null):r.isValidElement(e)?e.props.children:null);return(0,o.jsx)(t,{...i,ref:n,children:r.isValidElement(e)?r.cloneElement(e,void 0,l):null})}return(0,o.jsx)(t,{...i,ref:n,children:l})});return n.displayName=`${e}.Slot`,n}("Slot"),a=Symbol("radix.slottable");function s(e){return r.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===a}},25332:function(e,t,n){"use strict";n.d(t,{UG:function(){return np}});var r={};n.r(r),n.d(r,{boolean:function(){return b},booleanish:function(){return v},commaOrSpaceSeparated:function(){return S},commaSeparated:function(){return C},number:function(){return x},overloadedBoolean:function(){return y},spaceSeparated:function(){return w}});var l={};n.r(l),n.d(l,{attentionMarkers:function(){return th},contentInitial:function(){return ta},disable:function(){return tf},document:function(){return ti},flow:function(){return tu},flowInitial:function(){return ts},insideSpan:function(){return tp},string:function(){return tc},text:function(){return td}});var o=n(24345);let i=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,a=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,s={};function u(e,t){return((t||s).jsx?a:i).test(e)}let c=/[ \t\n\f\r]/g;function d(e){return""===e.replace(c,"")}class p{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function h(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new p(n,r,t)}function f(e){return e.toLowerCase()}p.prototype.normal={},p.prototype.property={},p.prototype.space=void 0;class g{constructor(e,t){this.attribute=t,this.property=e}}g.prototype.attribute="",g.prototype.booleanish=!1,g.prototype.boolean=!1,g.prototype.commaOrSpaceSeparated=!1,g.prototype.commaSeparated=!1,g.prototype.defined=!1,g.prototype.mustUseProperty=!1,g.prototype.number=!1,g.prototype.overloadedBoolean=!1,g.prototype.property="",g.prototype.spaceSeparated=!1,g.prototype.space=void 0;let m=0,b=k(),v=k(),y=k(),x=k(),w=k(),C=k(),S=k();function k(){return 2**++m}let I=Object.keys(r);class R extends g{constructor(e,t,n,l){var o,i;let a=-1;if(super(e,t),l&&(this.space=l),"number"==typeof n)for(;++a<I.length;){let e=I[a];o=I[a],(i=(n&r[e])===r[e])&&(this[o]=i)}}}function _(e){let t={},n={};for(let[r,l]of Object.entries(e.properties)){let o=new R(r,e.transform(e.attributes||{},r),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[f(r)]=r,n[f(o.attribute)]=r}return new p(t,n,e.space)}R.prototype.defined=!0;let E=_({properties:{ariaActiveDescendant:null,ariaAtomic:v,ariaAutoComplete:null,ariaBusy:v,ariaChecked:v,ariaColCount:x,ariaColIndex:x,ariaColSpan:x,ariaControls:w,ariaCurrent:null,ariaDescribedBy:w,ariaDetails:null,ariaDisabled:v,ariaDropEffect:w,ariaErrorMessage:null,ariaExpanded:v,ariaFlowTo:w,ariaGrabbed:v,ariaHasPopup:null,ariaHidden:v,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:w,ariaLevel:x,ariaLive:null,ariaModal:v,ariaMultiLine:v,ariaMultiSelectable:v,ariaOrientation:null,ariaOwns:w,ariaPlaceholder:null,ariaPosInSet:x,ariaPressed:v,ariaReadOnly:v,ariaRelevant:null,ariaRequired:v,ariaRoleDescription:w,ariaRowCount:x,ariaRowIndex:x,ariaRowSpan:x,ariaSelected:v,ariaSetSize:x,ariaSort:null,ariaValueMax:x,ariaValueMin:x,ariaValueNow:x,ariaValueText:null,role:null},transform:(e,t)=>
vendor: 4,641 bytes, line 27
27"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function M(e,t){return t in e?e[t]:t}function P(e,t){return M(e,t.toLowerCase())}let T=_({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:C,acceptCharset:w,accessKey:w,action:null,allow:null,allowFullScreen:b,allowPaymentRequest:b,allowUserMedia:b,alt:null,as:null,async:b,autoCapitalize:null,autoComplete:w,autoFocus:b,autoPlay:b,blocking:w,capture:null,charSet:null,checked:b,cite:null,className:w,cols:x,colSpan:null,content:null,contentEditable:v,controls:b,controlsList:w,coords:x|C,crossOrigin:null,data:null,dateTime:null,decoding:null,default:b,defer:b,dir:null,dirName:null,disabled:b,download:y,draggable:v,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:b,formTarget:null,headers:w,height:x,hidden:y,high:x,href:null,hrefLang:null,htmlFor:w,httpEquiv:w,id:null,imageSizes:null,imageSrcSet:null,inert:b,inputMode:null,integrity:null,is:null,isMap:b,itemId:null,itemProp:w,itemRef:w,itemScope:b,itemType:w,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:b,low:x,manifest:null,max:null,maxLength:x,media:null,method:null,min:null,minLength:x,multiple:b,muted:b,name:null,nonce:null,noModule:b,noValidate:b,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:b,optimum:x,pattern:null,ping:w,placeholder:null,playsInline:b,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:b,referrerPolicy:null,rel:w,required:b,reversed:b,rows:x,rowSpan:x,sandbox:w,scope:null,scoped:b,seamless:b,selected:b,shadowRootClonable:b,shadowRootDelegatesFocus:b,shadowRootMode:null,shape:null,size:x,sizes:null,slot:null,span:x,spellCheck:v,src:null,srcDoc:null,srcLang:null,srcSet:null,start:x,step:null,style:null,tabIndex:x,target:null,title:null,translate:null,type:null,typeMustMatch:b,useMap:null,value:v,width:x,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:w,axis:null,background:null,bgColor:null,border:x,borderColor:null,bottomMargin:x,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:b,declare:b,event:null,face:null,frame:null,frameBorder:null,hSpace:x,leftMargin:x,link:null,longDesc:null,lowSrc:null,marginHeight:x,marginWidth:x,noResize:b,noHref:b,noShade:b,noWrap:b,object:null,profile:null,prompt:null,rev:null,rightMargin:x,rules:null,scheme:null,scrolling:v,standby:null,summary:null,text:null,topMargin:x,valueType:null,version:null,vAlign:null,vLink:null,vSpace:x,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:b,disableRemotePlayback:b,prefix:null,property:null,results:x,security:null,unselectable:null},space:"html",transform:P}),Z=_({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRen
27dering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:S,accentHeight:x,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:x,amplitude:x,arabicForm:null,ascent:x,attributeName:null,attributeType:null,azimuth:x,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:x,by:null,calcMode:null,capHeight:x,className:w,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRen
27dering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:x,diffuseConstant:x,direction:null,display:null,dur:null,divisor:x,dominantBaseline:null,download:b,dx:null,dy:null,edgeMode:null,editable:null,elevation:x,enableBackground:null,end:null,event:null,exponent:x,externalResourcesRequired:null,fill:null,fillOpacity:x,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:C,g2:C,glyphName:C,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:x,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:x,horizOriginX:x,horizOriginY:x,id:null,ideographic:x,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:x,k:x,k1:x,k2:x,k3:x,k4:x,kernelMatrix:S,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:x,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:x,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:x,overlineThickness:x,paintOrder:null,panose1:null,path:null,pathLength:x,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:w,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:x,pointsAtY:x,pointsAtZ:x,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:S,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:S,rev:S,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:S,requiredFeatures:S,requiredFonts:S,requiredFormats:S,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:x,specularExponent:x,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:x,strikethroughThickness:x,string:null,stroke:null,strokeDashArray:S,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:x,strokeOpacity:x,strokeWidth:null,style:null,surfaceScale:x,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:S,tabIndex:x,tableValues:null,target:null,targetX:x,targetY:x,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:S,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:x,underlineThickness:x,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:x,values:null,vAlphabetic:x,vMathematical:x,vectorEffect:null,vHanging:x,vIdeographic:x,version:null,vertAdvY:x,vertOriginX:x,vertOriginY:x,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:x,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:M}),F=_({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>
27"xlink:"+t.slice(5).toLowerCase()}),D=_({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:P}),A=_({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),O=h([E,T,F,D,A],"html"),z=h([E,Z,F,D,A],"svg"),j=/[A-Z]/g,L=/-[a-z]/g,H=/^data[-\w.:]+$/i;function B(e){return"-"+e.toLowerCase()}function N(e){return e.charAt(1).toUpperCase()}let V={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var $=n(41476);let U=q("end"),G=q("start");function q(e){return function(t){let n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function W(e){return e&&"object"==typeof e?"position"in e||"type"in e?Y(e.position):"start"in e||"end"in e?Y(e):"line"in e||"column"in e?K(e):"":""}function K(e){return X(e&&e.line)+":"+X(e&&e.column)}function Y(e){return K(e&&e.start)+"-"+K(e&&e.end)}function X(e){return e&&"number"==typeof e?e:1}class J extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",l={},o=!1;if(t&&(l="line"in t&&"column"in t?{place:t}:"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!l.cause&&e&&(o=!0,r=e.message,l.cause=e),!l.ruleId&&!l.source&&"string"==typeof n){let e=n.indexOf(":");-1===e?l.ruleId=n:(l.source=n.slice(0,e),l.ruleId=n.slice(e+1))}if(!l.place&&l.ancestors&&l.ancestors){let e=l.ancestors[l.ancestors.length-1];e&&(l.place=e.position)}let i=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=i?i.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=i?i.line:void 0,this.name=W(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=o&&l.cause&&"string"==typeof l.cause.stack?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}J.prototype.file="",J.prototype.name="",J.prototype.reason="",J.prototype.message="",J.prototype.stack="",J.prototype.column=void 0,J.prototype.line=void 0,J.prototype.ancestors=void 0,J.prototype.cause=void 0,J.prototype.fatal=void 0,J.prototype.place=void 0,J.prototype.ruleId=void 0,J.prototype.source=void 0;let Q={}.hasOwnProperty,ee=new Map,et=/[A-Z]/g,en=new Set(["table","tbody","thead","tfoot","tr"]),er=new Set(["td","th"]),el="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function eo(e,t,n){return"element"===t.type?function(e,t,n){let r=e.schema,l=r;"svg"===t.tagName.toLowerCase()&&"html"===r.space&&(l=z,e.schema=l),e.ancestors.push(t);let o=eu(e,t.tagName,!1),i=function(e,t){let n,r;let l={};for(r in t.properties)if("children"!==r&&Q.call(t.properties,r)){let o=function(e,t,n){let r=function(e,t){let n=f(t),r=t,l=g;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&H.test(t)){if("-"===t.charAt(4)){let e=t.slice(5).replace(L,N);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!L.test(e)){let n=e.replace(j,B);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}l=R}return new l(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?function(e,t){let n={};return(""===e[e.length-1]?[...e,""]:e).join((n.padRight?" ":"")+","+(!1===n.padLeft?"":" ")).trim()}(n):n.join(" ").trim()),"style"===r.property){let t="object"==typeof n?n:function(e,t){try{return $(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};let t=new J("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});
27throw t.file=e.filePath||void 0,t.url=el+"#cannot-parse-style-attribute",t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){let t;let n={};for(t in e)Q.call(e,t)&&(n[function(e){let t=e.replace(et,ed);return"ms-"===t.slice(0,3)&&(t="-"+t),t}(t)]=e[t]);return n}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?V[r.property]||r.property:r.attribute,n]}}(e,r,t.properties[r]);if(o){let[r,i]=o;e.tableCellAlignToStyle&&"align"===r&&"string"==typeof i&&er.has(t.tagName)?n=i:l[r]=i}}return n&&((l.style||(l.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=n),l}(e,t),a=es(e,t);return en.has(t.tagName)&&(a=a.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&d(e.value):d(e))})),ei(e,i,o,t),ea(i,a),e.ancestors.pop(),e.schema=r,e.create(t,o,i,n)}(e,t,n):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return(0,o.ok)("ExpressionStatement"===n.type),e.evaluater.evaluateExpression(n.expression)}ec(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){let r=e.schema,l=r;"svg"===t.name&&"html"===r.space&&(l=z,e.schema=l),e.ancestors.push(t);let i=null===t.name?e.Fragment:eu(e,t.name,!0),a=function(e,t){let n={};for(let r of t.attributes)if("mdxJsxExpressionAttribute"===r.type){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];(0,o.ok)("ExpressionStatement"===t.type);let l=t.expression;(0,o.ok)("ObjectExpression"===l.type);let i=l.properties[0];(0,o.ok)("SpreadElement"===i.type),Object.assign(n,e.evaluater.evaluateExpression(i.argument))}else ec(e,t.position)}else{let l;let i=r.name;if(r.value&&"object"==typeof r.value){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];(0,o.ok)("ExpressionStatement"===t.type),l=e.evaluater.evaluateExpression(t.expression)}else ec(e,t.position)}else l=null===r.value||r.value;n[i]=l}return n}(e,t),s=es(e,t);return ei(e,a,i,t),ea(a,s),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}(e,t,n):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ec(e,t.position)}(e,t):"root"===t.type?function(e,t,n){let r={};return ea(r,es(e,t)),e.create(t,e.Fragment,r,n)}(e,t,n):"text"===t.type?t.value:void 0}function ei(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function ea(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function es(e,t){let n=[],r=-1,l=e.passKeys?new Map:ee;for(;++r<t.children.length;){let o;let i=t.children[r];if(e.passKeys){let e="element"===i.type?i.tagName:"mdxJsxFlowElement"===i.type||"mdxJsxTextElement"===i.type?i.name:void 0;if(e){let t=l.get(e)||0;o=e+"-"+t,l.set(e,t+1)}}let a=eo(e,i,o);void 0!==a&&n.push(a)}return n}function eu(e,t,n){let r;if(n){if(t.includes(".")){let e;let n=t.split("."),l=-1;for(;++l<n.length;){let t=u(n[l])?{type:"Identifier",name:n[l]}:{type:"Literal",value:n[l]};e=e?{type:"MemberExpression",object:e,property:t,computed:!!(l&&"Literal"===t.type),optional:!1}:t}(0,o.ok)(e,"always a result"),r=e}else r=u(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t}}else r={type:"Literal",value:t};if("Literal"===r.type){let t=r.value;return Q.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);ec(e)}function ec(e,t){let n=new J("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=el+"#cannot-handle-mdx-estrees-without-createevaluater",n}function ed(e){return"-"+e.toLowerCase()}let ep={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]};var eh=n(85893);n(67294);var ef=n(27962),eg=n(21905);class em{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=null==t?Number.POSITIVE_INFINITY:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){this.setCursor(Math.trunc(e));let r=this.right.splice(this.right.length-(t||0),Number.POSITIVE_INFINITY);return n&&eb(this.left,n),r.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),eb(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),eb(this.right,e.reverse())}setCursor(e){if(e!==this.left.length&&(!(e>this.left.length)||0!==this.right.length)&&(!(e<0)||0!==this.left.length)){if(e<this.left.length){let t=this.left.splice(e,Number.POSITIVE_INFINITY);eb(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);eb(this.left,t.reverse())}}}}function eb(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function ev(e){let t,n,r,l,o,i,a;let s={},u=-1,c=new em(e);for(;++u<c.length;){for(;(u in s);)u=s[u];if(t=c.get(u),u&&"chunkFlow"===t[1].type&&"listItemPrefix"===c.get(u-1)[1].type&&((r=0)<(i=t[1]._tokenizer.events).length&&"lineEndingBlank"===i[r][1].type&&(r+=2),r<i.length&&"content"===i[r][1].type))for(;++r<i.length&&"content"!==i[r][1].type;)"chunkText"===i[r][1].type&&(i[r][1]._isInFirstContentOfListItem=!0,r++);if("enter"===t[0])t[1].contentType&&(Object.assign(s,function(e,t){let n,r;let l=e.get(t)[1],o=e.get(t)[2],i=t-1,a=[],s=l._tokenizer;!s&&(s=o.parser[l.contentType](l.start),l._contentTypeTextTrailing&&(s._c
27ontentTypeTextTrailing=!0));let u=s.events,c=[],d={},p=-1,h=l,f=0,g=0,m=[0];for(;h;){for(;e.get(++i)[1]!==h;);a.push(i),!h._tokenizer&&(n=o.sliceStream(h),h.next||n.push(null),r&&s.defineSkip(h.start),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(n),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),r=h,h=h.next}for(h=l;++p<u.length;)"exit"===u[p][0]&&"enter"===u[p-1][0]&&u[p][1].type===u[p-1][1].type&&u[p][1].start.line!==u[p][1].end.line&&(g=p+1,m.push(g),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(s.events=[],h?(h._tokenizer=void 0,h.previous=void 0):m.pop(),p=m.length;p--;){let t=u.slice(m[p],m[p+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),p=-1;++p<c.length;)d[f+c[p][0]]=f+c[p][1],f+=c[p][1]-c[p][0]-1;return d}(c,u)),u=s[u],a=!0);else if(t[1]._container){for(r=u,n=void 0;r--;)if("lineEnding"===(l=c.get(r))[1].type||"lineEndingBlank"===l[1].type)"enter"===l[0]&&(n&&(c.get(n)[1].type="lineEndingBlank"),l[1].type="lineEnding",n=r);else if("linePrefix"===l[1].type||"listItemIndent"===l[1].type);else break;n&&(t[1].end={...c.get(n)[1].start},(o=c.slice(n,u)).unshift(t),c.splice(n,u-n+1,o))}}return(0,eg.d)(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!a}var ey=n(4663),ex=n(42761),ew=n(15459);let eC={tokenize:function(e){let t;let n=e.attempt(this.parser.constructs.contentInitial,function(t){if(null===t){e.consume(t);return}return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),(0,ex.f)(e,n,"linePrefix")},function(n){return e.enter("paragraph"),function n(r){let l=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=l),t=l,function t(r){if(null===r){e.exit("chunkText"),e.exit("paragraph"),e.consume(r);return}return(0,ew.Ch)(r)?(e.consume(r),e.exit("chunkText"),n):(e.consume(r),t)}(r)}(n)});return n}},eS={tokenize:function(e){let t,n,r;let l=this,o=[],i=0;return a;function a(t){if(i<o.length){let n=o[i];return l.containerState=n[1],e.attempt(n[0].continuation,s,u)(t)}return u(t)}function s(e){if(i++,l.containerState._closeFlow){let n;l.containerState._closeFlow=void 0,t&&b();let r=l.events.length,o=r;for(;o--;)if("exit"===l.events[o][0]&&"chunkFlow"===l.events[o][1].type){n=l.events[o][1].end;break}m(i);let a=r;for(;a<l.events.length;)l.events[a][1].end={...n},a++;return(0,eg.d)(l.events,o+1,0,l.events.slice(r)),l.events.length=a,u(e)}return a(e)}function u(n){if(i===o.length){if(!t)return p(n);if(t.currentConstruct&&t.currentConstruct.concrete)return f(n);l.interrupt=!!(t.currentConstruct&&!t._gfmTableDynamicInterruptHack)}return l.containerState={},e.check(ek,c,d)(n)}function c(e){return t&&b(),m(i),p(e)}function d(e){return l.parser.lazy[l.now().line]=i!==o.length,r=l.now().offset,f(e)}function p(t){return l.containerState={},e.attempt(ek,h,f)(t)}function h(e){return i++,o.push([l.currentConstruct,l.containerState]),p(e)}function f(r){if(null===r){t&&b(),m(0),e.consume(r);return}return t=t||l.parser.flow(l.now()),e.enter("chunkFlow",{_tokenizer:t,contentType:"flow",previous:n}),function t(n){if(null===n){g(e.exit("chunkFlow"),!0),m(0),e.consume(n);return}return(0,ew.Ch)(n)?(e.consume(n),g(e.exit("chunkFlow")),i=0,l.interrupt=void 0,a):(e.consume(n),t)}(r)}function g(e,o){let a=l.sliceStream(e);if(o&&a.push(null),e.previous=n,n&&(n.next=e),n=e,t.defineSkip(e.start),t.write(a),l.parser.lazy[e.start.line]){let e,n,o=t.events.length;for(;o--;)if(t.events[o][1].start.offset<r&&(!t.events[o][1].end||t.events[o][1].end.offset>r))return;let a=l.events.length,s=a;for(;s--;)if("exit"===l.events[s][0]&&"chunkFlow"===l.events[s][1].type){if(e){n=l.events[s][1].end;break}e=!0}for(m(i),o=a;o<l.events.length;)l.events[o][1].end={...n},o++;(0,eg.d)(l.events,s+1,0,l.events.slice(a)),l.events.length=o}}function m(t){let n=o.length;for(;n-- >t;){let t=o[n];l.containerState=t[1],t[0].exit.call(l,e)}o.length=t}function b(){t.write([null]),n=void 0,t=void 0,l.containerState._closeFlow=void 0}}},ek={tokenize:function(e,t,n){return(0,ex.f)(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};var eI=n(23402);let eR={resolve:function(e){return ev(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?l(t):(0,ew.Ch)(t)?e.check(e_,o,l)(t):(e.consume(t),r)}function l(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function o(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},e_={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),
27(0,ex.f)(e,l,"linePrefix")};function l(l){if(null===l||(0,ew.Ch)(l))return n(l);let o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}},eE={tokenize:function(e){let t=this,n=e.attempt(eI.w,function(r){if(null===r){e.consume(r);return}return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n},e.attempt(this.parser.constructs.flowInitial,r,(0,ex.f)(e,e.attempt(this.parser.constructs.flow,r,e.attempt(eR,r)),"linePrefix")));return n;function r(r){if(null===r){e.consume(r);return}return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n}}},eM={resolveAll:eF()},eP=eZ("string"),eT=eZ("text");function eZ(e){return{resolveAll:eF("text"===e?eD:void 0),tokenize:function(t){let n=this,r=this.parser.constructs[e],l=t.attempt(r,o,i);return o;function o(e){return s(e)?l(e):i(e)}function i(e){if(null===e){t.consume(e);return}return t.enter("data"),t.consume(e),a}function a(e){return s(e)?(t.exit("data"),l(e)):(t.consume(e),a)}function s(e){if(null===e)return!0;let t=r[e],l=-1;if(t)for(;++l<t.length;){let e=t[l];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function eF(e){return function(t,n){let r,l=-1;for(;++l<=t.length;)void 0===r?t[l]&&"data"===t[l][1].type&&(r=l,l++):t[l]&&"data"===t[l][1].type||(l!==r+2&&(t[r][1].end=t[l-1][1].end,t.splice(r+2,l-r-2),l=r+2),r=void 0);return e?e(t,n):t}}function eD(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){let r;let l=e[n-1][1],o=t.sliceStream(l),i=o.length,a=-1,s=0;for(;i--;){let e=o[i];if("string"==typeof e){for(a=e.length;32===e.charCodeAt(a-1);)s++,a--;if(a)break;a=-1}else if(-2===e)r=!0,s++;else if(-1===e);else{i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let o={type:n===e.length||r||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?a:l.start._bufferIndex+a,_index:l.start._index+i,line:l.end.line,column:l.end.column-s,offset:l.end.offset-s},end:{...l.end}};l.end={...o.start},l.start.offset===l.end.offset?Object.assign(l,o):(e.splice(n,0,["enter",o,t],["exit",o,t]),n+=2)}n++}return e}let eA={name:"thematicBreak",tokenize:function(e,t,n){let r,l=0;return function(o){return e.enter("thematicBreak"),r=o,function o(i){return i===r?(e.enter("thematicBreakSequence"),function t(n){return n===r?(e.consume(n),l++,t):(e.exit("thematicBreakSequence"),(0,ew.xz)(n)?(0,ex.f)(e,o,"whitespace")(n):o(n))}(i)):l>=3&&(null===i||(0,ew.Ch)(i))?(e.exit("thematicBreak"),t(i)):n(i)}(o)}}},eO={continuation:{tokenize:function(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(eI.w,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,(0,ex.f)(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!(0,ew.xz)(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine
27=void 0,l(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(ej,t,l)(n))});function l(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,(0,ex.f)(e,e.attempt(eO,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){let r=this,l=r.events[r.events.length-1],o=l&&"linePrefix"===l[1].type?l[2].sliceSerialize(l[1],!0).length:0,i=0;return function(t){let l=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===l?!r.containerState.marker||t===r.containerState.marker:(0,ew.pY)(t)){if(r.containerState.type||(r.containerState.type=l,e.enter(l,{_container:!0})),"listUnordered"===l)return e.enter("listItemPrefix"),42===t||45===t?e.check(eA,n,a)(t):a(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),function t(l){return(0,ew.pY)(l)&&++i<10?(e.consume(l),t):(!r.interrupt||i<2)&&(r.containerState.marker?l===r.containerState.marker:41===l||46===l)?(e.exit("listItemValue"),a(l)):n(l)}(t)}return n(t)};function a(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(eI.w,r.interrupt?n:s,e.attempt(ez,c,u))}
27function s(e){return r.containerState.initialBlankLine=!0,o++,c(e)}function u(t){return(0,ew.xz)(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),c):n(t)}function c(n){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},ez={partial:!0,tokenize:function(e,t,n){let r=this;return(0,ex.f)(e,function(e){let l=r.events[r.events.length-1];return!(0,ew.xz)(e)&&l&&"listItemPrefixWhitespace"===l[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},ej={partial:!0,tokenize:function(e,t,n){let r=this;return(0,ex.f)(e,function(e){let l=r.events[r.events.length-1];return l&&"listItemIndent"===l[1].type&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}},eL={continuation:{tokenize:function(e,t,n){let r=this;return function(t){return(0,ew.xz)(t)?(0,ex.f)(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)};function l(r){return e.attempt(eL,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){let r=this;return function(t){if(62===t){let n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),l}return n(t)};function l(n){return(0,ew.xz)(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}};function eH(e,t,n,r,l,o,i,a,s){let u=s||Number.POSITIVE_INFINITY,c=0;return function(t){return 60===t?(e.enter(r),e.enter(l),e.enter(o),e.consume(t),e.exit(o),d):null===t||32===t||41===t||(0,ew.Av)(t)?n(t):(e.enter(r),e.enter(i),e.enter(a),e.enter("chunkString",{contentType:"string"}),f(t))};function d(n){return 62===n?(e.enter(o),e.consume(n),e.exit(o),e.exit(l),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(n))}function p(t){return 62===t?(e.exit("chunkString"),e.exit(a),d(t)):null===t||60===t||(0,ew.Ch)(t)?n(t):(e.consume(t),92===t?h:p)}function h(t){return 60===t||62===t||92===t?(e.consume(t),p):p(t)}function f(l){return!c&&(null===l||41===l||(0,ew.z3)(l))?(e.exit("chunkString"),e.exit(a),e.exit(i),e.exit(r),t(l)):c<u&&40===l?(e.consume(l),c++,f):41===l?(e.consume(l),c--,f):null===l||32===l||40===l||(0,ew.Av)(l)?n(l):(e.consume(l),92===l?g:f)}function g(t){return 40===t||41===t||92===t?(e.consume(t),f):f(t)}}function eB(e,t,n,r,l,o){let i;let a=this,s=0;return function(t){return e.enter(r),e.enter(l),e.consume(t),e.exit(l),e.enter(o),u};function u(d){return s>999||null===d||91===d||93===d&&!i||94===d&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):93===d?(e.exit(o),e.enter(l),e.consume(d),e.exit(l),e.exit(r),t):(0,ew.Ch)(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),c(d))}function c(t){return null===t||91===t||93===t||(0,ew.Ch)(t)||s++>999?(e.exit("chunkString"),u(t)):(e.consume(t),i||(i=!(0,ew.xz)(t)),92===t?d:c)}function d(t){return 91===t||92===t||93===t?(e.consume(t),s++,c):c(t)}}function eN(e,t,n,r,l,o){let i;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(l),e.consume(t),e.exit(l),i=40===t?41:t,a):n(t)};function a(n){return n===i?(e.enter(l),e.consume(n),e.exit(l),e.exit(r),t):(e.enter(o),s(n))}function s(t){return t===i?(e.exit(o),a(i)):null===t?n(t):(0,ew.Ch)(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),(0,ex.f)(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(t))}function u(t){return t===i||null===t||(0,ew.Ch)(t)?(e.exit("chunkString"),s(t)):(e.consume(t),92===t?c:u)}function c(t){return t===i||92===t?(e.consume(t),u):u(t)}}function eV(e,t){let n;return function r(l){return(0,ew.Ch)(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,r):(0,ew.xz)(l)?(0,ex.f)(e,r,n?"linePrefix":"lineSuffix")(l):t(l)}}var e$=n(49411);let eU={partial:!0,tokenize:function(e,t,n){return function(t){return(0,ew.z3)(t)?eV(e,r)(t):n(t)};function r(t){return eN(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function l(t){return(0,ew.xz)(t)?(0,ex.f)(e,o,"whitespace")(t):o(t)}function o(e){return null===e||(0,ew.Ch)(e)?t(e):n(e)}}},eG={name:"codeIndented",tokenize:function(e,t,n){let r=this;
27return function(t){return e.enter("codeIndented"),(0,ex.f)(e,l,"linePrefix",5)(t)};function l(t){let l=r.events[r.events.length-1];return l&&"linePrefix"===l[1].type&&l[2].sliceSerialize(l[1],!0).length>=4?function t(n){return null===n?o(n):(0,ew.Ch)(n)?e.attempt(eq,t,o)(n):(e.enter("codeFlowValue"),function n(r){return null===r||(0,ew.Ch)(r)?(e.exit("codeFlowValue"),t(r)):(e.consume(r),n)}(n))}(t):n(t)}function o(n){return e.exit("codeIndented"),t(n)}}},eq={partial:!0,tokenize:function(e,t,n){let r=this;return l;function l(t){return r.parser.lazy[r.now().line]?n(t):(0,ew.Ch)(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l):(0,ex.f)(e,o,"linePrefix",5)(t)}function o(e){let o=r.events[r.events.length-1];return o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?t(e):(0,ew.Ch)(e)?l(e):n(e)}}},eW={name:"setextUnderline",resolveTo:function(e,t){let n,r,l,o=e.length;for(;o--;)if("enter"===e[o][0]){if("content"===e[o][1].type){n=o;break}"paragraph"===e[o][1].type&&(r=o)}else"content"===e[o][1].type&&e.splice(o,1),l||"definition"!==e[o][1].type||(l=o);let i={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",l?(e.splice(r,0,["enter",i,t]),e.splice(l+1,0,["exit",e[n][1],t]),e[n][1].end={...e[l][1].end}):e[n][1]=i,e.push(["exit",i,t]),e},tokenize:function(e,t,n){let r;let l=this;return function(t){let i,a=l.events.length;for(;a--;)if("lineEnding"!==l.events[a][1].type&&"linePrefix"!==l.events[a][1].type&&"content"!==l.events[a][1].type){i="paragraph"===l.events[a][1].type;break}return!l.parser.lazy[l.now().line]&&(l.interrupt||i)?(e.enter("setextHeadingLine"),r=t,e.enter("setextHeadingLineSequence"),function t(n){return n===r?(e.consume(n),t):(e.exit("setextHeadingLineSequence"),(0,ew.xz)(n)?(0,ex.f)(e,o,"lineSuffix")(n):o(n))}(t)):n(t)};function o(r){return null===r||(0,ew.Ch)(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}},eK=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],eY=["pre","script","style","textarea"],eX={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(eI.w,t,n)}}},eJ={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return(0,ew.Ch)(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l):n(t)};function l(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},eQ={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l)};function l(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},e0={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){let r;let l=this,o={partial:!0,tokenize:function(e,t,n){let o=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i};function i(t){return e.enter("codeFencedFence"),(0,ew.xz)(t)?(0,ex.f)(e,s,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):s(t)}function s(t){return t===r?(e.enter("codeFencedFenceSequence"),function t(l){return l===r?(o++,e.consume(l),t):o>=a?(e.exit("codeFencedFenceSequence"),(0,ew.xz)(l)?(0,ex.f)(e,u,"whitespace")(l):u(l)):n(l)}(t)):n(t)}function u(r){return null===r||(0,ew.Ch)(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}},i=0,a=0;return function(t){return function(t){let o=l.events[l.events.length-1];return i=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0,r=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function t(l){return l===r?(a++,e.consume(l),t):a<3?n(l):(e.exit("codeFencedFenceSequence"),(0,ew.xz)(l)?(0,ex.f)(e,s,"whitespace")(l):s(l))}(t)}(t)};function s(o){return null===o||(0,ew.Ch)(o)?(e.exit("codeFencedFence"),l.interrupt?t(o):e.check(eQ,c,f)(o)):(e.enter("co
27deFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function t(l){return null===l||(0,ew.Ch)(l)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),s(l)):(0,ew.xz)(l)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),(0,ex.f)(e,u,"whitespace")(l)):96===l&&l===r?n(l):(e.consume(l),t)}(o))}function u(t){return null===t||(0,ew.Ch)(t)?s(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function t(l){return null===l||(0,ew.Ch)(l)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),s(l)):96===l&&l===r?n(l):(e.consume(l),t)}(t))}function c(t){return e.attempt(o,f,d)(t)}function d(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),p}function p(t){return i>0&&(0,ew.xz)(t)?(0,ex.f)(e,h,"linePrefix",i+1)(t):h(t)}function h(t){return null===t||(0,ew.Ch)(t)?e.check(eQ,c,f)(t):(e.enter("codeFlowValue"),function t(n){return null===n||(0,ew.Ch)(n)?(e.exit("codeFlowValue"),h(n)):(e.consume(n),t)}(t))}function f(n){return e.exit("codeFenced"),t(n)}}},e1=document.createElement("i");function e2(e){let t="&"+e+";";e1.innerHTML=t;let n=e1.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}let e3={name:"characterReference",tokenize:function(e,t,n){let r,l;let o=this,i=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),a};function a(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),r=31,l=ew.H$,u(t))}function s(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,l=ew.AF,u):(e.enter("characterReferenceValue"),r=7,l=ew.pY,u(t))}function u(a){if(59===a&&i){let r=e.exit("characterReferenceValue");return l!==ew.H$||e2(o.sliceSerialize(r))?(e.enter("characterReferenceMarker"),e.consume(a),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(a)}return l(a)&&i++<r?(e.consume(a),u):n(a)}}},e4={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return(0,ew.sR)(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}},e5={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),(0,ex.f)(e,t,"linePrefix")}}};var e9=n(63233);let e6={name:"labelEnd",resolveAll:function(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){let e="labelImage"===r.type?4:2;r.type="data",t+=e}}return e.length!==n.length&&(0,eg.d)(e,0,e.length,n),e},resolveTo:function(e,t){let n,r,l,o,i=e.length,a=0;for(;i--;)if(n=e[i][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[i][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(l){if("enter"===e[i][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=i,"labelLink"!==n.type)){a=2;break}}else"labelEnd"===n.type&&(l=i);let s={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[r][1].start},end:{...e[l][1].end}},c={type:"labelText",start:{...e[r+a+2][1].end},end:{...e[l-2][1].start}};return o=[["enter",s,t],["enter",u,t]],o=(0,eg.V)(o,e.slice(r+1,r+a+3)),o=(0,eg.V)(o,[["enter",c,t]]),o=(0,eg.V)(o,(0,e9.C)(t.parser.constructs.insideSpan.null,e.slice(r+a+4,l-3),t)),o=(0,eg.V)(o,[["exit",c,t],e[l-2],e[l-1],["exit",u,t]]),o=(0,eg.V)(o,e.slice(l+1)),o=(0,eg.V)(o,[["exit",s,t]]),(0,eg.d)(e,r,e.length,o),e},tokenize:function(e,t,n){let r,l;let o=this,i=o.events.length;for(;i--;)if(("labelImage"===o.events[i][1].type||"labelLink"===o.events[i][1].type)&&!o.events[i][1]._balanced){r=o.events[i][1];break}return function(t){return r?r._inactive?c(t):(l=o.parser.defined.includes((0,e$.d)(o.sliceSerialize({start:r.end,end:o.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),a):n(t)};function a(t){return 40===t?e.attempt(e8,u,l?u:c)(t):91===t?e.attempt(e7,u,l?s:c)(t):l?u(t):c(t)}function s(t){return e.attempt(te,u,c)(t)}function u(e){return t(e)}function c(e){return r._balanced=!0,n(e)}}},e8={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return(0,ew.z3)(t)?eV(e,l)(t):l(t)}function l(t){return 41===t?u(t):eH(e,o,i,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function o(t){return(0,ew.z3)(t)?eV(e,a)(t):u(t)}function i(e){return n(e)}function a(t){return 34===t||39===t||40===t?eN(e,s,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):u(t)}function s(t){return(0,ew.z3)(t)?eV(e,u)(t):u(t)}function u(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},e7={tokenize:function(e,t,n){let r=this;return function(t){return eB.call(r,e,l,o,"reference","referenceMarker","referenceString")(t)};function l(e){return r.parser.defined.includes((0,e$.d)(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}},te={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}},tt={name:"labelStartImage",resolveAll:e6.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),l};function l(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),o):n(t)}function o(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};var tn=n(62987);let tr={name:"attention",resolveAll:function(e,t){let n,r,l,o,i,a,s,u,c=-1;for(;++c<e.length;)if("enter"===e[c][0]&&"attentionSequence"===e[c][1].type&&e[c][1]._close){for(n=c;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[
27n][1]).charCodeAt(0)===t.sliceSerialize(e[c][1]).charCodeAt(0)){if((e[n][1]._close||e[c][1]._open)&&(e[c][1].end.offset-e[c][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[c][1].end.offset-e[c][1].start.offset)%3))continue;a=e[n][1].end.offset-e[n][1].start.offset>1&&e[c][1].end.offset-e[c][1].start.offset>1?2:1;let d={...e[n][1].end},p={...e[c][1].start};tl(d,-a),tl(p,a),o={type:a>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},i={type:a>1?"strongSequence":"emphasisSequence",start:{...e[c][1].start},end:p},l={type:a>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[c][1].start}},r={type:a>1?"strong":"emphasis",start:{...o.start},end:{...i.end}},e[n][1].end={...o.start},e[c][1].start={...i.end},s=[],e[n][1].end.offset-e[n][1].start.offset&&(s=(0,eg.V)(s,[["enter",e[n][1],t],["exit",e[n][1],t]])),s=(0,eg.V)(s,[["enter",r,t],["enter",o,t],["exit",o,t],["enter",l,t]]),s=(0,eg.V)(s,(0,e9.C)(t.parser.constructs.insideSpan.null,e.slice(n+1,c),t)),s=(0,eg.V)(s,[["exit",l,t],["enter",i,t],["exit",i,t],["exit",r,t]]),e[c][1].end.offset-e[c][1].start.offset?(u=2,s=(0,eg.V)(s,[["enter",e[c][1],t],["exit",e[c][1],t]])):u=0,(0,eg.d)(e,n-1,c-n+3,s),c=n+s.length-u-2;break}}for(c=-1;++c<e.length;)"attentionSequence"===e[c][1].type&&(e[c][1].type="data");return e},tokenize:function(e,t){let n;let r=this.parser.constructs.attentionMarkers.null,l=this.previous,o=(0,tn.r)(l);return function(i){return n=i,e.enter("attentionSequence"),function i(a){if(a===n)return e.consume(a),i;let s=e.exit("attentionSequence"),u=(0,tn.r)(a),c=!u||2===u&&o||r.includes(a),d=!o||2===o&&u||r.includes(l);return s._open=!!(42===n?c:c&&(o||!d)),s._close=!!(42===n?d:d&&(u||!c)),t(a)}(i)}}};function tl(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}let to={name:"labelStartLink",resolveAll:e6.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),l};function l(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},ti={42:eO,43:eO,45:eO,48:eO,49:eO,50:eO,51:eO,52:eO,53:eO,54:eO,55:eO,56:eO,57:eO,62:eL},ta={91:{name:"definition",tokenize:function(e,t,n){let r;let l=this;return function(t){return e.enter("definition"),eB.call(l,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)};function o(t){return(r=(0,e$.d)(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)),58===t)?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),i):n(t)}function i(t){return(0,ew.z3)(t)?eV(e,a)(t):a(t)}function a(t){return eH(e,s,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function s(t){return e.attempt(eU,u,u)(t)}function u(t){return(0,ew.xz)(t)?(0,ex.f)(e,c,"whitespace")(t):c(t)}function c(o){return null===o||(0,ew.Ch)(o)?(e.exit("definition"),l.parser.defined.push(r),t(o)):n(o)}}}},ts={[-2]:eG,[-1]:eG,32:eG},tu={35:{name:"headingAtx",resolve:function(e,t){let n,r,l=e.length-2,o=3;return"whitespace"===e[3][1].type&&(o+=2),l-2>o&&"whitespace"===e[l][1].type&&(l-=2),"atxHeadingSequence"===e[l][1].type&&(o===l-1||l-4>o&&"whitespace"===e[l-2][1].type)&&(l-=o+1===l?2:4),l>o&&(n={type:"atxHeadingText",start:e[o][1].start,end:e[l][1].end},r={type:"chunkText",start:e[o][1].start,end:e[l][1].end,contentType:"text"},(0,eg.d)(e,o,l-o+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e},tokenize:function(e,t,n){let r=0;return function(l){return e.enter("atxHeading"),e.enter("atxHeadingSequence"),function l(o){return 35===o&&r++<6?(e.consume(o),l):null===o||(0,ew.z3)(o)?(e.exit("atxHeadingSequence"),function n(r){return 35===r?(e.enter("atxHeadingSequence"),function t(r){return 35===r?(e.consume(r),t):(e.exit("atxHeadingSequence"),n(r))}(r)):null===r||(0,ew.Ch)(r)?(e.exit("atxHeading"),t(r)):(0,ew.xz)(r)?(0,ex.f)(e,n,"whitespace")(r):(e.enter("atxHeadingText"),function t(r){return null===r||35===r||(0,ew.z3)(r)?(e.exit("atxHeadingText"),n(r)):(e.consume(r),t)}(r))}(o)):n(o)}(l)}}},42:eA,45:[eW,eA],60:{concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},tokenize:function(e,t,n){let r,l,o,i,a;let s=this;return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),u};function u(i){return 33===i?(e.consume(i),c):47===i?(e.consume(i),l=!0,h):63===i?(e.consume(i),r=3,s.interrupt?t:Z):(0,ew.jv)(i)?(e.consume(i),o=String.fromCharCode(i),f):n(i)}
27function c(l){return 45===l?(e.consume(l),r=2,d):91===l?(e.consume(l),r=5,i=0,p):(0,ew.jv)(l)?(e.consume(l),r=4,s.interrupt?t:Z):n(l)}function d(r){return 45===r?(e.consume(r),s.interrupt?t:Z):n(r)}function p(r){let l="CDATA[";return r===l.charCodeAt(i++)?(e.consume(r),i===l.length)?s.interrupt?t:k:p:n(r)}function h(t){return(0,ew.jv)(t)?(e.consume(t),o=String.fromCharCode(t),f):n(t)}function f(i){if(null===i||47===i||62===i||(0,ew.z3)(i)){let a=47===i,u=o.toLowerCase();return!a&&!l&&eY.includes(u)?(r=1,s.interrupt?t(i):k(i)):eK.includes(o.toLowerCase())?(r=6,a)?(e.consume(i),g):s.interrupt?t(i):k(i):(r=7,s.interrupt&&!s.parser.lazy[s.now().line]?n(i):l?function t(n){return(0,ew.xz)(n)?(e.consume(n),t):C(n)}(i):m(i))}return 45===i||(0,ew.H$)(i)?(e.consume(i),o+=String.fromCharCode(i),f):n(i)}function g(r){return 62===r?(e.consume(r),s.interrupt?t:k):n(r)}function m(t){return 47===t?(e.consume(t),C):58===t||95===t||(0,ew.jv)(t)?(e.consume(t),b):(0,ew.xz)(t)?(e.consume(t),m):C(t)}function b(t){return 45===t||46===t||58===t||95===t||(0,ew.H$)(t)?(e.consume(t),b):v(t)}function v(t){return 61===t?(e.consume(t),y):(0,ew.xz)(t)?(e.consume(t),v):m(t)}function y(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),a=t,x):(0,ew.xz)(t)?(e.consume(t),y):function t(n){return null===n||34===n||39===n||47===n||60===n||61===n||62===n||96===n||(0,ew.z3)(n)?v(n):(e.consume(n),t)}(t)}function x(t){return t===a?(e.consume(t),a=null,w):null===t||(0,ew.Ch)(t)?n(t):(e.consume(t),x)}function w(e){return 47===e||62===e||(0,ew.xz)(e)?m(e):n(e)}function C(t){return 62===t?(e.consume(t),S):n(t)}function S(t){return null===t||(0,ew.Ch)(t)?k(t):(0,ew.xz)(t)?(e.consume(t),S):n(t)}function k(t){return 45===t&&2===r?(e.consume(t),E):60===t&&1===r?(e.consume(t),M):62===t&&4===r?(e.consume(t),F):63===t&&3===r?(e.consume(t),Z):93===t&&5===r?(e.consume(t),T):(0,ew.Ch)(t)&&(6===r||7===r)?(e.exit("htmlFlowData"),e.check(eX,D,I)(t)):null===t||(0,ew.Ch)(t)?(e.exit("htmlFlowData"),I(t)):(e.consume(t),k)}function I(t){return e.check(eJ,R,D)(t)}function R(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),_}function _(t){return null===t||(0,ew.Ch)(t)?I(t):(e.enter("htmlFlowData"),k(t))}function E(t){return 45===t?(e.consume(t),Z):k(t)}function M(t){return 47===t?(e.consume(t),o="",P):k(t)}function P(t){if(62===t){let n=o.toLowerCase();return eY.includes(n)?(e.consume(t),F):k(t)}return(0,ew.jv)(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):k(t)}function T(t){return 93===t?(e.consume(t),Z):k(t)}function Z(t){return 62===t?(e.consume(t),F):45===t&&2===r?(e.consume(t),Z):k(t)}function F(t){return null===t||(0,ew.Ch)(t)?(e.exit("htmlFlowData"),D(t)):(e.consume(t),F)}function D(n){return e.exit("htmlFlow"),t(n)}}},61:eW,95:eA,96:e0,126:e0},tc={38:e3,92:e4},td={[-5]:e5,[-4]:e5,[-3]:e5,33:tt,38:e3,42:tr,60:[{name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l};function l(t){return(0,ew.jv)(t)?(e.consume(t),o):64===t?n(t):a(t)}function o(t){return 43===t||45===t||46===t||(0,ew.H$)(t)?(r=1,function t(n){return 58===n?(e.consume(n),r=0,i):(43===n||45===n||46===n||(0,ew.H$)(n))&&r++<32?(e.consume(n),t):(r=0,a(n))}(t)):a(t)}function i(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||(0,ew.Av)(r)?n(r):(e.consume(r),i)}function a(t){return 64===t?(e.consume(t),s):(0,ew.n9)(t)?(e.consume(t),a):n(t)}function s(l){return(0,ew.H$)(l)?function l(o){return 46===o?(e.consume(o),r=0,s):62===o?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(o),e.exit("autolinkMarker"),e.exit("autolink"),t):function t(o){if((45===o||(0,ew.H$)(o))&&r++<63){let n=45===o?t:l;return e.consume(o),n}return n(o)}(o)}(l):n(l)}}},{name:"htmlText",tokenize:function(e,t,n){let r,l,o;let i=this;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),a};function a(t){return 33===t?(e.consume(t),s):47===t?(e.consume(t),x):63===t?(e.consume(t),v):(0,ew.jv)(t)?(e.consume(t),C):n(t)}function s(t){return 45===t?(e.consume(t),u):91===t?(e.consume(t),l=0,h):(0,ew.jv)(t)?(e.consume(t),b):n(t)}function u(t){return 45===t?(e.consume(t),p):n(t)}function c(t){return null===t?n(t):45===t?(e.consume(t),d):(0,ew.Ch)(t)?(o=c,P(t)):(e.consume(t),c)}function d(t){return 45===t?(e.consume(t),p):c(t)}function p(e){return 62===e?M(e):45===e?d(e):c(e)}function h(t){let r="CDATA[";return t===r.charCodeAt(l++)?(e.consume(t),l===r.length?f:h):n(t)}function f(t){return null===t?n(t):93===t?(e.consume(t),g):(0,ew.Ch)(t)?(o=f,P(t)):(e.consume(t),f)}function g(t){return 93===t?(e.consume(t),m):f(t)}
27function m(t){return 62===t?M(t):93===t?(e.consume(t),m):f(t)}function b(t){return null===t||62===t?M(t):(0,ew.Ch)(t)?(o=b,P(t)):(e.consume(t),b)}function v(t){return null===t?n(t):63===t?(e.consume(t),y):(0,ew.Ch)(t)?(o=v,P(t)):(e.consume(t),v)}function y(e){return 62===e?M(e):v(e)}function x(t){return(0,ew.jv)(t)?(e.consume(t),w):n(t)}function w(t){return 45===t||(0,ew.H$)(t)?(e.consume(t),w):function t(n){return(0,ew.Ch)(n)?(o=t,P(n)):(0,ew.xz)(n)?(e.consume(n),t):M(n)}(t)}function C(t){return 45===t||(0,ew.H$)(t)?(e.consume(t),C):47===t||62===t||(0,ew.z3)(t)?S(t):n(t)}function S(t){return 47===t?(e.consume(t),M):58===t||95===t||(0,ew.jv)(t)?(e.consume(t),k):(0,ew.Ch)(t)?(o=S,P(t)):(0,ew.xz)(t)?(e.consume(t),S):M(t)}function k(t){return 45===t||46===t||58===t||95===t||(0,ew.H$)(t)?(e.consume(t),k):function t(n){return 61===n?(e.consume(n),I):(0,ew.Ch)(n)?(o=t,P(n)):(0,ew.xz)(n)?(e.consume(n),t):S(n)}(t)}function I(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),r=t,R):(0,ew.Ch)(t)?(o=I,P(t)):(0,ew.xz)(t)?(e.consume(t),I):(e.consume(t),_)}function R(t){return t===r?(e.consume(t),r=void 0,E):null===t?n(t):(0,ew.Ch)(t)?(o=R,P(t)):(e.consume(t),R)}function _(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||(0,ew.z3)(t)?S(t):(e.consume(t),_)}function E(e){return 47===e||62===e||(0,ew.z3)(e)?S(e):n(e)}function M(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function P(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),T}function T(t){return(0,ew.xz)(t)?(0,ex.f)(e,Z,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):Z(t)}function Z(t){return e.enter("htmlTextData"),o(t)}}}],91:to,92:[{name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return(0,ew.Ch)(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}},e4],93:e6,95:tr,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,l=3;if(("lineEnding"===e[3][1].type||"space"===e[l][1].type)&&("lineEnding"===e[r][1].type||"space"===e[r][1].type)){for(t=l;++t<r;)if("codeTextData"===e[t][1].type){e[l][1].type="codeTextPadding",e[r][1].type="codeTextPadding",l+=2,r-=2;break}}for(t=l-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):(t===r||"lineEnding"===e[t][1].type)&&(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,l,o=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),function t(n){return 96===n?(e.consume(n),o++,t):(e.exit("codeTextSequence"),i(n))}(t)};function i(s){return null===s?n(s):32===s?(e.enter("space"),e.consume(s),e.exit("space"),i):96===s?(l=e.enter("codeTextSequence"),r=0,function n(i){return 96===i?(e.consume(i),r++,n):r===o?(e.exit("codeTextSequence"),e.exit("codeText"),t(i)):(l.type="codeTextData",a(i))}(s)):(0,ew.Ch)(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):(e.enter("codeTextData"),a(s))}function a(t){return null===t||32===t||96===t||(0,ew.Ch)(t)?(e.exit("codeTextData"),i(t)):(e.consume(t),a)}}}},tp={null:[tr,eM]},th={null:[42,95]},tf={null:[]},tg=/[\0\t\n\r]/g;function tm(e,t){let n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(65535&n)==65535||(65535&n)==65534||n>1114111?"�":String.fromCodePoint(n)}let tb=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function tv(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){let e=n.charCodeAt(1),t=120===e||88===e;return tm(n.slice(t?2:1),t?16:10)}return e2(n)||e}let ty={}.hasOwnProperty;function tx(e){return{line:e.line,column:e.column,offset:e.offset}}function tw(e,t){if(e)throw Error("Cannot close `"+e.type+"` ("+W({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+W({start:t.start,end:t.end})+") is open");throw Error("Cannot close document, a token (`"+t.type+"`, "+W({start:t.start,end:t.end}
27)+") is still open")}function tC(e){let t=this;t.parser=function(n){var r,o;let i,a,s,u;return"object"==typeof(r={...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})&&(o=r,r=void 0),(function(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(b),autolinkProtocol:u,autolinkEmail:u,atxHeading:r(f),blockQuote:r(function(){return{type:"blockquote",children:[]}}),characterEscape:u,characterReference:u,codeFenced:r(h),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:r(h,l),codeText:r(function(){return{type:"inlineCode",value:""}},l),codeTextData:u,data:u,codeFlowValue:u,definition:r(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:r(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:r(g),hardBreakTrailing:r(g),htmlFlow:r(m,l),htmlFlowData:u,htmlText:r(m,l),htmlTextData:u,image:r(function(){return{type:"image",title:null,url:"",alt:null}}),label:l,link:r(b),listItem:r(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:r(v,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:r(v),paragraph:r(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:r(f),strong:r(function(){return{type:"strong",children:[]}}),thematicBreak:r(function(){return{type:"thematicBreak"}})},exit:{atxHeading:i(),atxHeadingSequence:function(e){let t=this.stack[this.stack.length-1];if(!t.depth){let n=this.sliceSerialize(e).length;t.depth=n}},autolink:i(),autolinkEmail:function(e){c.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){c.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:i(),characterEscapeValue:c,characterReferenceMarkerHexadecimal:p,characterReferenceMarkerNumeric:p,characterReferenceValue:function(e){let t;let n=this.sliceSerialize(e),r=this.data.characterReferenceType;r?(t=tm(n,"characterReferenceMarkerNumeric"===r?10:16),this.data.characterReferenceType=void 0):t=e2(n);let l=this.stack[this.stack.length-1];l.value+=t},characterReference:function(e){this.stack.pop().position.end=tx(e.end)},codeFenced:i(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){let e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:c,codeIndented:i(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:i(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:c,data:c,definition:i(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=(0,e$.d)(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:i(),hardBreakEscape:i(d),hardBreakTrailing:i(d),htmlFlow:i(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:c,htmlText:i(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:c,image:i(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),label:function(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(this.data.inReference=!0,"link"===n.type){let t=e.children;n.children=t}else n.alt=t},labelText:function(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=t.replace(tb,tv),n.identifier=(0,e$.d)(t).toLowerCase()},lineEnding:function(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){n.children[n.children.length-1].position.end=tx(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.t
27ype)&&(u.call(this,e),c.call(this,e))},link:i(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:i(),listOrdered:i(),listUnordered:i(),paragraph:i(),referenceString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=(0,e$.d)(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:i(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:i(),thematicBreak:i()}};(function e(t,n){let r=-1;for(;++r<n.length;){let l=n[r];Array.isArray(l)?e(t,l):function(e,t){let n;for(n in t)if(ty.call(t,n))switch(n){case"canContainEols":{let r=t[n];r&&e[n].push(...r);break}case"transforms":{let r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{let r=t[n];r&&Object.assign(e[n],r)}}}(t,l)}})(t,(e||{}).mdastExtensions||[]);let n={};return function(e){let r={type:"root",children:[]},i={stack:[r],tokenStack:[],config:t,enter:o,exit:a,buffer:l,resume:s,data:n},u=[],c=-1;for(;++c<e.length;)("listOrdered"===e[c][1].type||"listUnordered"===e[c][1].type)&&("enter"===e[c][0]?u.push(c):c=function(e,t,n){let r,l,o,i,a=t-1,s=-1,u=!1;for(;++a<=n;){let t=e[a];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?s++:s--,i=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||i||s||o||(o=a),i=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:i=void 0}if(!s&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===s&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let i=a;for(l=void 0;i--;){let t=e[i];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;l&&(e[l][1].type="lineEndingBlank",u=!0),t[1].type="lineEnding",l=i}else if("linePrefix"===t[1].type||"blockQuotePrefix"===t[1].type||"blockQuotePrefixWhitespace"===t[1].type||"blockQuoteMarker"===t[1].type||"listItemIndent"===t[1].type);else break}o&&(!l||o<l)&&(r._spread=!0),r.end=Object.assign({},l?e[l][1].start:t[1].end),e.splice(l||a,0,["exit",r,t[2]]),a++,n++}if("listItemPrefix"===t[1].type){let l={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=l,e.splice(a,0,["enter",l,t[2]]),a++,n++,o=void 0,i=!0}}}return e[t][1]._spread=u,n}(e,u.pop(),c));for(c=-1;++c<e.length;){let n=t[e[c][0]];ty.call(n,e[c][1].type)&&n[e[c][1].type].call(Object.assign({sliceSerialize:e[c][2].sliceSerialize},i),e[c][1])}if(i.tokenStack.length>0){let e=i.tokenStack[i.tokenStack.length-1];(e[1]||tw).call(i,void 0,e[0])}for(r.position={start:tx(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:tx(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},c=-1;++c<t.transforms.length;)r=t.transforms[c](r)||r;return r};function r(e,t){return function(n){o.call(this,e(n),n),t&&t.call(this,n)}}function l(){this.stack.push({type:"fragment",children:[]})}function o(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:tx(t.start),end:void 0}}function i(e){return function(t){e&&e.call(this,t),a.call(this,t)}}function a(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||tw).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+W({start:e.start,end:e.end})+"): it’s not open");n.position.end=tx(e.end)}function s(){return(0,ef.B)(this.stack.pop())}function u(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&"text"===n.type||((n={type:"text",value:""}).position={start:tx(e.start),end:void 0},t.push(n)),this.stack.push(n)}function c(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=tx(e.end)}function d(){this.data.atHardBreak=!0}function p(e){this.data.characterReferenceType=e.type}function h(){return{type:"code",lang:null,meta:null,value:""}}function f(){return{type:"heading",depth:0,children:[]}}function g(){return{type:"break"}}function m(){return{type:"html",value:""}}function b(){return{type:"link",title:null,url:"",children:[]}}function v(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}})(o)(function(e){for(;!ev(e););return e}((function(e){let t={constructs:(0,ey.W)([l,...(e||{}).extensions||[]]),content:n(eC),defined:[],document:n(eS),flow:n(eE),lazy:{},string:n(eP),text:n(eT)};return t;function n(e){return function(n){return function(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,c
27olumn:n&&n.column||1,offset:n&&n.offset||0},l={},o=[],i=[],a=[],s={attempt:f(function(e,t){g(e,t.from)}),check:f(h),consume:function(e){(0,ew.Ch)(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,m()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===i[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=e},enter:function(e,t){let n=t||{};return n.type=e,n.start=p(),u.events.push(["enter",n,u]),a.push(n),n},exit:function(e){let t=a.pop();return t.end=p(),u.events.push(["exit",t,u]),t},interrupt:f(h,{interrupt:!0})},u={code:null,containerState:{},defineSkip:function(e){l[e.line]=e.column,m()},events:[],now:p,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n,r=-1,l=[];for(;++r<e.length;){let o;let i=e[r];if("string"==typeof i)o=i;else switch(i){case -5:o="\r";break;case -4:o="\n";break;case -3:o="\r\n";break;case -2:o=t?" ":"	";break;case -1:if(!t&&n)continue;o=" ";break;default:o=String.fromCharCode(i)}n=-2===i,l.push(o)}return l.join("")}(d(e),t)},sliceStream:d,write:function(e){return(i=(0,eg.V)(i,e),function(){let e;for(;r._index<i.length;){let n=i[r._index];if("string"==typeof n)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<n.length;){var t;t=n.charCodeAt(r._bufferIndex),c=c(t)}else c=c(n)}}(),null!==i[i.length-1])?[]:(g(t,0),u.events=(0,e9.C)(o,u.events,u),u.events)}},c=t.tokenize.call(u,s);return t.resolveAll&&o.push(t),u;function d(e){return function(e,t){let n;let r=t.start._index,l=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;if(r===o)n=[e[r].slice(l,i)];else{if(n=e.slice(r,o),l>-1){let e=n[0];"string"==typeof e?n[0]=e.slice(l):n.shift()}i>0&&n.push(e[o].slice(0,i))}return n}(i,e)}function p(){let{_bufferIndex:e,_index:t,line:n,column:l,offset:o}=r;return{_bufferIndex:e,_index:t,line:n,column:l,offset:o}}function h(e,t){t.restore()}function f(e,t){return function(n,l,o){let i,c,d,h;return Array.isArray(n)?f(n):"tokenize"in n?f([n]):function(e){let t=null!==e&&n[e],r=null!==e&&n.null;return f([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(r)?r:r?[r]:[]])(e)};function f(e){return(i=e,c=0,0===e.length)?o:g(e[c])}function g(e){return function(n){return(h=function(){let e=p(),t=u.previous,n=u.currentConstruct,l=u.events.length,o=Array.from(a);return{from:l,restore:function(){r=e,u.previous=t,u.currentConstruct=n,u.events.length=l,a=o,m()}}}(),d=e,e.partial||(u.currentConstruct=e),e.name&&u.parser.constructs.disable.null.includes(e.name))?v(n):e.tokenize.call(t?Object.assign(Object.create(u),t):u,s,b,v)(n)}}function b(t){return e(d,h),l}function v(e){return(h.restore(),++c<i.length)?g(i[c]):o}}}function g(e,t){e.resolveAll&&!o.includes(e)&&o.push(e),e.resolve&&(0,eg.d)(u.events,t,u.events.length-t,e.resolve(u.events.slice(t),u)),e.resolveTo&&(u.events=e.resolveTo(u.events,u))}function m(){r.line in l&&r.column<2&&(r.column=l[r.line],r.offset+=l[r.line]-1)}}(t,e,n)}}})(o).document().write((a=1,s="",u=!0,function(e,t,n){let r,l,o,c,d;let p=[];for(e=s+("string"==typeof e?e.toString():new TextDecoder(t||void 0).decode(e)),o=0,s="",u&&(65279===e.charCodeAt(0)&&o++,u=void 0);o<e.length;){if(tg.lastIndex=o,c=(r=tg.exec(e))&&void 0!==r.index?r.index:e.length,d=e.charCodeAt(c),!r){s=e.slice(o);break}if(10===d&&o===c&&i)p.push(-3),i=void 0;else switch(i&&(p.push(-5),i=void 0),o<c&&(p.push(e.slice(o,c)),a+=c-o),d){case 0:p.push(65533),a++;break;case 9:for(l=4*Math.ceil(a/4),p.push(-2);a++<l;)p.push(-1);break;case 10:p.push(-4),a=1;break;default:i=!0,a=1}o=c+1}return n&&(i&&p.push(-5),s&&p.push(s),p.push(null)),p})(n,r,!0))))}}let tS="object"==typeof self?self:globalThis,tk=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=l=>{if(e.has(l))return e.get(l);let[o,i]=t[l];switch(o){case 0:case -1:return n(i,l);case 1:{let e=n([],l);for(let t of i)e.push(r(t));return e}case 2:{let e=n({},l);for(let[t,n]of i)e[r(t)]=r(n);return e}case 3:return n(new Date(i),l);case 4:{let{source:e,flags:t}=i;return n(new RegExp(e,t),l)}case 5:{let e=n(new Map,l);for(let[t,n]of i)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,l);for(let t of i)e.add(r(t));return e}case 7:{let{name:e,message:t}=i;return n(new tS[e](t),l)}case 8:return n(BigInt(i),l);case"BigInt":return n(Object(BigInt(i)),l);case"ArrayBuffer":return n(new Uint8Array(i).buffer,i);case"DataView":{let{buffer:e}=new Uint8Array(i);return n(new DataView(e),i)}}return n(new tS[o](i),l)};return r},tI=e=>tk(new Map,e)(0),{toString:tR}={},{keys:t_}=Object,tE=e=>{let t=typeof e;if("object"!==t||!e)return[0,t];let n=tR.call(e).slice(8,-1);switch(n){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},tM=([e,t])=>0===e&&("function"===t||"symbol"===t),tP=(e,t,n,r)=>{let l=(e,t)=>
27{let l=r.push(e)-1;return n.set(t,l),l},o=r=>{if(n.has(r))return n.get(r);let[i,a]=tE(r);switch(i){case 0:{let t=r;switch(a){case"bigint":i=8,t=r.toString();break;case"function":case"symbol":if(e)throw TypeError("unable to serialize "+a);t=null;break;case"undefined":return l([-1],r)}return l([i,t],r)}case 1:{if(a){let e=r;return"DataView"===a?e=new Uint8Array(r.buffer):"ArrayBuffer"===a&&(e=new Uint8Array(r)),l([a,[...e]],r)}let e=[],t=l([i,e],r);for(let t of r)e.push(o(t));return t}case 2:{if(a)switch(a){case"BigInt":return l([a,r.toString()],r);case"Boolean":case"Number":case"String":return l([a,r.valueOf()],r)}if(t&&"toJSON"in r)return o(r.toJSON());let n=[],s=l([i,n],r);for(let t of t_(r))(e||!tM(tE(r[t])))&&n.push([o(t),o(r[t])]);return s}case 3:return l([i,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return l([i,{source:e,flags:t}],r)}case 5:{let t=[],n=l([i,t],r);for(let[n,l]of r)(e||!(tM(tE(n))||tM(tE(l))))&&t.push([o(n),o(l)]);return n}case 6:{let t=[],n=l([i,t],r);for(let n of r)(e||!tM(tE(n)))&&t.push(o(n));return n}}let{message:s}=r;return l([i,{name:a,message:s}],r)};return o},tT=(e,{json:t,lossy:n}={})=>{let r=[];return tP(!(t||n),!!t,new Map,r)(e),r};var tZ="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?tI(tT(e,t)):structuredClone(e):(e,t)=>tI(tT(e,t));function tF(e){let t=[],n=-1,r=0,l=0;for(;++n<e.length;){let o=e.charCodeAt(n),i="";if(37===o&&(0,ew.H$)(e.charCodeAt(n+1))&&(0,ew.H$)(e.charCodeAt(n+2)))l=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(i=String.fromCharCode(o));else if(o>55295&&o<57344){let t=e.charCodeAt(n+1);o<56320&&t>56319&&t<57344?(i=String.fromCharCode(o,t),l=1):i="�"}else i=String.fromCharCode(o);i&&(t.push(e.slice(r,n),encodeURIComponent(i)),r=n+l+1,i=""),l&&(n+=l,l=0)}return t.join("")+e.slice(r)}function tD(e,t){let n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function tA(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}var tO=n(21623);function tz(e,t){let n=t.referenceType,r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];let l=e.all(t),o=l[0];o&&"text"===o.type?o.value="["+o.value:l.unshift({type:"text",value:"["});let i=l[l.length-1];return i&&"text"===i.type?i.value+=r:l.push({type:"text",value:r}),l}function tj(e){let t=e.spread;return null==t?e.children.length>1:t}function tL(e,t,n){let r=0,l=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(l-1);for(;9===t||32===t;)l--,t=e.codePointAt(l-1)}return l>r?e.slice(r,l):""}let tH={blockquote:function(e,t){let n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){let n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){let n=t.value?t.value+"\n":"",r={},l=t.lang?t.lang.split(/\s+/):[];l.length>0&&(r.className=["language-"+l[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o={type:"element",tagName:"pre",properties:{},children:[o=e.applyData(t,o)]},e.patch(t,o),o},delete:function(e,t){let n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){let n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){let n;let r="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",l=String(t.identifier).toUpperCase(),o=tF(l.toLowerCase()),i=e.footnoteOrder.indexOf(l),a=e.footnoteCounts.get(l);void 0===a?(a=0,e.footnoteOrder.push(l),n=e.footnoteOrder.length):n=i+1,a+=1,e.footnoteCounts.set(l,a);let s={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+o,id:r+"fnref-"+o+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(n)}]};e.patch(t,s);let u={type:"element",tagName:"sup",properties:{},children:[s]};
27return e.patch(t,u),e.applyData(t,u)},heading:function(e,t){let n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){let n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return tz(e,t);let l={src:tF(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(l.title=r.title);let o={type:"element",tagName:"img",properties:l,children:[]};return e.patch(t,o),e.applyData(t,o)},image:function(e,t){let n={src:tF(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){let n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);let r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return tz(e,t);let l={href:tF(r.url||"")};null!==r.title&&void 0!==r.title&&(l.title=r.title);let o={type:"element",tagName:"a",properties:l,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)},link:function(e,t){let n={href:tF(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){let r=e.all(t),l=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=tj(n[r])}return t}(n):tj(t),o={},i=[];if("boolean"==typeof t.checked){let e;let n=r[0];n&&"element"===n.type&&"p"===n.tagName?e=n:(e={type:"element",tagName:"p",properties:{},children:[]},r.unshift(e)),e.children.length>0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<r.length;){let e=r[a];(l||0!==a||"element"!==e.type||"p"!==e.tagName)&&i.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||l?i.push(e):i.push(...e.children)}let s=r[r.length-1];s&&(l||"element"!==s.type||"p"!==s.tagName)&&i.push({type:"text",value:"\n"});let u={type:"element",tagName:"li",properties:o,children:i};return e.patch(t,u),e.applyData(t,u)},list:function(e,t){let n={},r=e.all(t),l=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++l<r.length;){let e=r[l];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}let o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)},paragraph:function(e,t){let n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){let n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){let n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){let n=e.all(t),r=n.shift(),l=[];if(r){let n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),l.push(n)}if(n.length>0){let r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=G(t.children[1]),i=U(t.children[t.children.length-1]);o&&i&&(r.position={start:o,end:i}),l.push(r)}let o={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,o),e.applyData(t,o)},tableCell:function(e,t){let n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){let r=n?n.children:void 0,l=0===(r?r.indexOf(t):1)?"th":"td",o=n&&"table"===n.type?n.align:void 0,i=o?o.length:t.children.length,a=-1,s=[];for(;++a<i;){let n=t.children[a],r={},i=o?o[a]:void 0;i&&(r.align=i);let u={type:"element",tagName:l,properties:r,children:[]};n&&(u.children=e.all(n),e.patch(n,u),u=e.applyData(n,u)),s.push(u)}let u={type:"element",tagName:"tr",properties:{},children:e.wrap(s,!0)};
27return e.patch(t,u),e.applyData(t,u)},text:function(e,t){let n={type:"text",value:function(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),l=0,o=[];for(;r;)o.push(tL(t.slice(l,r.index),l>0,!0),r[0]),l=r.index+r[0].length,r=n.exec(t);return o.push(tL(t.slice(l),l>0,!1)),o.join("")}(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){let n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:tB,yaml:tB,definition:tB,footnoteDefinition:tB};function tB(){}let tN={}.hasOwnProperty,tV={};function t$(e,t){e.position&&(t.position=function(e){let t=G(e),n=U(e);if(t&&n)return{start:t,end:n}}(e))}function tU(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,l=e.data.hProperties;"string"==typeof t&&("element"===n.type?n.tagName=t:n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}),"element"===n.type&&l&&Object.assign(n.properties,tZ(l)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function tG(e,t){let n=[],r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function tq(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function tW(e,t){let n=function(e,t){let n=t||tV,r=new Map,l=new Map,o={all:function(e){let t=[];if("children"in e){let n=e.children,r=-1;for(;++r<n.length;){let l=o.one(n[r],e);if(l){if(r&&"break"===n[r-1].type&&(Array.isArray(l)||"text"!==l.type||(l.value=tq(l.value)),!Array.isArray(l)&&"element"===l.type)){let e=l.children[0];e&&"text"===e.type&&(e.value=tq(e.value))}Array.isArray(l)?t.push(...l):t.push(l)}}}return t},applyData:tU,definitionById:r,footnoteById:l,footnoteCounts:new Map,footnoteOrder:[],handlers:{...tH,...n.handlers},one:function(e,t){let n=e.type,r=o.handlers[n];if(tN.call(o.handlers,n)&&r)return r(o,e,t);if(o.options.passThrough&&o.options.passThrough.includes(n)){if("children"in e){let{children:t,...n}=e,r=tZ(n);return r.children=o.all(e),r}return tZ(e)}return(o.options.unknownHandler||function(e,t){let n=t.data||{},r="value"in t&&!(tN.call(n,"hProperties")||tN.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)})(o,e,t)},options:n,patch:t$,wrap:tG};return(0,tO.Vn)(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){let t="definition"===e.type?r:l,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),o}(e,t),r=n.one(e,void 0),l=function(e){let t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||tD,r=e.options.footnoteBackLabel||tA,l=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",i=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[],s=-1;for(;++s<e.footnoteOrder.length;){let l=e.footnoteById.get(e.footnoteOrder[s]);if(!l)continue;let o=e.all(l),i=String(l.identifier).toUpperCase(),u=tF(i.toLowerCase()),c=0,d=[],p=e.footnoteCounts.get(i);for(;void 0!==p&&++c<=p;){d.length>0&&d.push({type:"text",value:" "});let e="string"==typeof n?n:n(s,c);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+u+(c>1?"-"+c:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(s,c),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}let h=o[o.length-1];if(h&&"element"===h.type&&"p"===h.tagName){let e=h.children[h.children.length-1];e&&"text"===e.type?e.value+=" ":h.children.push({type:"text",value:" "}),h.children.push(...d)}else o.push(...d);let f={type:"element",tagName:"li",properties:{id:t+"fn-"+u},children:e.wrap(o,!0)};e.patch(l,f),a.push(f)}if(0!==a.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...tZ(i),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)}
27,{type:"text",value:"\n"}]}}(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return l&&((0,o.ok)("children"in i),i.children.push({type:"text",value:"\n"},l)),i}function tK(e,t){return e&&"run"in e?async function(n,r){let l=tW(n,{file:r,...t});await e.run(l,r)}:function(n,r){return tW(n,{file:r,...e||t})}}function tY(e){if(e)throw e}var tX=n(94470);function tJ(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let tQ={basename:function(e,t){let n;if(void 0!==t&&"string"!=typeof t)throw TypeError('"ext" argument must be a string');t0(e);let r=0,l=-1,o=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;o--;)if(47===e.codePointAt(o)){if(n){r=o+1;break}}else l<0&&(n=!0,l=o+1);return l<0?"":e.slice(r,l)}if(t===e)return"";let i=-1,a=t.length-1;for(;o--;)if(47===e.codePointAt(o)){if(n){r=o+1;break}}else i<0&&(n=!0,i=o+1),a>-1&&(e.codePointAt(o)===t.codePointAt(a--)?a<0&&(l=o):(a=-1,l=i));return r===l?l=i:l<0&&(l=e.length),e.slice(r,l)},dirname:function(e){let t;if(t0(e),0===e.length)return".";let n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},extname:function(e){let t;t0(e);let n=e.length,r=-1,l=0,o=-1,i=0;for(;n--;){let a=e.codePointAt(n);if(47===a){if(t){l=n+1;break}continue}r<0&&(t=!0,r=n+1),46===a?o<0?o=n:1!==i&&(i=1):o>-1&&(i=-1)}return o<0||r<0||0===i||1===i&&o===r-1&&o===l+1?"":e.slice(o,r)},join:function(...e){let t,n=-1;for(;++n<e.length;)t0(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){t0(e);let t=47===e.codePointAt(0),n=function(e,t){let n,r,l="",o=0,i=-1,a=0,s=-1;for(;++s<=e.length;){if(s<e.length)n=e.codePointAt(s);else if(47===n)break;else n=47;if(47===n){if(i===s-1||1===a);else if(i!==s-1&&2===a){if(l.length<2||2!==o||46!==l.codePointAt(l.length-1)||46!==l.codePointAt(l.length-2)){if(l.length>2){if((r=l.lastIndexOf("/"))!==l.length-1){r<0?(l="",o=0):o=(l=l.slice(0,r)).length-1-l.lastIndexOf("/"),i=s,a=0;continue}}else if(l.length>0){l="",o=0,i=s,a=0;continue}}t&&(l=l.length>0?l+"/..":"..",o=2)}else l.length>0?l+="/"+e.slice(i+1,s):l=e.slice(i+1,s),o=s-i-1;i=s,a=0}else 46===n&&a>-1?a++:a=-1}return l}(e,!t);return 0!==n.length||t||(n="."),n.length>0&&47===e.codePointAt(e.length-1)&&(n+="/"),t?"/"+n:n}(t)},sep:"/"};function t0(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}let t1={cwd:function(){return"/"}};function t2(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let t3=["history","path","basename","stem","extname","dirname"];class t4{constructor(e){let t,n;t=e?t2(e)?{path:e}:"string"==typeof e||e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e?{value:e}:e:{},this.cwd="cwd"in t?"":t1.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<t3.length;){let e=t3[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)t3.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?tQ.basename(this.path):void 0}set basename(e){t9(e,"basename"),t5(e,"basename"),this.path=tQ.join(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?tQ.dirname(this.path):void 0}set dirname(e){t6(this.basename,"dirname"),this.path=tQ.join(e||"",this.basename)}get extname(){return"string"==typeof this.path?tQ.extname(this.path):void 0}set extname(e){if(t5(e,"extname"),t6(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw Error("`extname` must start with `.`");if(e.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=tQ.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){t2(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!t2(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){let e=TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){let e=TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}let t=e.pathname,n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){let e=t.codePointAt(n+2);if(70===e||102===e){let e=TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}(e)),t9(e,"path"),this.path!==e&&this.history.push(e)}
27get stem(){return"string"==typeof this.path?tQ.basename(this.path,this.extname):void 0}set stem(e){t9(e,"stem"),t5(e,"stem"),this.path=tQ.join(this.dirname||"",e+(this.extname||""))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new J(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function t5(e,t){if(e&&e.includes(tQ.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+tQ.sep+"`")}function t9(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function t6(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}let t8=function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},t7={}.hasOwnProperty;class ne extends t8{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=function(){let e=[],t={run:function(...t){let n=-1,r=t.pop();if("function"!=typeof r)throw TypeError("Expected function as last argument, not "+r);(function l(o,...i){let a=e[++n],s=-1;if(o){r(o);return}for(;++s<t.length;)(null===i[s]||void 0===i[s])&&(i[s]=t[s]);t=i,a?(function(e,t){let n;return function(...t){let o;let i=e.length>t.length;i&&t.push(r);try{o=e.apply(this,t)}catch(e){if(i&&n)throw e;return r(e)}i||(o&&o.then&&"function"==typeof o.then?o.then(l,r):o instanceof Error?r(o):l(o))};function r(e,...l){n||(n=!0,t(e,...l))}function l(e){r(null,e)}})(a,l)(...i):r(null,...i)})(null,...t)},use:function(n){if("function"!=typeof n)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}()}copy(){let e=new ne,t=-1;for(;++t<this.attachers.length;){let n=this.attachers[t];e.use(...n)}return e.data(tX(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2==arguments.length?(nl("data",this.frozen),this.namespace[e]=t,this):t7.call(this.namespace,e)&&this.namespace[e]||void 0:e?(nl("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;for(;++this.freezeIndex<this.attachers.length;){let[e,...t]=this.attachers[this.freezeIndex];if(!1===t[0])continue;!0===t[0]&&(t[0]=void 0);let n=e.call(this,...t);"function"==typeof n&&this.transformers.use(n)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();let t=na(e),n=this.parser||this.Parser;return nn("parse",n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),nn("process",this.parser||this.Parser),nr("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,l){let i=na(e),a=n.parse(i);function s(e,n){e||!n?l(e):r?r(n):((0,o.ok)(t,"`done` is defined if `resolve` is not"),t(void 0,n))}n.run(a,i,function(e,t,r){if(e||!t||!r)return s(e);let l=n.stringify(t,r);"string"==typeof l||l&&"object"==typeof l&&"byteLength"in l&&"byteOffset"in l?r.value=l:r.result=l,s(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),nn("processSync",this.parser||this.Parser),nr("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,tY(e),t=r}),ni("processSync","process",n),(0,o.ok)(t,"we either bailed on an error or have a tree"),t}run(e,t,n){no(e),this.freeze();let r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?l(void 0,n):new Promise(l);function l(l,i){(0,o.ok)("function"!=typeof t,"`file` can’t be a `done` anymore, we checked");let a=na(t);r.run(e,a,function(t,r,a){let s=r||e;t?i(t):l?l(s):((0,o.ok)(n,"`done` is defined if `resolve` is not"),n(void 0,s,a))})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){tY(e),n=t,r=!0}),ni("runSync","run",r),(0,o.ok)(n,"we either bailed on an error or have a tree"),n}stringify(e,t){this.freeze();let n=na(t),r=this.compiler||this.Compiler;return nr("stringify",r),no(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(nl("use",this.frozen),null==e);else if("function"==typeof e)i(e,t);else if("object"==typeof e)Array.isArray(e)?o(e):l(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function l(e){if(!("plugins"in e)&&!("settings"in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=tX(!0,r.settings,e.settings))}function o(e){let t=-1;if(null==e);else if(Array.isArray(e))for(;++t<e.length;)!function(e){if("function"==typeof e)i(e,[]);else if("object"==typeof e){if(Array.isArray(e)){let[t,...n]=e;i(t,n)}else l(e)}else throw TypeError("Expected usable value, not `"+e+"`")}(e[t]);else throw TypeError("Expected a list of plugins, not `"+e+"`")}function i(e,t){let r=-1,l=-1;for(;++r<n.length;)if(n[r][0]===e){l=r;break}if(-1===l)n.push([e,...t]);else if(t.length>0){let[r,...o]=t,i=n[l][1];tJ(i)&&tJ(r)&&(r=tX(!0,i,r)),n[l]=[e,r,...o]}}}}
27let nt=new ne().freeze();function nn(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `parser`")}function nr(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `compiler`")}function nl(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function no(e){if(!tJ(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function ni(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function na(e){return e&&"object"==typeof e&&"message"in e&&"messages"in e?e:new t4(e)}let ns=[],nu={allowDangerousHtml:!0},nc=/^(https?|ircs?|mailto|xmpp)$/i,nd=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function np(e){let t=function(e){let t=e.rehypePlugins||ns,n=e.remarkPlugins||ns,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...nu}:nu;return nt().use(tC).use(n).use(tK,r).use(t)}(e),n=function(e){let t=e.children||"",n=new t4;return"string"==typeof t?n.value=t:(0,o.t1)("Unexpected value `"+t+"` for `children` prop, expected `string`"),n}(e);return function(e,t){let n=t.allowedElements,r=t.allowElement,l=t.components,i=t.disallowedElements,a=t.skipHtml,s=t.unwrapDisallowed,u=t.urlTransform||nh;for(let e of nd)Object.hasOwn(t,e.from)&&(0,o.t1)("Unexpected `"+e.from+"` prop, "+(e.to?"use `"+e.to+"` instead":"remove it")+" (see <https://github.com/remarkjs/react-markdown/blob/main/changelog.md#"+e.id+"> for more info)");return n&&i&&(0,o.t1)("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other"),(0,tO.Vn)(e,function(e,t,l){if("raw"===e.type&&l&&"number"==typeof t)return a?l.children.splice(t,1):l.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in ep)if(Object.hasOwn(ep,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=ep[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=u(String(n||""),t,e))}}if("element"===e.type){let o=n?!n.includes(e.tagName):!!i&&i.includes(e.tagName);if(!o&&r&&"number"==typeof t&&(o=!r(e,t,l)),o&&l&&"number"==typeof t)return s&&e.children?l.children.splice(t,1,...e.children):l.children.splice(t,1),t}}),function(e,t){var n,r,l;let o;if(!t||void 0===t.Fragment)throw TypeError("Expected `Fragment` in options");let i=t.filePath||void 0;if(t.development){if("function"!=typeof t.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");n=t.jsxDEV,o=function(e,t,r,l){let o=Array.isArray(r.children),a=G(e);return n(t,r,l,o,{columnNumber:a?a.column-1:void 0,fileName:i,lineNumber:a?a.line:void 0},void 0)}}else{if("function"!=typeof t.jsx)throw TypeError("Expected `jsx` in production options");
27if("function"!=typeof t.jsxs)throw TypeError("Expected `jsxs` in production options");r=t.jsx,l=t.jsxs,o=function(e,t,n,o){let i=Array.isArray(n.children)?l:r;return o?i(t,n,o):i(t,n)}}let a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:o,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:i,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?z:O,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},s=eo(a,e,void 0);return s&&"string"!=typeof s?s:a.create(e,a.Fragment,{children:s||void 0},void 0)}(e,{Fragment:eh.Fragment,components:l,ignoreInvalidStyle:!0,jsx:eh.jsx,jsxs:eh.jsxs,passKeys:!0,passNode:!0})}(t.runSync(t.parse(n),n),e)}function nh(e){let t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),l=e.indexOf("/");return -1===t||-1!==l&&t>l||-1!==n&&t>n||-1!==r&&t>r||nc.test(e.slice(0,t))?e:""}},4958:function(e,t,n){"use strict";function r(e,t){let n=String(e);if("string"!=typeof t)throw TypeError("Expected character");let r=0,l=n.indexOf(t);for(;-1!==l;)r++,l=n.indexOf(t,l+t.length);return r}n.d(t,{Z:function(){return eD}});var l=n(24345),o=n(15459),i=n(88718),a=n(96093);let s="phrasing",u=["autolink","link","image","label"];function c(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function d(e){this.config.enter.autolinkProtocol.call(this,e)}function p(e){this.config.exit.autolinkProtocol.call(this,e)}function h(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];(0,l.ok)("link"===t.type),t.url="http://"+this.sliceSerialize(e)}function f(e){this.config.exit.autolinkEmail.call(this,e)}function g(e){this.exit(e)}function m(e){!function(e,t,n){let r=(0,a.O)((n||{}).ignore||[]),l=function(e){let t=[];if(!Array.isArray(e))throw TypeError("Expected find and replace tuple or list of tuples");let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){var l;let e=n[r];t.push(["string"==typeof(l=e[0])?RegExp(function(e){if("string"!=typeof e)throw TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(l),"g"):l,function(e){return"function"==typeof e?e:function(){return e}}(e[1])])}return t}(t),o=-1;for(;++o<l.length;)(0,i.S4)(e,"text",s);function s(e,t){let n,i=-1;for(;++i<t.length;){let e=t[i],l=n?n.children:void 0;if(r(e,l?l.indexOf(e):void 0,n))return;n=e}if(n)return function(e,t){let n=t[t.length-1],r=l[o][0],i=l[o][1],a=0,s=n.children.indexOf(e),u=!1,c=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,l={index:d.index,input:d.input,stack:[...t,e]},o=i(...d,l);if("string"==typeof o&&(o=o.length>0?{type:"text",value:o}:void 0),!1===o?r.lastIndex=n+1:(a!==n&&c.push({type:"text",value:e.value.slice(a,n)}),Array.isArray(o)?c.push(...o):o&&c.push(o),a=n+d[0].length,u=!0),!r.global)break;d=r.exec(e.value)}return u?(a<e.value.length&&c.push({type:"text",value:e.value.slice(a)}),n.children.splice(s,1,...c)):c=[e],s+c.length}(e,t)}}(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,b],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,v]],{ignore:["link","linkReference"]})}function b(e,t,n,l,o){let i="";if(!y(o)||(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!function(e){let t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}(n)))return!1;let a=function(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],l=n.indexOf(")"),o=r(e,"("),i=r(e,")");for(;-1!==l&&o>i;)e+=n.slice(0,l+1),l=(n=n.slice(l+1)).indexOf(")"),i++;return[e,n]}(n+l);if(!a[0])return!1;let s={type:"link",title:null,url:i+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[s,{type:"text",value:a[1]}]:s}function v(e,t,n,r){return!(!y(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function y(e,t){let n=e.input.charCodeAt(e.index-1);return(0===e.index||(0,o.B8)(n)||(0,o.Xh)(n))&&(!t||47!==n)}var x=n(49411);function w(){this.buffer()}function C(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function S(){this.buffer()}function k(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function I(e){let t=this.resume(),n=this.stack[this.stack.length-1];(0,l.ok)("footnoteReference"===n.type),n.identifier=(0,x.d)(this.sliceSerialize(e)).toLowerCase(),n.label=t}function R(e){this.exit(e)}function _(e){let t=this.resume(),n=this.stack[this.stack.length-1];(0,l.ok)("footnoteDefinition"===n.type),n.identifier=(0,x.d)(this.sliceSerialize(e)).toLowerCase(),n.label=t}function E(e){this.exit(e)}function M(e,t,n,r){let l=n.createTracker(r),o=l.move("[^"),i=n.enter("footnoteReference"),a=n.enter("reference");return o+=l.move(n.safe(n.associationId(e),{after:"]",before:o})),a(),i(),o+=l.move("]")}function P(e,t,n){return 0===t?e:T(e,t,n)}function T(e,t,n){return(n?"":"    ")+e}M.peek=function(){return"["};let Z=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function F(e){this.enter({type:"delete",children:[]},e)}function D(e){this.exit(e)}function A(e,t,n,r){let l=n.createTracker(r),o=n.enter("strikethrough"),i=l.move("~~");return i+=n.containerPhrasing(e,{...l.current(),before:i,after:"~"})+l.move("~~"),o(),i}function O(e){return e.length}function z(e){let t="string"==typeof e?e.codePointAt(0):0;return 67===t||99===t?99:76===t||108===t?108:82===t||114===t?114:0}A.peek=function(){return"~"};var j=n(62987);n(21623);var L=n(27962);function H(e,t,n){let r=e.value||"",l="`",o=-1;for(;RegExp("(^|[^`])"+l+"([^`]|$)").test(r);)l+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){let e;let t=n.unsafe[o],l=n.compilePattern(t);if(t.atBreak)for(;e=l.exec(r);){let t=e.index;10===r.charCodeAt(t)&&13===r.charCodeAt(t-1)&&t--,r=r.slice(0,t)+" "+r.slice(e.index+1)}}return l+r+l}H.peek=function(){return"`"},(0,a.O)(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);let B=function(e,t,n,r){let l=function(e){let t=e.options.listItemIndent||"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n),o=n.bulletCurrent||function(e){let t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}(n);t&&"list"===t.type&&t.ordered&&(o=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+o);let i=o.length+1;("tab"===l||"mixed"===l&&(t&&"list"===t.type&&t.spread||e.spread))&&(i=4*Math.ceil(i/4));let a=n.createTracker(r);a.move(o+" ".repeat(i-o.length)),a.shift(i);let s=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,a.current()),function(e,t,n){return t?(n?"":" ".repeat(i))+e:(n?o:o+" ".repeat(i-o.length))+e});return s(),u};function N(e){let t=e._align;(0,l.ok)(t,"expected `_align` on table"),this.enter({type:"table",align:t.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function V(e){this.exit(e),this.data.inTable=void 0}function $(e){this.enter({type:"tableRow",children:[]},e)}function U(e){this.exit(e)}function G(e){this.enter({type:"tableCell",children:[]},e)}function q(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,W));let n=this.stack[this.stack.length-1];(0,l.ok)("inlineCode"===n.type),n.value=t,this.exit(e)}function W(e,t){return"|"===t?t:e}function K(e){let t=this.stack[this.stack.length-2];(0,l.ok)("listItem"===t.type),t.checked="taskListCheckValueChecked"===e.type}function Y(e){let t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"==typeof t.checked){let e=this.stack[this.stack.length-1];(0,l.ok)("paragraph"===e.type);let n=e.children[0];if(n&&"text"===n.type){let r;let l=t.children,o=-1;for(;++o<l.length;){let e=l[o];if("paragraph"===e.type){r=e;break}}r===e&&(n.value=n.value.slice(1),0===n.value.length?e.children.shift():e.position&&n.position&&"number"==typeof n.position.start.offset&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function X(e,t,n,r){let l=e.children[0],o="boolean"==typeof e.checked&&l&&"paragraph"===l.type,i="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);o&&a.move(i);let s=B(e,t,n,{...r,...a.current()});return o&&(s=s.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(e){return e+i})),s}var J=n(4663);let Q={tokenize:function(e,t,n){let r=0;return function t(o){return(87===o||119===o)&&r<3?(r++,e.consume(o),t):46===o&&3===r?(e.consume(o),l):n(o)};function l(e){return null===e?n(e):t(e)}},partial:!0},ee={tokenize:function(e,t,n){let r,l,i;return a;function a(t){return 46===t||95===t?e.check(en,u,s)(t):null===t||(0,o.z3)(t)||(0,o.B8)(t)||45!==t&&(0,o.Xh)(t)?u(t):(i=!0,e.consume(t),a)}function s(t){return 95===t?r=!0:(l=r,r=void 0),e.consume(t),a}function u(e){return l||r||!i?n(e):t(e)}},partial:!0},et={tokenize:function(e,t){let n=0,r=0;return l;function l(a){return 40===a?(n++,e.consume(a),l):41===a&&r<n?i(a):33===a||34===a||38===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||
2760===a||63===a||93===a||95===a||126===a?e.check(en,t,i)(a):null===a||(0,o.z3)(a)||(0,o.B8)(a)?t(a):(e.consume(a),l)}function i(t){return 41===t&&r++,e.consume(t),l}},partial:!0},en={tokenize:function(e,t,n){return r;function r(a){return 33===a||34===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||63===a||95===a||126===a?(e.consume(a),r):38===a?(e.consume(a),i):93===a?(e.consume(a),l):60===a||null===a||(0,o.z3)(a)||(0,o.B8)(a)?t(a):n(a)}function l(e){return null===e||40===e||91===e||(0,o.z3)(e)||(0,o.B8)(e)?t(e):r(e)}function i(t){return(0,o.jv)(t)?function t(l){return 59===l?(e.consume(l),r):(0,o.jv)(l)?(e.consume(l),t):n(l)}(t):n(t)}},partial:!0},er={tokenize:function(e,t,n){return function(t){return e.consume(t),r};function r(e){return(0,o.H$)(e)?n(e):t(e)}},partial:!0},el={name:"wwwAutolink",tokenize:function(e,t,n){let r=this;return function(t){return 87!==t&&119!==t||!eu.call(r,r.previous)||eh(r.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Q,e.attempt(ee,e.attempt(et,l),n),n)(t))};function l(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:eu},eo={name:"protocolAutolink",tokenize:function(e,t,n){let r=this,l="",i=!1;return function(t){return(72===t||104===t)&&ec.call(r,r.previous)&&!eh(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(t),e.consume(t),a):n(t)};function a(t){if((0,o.jv)(t)&&l.length<5)return l+=String.fromCodePoint(t),e.consume(t),a;if(58===t){let n=l.toLowerCase();if("http"===n||"https"===n)return e.consume(t),s}return n(t)}function s(t){return 47===t?(e.consume(t),i)?u:(i=!0,s):n(t)}function u(t){return null===t||(0,o.Av)(t)||(0,o.z3)(t)||(0,o.B8)(t)||(0,o.Xh)(t)?n(t):e.attempt(ee,e.attempt(et,c),n)(t)}function c(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:ec},ei={name:"emailAutolink",tokenize:function(e,t,n){let r,l;let i=this;return function(t){return!ep(t)||!ed.call(i,i.previous)||eh(i.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),function t(r){return ep(r)?(e.consume(r),t):64===r?(e.consume(r),a):n(r)}(t))};function a(t){return 46===t?e.check(er,u,s)(t):45===t||95===t||(0,o.H$)(t)?(l=!0,e.consume(t),a):u(t)}function s(t){return e.consume(t),r=!0,a}function u(a){return l&&r&&(0,o.jv)(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(a)):n(a)}},previous:ed},ea={},es=48;for(;es<123;)ea[es]=ei,58==++es?es=65:91===es&&(es=97);function eu(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||(0,o.z3)(e)}function ec(e){return!(0,o.jv)(e)}function ed(e){return!(47===e||ep(e))}function ep(e){return 43===e||45===e||46===e||95===e||(0,o.H$)(e)}function eh(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if(("labelLink"===r.type||"labelImage"===r.type)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}ea[43]=ei,ea[45]=ei,ea[46]=ei,ea[95]=ei,ea[72]=[ei,eo],ea[104]=[ei,eo],ea[87]=[ei,el],ea[119]=[ei,el];var ef=n(23402),eg=n(42761);let em={tokenize:function(e,t,n){let r=this;return(0,eg.f)(e,function(e){let l=r.events[r.events.length-1];return l&&"gfmFootnoteDefinitionIndent"===l[1].type&&4===l[2].sliceSerialize(l[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function eb(e,t,n){let r;let l=this,o=l.events.length,i=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);for(;o--;){let e=l.events[o][1];if("labelImage"===e.type){r=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(o){if(!r||!r._balanced)return n(o);let a=(0,x.d)(l.sliceSerialize({start:r.end,end:l.now()}));return 94===a.codePointAt(0)&&i.includes(a.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),t(o)):n(o)}}function ev(e,t){let n=e.length;for(;n--;)if("labelImage"===e[n][1].type&&"enter"===e[n][0]){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";let r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;let o={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},i={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",l,t],["exit",l,t],["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}
27function ey(e,t,n){let r;let l=this,i=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]),a=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),s};function s(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(s){if(a>999||93===s&&!r||null===s||91===s||(0,o.z3)(s))return n(s);if(93===s){e.exit("chunkString");let r=e.exit("gfmFootnoteCallString");return i.includes((0,x.d)(l.sliceSerialize(r)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(s)}return(0,o.z3)(s)||(r=!0),a++,e.consume(s),92===s?c:u}function c(t){return 91===t||92===t||93===t?(e.consume(t),a++,u):u(t)}}function ex(e,t,n){let r,l;let i=this,a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]),s=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),u};function u(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(t)}function c(t){if(s>999||93===t&&!l||null===t||91===t||(0,o.z3)(t))return n(t);if(93===t){e.exit("chunkString");let n=e.exit("gfmFootnoteDefinitionLabelString");return r=(0,x.d)(i.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return(0,o.z3)(t)||(l=!0),s++,e.consume(t),92===t?d:c}function d(t){return 91===t||92===t||93===t?(e.consume(t),s++,c):c(t)}function p(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),a.includes(r)||a.push(r),(0,eg.f)(e,h,"gfmFootnoteDefinitionWhitespace")):n(t)}function h(e){return t(e)}}function ew(e,t,n){return e.check(ef.w,t,e.attempt(em,t,n))}function eC(e){e.exit("gfmFootnoteDefinition")}var eS=n(21905),ek=n(63233);class eI{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,r){let l=0;if(0!==n||0!==r.length){for(;l<e.map.length;){if(e.map[l][0]===t){e.map[l][1]+=n,e.map[l][2].push(...r);return}l+=1}e.map.push([t,n,r])}}(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),0===this.map.length)return;let t=this.map.length,n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}}function eR(e,t,n){let r;let l=this,i=0,a=0;return function(e){let t=l.events.length-1;for(;t>-1;){let e=l.events[t][1].type;if("lineEnding"===e||"linePrefix"===e)t--;else break}let r=t>-1?l.events[t][1].type:null,o="tableHead"===r||"tableRow"===r?y:s;return o===y&&l.parser.lazy[l.now().line]?n(e):o(e)};function s(t){return e.enter("tableHead"),e.enter("tableRow"),124===t||(r=!0,a+=1),u(t)}function u(t){return null===t?n(t):(0,o.Ch)(t)?a>1?(a=0,l.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),p):n(t):(0,o.xz)(t)?(0,eg.f)(e,u,"whitespace")(t):(a+=1,r&&(r=!1,i+=1),124===t)?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),r=!0,u):(e.enter("data"),c(t))}function c(t){return null===t||124===t||(0,o.z3)(t)?(e.exit("data"),u(t)):(e.consume(t),92===t?d:c)}function d(t){return 92===t||124===t?(e.consume(t),c):c(t)}function p(t){return(l.interrupt=!1,l.parser.lazy[l.now().line])?n(t):(e.enter("tableDelimiterRow"),r=!1,(0,o.xz)(t))?(0,eg.f)(e,h,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):h(t)}function h(t){return 45===t||58===t?g(t):124===t?(r=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),f):n(t)}function f(t){return(0,o.xz)(t)?(0,eg.f)(e,g,"whitespace")(t):g(t)}function g(t){return 58===t?(a+=1,r=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),m):45===t?(a+=1,m(t)):null===t||(0,o.Ch)(t)?v(t):n(t)}function m(t){return 45===t?(e.enter("tableDelimiterFiller"),function t(n){return 45===n?(e.consume(n),t):58===n?(r=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(n),e.exit("tableDelimiterMarker"),b):(e.exit("tableDelimiterFiller"),b(n))}(t)):n(t)}function b(t){return(0,o.xz)(t)?(0,eg.f)(e,v,"whitespace")(t):v(t)}function v(l){return 124===l?h(l):null===l||(0,o.Ch)(l)?r&&i===a?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(l)):n(l):n(l)}function y(t){return e.enter("tableRow"),x(t)}function x(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),x):null===n||(0,o.Ch)(n)?(e.exit("tableRow"),t(n)):(0,o.xz)(n)?(0,eg.f)(e,x,"whitespace")(n):(e.enter("data"),w(n))}function w(t){return null===t||124===t||(0,o.z3)(t)?(e.exit("data"),x(t)):(e.consume(t),92===t?C:w)}function C(t){return 92===t||124===t?(e.consume(t),w):w(t)}}function e_(e,t){let n,r,l,o=-1,i=!0,a=0,s=[0,0,0,0],u=[0,0,0,0],c=!1,d=0,p=new eI;for(;++o<e.length;){let h=e[o],f=h[1];"enter"===h[0]?"tableHead"===f.type?(c=!1,0!==d&&(eM(p,t,d,n,r),r=void 0,d=0),n={type:"table",start:Object.assign({},f.start),end:Object.assign({},f.end)},p.add(o,0,[["enter",n,t]])):"tableRow"===f.type||"tableDelimiterRow"===f.type?(i=!0,l=void 0,s=[0,0,0,0],u=[0,o+1,0,0],c&&(c=!1,r={type:"tableBody",start:Object.assign({},f.start),end:Object.assign({},f.end)},p.add(o,0,[["enter",r,t]])),a="tableDelimiterRow"===f.type?2:r?3:1):a&&("data"===f.type||"tableDelimiterMarker"===f.type||"tableDelimiterFiller"===f.type)?(i=!1,0===u[2]&&(0!==s[1]&&(u[0]=u[1],l=eE(p,t,s,a,void 0,l),s=[0,0,0,0]),u[2]=o)
27):"tableCellDivider"===f.type&&(i?i=!1:(0!==s[1]&&(u[0]=u[1],l=eE(p,t,s,a,void 0,l)),u=[(s=u)[1],o,0,0])):"tableHead"===f.type?(c=!0,d=o):"tableRow"===f.type||"tableDelimiterRow"===f.type?(d=o,0!==s[1]?(u[0]=u[1],l=eE(p,t,s,a,o,l)):0!==u[1]&&(l=eE(p,t,u,a,o,l)),a=0):a&&("data"===f.type||"tableDelimiterMarker"===f.type||"tableDelimiterFiller"===f.type)&&(u[3]=o)}for(0!==d&&eM(p,t,d,n,r),p.consume(t.events),o=-1;++o<t.events.length;){let e=t.events[o];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=function(e,t){let n=!1,r=[];for(;t<e.length;){let l=e[t];if(n){if("enter"===l[0])"tableContent"===l[1].type&&r.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===l[1].type){if("tableDelimiterMarker"===e[t-1][1].type){let e=r.length-1;r[e]="left"===r[e]?"center":"right"}}else if("tableDelimiterRow"===l[1].type)break}else"enter"===l[0]&&"tableDelimiterRow"===l[1].type&&(n=!0);t+=1}return r}(t.events,o))}return e}function eE(e,t,n,r,l,o){0!==n[0]&&(o.end=Object.assign({},eP(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));let i=eP(t.events,n[1]);if(o={type:1===r?"tableHeader":2===r?"tableDelimiter":"tableData",start:Object.assign({},i),end:Object.assign({},i)},e.add(n[1],0,[["enter",o,t]]),0!==n[2]){let l=eP(t.events,n[2]),o=eP(t.events,n[3]),i={type:"tableContent",start:Object.assign({},l),end:Object.assign({},o)};if(e.add(n[2],0,[["enter",i,t]]),2!==r){let r=t.events[n[2]],l=t.events[n[3]];if(r[1].end=Object.assign({},l[1].end),r[1].type="chunkText",r[1].contentType="text",n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",i,t]])}return void 0!==l&&(o.end=Object.assign({},eP(t.events,l)),e.add(l,0,[["exit",o,t]]),o=void 0),o}function eM(e,t,n,r,l){let o=[],i=eP(t.events,n);l&&(l.end=Object.assign({},i),o.push(["exit",l,t])),r.end=Object.assign({},i),o.push(["exit",r,t]),e.add(n+1,0,o)}function eP(e,t){let n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}let eT={name:"tasklistCheck",tokenize:function(e,t,n){let r=this;return function(t){return null===r.previous&&r._gfmTasklistFirstContentOfListItem?(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),l):n(t)};function l(t){return(0,o.z3)(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),i):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),i):n(t)}function i(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(t)}function a(r){return(0,o.Ch)(r)?t(r):(0,o.xz)(r)?e.check({tokenize:eZ},t,n)(r):n(r)}}};function eZ(e,t,n){return(0,eg.f)(e,function(e){return null===e?n(e):t(e)},"whitespace")}let eF={};function eD(e){let t;let n=e||eF,r=this.data(),l=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),i=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);l.push((0,J.W)([{text:ea},{document:{91:{name:"gfmFootnoteDefinition",tokenize:ex,continuation:{tokenize:ew},exit:eC}},text:{91:{name:"gfmFootnoteCall",tokenize:ey},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:eb,resolveTo:ev}}},function(e){let t=(e||{}).singleTilde,n={name:"strikethrough",tokenize:function(e,n,r){let l=this.previous,o=this.events,i=0;return function(a){return 126===l&&"characterEscape"!==o[o.length-1][1].type?r(a):(e.enter("strikethroughSequenceTemporary"),function o(a){let s=(0,j.r)(l);if(126===a)return i>1?r(a):(e.consume(a),i++,o);if(i<2&&!t)return r(a);let u=e.exit("strikethroughSequenceTemporary"),c=(0,j.r)(a);return u._open=!c||2===c&&!!s,u._close=!s||2===s&&!!c,n(a)}(a))}},resolveAll:function(e,t){let n=-1;for(;++n<e.length;)if("enter"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._close){let r=n;for(;r--;)if("exit"===e[r][0]&&"strikethroughSequenceTemporary"===e[r][1].type&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset==e[r][1].end.offset-e[r][1].start.offset){e[n][1].type="strikethroughSequence",e[r][1].type="strikethroughSequence";let l={type:"strikethrough",start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},o={type:"strikethroughText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i=[["enter",l,t],["enter",e[r][1],t],["exit",e[r][1],t],["enter",o,t]],a=t.parser.constructs.insideSpan.null;a&&(0,eS.d)(i,i.length,0,(0,ek.C)(a,e.slice(r+1,n),t)),(0,eS.d)(i,i.length,0,[["exit",o,t],["enter",e[n][1],t],["exit",e[n][1],t],["exit",l,t]]),(0,eS.d)(e,r-1,n-r+3,i),n=r+i.length-2;break}}for(n=-1;++n<e.length;)"strikethroughSequenceTemporary"===e[n][1].type&&(e[n][1].type="data");return e}};return null==t&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}}}(n),{flow:{null:{name:"table",tokenize:eR,resolveAll:e_}}},{text:{91:eT}}])),o.push([{transforms:[m],enter:{literalAutolink:c,literalAutolinkEmail:d,literalAutolinkHttp:d,literalAutolinkWww:d},exit:{literalAutolink:g,literalAutolinkEmail:f,literalAutolinkHttp:p,literalAutolinkWww:h}}
27,{enter:{gfmFootnoteCallString:w,gfmFootnoteCall:C,gfmFootnoteDefinitionLabelString:S,gfmFootnoteDefinition:k},exit:{gfmFootnoteCallString:I,gfmFootnoteCall:R,gfmFootnoteDefinitionLabelString:_,gfmFootnoteDefinition:E}},{canContainEols:["delete"],enter:{strikethrough:F},exit:{strikethrough:D}},{enter:{table:N,tableData:G,tableHeader:G,tableRow:$},exit:{codeText:q,table:V,tableData:U,tableHeader:U,tableRow:U}},{exit:{taskListCheckValueChecked:K,taskListCheckValueUnchecked:K,paragraph:Y}}]),i.push({extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:s,notInConstruct:u},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:s,notInConstruct:u},{character:":",before:"[ps]",after:"\\/",inConstruct:s,notInConstruct:u}]},(t=!1,n&&n.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:function(e,n,r,l){let o=r.createTracker(l),i=o.move("[^"),a=r.enter("footnoteDefinition"),s=r.enter("label");return i+=o.move(r.safe(r.associationId(e),{before:i,after:"]"})),s(),i+=o.move("]:"),e.children&&e.children.length>0&&(o.shift(4),i+=o.move((t?"\n":" ")+r.indentLines(r.containerFlow(e,o.current()),t?T:P))),a(),i},footnoteReference:M},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Z}],handlers:{delete:A}},function(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,l=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[	 :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let r=H(e,t,n);return n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&")),r},table:function(e,t,n,r){return a(function(e,t,n){let r=e.children,l=-1,o=[],i=t.enter("table");for(;++l<r.length;)o[l]=s(r[l],t,n);return i(),o}(e,n,r),e.align)},tableCell:i,tableRow:function(e,t,n,r){let l=a([s(e,n,r)]);return l.slice(0,l.indexOf("\n"))}}};function i(e,t,n,r){let l=n.enter("tableCell"),i=n.enter("phrasing"),a=n.containerPhrasing(e,{...r,before:o,after:o});return i(),l(),a}function a(e,t){return function(e,t){let n=t||{},r=(n.align||[]).concat(),l=n.stringLength||O,o=[],i=[],a=[],s=[],u=0,c=-1;for(;++c<e.length;){let t=[],r=[],o=-1;for(e[c].length>u&&(u=e[c].length);++o<e[c].length;){var d;let i=null==(d=e[c][o])?"":String(d);if(!1!==n.alignDelimiters){let e=l(i);r[o]=e,(void 0===s[o]||e>s[o])&&(s[o]=e)}t.push(i)}i[c]=t,a[c]=r}let p=-1;if("object"==typeof r&&"length"in r)for(;++p<u;)o[p]=z(r[p]);else{let e=z(r);for(;++p<u;)o[p]=e}p=-1;let h=[],f=[];for(;++p<u;){let e=o[p],t="",r="";99===e?(t=":",r=":"):108===e?t=":":114===e&&(r=":");let l=!1===n.alignDelimiters?1:Math.max(1,s[p]-t.length-r.length),i=t+"-".repeat(l)+r;!1!==n.alignDelimiters&&((l=t.length+l+r.length)>s[p]&&(s[p]=l),f[p]=l),h[p]=i}i.splice(1,0,h),a.splice(1,0,f),c=-1;let g=[];for(;++c<i.length;){let e=i[c],t=a[c];p=-1;let r=[];for(;++p<u;){let l=e[p]||"",i="",a="";if(!1!==n.alignDelimiters){let e=s[p]-(t[p]||0),n=o[p];114===n?i=" ".repeat(e):99===n?e%2?(i=" ".repeat(e/2+.5),a=" ".repeat(e/2-.5)):a=i=" ".repeat(e/2):a=" ".repeat(e)}!1===n.delimiterStart||p||r.push("|"),!1!==n.padding&&!(!1===n.alignDelimiters&&""===l)&&(!1!==n.delimiterStart||p)&&r.push(" "),!1!==n.alignDelimiters&&r.push(i),r.push(l),!1!==n.alignDelimiters&&r.push(a),!1!==n.padding&&r.push(" "),(!1!==n.delimiterEnd||p!==u-1)&&r.push("|")}g.push(!1===n.delimiterEnd?r.join("").replace(/ +$/,""):r.join(""))}return g.join("\n")}(e,{align:t,alignDelimiters:r,padding:n,stringLength:l})}function s(e,t,n){let r=e.children,l=-1,o=[],a=t.enter("tableRow");for(;++l<r.length;)o[l]=i(r[l],e,t,n);return a(),o}}(n),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:X}}]})}},96093:function(e,t,n){"use strict";n.d(t,{O:function(){return r}});let r=function(e){if(null==e)return o;if("function"==typeof e)return l(e);if("object"==typeof e)return Array.isArray(e)?function(e){let t=[],n=-1;for(;++n<e.length;)t[n]=r(e[n]);return l(function(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1})}(e):l(function(t){let n;for(n in e)if(t[n]!==e[n])return!1;return!0});if("string"==typeof e)return l(function(t){return t&&t.type===e});throw Error("Expected function, string, or object as test")};function l(e){return function(t,n,r){var l;return!!(null!==(l=t)&&"object"==typeof l&&"type"in l&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function o(){return!0}},88718:function(e,t,n){"use strict";n.d(t,{BK:function(){return o},S4:function(){return i}});var r=n(96093);let l=[],o=!1;function i(e,t,n,i){let a;"function"==typeof t&&"function"!=typeof n?(i=n,n=t):a=t;let s=(0,r.O)(a),u=i?-1:1;(function e(r,a,c){let d=r&&"object"==typeof r?r:{};if("string"==typeof d.type){let e="string"==typeof d.tagName?d.tagName:"string"==typeof d.name?d.name:void 0;Object.defineProperty(p,"name",{value:"node ("+r.type+(e?"<"+e+">":"")+")"})}return p;function p(){var d;let p,h,f,g=l;if((!t||s(r,a,c[c.length-1]||void 0))&&(g=Array.isArray(d=n(r,c))?d:"number"==typeof d?[!0,d]:null==d?l:[d])[0]===o)return g;if("children"in r&&r.children&&r.children&&"skip"!==g[0])for(h=(i?r.children.length:-1)+u,f=c.concat(r);h>-1&&h<r.children.length;){if((p=e(r.children[h],h,f)())[0]===o)return p;h="number"==typeof p[1]?p[1]:h+u}return g}})(e,void 0,[])()}},21623:function(e,t,n){"use strict";n.d(t,{Vn:function(){return l}});var r=n(88718);function l(e,t,n,l){let o,i,a;"function"==typeof t&&"function"!=typeof n?(i=void 0,a=t,o=n):(i=t,a=n,o=l),(0,r.S4)(e,i,function(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return a(e,r,n)},o)}},31993:function(e,t,n){"use strict";n.d(t,{U:function(){return s}});var r=n(67294);let l=e=>{let t;let n=new Set,r=(e,r)=>{let l="function"==typeof e?e(t):e;if(!Object.is(l,t)){let e=t;t=(null!=r?r:"object"!=typeof l||null===l)?l:Object.assign({}
27,t,l),n.forEach(n=>n(t,e))}},l=()=>t,o={setState:r,getState:l,getInitialState:()=>i,subscribe:e=>(n.add(e),()=>n.delete(e))},i=t=e(r,l,o);return o},o=e=>e?l(e):l,i=e=>e,a=e=>{let t=o(e),n=e=>(function(e,t=i){let n=r.useSyncExternalStore(e.subscribe,r.useCallback(()=>t(e.getState()),[e,t]),r.useCallback(()=>t(e.getInitialState()),[e,t]));return r.useDebugValue(n),n})(t,e);return Object.assign(n,t),n},s=e=>e?a(e):a}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.