@agentica/chat 0.31.3 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{VendorConfigurationMovie-u9ds7Mmc.js → VendorConfigurationMovie-Dxxx7TxM.js} +7 -7
- package/dist/assets/bbs/{index-C5IJO4Wm.js → index-DVP_ca8K.js} +1 -1
- package/dist/assets/shopping/{index.html-DS7-USk0.js → index.html-DDvkKU33.js} +1 -1
- package/dist/assets/uploader/{index.html-DGYfzaPf.js → index.html-CH9F8E01.js} +1 -1
- package/dist/bbs/index.html +2 -2
- package/dist/shopping/index.html +2 -2
- package/dist/uploader/index.html +2 -2
- package/package.json +2 -2
package/dist/assets/{VendorConfigurationMovie-u9ds7Mmc.js → VendorConfigurationMovie-Dxxx7TxM.js}
RENAMED
|
@@ -27,7 +27,7 @@ import{O as $Ae,r as un,P as $In,Q as jIn,d as Im,S as HIn,U as zIn,V as jAe,x a
|
|
|
27
27
|
animation: ${TBt} 1.4s ease-in-out infinite;
|
|
28
28
|
`:null,qOn=o=>{const{classes:s,variant:p,color:y,disableShrink:C}=o,N={root:["root",p,`color${fa(y)}`],svg:["svg"],circle:["circle",`circle${fa(p)}`,C&&"circleDisableShrink"]};return Hc(N,HOn,s)},WOn=Ia("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,s[p.variant],s[`color${fa(p.color)}`]]}})(pu(({theme:o})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:o.transitions.create("transform")}},{props:{variant:"indeterminate"},style:zOn||{animation:`${EBt} 1.4s linear infinite`}},...Object.entries(o.palette).filter(Am()).map(([s])=>({props:{color:s},style:{color:(o.vars||o).palette[s].main}}))]}))),KOn=Ia("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(o,s)=>s.svg})({display:"block"}),GOn=Ia("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.circle,s[`circle${fa(p.variant)}`],p.disableShrink&&s.circleDisableShrink]}})(pu(({theme:o})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:o.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:s})=>s.variant==="indeterminate"&&!s.disableShrink,style:UOn||{animation:`${TBt} 1.4s ease-in-out infinite`}}]}))),nIe=un.forwardRef(function(s,p){const y=Su({props:s,name:"MuiCircularProgress"}),{className:C,color:N="primary",disableShrink:L=!1,size:z=40,style:G,thickness:q=3.6,value:nt=0,variant:tt="indeterminate",...et}=y,st={...y,color:N,disableShrink:L,size:z,thickness:q,value:nt,variant:tt},at=qOn(st),It={},Rt={},At={};if(tt==="determinate"){const ee=2*Math.PI*((eC-q)/2);It.strokeDasharray=ee.toFixed(3),At["aria-valuenow"]=Math.round(nt),It.strokeDashoffset=`${((100-nt)/100*ee).toFixed(3)}px`,Rt.transform="rotate(-90deg)"}return le.jsx(WOn,{className:bo(at.root,C),style:{width:z,height:z,...Rt,...G},ownerState:st,ref:p,role:"progressbar",...At,...et,children:le.jsx(KOn,{className:at.svg,ownerState:st,viewBox:`${eC/2} ${eC/2} ${eC} ${eC}`,children:le.jsx(GOn,{className:at.circle,style:It,ownerState:st,cx:eC,cy:eC,r:(eC-q)/2,fill:"none",strokeWidth:q})})})});function YOn(o){return Vc("MuiIconButton",o)}const V7e=au("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),VOn=o=>{const{classes:s,disabled:p,color:y,edge:C,size:N,loading:L}=o,z={root:["root",L&&"loading",p&&"disabled",y!=="default"&&`color${fa(y)}`,C&&`edge${fa(C)}`,`size${fa(N)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]};return Hc(z,YOn,s)},XOn=Ia(GF,{name:"MuiIconButton",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,p.loading&&s.loading,p.color!=="default"&&s[`color${fa(p.color)}`],p.edge&&s[`edge${fa(p.edge)}`],s[`size${fa(p.size)}`]]}})(pu(({theme:o})=>({textAlign:"center",flex:"0 0 auto",fontSize:o.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(o.vars||o).palette.action.active,transition:o.transitions.create("background-color",{duration:o.transitions.duration.shortest}),variants:[{props:s=>!s.disableRipple,style:{"--IconButton-hoverBg":o.vars?`rgba(${o.vars.palette.action.activeChannel} / ${o.vars.palette.action.hoverOpacity})`:Ef(o.palette.action.active,o.palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),pu(({theme:o})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(o.palette).filter(Am()).map(([s])=>({props:{color:s},style:{color:(o.vars||o).palette[s].main}})),...Object.entries(o.palette).filter(Am()).map(([s])=>({props:{color:s},style:{"--IconButton-hoverBg":o.vars?`rgba(${(o.vars||o).palette[s].mainChannel} / ${o.vars.palette.action.hoverOpacity})`:Ef((o.vars||o).palette[s].main,o.palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:o.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:o.typography.pxToRem(28)}}],[`&.${V7e.disabled}`]:{backgroundColor:"transparent",color:(o.vars||o).palette.action.disabled},[`&.${V7e.loading}`]:{color:"transparent"}}))),QOn=Ia("span",{name:"MuiIconButton",slot:"LoadingIndicator",overridesResolver:(o,s)=>s.loadingIndicator})(({theme:o})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(o.vars||o).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),X7e=un.forwardRef(function(s,p){const y=Su({props:s,name:"MuiIconButton"}),{edge:C=!1,children:N,className:L,color:z="default",disabled:G=!1,disableFocusRipple:q=!1,size:nt="medium",id:tt,loading:et=null,loadingIndicator:st,...at}=y,It=XQ(tt),Rt=st??le.jsx(nIe,{"aria-labelledby":It,color:"inherit",size:16}),At={...y,edge:C,color:z,disabled:G,disableFocusRipple:q,loading:et,loadingIndicator:Rt,size:nt},ee=VOn(At);return le.jsxs(XOn,{id:et?It:tt,className:bo(ee.root,L),centerRipple:!0,focusRipple:!q,disabled:G||et,ref:p,...at,ownerState:At,children:[typeof et=="boolean"&&le.jsx("span",{className:ee.loadingWrapper,style:{display:"contents"},children:le.jsx(QOn,{className:ee.loadingIndicator,ownerState:At,children:et&&Rt})}),N]})});function JOn(o){return Vc("MuiAppBar",o)}au("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const ZOn=o=>{const{color:s,position:p,classes:y}=o,C={root:["root",`color${fa(s)}`,`position${fa(p)}`]};return Hc(C,JOn,y)},Q7e=(o,s)=>o?`${o==null?void 0:o.replace(")","")}, ${s})`:s,tNn=Ia(QQ,{name:"MuiAppBar",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,s[`position${fa(p.position)}`],s[`color${fa(p.color)}`]]}})(pu(({theme:o})=>({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0,variants:[{props:{position:"fixed"},style:{position:"fixed",zIndex:(o.vars||o).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}}},{props:{position:"absolute"},style:{position:"absolute",zIndex:(o.vars||o).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"sticky"},style:{position:"sticky",zIndex:(o.vars||o).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"static"},style:{position:"static"}},{props:{position:"relative"},style:{position:"relative"}},{props:{color:"inherit"},style:{"--AppBar-color":"inherit"}},{props:{color:"default"},style:{"--AppBar-background":o.vars?o.vars.palette.AppBar.defaultBg:o.palette.grey[100],"--AppBar-color":o.vars?o.vars.palette.text.primary:o.palette.getContrastText(o.palette.grey[100]),...o.applyStyles("dark",{"--AppBar-background":o.vars?o.vars.palette.AppBar.defaultBg:o.palette.grey[900],"--AppBar-color":o.vars?o.vars.palette.text.primary:o.palette.getContrastText(o.palette.grey[900])})}},...Object.entries(o.palette).filter(Am(["contrastText"])).map(([s])=>({props:{color:s},style:{"--AppBar-background":(o.vars??o).palette[s].main,"--AppBar-color":(o.vars??o).palette[s].contrastText}})),{props:s=>s.enableColorOnDark===!0&&!["inherit","transparent"].includes(s.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)"}},{props:s=>s.enableColorOnDark===!1&&!["inherit","transparent"].includes(s.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...o.applyStyles("dark",{backgroundColor:o.vars?Q7e(o.vars.palette.AppBar.darkBg,"var(--AppBar-background)"):null,color:o.vars?Q7e(o.vars.palette.AppBar.darkColor,"var(--AppBar-color)"):null})}},{props:{color:"transparent"},style:{"--AppBar-background":"transparent","--AppBar-color":"inherit",backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...o.applyStyles("dark",{backgroundImage:"none"})}}]}))),J7e=un.forwardRef(function(s,p){const y=Su({props:s,name:"MuiAppBar"}),{className:C,color:N="primary",enableColorOnDark:L=!1,position:z="fixed",...G}=y,q={...y,color:N,position:z,enableColorOnDark:L},nt=ZOn(q);return le.jsx(tNn,{square:!0,component:"header",ownerState:q,elevation:4,className:bo(nt.root,C,z==="fixed"&&"mui-fixed"),ref:p,...G})});function eNn(o){return typeof o=="function"?o():o}const nNn=un.forwardRef(function(s,p){const{children:y,container:C,disablePortal:N=!1}=s,[L,z]=un.useState(null),G=Im(un.isValidElement(y)?r$(y):null,p);if(bP(()=>{N||z(eNn(C)||document.body)},[C,N]),bP(()=>{if(L&&!N)return W7e(p,L),()=>{W7e(p,null)}},[p,L,N]),N){if(un.isValidElement(y)){const q={ref:G};return un.cloneElement(y,q)}return y}return L&&VIn.createPortal(y,L)}),rNn=s5(le.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function iNn(o){return Vc("MuiChip",o)}const Fu=au("MuiChip",["root","sizeSmall","sizeMedium","colorDefault","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),aNn=o=>{const{classes:s,disabled:p,size:y,color:C,iconColor:N,onDelete:L,clickable:z,variant:G}=o,q={root:["root",G,p&&"disabled",`size${fa(y)}`,`color${fa(C)}`,z&&"clickable",z&&`clickableColor${fa(C)}`,L&&"deletable",L&&`deletableColor${fa(C)}`,`${G}${fa(C)}`],label:["label",`label${fa(y)}`],avatar:["avatar",`avatar${fa(y)}`,`avatarColor${fa(C)}`],icon:["icon",`icon${fa(y)}`,`iconColor${fa(N)}`],deleteIcon:["deleteIcon",`deleteIcon${fa(y)}`,`deleteIconColor${fa(C)}`,`deleteIcon${fa(G)}Color${fa(C)}`]};return Hc(q,iNn,s)},sNn=Ia("div",{name:"MuiChip",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o,{color:y,iconColor:C,clickable:N,onDelete:L,size:z,variant:G}=p;return[{[`& .${Fu.avatar}`]:s.avatar},{[`& .${Fu.avatar}`]:s[`avatar${fa(z)}`]},{[`& .${Fu.avatar}`]:s[`avatarColor${fa(y)}`]},{[`& .${Fu.icon}`]:s.icon},{[`& .${Fu.icon}`]:s[`icon${fa(z)}`]},{[`& .${Fu.icon}`]:s[`iconColor${fa(C)}`]},{[`& .${Fu.deleteIcon}`]:s.deleteIcon},{[`& .${Fu.deleteIcon}`]:s[`deleteIcon${fa(z)}`]},{[`& .${Fu.deleteIcon}`]:s[`deleteIconColor${fa(y)}`]},{[`& .${Fu.deleteIcon}`]:s[`deleteIcon${fa(G)}Color${fa(y)}`]},s.root,s[`size${fa(z)}`],s[`color${fa(y)}`],N&&s.clickable,N&&y!=="default"&&s[`clickableColor${fa(y)})`],L&&s.deletable,L&&y!=="default"&&s[`deletableColor${fa(y)}`],s[G],s[`${G}${fa(y)}`]]}})(pu(({theme:o})=>{const s=o.palette.mode==="light"?o.palette.grey[700]:o.palette.grey[300];return{maxWidth:"100%",fontFamily:o.typography.fontFamily,fontSize:o.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(o.vars||o).palette.text.primary,backgroundColor:(o.vars||o).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:o.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${Fu.disabled}`]:{opacity:(o.vars||o).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${Fu.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:o.vars?o.vars.palette.Chip.defaultAvatarColor:s,fontSize:o.typography.pxToRem(12)},[`& .${Fu.avatarColorPrimary}`]:{color:(o.vars||o).palette.primary.contrastText,backgroundColor:(o.vars||o).palette.primary.dark},[`& .${Fu.avatarColorSecondary}`]:{color:(o.vars||o).palette.secondary.contrastText,backgroundColor:(o.vars||o).palette.secondary.dark},[`& .${Fu.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:o.typography.pxToRem(10)},[`& .${Fu.icon}`]:{marginLeft:5,marginRight:-6},[`& .${Fu.deleteIcon}`]:{WebkitTapHighlightColor:"transparent",color:o.vars?`rgba(${o.vars.palette.text.primaryChannel} / 0.26)`:Ef(o.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:o.vars?`rgba(${o.vars.palette.text.primaryChannel} / 0.4)`:Ef(o.palette.text.primary,.4)}},variants:[{props:{size:"small"},style:{height:24,[`& .${Fu.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${Fu.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(o.palette).filter(Am(["contrastText"])).map(([p])=>({props:{color:p},style:{backgroundColor:(o.vars||o).palette[p].main,color:(o.vars||o).palette[p].contrastText,[`& .${Fu.deleteIcon}`]:{color:o.vars?`rgba(${o.vars.palette[p].contrastTextChannel} / 0.7)`:Ef(o.palette[p].contrastText,.7),"&:hover, &:active":{color:(o.vars||o).palette[p].contrastText}}}})),{props:p=>p.iconColor===p.color,style:{[`& .${Fu.icon}`]:{color:o.vars?o.vars.palette.Chip.defaultIconColor:s}}},{props:p=>p.iconColor===p.color&&p.color!=="default",style:{[`& .${Fu.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:{[`&.${Fu.focusVisible}`]:{backgroundColor:o.vars?`rgba(${o.vars.palette.action.selectedChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.focusOpacity}))`:Ef(o.palette.action.selected,o.palette.action.selectedOpacity+o.palette.action.focusOpacity)}}},...Object.entries(o.palette).filter(Am(["dark"])).map(([p])=>({props:{color:p,onDelete:!0},style:{[`&.${Fu.focusVisible}`]:{background:(o.vars||o).palette[p].dark}}})),{props:{clickable:!0},style:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:o.vars?`rgba(${o.vars.palette.action.selectedChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.hoverOpacity}))`:Ef(o.palette.action.selected,o.palette.action.selectedOpacity+o.palette.action.hoverOpacity)},[`&.${Fu.focusVisible}`]:{backgroundColor:o.vars?`rgba(${o.vars.palette.action.selectedChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.focusOpacity}))`:Ef(o.palette.action.selected,o.palette.action.selectedOpacity+o.palette.action.focusOpacity)},"&:active":{boxShadow:(o.vars||o).shadows[1]}}},...Object.entries(o.palette).filter(Am(["dark"])).map(([p])=>({props:{color:p,clickable:!0},style:{[`&:hover, &.${Fu.focusVisible}`]:{backgroundColor:(o.vars||o).palette[p].dark}}})),{props:{variant:"outlined"},style:{backgroundColor:"transparent",border:o.vars?`1px solid ${o.vars.palette.Chip.defaultBorder}`:`1px solid ${o.palette.mode==="light"?o.palette.grey[400]:o.palette.grey[700]}`,[`&.${Fu.clickable}:hover`]:{backgroundColor:(o.vars||o).palette.action.hover},[`&.${Fu.focusVisible}`]:{backgroundColor:(o.vars||o).palette.action.focus},[`& .${Fu.avatar}`]:{marginLeft:4},[`& .${Fu.avatarSmall}`]:{marginLeft:2},[`& .${Fu.icon}`]:{marginLeft:4},[`& .${Fu.iconSmall}`]:{marginLeft:2},[`& .${Fu.deleteIcon}`]:{marginRight:5},[`& .${Fu.deleteIconSmall}`]:{marginRight:3}}},...Object.entries(o.palette).filter(Am()).map(([p])=>({props:{variant:"outlined",color:p},style:{color:(o.vars||o).palette[p].main,border:`1px solid ${o.vars?`rgba(${o.vars.palette[p].mainChannel} / 0.7)`:Ef(o.palette[p].main,.7)}`,[`&.${Fu.clickable}:hover`]:{backgroundColor:o.vars?`rgba(${o.vars.palette[p].mainChannel} / ${o.vars.palette.action.hoverOpacity})`:Ef(o.palette[p].main,o.palette.action.hoverOpacity)},[`&.${Fu.focusVisible}`]:{backgroundColor:o.vars?`rgba(${o.vars.palette[p].mainChannel} / ${o.vars.palette.action.focusOpacity})`:Ef(o.palette[p].main,o.palette.action.focusOpacity)},[`& .${Fu.deleteIcon}`]:{color:o.vars?`rgba(${o.vars.palette[p].mainChannel} / 0.7)`:Ef(o.palette[p].main,.7),"&:hover, &:active":{color:(o.vars||o).palette[p].main}}}}))]}})),oNn=Ia("span",{name:"MuiChip",slot:"Label",overridesResolver:(o,s)=>{const{ownerState:p}=o,{size:y}=p;return[s.label,s[`label${fa(y)}`]]}})({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap",variants:[{props:{variant:"outlined"},style:{paddingLeft:11,paddingRight:11}},{props:{size:"small"},style:{paddingLeft:8,paddingRight:8}},{props:{size:"small",variant:"outlined"},style:{paddingLeft:7,paddingRight:7}}]});function Z7e(o){return o.key==="Backspace"||o.key==="Delete"}const JQ=un.forwardRef(function(s,p){const y=Su({props:s,name:"MuiChip"}),{avatar:C,className:N,clickable:L,color:z="default",component:G,deleteIcon:q,disabled:nt=!1,icon:tt,label:et,onClick:st,onDelete:at,onKeyDown:It,onKeyUp:Rt,size:At="medium",variant:ee="filled",tabIndex:ae,skipFocusWhenDisabled:ve=!1,...hn}=y,pe=un.useRef(null),pn=Im(pe,p),Yn=li=>{li.stopPropagation(),at&&at(li)},Ln=li=>{li.currentTarget===li.target&&Z7e(li)&&li.preventDefault(),It&&It(li)},zn=li=>{li.currentTarget===li.target&&at&&Z7e(li)&&at(li),Rt&&Rt(li)},Qn=L!==!1&&st?!0:L,ur=Qn||at?GF:G||"div",fi={...y,component:ur,disabled:nt,size:At,color:z,iconColor:un.isValidElement(tt)&&tt.props.color||z,onDelete:!!at,clickable:Qn,variant:ee},pi=aNn(fi),Or=ur===GF?{component:G||"div",focusVisibleClassName:pi.focusVisible,...at&&{disableRipple:!0}}:{};let di=null;at&&(di=q&&un.isValidElement(q)?un.cloneElement(q,{className:bo(q.props.className,pi.deleteIcon),onClick:Yn}):le.jsx(rNn,{className:bo(pi.deleteIcon),onClick:Yn}));let Ea=null;C&&un.isValidElement(C)&&(Ea=un.cloneElement(C,{className:bo(pi.avatar,C.props.className)}));let Qi=null;return tt&&un.isValidElement(tt)&&(Qi=un.cloneElement(tt,{className:bo(pi.icon,tt.props.className)})),le.jsxs(sNn,{as:ur,className:bo(pi.root,N),disabled:Qn&&nt?!0:void 0,onClick:st,onKeyDown:Ln,onKeyUp:zn,ref:pn,tabIndex:ve&&nt?-1:ae,ownerState:fi,...Or,...hn,children:[Ea||Qi,le.jsx(oNn,{className:bo(pi.label),ownerState:fi,children:et}),di]})});function xbt(o){return parseInt(o,10)||0}const cNn={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function uNn(o){for(const s in o)return!1;return!0}function tCe(o){return uNn(o)||o.outerHeightStyle===0&&!o.overflowing}const lNn=un.forwardRef(function(s,p){const{onChange:y,maxRows:C,minRows:N=1,style:L,value:z,...G}=s,{current:q}=un.useRef(z!=null),nt=un.useRef(null),tt=Im(p,nt),et=un.useRef(null),st=un.useRef(null),at=un.useCallback(()=>{const ae=nt.current,ve=st.current;if(!ae||!ve)return;const pe=i5(ae).getComputedStyle(ae);if(pe.width==="0px")return{outerHeightStyle:0,overflowing:!1};ve.style.width=pe.width,ve.value=ae.value||s.placeholder||"x",ve.value.slice(-1)===`
|
|
29
29
|
`&&(ve.value+=" ");const pn=pe.boxSizing,Yn=xbt(pe.paddingBottom)+xbt(pe.paddingTop),Ln=xbt(pe.borderBottomWidth)+xbt(pe.borderTopWidth),zn=ve.scrollHeight;ve.value="x";const Qn=ve.scrollHeight;let ur=zn;N&&(ur=Math.max(Number(N)*Qn,ur)),C&&(ur=Math.min(Number(C)*Qn,ur)),ur=Math.max(ur,Qn);const fi=ur+(pn==="border-box"?Yn+Ln:0),pi=Math.abs(ur-zn)<=1;return{outerHeightStyle:fi,overflowing:pi}},[C,N,s.placeholder]),It=wBt(()=>{const ae=nt.current,ve=at();if(!ae||!ve||tCe(ve))return!1;const hn=ve.outerHeightStyle;return et.current!=null&&et.current!==hn}),Rt=un.useCallback(()=>{const ae=nt.current,ve=at();if(!ae||!ve||tCe(ve))return;const hn=ve.outerHeightStyle;et.current!==hn&&(et.current=hn,ae.style.height=`${hn}px`),ae.style.overflow=ve.overflowing?"hidden":""},[at]),At=un.useRef(-1);bP(()=>{const ae=LFt(Rt),ve=nt==null?void 0:nt.current;if(!ve)return;const hn=i5(ve);hn.addEventListener("resize",ae);let pe;return typeof ResizeObserver<"u"&&(pe=new ResizeObserver(()=>{It()&&(pe.unobserve(ve),cancelAnimationFrame(At.current),Rt(),At.current=requestAnimationFrame(()=>{pe.observe(ve)}))}),pe.observe(ve)),()=>{ae.clear(),cancelAnimationFrame(At.current),hn.removeEventListener("resize",ae),pe&&pe.disconnect()}},[at,Rt,It]),bP(()=>{Rt()});const ee=ae=>{q||Rt(),y&&y(ae)};return le.jsxs(un.Fragment,{children:[le.jsx("textarea",{value:z,onChange:ee,ref:tt,rows:N,style:L,...G}),le.jsx("textarea",{"aria-hidden":!0,className:s.className,readOnly:!0,ref:st,tabIndex:-1,style:{...cNn.shadow,...L,paddingTop:0,paddingBottom:0}})]})});function xC({props:o,states:s,muiFormControl:p}){return s.reduce((y,C)=>(y[C]=o[C],p&&typeof o[C]>"u"&&(y[C]=p[C]),y),{})}const RFt=un.createContext(void 0);function N6(){return un.useContext(RFt)}function eCe(o){return o!=null&&!(Array.isArray(o)&&o.length===0)}function emt(o,s=!1){return o&&(eCe(o.value)&&o.value!==""||s&&eCe(o.defaultValue)&&o.defaultValue!=="")}function hNn(o){return o.startAdornment}function fNn(o){return Vc("MuiInputBase",o)}const YF=au("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var nCe;const Fmt=(o,s)=>{const{ownerState:p}=o;return[s.root,p.formControl&&s.formControl,p.startAdornment&&s.adornedStart,p.endAdornment&&s.adornedEnd,p.error&&s.error,p.size==="small"&&s.sizeSmall,p.multiline&&s.multiline,p.color&&s[`color${fa(p.color)}`],p.fullWidth&&s.fullWidth,p.hiddenLabel&&s.hiddenLabel]},$mt=(o,s)=>{const{ownerState:p}=o;return[s.input,p.size==="small"&&s.inputSizeSmall,p.multiline&&s.inputMultiline,p.type==="search"&&s.inputTypeSearch,p.startAdornment&&s.inputAdornedStart,p.endAdornment&&s.inputAdornedEnd,p.hiddenLabel&&s.inputHiddenLabel]},dNn=o=>{const{classes:s,color:p,disabled:y,error:C,endAdornment:N,focused:L,formControl:z,fullWidth:G,hiddenLabel:q,multiline:nt,readOnly:tt,size:et,startAdornment:st,type:at}=o,It={root:["root",`color${fa(p)}`,y&&"disabled",C&&"error",G&&"fullWidth",L&&"focused",z&&"formControl",et&&et!=="medium"&&`size${fa(et)}`,nt&&"multiline",st&&"adornedStart",N&&"adornedEnd",q&&"hiddenLabel",tt&&"readOnly"],input:["input",y&&"disabled",at==="search"&&"inputTypeSearch",nt&&"inputMultiline",et==="small"&&"inputSizeSmall",q&&"inputHiddenLabel",st&&"inputAdornedStart",N&&"inputAdornedEnd",tt&&"readOnly"]};return Hc(It,fNn,s)},jmt=Ia("div",{name:"MuiInputBase",slot:"Root",overridesResolver:Fmt})(pu(({theme:o})=>({...o.typography.body1,color:(o.vars||o).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${YF.disabled}`]:{color:(o.vars||o).palette.text.disabled,cursor:"default"},variants:[{props:({ownerState:s})=>s.multiline,style:{padding:"4px 0 5px"}},{props:({ownerState:s,size:p})=>s.multiline&&p==="small",style:{paddingTop:1}},{props:({ownerState:s})=>s.fullWidth,style:{width:"100%"}}]}))),Hmt=Ia("input",{name:"MuiInputBase",slot:"Input",overridesResolver:$mt})(pu(({theme:o})=>{const s=o.palette.mode==="light",p={color:"currentColor",...o.vars?{opacity:o.vars.opacity.inputPlaceholder}:{opacity:s?.42:.5},transition:o.transitions.create("opacity",{duration:o.transitions.duration.shorter})},y={opacity:"0 !important"},C=o.vars?{opacity:o.vars.opacity.inputPlaceholder}:{opacity:s?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":p,"&::-moz-placeholder":p,"&::-ms-input-placeholder":p,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${YF.formControl} &`]:{"&::-webkit-input-placeholder":y,"&::-moz-placeholder":y,"&::-ms-input-placeholder":y,"&:focus::-webkit-input-placeholder":C,"&:focus::-moz-placeholder":C,"&:focus::-ms-input-placeholder":C},[`&.${YF.disabled}`]:{opacity:1,WebkitTextFillColor:(o.vars||o).palette.text.disabled},variants:[{props:({ownerState:N})=>!N.disableInjectingGlobalStyles,style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:({ownerState:N})=>N.multiline,style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}})),rCe=XIn({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),DFt=un.forwardRef(function(s,p){const y=Su({props:s,name:"MuiInputBase"}),{"aria-describedby":C,autoComplete:N,autoFocus:L,className:z,color:G,components:q={},componentsProps:nt={},defaultValue:tt,disabled:et,disableInjectingGlobalStyles:st,endAdornment:at,error:It,fullWidth:Rt=!1,id:At,inputComponent:ee="input",inputProps:ae={},inputRef:ve,margin:hn,maxRows:pe,minRows:pn,multiline:Yn=!1,name:Ln,onBlur:zn,onChange:Qn,onClick:ur,onFocus:fi,onKeyDown:pi,onKeyUp:Or,placeholder:di,readOnly:Ea,renderSuffix:Qi,rows:li,size:ze,slotProps:Na={},slots:Ts={},startAdornment:Ke,type:xo="text",value:Ss,...La}=y,zo=ae.value!=null?ae.value:Ss,{current:$u}=un.useRef(zo!=null),gu=un.useRef(),Ds=un.useCallback(su=>{},[]),pc=Im(gu,ve,ae.ref,Ds),[bu,P1]=un.useState(!1),il=N6(),Rh=xC({props:y,muiFormControl:il,states:["color","disabled","error","hiddenLabel","size","required","filled"]});Rh.focused=il?il.focused:bu,un.useEffect(()=>{!il&&et&&bu&&(P1(!1),zn&&zn())},[il,et,bu,zn]);const Mg=il&&il.onFilled,Rg=il&&il.onEmpty,Dg=un.useCallback(su=>{emt(su)?Mg&&Mg():Rg&&Rg()},[Mg,Rg]);bP(()=>{$u&&Dg({value:zo})},[zo,Dg,$u]);const iy=su=>{fi&&fi(su),ae.onFocus&&ae.onFocus(su),il&&il.onFocus?il.onFocus(su):P1(!0)},Yp=su=>{zn&&zn(su),ae.onBlur&&ae.onBlur(su),il&&il.onBlur?il.onBlur(su):P1(!1)},wd=(su,...Bg)=>{if(!$u){const d0=su.target||gu.current;if(d0==null)throw new Error(GAe(1));Dg({value:d0.value})}ae.onChange&&ae.onChange(su,...Bg),Qn&&Qn(su,...Bg)};un.useEffect(()=>{Dg(gu.current)},[]);const Vp=su=>{gu.current&&su.currentTarget===su.target&&gu.current.focus(),ur&&ur(su)};let Ow=ee,Jd=ae;Yn&&Ow==="input"&&(li?Jd={type:void 0,minRows:li,maxRows:li,...Jd}:Jd={type:void 0,maxRows:pe,minRows:pn,...Jd},Ow=lNn);const D3=su=>{Dg(su.animationName==="mui-auto-fill-cancel"?gu.current:{value:"x"})};un.useEffect(()=>{il&&il.setAdornedStart(!!Ke)},[il,Ke]);const Hr={...y,color:Rh.color||"primary",disabled:Rh.disabled,endAdornment:at,error:Rh.error,focused:Rh.focused,formControl:il,fullWidth:Rt,hiddenLabel:Rh.hiddenLabel,multiline:Yn,size:Rh.size,startAdornment:Ke,type:xo},da=dNn(Hr),Ws=Ts.root||q.Root||jmt,gc=Na.root||nt.root||{},Cu=Ts.input||q.Input||Hmt;return Jd={...Jd,...Na.input??nt.input},le.jsxs(un.Fragment,{children:[!st&&typeof rCe=="function"&&(nCe||(nCe=le.jsx(rCe,{}))),le.jsxs(Ws,{...gc,ref:p,onClick:Vp,...La,...!vBt(Ws)&&{ownerState:{...Hr,...gc.ownerState}},className:bo(da.root,gc.className,z,Ea&&"MuiInputBase-readOnly"),children:[Ke,le.jsx(RFt.Provider,{value:null,children:le.jsx(Cu,{"aria-invalid":Rh.error,"aria-describedby":C,autoComplete:N,autoFocus:L,defaultValue:tt,disabled:Rh.disabled,id:At,onAnimationStart:D3,name:Ln,placeholder:di,readOnly:Ea,required:Rh.required,rows:li,value:zo,onKeyDown:pi,onKeyUp:Or,type:xo,...Jd,...!vBt(Cu)&&{as:Ow,ownerState:{...Hr,...Jd.ownerState}},ref:pc,className:bo(da.input,Jd.className,Ea&&"MuiInputBase-readOnly"),onBlur:Yp,onChange:wd,onFocus:iy})}),at,Qi?Qi({...Rh,startAdornment:Ke}):null]})]})});function pNn(o){return Vc("MuiInput",o)}const cQ={...YF,...au("MuiInput",["root","underline","input"])};function gNn(o){return Vc("MuiOutlinedInput",o)}const y6={...YF,...au("MuiOutlinedInput",["root","notchedOutline","input"])};function bNn(o){return Vc("MuiFilledInput",o)}const rP={...YF,...au("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},mNn=s5(le.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),yNn={entering:{opacity:1},entered:{opacity:1}},wNn=un.forwardRef(function(s,p){const y=vP(),C={enter:y.transitions.duration.enteringScreen,exit:y.transitions.duration.leavingScreen},{addEndListener:N,appear:L=!0,children:z,easing:G,in:q,onEnter:nt,onEntered:tt,onEntering:et,onExit:st,onExited:at,onExiting:It,style:Rt,timeout:At=C,TransitionComponent:ee=M3,...ae}=s,ve=un.useRef(null),hn=Im(ve,r$(z),p),pe=pi=>Or=>{if(pi){const di=ve.current;Or===void 0?pi(di):pi(di,Or)}},pn=pe(et),Yn=pe((pi,Or)=>{MFt(pi);const di=gC({style:Rt,timeout:At,easing:G},{mode:"enter"});pi.style.webkitTransition=y.transitions.create("opacity",di),pi.style.transition=y.transitions.create("opacity",di),nt&&nt(pi,Or)}),Ln=pe(tt),zn=pe(It),Qn=pe(pi=>{const Or=gC({style:Rt,timeout:At,easing:G},{mode:"exit"});pi.style.webkitTransition=y.transitions.create("opacity",Or),pi.style.transition=y.transitions.create("opacity",Or),st&&st(pi)}),ur=pe(at),fi=pi=>{N&&N(ve.current,pi)};return le.jsx(ee,{appear:L,in:q,nodeRef:ve,onEnter:Yn,onEntered:Ln,onEntering:pn,onExit:Qn,onExited:ur,onExiting:zn,addEndListener:fi,timeout:At,...ae,children:(pi,{ownerState:Or,...di})=>un.cloneElement(z,{style:{opacity:0,visibility:pi==="exited"&&!q?"hidden":void 0,...yNn[pi],...Rt,...z.props.style},ref:hn,...di})})});function vNn(o){return Vc("MuiBackdrop",o)}au("MuiBackdrop",["root","invisible"]);const _Nn=o=>{const{classes:s,invisible:p}=o;return Hc({root:["root",p&&"invisible"]},vNn,s)},xNn=Ia("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,p.invisible&&s.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),ENn=un.forwardRef(function(s,p){const y=Su({props:s,name:"MuiBackdrop"}),{children:C,className:N,component:L="div",invisible:z=!1,open:G,components:q={},componentsProps:nt={},slotProps:tt={},slots:et={},TransitionComponent:st,transitionDuration:at,...It}=y,Rt={...y,component:L,invisible:z},At=_Nn(Rt),ee={transition:st,root:q.Root,...et},ae={...nt,...tt},ve={slots:ee,slotProps:ae},[hn,pe]=wh("root",{elementType:xNn,externalForwardedProps:ve,className:bo(At.root,N),ownerState:Rt}),[pn,Yn]=wh("transition",{elementType:wNn,externalForwardedProps:ve,ownerState:Rt});return le.jsx(pn,{in:G,timeout:at,...It,...Yn,children:le.jsx(hn,{"aria-hidden":!0,...pe,classes:At,ref:p,children:C})})});function TNn(o){return Vc("MuiButton",o)}const iP=au("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge","loading","loadingWrapper","loadingIconPlaceholder","loadingIndicator","loadingPositionCenter","loadingPositionStart","loadingPositionEnd"]),kNn=un.createContext({}),SNn=un.createContext(void 0),CNn=o=>{const{color:s,disableElevation:p,fullWidth:y,size:C,variant:N,loading:L,loadingPosition:z,classes:G}=o,q={root:["root",L&&"loading",N,`${N}${fa(s)}`,`size${fa(C)}`,`${N}Size${fa(C)}`,`color${fa(s)}`,p&&"disableElevation",y&&"fullWidth",L&&`loadingPosition${fa(z)}`],startIcon:["icon","startIcon",`iconSize${fa(C)}`],endIcon:["icon","endIcon",`iconSize${fa(C)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},nt=Hc(q,TNn,G);return{...G,...nt}},rIe=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],ANn=Ia(GF,{shouldForwardProp:o=>ny(o)||o==="classes",name:"MuiButton",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,s[p.variant],s[`${p.variant}${fa(p.color)}`],s[`size${fa(p.size)}`],s[`${p.variant}Size${fa(p.size)}`],p.color==="inherit"&&s.colorInherit,p.disableElevation&&s.disableElevation,p.fullWidth&&s.fullWidth,p.loading&&s.loading]}})(pu(({theme:o})=>{const s=o.palette.mode==="light"?o.palette.grey[300]:o.palette.grey[800],p=o.palette.mode==="light"?o.palette.grey.A100:o.palette.grey[700];return{...o.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(o.vars||o).shape.borderRadius,transition:o.transitions.create(["background-color","box-shadow","border-color","color"],{duration:o.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${iP.disabled}`]:{color:(o.vars||o).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(o.vars||o).shadows[2],"&:hover":{boxShadow:(o.vars||o).shadows[4],"@media (hover: none)":{boxShadow:(o.vars||o).shadows[2]}},"&:active":{boxShadow:(o.vars||o).shadows[8]},[`&.${iP.focusVisible}`]:{boxShadow:(o.vars||o).shadows[6]},[`&.${iP.disabled}`]:{color:(o.vars||o).palette.action.disabled,boxShadow:(o.vars||o).shadows[0],backgroundColor:(o.vars||o).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${iP.disabled}`]:{border:`1px solid ${(o.vars||o).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(o.palette).filter(Am()).map(([y])=>({props:{color:y},style:{"--variant-textColor":(o.vars||o).palette[y].main,"--variant-outlinedColor":(o.vars||o).palette[y].main,"--variant-outlinedBorder":o.vars?`rgba(${o.vars.palette[y].mainChannel} / 0.5)`:Ef(o.palette[y].main,.5),"--variant-containedColor":(o.vars||o).palette[y].contrastText,"--variant-containedBg":(o.vars||o).palette[y].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(o.vars||o).palette[y].dark,"--variant-textBg":o.vars?`rgba(${o.vars.palette[y].mainChannel} / ${o.vars.palette.action.hoverOpacity})`:Ef(o.palette[y].main,o.palette.action.hoverOpacity),"--variant-outlinedBorder":(o.vars||o).palette[y].main,"--variant-outlinedBg":o.vars?`rgba(${o.vars.palette[y].mainChannel} / ${o.vars.palette.action.hoverOpacity})`:Ef(o.palette[y].main,o.palette.action.hoverOpacity)}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":o.vars?o.vars.palette.Button.inheritContainedBg:s,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":o.vars?o.vars.palette.Button.inheritContainedHoverBg:p,"--variant-textBg":o.vars?`rgba(${o.vars.palette.text.primaryChannel} / ${o.vars.palette.action.hoverOpacity})`:Ef(o.palette.text.primary,o.palette.action.hoverOpacity),"--variant-outlinedBg":o.vars?`rgba(${o.vars.palette.text.primaryChannel} / ${o.vars.palette.action.hoverOpacity})`:Ef(o.palette.text.primary,o.palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:o.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:o.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:o.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:o.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:o.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:o.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${iP.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${iP.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{loadingPosition:"center"},style:{transition:o.transitions.create(["background-color","box-shadow","border-color"],{duration:o.transitions.duration.short}),[`&.${iP.loading}`]:{color:"transparent"}}}]}})),INn=Ia("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.startIcon,p.loading&&s.startIconLoadingStart,s[`iconSize${fa(p.size)}`]]}})(({theme:o})=>({display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},{props:{loadingPosition:"start",loading:!0},style:{transition:o.transitions.create(["opacity"],{duration:o.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"start",loading:!0,fullWidth:!0},style:{marginRight:-8}},...rIe]})),ONn=Ia("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.endIcon,p.loading&&s.endIconLoadingEnd,s[`iconSize${fa(p.size)}`]]}})(({theme:o})=>({display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},{props:{loadingPosition:"end",loading:!0},style:{transition:o.transitions.create(["opacity"],{duration:o.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"end",loading:!0,fullWidth:!0},style:{marginLeft:-8}},...rIe]})),NNn=Ia("span",{name:"MuiButton",slot:"LoadingIndicator",overridesResolver:(o,s)=>s.loadingIndicator})(({theme:o})=>({display:"none",position:"absolute",visibility:"visible",variants:[{props:{loading:!0},style:{display:"flex"}},{props:{loadingPosition:"start"},style:{left:14}},{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(o.vars||o).palette.action.disabled}},{props:{loadingPosition:"end"},style:{right:14}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:{loadingPosition:"start",fullWidth:!0},style:{position:"relative",left:-10}},{props:{loadingPosition:"end",fullWidth:!0},style:{position:"relative",right:-10}}]})),iCe=Ia("span",{name:"MuiButton",slot:"LoadingIconPlaceholder",overridesResolver:(o,s)=>s.loadingIconPlaceholder})({display:"inline-block",width:"1em",height:"1em"}),nmt=un.forwardRef(function(s,p){const y=un.useContext(kNn),C=un.useContext(SNn),N=jAe(y,s),L=Su({props:N,name:"MuiButton"}),{children:z,color:G="primary",component:q="button",className:nt,disabled:tt=!1,disableElevation:et=!1,disableFocusRipple:st=!1,endIcon:at,focusVisibleClassName:It,fullWidth:Rt=!1,id:At,loading:ee=null,loadingIndicator:ae,loadingPosition:ve="center",size:hn="medium",startIcon:pe,type:pn,variant:Yn="text",...Ln}=L,zn=XQ(At),Qn=ae??le.jsx(nIe,{"aria-labelledby":zn,color:"inherit",size:16}),ur={...L,color:G,component:q,disabled:tt,disableElevation:et,disableFocusRipple:st,fullWidth:Rt,loading:ee,loadingIndicator:Qn,loadingPosition:ve,size:hn,type:pn,variant:Yn},fi=CNn(ur),pi=(pe||ee&&ve==="start")&&le.jsx(INn,{className:fi.startIcon,ownerState:ur,children:pe||le.jsx(iCe,{className:fi.loadingIconPlaceholder,ownerState:ur})}),Or=(at||ee&&ve==="end")&&le.jsx(ONn,{className:fi.endIcon,ownerState:ur,children:at||le.jsx(iCe,{className:fi.loadingIconPlaceholder,ownerState:ur})}),di=C||"",Ea=typeof ee=="boolean"?le.jsx("span",{className:fi.loadingWrapper,style:{display:"contents"},children:ee&&le.jsx(NNn,{className:fi.loadingIndicator,ownerState:ur,children:Qn})}):null;return le.jsxs(ANn,{ownerState:ur,className:bo(y.className,fi.root,nt,di),component:q,disabled:tt||ee,focusRipple:!st,focusVisibleClassName:bo(fi.focusVisible,It),ref:p,type:pn,id:ee?zn:At,...Ln,classes:fi,children:[pi,ve!=="end"&&Ea,z,ve==="end"&&Ea,Or]})});function PNn(o){return Vc("MuiCard",o)}au("MuiCard",["root"]);const LNn=o=>{const{classes:s}=o;return Hc({root:["root"]},PNn,s)},MNn=Ia(QQ,{name:"MuiCard",slot:"Root",overridesResolver:(o,s)=>s.root})({overflow:"hidden"}),ZQ=un.forwardRef(function(s,p){const y=Su({props:s,name:"MuiCard"}),{className:C,raised:N=!1,...L}=y,z={...y,raised:N},G=LNn(z);return le.jsx(MNn,{className:bo(G.root,C),elevation:N?8:void 0,ref:p,ownerState:z,...L})});function RNn(o){return Vc("MuiCardActions",o)}au("MuiCardActions",["root","spacing"]);const DNn=o=>{const{classes:s,disableSpacing:p}=o;return Hc({root:["root",!p&&"spacing"]},RNn,s)},BNn=Ia("div",{name:"MuiCardActions",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,!p.disableSpacing&&s.spacing]}})({display:"flex",alignItems:"center",padding:8,variants:[{props:{disableSpacing:!1},style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),iIe=un.forwardRef(function(s,p){const y=Su({props:s,name:"MuiCardActions"}),{disableSpacing:C=!1,className:N,...L}=y,z={...y,disableSpacing:C},G=DNn(z);return le.jsx(BNn,{className:bo(G.root,N),ownerState:z,ref:p,...L})});function FNn(o){return Vc("MuiCardContent",o)}au("MuiCardContent",["root"]);const $Nn=o=>{const{classes:s}=o;return Hc({root:["root"]},FNn,s)},jNn=Ia("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(o,s)=>s.root})({padding:16,"&:last-child":{paddingBottom:24}}),mP=un.forwardRef(function(s,p){const y=Su({props:s,name:"MuiCardContent"}),{className:C,component:N="div",...L}=y,z={...y,component:N},G=$Nn(z);return le.jsx(jNn,{as:N,className:bo(G.root,C),ownerState:z,ref:p,...L})});function HNn(o){return Vc("PrivateSwitchBase",o)}au("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const zNn=o=>{const{classes:s,checked:p,disabled:y,edge:C}=o,N={root:["root",p&&"checked",y&&"disabled",C&&`edge${fa(C)}`],input:["input"]};return Hc(N,HNn,s)},UNn=Ia(GF)({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:o,ownerState:s})=>o==="start"&&s.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:o,ownerState:s})=>o==="end"&&s.size!=="small",style:{marginRight:-12}}]}),qNn=Ia("input",{shouldForwardProp:ny})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),WNn=un.forwardRef(function(s,p){const{autoFocus:y,checked:C,checkedIcon:N,defaultChecked:L,disabled:z,disableFocusRipple:G=!1,edge:q=!1,icon:nt,id:tt,inputProps:et,inputRef:st,name:at,onBlur:It,onChange:Rt,onFocus:At,readOnly:ee,required:ae=!1,tabIndex:ve,type:hn,value:pe,slots:pn={},slotProps:Yn={},...Ln}=s,[zn,Qn]=HQ({controlled:C,default:!!L,name:"SwitchBase",state:"checked"}),ur=N6(),fi=Ss=>{At&&At(Ss),ur&&ur.onFocus&&ur.onFocus(Ss)},pi=Ss=>{It&&It(Ss),ur&&ur.onBlur&&ur.onBlur(Ss)},Or=Ss=>{if(Ss.nativeEvent.defaultPrevented)return;const La=Ss.target.checked;Qn(La),Rt&&Rt(Ss,La)};let di=z;ur&&typeof di>"u"&&(di=ur.disabled);const Ea=hn==="checkbox"||hn==="radio",Qi={...s,checked:zn,disabled:di,disableFocusRipple:G,edge:q},li=zNn(Qi),ze={slots:pn,slotProps:{input:et,...Yn}},[Na,Ts]=wh("root",{ref:p,elementType:UNn,className:li.root,shouldForwardComponentProp:!0,externalForwardedProps:{...ze,component:"span",...Ln},getSlotProps:Ss=>({...Ss,onFocus:La=>{var zo;(zo=Ss.onFocus)==null||zo.call(Ss,La),fi(La)},onBlur:La=>{var zo;(zo=Ss.onBlur)==null||zo.call(Ss,La),pi(La)}}),ownerState:Qi,additionalProps:{centerRipple:!0,focusRipple:!G,disabled:di,role:void 0,tabIndex:null}}),[Ke,xo]=wh("input",{ref:st,elementType:qNn,className:li.input,externalForwardedProps:ze,getSlotProps:Ss=>({onChange:La=>{var zo;(zo=Ss.onChange)==null||zo.call(Ss,La),Or(La)}}),ownerState:Qi,additionalProps:{autoFocus:y,checked:C,defaultChecked:L,disabled:di,id:Ea?tt:void 0,name:at,readOnly:ee,required:ae,tabIndex:ve,type:hn,...hn==="checkbox"&&pe===void 0?{}:{value:pe}}});return le.jsxs(Na,{...Ts,children:[le.jsx(Ke,{...xo}),zn?N:nt]})}),aCe=bOn({createStyledComponent:Ia("div",{name:"MuiContainer",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,s[`maxWidth${fa(String(p.maxWidth))}`],p.fixed&&s.fixed,p.disableGutters&&s.disableGutters]}}),useThemeProps:o=>Su({props:o,name:"MuiContainer"})});function KNn(o){const s=r5(o);return s.body===o?i5(o).innerWidth>s.documentElement.clientWidth:o.scrollHeight>o.clientHeight}function AQ(o,s){s?o.setAttribute("aria-hidden","true"):o.removeAttribute("aria-hidden")}function sCe(o){return parseInt(i5(o).getComputedStyle(o).paddingRight,10)||0}function GNn(o){const p=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(o.tagName),y=o.tagName==="INPUT"&&o.getAttribute("type")==="hidden";return p||y}function oCe(o,s,p,y,C){const N=[s,p,...y];[].forEach.call(o.children,L=>{const z=!N.includes(L),G=!GNn(L);z&&G&&AQ(L,C)})}function DDt(o,s){let p=-1;return o.some((y,C)=>s(y)?(p=C,!0):!1),p}function YNn(o,s){const p=[],y=o.container;if(!s.disableScrollLock){if(KNn(y)){const L=VAe(i5(y));p.push({value:y.style.paddingRight,property:"padding-right",el:y}),y.style.paddingRight=`${sCe(y)+L}px`;const z=r5(y).querySelectorAll(".mui-fixed");[].forEach.call(z,G=>{p.push({value:G.style.paddingRight,property:"padding-right",el:G}),G.style.paddingRight=`${sCe(G)+L}px`})}let N;if(y.parentNode instanceof DocumentFragment)N=r5(y).body;else{const L=y.parentElement,z=i5(y);N=(L==null?void 0:L.nodeName)==="HTML"&&z.getComputedStyle(L).overflowY==="scroll"?L:y}p.push({value:N.style.overflow,property:"overflow",el:N},{value:N.style.overflowX,property:"overflow-x",el:N},{value:N.style.overflowY,property:"overflow-y",el:N}),N.style.overflow="hidden"}return()=>{p.forEach(({value:N,el:L,property:z})=>{N?L.style.setProperty(z,N):L.style.removeProperty(z)})}}function VNn(o){const s=[];return[].forEach.call(o.children,p=>{p.getAttribute("aria-hidden")==="true"&&s.push(p)}),s}class XNn{constructor(){this.modals=[],this.containers=[]}add(s,p){let y=this.modals.indexOf(s);if(y!==-1)return y;y=this.modals.length,this.modals.push(s),s.modalRef&&AQ(s.modalRef,!1);const C=VNn(p);oCe(p,s.mount,s.modalRef,C,!0);const N=DDt(this.containers,L=>L.container===p);return N!==-1?(this.containers[N].modals.push(s),y):(this.containers.push({modals:[s],container:p,restore:null,hiddenSiblings:C}),y)}mount(s,p){const y=DDt(this.containers,N=>N.modals.includes(s)),C=this.containers[y];C.restore||(C.restore=YNn(C,p))}remove(s,p=!0){const y=this.modals.indexOf(s);if(y===-1)return y;const C=DDt(this.containers,L=>L.modals.includes(s)),N=this.containers[C];if(N.modals.splice(N.modals.indexOf(s),1),this.modals.splice(y,1),N.modals.length===0)N.restore&&N.restore(),s.modalRef&&AQ(s.modalRef,p),oCe(N.container,s.mount,s.modalRef,N.hiddenSiblings,!1),this.containers.splice(C,1);else{const L=N.modals[N.modals.length-1];L.modalRef&&AQ(L.modalRef,!1)}return y}isTopModal(s){return this.modals.length>0&&this.modals[this.modals.length-1]===s}}const QNn=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function JNn(o){const s=parseInt(o.getAttribute("tabindex")||"",10);return Number.isNaN(s)?o.contentEditable==="true"||(o.nodeName==="AUDIO"||o.nodeName==="VIDEO"||o.nodeName==="DETAILS")&&o.getAttribute("tabindex")===null?0:o.tabIndex:s}function ZNn(o){if(o.tagName!=="INPUT"||o.type!=="radio"||!o.name)return!1;const s=y=>o.ownerDocument.querySelector(`input[type="radio"]${y}`);let p=s(`[name="${o.name}"]:checked`);return p||(p=s(`[name="${o.name}"]`)),p!==o}function tPn(o){return!(o.disabled||o.tagName==="INPUT"&&o.type==="hidden"||ZNn(o))}function ePn(o){const s=[],p=[];return Array.from(o.querySelectorAll(QNn)).forEach((y,C)=>{const N=JNn(y);N===-1||!tPn(y)||(N===0?s.push(y):p.push({documentOrder:C,tabIndex:N,node:y}))}),p.sort((y,C)=>y.tabIndex===C.tabIndex?y.documentOrder-C.documentOrder:y.tabIndex-C.tabIndex).map(y=>y.node).concat(s)}function nPn(){return!0}function rPn(o){const{children:s,disableAutoFocus:p=!1,disableEnforceFocus:y=!1,disableRestoreFocus:C=!1,getTabbable:N=ePn,isEnabled:L=nPn,open:z}=o,G=un.useRef(!1),q=un.useRef(null),nt=un.useRef(null),tt=un.useRef(null),et=un.useRef(null),st=un.useRef(!1),at=un.useRef(null),It=Im(r$(s),at),Rt=un.useRef(null);un.useEffect(()=>{!z||!at.current||(st.current=!p)},[p,z]),un.useEffect(()=>{if(!z||!at.current)return;const ae=r5(at.current);return at.current.contains(ae.activeElement)||(at.current.hasAttribute("tabIndex")||at.current.setAttribute("tabIndex","-1"),st.current&&at.current.focus()),()=>{C||(tt.current&&tt.current.focus&&(G.current=!0,tt.current.focus()),tt.current=null)}},[z]),un.useEffect(()=>{if(!z||!at.current)return;const ae=r5(at.current),ve=pn=>{Rt.current=pn,!(y||!L()||pn.key!=="Tab")&&ae.activeElement===at.current&&pn.shiftKey&&(G.current=!0,nt.current&&nt.current.focus())},hn=()=>{var Ln,zn;const pn=at.current;if(pn===null)return;if(!ae.hasFocus()||!L()||G.current){G.current=!1;return}if(pn.contains(ae.activeElement)||y&&ae.activeElement!==q.current&&ae.activeElement!==nt.current)return;if(ae.activeElement!==et.current)et.current=null;else if(et.current!==null)return;if(!st.current)return;let Yn=[];if((ae.activeElement===q.current||ae.activeElement===nt.current)&&(Yn=N(at.current)),Yn.length>0){const Qn=!!((Ln=Rt.current)!=null&&Ln.shiftKey&&((zn=Rt.current)==null?void 0:zn.key)==="Tab"),ur=Yn[0],fi=Yn[Yn.length-1];typeof ur!="string"&&typeof fi!="string"&&(Qn?fi.focus():ur.focus())}else pn.focus()};ae.addEventListener("focusin",hn),ae.addEventListener("keydown",ve,!0);const pe=setInterval(()=>{ae.activeElement&&ae.activeElement.tagName==="BODY"&&hn()},50);return()=>{clearInterval(pe),ae.removeEventListener("focusin",hn),ae.removeEventListener("keydown",ve,!0)}},[p,y,C,L,z,N]);const At=ae=>{tt.current===null&&(tt.current=ae.relatedTarget),st.current=!0,et.current=ae.target;const ve=s.props.onFocus;ve&&ve(ae)},ee=ae=>{tt.current===null&&(tt.current=ae.relatedTarget),st.current=!0};return le.jsxs(un.Fragment,{children:[le.jsx("div",{tabIndex:z?0:-1,onFocus:ee,ref:q,"data-testid":"sentinelStart"}),un.cloneElement(s,{ref:It,onFocus:At}),le.jsx("div",{tabIndex:z?0:-1,onFocus:ee,ref:nt,"data-testid":"sentinelEnd"})]})}function iPn(o){return typeof o=="function"?o():o}function aPn(o){return o?o.props.hasOwnProperty("in"):!1}const cCe=()=>{},Ebt=new XNn;function sPn(o){const{container:s,disableEscapeKeyDown:p=!1,disableScrollLock:y=!1,closeAfterTransition:C=!1,onTransitionEnter:N,onTransitionExited:L,children:z,onClose:G,open:q,rootRef:nt}=o,tt=un.useRef({}),et=un.useRef(null),st=un.useRef(null),at=Im(st,nt),[It,Rt]=un.useState(!q),At=aPn(z);let ee=!0;(o["aria-hidden"]==="false"||o["aria-hidden"]===!1)&&(ee=!1);const ae=()=>r5(et.current),ve=()=>(tt.current.modalRef=st.current,tt.current.mount=et.current,tt.current),hn=()=>{Ebt.mount(ve(),{disableScrollLock:y}),st.current&&(st.current.scrollTop=0)},pe=wBt(()=>{const Or=iPn(s)||ae().body;Ebt.add(ve(),Or),st.current&&hn()}),pn=()=>Ebt.isTopModal(ve()),Yn=wBt(Or=>{et.current=Or,Or&&(q&&pn()?hn():st.current&&AQ(st.current,ee))}),Ln=un.useCallback(()=>{Ebt.remove(ve(),ee)},[ee]);un.useEffect(()=>()=>{Ln()},[Ln]),un.useEffect(()=>{q?pe():(!At||!C)&&Ln()},[q,Ln,At,C,pe]);const zn=Or=>di=>{var Ea;(Ea=Or.onKeyDown)==null||Ea.call(Or,di),!(di.key!=="Escape"||di.which===229||!pn())&&(p||(di.stopPropagation(),G&&G(di,"escapeKeyDown")))},Qn=Or=>di=>{var Ea;(Ea=Or.onClick)==null||Ea.call(Or,di),di.target===di.currentTarget&&G&&G(di,"backdropClick")};return{getRootProps:(Or={})=>{const di=QIn(o);delete di.onTransitionEnter,delete di.onTransitionExited;const Ea={...di,...Or};return{role:"presentation",...Ea,onKeyDown:zn(Ea),ref:at}},getBackdropProps:(Or={})=>{const di=Or;return{"aria-hidden":!0,...di,onClick:Qn(di),open:q}},getTransitionProps:()=>{const Or=()=>{Rt(!1),N&&N()},di=()=>{Rt(!0),L&&L(),C&&Ln()};return{onEnter:_Bt(Or,(z==null?void 0:z.props.onEnter)??cCe),onExited:_Bt(di,(z==null?void 0:z.props.onExited)??cCe)}},rootRef:at,portalRef:Yn,isTopModal:pn,exited:It,hasTransition:At}}function oPn(o){return Vc("MuiModal",o)}au("MuiModal",["root","hidden","backdrop"]);const cPn=o=>{const{open:s,exited:p,classes:y}=o;return Hc({root:["root",!s&&p&&"hidden"],backdrop:["backdrop"]},oPn,y)},uPn=Ia("div",{name:"MuiModal",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,!p.open&&p.exited&&s.hidden]}})(pu(({theme:o})=>({position:"fixed",zIndex:(o.vars||o).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:s})=>!s.open&&s.exited,style:{visibility:"hidden"}}]}))),lPn=Ia(ENn,{name:"MuiModal",slot:"Backdrop",overridesResolver:(o,s)=>s.backdrop})({zIndex:-1}),aIe=un.forwardRef(function(s,p){const y=Su({name:"MuiModal",props:s}),{BackdropComponent:C=lPn,BackdropProps:N,classes:L,className:z,closeAfterTransition:G=!1,children:q,container:nt,component:tt,components:et={},componentsProps:st={},disableAutoFocus:at=!1,disableEnforceFocus:It=!1,disableEscapeKeyDown:Rt=!1,disablePortal:At=!1,disableRestoreFocus:ee=!1,disableScrollLock:ae=!1,hideBackdrop:ve=!1,keepMounted:hn=!1,onBackdropClick:pe,onClose:pn,onTransitionEnter:Yn,onTransitionExited:Ln,open:zn,slotProps:Qn={},slots:ur={},theme:fi,...pi}=y,Or={...y,closeAfterTransition:G,disableAutoFocus:at,disableEnforceFocus:It,disableEscapeKeyDown:Rt,disablePortal:At,disableRestoreFocus:ee,disableScrollLock:ae,hideBackdrop:ve,keepMounted:hn},{getRootProps:di,getBackdropProps:Ea,getTransitionProps:Qi,portalRef:li,isTopModal:ze,exited:Na,hasTransition:Ts}=sPn({...Or,rootRef:p}),Ke={...Or,exited:Na},xo=cPn(Ke),Ss={};if(q.props.tabIndex===void 0&&(Ss.tabIndex="-1"),Ts){const{onEnter:pc,onExited:bu}=Qi();Ss.onEnter=pc,Ss.onExited=bu}const La={slots:{root:et.Root,backdrop:et.Backdrop,...ur},slotProps:{...st,...Qn}},[zo,$u]=wh("root",{ref:p,elementType:uPn,externalForwardedProps:{...La,...pi,component:tt},getSlotProps:di,ownerState:Ke,className:bo(z,xo==null?void 0:xo.root,!Ke.open&&Ke.exited&&(xo==null?void 0:xo.hidden))}),[gu,Ds]=wh("backdrop",{ref:N==null?void 0:N.ref,elementType:C,externalForwardedProps:La,shouldForwardComponentProp:!0,additionalProps:N,getSlotProps:pc=>Ea({...pc,onClick:bu=>{pe&&pe(bu),pc!=null&&pc.onClick&&pc.onClick(bu)}}),className:bo(N==null?void 0:N.className,xo==null?void 0:xo.backdrop),ownerState:Ke});return!hn&&!zn&&(!Ts||Na)?null:le.jsx(nNn,{ref:li,container:nt,disablePortal:At,children:le.jsxs(zo,{...$u,children:[!ve&&C?le.jsx(gu,{...Ds}):null,le.jsx(rPn,{disableEnforceFocus:It,disableAutoFocus:at,disableRestoreFocus:ee,isEnabled:ze,open:zn,children:un.cloneElement(q,Ss)})]})})});function hPn(o,s,p){const y=s.getBoundingClientRect(),C=p&&p.getBoundingClientRect(),N=i5(s);let L;if(s.fakeTransform)L=s.fakeTransform;else{const q=N.getComputedStyle(s);L=q.getPropertyValue("-webkit-transform")||q.getPropertyValue("transform")}let z=0,G=0;if(L&&L!=="none"&&typeof L=="string"){const q=L.split("(")[1].split(")")[0].split(",");z=parseInt(q[4],10),G=parseInt(q[5],10)}return o==="left"?C?`translateX(${C.right+z-y.left}px)`:`translateX(${N.innerWidth+z-y.left}px)`:o==="right"?C?`translateX(-${y.right-C.left-z}px)`:`translateX(-${y.left+y.width-z}px)`:o==="up"?C?`translateY(${C.bottom+G-y.top}px)`:`translateY(${N.innerHeight+G-y.top}px)`:C?`translateY(-${y.top-C.top+y.height-G}px)`:`translateY(-${y.top+y.height-G}px)`}function fPn(o){return typeof o=="function"?o():o}function Tbt(o,s,p){const y=fPn(p),C=hPn(o,s,y);C&&(s.style.webkitTransform=C,s.style.transform=C)}const dPn=un.forwardRef(function(s,p){const y=vP(),C={enter:y.transitions.easing.easeOut,exit:y.transitions.easing.sharp},N={enter:y.transitions.duration.enteringScreen,exit:y.transitions.duration.leavingScreen},{addEndListener:L,appear:z=!0,children:G,container:q,direction:nt="down",easing:tt=C,in:et,onEnter:st,onEntered:at,onEntering:It,onExit:Rt,onExited:At,onExiting:ee,style:ae,timeout:ve=N,TransitionComponent:hn=M3,...pe}=s,pn=un.useRef(null),Yn=Im(r$(G),pn,p),Ln=Qi=>li=>{Qi&&(li===void 0?Qi(pn.current):Qi(pn.current,li))},zn=Ln((Qi,li)=>{Tbt(nt,Qi,q),MFt(Qi),st&&st(Qi,li)}),Qn=Ln((Qi,li)=>{const ze=gC({timeout:ve,style:ae,easing:tt},{mode:"enter"});Qi.style.webkitTransition=y.transitions.create("-webkit-transform",{...ze}),Qi.style.transition=y.transitions.create("transform",{...ze}),Qi.style.webkitTransform="none",Qi.style.transform="none",It&&It(Qi,li)}),ur=Ln(at),fi=Ln(ee),pi=Ln(Qi=>{const li=gC({timeout:ve,style:ae,easing:tt},{mode:"exit"});Qi.style.webkitTransition=y.transitions.create("-webkit-transform",li),Qi.style.transition=y.transitions.create("transform",li),Tbt(nt,Qi,q),Rt&&Rt(Qi)}),Or=Ln(Qi=>{Qi.style.webkitTransition="",Qi.style.transition="",At&&At(Qi)}),di=Qi=>{L&&L(pn.current,Qi)},Ea=un.useCallback(()=>{pn.current&&Tbt(nt,pn.current,q)},[nt,q]);return un.useEffect(()=>{if(et||nt==="down"||nt==="right")return;const Qi=LFt(()=>{pn.current&&Tbt(nt,pn.current,q)}),li=i5(pn.current);return li.addEventListener("resize",Qi),()=>{Qi.clear(),li.removeEventListener("resize",Qi)}},[nt,et,q]),un.useEffect(()=>{et||Ea()},[et,Ea]),le.jsx(hn,{nodeRef:pn,onEnter:zn,onEntered:ur,onEntering:Qn,onExit:pi,onExited:Or,onExiting:fi,addEndListener:di,appear:z,in:et,timeout:ve,...pe,children:(Qi,{ownerState:li,...ze})=>un.cloneElement(G,{ref:Yn,style:{visibility:Qi==="exited"&&!et?"hidden":void 0,...ae,...G.props.style},...ze})})});function pPn(o){return Vc("MuiDrawer",o)}au("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const sIe=(o,s)=>{const{ownerState:p}=o;return[s.root,(p.variant==="permanent"||p.variant==="persistent")&&s.docked,s.modal]},gPn=o=>{const{classes:s,anchor:p,variant:y}=o,C={root:["root",`anchor${fa(p)}`],docked:[(y==="permanent"||y==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${fa(p)}`,y!=="temporary"&&`paperAnchorDocked${fa(p)}`]};return Hc(C,pPn,s)},bPn=Ia(aIe,{name:"MuiDrawer",slot:"Root",overridesResolver:sIe})(pu(({theme:o})=>({zIndex:(o.vars||o).zIndex.drawer}))),mPn=Ia("div",{shouldForwardProp:ny,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:sIe})({flex:"0 0 auto"}),yPn=Ia(QQ,{name:"MuiDrawer",slot:"Paper",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.paper,s[`paperAnchor${fa(p.anchor)}`],p.variant!=="temporary"&&s[`paperAnchorDocked${fa(p.anchor)}`]]}})(pu(({theme:o})=>({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(o.vars||o).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0,variants:[{props:{anchor:"left"},style:{left:0}},{props:{anchor:"top"},style:{top:0,left:0,right:0,height:"auto",maxHeight:"100%"}},{props:{anchor:"right"},style:{right:0}},{props:{anchor:"bottom"},style:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"}},{props:({ownerState:s})=>s.anchor==="left"&&s.variant!=="temporary",style:{borderRight:`1px solid ${(o.vars||o).palette.divider}`}},{props:({ownerState:s})=>s.anchor==="top"&&s.variant!=="temporary",style:{borderBottom:`1px solid ${(o.vars||o).palette.divider}`}},{props:({ownerState:s})=>s.anchor==="right"&&s.variant!=="temporary",style:{borderLeft:`1px solid ${(o.vars||o).palette.divider}`}},{props:({ownerState:s})=>s.anchor==="bottom"&&s.variant!=="temporary",style:{borderTop:`1px solid ${(o.vars||o).palette.divider}`}}]}))),oIe={left:"right",right:"left",top:"down",bottom:"up"};function wPn(o){return["left","right"].includes(o)}function vPn({direction:o},s){return o==="rtl"&&wPn(s)?oIe[s]:s}const _Pn=un.forwardRef(function(s,p){const y=Su({props:s,name:"MuiDrawer"}),C=vP(),N=ZAe(),L={enter:C.transitions.duration.enteringScreen,exit:C.transitions.duration.leavingScreen},{anchor:z="left",BackdropProps:G,children:q,className:nt,elevation:tt=16,hideBackdrop:et=!1,ModalProps:{BackdropProps:st,...at}={},onClose:It,open:Rt=!1,PaperProps:At={},SlideProps:ee,TransitionComponent:ae,transitionDuration:ve=L,variant:hn="temporary",slots:pe={},slotProps:pn={},...Yn}=y,Ln=un.useRef(!1);un.useEffect(()=>{Ln.current=!0},[]);const zn=vPn({direction:N?"rtl":"ltr"},z),ur={...y,anchor:z,elevation:tt,open:Rt,variant:hn,...Yn},fi=gPn(ur),pi={slots:{transition:ae,...pe},slotProps:{paper:At,transition:ee,...pn,backdrop:tIe(pn.backdrop||{...G,...st},{transitionDuration:ve})}},[Or,di]=wh("root",{ref:p,elementType:bPn,className:bo(fi.root,fi.modal,nt),shouldForwardComponentProp:!0,ownerState:ur,externalForwardedProps:{...pi,...Yn,...at},additionalProps:{open:Rt,onClose:It,hideBackdrop:et,slots:{backdrop:pi.slots.backdrop},slotProps:{backdrop:pi.slotProps.backdrop}}}),[Ea,Qi]=wh("paper",{elementType:yPn,shouldForwardComponentProp:!0,className:bo(fi.paper,At.className),ownerState:ur,externalForwardedProps:pi,additionalProps:{elevation:hn==="temporary"?tt:0,square:!0}}),[li,ze]=wh("docked",{elementType:mPn,ref:p,className:bo(fi.root,fi.docked,nt),ownerState:ur,externalForwardedProps:pi,additionalProps:Yn}),[Na,Ts]=wh("transition",{elementType:dPn,ownerState:ur,externalForwardedProps:pi,additionalProps:{in:Rt,direction:oIe[zn],timeout:ve,appear:Ln.current}}),Ke=le.jsx(Ea,{...Qi,children:q});if(hn==="permanent")return le.jsx(li,{...ze,children:Ke});const xo=le.jsx(Na,{...Ts,children:Ke});return hn==="persistent"?le.jsx(li,{...ze,children:xo}):le.jsx(Or,{...di,children:xo})}),xPn=o=>{const{classes:s,disableUnderline:p,startAdornment:y,endAdornment:C,size:N,hiddenLabel:L,multiline:z}=o,G={root:["root",!p&&"underline",y&&"adornedStart",C&&"adornedEnd",N==="small"&&`size${fa(N)}`,L&&"hiddenLabel",z&&"multiline"],input:["input"]},q=Hc(G,bNn,s);return{...s,...q}},EPn=Ia(jmt,{shouldForwardProp:o=>ny(o)||o==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[...Fmt(o,s),!p.disableUnderline&&s.underline]}})(pu(({theme:o})=>{const s=o.palette.mode==="light",p=s?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",y=s?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",C=s?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",N=s?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{position:"relative",backgroundColor:o.vars?o.vars.palette.FilledInput.bg:y,borderTopLeftRadius:(o.vars||o).shape.borderRadius,borderTopRightRadius:(o.vars||o).shape.borderRadius,transition:o.transitions.create("background-color",{duration:o.transitions.duration.shorter,easing:o.transitions.easing.easeOut}),"&:hover":{backgroundColor:o.vars?o.vars.palette.FilledInput.hoverBg:C,"@media (hover: none)":{backgroundColor:o.vars?o.vars.palette.FilledInput.bg:y}},[`&.${rP.focused}`]:{backgroundColor:o.vars?o.vars.palette.FilledInput.bg:y},[`&.${rP.disabled}`]:{backgroundColor:o.vars?o.vars.palette.FilledInput.disabledBg:N},variants:[{props:({ownerState:L})=>!L.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:o.transitions.create("transform",{duration:o.transitions.duration.shorter,easing:o.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${rP.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${rP.error}`]:{"&::before, &::after":{borderBottomColor:(o.vars||o).palette.error.main}},"&::before":{borderBottom:`1px solid ${o.vars?`rgba(${o.vars.palette.common.onBackgroundChannel} / ${o.vars.opacity.inputUnderline})`:p}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:o.transitions.create("border-bottom-color",{duration:o.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${rP.disabled}, .${rP.error}):before`]:{borderBottom:`1px solid ${(o.vars||o).palette.text.primary}`},[`&.${rP.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(o.palette).filter(Am()).map(([L])=>{var z;return{props:{disableUnderline:!1,color:L},style:{"&::after":{borderBottom:`2px solid ${(z=(o.vars||o).palette[L])==null?void 0:z.main}`}}}}),{props:({ownerState:L})=>L.startAdornment,style:{paddingLeft:12}},{props:({ownerState:L})=>L.endAdornment,style:{paddingRight:12}},{props:({ownerState:L})=>L.multiline,style:{padding:"25px 12px 8px"}},{props:({ownerState:L,size:z})=>L.multiline&&z==="small",style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:L})=>L.multiline&&L.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:L})=>L.multiline&&L.hiddenLabel&&L.size==="small",style:{paddingTop:8,paddingBottom:9}}]}})),TPn=Ia(Hmt,{name:"MuiFilledInput",slot:"Input",overridesResolver:$mt})(pu(({theme:o})=>({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!o.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:o.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:o.palette.mode==="light"?null:"#fff",caretColor:o.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},...o.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[o.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:s})=>s.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:s})=>s.startAdornment,style:{paddingLeft:0}},{props:({ownerState:s})=>s.endAdornment,style:{paddingRight:0}},{props:({ownerState:s})=>s.hiddenLabel&&s.size==="small",style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:s})=>s.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),BFt=un.forwardRef(function(s,p){const y=Su({props:s,name:"MuiFilledInput"}),{disableUnderline:C=!1,components:N={},componentsProps:L,fullWidth:z=!1,hiddenLabel:G,inputComponent:q="input",multiline:nt=!1,slotProps:tt,slots:et={},type:st="text",...at}=y,It={...y,disableUnderline:C,fullWidth:z,inputComponent:q,multiline:nt,type:st},Rt=xPn(y),At={root:{ownerState:It},input:{ownerState:It}},ee=tt??L?PFt(At,tt??L):At,ae=et.root??N.Root??EPn,ve=et.input??N.Input??TPn;return le.jsx(DFt,{slots:{root:ae,input:ve},slotProps:ee,fullWidth:z,inputComponent:q,multiline:nt,ref:p,type:st,...at,classes:Rt})});BFt.muiName="Input";function kPn(o){return Vc("MuiFormControl",o)}au("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const SPn=o=>{const{classes:s,margin:p,fullWidth:y}=o,C={root:["root",p!=="none"&&`margin${fa(p)}`,y&&"fullWidth"]};return Hc(C,kPn,s)},CPn=Ia("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,s[`margin${fa(p.margin)}`],p.fullWidth&&s.fullWidth]}})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),APn=un.forwardRef(function(s,p){const y=Su({props:s,name:"MuiFormControl"}),{children:C,className:N,color:L="primary",component:z="div",disabled:G=!1,error:q=!1,focused:nt,fullWidth:tt=!1,hiddenLabel:et=!1,margin:st="none",required:at=!1,size:It="medium",variant:Rt="outlined",...At}=y,ee={...y,color:L,component:z,disabled:G,error:q,fullWidth:tt,hiddenLabel:et,margin:st,required:at,size:It,variant:Rt},ae=SPn(ee),[ve,hn]=un.useState(()=>{let Or=!1;return C&&un.Children.forEach(C,di=>{if(!RDt(di,["Input","Select"]))return;const Ea=RDt(di,["Select"])?di.props.input:di;Ea&&hNn(Ea.props)&&(Or=!0)}),Or}),[pe,pn]=un.useState(()=>{let Or=!1;return C&&un.Children.forEach(C,di=>{RDt(di,["Input","Select"])&&(emt(di.props,!0)||emt(di.props.inputProps,!0))&&(Or=!0)}),Or}),[Yn,Ln]=un.useState(!1);G&&Yn&&Ln(!1);const zn=nt!==void 0&&!G?nt:Yn;let Qn;un.useRef(!1);const ur=un.useCallback(()=>{pn(!0)},[]),fi=un.useCallback(()=>{pn(!1)},[]),pi=un.useMemo(()=>({adornedStart:ve,setAdornedStart:hn,color:L,disabled:G,error:q,filled:pe,focused:zn,fullWidth:tt,hiddenLabel:et,size:It,onBlur:()=>{Ln(!1)},onFocus:()=>{Ln(!0)},onEmpty:fi,onFilled:ur,registerEffect:Qn,required:at,variant:Rt}),[ve,L,G,q,pe,zn,tt,et,Qn,fi,ur,at,It,Rt]);return le.jsx(RFt.Provider,{value:pi,children:le.jsx(CPn,{as:z,ownerState:ee,className:bo(ae.root,N),ref:p,...At,children:C})})});function IPn(o){return Vc("MuiFormControlLabel",o)}const yQ=au("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),OPn=o=>{const{classes:s,disabled:p,labelPlacement:y,error:C,required:N}=o,L={root:["root",p&&"disabled",`labelPlacement${fa(y)}`,C&&"error",N&&"required"],label:["label",p&&"disabled"],asterisk:["asterisk",C&&"error"]};return Hc(L,IPn,s)},NPn=Ia("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[{[`& .${yQ.label}`]:s.label},s.root,s[`labelPlacement${fa(p.labelPlacement)}`]]}})(pu(({theme:o})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${yQ.disabled}`]:{cursor:"default"},[`& .${yQ.label}`]:{[`&.${yQ.disabled}`]:{color:(o.vars||o).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:s})=>s==="start"||s==="top"||s==="bottom",style:{marginLeft:16}}]}))),PPn=Ia("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(o,s)=>s.asterisk})(pu(({theme:o})=>({[`&.${yQ.error}`]:{color:(o.vars||o).palette.error.main}}))),hk=un.forwardRef(function(s,p){const y=Su({props:s,name:"MuiFormControlLabel"}),{checked:C,className:N,componentsProps:L={},control:z,disabled:G,disableTypography:q,inputRef:nt,label:tt,labelPlacement:et="end",name:st,onChange:at,required:It,slots:Rt={},slotProps:At={},value:ee,...ae}=y,ve=N6(),hn=G??z.props.disabled??(ve==null?void 0:ve.disabled),pe=It??z.props.required,pn={disabled:hn,required:pe};["checked","name","onChange","value","inputRef"].forEach(Or=>{typeof z.props[Or]>"u"&&typeof y[Or]<"u"&&(pn[Or]=y[Or])});const Yn=xC({props:y,muiFormControl:ve,states:["error"]}),Ln={...y,disabled:hn,labelPlacement:et,required:pe,error:Yn.error},zn=OPn(Ln),Qn={slots:Rt,slotProps:{...L,...At}},[ur,fi]=wh("typography",{elementType:I3,externalForwardedProps:Qn,ownerState:Ln});let pi=tt;return pi!=null&&pi.type!==I3&&!q&&(pi=le.jsx(ur,{component:"span",...fi,className:bo(zn.label,fi==null?void 0:fi.className),children:pi})),le.jsxs(NPn,{className:bo(zn.root,N),ownerState:Ln,ref:p,...ae,children:[un.cloneElement(z,pn),pe?le.jsxs("div",{children:[pi,le.jsxs(PPn,{ownerState:Ln,"aria-hidden":!0,className:zn.asterisk,children:[" ","*"]})]}):pi]})});function LPn(o){return Vc("MuiFormGroup",o)}au("MuiFormGroup",["root","row","error"]);const MPn=o=>{const{classes:s,row:p,error:y}=o;return Hc({root:["root",p&&"row",y&&"error"]},LPn,s)},RPn=Ia("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,p.row&&s.row]}})({display:"flex",flexDirection:"column",flexWrap:"wrap",variants:[{props:{row:!0},style:{flexDirection:"row"}}]}),DPn=un.forwardRef(function(s,p){const y=Su({props:s,name:"MuiFormGroup"}),{className:C,row:N=!1,...L}=y,z=N6(),G=xC({props:y,muiFormControl:z,states:["error"]}),q={...y,row:N,error:G.error},nt=MPn(q);return le.jsx(RPn,{className:bo(nt.root,C),ownerState:q,ref:p,...L})});function BPn(o){return Vc("MuiFormHelperText",o)}const uCe=au("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var lCe;const FPn=o=>{const{classes:s,contained:p,size:y,disabled:C,error:N,filled:L,focused:z,required:G}=o,q={root:["root",C&&"disabled",N&&"error",y&&`size${fa(y)}`,p&&"contained",z&&"focused",L&&"filled",G&&"required"]};return Hc(q,BPn,s)},$Pn=Ia("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,p.size&&s[`size${fa(p.size)}`],p.contained&&s.contained,p.filled&&s.filled]}})(pu(({theme:o})=>({color:(o.vars||o).palette.text.secondary,...o.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${uCe.disabled}`]:{color:(o.vars||o).palette.text.disabled},[`&.${uCe.error}`]:{color:(o.vars||o).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:({ownerState:s})=>s.contained,style:{marginLeft:14,marginRight:14}}]}))),jPn=un.forwardRef(function(s,p){const y=Su({props:s,name:"MuiFormHelperText"}),{children:C,className:N,component:L="p",disabled:z,error:G,filled:q,focused:nt,margin:tt,required:et,variant:st,...at}=y,It=N6(),Rt=xC({props:y,muiFormControl:It,states:["variant","size","disabled","error","filled","focused","required"]}),At={...y,component:L,contained:Rt.variant==="filled"||Rt.variant==="outlined",variant:Rt.variant,size:Rt.size,disabled:Rt.disabled,error:Rt.error,filled:Rt.filled,focused:Rt.focused,required:Rt.required};delete At.ownerState;const ee=FPn(At);return le.jsx($Pn,{as:L,className:bo(ee.root,N),ref:p,...at,ownerState:At,children:C===" "?lCe||(lCe=le.jsx("span",{className:"notranslate","aria-hidden":!0,children:""})):C})});function HPn(o){return Vc("MuiFormLabel",o)}const IQ=au("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),zPn=o=>{const{classes:s,color:p,focused:y,disabled:C,error:N,filled:L,required:z}=o,G={root:["root",`color${fa(p)}`,C&&"disabled",N&&"error",L&&"filled",y&&"focused",z&&"required"],asterisk:["asterisk",N&&"error"]};return Hc(G,HPn,s)},UPn=Ia("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,p.color==="secondary"&&s.colorSecondary,p.filled&&s.filled]}})(pu(({theme:o})=>({color:(o.vars||o).palette.text.secondary,...o.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(o.palette).filter(Am()).map(([s])=>({props:{color:s},style:{[`&.${IQ.focused}`]:{color:(o.vars||o).palette[s].main}}})),{props:{},style:{[`&.${IQ.disabled}`]:{color:(o.vars||o).palette.text.disabled},[`&.${IQ.error}`]:{color:(o.vars||o).palette.error.main}}}]}))),qPn=Ia("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(o,s)=>s.asterisk})(pu(({theme:o})=>({[`&.${IQ.error}`]:{color:(o.vars||o).palette.error.main}}))),WPn=un.forwardRef(function(s,p){const y=Su({props:s,name:"MuiFormLabel"}),{children:C,className:N,color:L,component:z="label",disabled:G,error:q,filled:nt,focused:tt,required:et,...st}=y,at=N6(),It=xC({props:y,muiFormControl:at,states:["color","required","focused","disabled","error","filled"]}),Rt={...y,color:It.color||"primary",component:z,disabled:It.disabled,error:It.error,filled:It.filled,focused:It.focused,required:It.required},At=zPn(Rt);return le.jsxs(UPn,{as:z,ownerState:Rt,className:bo(At.root,N),ref:p,...st,children:[C,It.required&&le.jsxs(qPn,{ownerState:Rt,"aria-hidden":!0,className:At.asterisk,children:[" ","*"]})]})});function kBt(o){return`scale(${o}, ${o**2})`}const KPn={entering:{opacity:1,transform:kBt(1)},entered:{opacity:1,transform:"none"}},BDt=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),SBt=un.forwardRef(function(s,p){const{addEndListener:y,appear:C=!0,children:N,easing:L,in:z,onEnter:G,onEntered:q,onEntering:nt,onExit:tt,onExited:et,onExiting:st,style:at,timeout:It="auto",TransitionComponent:Rt=M3,...At}=s,ee=qAe(),ae=un.useRef(),ve=vP(),hn=un.useRef(null),pe=Im(hn,r$(N),p),pn=Or=>di=>{if(Or){const Ea=hn.current;di===void 0?Or(Ea):Or(Ea,di)}},Yn=pn(nt),Ln=pn((Or,di)=>{MFt(Or);const{duration:Ea,delay:Qi,easing:li}=gC({style:at,timeout:It,easing:L},{mode:"enter"});let ze;It==="auto"?(ze=ve.transitions.getAutoHeightDuration(Or.clientHeight),ae.current=ze):ze=Ea,Or.style.transition=[ve.transitions.create("opacity",{duration:ze,delay:Qi}),ve.transitions.create("transform",{duration:BDt?ze:ze*.666,delay:Qi,easing:li})].join(","),G&&G(Or,di)}),zn=pn(q),Qn=pn(st),ur=pn(Or=>{const{duration:di,delay:Ea,easing:Qi}=gC({style:at,timeout:It,easing:L},{mode:"exit"});let li;It==="auto"?(li=ve.transitions.getAutoHeightDuration(Or.clientHeight),ae.current=li):li=di,Or.style.transition=[ve.transitions.create("opacity",{duration:li,delay:Ea}),ve.transitions.create("transform",{duration:BDt?li:li*.666,delay:BDt?Ea:Ea||li*.333,easing:Qi})].join(","),Or.style.opacity=0,Or.style.transform=kBt(.75),tt&&tt(Or)}),fi=pn(et),pi=Or=>{It==="auto"&&ee.start(ae.current||0,Or),y&&y(hn.current,Or)};return le.jsx(Rt,{appear:C,in:z,nodeRef:hn,onEnter:Ln,onEntered:zn,onEntering:Yn,onExit:ur,onExited:fi,onExiting:Qn,addEndListener:pi,timeout:It==="auto"?null:It,...At,children:(Or,{ownerState:di,...Ea})=>un.cloneElement(N,{style:{opacity:0,transform:kBt(.75),visibility:Or==="exited"&&!z?"hidden":void 0,...KPn[Or],...at,...N.props.style},ref:pe,...Ea})})});SBt&&(SBt.muiSupportAuto=!0);const GPn=JAe({themeId:zAe}),YPn=o=>{const{classes:s,disableUnderline:p}=o,C=Hc({root:["root",!p&&"underline"],input:["input"]},pNn,s);return{...s,...C}},VPn=Ia(jmt,{shouldForwardProp:o=>ny(o)||o==="classes",name:"MuiInput",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[...Fmt(o,s),!p.disableUnderline&&s.underline]}})(pu(({theme:o})=>{let p=o.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return o.vars&&(p=`rgba(${o.vars.palette.common.onBackgroundChannel} / ${o.vars.opacity.inputUnderline})`),{position:"relative",variants:[{props:({ownerState:y})=>y.formControl,style:{"label + &":{marginTop:16}}},{props:({ownerState:y})=>!y.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:o.transitions.create("transform",{duration:o.transitions.duration.shorter,easing:o.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${cQ.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${cQ.error}`]:{"&::before, &::after":{borderBottomColor:(o.vars||o).palette.error.main}},"&::before":{borderBottom:`1px solid ${p}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:o.transitions.create("border-bottom-color",{duration:o.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${cQ.disabled}, .${cQ.error}):before`]:{borderBottom:`2px solid ${(o.vars||o).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${p}`}},[`&.${cQ.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(o.palette).filter(Am()).map(([y])=>({props:{color:y,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(o.vars||o).palette[y].main}`}}}))]}})),XPn=Ia(Hmt,{name:"MuiInput",slot:"Input",overridesResolver:$mt})({}),zmt=un.forwardRef(function(s,p){const y=Su({props:s,name:"MuiInput"}),{disableUnderline:C=!1,components:N={},componentsProps:L,fullWidth:z=!1,inputComponent:G="input",multiline:q=!1,slotProps:nt,slots:tt={},type:et="text",...st}=y,at=YPn(y),Rt={root:{ownerState:{disableUnderline:C}}},At=nt??L?PFt(nt??L,Rt):Rt,ee=tt.root??N.Root??VPn,ae=tt.input??N.Input??XPn;return le.jsx(DFt,{slots:{root:ee,input:ae},slotProps:At,fullWidth:z,inputComponent:G,multiline:q,ref:p,type:et,...st,classes:at})});zmt.muiName="Input";function QPn(o){return Vc("MuiInputLabel",o)}au("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const JPn=o=>{const{classes:s,formControl:p,size:y,shrink:C,disableAnimation:N,variant:L,required:z}=o,G={root:["root",p&&"formControl",!N&&"animated",C&&"shrink",y&&y!=="normal"&&`size${fa(y)}`,L],asterisk:[z&&"asterisk"]},q=Hc(G,QPn,s);return{...s,...q}},ZPn=Ia(WPn,{shouldForwardProp:o=>ny(o)||o==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[{[`& .${IQ.asterisk}`]:s.asterisk},s.root,p.formControl&&s.formControl,p.size==="small"&&s.sizeSmall,p.shrink&&s.shrink,!p.disableAnimation&&s.animated,p.focused&&s.focused,s[p.variant]]}})(pu(({theme:o})=>({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:({ownerState:s})=>s.formControl,style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:({ownerState:s})=>s.shrink,style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:({ownerState:s})=>!s.disableAnimation,style:{transition:o.transitions.create(["color","transform","max-width"],{duration:o.transitions.duration.shorter,easing:o.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:({variant:s,ownerState:p})=>s==="filled"&&p.shrink,style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:({variant:s,ownerState:p,size:y})=>s==="filled"&&p.shrink&&y==="small",style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:({variant:s,ownerState:p})=>s==="outlined"&&p.shrink,style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}))),tLn=un.forwardRef(function(s,p){const y=Su({name:"MuiInputLabel",props:s}),{disableAnimation:C=!1,margin:N,shrink:L,variant:z,className:G,...q}=y,nt=N6();let tt=L;typeof tt>"u"&&nt&&(tt=nt.filled||nt.focused||nt.adornedStart);const et=xC({props:y,muiFormControl:nt,states:["size","variant","required","focused"]}),st={...y,disableAnimation:C,formControl:nt,shrink:tt,size:et.size,variant:et.variant,required:et.required,focused:et.focused},at=JPn(st);return le.jsx(ZPn,{"data-shrink":tt,ref:p,className:bo(at.root,G),...q,ownerState:st,classes:at})});function FDt(o,s,p){return o===s?o.firstChild:s&&s.nextElementSibling?s.nextElementSibling:p?null:o.firstChild}function hCe(o,s,p){return o===s?p?o.firstChild:o.lastChild:s&&s.previousElementSibling?s.previousElementSibling:p?null:o.lastChild}function cIe(o,s){if(s===void 0)return!0;let p=o.innerText;return p===void 0&&(p=o.textContent),p=p.trim().toLowerCase(),p.length===0?!1:s.repeating?p[0]===s.keys[0]:p.startsWith(s.keys.join(""))}function uQ(o,s,p,y,C,N){let L=!1,z=C(o,s,s?p:!1);for(;z;){if(z===o.firstChild){if(L)return!1;L=!0}const G=y?!1:z.disabled||z.getAttribute("aria-disabled")==="true";if(!z.hasAttribute("tabindex")||!cIe(z,N)||G)z=C(o,z,p);else return z.focus(),!0}return!1}const eLn=un.forwardRef(function(s,p){const{actions:y,autoFocus:C=!1,autoFocusItem:N=!1,children:L,className:z,disabledItemsFocusable:G=!1,disableListWrap:q=!1,onKeyDown:nt,variant:tt="selectedMenu",...et}=s,st=un.useRef(null),at=un.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});bP(()=>{C&&st.current.focus()},[C]),un.useImperativeHandle(y,()=>({adjustStyleForScrollbar:(ae,{direction:ve})=>{const hn=!st.current.style.width;if(ae.clientHeight<st.current.clientHeight&&hn){const pe=`${VAe(i5(ae))}px`;st.current.style[ve==="rtl"?"paddingLeft":"paddingRight"]=pe,st.current.style.width=`calc(100% + ${pe})`}return st.current}}),[]);const It=ae=>{const ve=st.current,hn=ae.key;if(ae.ctrlKey||ae.metaKey||ae.altKey){nt&&nt(ae);return}const pn=r5(ve).activeElement;if(hn==="ArrowDown")ae.preventDefault(),uQ(ve,pn,q,G,FDt);else if(hn==="ArrowUp")ae.preventDefault(),uQ(ve,pn,q,G,hCe);else if(hn==="Home")ae.preventDefault(),uQ(ve,null,q,G,FDt);else if(hn==="End")ae.preventDefault(),uQ(ve,null,q,G,hCe);else if(hn.length===1){const Yn=at.current,Ln=hn.toLowerCase(),zn=performance.now();Yn.keys.length>0&&(zn-Yn.lastTime>500?(Yn.keys=[],Yn.repeating=!0,Yn.previousKeyMatched=!0):Yn.repeating&&Ln!==Yn.keys[0]&&(Yn.repeating=!1)),Yn.lastTime=zn,Yn.keys.push(Ln);const Qn=pn&&!Yn.repeating&&cIe(pn,Yn);Yn.previousKeyMatched&&(Qn||uQ(ve,pn,!1,G,FDt,Yn))?ae.preventDefault():Yn.previousKeyMatched=!1}nt&&nt(ae)},Rt=Im(st,p);let At=-1;un.Children.forEach(L,(ae,ve)=>{if(!un.isValidElement(ae)){At===ve&&(At+=1,At>=L.length&&(At=-1));return}ae.props.disabled||(tt==="selectedMenu"&&ae.props.selected||At===-1)&&(At=ve),At===ve&&(ae.props.disabled||ae.props.muiSkipListHighlight||ae.type.muiSkipListHighlight)&&(At+=1,At>=L.length&&(At=-1))});const ee=un.Children.map(L,(ae,ve)=>{if(ve===At){const hn={};return N&&(hn.autoFocus=!0),ae.props.tabIndex===void 0&&tt==="selectedMenu"&&(hn.tabIndex=0),un.cloneElement(ae,hn)}return ae});return le.jsx(JIn,{role:"menu",ref:Rt,className:z,onKeyDown:It,tabIndex:C?0:-1,...et,children:ee})});function nLn(o){return Vc("MuiPopover",o)}au("MuiPopover",["root","paper"]);function fCe(o,s){let p=0;return typeof s=="number"?p=s:s==="center"?p=o.height/2:s==="bottom"&&(p=o.height),p}function dCe(o,s){let p=0;return typeof s=="number"?p=s:s==="center"?p=o.width/2:s==="right"&&(p=o.width),p}function pCe(o){return[o.horizontal,o.vertical].map(s=>typeof s=="number"?`${s}px`:s).join(" ")}function kbt(o){return typeof o=="function"?o():o}const rLn=o=>{const{classes:s}=o;return Hc({root:["root"],paper:["paper"]},nLn,s)},iLn=Ia(aIe,{name:"MuiPopover",slot:"Root",overridesResolver:(o,s)=>s.root})({}),uIe=Ia(QQ,{name:"MuiPopover",slot:"Paper",overridesResolver:(o,s)=>s.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),aLn=un.forwardRef(function(s,p){const y=Su({props:s,name:"MuiPopover"}),{action:C,anchorEl:N,anchorOrigin:L={vertical:"top",horizontal:"left"},anchorPosition:z,anchorReference:G="anchorEl",children:q,className:nt,container:tt,elevation:et=8,marginThreshold:st=16,open:at,PaperProps:It={},slots:Rt={},slotProps:At={},transformOrigin:ee={vertical:"top",horizontal:"left"},TransitionComponent:ae,transitionDuration:ve="auto",TransitionProps:hn={},disableScrollLock:pe=!1,...pn}=y,Yn=un.useRef(),Ln={...y,anchorOrigin:L,anchorReference:G,elevation:et,marginThreshold:st,transformOrigin:ee,TransitionComponent:ae,transitionDuration:ve,TransitionProps:hn},zn=rLn(Ln),Qn=un.useCallback(()=>{if(G==="anchorPosition")return z;const Ds=kbt(N),bu=(Ds&&Ds.nodeType===1?Ds:r5(Yn.current).body).getBoundingClientRect();return{top:bu.top+fCe(bu,L.vertical),left:bu.left+dCe(bu,L.horizontal)}},[N,L.horizontal,L.vertical,z,G]),ur=un.useCallback(Ds=>({vertical:fCe(Ds,ee.vertical),horizontal:dCe(Ds,ee.horizontal)}),[ee.horizontal,ee.vertical]),fi=un.useCallback(Ds=>{const pc={width:Ds.offsetWidth,height:Ds.offsetHeight},bu=ur(pc);if(G==="none")return{top:null,left:null,transformOrigin:pCe(bu)};const P1=Qn();let il=P1.top-bu.vertical,Rh=P1.left-bu.horizontal;const Mg=il+pc.height,Rg=Rh+pc.width,Dg=i5(kbt(N)),iy=Dg.innerHeight-st,Yp=Dg.innerWidth-st;if(st!==null&&il<st){const wd=il-st;il-=wd,bu.vertical+=wd}else if(st!==null&&Mg>iy){const wd=Mg-iy;il-=wd,bu.vertical+=wd}if(st!==null&&Rh<st){const wd=Rh-st;Rh-=wd,bu.horizontal+=wd}else if(Rg>Yp){const wd=Rg-Yp;Rh-=wd,bu.horizontal+=wd}return{top:`${Math.round(il)}px`,left:`${Math.round(Rh)}px`,transformOrigin:pCe(bu)}},[N,G,Qn,ur,st]),[pi,Or]=un.useState(at),di=un.useCallback(()=>{const Ds=Yn.current;if(!Ds)return;const pc=fi(Ds);pc.top!==null&&Ds.style.setProperty("top",pc.top),pc.left!==null&&(Ds.style.left=pc.left),Ds.style.transformOrigin=pc.transformOrigin,Or(!0)},[fi]);un.useEffect(()=>(pe&&window.addEventListener("scroll",di),()=>window.removeEventListener("scroll",di)),[N,pe,di]);const Ea=()=>{di()},Qi=()=>{Or(!1)};un.useEffect(()=>{at&&di()}),un.useImperativeHandle(C,()=>at?{updatePosition:()=>{di()}}:null,[at,di]),un.useEffect(()=>{if(!at)return;const Ds=LFt(()=>{di()}),pc=i5(kbt(N));return pc.addEventListener("resize",Ds),()=>{Ds.clear(),pc.removeEventListener("resize",Ds)}},[N,at,di]);let li=ve;const ze={slots:{transition:ae,...Rt},slotProps:{transition:hn,paper:It,...At}},[Na,Ts]=wh("transition",{elementType:SBt,externalForwardedProps:ze,ownerState:Ln,getSlotProps:Ds=>({...Ds,onEntering:(pc,bu)=>{var P1;(P1=Ds.onEntering)==null||P1.call(Ds,pc,bu),Ea()},onExited:pc=>{var bu;(bu=Ds.onExited)==null||bu.call(Ds,pc),Qi()}}),additionalProps:{appear:!0,in:at}});ve==="auto"&&!Na.muiSupportAuto&&(li=void 0);const Ke=tt||(N?r5(kbt(N)).body:void 0),[xo,{slots:Ss,slotProps:La,...zo}]=wh("root",{ref:p,elementType:iLn,externalForwardedProps:{...ze,...pn},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:Rt.backdrop},slotProps:{backdrop:tIe(typeof At.backdrop=="function"?At.backdrop(Ln):At.backdrop,{invisible:!0})},container:Ke,open:at},ownerState:Ln,className:bo(zn.root,nt)}),[$u,gu]=wh("paper",{ref:Yn,className:zn.paper,elementType:uIe,externalForwardedProps:ze,shouldForwardComponentProp:!0,additionalProps:{elevation:et,style:pi?void 0:{opacity:0}},ownerState:Ln});return le.jsx(xo,{...zo,...!vBt(xo)&&{slots:Ss,slotProps:La,disableScrollLock:pe},children:le.jsx(Na,{...Ts,timeout:li,children:le.jsx($u,{...gu,children:q})})})});function sLn(o){return Vc("MuiMenu",o)}au("MuiMenu",["root","paper","list"]);const oLn={vertical:"top",horizontal:"right"},cLn={vertical:"top",horizontal:"left"},uLn=o=>{const{classes:s}=o;return Hc({root:["root"],paper:["paper"],list:["list"]},sLn,s)},lLn=Ia(aLn,{shouldForwardProp:o=>ny(o)||o==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(o,s)=>s.root})({}),hLn=Ia(uIe,{name:"MuiMenu",slot:"Paper",overridesResolver:(o,s)=>s.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),fLn=Ia(eLn,{name:"MuiMenu",slot:"List",overridesResolver:(o,s)=>s.list})({outline:0}),dLn=un.forwardRef(function(s,p){const y=Su({props:s,name:"MuiMenu"}),{autoFocus:C=!0,children:N,className:L,disableAutoFocusItem:z=!1,MenuListProps:G={},onClose:q,open:nt,PaperProps:tt={},PopoverClasses:et,transitionDuration:st="auto",TransitionProps:{onEntering:at,...It}={},variant:Rt="selectedMenu",slots:At={},slotProps:ee={},...ae}=y,ve=ZAe(),hn={...y,autoFocus:C,disableAutoFocusItem:z,MenuListProps:G,onEntering:at,PaperProps:tt,transitionDuration:st,TransitionProps:It,variant:Rt},pe=uLn(hn),pn=C&&!z&&nt,Yn=un.useRef(null),Ln=(li,ze)=>{Yn.current&&Yn.current.adjustStyleForScrollbar(li,{direction:ve?"rtl":"ltr"}),at&&at(li,ze)},zn=li=>{li.key==="Tab"&&(li.preventDefault(),q&&q(li,"tabKeyDown"))};let Qn=-1;un.Children.map(N,(li,ze)=>{un.isValidElement(li)&&(li.props.disabled||(Rt==="selectedMenu"&&li.props.selected||Qn===-1)&&(Qn=ze))});const ur={slots:At,slotProps:{list:G,transition:It,paper:tt,...ee}},fi=aOn({elementType:At.root,externalSlotProps:ee.root,ownerState:hn,className:[pe.root,L]}),[pi,Or]=wh("paper",{className:pe.paper,elementType:hLn,externalForwardedProps:ur,shouldForwardComponentProp:!0,ownerState:hn}),[di,Ea]=wh("list",{className:bo(pe.list,G.className),elementType:fLn,shouldForwardComponentProp:!0,externalForwardedProps:ur,getSlotProps:li=>({...li,onKeyDown:ze=>{var Na;zn(ze),(Na=li.onKeyDown)==null||Na.call(li,ze)}}),ownerState:hn}),Qi=typeof ur.slotProps.transition=="function"?ur.slotProps.transition(hn):ur.slotProps.transition;return le.jsx(lLn,{onClose:q,anchorOrigin:{vertical:"bottom",horizontal:ve?"right":"left"},transformOrigin:ve?oLn:cLn,slots:{root:At.root,paper:pi,backdrop:At.backdrop,...At.transition&&{transition:At.transition}},slotProps:{root:fi,paper:Or,backdrop:typeof ee.backdrop=="function"?ee.backdrop(hn):ee.backdrop,transition:{...Qi,onEntering:(...li)=>{var ze;Ln(...li),(ze=Qi==null?void 0:Qi.onEntering)==null||ze.call(Qi,...li)}}},open:nt,ref:p,transitionDuration:st,ownerState:hn,...ae,classes:et,children:le.jsx(di,{actions:Yn,autoFocus:C&&(Qn===-1||z),autoFocusItem:pn,variant:Rt,...Ea,children:N})})});function pLn(o){return Vc("MuiNativeSelect",o)}const FFt=au("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),gLn=o=>{const{classes:s,variant:p,disabled:y,multiple:C,open:N,error:L}=o,z={select:["select",p,y&&"disabled",C&&"multiple",L&&"error"],icon:["icon",`icon${fa(p)}`,N&&"iconOpen",y&&"disabled"]};return Hc(z,pLn,s)},lIe=Ia("select")(({theme:o})=>({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${FFt.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(o.vars||o).palette.background.paper},variants:[{props:({ownerState:s})=>s.variant!=="filled"&&s.variant!=="outlined",style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(o.vars||o).shape.borderRadius,"&:focus":{borderRadius:(o.vars||o).shape.borderRadius},"&&&":{paddingRight:32}}}]})),bLn=Ia(lIe,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:ny,overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.select,s[p.variant],p.error&&s.error,{[`&.${FFt.multiple}`]:s.multiple}]}})({}),hIe=Ia("svg")(({theme:o})=>({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(o.vars||o).palette.action.active,[`&.${FFt.disabled}`]:{color:(o.vars||o).palette.action.disabled},variants:[{props:({ownerState:s})=>s.open,style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]})),mLn=Ia(hIe,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.icon,p.variant&&s[`icon${fa(p.variant)}`],p.open&&s.iconOpen]}})({}),yLn=un.forwardRef(function(s,p){const{className:y,disabled:C,error:N,IconComponent:L,inputRef:z,variant:G="standard",...q}=s,nt={...s,disabled:C,variant:G,error:N},tt=gLn(nt);return le.jsxs(un.Fragment,{children:[le.jsx(bLn,{ownerState:nt,className:bo(tt.select,y),disabled:C,ref:z||p,...q}),s.multiple?null:le.jsx(mLn,{as:L,ownerState:nt,className:tt.icon})]})});var gCe;const wLn=Ia("fieldset",{shouldForwardProp:ny})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),vLn=Ia("legend",{shouldForwardProp:ny})(pu(({theme:o})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:({ownerState:s})=>!s.withLabel,style:{padding:0,lineHeight:"11px",transition:o.transitions.create("width",{duration:150,easing:o.transitions.easing.easeOut})}},{props:({ownerState:s})=>s.withLabel,style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:o.transitions.create("max-width",{duration:50,easing:o.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:({ownerState:s})=>s.withLabel&&s.notched,style:{maxWidth:"100%",transition:o.transitions.create("max-width",{duration:100,easing:o.transitions.easing.easeOut,delay:50})}}]})));function _Ln(o){const{children:s,classes:p,className:y,label:C,notched:N,...L}=o,z=C!=null&&C!=="",G={...o,notched:N,withLabel:z};return le.jsx(wLn,{"aria-hidden":!0,className:y,ownerState:G,...L,children:le.jsx(vLn,{ownerState:G,children:z?le.jsx("span",{children:C}):gCe||(gCe=le.jsx("span",{className:"notranslate","aria-hidden":!0,children:""}))})})}const xLn=o=>{const{classes:s}=o,y=Hc({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},gNn,s);return{...s,...y}},ELn=Ia(jmt,{shouldForwardProp:o=>ny(o)||o==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:Fmt})(pu(({theme:o})=>{const s=o.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(o.vars||o).shape.borderRadius,[`&:hover .${y6.notchedOutline}`]:{borderColor:(o.vars||o).palette.text.primary},"@media (hover: none)":{[`&:hover .${y6.notchedOutline}`]:{borderColor:o.vars?`rgba(${o.vars.palette.common.onBackgroundChannel} / 0.23)`:s}},[`&.${y6.focused} .${y6.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(o.palette).filter(Am()).map(([p])=>({props:{color:p},style:{[`&.${y6.focused} .${y6.notchedOutline}`]:{borderColor:(o.vars||o).palette[p].main}}})),{props:{},style:{[`&.${y6.error} .${y6.notchedOutline}`]:{borderColor:(o.vars||o).palette.error.main},[`&.${y6.disabled} .${y6.notchedOutline}`]:{borderColor:(o.vars||o).palette.action.disabled}}},{props:({ownerState:p})=>p.startAdornment,style:{paddingLeft:14}},{props:({ownerState:p})=>p.endAdornment,style:{paddingRight:14}},{props:({ownerState:p})=>p.multiline,style:{padding:"16.5px 14px"}},{props:({ownerState:p,size:y})=>p.multiline&&y==="small",style:{padding:"8.5px 14px"}}]}})),TLn=Ia(_Ln,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(o,s)=>s.notchedOutline})(pu(({theme:o})=>{const s=o.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:o.vars?`rgba(${o.vars.palette.common.onBackgroundChannel} / 0.23)`:s}})),kLn=Ia(Hmt,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:$mt})(pu(({theme:o})=>({padding:"16.5px 14px",...!o.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:o.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:o.palette.mode==="light"?null:"#fff",caretColor:o.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},...o.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[o.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{padding:"8.5px 14px"}},{props:({ownerState:s})=>s.multiline,style:{padding:0}},{props:({ownerState:s})=>s.startAdornment,style:{paddingLeft:0}},{props:({ownerState:s})=>s.endAdornment,style:{paddingRight:0}}]}))),$Ft=un.forwardRef(function(s,p){var y;const C=Su({props:s,name:"MuiOutlinedInput"}),{components:N={},fullWidth:L=!1,inputComponent:z="input",label:G,multiline:q=!1,notched:nt,slots:tt={},type:et="text",...st}=C,at=xLn(C),It=N6(),Rt=xC({props:C,muiFormControl:It,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),At={...C,color:Rt.color||"primary",disabled:Rt.disabled,error:Rt.error,focused:Rt.focused,formControl:It,fullWidth:L,hiddenLabel:Rt.hiddenLabel,multiline:q,size:Rt.size,type:et},ee=tt.root??N.Root??ELn,ae=tt.input??N.Input??kLn;return le.jsx(DFt,{slots:{root:ee,input:ae},renderSuffix:ve=>le.jsx(TLn,{ownerState:At,className:at.notchedOutline,label:G!=null&&G!==""&&Rt.required?y||(y=le.jsxs(un.Fragment,{children:[G," ","*"]})):G,notched:typeof nt<"u"?nt:!!(ve.startAdornment||ve.filled||ve.focused)}),fullWidth:L,inputComponent:z,multiline:q,ref:p,type:et,...st,classes:{...at,notchedOutline:null}})});$Ft.muiName="Input";const SLn=s5(le.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonUnchecked"),CLn=s5(le.jsx("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"}),"RadioButtonChecked"),ALn=Ia("span",{shouldForwardProp:ny})({position:"relative",display:"flex"}),ILn=Ia(SLn)({transform:"scale(1)"}),OLn=Ia(CLn)(pu(({theme:o})=>({left:0,position:"absolute",transform:"scale(0)",transition:o.transitions.create("transform",{easing:o.transitions.easing.easeIn,duration:o.transitions.duration.shortest}),variants:[{props:{checked:!0},style:{transform:"scale(1)",transition:o.transitions.create("transform",{easing:o.transitions.easing.easeOut,duration:o.transitions.duration.shortest})}}]})));function fIe(o){const{checked:s=!1,classes:p={},fontSize:y}=o,C={...o,checked:s};return le.jsxs(ALn,{className:p.root,ownerState:C,children:[le.jsx(ILn,{fontSize:y,className:p.background,ownerState:C}),le.jsx(OLn,{fontSize:y,className:p.dot,ownerState:C})]})}const dIe=un.createContext(void 0);function NLn(){return un.useContext(dIe)}function PLn(o){return Vc("MuiRadio",o)}const bCe=au("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),LLn=o=>{const{classes:s,color:p,size:y}=o,C={root:["root",`color${fa(p)}`,y!=="medium"&&`size${fa(y)}`]};return{...s,...Hc(C,PLn,s)}},MLn=Ia(WNn,{shouldForwardProp:o=>ny(o)||o==="classes",name:"MuiRadio",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,p.size!=="medium"&&s[`size${fa(p.size)}`],s[`color${fa(p.color)}`]]}})(pu(({theme:o})=>({color:(o.vars||o).palette.text.secondary,[`&.${bCe.disabled}`]:{color:(o.vars||o).palette.action.disabled},variants:[{props:{color:"default",disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:o.vars?`rgba(${o.vars.palette.action.activeChannel} / ${o.vars.palette.action.hoverOpacity})`:Ef(o.palette.action.active,o.palette.action.hoverOpacity)}}},...Object.entries(o.palette).filter(Am()).map(([s])=>({props:{color:s,disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:o.vars?`rgba(${o.vars.palette[s].mainChannel} / ${o.vars.palette.action.hoverOpacity})`:Ef(o.palette[s].main,o.palette.action.hoverOpacity)}}})),...Object.entries(o.palette).filter(Am()).map(([s])=>({props:{color:s,disabled:!1},style:{[`&.${bCe.checked}`]:{color:(o.vars||o).palette[s].main}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]})));function RLn(o,s){return typeof s=="object"&&s!==null?o===s:String(o)===String(s)}const DLn=le.jsx(fIe,{checked:!0}),BLn=le.jsx(fIe,{}),fk=un.forwardRef(function(s,p){const y=Su({props:s,name:"MuiRadio"}),{checked:C,checkedIcon:N=DLn,color:L="primary",icon:z=BLn,name:G,onChange:q,size:nt="medium",className:tt,disabled:et,disableRipple:st=!1,slots:at={},slotProps:It={},inputProps:Rt,...At}=y,ee=N6();let ae=et;ee&&typeof ae>"u"&&(ae=ee.disabled),ae??(ae=!1);const ve={...y,disabled:ae,disableRipple:st,color:L,size:nt},hn=LLn(ve),pe=NLn();let pn=C;const Yn=_Bt(q,pe&&pe.onChange);let Ln=G;pe&&(typeof pn>"u"&&(pn=RLn(pe.value,y.value)),typeof Ln>"u"&&(Ln=pe.name));const zn=It.input??Rt,[Qn,ur]=wh("root",{ref:p,elementType:MLn,className:bo(hn.root,tt),shouldForwardComponentProp:!0,externalForwardedProps:{slots:at,slotProps:It,...At},getSlotProps:fi=>({...fi,onChange:(pi,...Or)=>{var di;(di=fi.onChange)==null||di.call(fi,pi,...Or),Yn(pi,...Or)}}),ownerState:ve,additionalProps:{type:"radio",icon:un.cloneElement(z,{fontSize:z.props.fontSize??nt}),checkedIcon:un.cloneElement(N,{fontSize:N.props.fontSize??nt}),disabled:ae,name:Ln,checked:pn,slots:at,slotProps:{input:typeof zn=="function"?zn(ve):zn}}});return le.jsx(Qn,{...ur,classes:hn})});function FLn(o){return Vc("MuiRadioGroup",o)}au("MuiRadioGroup",["root","row","error"]);const $Ln=o=>{const{classes:s,row:p,error:y}=o;return Hc({root:["root",p&&"row",y&&"error"]},FLn,s)},mCe=un.forwardRef(function(s,p){const{actions:y,children:C,className:N,defaultValue:L,name:z,onChange:G,value:q,...nt}=s,tt=un.useRef(null),et=$Ln(s),[st,at]=HQ({controlled:q,default:L,name:"RadioGroup"});un.useImperativeHandle(y,()=>({focus:()=>{let ee=tt.current.querySelector("input:not(:disabled):checked");ee||(ee=tt.current.querySelector("input:not(:disabled)")),ee&&ee.focus()}}),[]);const It=Im(p,tt),Rt=XQ(z),At=un.useMemo(()=>({name:Rt,onChange(ee){at(ee.target.value),G&&G(ee,ee.target.value)},value:st}),[Rt,G,at,st]);return le.jsx(dIe.Provider,{value:At,children:le.jsx(DPn,{role:"radiogroup",ref:It,className:bo(et.root,N),...nt,children:C})})});function pIe(o){return Vc("MuiSelect",o)}const lQ=au("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var yCe;const jLn=Ia(lIe,{name:"MuiSelect",slot:"Select",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[{[`&.${lQ.select}`]:s.select},{[`&.${lQ.select}`]:s[p.variant]},{[`&.${lQ.error}`]:s.error},{[`&.${lQ.multiple}`]:s.multiple}]}})({[`&.${lQ.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),HLn=Ia(hIe,{name:"MuiSelect",slot:"Icon",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.icon,p.variant&&s[`icon${fa(p.variant)}`],p.open&&s.iconOpen]}})({}),zLn=Ia("input",{shouldForwardProp:o=>ZIn(o)&&o!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(o,s)=>s.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function wCe(o,s){return typeof s=="object"&&s!==null?o===s:String(o)===String(s)}function ULn(o){return o==null||typeof o=="string"&&!o.trim()}const qLn=o=>{const{classes:s,variant:p,disabled:y,multiple:C,open:N,error:L}=o,z={select:["select",p,y&&"disabled",C&&"multiple",L&&"error"],icon:["icon",`icon${fa(p)}`,N&&"iconOpen",y&&"disabled"],nativeInput:["nativeInput"]};return Hc(z,pIe,s)},WLn=un.forwardRef(function(s,p){var c5;const{"aria-describedby":y,"aria-label":C,autoFocus:N,autoWidth:L,children:z,className:G,defaultOpen:q,defaultValue:nt,disabled:tt,displayEmpty:et,error:st=!1,IconComponent:at,inputRef:It,labelId:Rt,MenuProps:At={},multiple:ee,name:ae,onBlur:ve,onChange:hn,onClose:pe,onFocus:pn,onOpen:Yn,open:Ln,readOnly:zn,renderValue:Qn,required:ur,SelectDisplayProps:fi={},tabIndex:pi,type:Or,value:di,variant:Ea="standard",...Qi}=s,[li,ze]=HQ({controlled:di,default:nt,name:"Select"}),[Na,Ts]=HQ({controlled:Ln,default:q,name:"Select"}),Ke=un.useRef(null),xo=un.useRef(null),[Ss,La]=un.useState(null),{current:zo}=un.useRef(Ln!=null),[$u,gu]=un.useState(),Ds=Im(p,It),pc=un.useCallback(Ns=>{xo.current=Ns,Ns&&La(Ns)},[]),bu=Ss==null?void 0:Ss.parentNode;un.useImperativeHandle(Ds,()=>({focus:()=>{xo.current.focus()},node:Ke.current,value:li}),[li]),un.useEffect(()=>{q&&Na&&Ss&&!zo&&(gu(L?null:bu.clientWidth),xo.current.focus())},[Ss,L]),un.useEffect(()=>{N&&xo.current.focus()},[N]),un.useEffect(()=>{if(!Rt)return;const Ns=r5(xo.current).getElementById(Rt);if(Ns){const zc=()=>{getSelection().isCollapsed&&xo.current.focus()};return Ns.addEventListener("click",zc),()=>{Ns.removeEventListener("click",zc)}}},[Rt]);const P1=(Ns,zc)=>{Ns?Yn&&Yn(zc):pe&&pe(zc),zo||(gu(L?null:bu.clientWidth),Ts(Ns))},il=Ns=>{Ns.button===0&&(Ns.preventDefault(),xo.current.focus(),P1(!0,Ns))},Rh=Ns=>{P1(!1,Ns)},Mg=un.Children.toArray(z),Rg=Ns=>{const zc=Mg.find(Dh=>Dh.props.value===Ns.target.value);zc!==void 0&&(ze(zc.props.value),hn&&hn(Ns,zc))},Dg=Ns=>zc=>{let Dh;if(zc.currentTarget.hasAttribute("tabindex")){if(ee){Dh=Array.isArray(li)?li.slice():[];const ap=li.indexOf(Ns.props.value);ap===-1?Dh.push(Ns.props.value):Dh.splice(ap,1)}else Dh=Ns.props.value;if(Ns.props.onClick&&Ns.props.onClick(zc),li!==Dh&&(ze(Dh),hn)){const ap=zc.nativeEvent||zc,lJ=new ap.constructor(ap.type,ap);Object.defineProperty(lJ,"target",{writable:!0,value:{value:Dh,name:ae}}),hn(lJ,Ns)}ee||P1(!1,zc)}},iy=Ns=>{zn||[" ","ArrowUp","ArrowDown","Enter"].includes(Ns.key)&&(Ns.preventDefault(),P1(!0,Ns))},Yp=Ss!==null&&Na,wd=Ns=>{!Yp&&ve&&(Object.defineProperty(Ns,"target",{writable:!0,value:{value:li,name:ae}}),ve(Ns))};delete Qi["aria-invalid"];let Vp,Ow;const Jd=[];let D3=!1;(emt({value:li})||et)&&(Qn?Vp=Qn(li):D3=!0);const Hr=Mg.map(Ns=>{if(!un.isValidElement(Ns))return null;let zc;if(ee){if(!Array.isArray(li))throw new Error(GAe(2));zc=li.some(Dh=>wCe(Dh,Ns.props.value)),zc&&D3&&Jd.push(Ns.props.children)}else zc=wCe(li,Ns.props.value),zc&&D3&&(Ow=Ns.props.children);return un.cloneElement(Ns,{"aria-selected":zc?"true":"false",onClick:Dg(Ns),onKeyUp:Dh=>{Dh.key===" "&&Dh.preventDefault(),Ns.props.onKeyUp&&Ns.props.onKeyUp(Dh)},role:"option",selected:zc,value:void 0,"data-value":Ns.props.value})});D3&&(ee?Jd.length===0?Vp=null:Vp=Jd.reduce((Ns,zc,Dh)=>(Ns.push(zc),Dh<Jd.length-1&&Ns.push(", "),Ns),[]):Vp=Ow);let da=$u;!L&&zo&&Ss&&(da=bu.clientWidth);let Ws;typeof pi<"u"?Ws=pi:Ws=tt?null:0;const gc=fi.id||(ae?`mui-component-select-${ae}`:void 0),Cu={...s,variant:Ea,value:li,open:Yp,error:st},su=qLn(Cu),Bg={...At.PaperProps,...(c5=At.slotProps)==null?void 0:c5.paper},d0=XQ();return le.jsxs(un.Fragment,{children:[le.jsx(jLn,{as:"div",ref:pc,tabIndex:Ws,role:"combobox","aria-controls":Yp?d0:void 0,"aria-disabled":tt?"true":void 0,"aria-expanded":Yp?"true":"false","aria-haspopup":"listbox","aria-label":C,"aria-labelledby":[Rt,gc].filter(Boolean).join(" ")||void 0,"aria-describedby":y,"aria-required":ur?"true":void 0,"aria-invalid":st?"true":void 0,onKeyDown:iy,onMouseDown:tt||zn?null:il,onBlur:wd,onFocus:pn,...fi,ownerState:Cu,className:bo(fi.className,su.select,G),id:gc,children:ULn(Vp)?yCe||(yCe=le.jsx("span",{className:"notranslate","aria-hidden":!0,children:""})):Vp}),le.jsx(zLn,{"aria-invalid":st,value:Array.isArray(li)?li.join(","):li,name:ae,ref:Ke,"aria-hidden":!0,onChange:Rg,tabIndex:-1,disabled:tt,className:su.nativeInput,autoFocus:N,required:ur,...Qi,ownerState:Cu}),le.jsx(HLn,{as:at,className:su.icon,ownerState:Cu}),le.jsx(dLn,{id:`menu-${ae||""}`,anchorEl:bu,open:Yp,onClose:Rh,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...At,slotProps:{...At.slotProps,list:{"aria-labelledby":Rt,role:"listbox","aria-multiselectable":ee?"true":void 0,disableListWrap:!0,id:d0,...At.MenuListProps},paper:{...Bg,style:{minWidth:da,...Bg!=null?Bg.style:null}}},children:Hr})]})}),KLn=o=>{const{classes:s}=o,y=Hc({root:["root"]},pIe,s);return{...s,...y}},jFt={name:"MuiSelect",overridesResolver:(o,s)=>s.root,shouldForwardProp:o=>ny(o)&&o!=="variant",slot:"Root"},GLn=Ia(zmt,jFt)(""),YLn=Ia($Ft,jFt)(""),VLn=Ia(BFt,jFt)(""),gIe=un.forwardRef(function(s,p){const y=Su({name:"MuiSelect",props:s}),{autoWidth:C=!1,children:N,classes:L={},className:z,defaultOpen:G=!1,displayEmpty:q=!1,IconComponent:nt=mNn,id:tt,input:et,inputProps:st,label:at,labelId:It,MenuProps:Rt,multiple:At=!1,native:ee=!1,onClose:ae,onOpen:ve,open:hn,renderValue:pe,SelectDisplayProps:pn,variant:Yn="outlined",...Ln}=y,zn=ee?yLn:WLn,Qn=N6(),ur=xC({props:y,muiFormControl:Qn,states:["variant","error"]}),fi=ur.variant||Yn,pi={...y,variant:fi,classes:L},Or=KLn(pi),{root:di,...Ea}=Or,Qi=et||{standard:le.jsx(GLn,{ownerState:pi}),outlined:le.jsx(YLn,{label:at,ownerState:pi}),filled:le.jsx(VLn,{ownerState:pi})}[fi],li=Im(p,r$(Qi));return le.jsx(un.Fragment,{children:un.cloneElement(Qi,{inputComponent:zn,inputProps:{children:N,error:ur.error,IconComponent:nt,variant:fi,type:void 0,multiple:At,...ee?{id:tt}:{autoWidth:C,defaultOpen:G,displayEmpty:q,labelId:It,MenuProps:Rt,onClose:ae,onOpen:ve,open:hn,renderValue:pe,SelectDisplayProps:{id:tt,...pn}},...st,classes:st?PFt(Ea,st.classes):Ea,...et?et.props.inputProps:{}},...(At&&ee||q)&&fi==="outlined"?{notched:!0}:{},ref:li,className:bo(Qi.props.className,z,Or.root),...!et&&{variant:fi},...Ln})})});gIe.muiName="Select";const bIe=un.createContext();function XLn(o){return Vc("MuiTable",o)}au("MuiTable",["root","stickyHeader"]);const QLn=o=>{const{classes:s,stickyHeader:p}=o;return Hc({root:["root",p&&"stickyHeader"]},XLn,s)},JLn=Ia("table",{name:"MuiTable",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,p.stickyHeader&&s.stickyHeader]}})(pu(({theme:o})=>({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":{...o.typography.body2,padding:o.spacing(2),color:(o.vars||o).palette.text.secondary,textAlign:"left",captionSide:"bottom"},variants:[{props:({ownerState:s})=>s.stickyHeader,style:{borderCollapse:"separate"}}]}))),vCe="table",ZLn=un.forwardRef(function(s,p){const y=Su({props:s,name:"MuiTable"}),{className:C,component:N=vCe,padding:L="normal",size:z="medium",stickyHeader:G=!1,...q}=y,nt={...y,component:N,padding:L,size:z,stickyHeader:G},tt=QLn(nt),et=un.useMemo(()=>({padding:L,size:z,stickyHeader:G}),[L,z,G]);return le.jsx(bIe.Provider,{value:et,children:le.jsx(JLn,{as:N,role:N===vCe?null:"table",ref:p,className:bo(tt.root,C),ownerState:nt,...q})})}),Umt=un.createContext();function tMn(o){return Vc("MuiTableBody",o)}au("MuiTableBody",["root"]);const eMn=o=>{const{classes:s}=o;return Hc({root:["root"]},tMn,s)},nMn=Ia("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(o,s)=>s.root})({display:"table-row-group"}),rMn={variant:"body"},_Ce="tbody",iMn=un.forwardRef(function(s,p){const y=Su({props:s,name:"MuiTableBody"}),{className:C,component:N=_Ce,...L}=y,z={...y,component:N},G=eMn(z);return le.jsx(Umt.Provider,{value:rMn,children:le.jsx(nMn,{className:bo(G.root,C),as:N,ref:p,role:N===_Ce?null:"rowgroup",ownerState:z,...L})})});function aMn(o){return Vc("MuiTableCell",o)}const sMn=au("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),oMn=o=>{const{classes:s,variant:p,align:y,padding:C,size:N,stickyHeader:L}=o,z={root:["root",p,L&&"stickyHeader",y!=="inherit"&&`align${fa(y)}`,C!=="normal"&&`padding${fa(C)}`,`size${fa(N)}`]};return Hc(z,aMn,s)},cMn=Ia("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,s[p.variant],s[`size${fa(p.size)}`],p.padding!=="normal"&&s[`padding${fa(p.padding)}`],p.align!=="inherit"&&s[`align${fa(p.align)}`],p.stickyHeader&&s.stickyHeader]}})(pu(({theme:o})=>({...o.typography.body2,display:"table-cell",verticalAlign:"inherit",borderBottom:o.vars?`1px solid ${o.vars.palette.TableCell.border}`:`1px solid
|
|
30
|
-
${o.palette.mode==="light"?tOn(Ef(o.palette.divider,1),.88):eOn(Ef(o.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(o.vars||o).palette.text.primary,lineHeight:o.typography.pxToRem(24),fontWeight:o.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(o.vars||o).palette.text.primary}},{props:{variant:"footer"},style:{color:(o.vars||o).palette.text.secondary,lineHeight:o.typography.pxToRem(21),fontSize:o.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${sMn.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:({ownerState:s})=>s.stickyHeader,style:{position:"sticky",top:0,zIndex:2,backgroundColor:(o.vars||o).palette.background.default}}]}))),S3=un.forwardRef(function(s,p){const y=Su({props:s,name:"MuiTableCell"}),{align:C="inherit",className:N,component:L,padding:z,scope:G,size:q,sortDirection:nt,variant:tt,...et}=y,st=un.useContext(bIe),at=un.useContext(Umt),It=at&&at.variant==="head";let Rt;L?Rt=L:Rt=It?"th":"td";let At=G;Rt==="td"?At=void 0:!At&&It&&(At="col");const ee=tt||at&&at.variant,ae={...y,align:C,component:Rt,padding:z||(st&&st.padding?st.padding:"normal"),size:q||(st&&st.size?st.size:"medium"),sortDirection:nt,stickyHeader:ee==="head"&&st&&st.stickyHeader,variant:ee},ve=oMn(ae);let hn=null;return nt&&(hn=nt==="asc"?"ascending":"descending"),le.jsx(cMn,{as:Rt,ref:p,className:bo(ve.root,N),"aria-sort":hn,scope:At,ownerState:ae,...et})});function uMn(o){return Vc("MuiTableHead",o)}au("MuiTableHead",["root"]);const lMn=o=>{const{classes:s}=o;return Hc({root:["root"]},uMn,s)},hMn=Ia("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(o,s)=>s.root})({display:"table-header-group"}),fMn={variant:"head"},xCe="thead",dMn=un.forwardRef(function(s,p){const y=Su({props:s,name:"MuiTableHead"}),{className:C,component:N=xCe,...L}=y,z={...y,component:N},G=lMn(z);return le.jsx(Umt.Provider,{value:fMn,children:le.jsx(hMn,{as:N,className:bo(G.root,C),ref:p,role:N===xCe?null:"rowgroup",ownerState:z,...L})})});function pMn(o){return Vc("MuiToolbar",o)}au("MuiToolbar",["root","gutters","regular","dense"]);const gMn=o=>{const{classes:s,disableGutters:p,variant:y}=o;return Hc({root:["root",!p&&"gutters",y]},pMn,s)},bMn=Ia("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,!p.disableGutters&&s.gutters,s[p.variant]]}})(pu(({theme:o})=>({position:"relative",display:"flex",alignItems:"center",variants:[{props:({ownerState:s})=>!s.disableGutters,style:{paddingLeft:o.spacing(2),paddingRight:o.spacing(2),[o.breakpoints.up("sm")]:{paddingLeft:o.spacing(3),paddingRight:o.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:o.mixins.toolbar}]}))),ECe=un.forwardRef(function(s,p){const y=Su({props:s,name:"MuiToolbar"}),{className:C,component:N="div",disableGutters:L=!1,variant:z="regular",...G}=y,q={...y,component:N,disableGutters:L,variant:z},nt=gMn(q);return le.jsx(bMn,{as:N,className:bo(nt.root,C),ref:p,ownerState:q,...G})});function mMn(o){return Vc("MuiTableRow",o)}const TCe=au("MuiTableRow",["root","selected","hover","head","footer"]),yMn=o=>{const{classes:s,selected:p,hover:y,head:C,footer:N}=o;return Hc({root:["root",p&&"selected",y&&"hover",C&&"head",N&&"footer"]},mMn,s)},wMn=Ia("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,p.head&&s.head,p.footer&&s.footer]}})(pu(({theme:o})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${TCe.hover}:hover`]:{backgroundColor:(o.vars||o).palette.action.hover},[`&.${TCe.selected}`]:{backgroundColor:o.vars?`rgba(${o.vars.palette.primary.mainChannel} / ${o.vars.palette.action.selectedOpacity})`:Ef(o.palette.primary.main,o.palette.action.selectedOpacity),"&:hover":{backgroundColor:o.vars?`rgba(${o.vars.palette.primary.mainChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.hoverOpacity}))`:Ef(o.palette.primary.main,o.palette.action.selectedOpacity+o.palette.action.hoverOpacity)}}}))),kCe="tr",Sbt=un.forwardRef(function(s,p){const y=Su({props:s,name:"MuiTableRow"}),{className:C,component:N=kCe,hover:L=!1,selected:z=!1,...G}=y,q=un.useContext(Umt),nt={...y,component:N,hover:L,selected:z,head:q&&q.variant==="head",footer:q&&q.variant==="footer"},tt=yMn(nt);return le.jsx(wMn,{as:N,ref:p,className:bo(tt.root,C),role:N===kCe?null:"row",ownerState:nt,...G})});function vMn(o){return Vc("MuiTextField",o)}au("MuiTextField",["root"]);const _Mn={standard:zmt,filled:BFt,outlined:$Ft},xMn=o=>{const{classes:s}=o;return Hc({root:["root"]},vMn,s)},EMn=Ia(APn,{name:"MuiTextField",slot:"Root",overridesResolver:(o,s)=>s.root})({}),$Dt=un.forwardRef(function(s,p){const y=Su({props:s,name:"MuiTextField"}),{autoComplete:C,autoFocus:N=!1,children:L,className:z,color:G="primary",defaultValue:q,disabled:nt=!1,error:tt=!1,FormHelperTextProps:et,fullWidth:st=!1,helperText:at,id:It,InputLabelProps:Rt,inputProps:At,InputProps:ee,inputRef:ae,label:ve,maxRows:hn,minRows:pe,multiline:pn=!1,name:Yn,onBlur:Ln,onChange:zn,onFocus:Qn,placeholder:ur,required:fi=!1,rows:pi,select:Or=!1,SelectProps:di,slots:Ea={},slotProps:Qi={},type:li,value:ze,variant:Na="outlined",...Ts}=y,Ke={...y,autoFocus:N,color:G,disabled:nt,error:tt,fullWidth:st,multiline:pn,required:fi,select:Or,variant:Na},xo=xMn(Ke),Ss=XQ(It),La=at&&Ss?`${Ss}-helper-text`:void 0,zo=ve&&Ss?`${Ss}-label`:void 0,$u=_Mn[Na],gu={slots:Ea,slotProps:{input:ee,inputLabel:Rt,htmlInput:At,formHelperText:et,select:di,...Qi}},Ds={},pc=gu.slotProps.inputLabel;Na==="outlined"&&(pc&&typeof pc.shrink<"u"&&(Ds.notched=pc.shrink),Ds.label=ve),Or&&((!di||!di.native)&&(Ds.id=void 0),Ds["aria-describedby"]=void 0);const[bu,P1]=wh("root",{elementType:EMn,shouldForwardComponentProp:!0,externalForwardedProps:{...gu,...Ts},ownerState:Ke,className:bo(xo.root,z),ref:p,additionalProps:{disabled:nt,error:tt,fullWidth:st,required:fi,color:G,variant:Na}}),[il,Rh]=wh("input",{elementType:$u,externalForwardedProps:gu,additionalProps:Ds,ownerState:Ke}),[Mg,Rg]=wh("inputLabel",{elementType:tLn,externalForwardedProps:gu,ownerState:Ke}),[Dg,iy]=wh("htmlInput",{elementType:"input",externalForwardedProps:gu,ownerState:Ke}),[Yp,wd]=wh("formHelperText",{elementType:jPn,externalForwardedProps:gu,ownerState:Ke}),[Vp,Ow]=wh("select",{elementType:gIe,externalForwardedProps:gu,ownerState:Ke}),Jd=le.jsx(il,{"aria-describedby":La,autoComplete:C,autoFocus:N,defaultValue:q,fullWidth:st,multiline:pn,name:Yn,rows:pi,maxRows:hn,minRows:pe,type:li,value:ze,id:Ss,inputRef:ae,onBlur:Ln,onChange:zn,onFocus:Qn,placeholder:ur,inputProps:iy,slots:{input:Ea.htmlInput?Dg:void 0},...Rh});return le.jsxs(bu,{...P1,children:[ve!=null&&ve!==""&&le.jsx(Mg,{htmlFor:Ss,id:zo,...Rg,children:ve}),Or?le.jsx(Vp,{"aria-describedby":La,id:Ss,labelId:zo,value:ze,input:Jd,...Ow,children:L}):Jd,at&&le.jsx(Yp,{id:La,...wd,children:at})]})});class mIe{constructor(s,p){this.it_=s,this.last_=p}next(){if(this.it_.equals(this.last_))return{done:!0,value:void 0};{const s=this.it_;return this.it_=this.it_.next(),{done:!1,value:s.value}}}[Symbol.iterator](){return this}}class qmt{empty(){return this.size()===0}rbegin(){return this.end().reverse()}rend(){return this.begin().reverse()}[Symbol.iterator](){return new mIe(this.begin(),this.end())}toJSON(){const s=[];for(const p of this)s.push(p);return s}}class J2{constructor(s,p){this.data_=s,this.index_=p}index(){return this.index_}get value(){return this.data_[this.index_]}prev(){return--this.index_,this}next(){return++this.index_,this}advance(s){return this.index_+=s,this}equals(s){return this.data_===s.data_&&this.index_===s.index_}swap(s){[this.data_,s.data_]=[s.data_,this.data_],[this.index_,s.index_]=[s.index_,this.index_]}}class yIe extends qmt{constructor(s){super(),this.data_=s(this)}assign(s,p){this.clear(),this.insert(s,p)}clear(){this.data_.clear()}begin(){return this.data_.begin()}end(){return this.data_.end()}has(s){return!this.find(s).equals(this.end())}size(){return this.data_.size()}push(...s){if(s.length===0)return this.size();const p=new J2(s,0),y=new J2(s,s.length);return this._Insert_by_range(p,y),this.size()}insert(...s){return s.length===1?this._Insert_by_key(s[0]):s[0].next instanceof Function&&s[1].next instanceof Function?this._Insert_by_range(s[0],s[1]):this._Insert_by_hint(s[0],s[1])}erase(...s){return s.length===1&&!(s[0]instanceof this.end().constructor&&s[0].source()===this)?this._Erase_by_val(s[0]):s.length===1?this._Erase_by_range(s[0]):this._Erase_by_range(s[0],s[1])}_Erase_by_range(s,p=s.next()){const y=this.data_.erase(s,p);return this._Handle_erase(s,p),y}}class wIe extends Error{constructor(s){super(s);const p=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,p):this.__proto__=p}get name(){return this.constructor.name}what(){return this.message}toJSON(){return{name:this.name,message:this.message,stack:this.stack}}}class vIe extends wIe{constructor(s){super(s)}}class UQ extends vIe{constructor(s){super(s)}}class oC extends vIe{constructor(s){super(s)}}var yd;(function(o){function s(nt){if(typeof nt=="string")return nt;let tt=nt.constructor.name;return nt.constructor.__MODULE&&(tt=`${nt.constructor.__MODULE}.${tt}`),`std.${tt}`}o.get_class_name=s;function p(nt,tt){return new oC(`Error on ${s(nt)}.${tt}(): it's empty container.`)}o.empty=p;function y(nt,tt,et){return new oC(`Error on ${s(nt)}.${tt}(): parametric index is negative -> (index = ${et}).`)}o.negative_index=y;function C(nt,tt,et,st){return new oC(`Error on ${s(nt)}.${tt}(): parametric index is equal or greater than size -> (index = ${et}, size: ${st}).`)}o.excessive_index=C;function N(nt,tt){return new UQ(`Error on ${s(nt)}.${tt}(): parametric iterator is not this container's own.`)}o.not_my_iterator=N;function L(nt,tt){return new UQ(`Error on ${s(nt)}.${tt}(): parametric iterator, it already has been erased.`)}o.erased_iterator=L;function z(nt,tt,et){return new oC(`Error on ${s(nt)}.${tt}(): parametric iterator is directing negative position -> (index = ${et}).`)}o.negative_iterator=z;function G(nt,tt="end"){const et=s(nt);return new oC(`Error on ${et}.Iterator.value: cannot access to the ${et}.${tt}().value.`)}o.iterator_end_value=G;function q(nt,tt,et){throw new oC(`Error on ${s(nt)}.${tt}(): unable to find the matched key -> ${et}`)}o.key_nout_found=q})(yd||(yd={}));class _Ie extends yIe{count(s){return this.find(s).equals(this.end())?0:1}insert(...s){return super.insert(...s)}_Insert_by_range(s,p){for(;!s.equals(p);s=s.next())this._Insert_by_key(s.value)}extract(s){return s instanceof this.end().constructor?this._Extract_by_iterator(s):this._Extract_by_val(s)}_Extract_by_val(s){const p=this.find(s);if(p.equals(this.end())===!0)throw yd.key_nout_found(this,"extract",s);return this._Erase_by_range(p),s}_Extract_by_iterator(s){return s.equals(this.end())===!0||this.has(s.value)===!1?this.end():(this._Erase_by_range(s),s)}_Erase_by_val(s){const p=this.find(s);return p.equals(this.end())===!0?0:(this._Erase_by_range(p),1)}merge(s){for(let p=s.begin();!p.equals(s.end());)this.has(p.value)===!1?(this.insert(p.value),p=s.erase(p)):p=p.next()}}class xIe extends yIe{insert(...s){return super.insert(...s)}_Erase_by_val(s){const p=this.find(s);if(p.equals(this.end())===!0)return 0;let y=p.next(),C=1;for(;!y.equals(this.end())&&this._Key_eq(s,y.value);)y=y.next(),++C;return this._Erase_by_range(p,y),C}merge(s){this.insert(s.begin(),s.end()),s.clear()}}class EIe extends qmt{constructor(s){super(),this.data_=s(this)}assign(s,p){this.clear(),this.insert(s,p)}clear(){this.data_.clear()}begin(){return this.data_.begin()}end(){return this.data_.end()}has(s){return!this.find(s).equals(this.end())}size(){return this.data_.size()}push(...s){const p=new J2(s,0),y=new J2(s,s.length);return this.insert(p,y),this.size()}insert(...s){return s.length===1?this.emplace(s[0].first,s[0].second):s[0].next instanceof Function&&s[1].next instanceof Function?this._Insert_by_range(s[0],s[1]):this.emplace_hint(s[0],s[1].first,s[1].second)}erase(...s){return s.length===1&&(!(s[0]instanceof this.end().constructor)||s[0].source()!==this)?this._Erase_by_key(s[0]):s.length===1?this._Erase_by_range(s[0]):this._Erase_by_range(s[0],s[1])}_Erase_by_range(s,p=s.next()){const y=this.data_.erase(s,p);return this._Handle_erase(s,p),y}}class TIe extends EIe{count(s){return this.find(s).equals(this.end())?0:1}get(s){const p=this.find(s);if(p.equals(this.end())===!0)throw yd.key_nout_found(this,"get",s);return p.second}take(s,p){const y=this.find(s);return y.equals(this.end())?this.emplace(s,p()).first.second:y.second}set(s,p){this.insert_or_assign(s,p)}insert(...s){return super.insert(...s)}_Insert_by_range(s,p){for(let y=s;!y.equals(p);y=y.next())this.emplace(y.value.first,y.value.second)}insert_or_assign(...s){if(s.length===2)return this._Insert_or_assign_with_key_value(s[0],s[1]);if(s.length===3)return this._Insert_or_assign_with_hint(s[0],s[1],s[2])}_Insert_or_assign_with_key_value(s,p){const y=this.emplace(s,p);return y.second===!1&&(y.first.second=p),y}_Insert_or_assign_with_hint(s,p,y){const C=this.emplace_hint(s,p,y);return C.second!==y&&(C.second=y),C}extract(s){return s instanceof this.end().constructor?this._Extract_by_iterator(s):this._Extract_by_key(s)}_Extract_by_key(s){const p=this.find(s);if(p.equals(this.end())===!0)throw yd.key_nout_found(this,"extract",s);const y=p.value;return this._Erase_by_range(p),y}_Extract_by_iterator(s){return s.equals(this.end())===!0?this.end():(this._Erase_by_range(s),s)}_Erase_by_key(s){const p=this.find(s);return p.equals(this.end())===!0?0:(this._Erase_by_range(p),1)}merge(s){for(let p=s.begin();!p.equals(s.end());)this.has(p.first)===!1?(this.insert(p.value),p=s.erase(p)):p=p.next()}}class kIe extends EIe{insert(...s){return super.insert(...s)}_Erase_by_key(s){const p=this.find(s);if(p.equals(this.end())===!0)return 0;let y=p.next(),C=1;for(;!y.equals(this.end())&&this._Key_eq(s,y.first);)y=y.next(),++C;return this._Erase_by_range(p,y),C}merge(s){this.insert(s.begin(),s.end()),s.clear()}}var rmt;(function(o){function s(p,...y){let C,N;return y.length>=1&&y[0]instanceof Array?(C=()=>{const L=y[0];p.push(...L)},N=y.slice(1)):y.length>=2&&y[0].next instanceof Function&&y[1].next instanceof Function?(C=()=>{const L=y[0],z=y[1];p.assign(L,z)},N=y.slice(2)):(C=null,N=y),{ramda:C,tail:N}}o.construct=s})(rmt||(rmt={}));function SIe(){return jDt===null&&(jDt=typeof global=="object"&&TMn(global)),jDt}function TMn(o){return o!==null&&typeof o.process=="object"&&o.process!==null&&typeof o.process.versions=="object"&&o.process.versions!==null&&typeof o.process.versions.node<"u"}let jDt=null;function kMn(){return hQ===null&&(hQ=SIe()?global:self,hQ.__s_iUID===void 0&&(hQ.__s_iUID=0)),hQ}let hQ=null;function bk(o){if(o instanceof Object){if(o.hasOwnProperty("__get_m_iUID")===!1){const s=++kMn().__s_iUID;Object.defineProperty(o,"__get_m_iUID",{value:function(){return s}})}return o.__get_m_iUID()}else return o===void 0?-1:0}function t5(o,s){return o=o&&o.valueOf(),s=s&&s.valueOf(),o instanceof Object&&o.equals instanceof Function?o.equals(s):o===s}function SMn(o,s){return!t5(o,s)}function a5(o,s){return o=o.valueOf(),s=s.valueOf(),o instanceof Object?o.less instanceof Function?o.less(s):bk(o)<bk(s):o<s}var ey;(function(o){function s(y,C,N,...L){let z=null,G=a5;if(L.length===1&&L[0]instanceof C){const q=L[0];G=q.key_comp(),z=()=>{const nt=q.begin(),tt=q.end();y.assign(nt,tt)}}else{const q=rmt.construct(y,...L);z=q.ramda,q.tail.length>=1&&(G=q.tail[0])}N(G),z!==null&&z()}o.construct=s;function p(y,C,N){const L=C.prev();let z=L.equals(y.end())||y.value_comp()(L.value,N);return z=z&&(C.equals(y.end())||y.value_comp()(N,C.value)),z}o.emplacable=p})(ey||(ey={}));function HFt(...o){let s=AMn;for(let p of o){p=p&&p.valueOf();const y=typeof p;if(y==="boolean")s=CMn(p,s);else if(y==="number"||y==="bigint")s=SCe(p,s);else if(y==="string")s=CIe(p,s);else if(p instanceof Object&&p.hashCode instanceof Function){const C=p.hashCode();if(o.length===1)return C;s=s^C,s*=zFt}else s=SCe(bk(p),s)}return Math.abs(s)}function CMn(o,s){return s^=o?1:0,s*=zFt,s}function SCe(o,s){return CIe(o.toString(),s)}function CIe(o,s){for(let p=0;p<o.length;++p)s^=o.charCodeAt(p),s*=zFt;return Math.abs(s)}const AMn=2166136261,zFt=16777619;class rp{constructor(s,p){this.first=s,this.second=p}equals(s){return t5(this.first,s.first)&&t5(this.second,s.second)}less(s){return t5(this.first,s.first)===!1?a5(this.first,s.first):a5(this.second,s.second)}hashCode(){return HFt(this.first,this.second)}}class AIe extends _Ie{find(s){const p=this.lower_bound(s);return!p.equals(this.end())&&this._Key_eq(s,p.value)?p:this.end()}equal_range(s){const p=this.lower_bound(s);return new rp(p,!p.equals(this.end())&&this._Key_eq(s,p.value)?p.next():p)}value_comp(){return this.key_comp()}_Key_eq(s,p){return!this.key_comp()(s,p)&&!this.key_comp()(p,s)}_Insert_by_key(s){let p=this.lower_bound(s);return!p.equals(this.end())&&this._Key_eq(p.value,s)?new rp(p,!1):(p=this.data_.insert(p,s),this._Handle_insert(p,p.next()),new rp(p,!0))}_Insert_by_hint(s,p){if(ey.emplacable(this,s,p)){const C=this.data_.insert(s,p);return this._Handle_insert(C,C.next()),C}else return this._Insert_by_key(p).first}}class IMn extends wIe{constructor(s){super(s)}}let OMn=class extends IMn{constructor(s){super(s)}};class VF{constructor(s,p){this.index_=s,this.value_=p}index(){return this.index_}get value(){return this.value_}next(){return++this.index_,this}equals(s){return this.index_===s.index_}}class UFt extends qmt{begin(){return this.nth(0)}end(){return this.nth(this.size())}at(s){return this._At(s)}set(s,p){if(s<0)throw yd.negative_index(this.source(),"at",s);if(s>=this.size())throw yd.excessive_index(this.source(),"at",s,this.size());this._Set(s,p)}front(s){if(arguments.length===0)return this.at(0);this.set(0,s)}back(s){const p=this.size()-1;if(arguments.length===0)return this.at(p);this.set(p,s)}insert(s,...p){if(s._Get_array()!==this)throw yd.not_my_iterator(this.source(),"insert");if(s.index()<0)throw yd.negative_iterator(this.source(),"insert",s.index());return s.index()>this.size()&&(s=this.end()),p.length===1?this._Insert_by_repeating_val(s,1,p[0]):p.length===2&&typeof p[0]=="number"?this._Insert_by_repeating_val(s,p[0],p[1]):this._Insert_by_range(s,p[0],p[1])}_Insert_by_repeating_val(s,p,y){const C=new VF(0,y),N=new VF(p);return this._Insert_by_range(s,C,N)}pop_back(){if(this.empty()===!0)throw yd.empty(this.source(),"pop_back");this._Pop_back()}erase(s,p=s.next()){if(s._Get_array()!==this||p._Get_array()!==this)throw yd.not_my_iterator(this.source(),"erase");if(s.index()<0)throw yd.negative_iterator(this.source(),"erase",s.index());if(s.index()>p.index())throw new OMn(`Error on ${yd.get_class_name(this.source())}.erase(): first iterator has greater index than last -> (first = ${s.index()}, last = ${p.index()}).`);return s.index()>=this.size()?this.end():this._Erase_by_range(s,p)}}class qFt extends UFt{constructor(){super()}assign(s,p){this.clear(),this.insert(this.end(),s,p)}clear(){this.data_.splice(0,this.data_.length)}resize(s){this.data_.length=s}size(){return this.data_.length}_At(s){return this.data_[s]}_Set(s,p){this.data_[s]=p}data(){return this.data_}[Symbol.iterator](){return this.data_[Symbol.iterator]()}push(...s){return this.data_.push(...s)}push_back(s){this.data_.push(s)}_Insert_by_range(s,p,y){if(s.index()>=this.size()){const C=this.size();for(;!p.equals(y);p=p.next())this.data_.push(p.value);return this.nth(C)}else{const C=this.data_.splice(s.index());for(;!p.equals(y);p=p.next())this.data_.push(p.value);return this.data_.push(...C),s}}_Pop_back(){this.data_.pop()}_Erase_by_range(s,p){return s.index()>=this.size()?s:p.index()>=this.size()?(this.data_.splice(s.index()),this.end()):(this.data_.splice(s.index(),p.index()-s.index()),s)}equals(s){return this.data_===s.data_}swap(s){[this.data_,s.data_]=[s.data_,this.data_]}toJSON(){return this.data_}}class WFt{constructor(s,p){this.array_=s,this.index_=p}_Get_array(){return this.array_}index(){return this.index_}get value(){return this.array_.at(this.index_)}set value(s){this.array_.set(this.index_,s)}prev(){return this.advance(-1)}next(){return this.advance(1)}advance(s){return this.array_.nth(this.index_+s)}equals(s){return t5(this.array_,s.array_)&&this.index_===s.index_}}let Wmt=class{constructor(s){this.base_=s.prev()}source(){return this.base_.source()}base(){return this.base_.next()}get value(){return this.base_.value}prev(){return this._Create_neighbor(this.base().next())}next(){return this._Create_neighbor(this.base_)}equals(s){return this.base_.equals(s.base_)}};class KFt extends Wmt{advance(s){return this._Create_neighbor(this.base().advance(-s))}index(){return this.base_.index()}get value(){return this.base_.value}set value(s){this.base_.value=s}}class N3 extends qFt{constructor(s){super(),this.data_=[],this.associative_=s}nth(s){return new N3.Iterator(this,s)}static _Swap_associative(s,p){[s.associative_,p.associative_]=[p.associative_,s.associative_]}source(){return this.associative_}}(function(o){class s extends WFt{source(){return this._Get_array().source()}reverse(){return new p(this)}}o.Iterator=s;class p extends KFt{_Create_neighbor(C){return new p(C)}}o.ReverseIterator=p})(N3||(N3={}));function Kmt(o,s){if(o.index instanceof Function)return NMn(o,s);let p=0;for(;!o.equals(s);o=o.next())++p;return p}function NMn(o,s){const p=o.index(),y=s.index();return o.base instanceof Function?p-y:y-p}function Gmt(o,s){if(s===0)return o;if(o.advance instanceof Function)return o.advance(s);let p;if(s<0){if(!(o.prev instanceof Function))throw new UQ("Error on std.advance(): parametric iterator is not a bi-directional iterator, thus advancing to negative direction is not possible.");p=y=>y.prev(),s=-s}else p=y=>y.next();for(;s-- >0;)o=p(o);return o}function Ymt(o,s,p,y=a5){let C=Kmt(o,s);for(;C>0;){const N=Math.floor(C/2),L=Gmt(o,N);y(L.value,p)?(o=L.next(),C-=N+1):C=N}return o}function Vmt(o,s,p,y=a5){let C=Kmt(o,s);for(;C>0;){const N=Math.floor(C/2),L=Gmt(o,N);y(p,L.value)?C=N:(o=L.next(),C-=N+1)}return o}class imt extends AIe{constructor(...s){super(p=>new N3(p)),ey.construct(this,imt,p=>{this.key_comp_=p},...s)}swap(s){[this.data_,s.data_]=[s.data_,this.data_],N3._Swap_associative(this.data_,s.data_),[this.key_comp_,s.key_comp_]=[s.key_comp_,this.key_comp_]}nth(s){return this.data_.nth(s)}key_comp(){return this.key_comp_}lower_bound(s){return Ymt(this.begin(),this.end(),s,this.value_comp())}upper_bound(s){return Vmt(this.begin(),this.end(),s,this.value_comp())}_Handle_insert({},{}){}_Handle_erase({},{}){}}(function(o){o.Iterator=N3.Iterator,o.ReverseIterator=N3.ReverseIterator,o.__MODULE="experimental"})(imt||(imt={}));class IIe extends xIe{find(s){const p=this.lower_bound(s);return!p.equals(this.end())&&this._Key_eq(s,p.value)?p:this.end()}count(s){let p=this.find(s),y=0;for(;!p.equals(this.end())&&this._Key_eq(p.value,s);p=p.next())++y;return y}equal_range(s){return new rp(this.lower_bound(s),this.upper_bound(s))}value_comp(){return this.key_comp()}_Key_eq(s,p){return!this.key_comp()(s,p)&&!this.key_comp()(p,s)}_Insert_by_key(s){let p=this.upper_bound(s);return p=this.data_.insert(p,s),this._Handle_insert(p,p.next()),p}_Insert_by_hint(s,p){if(ey.emplacable(this,s,p)){const C=this.data_.insert(s,p);return this._Handle_insert(C,C.next()),C}else return this._Insert_by_key(p)}_Insert_by_range(s,p){for(let y=s;!y.equals(p);y=y.next())this._Insert_by_key(y.value)}}class amt extends IIe{constructor(...s){super(p=>new N3(p)),ey.construct(this,amt,p=>{this.key_comp_=p},...s)}swap(s){[this.data_,s.data_]=[s.data_,this.data_],N3._Swap_associative(this.data_,s.data_),[this.key_comp_,s.key_comp_]=[s.key_comp_,this.key_comp_]}nth(s){return this.data_.nth(s)}key_comp(){return this.key_comp_}lower_bound(s){return Ymt(this.begin(),this.end(),s,this.value_comp())}upper_bound(s){return Vmt(this.begin(),this.end(),s,this.value_comp())}_Handle_insert({},{}){}_Handle_erase({},{}){}}(function(o){o.Iterator=N3.Iterator,o.ReverseIterator=N3.ReverseIterator,o.__MODULE="experimental"})(amt||(amt={}));class mk{constructor(s,p){this.first=s,this.second=p}equals(s){return t5(this.first,s.first)}less(s){return a5(this.first,s.first)}hashCode(){return HFt(this.first)}}class OIe extends TIe{find(s){const p=this.lower_bound(s);return!p.equals(this.end())&&this._Key_eq(s,p.first)?p:this.end()}equal_range(s){const p=this.lower_bound(s);return new rp(p,!p.equals(this.end())&&this._Key_eq(s,p.first)?p.next():p)}value_comp(){return(s,p)=>this.key_comp()(s.first,p.first)}_Key_eq(s,p){return!this.key_comp()(s,p)&&!this.key_comp()(p,s)}emplace(s,p){let y=this.lower_bound(s);return!y.equals(this.end())&&this._Key_eq(y.first,s)?new rp(y,!1):(y=this.data_.insert(y,new mk(s,p)),this._Handle_insert(y,y.next()),new rp(y,!0))}emplace_hint(s,p,y){const C=new mk(p,y);if(ey.emplacable(this,s,C)){const L=this.data_.insert(s,C);return this._Handle_insert(L,L.next()),L}else return this.emplace(p,y).first}}class P3 extends qFt{constructor(s){super(),this.data_=[],this.associative_=s}nth(s){return new P3.Iterator(this,s)}static _Swap_associative(s,p){[s.associative_,p.associative_]=[p.associative_,s.associative_]}source(){return this.associative_}}(function(o){class s extends WFt{source(){return this._Get_array().source()}reverse(){return new p(this)}get first(){return this.value.first}get second(){return this.value.second}set second(C){this.value.second=C}}o.Iterator=s;class p extends KFt{_Create_neighbor(C){return new p(C)}get first(){return this.value.first}get second(){return this.value.second}set second(C){this.value.second=C}}o.ReverseIterator=p})(P3||(P3={}));class smt extends OIe{constructor(...s){super(p=>new P3(p)),ey.construct(this,smt,p=>{this.key_comp_=p},...s)}swap(s){[this.data_,s.data_]=[s.data_,this.data_],P3._Swap_associative(this.data_,s.data_),[this.key_comp_,s.key_comp_]=[s.key_comp_,this.key_comp_]}nth(s){return this.data_.nth(s)}key_comp(){return this.key_comp_}lower_bound(s){return Ymt(this.begin(),this.end(),this._Capsule_key(s),this.value_comp())}upper_bound(s){return Vmt(this.begin(),this.end(),this._Capsule_key(s),this.value_comp())}_Capsule_key(s){return{first:s}}_Handle_insert({},{}){}_Handle_erase({},{}){}}(function(o){o.Iterator=P3.Iterator,o.ReverseIterator=P3.ReverseIterator,o.__MODULE="experimental"})(smt||(smt={}));class NIe extends kIe{find(s){const p=this.lower_bound(s);return!p.equals(this.end())&&this._Key_eq(s,p.first)?p:this.end()}count(s){let p=this.find(s),y=0;for(;!p.equals(this.end())&&this._Key_eq(p.first,s);p=p.next())++y;return y}equal_range(s){return new rp(this.lower_bound(s),this.upper_bound(s))}value_comp(){return(s,p)=>this.key_comp()(s.first,p.first)}_Key_eq(s,p){return!this.key_comp()(s,p)&&!this.key_comp()(p,s)}emplace(s,p){let y=this.upper_bound(s);return y=this.data_.insert(y,new mk(s,p)),this._Handle_insert(y,y.next()),y}emplace_hint(s,p,y){const C=new mk(p,y);if(ey.emplacable(this,s,C)){const L=this.data_.insert(s,C);return this._Handle_insert(L,L.next()),L}else return this.emplace(p,y)}_Insert_by_range(s,p){for(let y=s;!y.equals(p);y=y.next())this.emplace(y.value.first,y.value.second)}}class omt extends NIe{constructor(...s){super(p=>new P3(p)),ey.construct(this,omt,p=>{this.key_comp_=p},...s)}swap(s){[this.data_,s.data_]=[s.data_,this.data_],P3._Swap_associative(this.data_,s.data_),[this.key_comp_,s.key_comp_]=[s.key_comp_,this.key_comp_]}nth(s){return this.data_.nth(s)}key_comp(){return this.key_comp_}lower_bound(s){return Ymt(this.begin(),this.end(),this._Capsule_key(s),this.value_comp())}upper_bound(s){return Vmt(this.begin(),this.end(),this._Capsule_key(s),this.value_comp())}_Capsule_key(s){return{first:s}}_Handle_insert({},{}){}_Handle_erase({},{}){}}(function(o){o.Iterator=P3.Iterator,o.ReverseIterator=P3.ReverseIterator,o.__MODULE="experimental"})(omt||(omt={}));class i$ extends KFt{_Create_neighbor(s){return new i$(s)}}class GFt extends WFt{reverse(){return new i$(this)}source(){return this._Get_array()}}class uC extends qFt{constructor(...s){if(super(),s.length===0)this.data_=[];else if(s[0]instanceof Array){const p=s[0];this.data_=s[1]===!0?p:p.slice()}else if(s.length===1&&s[0]instanceof uC){const p=s[0];this.data_=p.data_.slice()}else s.length===2&&(this.data_=[],this.assign(s[0],s[1]))}static wrap(s){return new uC(s,!0)}nth(s){return new uC.Iterator(this,s)}source(){return this}}(function(o){o.Iterator=GFt,o.ReverseIterator=i$})(uC||(uC={}));function CBt(o,s,p=a5){const y=s.index()-o.index();if(y<=0)return;const C=o.advance(Math.floor(y/2)),N=C.value;C.index()!==o.index()&&HDt(o,C);let L=1;for(let z=1;z<y;++z){const G=o.advance(z);p(G.value,N)&&(HDt(G,o.advance(L)),++L)}HDt(o,o.advance(L-1)),CBt(o,o.advance(L-1),p),CBt(o.advance(L),s,p)}function HDt(o,s){[o.value,s.value]=[s.value,o.value]}class qp extends UFt{constructor(...s){if(super(),s.length===0&&this.clear(),s.length===1&&s[0]instanceof Array){const p=s[0],y=new J2(p,0),C=new J2(p,p.length);this.assign(y,C)}else if(s.length===1&&s[0]instanceof qp){const p=s[0];this.assign(p.begin(),p.end())}else s.length===2&&this.assign(s[0],s[1])}assign(s,p){this.clear(),this.insert(this.end(),s,p)}clear(){this.matrix_=[[]],this.size_=0,this.capacity_=qp.MIN_CAPACITY}resize(s){s=qp._Emend(s,"resize");const p=s-this.size();p>0?this.insert(this.end(),p,void 0):p<0&&this.erase(this.end().advance(-p),this.end())}reserve(s){this._Reserve(qp._Emend(s,"reserve"))}_Reserve(s){const p=[[]],y=this._Compute_col_size(s);for(let C=0;C<this.matrix_.length;++C){const N=this.matrix_[C];for(let L=0;L<N.length;++L){let z=p[p.length-1];p.length<qp.ROW_SIZE&&z.length===y&&(z=[],p.push(z)),z.push(N[L])}}this.matrix_=p,this.capacity_=s}shrink_to_fit(){this._Reserve(this.size())}swap(s){this._Swap(s)}_Swap(s){[this.matrix_,s.matrix_]=[s.matrix_,this.matrix_],[this.size_,s.size_]=[s.size_,this.size_],[this.capacity_,s.capacity_]=[s.capacity_,this.capacity_]}static _Emend(s,p){if(s=Math.floor(s),s<=0)throw new UQ(`Error on Deque.${p}(): n must be positive integer -> (n = ${s})`);return s}size(){return this.size_}capacity(){return this.capacity_}nth(s){return new qp.Iterator(this,s)}[Symbol.iterator](){return new qp.ForOfAdaptor(this.matrix_)}source(){return this}_At(s){const p=this._Fetch_index(s);return this.matrix_[p.first][p.second]}_Set(s,p){const y=this._Fetch_index(s);this.matrix_[y.first][y.second]=p}_Fetch_index(s){let p;for(p=0;p<this.matrix_.length;p++){const y=this.matrix_[p];if(s<y.length)break;s-=y.length}return p===this.matrix_.length&&p--,new rp(p,s)}_Compute_col_size(s=this.capacity_){return Math.floor(s/qp.ROW_SIZE)}push(...s){if(s.length===0)return this.size();const p=new J2(s,0),y=new J2(s,s.length);return this._Insert_by_range(this.end(),p,y),this.size()}push_front(s){this._Try_expand_capacity(this.size_+1),this._Try_add_row_at_front(),this.matrix_[0].unshift(s),++this.size_}push_back(s){this._Try_expand_capacity(this.size_+1),this._Try_add_row_at_back(),this.matrix_[this.matrix_.length-1].push(s),++this.size_}pop_front(){if(this.empty()===!0)throw yd.empty(this.constructor,"pop_front");this.matrix_[0].shift(),this.matrix_[0].length===0&&this.matrix_.length>1&&this.matrix_.shift(),this.size_--}_Pop_back(){const s=this.matrix_[this.matrix_.length-1];s.pop(),s.length===0&&this.matrix_.length>1&&this.matrix_.pop(),this.size_--}_Insert_by_range(s,p,y){const C=this.size_+Kmt(p,y);if(C===this.size_)return s;if(s.equals(this.end())===!0)this._Try_expand_capacity(C),this._Insert_to_end(p,y),s=this.nth(this.size_);else if(C>this.capacity_){const N=new qp;N._Reserve(Math.max(C,Math.floor(this.capacity_*qp.MAGNIFIER))),N._Insert_to_end(this.begin(),s),N._Insert_to_end(p,y),N._Insert_to_end(s,this.end()),this._Swap(N)}else this._Insert_to_middle(s,p,y);return this.size_=C,s}_Insert_to_middle(s,p,y){const C=this._Compute_col_size(),N=this._Fetch_index(s.index());let L=this.matrix_[N.first];const z=N.second,G=L.splice(z);for(;!p.equals(y);p=p.next()){if(L.length===C&&this.matrix_.length<qp.ROW_SIZE){L=new Array;const q=this.matrix_.splice(++N.first);this.matrix_.push(L),this.matrix_.push(...q)}L.push(p.value)}for(let q=0;q<G.length;++q){if(L.length===C&&this.matrix_.length<qp.ROW_SIZE){L=new Array;const nt=this.matrix_.splice(++N.first);this.matrix_.push(L),this.matrix_.push(...nt)}L.push(G[q])}}_Insert_to_end(s,p){for(;!s.equals(p);s=s.next())this._Try_add_row_at_back(),this.matrix_[this.matrix_.length-1].push(s.value)}_Try_expand_capacity(s){return s<=this.capacity_?!1:(s=Math.max(s,Math.floor(this.capacity_*qp.MAGNIFIER)),this._Reserve(s),!0)}_Try_add_row_at_front(){const s=this._Compute_col_size();return this.matrix_[0].length>=s&&this.matrix_.length<qp.ROW_SIZE?(this.matrix_=[[]].concat(...this.matrix_),!0):!1}_Try_add_row_at_back(){const s=this._Compute_col_size();return this.matrix_[this.matrix_.length-1].length>=s&&this.matrix_.length<qp.ROW_SIZE?(this.matrix_.push([]),!0):!1}_Erase_by_range(s,p){if(s.index()>=this.size())return s;let y;p.index()>=this.size()?y=this.size()-s.index():y=p.index()-s.index(),this.size_-=y;let C=null,N=null,L=0;for(;y!==0;){const z=this._Fetch_index(s.index()),G=this.matrix_[z.first],q=z.second,nt=Math.min(y,G.length-q);G.splice(q,nt),G.length!==0&&(L===0?C=G:N=G),G.length===0&&this.matrix_.length>1&&this.matrix_.splice(z.first,1),y-=nt,++L}return C!==null&&N!==null&&C.length+N.length<=this._Compute_col_size()&&(C.push(...N),this.matrix_.splice(this.matrix_.indexOf(N),1)),s}}(function(o){o.Iterator=GFt,o.ReverseIterator=i$,o.ROW_SIZE=8,o.MIN_CAPACITY=36,o.MAGNIFIER=1.5;class s{constructor(y){this.matrix_=y,this.row_=0,this.col_=0}next(){if(this.row_===this.matrix_.length)return{done:!0,value:void 0};{const y=this.matrix_[this.row_][this.col_];return++this.col_===this.matrix_[this.row_].length&&(++this.row_,this.col_=0),{done:!1,value:y}}}[Symbol.iterator](){return this}}o.ForOfAdaptor=s})(qp||(qp={}));class _6{constructor(s,p,y){this.prev_=s,this.next_=p,this.value_=y}static _Set_prev(s,p){s.prev_=p}static _Set_next(s,p){s.next_=p}prev(){return this.prev_}next(){return this.next_}get value(){return this._Try_value(),this.value_}_Try_value(){if(this.value_===void 0&&this.equals(this.source().end())===!0)throw yd.iterator_end_value(this.source())}equals(s){return this===s}}class YFt extends qmt{constructor(){super(),this.end_=this._Create_iterator(null,null),this.clear()}assign(s,p){this.clear(),this.insert(this.end(),s,p)}clear(){_6._Set_prev(this.end_,this.end_),_6._Set_next(this.end_,this.end_),this.begin_=this.end_,this.size_=0}resize(s){const p=s-this.size();p>0?this.insert(this.end(),p,void 0):p<0&&this.erase(Gmt(this.end(),-p),this.end())}begin(){return this.begin_}end(){return this.end_}size(){return this.size_}push_front(s){this.insert(this.begin_,s)}push_back(s){this.insert(this.end_,s)}pop_front(){if(this.empty()===!0)throw yd.empty(this.end_.source().constructor.name,"pop_front");this.erase(this.begin_)}pop_back(){if(this.empty()===!0)throw yd.empty(this.end_.source().constructor.name,"pop_back");this.erase(this.end_.prev())}push(...s){if(s.length===0)return this.size();const p=new J2(s,0),y=new J2(s,s.length);return this._Insert_by_range(this.end(),p,y),this.size()}insert(s,...p){if(s.source()!==this.end_.source())throw yd.not_my_iterator(this.end_.source(),"insert");if(s.erased_===!0)throw yd.erased_iterator(this.end_.source(),"insert");return p.length===1?this._Insert_by_repeating_val(s,1,p[0]):p.length===2&&typeof p[0]=="number"?this._Insert_by_repeating_val(s,p[0],p[1]):this._Insert_by_range(s,p[0],p[1])}_Insert_by_repeating_val(s,p,y){const C=new VF(0,y),N=new VF(p);return this._Insert_by_range(s,C,N)}_Insert_by_range(s,p,y){let C=s.prev(),N=null,L=0;for(let z=p;z.equals(y)===!1;z=z.next()){const G=this._Create_iterator(C,null,z.value);L===0&&(N=G),_6._Set_next(C,G),C=G,++L}return s.equals(this.begin())===!0&&(this.begin_=N),_6._Set_next(C,s),_6._Set_prev(s,C),this.size_+=L,N}erase(s,p=s.next()){return this._Erase_by_range(s,p)}_Erase_by_range(s,p){if(s.source()!==this.end_.source())throw yd.not_my_iterator(this.end_.source(),"insert");if(s.erased_===!0)throw yd.erased_iterator(this.end_.source(),"insert");if(s.equals(this.end_))return this.end_;const y=s.prev();_6._Set_next(y,p),_6._Set_prev(p,y);for(let C=s;!C.equals(p);C=C.next())C.erased_=!0,--this.size_;return s.equals(this.begin_)&&(this.begin_=p),p}swap(s){[this.begin_,s.begin_]=[s.begin_,this.begin_],[this.end_,s.end_]=[s.end_,this.end_],[this.size_,s.size_]=[s.size_,this.size_]}}class Z_ extends YFt{constructor(...s){if(super(),this.ptr_={value:this},Z_.Iterator._Set_source_ptr(this.end_,this.ptr_),s.length!==0)if(s.length===1&&s[0]instanceof Array){const p=s[0];this.push(...p)}else if(s.length===1&&s[0]instanceof Z_){const p=s[0];this.assign(p.begin(),p.end())}else s.length===2&&this.assign(s[0],s[1])}_Create_iterator(s,p,y){return Z_.Iterator.create(this.ptr_,s,p,y)}front(s){if(arguments.length===0)return this.begin_.value;this.begin_.value=s}back(s){const p=this.end().prev();if(arguments.length===0)return p.value;p.value=s}unique(s=t5){let p=this.begin().next();for(;!p.equals(this.end());)s(p.value,p.prev().value)===!0?p=this.erase(p):p=p.next()}remove(s){return this.remove_if(p=>t5(p,s))}remove_if(s){let p=this.begin();for(;!p.equals(this.end());)s(p.value)===!0?p=this.erase(p):p=p.next()}merge(s,p=a5){if(this===s)return;let y=this.begin();for(;s.empty()===!1;){const C=s.begin();for(;!y.equals(this.end())&&p(y.value,C.value)===!0;)y=y.next();this.splice(y,s,C)}}splice(s,p,y,C){y===void 0?(y=p.begin(),C=p.end()):C===void 0&&(C=y.next()),this.insert(s,y,C),p.erase(y,C)}sort(s=a5){this._Quick_sort(this.begin(),this.end().prev(),s)}_Quick_sort(s,p,y){if(!s.equals(p)&&!p.equals(this.end())&&!s.equals(p.next())){const C=this._Quick_sort_partition(s,p,y);this._Quick_sort(s,C.prev(),y),this._Quick_sort(C.next(),p,y)}}_Quick_sort_partition(s,p,y){const C=p.value;let N=s.prev(),L=s;for(;!L.equals(p);L=L.next())y(L.value,C)&&(N=N.equals(this.end())?s:N.next(),[N.value,L.value]=[L.value,N.value]);return N=N.equals(this.end())?s:N.next(),[N.value,L.value]=[L.value,N.value],N}reverse(){const s=this.end_.prev(),p=this.begin();for(let y=this.begin();!y.equals(this.end());){const C=y.prev(),N=y.next();Z_.Iterator._Set_prev(y,N),Z_.Iterator._Set_next(y,C),y=N}this.begin_=s,Z_.Iterator._Set_prev(this.end_,p),Z_.Iterator._Set_next(this.end_,s)}swap(s){super.swap(s),[this.ptr_,s.ptr_]=[s.ptr_,this.ptr_],[this.ptr_.value,s.ptr_.value]=[s.ptr_.value,this.ptr_.value]}}(function(o){class s extends _6{constructor(C,N,L,z){super(N,L,z),this.source_ptr_=C}static create(C,N,L,z){return new s(C,N,L,z)}reverse(){return new p(this)}static _Set_source_ptr(C,N){C.source_ptr_=N}source(){return this.source_ptr_.value}get value(){return this._Try_value(),this.value_}set value(C){this._Try_value(),this.value_=C}equals(C){return this===C}}o.Iterator=s;class p extends Wmt{_Create_neighbor(C){return new p(C)}get value(){return this.base_.value}set value(C){this.base_.value=C}}o.ReverseIterator=p})(Z_||(Z_={}));class l0 extends YFt{constructor(s){super(),this.associative_=s}_Create_iterator(s,p,y){return l0.Iterator.create(this,s,p,y)}static _Swap_associative(s,p){[s.associative_,p.associative_]=[p.associative_,s.associative_]}associative(){return this.associative_}}(function(o){class s extends _6{constructor(C,N,L,z){super(N,L,z),this.list_=C}static create(C,N,L,z){return new s(C,N,L,z)}reverse(){return new p(this)}source(){return this.list_.associative()}get first(){return this.value.first}get second(){return this.value.second}set second(C){this.value.second=C}}o.Iterator=s;class p extends Wmt{_Create_neighbor(C){return new p(C)}get first(){return this.base_.first}get second(){return this.base_.second}set second(C){this.base_.second=C}}o.ReverseIterator=p})(l0||(l0={}));class PMn{constructor(s,p){this.value=s,this.color=p,this.parent=null,this.left=null,this.right=null}get grand(){return this.parent.parent}get sibling(){return this===this.parent.left?this.parent.right:this.parent.left}get uncle(){return this.parent.sibling}}class PIe{constructor(s){this.root_=null,this.comp_=s,this.equal_=function(p,y){return!s(p,y)&&!s(y,p)}}clear(){this.root_=null}root(){return this.root_}get(s){const p=this.nearest(s);return p===null||!this.equal_(s,p.value)?null:p}nearest(s){if(this.root_===null)return null;let p=this.root_;for(;;){let y=null;if(this.comp_(s,p.value))y=p.left;else if(this.comp_(p.value,s))y=p.right;else return p;if(y!==null)p=y;else break}return p}_Fetch_maximum(s){for(;s.right!==null;)s=s.right;return s}insert(s){const p=this.nearest(s),y=new PMn(s,1);p===null?this.root_=y:(y.parent=p,this.comp_(y.value,p.value)?p.left=y:p.right=y),this._Insert_case1(y)}_Insert_case1(s){s.parent===null?s.color=0:this._Insert_case2(s)}_Insert_case2(s){this._Fetch_color(s.parent)!==0&&this._Insert_case3(s)}_Insert_case3(s){this._Fetch_color(s.uncle)===1?(s.parent.color=0,s.uncle.color=0,s.grand.color=1,this._Insert_case1(s.grand)):this._Insert_case4(s)}_Insert_case4(s){s===s.parent.right&&s.parent===s.grand.left?(this._Rotate_left(s.parent),s=s.left):s===s.parent.left&&s.parent===s.grand.right&&(this._Rotate_right(s.parent),s=s.right),this._Insert_case5(s)}_Insert_case5(s){s.parent.color=0,s.grand.color=1,s===s.parent.left&&s.parent===s.grand.left?this._Rotate_right(s.grand):this._Rotate_left(s.grand)}erase(s){let p=this.get(s);if(p===null)return;if(p.left!==null&&p.right!==null){const C=this._Fetch_maximum(p.left);p.value=C.value,p=C}const y=p.right===null?p.left:p.right;this._Fetch_color(p)===0&&(p.color=this._Fetch_color(y),this._Erase_case1(p)),this._Replace_node(p,y),this._Fetch_color(this.root_)===1&&(this.root_.color=0)}_Erase_case1(s){s.parent!==null&&this._Erase_case2(s)}_Erase_case2(s){this._Fetch_color(s.sibling)===1&&(s.parent.color=1,s.sibling.color=0,s===s.parent.left?this._Rotate_left(s.parent):this._Rotate_right(s.parent)),this._Erase_case3(s)}_Erase_case3(s){this._Fetch_color(s.parent)===0&&this._Fetch_color(s.sibling)===0&&this._Fetch_color(s.sibling.left)===0&&this._Fetch_color(s.sibling.right)===0?(s.sibling.color=1,this._Erase_case1(s.parent)):this._Erase_case4(s)}_Erase_case4(s){this._Fetch_color(s.parent)===1&&s.sibling!==null&&this._Fetch_color(s.sibling)===0&&this._Fetch_color(s.sibling.left)===0&&this._Fetch_color(s.sibling.right)===0?(s.sibling.color=1,s.parent.color=0):this._Erase_case5(s)}_Erase_case5(s){s===s.parent.left&&s.sibling!==null&&this._Fetch_color(s.sibling)===0&&this._Fetch_color(s.sibling.left)===1&&this._Fetch_color(s.sibling.right)===0?(s.sibling.color=1,s.sibling.left.color=0,this._Rotate_right(s.sibling)):s===s.parent.right&&s.sibling!==null&&this._Fetch_color(s.sibling)===0&&this._Fetch_color(s.sibling.left)===0&&this._Fetch_color(s.sibling.right)===1&&(s.sibling.color=1,s.sibling.right.color=0,this._Rotate_left(s.sibling)),this._Erase_case6(s)}_Erase_case6(s){s.sibling.color=this._Fetch_color(s.parent),s.parent.color=0,s===s.parent.left?(s.sibling.right.color=0,this._Rotate_left(s.parent)):(s.sibling.left.color=0,this._Rotate_right(s.parent))}_Rotate_left(s){const p=s.right;this._Replace_node(s,p),s.right=p.left,p.left!==null&&(p.left.parent=s),p.left=s,s.parent=p}_Rotate_right(s){const p=s.left;this._Replace_node(s,p),s.left=p.right,p.right!==null&&(p.right.parent=s),p.right=s,s.parent=p}_Replace_node(s,p){s.parent===null?this.root_=p:s===s.parent.left?s.parent.left=p:s.parent.right=p,p!==null&&(p.parent=s.parent)}_Fetch_color(s){return s===null?0:s.color}}class LIe extends PIe{constructor(s,p,y){super(y),this.source_=s,this.key_compare_=p,this.key_eq_=function(C,N){return!p(C,N)&&!p(N,C)},this.value_compare_=function(C,N){return p(C.first,N.first)}}static _Swap_source(s,p){[s.source_,p.source_]=[p.source_,s.source_]}get_by_key(s){const p=this.nearest_by_key(s);return p===null||!this.key_eq_(s,p.value.first)?null:p}lower_bound(s){const p=this.nearest_by_key(s);return p===null?this.source().end():this.key_comp()(p.value.first,s)?p.value.next():p.value}equal_range(s){return new rp(this.lower_bound(s),this.upper_bound(s))}source(){return this.source_}key_comp(){return this.key_compare_}key_eq(){return this.key_eq_}value_comp(){return this.value_compare_}}class CCe extends LIe{constructor(s,p){super(s,p,(y,C)=>p(y.first,C.first))}nearest_by_key(s){if(this.root_===null)return null;let p=this.root_;for(;;){const y=p.value;let C=null;if(this.key_comp()(s,y.first))C=p.left;else if(this.key_comp()(y.first,s))C=p.right;else return p;if(C===null)break;p=C}return p}upper_bound(s){const p=this.nearest_by_key(s);if(p===null)return this.source().end();const y=p.value;return this.key_comp()(s,y.first)?y:y.next()}}class XF extends OIe{constructor(...s){super(p=>new l0(p)),ey.construct(this,XF,p=>{this.tree_=new CCe(this,p)},...s)}clear(){super.clear(),this.tree_.clear()}swap(s){[this.data_,s.data_]=[s.data_,this.data_],l0._Swap_associative(this.data_,s.data_),CCe._Swap_source(this.tree_,s.tree_),[this.tree_,s.tree_]=[s.tree_,this.tree_]}key_comp(){return this.tree_.key_comp()}lower_bound(s){return this.tree_.lower_bound(s)}upper_bound(s){return this.tree_.upper_bound(s)}_Handle_insert(s,p){for(;!s.equals(p);s=s.next())this.tree_.insert(s)}_Handle_erase(s,p){for(;!s.equals(p);s=s.next())this.tree_.erase(s)}}(function(o){o.Iterator=l0.Iterator,o.ReverseIterator=l0.ReverseIterator})(XF||(XF={}));class qQ extends UFt{constructor(...s){if(super(),s.length===1&&s[0]instanceof qQ){const p=s[0];this.data_=new XF(p.data_.begin(),p.data_.end()),this.size_=p.size_}else s.length===1&&s[0]instanceof Array?(this.clear(),this.push(...s[0])):s.length===2?this.assign(s[0],s[1]):this.clear()}assign(s,p){this.clear(),this.insert(this.end(),s,p)}clear(){this.data_=new XF,this.size_=0}resize(s){const p=s-this.size();p>0?this.insert(this.end(),p,!1):p<0&&this.erase(this.end().advance(-p),this.end())}flip(){for(const s of this.data_)s.second=!s.second}swap(s){[this.data_,s.data_]=[s.data_,this.data_],[this.size_,s.size_]=[s.size_,this.size_]}source(){return this}size(){return this.size_}_At(s){return this._Find_node(s).second}_Set(s,p){p=!!p;let y=this._Find_node(s);if(y.second===p||(y.first===s?y.second=p:y=this.data_.emplace(s,p).first,s===this.size()-1))return;const C=y.prev(),N=y.next();SMn(C,this.data_.end())&&C.second===y.second&&this.data_.erase(y),N.equals(this.data_.end())===!0||N.first!==s+1||N.second!==p?this.data_.emplace(s+1,!p):this.data_.erase(N)}nth(s){return new qQ.Iterator(this,s)}_Find_node(s){return this.data_.upper_bound(s).prev()}push(...s){if(s.length===0)return this.size();const p=new J2(s,0),y=new J2(s,s.length);return this._Insert_by_range(this.end(),p,y),this.size()}push_back(s){const p=this.data_.rbegin(),y=this.size_++;s=!!s,(this.data_.empty()||p.second!==s)&&this.data_.emplace(y,s)}_Pop_back(){const s=this.data_.rbegin(),p=--this.size_;s.first===p&&this.data_.erase(s.base())}_Insert_by_repeating_val(s,p,y){const C=[];return C.push(new rp(p,y)),s.equals(this.end())===!0?this._Insert_to_end(C):this._Insert_to_middle(s,C)}_Insert_by_range(s,p,y){const C=[];for(let N=p;!N.equals(y);N=N.next())C.length===0||C[C.length-1].second!==N.value?C.push(new rp(1,N.value)):++C[C.length-1].first;return s.equals(this.end())===!0?this._Insert_to_end(C):this._Insert_to_middle(s,C)}_Insert_to_middle(s,p){const y=this._Find_node(s.index());for(let C=y;!C.equals(this.data_.end());C=C.next()){const N=C.next(),L=C.first<s.index()?s.index():C.first,G=(N.equals(this.data_.end())?this.size():N.first)-L,q=!!C.second;p.push(new rp(G,q))}return this.size_=s.index(),this.data_.erase(y.first===s.index()?y:y.next(),this.data_.end()),this._Insert_to_end(p)}_Insert_to_end(s){const p=this.size(),y=this.data_.empty()?null:this.data_.rbegin().second;for(let C=0;C<s.length;++C){const N=s[C],L=this.size(),z=!!N.second;this.size_+=N.first,!(C===0&&z===y)&&this.data_.emplace(L,z)}return this.begin().advance(p)}_Erase_by_range(s,p){const y=[];if(p.equals(this.end())===!1){const C=Math.min(this.size(),p.index());for(let N=this._Find_node(C);!N.equals(this.data_.end());N=N.next()){const L=N.next(),z=Math.max(N.first,C),q=(L.equals(this.data_.end())?this.size():L.first)-z,nt=N.second;y.push(new rp(q,nt))}}return this.size_=s.index(),this.data_.erase(this.data_.lower_bound(this.size_),this.data_.end()),this._Insert_to_end(y)}}(function(o){o.Iterator=GFt,o.ReverseIterator=i$})(qQ||(qQ={}));class Sw{constructor(...s){if(this.ptr_={value:this},this.end_=Sw.Iterator.create(this.ptr_,null),this.before_begin_=Sw.Iterator.create(this.ptr_,this.end_),this.size_=0,s.length===1&&s[0]instanceof Array){const p=s[0];let y=this.before_begin();for(const C of p)y=this.insert_after(y,C)}else s.length===1&&s[0]instanceof Sw?this.assign(s[0].begin(),s[0].end()):s.length===2&&this.assign(s[0],s[1])}assign(s,p){this.clear(),this.insert_after(this.before_begin_,s,p)}clear(){Sw.Iterator._Set_next(this.before_begin_,this.end_),this.size_=0}size(){return this.size_}empty(){return this.size_===0}front(s){const p=this.begin();if(arguments.length===0)return p.value;p.value=s}before_begin(){return this.before_begin_}begin(){return this.before_begin_.next()}end(){return this.end_}[Symbol.iterator](){return new mIe(this.begin(),this.end())}push_front(s){this.insert_after(this.before_begin_,s)}insert_after(s,...p){let y;return p.length===1?y=this._Insert_by_repeating_val(s,1,p[0]):typeof p[0]=="number"?y=this._Insert_by_repeating_val(s,p[0],p[1]):y=this._Insert_by_range(s,p[0],p[1]),y}_Insert_by_repeating_val(s,p,y){const C=new VF(0,y),N=new VF(p);return this._Insert_by_range(s,C,N)}_Insert_by_range(s,p,y){const C=[];let N=0;for(;!p.equals(y);p=p.next()){const L=Sw.Iterator.create(this.ptr_,null,p.value);C.push(L),++N}if(N===0)return s;for(let L=0;L<N-1;++L)Sw.Iterator._Set_next(C[L],C[L+1]);return Sw.Iterator._Set_next(C[C.length-1],s.next()),Sw.Iterator._Set_next(s,C[0]),this.size_+=N,C[C.length-1]}pop_front(){this.erase_after(this.before_begin())}erase_after(s,p=Gmt(s,2)){return this.size_-=Math.max(0,Kmt(s,p)-1),Sw.Iterator._Set_next(s,p),p}unique(s=t5){for(let p=this.begin().next();!p.equals(this.end());p=p.next()){const y=p.next();if(y.equals(this.end()))break;s(p.value,y.value)&&this.erase_after(p)}}remove(s){return this.remove_if(p=>t5(p,s))}remove_if(s){let p=0;for(let y=this.before_begin();!y.next().equals(this.end());y=y.next())s(y.next().value)===!0&&(Sw.Iterator._Set_next(y,y.next().next()),++p);this.size_-=p}merge(s,p=a5){if(this===s)return;let y=this.before_begin();for(;s.empty()===!1;){const C=s.begin().value;for(;!y.next().equals(this.end())&&p(y.next().value,C);)y=y.next();this.splice_after(y,s,s.before_begin())}}splice_after(s,p,y=p.before_begin(),C=y.next().next()){C===null&&(C=p.end()),this.insert_after(s,y.next(),C),p.erase_after(y,C)}sort(s=a5){const p=new uC(this.begin(),this.end());CBt(p.begin(),p.end(),s),this.assign(p.begin(),p.end())}reverse(){const s=new uC(this.begin(),this.end());this.assign(s.rbegin(),s.rend())}swap(s){[this.size_,s.size_]=[s.size_,this.size_],[this.before_begin_,s.before_begin_]=[s.before_begin_,this.before_begin_],[this.end_,s.end_]=[s.end_,this.end_],[this.ptr_,s.ptr_]=[s.ptr_,this.ptr_],[this.ptr_.value,s.ptr_.value]=[s.ptr_.value,this.ptr_.value]}toJSON(){const s=[];for(const p of this)s.push(p);return s}}(function(o){class s{constructor(y,C,N){this.source_ptr_=y,this.next_=C,this.value_=N}static create(y,C,N){return new s(y,C,N)}source(){return this.source_ptr_.value}get value(){return this._Try_value(),this.value_}set value(y){this._Try_value(),this.value_=y}_Try_value(){if(this.value_===void 0){const y=this.source();if(this.equals(y.end())===!0)throw yd.iterator_end_value(y);if(this.equals(y.before_begin())===!0)throw yd.iterator_end_value(y,"before_begin")}}next(){return this.next_}equals(y){return this===y}static _Set_next(y,C){y.next_=C}}o.Iterator=s})(Sw||(Sw={}));class h0 extends YFt{constructor(s){super(),this.associative_=s}_Create_iterator(s,p,y){return h0.Iterator.create(this,s,p,y)}static _Swap_associative(s,p){[s.associative_,p.associative_]=[p.associative_,s.associative_]}associative(){return this.associative_}}(function(o){class s extends _6{constructor(C,N,L,z){super(N,L,z),this.source_=C}static create(C,N,L,z){return new s(C,N,L,z)}reverse(){return new p(this)}source(){return this.source_.associative()}}o.Iterator=s;class p extends Wmt{_Create_neighbor(C){return new p(C)}}o.ReverseIterator=p})(h0||(h0={}));class MIe extends PIe{constructor(s,p,y){super(y),this.source_=s,this.key_comp_=p,this.key_eq_=(C,N)=>!p(C,N)&&!p(N,C)}static _Swap_source(s,p){[s.source_,p.source_]=[p.source_,s.source_]}get_by_key(s){const p=this.nearest_by_key(s);return p===null||!this.key_eq_(s,p.value.value)?null:p}lower_bound(s){const p=this.nearest_by_key(s);return p===null?this.source_.end():this.key_comp_(p.value.value,s)?p.value.next():p.value}equal_range(s){return new rp(this.lower_bound(s),this.upper_bound(s))}source(){return this.source_}key_comp(){return this.key_comp_}key_eq(){return this.key_eq_}value_comp(){return this.key_comp_}}class ACe extends MIe{constructor(s,p){super(s,p,(y,C)=>p(y.value,C.value))}nearest_by_key(s){if(this.root_===null)return null;let p=this.root_;for(;;){const y=p.value;let C=null;if(this.key_comp()(s,y.value))C=p.left;else if(this.key_comp()(y.value,s))C=p.right;else return p;if(C===null)break;p=C}return p}upper_bound(s){const p=this.nearest_by_key(s);if(p===null)return this.source().end();const y=p.value;return this.key_comp()(s,y.value)?y:y.next()}}class cmt extends AIe{constructor(...s){super(p=>new h0(p)),ey.construct(this,cmt,p=>{this.tree_=new ACe(this,p)},...s)}clear(){super.clear(),this.tree_.clear()}swap(s){[this.data_,s.data_]=[s.data_,this.data_],h0._Swap_associative(this.data_,s.data_),ACe._Swap_source(this.tree_,s.tree_),[this.tree_,s.tree_]=[s.tree_,this.tree_]}key_comp(){return this.tree_.key_comp()}lower_bound(s){return this.tree_.lower_bound(s)}upper_bound(s){return this.tree_.upper_bound(s)}_Handle_insert(s,p){for(;!s.equals(p);s=s.next())this.tree_.insert(s)}_Handle_erase(s,p){for(;!s.equals(p);s=s.next())this.tree_.erase(s)}}(function(o){o.Iterator=h0.Iterator,o.ReverseIterator=h0.ReverseIterator})(cmt||(cmt={}));var QF;(function(o){function s(p,y,C,...N){let L=null,z=HFt,G=t5;if(N.length===1&&N[0]instanceof y){const q=N[0];z=q.hash_function(),G=q.key_eq(),L=()=>{const nt=q.begin(),tt=q.end();p.assign(nt,tt)}}else{const q=rmt.construct(p,...N);L=q.ramda,q.tail.length>=1&&(z=q.tail[0]),q.tail.length>=2&&(G=q.tail[1])}C(z,G),L!==null&&L()}o.construct=s})(QF||(QF={}));class RIe{constructor(s,p){this.fetcher_=s,this.hasher_=p,this.max_load_factor_=LMn,this.data_=[],this.size_=0,this.initialize()}clear(){this.data_=[],this.size_=0,this.initialize()}rehash(s){s=Math.max(s,ICe);const p=[];for(let y=0;y<s;++y)p.push([]);for(const y of this.data_)for(const C of y){const N=this.hasher_(this.fetcher_(C))%p.length;p[N].push(C)}this.data_=p}reserve(s){s>this.capacity()&&(s=Math.floor(s/this.max_load_factor_),this.rehash(s))}initialize(){for(let s=0;s<ICe;++s)this.data_.push([])}length(){return this.data_.length}capacity(){return this.data_.length*this.max_load_factor_}at(s){return this.data_[s]}load_factor(){return this.size_/this.length()}max_load_factor(s=null){if(s===null)return this.max_load_factor_;this.max_load_factor_=s}hash_function(){return this.hasher_}index(s){return this.hasher_(this.fetcher_(s))%this.length()}insert(s){const p=this.capacity();++this.size_>p&&this.reserve(p*2);const y=this.index(s);this.data_[y].push(s)}erase(s){const p=this.index(s),y=this.data_[p];for(let C=0;C<y.length;++C)if(y[C]===s){y.splice(C,1),--this.size_;break}}}const ICe=10,LMn=1;class umt extends RIe{constructor(s,p,y){super(MMn,p),this.source_=s,this.key_eq_=y}static _Swap_source(s,p){[s.source_,p.source_]=[p.source_,s.source_]}key_eq(){return this.key_eq_}find(s){const p=this.hash_function()(s)%this.length(),y=this.at(p);for(const C of y)if(this.key_eq_(C.value,s))return C;return this.source_.end()}}function MMn(o){return o.value}class lmt extends _Ie{constructor(...s){super(p=>new h0(p)),QF.construct(this,lmt,(p,y)=>{this.buckets_=new umt(this,p,y)},...s)}clear(){this.buckets_.clear(),super.clear()}swap(s){[this.data_,s.data_]=[s.data_,this.data_],h0._Swap_associative(this.data_,s.data_),umt._Swap_source(this.buckets_,s.buckets_),[this.buckets_,s.buckets_]=[s.buckets_,this.buckets_]}find(s){return this.buckets_.find(s)}begin(s=null){return s===null?super.begin():this.buckets_.at(s)[0]}end(s=null){if(s===null)return super.end();{const p=this.buckets_.at(s);return p[p.length-1].next()}}rbegin(s=null){return this.end(s).reverse()}rend(s=null){return this.begin(s).reverse()}bucket_count(){return this.buckets_.length()}bucket_size(s){return this.buckets_.at(s).length}load_factor(){return this.buckets_.load_factor()}hash_function(){return this.buckets_.hash_function()}key_eq(){return this.buckets_.key_eq()}bucket(s){return this.hash_function()(s)%this.buckets_.length()}max_load_factor(s=null){return this.buckets_.max_load_factor(s)}reserve(s){this.buckets_.reserve(s)}rehash(s){this.buckets_.rehash(s)}_Insert_by_key(s){let p=this.find(s);return p.equals(this.end())===!1?new rp(p,!1):(this.data_.push(s),p=p.prev(),this._Handle_insert(p,p.next()),new rp(p,!0))}_Insert_by_hint(s,p){let y=this.find(p);return y.equals(this.end())===!0&&(y=this.data_.insert(s,p),this._Handle_insert(y,y.next())),y}_Handle_insert(s,p){for(;!s.equals(p);s=s.next())this.buckets_.insert(s)}_Handle_erase(s,p){for(;!s.equals(p);s=s.next())this.buckets_.erase(s)}}(function(o){o.Iterator=h0.Iterator,o.ReverseIterator=h0.ReverseIterator})(lmt||(lmt={}));class OCe extends MIe{constructor(s,p){super(s,p,function(y,C){const N=p(y.value,C.value);return!N&&!p(C.value,y.value)?bk(y)<bk(C):N})}insert(s){bk(s),super.insert(s)}_Nearest_by_key(s,p){if(this.root_===null)return null;let y=this.root_,C=null;for(;;){const N=y.value;let L=null;if(this.key_comp()(s,N.value)?L=y.left:this.key_comp()(N.value,s)?L=y.right:(C=y,L=p(y)),L===null)break;y=L}return C!==null?C:y}nearest_by_key(s){return this._Nearest_by_key(s,function(p){return p.left})}upper_bound(s){const p=this._Nearest_by_key(s,function(C){return C.right});if(p===null)return this.source().end();const y=p.value;return this.key_comp()(s,y.value)?y:y.next()}}class hmt extends IIe{constructor(...s){super(p=>new h0(p)),ey.construct(this,hmt,p=>{this.tree_=new OCe(this,p)},...s)}clear(){super.clear(),this.tree_.clear()}swap(s){[this.data_,s.data_]=[s.data_,this.data_],h0._Swap_associative(this.data_,s.data_),OCe._Swap_source(this.tree_,s.tree_),[this.tree_,s.tree_]=[s.tree_,this.tree_]}key_comp(){return this.tree_.key_comp()}lower_bound(s){return this.tree_.lower_bound(s)}upper_bound(s){return this.tree_.upper_bound(s)}_Handle_insert(s,p){for(;!s.equals(p);s=s.next())this.tree_.insert(s)}_Handle_erase(s,p){for(;!s.equals(p);s=s.next())this.tree_.erase(s)}}(function(o){o.Iterator=h0.Iterator,o.ReverseIterator=h0.ReverseIterator})(hmt||(hmt={}));class fmt extends xIe{constructor(...s){super(p=>new h0(p)),QF.construct(this,fmt,(p,y)=>{this.buckets_=new umt(this,p,y)},...s)}clear(){this.buckets_.clear(),super.clear()}swap(s){[this.data_,s.data_]=[s.data_,this.data_],h0._Swap_associative(this.data_,s.data_),umt._Swap_source(this.buckets_,s.buckets_),[this.buckets_,s.buckets_]=[s.buckets_,this.buckets_]}find(s){return this.buckets_.find(s)}count(s){const p=this.bucket(s),y=this.buckets_.at(p);let C=0;for(let N of y)this.buckets_.key_eq()(N.value,s)&&++C;return C}begin(s=null){return s===null?super.begin():this.buckets_.at(s)[0]}end(s=null){if(s===null)return super.end();{const p=this.buckets_.at(s);return p[p.length-1].next()}}rbegin(s=null){return this.end(s).reverse()}rend(s=null){return this.begin(s).reverse()}bucket_count(){return this.buckets_.length()}bucket_size(s){return this.buckets_.at(s).length}load_factor(){return this.buckets_.load_factor()}hash_function(){return this.buckets_.hash_function()}key_eq(){return this.buckets_.key_eq()}bucket(s){return this.hash_function()(s)%this.buckets_.length()}max_load_factor(s=null){return this.buckets_.max_load_factor(s)}reserve(s){this.buckets_.rehash(Math.ceil(s*this.max_load_factor()))}rehash(s){s<=this.bucket_count()||this.buckets_.rehash(s)}_Key_eq(s,p){return this.key_eq()(s,p)}_Insert_by_key(s){const p=this.data_.insert(this.data_.end(),s);return this._Handle_insert(p,p.next()),p}_Insert_by_hint(s,p){const y=this.data_.insert(s,p);return this._Handle_insert(y,y.next()),y}_Insert_by_range(s,p){const y=this.data_.insert(this.data_.end(),s,p);this.size()>this.buckets_.capacity()&&this.reserve(Math.max(this.size(),this.buckets_.capacity()*2)),this._Handle_insert(y,this.end())}_Handle_insert(s,p){for(;!s.equals(p);s=s.next())this.buckets_.insert(s)}_Handle_erase(s,p){for(;!s.equals(p);s=s.next())this.buckets_.erase(s)}}(function(o){o.Iterator=h0.Iterator,o.ReverseIterator=h0.ReverseIterator})(fmt||(fmt={}));class dmt extends RIe{constructor(s,p,y){super(RMn,p),this.source_=s,this.key_eq_=y}static _Swap_source(s,p){[s.source_,p.source_]=[p.source_,s.source_]}key_eq(){return this.key_eq_}find(s){const p=this.hash_function()(s)%this.length(),y=this.at(p);for(const C of y)if(this.key_eq_(C.first,s))return C;return this.source_.end()}}function RMn(o){return o.first}class pmt extends TIe{constructor(...s){super(p=>new l0(p)),QF.construct(this,pmt,(p,y)=>{this.buckets_=new dmt(this,p,y)},...s)}clear(){this.buckets_.clear(),super.clear()}swap(s){[this.data_,s.data_]=[s.data_,this.data_],l0._Swap_associative(this.data_,s.data_),dmt._Swap_source(this.buckets_,s.buckets_),[this.buckets_,s.buckets_]=[s.buckets_,this.buckets_]}find(s){return this.buckets_.find(s)}begin(s=null){return s===null?super.begin():this.buckets_.at(s)[0]}end(s=null){if(s===null)return super.end();{const p=this.buckets_.at(s);return p[p.length-1].next()}}rbegin(s=null){return this.end(s).reverse()}rend(s=null){return this.begin(s).reverse()}bucket_count(){return this.buckets_.length()}bucket_size(s){return this.buckets_.at(s).length}load_factor(){return this.buckets_.load_factor()}hash_function(){return this.buckets_.hash_function()}key_eq(){return this.buckets_.key_eq()}bucket(s){return this.hash_function()(s)%this.buckets_.length()}max_load_factor(s=null){return this.buckets_.max_load_factor(s)}reserve(s){this.buckets_.reserve(s)}rehash(s){this.buckets_.rehash(s)}emplace(s,p){let y=this.find(s);return y.equals(this.end())===!1?new rp(y,!1):(this.data_.push(new mk(s,p)),y=y.prev(),this._Handle_insert(y,y.next()),new rp(y,!0))}emplace_hint(s,p,y){let C=this.find(p);return C.equals(this.end())===!0&&(C=this.data_.insert(s,new mk(p,y)),this._Handle_insert(C,C.next())),C}_Handle_insert(s,p){for(;!s.equals(p);s=s.next())this.buckets_.insert(s)}_Handle_erase(s,p){for(;!s.equals(p);s=s.next())this.buckets_.erase(s)}}(function(o){o.Iterator=l0.Iterator,o.ReverseIterator=l0.ReverseIterator})(pmt||(pmt={}));class NCe extends LIe{constructor(s,p){super(s,p,function(y,C){const N=p(y.first,C.first);return!N&&!p(C.first,y.first)?bk(y)<bk(C):N})}insert(s){bk(s),super.insert(s)}_Nearest_by_key(s,p){if(this.root_===null)return null;let y=this.root_,C=null;for(;;){const N=y.value;let L=null;if(this.key_comp()(s,N.first)?L=y.left:this.key_comp()(N.first,s)?L=y.right:(C=y,L=p(y)),L===null)break;y=L}return C!==null?C:y}nearest_by_key(s){return this._Nearest_by_key(s,function(p){return p.left})}upper_bound(s){const p=this._Nearest_by_key(s,function(C){return C.right});if(p===null)return this.source().end();const y=p.value;return this.key_comp()(s,y.first)?y:y.next()}}class gmt extends NIe{constructor(...s){super(p=>new l0(p)),ey.construct(this,gmt,p=>{this.tree_=new NCe(this,p)},...s)}clear(){super.clear(),this.tree_.clear()}swap(s){[this.data_,s.data_]=[s.data_,this.data_],l0._Swap_associative(this.data_,s.data_),NCe._Swap_source(this.tree_,s.tree_),[this.tree_,s.tree_]=[s.tree_,this.tree_]}key_comp(){return this.tree_.key_comp()}lower_bound(s){return this.tree_.lower_bound(s)}upper_bound(s){return this.tree_.upper_bound(s)}_Handle_insert(s,p){for(;!s.equals(p);s=s.next())this.tree_.insert(s)}_Handle_erase(s,p){for(;!s.equals(p);s=s.next())this.tree_.erase(s)}}(function(o){o.Iterator=l0.Iterator,o.ReverseIterator=l0.ReverseIterator})(gmt||(gmt={}));class bmt extends kIe{constructor(...s){super(p=>new l0(p)),QF.construct(this,bmt,(p,y)=>{this.buckets_=new dmt(this,p,y)},...s)}clear(){this.buckets_.clear(),super.clear()}swap(s){[this.data_,s.data_]=[s.data_,this.data_],l0._Swap_associative(this.data_,s.data_),dmt._Swap_source(this.buckets_,s.buckets_),[this.buckets_,s.buckets_]=[s.buckets_,this.buckets_]}find(s){return this.buckets_.find(s)}count(s){const p=this.bucket(s),y=this.buckets_.at(p);let C=0;for(let N of y)this.buckets_.key_eq()(N.first,s)&&++C;return C}begin(s=null){return s===null?super.begin():this.buckets_.at(s)[0]}end(s=null){if(s===null)return super.end();{const p=this.buckets_.at(s);return p[p.length-1].next()}}rbegin(s=null){return this.end(s).reverse()}rend(s=null){return this.begin(s).reverse()}bucket_count(){return this.buckets_.length()}bucket_size(s){return this.buckets_.at(s).length}load_factor(){return this.buckets_.load_factor()}hash_function(){return this.buckets_.hash_function()}key_eq(){return this.buckets_.key_eq()}bucket(s){return this.hash_function()(s)%this.buckets_.length()}max_load_factor(s=null){return this.buckets_.max_load_factor(s)}reserve(s){this.buckets_.reserve(s)}rehash(s){s<=this.bucket_count()||this.buckets_.rehash(s)}_Key_eq(s,p){return this.key_eq()(s,p)}emplace(s,p){const y=this.data_.insert(this.data_.end(),new mk(s,p));return this._Handle_insert(y,y.next()),y}emplace_hint(s,p,y){const C=this.data_.insert(s,new mk(p,y));return this._Handle_insert(C,C.next()),C}_Insert_by_range(s,p){const y=[];for(let N=s;!N.equals(p);N=N.next())y.push(new mk(N.value.first,N.value.second));const C=this.data_.insert(this.data_.end(),new J2(y,0),new J2(y,y.length));this.size()>this.buckets_.capacity()&&this.reserve(Math.max(this.size(),this.buckets_.capacity()*2)),this._Handle_insert(C,this.end())}_Handle_insert(s,p){for(;!s.equals(p);s=s.next())this.buckets_.insert(s)}_Handle_erase(s,p){for(;!s.equals(p);s=s.next())this.buckets_.erase(s)}}(function(o){o.Iterator=l0.Iterator,o.ReverseIterator=l0.ReverseIterator})(bmt||(bmt={}));var PCe;(function(o){function s(N){if(C.length<=N)for(let L=C.length;L<=N;++L)C.push(C[L-1]*L);return C[N]}o.factorial=s;function p(N,L,z,G=100*1e3){if(L>z)[L,z]=[z,L];else if(L===z)return 0;const q=(z-L)/G;let nt=0;for(;L<z;L+=q)nt+=N(L)*q;return nt}o.integral=p;function y(N,L,z){let G=0;for(;L<=z;++L)G+=N(L);return G}o.sigma=y;const C=[1,1]})(PCe||(PCe={}));function DMn(o){return new Promise(s=>{setTimeout(s,o)})}var S6;(function(o){async function s(C,N,L){await C(),await y(N,L)}o.lock=s;async function p(C,N,L){return await C()===!1?!1:(await y(N,L),!0)}o.try_lock=p;async function y(C,N){try{await N()}catch(L){throw await C(),L}await C()}})(S6||(S6={}));class LCe{}(function(o){function s(N,L){return S6.lock(()=>N.lock(),()=>N.unlock(),L)}o.lock=s;function p(N,L){return S6.try_lock(()=>N.try_lock(),()=>N.unlock(),L)}o.try_lock=p;function y(N,L,z){return S6.try_lock(()=>N.try_lock_for(L),()=>N.unlock(),z)}o.try_lock_for=y;function C(N,L,z){return S6.try_lock(()=>N.try_lock_until(L),()=>N.unlock(),z)}o.try_lock_until=C})(LCe||(LCe={}));class MCe{}(function(o){function s(N,L){return S6.lock(()=>N.lock_shared(),()=>N.unlock_shared(),L)}o.lock=s;function p(N,L){return S6.try_lock(()=>N.try_lock_shared(),()=>N.unlock_shared(),L)}o.try_lock=p;function y(N,L,z){return S6.try_lock(()=>N.try_lock_shared_for(L),()=>N.unlock_shared(),z)}o.try_lock_for=y;function C(N,L,z){return S6.try_lock(()=>N.try_lock_shared_until(L),()=>N.unlock_shared(),z)}o.try_lock_until=C})(MCe||(MCe={}));class ABt{constructor(s){this.queue_=new Z_,this.acquiring_=0,this.max_=s}max(){return this.max_}acquire(){return new Promise(s=>{this.acquiring_<this.max_?(++this.acquiring_,s()):this.queue_.push_back({handler:s,lockType:0})})}async try_acquire(){return this.acquiring_<this.max_?(++this.acquiring_,!0):!1}async try_acquire_for(s){return new Promise(p=>{if(this.acquiring_<this.max_)++this.acquiring_,p(!0);else{const y=this.queue_.insert(this.queue_.end(),{handler:p,lockType:1});DMn(s).then(()=>{y.value.handler!==null&&this._Cancel(y)})}})}try_acquire_until(s){const p=new Date,y=s.getTime()-p.getTime();return this.try_acquire_for(y)}async release(s=1){if(s<1)throw new UQ(`Error on std.Semaphore.release(): parametric n is less than 1 -> (n = ${s}).`);if(s>this.max_)throw new oC(`Error on std.Semaphore.release(): parametric n is greater than max -> (n = ${s}, max = ${this.max_}).`);if(s>this.acquiring_)throw new oC(`Error on std.Semaphore.release(): parametric n is greater than acquiring -> (n = ${s}, acquiring = ${this.acquiring_}).`);const p=[];for(;this.queue_.empty()===!1&&p.length<s;){const y=this.queue_.front();y.handler!==null&&p.push({...y}),this.queue_.pop_front(),y.handler=null}this.acquiring_-=s-p.length;for(const y of p)y.lockType===0?y.handler():y.handler(!0)}_Cancel(s){const p=s.value.handler;s.value.handler=null,this.queue_.erase(s),p(!1)}}(function(o){function s(y){return new p(y)}o.get_lockable=s;class p{constructor(C){this.semahpore_=C}lock(){return this.semahpore_.acquire()}unlock(){return this.semahpore_.release()}try_lock(){return this.semahpore_.try_acquire()}try_lock_for(C){return this.semahpore_.try_acquire_for(C)}try_lock_until(C){return this.semahpore_.try_acquire_until(C)}}o.Lockable=p})(ABt||(ABt={}));const Ng=[];for(let o=0;o<256;++o)Ng.push((o+256).toString(16).slice(1));function BMn(o,s=0){return(Ng[o[s+0]]+Ng[o[s+1]]+Ng[o[s+2]]+Ng[o[s+3]]+"-"+Ng[o[s+4]]+Ng[o[s+5]]+"-"+Ng[o[s+6]]+Ng[o[s+7]]+"-"+Ng[o[s+8]]+Ng[o[s+9]]+"-"+Ng[o[s+10]]+Ng[o[s+11]]+Ng[o[s+12]]+Ng[o[s+13]]+Ng[o[s+14]]+Ng[o[s+15]]).toLowerCase()}let zDt;const FMn=new Uint8Array(16);function $Mn(){if(!zDt){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");zDt=crypto.getRandomValues.bind(crypto)}return zDt(FMn)}const jMn=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),RCe={randomUUID:jMn};function wk(o,s,p){var C;if(RCe.randomUUID&&!o)return RCe.randomUUID();o=o||{};const y=o.random??((C=o.rng)==null?void 0:C.call(o))??$Mn();if(y.length<16)throw new Error("Random bytes length must be >= 16");return y[6]=y[6]&15|64,y[8]=y[8]&63|128,BMn(y)}function HMn(o){var C,N,L,z,G;const s=o.usage[o.kind];s.total+=o.completionUsage.total_tokens,s.input.total+=o.completionUsage.prompt_tokens,s.input.total+=((C=o.completionUsage.prompt_tokens_details)==null?void 0:C.audio_tokens)??0,s.input.cached+=((N=o.completionUsage.prompt_tokens_details)==null?void 0:N.cached_tokens)??0,s.output.total+=o.completionUsage.completion_tokens,s.output.accepted_prediction+=((L=o.completionUsage.completion_tokens_details)==null?void 0:L.accepted_prediction_tokens)??0,s.output.reasoning+=((z=o.completionUsage.completion_tokens_details)==null?void 0:z.reasoning_tokens)??0,s.output.rejected_prediction+=((G=o.completionUsage.completion_tokens_details)==null?void 0:G.rejected_prediction_tokens)??0;const p=q=>Object.entries(o.usage).filter(([nt])=>nt!=="aggregate").map(([,nt])=>q(nt)).reduce((nt,tt)=>nt+tt,0),y=o.usage.aggregate;y.total=p(q=>q.total),y.input.total=p(q=>q.input.total),y.input.cached=p(q=>q.input.cached),y.output.total=p(q=>q.output.total),y.output.reasoning=p(q=>q.output.reasoning),y.output.accepted_prediction=p(q=>q.output.accepted_prediction),y.output.rejected_prediction=p(q=>q.output.rejected_prediction)}const DIe={aggregate:HMn};class pP{constructor(s){if(s===void 0){const p=pP.zero();this.aggregate=p.aggregate,this.initialize=p.initialize,this.select=p.select,this.cancel=p.cancel,this.call=p.call,this.describe=p.describe}else this.aggregate=s.aggregate,this.initialize=s.initialize,this.select=s.select,this.cancel=s.cancel,this.call=s.call,this.describe=s.describe}increment(s){const p=(y,C)=>{y.total+=C.total,y.input.total+=C.input.total,y.input.cached+=C.input.cached,y.output.total+=C.output.total,y.output.reasoning+=C.output.reasoning,y.output.accepted_prediction+=C.output.accepted_prediction,y.output.rejected_prediction+=C.output.rejected_prediction};p(this.aggregate,s.aggregate),p(this.initialize,s.initialize),p(this.select,s.select),p(this.cancel,s.cancel),p(this.call,s.call),p(this.describe,s.describe)}use(s,p){DIe.aggregate({kind:s,completionUsage:p,usage:this})}toJSON(){return(()=>{const s=N=>({aggregate:p(N.aggregate),initialize:p(N.initialize),select:p(N.select),cancel:p(N.cancel),call:p(N.call),describe:p(N.describe)}),p=N=>({total:N.total,input:y(N.input),output:C(N.output)}),y=N=>({total:N.total,cached:N.cached}),C=N=>({total:N.total,reasoning:N.reasoning,accepted_prediction:N.accepted_prediction,rejected_prediction:N.rejected_prediction});return N=>s(N)})()(this)}static zero(){const s=()=>({total:0,input:{total:0,cached:0},output:{total:0,reasoning:0,accepted_prediction:0,rejected_prediction:0}});return new pP({aggregate:s(),initialize:s(),select:s(),cancel:s(),call:s(),describe:s()})}static plus(s,p){const y=new pP(s.toJSON());return y.increment(p.toJSON()),y}}function BIe(o,s,p){const y=o.get(s);if(y!==void 0)return y;const C=p();return o.set(s,C),C}function zMn(o){var z;const s=o.controllers.length===1||(()=>{const G=o.controllers.map(q=>q.application.functions.map(nt=>nt.name)).flat();return new Set(G).size===G.length})(),p=UMn({controllers:o.controllers,naming:(G,q)=>s?G:`_${q}_${G}`}),y=(z=o.config)==null?void 0:z.capacity,C=y!==void 0&&p.length>y?GMn({array:p,capacity:y}):void 0,N=new Map,L=new Map;for(const G of p)N.set(G.name,G),BIe(L,G.controller.name,()=>new Map).set(G.name,G);return{array:p,divided:C,flat:N,group:L}}function UMn(o){return o.controllers.flatMap((s,p)=>{switch(s.protocol){case"http":return qMn({controller:s,index:p,naming:o.naming});case"class":return WMn({controller:s,index:p,naming:o.naming});case"mcp":return KMn({controller:s,index:p,naming:o.naming});default:throw new Error(`Unsupported protocol: ${s.protocol}`)}})}function qMn(o){return o.controller.application.functions.map(s=>({protocol:"http",controller:o.controller,function:s,name:o.naming(s.name,o.index),toJSON:()=>({protocol:"http",controller:o.controller.name,function:s.name,name:o.naming(s.name,o.index)})}))}function WMn(o){return o.controller.application.functions.map(s=>({protocol:"class",controller:o.controller,function:s,name:o.naming(s.name,o.index),toJSON:()=>({protocol:"class",controller:o.controller.name,function:s.name,name:o.naming(s.name,o.index)})}))}function KMn(o){return o.controller.application.functions.map(s=>({protocol:"mcp",controller:o.controller,function:s,name:o.naming(s.name,o.index),toJSON:()=>({protocol:"mcp",controller:o.controller.name,function:s.name,name:o.naming(s.name,o.index)})}))}function GMn(o){if(o.capacity<=0)throw new Error("Capacity must be a positive integer");if(Number.isNaN(o.capacity))throw new TypeError("Capacity must be a positive integer");if(o.capacity===1/0)throw new Error("Capacity must be a positive integer");const s=Math.ceil(o.array.length/o.capacity),p=Math.ceil(o.array.length/s),y=o.array.slice();return Array.from({length:s},()=>y.splice(0,p))}const YMn={compose:zMn};function a$(o){if(o.type==="describe")return[];if(o.type==="select"||o.type==="cancel")return[{role:"assistant",tool_calls:[{type:"function",id:o.id,function:{name:`${o.type}Functions`,arguments:JSON.stringify({function:{name:o.selection.operation.name,reason:o.selection.reason}})}}]},{role:"tool",tool_call_id:o.id,content:""}];if(o.type==="execute")return[{role:"assistant",tool_calls:[{type:"function",id:o.id,function:{name:o.operation.name,arguments:JSON.stringify(o.arguments)}}]},{role:"tool",tool_call_id:o.id,content:JSON.stringify({function:{protocol:o.operation.protocol,description:o.operation.function.description,parameters:o.operation.function.parameters,output:o.operation.function.output,...o.operation.protocol==="http"?{method:o.operation.function.method,path:o.operation.function.path}:{}},...o.operation.protocol==="http"?{status:o.value.status,data:o.value.body}:{value:o.value}})}];if(o.type==="assistantMessage")return[{role:"assistant",content:o.text}];if(o.type==="systemMessage")return[{role:"system",content:o.text}];if(o.type==="userMessage")return[{role:"user",content:o.contents.map(s$)}];throw new Error(`Unsupported history type, value: ${JSON.stringify(o)}`)}function s$(o){if(o.type==="text")return o;if(o.type==="audio")return{type:"input_audio",input_audio:{data:o.data,format:o.format}};if(o.type==="file")return{type:"file",file:o.file.type==="base64"?{file_data:o.file.data,filename:o.file.name}:{file_id:o.file.id}};if(o.type==="image")return{type:"image_url",image_url:{url:o.image.type==="base64"?o.image.data:o.image.url,detail:o.detail}};throw new Error(`Unsupported user message content type, value: ${JSON.stringify(o)}`)}function FIe(o){return{type:"userMessage",id:o.id,created_at:o.created_at,contents:o.contents,toJSON:()=>({type:"userMessage",id:o.id,created_at:o.created_at,contents:o.contents})}}function VMn(o){const s={type:"assistantMessage",id:o.id,created_at:o.created_at,text:o.text};return{...s,toJSON:()=>s}}function XMn(o){const s={type:"systemMessage",id:o.id,created_at:o.created_at,text:o.text};return{...s,toJSON:()=>s}}function QMn(o){return{type:"describe",id:o.id,created_at:o.created_at,text:o.text,executes:o.executes,toJSON:()=>({type:"describe",id:o.id,created_at:o.created_at,text:o.text,executes:o.executes.map(s=>s.toJSON())})}}function $Ie(o){return{type:"select",id:o.id,selection:o.selection,created_at:o.created_at,toJSON:()=>({type:"select",id:o.id,created_at:o.created_at,selection:o.selection.toJSON()})}}function JMn(o){return{type:"cancel",id:o.id,created_at:o.created_at,selection:o.selection,toJSON:()=>({type:"cancel",id:o.id,created_at:o.created_at,selection:o.selection.toJSON()})}}function jIe(o){return{type:"execute",protocol:o.operation.protocol,id:o.id,created_at:o.created_at,operation:o.operation,arguments:o.arguments,value:o.value,toJSON:()=>({type:"execute",id:o.id,created_at:o.created_at,protocol:o.operation.protocol,operation:o.operation.toJSON(),arguments:o.arguments,value:o.value})}}function ZMn(){const o={id:wk(),type:"initialize",created_at:new Date().toISOString()};return{id:o.id,type:o.type,created_at:o.created_at,toJSON:()=>o}}function tRn(o){const s=wk(),p=new Date().toISOString();return{type:"select",id:s,created_at:p,selection:o.selection,toJSON:()=>({type:"select",id:s,created_at:p,selection:o.selection.toJSON()}),toHistory:()=>$Ie({id:s,created_at:p,selection:o.selection})}}function eRn(o){const s=wk(),p=new Date().toISOString();return{type:"cancel",id:s,created_at:p,selection:o.selection,toJSON:()=>({type:"cancel",id:s,created_at:p,selection:o.selection.toJSON()})}}function nRn(o){const s=new Date().toISOString();return{type:"call",id:o.id,created_at:s,operation:o.operation,arguments:o.arguments,toJSON:()=>({type:"call",id:o.id,created_at:s,operation:o.operation.toJSON(),arguments:o.arguments})}}function rRn(o){const s=new Date().toISOString();return{type:"jsonParseError",id:o.id,created_at:s,operation:o.operation,arguments:o.arguments,errorMessage:o.errorMessage}}function iRn(o){const s=new Date().toISOString();return{type:"validate",id:o.id,created_at:s,operation:o.operation,result:o.result,toJSON:()=>({type:"validate",id:o.id,created_at:s,operation:o.operation.toJSON(),result:o.result})}}function mmt(o){const s=wk(),p=new Date().toISOString();return{type:"execute",id:s,created_at:p,protocol:o.operation.protocol,operation:o.operation,arguments:o.arguments,value:o.value,toJSON:()=>({type:"execute",id:s,created_at:p,protocol:o.operation.protocol,operation:o.operation.toJSON(),arguments:o.arguments,value:o.value}),toHistory:()=>jIe({id:s,created_at:p,...o})}}function aRn(o){const s=wk(),p=new Date().toISOString();return{type:"userMessage",id:s,created_at:p,contents:o.contents,toJSON:()=>({type:"userMessage",id:s,created_at:p,contents:o.contents}),toHistory:()=>FIe({id:s,created_at:p,contents:o.contents})}}function VFt(o){const s=wk(),p=new Date().toISOString();return{type:"assistantMessage",id:s,created_at:p,stream:o.stream,join:o.join,toJSON:()=>({type:"assistantMessage",id:s,created_at:p,done:o.done(),text:o.get()}),toHistory:()=>({type:"assistantMessage",id:s,created_at:p,text:o.get(),toJSON:()=>({type:"assistantMessage",id:s,created_at:p,text:o.get()})})}}function sRn(o){const s=wk(),p=new Date().toISOString();return{type:"describe",id:s,created_at:p,executes:o.executes,stream:o.stream,join:o.join,toJSON:()=>({type:"describe",id:s,created_at:p,executes:o.executes.map(y=>y.toJSON()),done:o.done(),text:o.get()}),toHistory:()=>({type:"describe",id:s,created_at:p,executes:o.executes,text:o.get(),toJSON:()=>({type:"describe",id:s,created_at:p,executes:o.executes.map(y=>y.toJSON()),text:o.get()})})}}function oRn(o){const s=wk(),p=new Date().toISOString();return{type:"request",id:s,created_at:p,source:o.source,body:o.body,options:o.options}}var IBt;(function(o){o.is=s=>typeof s=="object"&&s!==null&&typeof s.openapi=="string"&&s.openapi.startsWith("3.0")})(IBt||(IBt={}));var OBt;(function(o){o.is=s=>typeof s=="object"&&s!==null&&typeof s.openapi=="string"&&s.openapi.startsWith("3.1")})(OBt||(OBt={}));var NBt;(function(o){o.is=s=>typeof s=="object"&&s!==null&&typeof s.swagger=="string"&&s.swagger.startsWith("2.0")})(NBt||(NBt={}));var ymt;(function(o){o.reference=s=>s.split("/").filter((p,y)=>!!p.length&&!(y===0&&p==="#")).join(".")})(ymt||(ymt={}));var lC;(function(o){o.take=s=>p=>y=>{const C=s.get(p);if(C)return C;const N=y();return s.set(p,N),N}})(lC||(lC={}));var JF;(function(o){o.variable=s=>o.reserved(s)===!1&&/^[a-zA-Z_$][a-zA-Z_$0-9]*$/g.test(s),o.reserved=s=>cRn.has(s)})(JF||(JF={}));const cRn=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","package","return","super","switch","this","throw","true","try","typeof","var","void","while","with"]);var hC;(function(o){o.cascade=s=>{var C,N;const p=s.schema.$ref.split(s.prefix)[1].split("."),y=p.slice(0,s.escape?p.length:p.length-1).map((L,z,G)=>G.slice(0,z+1).join(".")).map(L=>{var z,G;return{key:L,description:(G=(z=s.components.schemas)==null?void 0:z[L])==null?void 0:G.description}}).reverse().filter((L,z)=>z===0||!!(L!=null&&L.description));if(!(!((C=s.schema.description)!=null&&C.length)&&y.length===0))return[...(N=s.schema.description)!=null&&N.length?[s.schema.description]:[],...y.map((L,z)=>L.description===void 0?`Current Type: {@link ${L.key}}`:`Description of the ${z===0&&s.escape?"current":"parent"} {@link ${L.key}} type:
|
|
30
|
+
${o.palette.mode==="light"?tOn(Ef(o.palette.divider,1),.88):eOn(Ef(o.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(o.vars||o).palette.text.primary,lineHeight:o.typography.pxToRem(24),fontWeight:o.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(o.vars||o).palette.text.primary}},{props:{variant:"footer"},style:{color:(o.vars||o).palette.text.secondary,lineHeight:o.typography.pxToRem(21),fontSize:o.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${sMn.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:({ownerState:s})=>s.stickyHeader,style:{position:"sticky",top:0,zIndex:2,backgroundColor:(o.vars||o).palette.background.default}}]}))),S3=un.forwardRef(function(s,p){const y=Su({props:s,name:"MuiTableCell"}),{align:C="inherit",className:N,component:L,padding:z,scope:G,size:q,sortDirection:nt,variant:tt,...et}=y,st=un.useContext(bIe),at=un.useContext(Umt),It=at&&at.variant==="head";let Rt;L?Rt=L:Rt=It?"th":"td";let At=G;Rt==="td"?At=void 0:!At&&It&&(At="col");const ee=tt||at&&at.variant,ae={...y,align:C,component:Rt,padding:z||(st&&st.padding?st.padding:"normal"),size:q||(st&&st.size?st.size:"medium"),sortDirection:nt,stickyHeader:ee==="head"&&st&&st.stickyHeader,variant:ee},ve=oMn(ae);let hn=null;return nt&&(hn=nt==="asc"?"ascending":"descending"),le.jsx(cMn,{as:Rt,ref:p,className:bo(ve.root,N),"aria-sort":hn,scope:At,ownerState:ae,...et})});function uMn(o){return Vc("MuiTableHead",o)}au("MuiTableHead",["root"]);const lMn=o=>{const{classes:s}=o;return Hc({root:["root"]},uMn,s)},hMn=Ia("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(o,s)=>s.root})({display:"table-header-group"}),fMn={variant:"head"},xCe="thead",dMn=un.forwardRef(function(s,p){const y=Su({props:s,name:"MuiTableHead"}),{className:C,component:N=xCe,...L}=y,z={...y,component:N},G=lMn(z);return le.jsx(Umt.Provider,{value:fMn,children:le.jsx(hMn,{as:N,className:bo(G.root,C),ref:p,role:N===xCe?null:"rowgroup",ownerState:z,...L})})});function pMn(o){return Vc("MuiToolbar",o)}au("MuiToolbar",["root","gutters","regular","dense"]);const gMn=o=>{const{classes:s,disableGutters:p,variant:y}=o;return Hc({root:["root",!p&&"gutters",y]},pMn,s)},bMn=Ia("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,!p.disableGutters&&s.gutters,s[p.variant]]}})(pu(({theme:o})=>({position:"relative",display:"flex",alignItems:"center",variants:[{props:({ownerState:s})=>!s.disableGutters,style:{paddingLeft:o.spacing(2),paddingRight:o.spacing(2),[o.breakpoints.up("sm")]:{paddingLeft:o.spacing(3),paddingRight:o.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:o.mixins.toolbar}]}))),ECe=un.forwardRef(function(s,p){const y=Su({props:s,name:"MuiToolbar"}),{className:C,component:N="div",disableGutters:L=!1,variant:z="regular",...G}=y,q={...y,component:N,disableGutters:L,variant:z},nt=gMn(q);return le.jsx(bMn,{as:N,className:bo(nt.root,C),ref:p,ownerState:q,...G})});function mMn(o){return Vc("MuiTableRow",o)}const TCe=au("MuiTableRow",["root","selected","hover","head","footer"]),yMn=o=>{const{classes:s,selected:p,hover:y,head:C,footer:N}=o;return Hc({root:["root",p&&"selected",y&&"hover",C&&"head",N&&"footer"]},mMn,s)},wMn=Ia("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,p.head&&s.head,p.footer&&s.footer]}})(pu(({theme:o})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${TCe.hover}:hover`]:{backgroundColor:(o.vars||o).palette.action.hover},[`&.${TCe.selected}`]:{backgroundColor:o.vars?`rgba(${o.vars.palette.primary.mainChannel} / ${o.vars.palette.action.selectedOpacity})`:Ef(o.palette.primary.main,o.palette.action.selectedOpacity),"&:hover":{backgroundColor:o.vars?`rgba(${o.vars.palette.primary.mainChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.hoverOpacity}))`:Ef(o.palette.primary.main,o.palette.action.selectedOpacity+o.palette.action.hoverOpacity)}}}))),kCe="tr",Sbt=un.forwardRef(function(s,p){const y=Su({props:s,name:"MuiTableRow"}),{className:C,component:N=kCe,hover:L=!1,selected:z=!1,...G}=y,q=un.useContext(Umt),nt={...y,component:N,hover:L,selected:z,head:q&&q.variant==="head",footer:q&&q.variant==="footer"},tt=yMn(nt);return le.jsx(wMn,{as:N,ref:p,className:bo(tt.root,C),role:N===kCe?null:"row",ownerState:nt,...G})});function vMn(o){return Vc("MuiTextField",o)}au("MuiTextField",["root"]);const _Mn={standard:zmt,filled:BFt,outlined:$Ft},xMn=o=>{const{classes:s}=o;return Hc({root:["root"]},vMn,s)},EMn=Ia(APn,{name:"MuiTextField",slot:"Root",overridesResolver:(o,s)=>s.root})({}),$Dt=un.forwardRef(function(s,p){const y=Su({props:s,name:"MuiTextField"}),{autoComplete:C,autoFocus:N=!1,children:L,className:z,color:G="primary",defaultValue:q,disabled:nt=!1,error:tt=!1,FormHelperTextProps:et,fullWidth:st=!1,helperText:at,id:It,InputLabelProps:Rt,inputProps:At,InputProps:ee,inputRef:ae,label:ve,maxRows:hn,minRows:pe,multiline:pn=!1,name:Yn,onBlur:Ln,onChange:zn,onFocus:Qn,placeholder:ur,required:fi=!1,rows:pi,select:Or=!1,SelectProps:di,slots:Ea={},slotProps:Qi={},type:li,value:ze,variant:Na="outlined",...Ts}=y,Ke={...y,autoFocus:N,color:G,disabled:nt,error:tt,fullWidth:st,multiline:pn,required:fi,select:Or,variant:Na},xo=xMn(Ke),Ss=XQ(It),La=at&&Ss?`${Ss}-helper-text`:void 0,zo=ve&&Ss?`${Ss}-label`:void 0,$u=_Mn[Na],gu={slots:Ea,slotProps:{input:ee,inputLabel:Rt,htmlInput:At,formHelperText:et,select:di,...Qi}},Ds={},pc=gu.slotProps.inputLabel;Na==="outlined"&&(pc&&typeof pc.shrink<"u"&&(Ds.notched=pc.shrink),Ds.label=ve),Or&&((!di||!di.native)&&(Ds.id=void 0),Ds["aria-describedby"]=void 0);const[bu,P1]=wh("root",{elementType:EMn,shouldForwardComponentProp:!0,externalForwardedProps:{...gu,...Ts},ownerState:Ke,className:bo(xo.root,z),ref:p,additionalProps:{disabled:nt,error:tt,fullWidth:st,required:fi,color:G,variant:Na}}),[il,Rh]=wh("input",{elementType:$u,externalForwardedProps:gu,additionalProps:Ds,ownerState:Ke}),[Mg,Rg]=wh("inputLabel",{elementType:tLn,externalForwardedProps:gu,ownerState:Ke}),[Dg,iy]=wh("htmlInput",{elementType:"input",externalForwardedProps:gu,ownerState:Ke}),[Yp,wd]=wh("formHelperText",{elementType:jPn,externalForwardedProps:gu,ownerState:Ke}),[Vp,Ow]=wh("select",{elementType:gIe,externalForwardedProps:gu,ownerState:Ke}),Jd=le.jsx(il,{"aria-describedby":La,autoComplete:C,autoFocus:N,defaultValue:q,fullWidth:st,multiline:pn,name:Yn,rows:pi,maxRows:hn,minRows:pe,type:li,value:ze,id:Ss,inputRef:ae,onBlur:Ln,onChange:zn,onFocus:Qn,placeholder:ur,inputProps:iy,slots:{input:Ea.htmlInput?Dg:void 0},...Rh});return le.jsxs(bu,{...P1,children:[ve!=null&&ve!==""&&le.jsx(Mg,{htmlFor:Ss,id:zo,...Rg,children:ve}),Or?le.jsx(Vp,{"aria-describedby":La,id:Ss,labelId:zo,value:ze,input:Jd,...Ow,children:L}):Jd,at&&le.jsx(Yp,{id:La,...wd,children:at})]})});class mIe{constructor(s,p){this.it_=s,this.last_=p}next(){if(this.it_.equals(this.last_))return{done:!0,value:void 0};{const s=this.it_;return this.it_=this.it_.next(),{done:!1,value:s.value}}}[Symbol.iterator](){return this}}class qmt{empty(){return this.size()===0}rbegin(){return this.end().reverse()}rend(){return this.begin().reverse()}[Symbol.iterator](){return new mIe(this.begin(),this.end())}toJSON(){const s=[];for(const p of this)s.push(p);return s}}class J2{constructor(s,p){this.data_=s,this.index_=p}index(){return this.index_}get value(){return this.data_[this.index_]}prev(){return--this.index_,this}next(){return++this.index_,this}advance(s){return this.index_+=s,this}equals(s){return this.data_===s.data_&&this.index_===s.index_}swap(s){[this.data_,s.data_]=[s.data_,this.data_],[this.index_,s.index_]=[s.index_,this.index_]}}class yIe extends qmt{constructor(s){super(),this.data_=s(this)}assign(s,p){this.clear(),this.insert(s,p)}clear(){this.data_.clear()}begin(){return this.data_.begin()}end(){return this.data_.end()}has(s){return!this.find(s).equals(this.end())}size(){return this.data_.size()}push(...s){if(s.length===0)return this.size();const p=new J2(s,0),y=new J2(s,s.length);return this._Insert_by_range(p,y),this.size()}insert(...s){return s.length===1?this._Insert_by_key(s[0]):s[0].next instanceof Function&&s[1].next instanceof Function?this._Insert_by_range(s[0],s[1]):this._Insert_by_hint(s[0],s[1])}erase(...s){return s.length===1&&!(s[0]instanceof this.end().constructor&&s[0].source()===this)?this._Erase_by_val(s[0]):s.length===1?this._Erase_by_range(s[0]):this._Erase_by_range(s[0],s[1])}_Erase_by_range(s,p=s.next()){const y=this.data_.erase(s,p);return this._Handle_erase(s,p),y}}class wIe extends Error{constructor(s){super(s);const p=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,p):this.__proto__=p}get name(){return this.constructor.name}what(){return this.message}toJSON(){return{name:this.name,message:this.message,stack:this.stack}}}class vIe extends wIe{constructor(s){super(s)}}class UQ extends vIe{constructor(s){super(s)}}class oC extends vIe{constructor(s){super(s)}}var yd;(function(o){function s(nt){if(typeof nt=="string")return nt;let tt=nt.constructor.name;return nt.constructor.__MODULE&&(tt=`${nt.constructor.__MODULE}.${tt}`),`std.${tt}`}o.get_class_name=s;function p(nt,tt){return new oC(`Error on ${s(nt)}.${tt}(): it's empty container.`)}o.empty=p;function y(nt,tt,et){return new oC(`Error on ${s(nt)}.${tt}(): parametric index is negative -> (index = ${et}).`)}o.negative_index=y;function C(nt,tt,et,st){return new oC(`Error on ${s(nt)}.${tt}(): parametric index is equal or greater than size -> (index = ${et}, size: ${st}).`)}o.excessive_index=C;function N(nt,tt){return new UQ(`Error on ${s(nt)}.${tt}(): parametric iterator is not this container's own.`)}o.not_my_iterator=N;function L(nt,tt){return new UQ(`Error on ${s(nt)}.${tt}(): parametric iterator, it already has been erased.`)}o.erased_iterator=L;function z(nt,tt,et){return new oC(`Error on ${s(nt)}.${tt}(): parametric iterator is directing negative position -> (index = ${et}).`)}o.negative_iterator=z;function G(nt,tt="end"){const et=s(nt);return new oC(`Error on ${et}.Iterator.value: cannot access to the ${et}.${tt}().value.`)}o.iterator_end_value=G;function q(nt,tt,et){throw new oC(`Error on ${s(nt)}.${tt}(): unable to find the matched key -> ${et}`)}o.key_nout_found=q})(yd||(yd={}));class _Ie extends yIe{count(s){return this.find(s).equals(this.end())?0:1}insert(...s){return super.insert(...s)}_Insert_by_range(s,p){for(;!s.equals(p);s=s.next())this._Insert_by_key(s.value)}extract(s){return s instanceof this.end().constructor?this._Extract_by_iterator(s):this._Extract_by_val(s)}_Extract_by_val(s){const p=this.find(s);if(p.equals(this.end())===!0)throw yd.key_nout_found(this,"extract",s);return this._Erase_by_range(p),s}_Extract_by_iterator(s){return s.equals(this.end())===!0||this.has(s.value)===!1?this.end():(this._Erase_by_range(s),s)}_Erase_by_val(s){const p=this.find(s);return p.equals(this.end())===!0?0:(this._Erase_by_range(p),1)}merge(s){for(let p=s.begin();!p.equals(s.end());)this.has(p.value)===!1?(this.insert(p.value),p=s.erase(p)):p=p.next()}}class xIe extends yIe{insert(...s){return super.insert(...s)}_Erase_by_val(s){const p=this.find(s);if(p.equals(this.end())===!0)return 0;let y=p.next(),C=1;for(;!y.equals(this.end())&&this._Key_eq(s,y.value);)y=y.next(),++C;return this._Erase_by_range(p,y),C}merge(s){this.insert(s.begin(),s.end()),s.clear()}}class EIe extends qmt{constructor(s){super(),this.data_=s(this)}assign(s,p){this.clear(),this.insert(s,p)}clear(){this.data_.clear()}begin(){return this.data_.begin()}end(){return this.data_.end()}has(s){return!this.find(s).equals(this.end())}size(){return this.data_.size()}push(...s){const p=new J2(s,0),y=new J2(s,s.length);return this.insert(p,y),this.size()}insert(...s){return s.length===1?this.emplace(s[0].first,s[0].second):s[0].next instanceof Function&&s[1].next instanceof Function?this._Insert_by_range(s[0],s[1]):this.emplace_hint(s[0],s[1].first,s[1].second)}erase(...s){return s.length===1&&(!(s[0]instanceof this.end().constructor)||s[0].source()!==this)?this._Erase_by_key(s[0]):s.length===1?this._Erase_by_range(s[0]):this._Erase_by_range(s[0],s[1])}_Erase_by_range(s,p=s.next()){const y=this.data_.erase(s,p);return this._Handle_erase(s,p),y}}class TIe extends EIe{count(s){return this.find(s).equals(this.end())?0:1}get(s){const p=this.find(s);if(p.equals(this.end())===!0)throw yd.key_nout_found(this,"get",s);return p.second}take(s,p){const y=this.find(s);return y.equals(this.end())?this.emplace(s,p()).first.second:y.second}set(s,p){this.insert_or_assign(s,p)}insert(...s){return super.insert(...s)}_Insert_by_range(s,p){for(let y=s;!y.equals(p);y=y.next())this.emplace(y.value.first,y.value.second)}insert_or_assign(...s){if(s.length===2)return this._Insert_or_assign_with_key_value(s[0],s[1]);if(s.length===3)return this._Insert_or_assign_with_hint(s[0],s[1],s[2])}_Insert_or_assign_with_key_value(s,p){const y=this.emplace(s,p);return y.second===!1&&(y.first.second=p),y}_Insert_or_assign_with_hint(s,p,y){const C=this.emplace_hint(s,p,y);return C.second!==y&&(C.second=y),C}extract(s){return s instanceof this.end().constructor?this._Extract_by_iterator(s):this._Extract_by_key(s)}_Extract_by_key(s){const p=this.find(s);if(p.equals(this.end())===!0)throw yd.key_nout_found(this,"extract",s);const y=p.value;return this._Erase_by_range(p),y}_Extract_by_iterator(s){return s.equals(this.end())===!0?this.end():(this._Erase_by_range(s),s)}_Erase_by_key(s){const p=this.find(s);return p.equals(this.end())===!0?0:(this._Erase_by_range(p),1)}merge(s){for(let p=s.begin();!p.equals(s.end());)this.has(p.first)===!1?(this.insert(p.value),p=s.erase(p)):p=p.next()}}class kIe extends EIe{insert(...s){return super.insert(...s)}_Erase_by_key(s){const p=this.find(s);if(p.equals(this.end())===!0)return 0;let y=p.next(),C=1;for(;!y.equals(this.end())&&this._Key_eq(s,y.first);)y=y.next(),++C;return this._Erase_by_range(p,y),C}merge(s){this.insert(s.begin(),s.end()),s.clear()}}var rmt;(function(o){function s(p,...y){let C,N;return y.length>=1&&y[0]instanceof Array?(C=()=>{const L=y[0];p.push(...L)},N=y.slice(1)):y.length>=2&&y[0].next instanceof Function&&y[1].next instanceof Function?(C=()=>{const L=y[0],z=y[1];p.assign(L,z)},N=y.slice(2)):(C=null,N=y),{ramda:C,tail:N}}o.construct=s})(rmt||(rmt={}));function SIe(){return jDt===null&&(jDt=typeof global=="object"&&TMn(global)),jDt}function TMn(o){return o!==null&&typeof o.process=="object"&&o.process!==null&&typeof o.process.versions=="object"&&o.process.versions!==null&&typeof o.process.versions.node<"u"}let jDt=null;function kMn(){return hQ===null&&(hQ=SIe()?global:self,hQ.__s_iUID===void 0&&(hQ.__s_iUID=0)),hQ}let hQ=null;function bk(o){if(o instanceof Object){if(o.hasOwnProperty("__get_m_iUID")===!1){const s=++kMn().__s_iUID;Object.defineProperty(o,"__get_m_iUID",{value:function(){return s}})}return o.__get_m_iUID()}else return o===void 0?-1:0}function t5(o,s){return o=o&&o.valueOf(),s=s&&s.valueOf(),o instanceof Object&&o.equals instanceof Function?o.equals(s):o===s}function SMn(o,s){return!t5(o,s)}function a5(o,s){return o=o.valueOf(),s=s.valueOf(),o instanceof Object?o.less instanceof Function?o.less(s):bk(o)<bk(s):o<s}var ey;(function(o){function s(y,C,N,...L){let z=null,G=a5;if(L.length===1&&L[0]instanceof C){const q=L[0];G=q.key_comp(),z=()=>{const nt=q.begin(),tt=q.end();y.assign(nt,tt)}}else{const q=rmt.construct(y,...L);z=q.ramda,q.tail.length>=1&&(G=q.tail[0])}N(G),z!==null&&z()}o.construct=s;function p(y,C,N){const L=C.prev();let z=L.equals(y.end())||y.value_comp()(L.value,N);return z=z&&(C.equals(y.end())||y.value_comp()(N,C.value)),z}o.emplacable=p})(ey||(ey={}));function HFt(...o){let s=AMn;for(let p of o){p=p&&p.valueOf();const y=typeof p;if(y==="boolean")s=CMn(p,s);else if(y==="number"||y==="bigint")s=SCe(p,s);else if(y==="string")s=CIe(p,s);else if(p instanceof Object&&p.hashCode instanceof Function){const C=p.hashCode();if(o.length===1)return C;s=s^C,s*=zFt}else s=SCe(bk(p),s)}return Math.abs(s)}function CMn(o,s){return s^=o?1:0,s*=zFt,s}function SCe(o,s){return CIe(o.toString(),s)}function CIe(o,s){for(let p=0;p<o.length;++p)s^=o.charCodeAt(p),s*=zFt;return Math.abs(s)}const AMn=2166136261,zFt=16777619;class rp{constructor(s,p){this.first=s,this.second=p}equals(s){return t5(this.first,s.first)&&t5(this.second,s.second)}less(s){return t5(this.first,s.first)===!1?a5(this.first,s.first):a5(this.second,s.second)}hashCode(){return HFt(this.first,this.second)}}class AIe extends _Ie{find(s){const p=this.lower_bound(s);return!p.equals(this.end())&&this._Key_eq(s,p.value)?p:this.end()}equal_range(s){const p=this.lower_bound(s);return new rp(p,!p.equals(this.end())&&this._Key_eq(s,p.value)?p.next():p)}value_comp(){return this.key_comp()}_Key_eq(s,p){return!this.key_comp()(s,p)&&!this.key_comp()(p,s)}_Insert_by_key(s){let p=this.lower_bound(s);return!p.equals(this.end())&&this._Key_eq(p.value,s)?new rp(p,!1):(p=this.data_.insert(p,s),this._Handle_insert(p,p.next()),new rp(p,!0))}_Insert_by_hint(s,p){if(ey.emplacable(this,s,p)){const C=this.data_.insert(s,p);return this._Handle_insert(C,C.next()),C}else return this._Insert_by_key(p).first}}class IMn extends wIe{constructor(s){super(s)}}let OMn=class extends IMn{constructor(s){super(s)}};class VF{constructor(s,p){this.index_=s,this.value_=p}index(){return this.index_}get value(){return this.value_}next(){return++this.index_,this}equals(s){return this.index_===s.index_}}class UFt extends qmt{begin(){return this.nth(0)}end(){return this.nth(this.size())}at(s){return this._At(s)}set(s,p){if(s<0)throw yd.negative_index(this.source(),"at",s);if(s>=this.size())throw yd.excessive_index(this.source(),"at",s,this.size());this._Set(s,p)}front(s){if(arguments.length===0)return this.at(0);this.set(0,s)}back(s){const p=this.size()-1;if(arguments.length===0)return this.at(p);this.set(p,s)}insert(s,...p){if(s._Get_array()!==this)throw yd.not_my_iterator(this.source(),"insert");if(s.index()<0)throw yd.negative_iterator(this.source(),"insert",s.index());return s.index()>this.size()&&(s=this.end()),p.length===1?this._Insert_by_repeating_val(s,1,p[0]):p.length===2&&typeof p[0]=="number"?this._Insert_by_repeating_val(s,p[0],p[1]):this._Insert_by_range(s,p[0],p[1])}_Insert_by_repeating_val(s,p,y){const C=new VF(0,y),N=new VF(p);return this._Insert_by_range(s,C,N)}pop_back(){if(this.empty()===!0)throw yd.empty(this.source(),"pop_back");this._Pop_back()}erase(s,p=s.next()){if(s._Get_array()!==this||p._Get_array()!==this)throw yd.not_my_iterator(this.source(),"erase");if(s.index()<0)throw yd.negative_iterator(this.source(),"erase",s.index());if(s.index()>p.index())throw new OMn(`Error on ${yd.get_class_name(this.source())}.erase(): first iterator has greater index than last -> (first = ${s.index()}, last = ${p.index()}).`);return s.index()>=this.size()?this.end():this._Erase_by_range(s,p)}}class qFt extends UFt{constructor(){super()}assign(s,p){this.clear(),this.insert(this.end(),s,p)}clear(){this.data_.splice(0,this.data_.length)}resize(s){this.data_.length=s}size(){return this.data_.length}_At(s){return this.data_[s]}_Set(s,p){this.data_[s]=p}data(){return this.data_}[Symbol.iterator](){return this.data_[Symbol.iterator]()}push(...s){return this.data_.push(...s)}push_back(s){this.data_.push(s)}_Insert_by_range(s,p,y){if(s.index()>=this.size()){const C=this.size();for(;!p.equals(y);p=p.next())this.data_.push(p.value);return this.nth(C)}else{const C=this.data_.splice(s.index());for(;!p.equals(y);p=p.next())this.data_.push(p.value);return this.data_.push(...C),s}}_Pop_back(){this.data_.pop()}_Erase_by_range(s,p){return s.index()>=this.size()?s:p.index()>=this.size()?(this.data_.splice(s.index()),this.end()):(this.data_.splice(s.index(),p.index()-s.index()),s)}equals(s){return this.data_===s.data_}swap(s){[this.data_,s.data_]=[s.data_,this.data_]}toJSON(){return this.data_}}class WFt{constructor(s,p){this.array_=s,this.index_=p}_Get_array(){return this.array_}index(){return this.index_}get value(){return this.array_.at(this.index_)}set value(s){this.array_.set(this.index_,s)}prev(){return this.advance(-1)}next(){return this.advance(1)}advance(s){return this.array_.nth(this.index_+s)}equals(s){return t5(this.array_,s.array_)&&this.index_===s.index_}}let Wmt=class{constructor(s){this.base_=s.prev()}source(){return this.base_.source()}base(){return this.base_.next()}get value(){return this.base_.value}prev(){return this._Create_neighbor(this.base().next())}next(){return this._Create_neighbor(this.base_)}equals(s){return this.base_.equals(s.base_)}};class KFt extends Wmt{advance(s){return this._Create_neighbor(this.base().advance(-s))}index(){return this.base_.index()}get value(){return this.base_.value}set value(s){this.base_.value=s}}class N3 extends qFt{constructor(s){super(),this.data_=[],this.associative_=s}nth(s){return new N3.Iterator(this,s)}static _Swap_associative(s,p){[s.associative_,p.associative_]=[p.associative_,s.associative_]}source(){return this.associative_}}(function(o){class s extends WFt{source(){return this._Get_array().source()}reverse(){return new p(this)}}o.Iterator=s;class p extends KFt{_Create_neighbor(C){return new p(C)}}o.ReverseIterator=p})(N3||(N3={}));function Kmt(o,s){if(o.index instanceof Function)return NMn(o,s);let p=0;for(;!o.equals(s);o=o.next())++p;return p}function NMn(o,s){const p=o.index(),y=s.index();return o.base instanceof Function?p-y:y-p}function Gmt(o,s){if(s===0)return o;if(o.advance instanceof Function)return o.advance(s);let p;if(s<0){if(!(o.prev instanceof Function))throw new UQ("Error on std.advance(): parametric iterator is not a bi-directional iterator, thus advancing to negative direction is not possible.");p=y=>y.prev(),s=-s}else p=y=>y.next();for(;s-- >0;)o=p(o);return o}function Ymt(o,s,p,y=a5){let C=Kmt(o,s);for(;C>0;){const N=Math.floor(C/2),L=Gmt(o,N);y(L.value,p)?(o=L.next(),C-=N+1):C=N}return o}function Vmt(o,s,p,y=a5){let C=Kmt(o,s);for(;C>0;){const N=Math.floor(C/2),L=Gmt(o,N);y(p,L.value)?C=N:(o=L.next(),C-=N+1)}return o}class imt extends AIe{constructor(...s){super(p=>new N3(p)),ey.construct(this,imt,p=>{this.key_comp_=p},...s)}swap(s){[this.data_,s.data_]=[s.data_,this.data_],N3._Swap_associative(this.data_,s.data_),[this.key_comp_,s.key_comp_]=[s.key_comp_,this.key_comp_]}nth(s){return this.data_.nth(s)}key_comp(){return this.key_comp_}lower_bound(s){return Ymt(this.begin(),this.end(),s,this.value_comp())}upper_bound(s){return Vmt(this.begin(),this.end(),s,this.value_comp())}_Handle_insert({},{}){}_Handle_erase({},{}){}}(function(o){o.Iterator=N3.Iterator,o.ReverseIterator=N3.ReverseIterator,o.__MODULE="experimental"})(imt||(imt={}));class IIe extends xIe{find(s){const p=this.lower_bound(s);return!p.equals(this.end())&&this._Key_eq(s,p.value)?p:this.end()}count(s){let p=this.find(s),y=0;for(;!p.equals(this.end())&&this._Key_eq(p.value,s);p=p.next())++y;return y}equal_range(s){return new rp(this.lower_bound(s),this.upper_bound(s))}value_comp(){return this.key_comp()}_Key_eq(s,p){return!this.key_comp()(s,p)&&!this.key_comp()(p,s)}_Insert_by_key(s){let p=this.upper_bound(s);return p=this.data_.insert(p,s),this._Handle_insert(p,p.next()),p}_Insert_by_hint(s,p){if(ey.emplacable(this,s,p)){const C=this.data_.insert(s,p);return this._Handle_insert(C,C.next()),C}else return this._Insert_by_key(p)}_Insert_by_range(s,p){for(let y=s;!y.equals(p);y=y.next())this._Insert_by_key(y.value)}}class amt extends IIe{constructor(...s){super(p=>new N3(p)),ey.construct(this,amt,p=>{this.key_comp_=p},...s)}swap(s){[this.data_,s.data_]=[s.data_,this.data_],N3._Swap_associative(this.data_,s.data_),[this.key_comp_,s.key_comp_]=[s.key_comp_,this.key_comp_]}nth(s){return this.data_.nth(s)}key_comp(){return this.key_comp_}lower_bound(s){return Ymt(this.begin(),this.end(),s,this.value_comp())}upper_bound(s){return Vmt(this.begin(),this.end(),s,this.value_comp())}_Handle_insert({},{}){}_Handle_erase({},{}){}}(function(o){o.Iterator=N3.Iterator,o.ReverseIterator=N3.ReverseIterator,o.__MODULE="experimental"})(amt||(amt={}));class mk{constructor(s,p){this.first=s,this.second=p}equals(s){return t5(this.first,s.first)}less(s){return a5(this.first,s.first)}hashCode(){return HFt(this.first)}}class OIe extends TIe{find(s){const p=this.lower_bound(s);return!p.equals(this.end())&&this._Key_eq(s,p.first)?p:this.end()}equal_range(s){const p=this.lower_bound(s);return new rp(p,!p.equals(this.end())&&this._Key_eq(s,p.first)?p.next():p)}value_comp(){return(s,p)=>this.key_comp()(s.first,p.first)}_Key_eq(s,p){return!this.key_comp()(s,p)&&!this.key_comp()(p,s)}emplace(s,p){let y=this.lower_bound(s);return!y.equals(this.end())&&this._Key_eq(y.first,s)?new rp(y,!1):(y=this.data_.insert(y,new mk(s,p)),this._Handle_insert(y,y.next()),new rp(y,!0))}emplace_hint(s,p,y){const C=new mk(p,y);if(ey.emplacable(this,s,C)){const L=this.data_.insert(s,C);return this._Handle_insert(L,L.next()),L}else return this.emplace(p,y).first}}class P3 extends qFt{constructor(s){super(),this.data_=[],this.associative_=s}nth(s){return new P3.Iterator(this,s)}static _Swap_associative(s,p){[s.associative_,p.associative_]=[p.associative_,s.associative_]}source(){return this.associative_}}(function(o){class s extends WFt{source(){return this._Get_array().source()}reverse(){return new p(this)}get first(){return this.value.first}get second(){return this.value.second}set second(C){this.value.second=C}}o.Iterator=s;class p extends KFt{_Create_neighbor(C){return new p(C)}get first(){return this.value.first}get second(){return this.value.second}set second(C){this.value.second=C}}o.ReverseIterator=p})(P3||(P3={}));class smt extends OIe{constructor(...s){super(p=>new P3(p)),ey.construct(this,smt,p=>{this.key_comp_=p},...s)}swap(s){[this.data_,s.data_]=[s.data_,this.data_],P3._Swap_associative(this.data_,s.data_),[this.key_comp_,s.key_comp_]=[s.key_comp_,this.key_comp_]}nth(s){return this.data_.nth(s)}key_comp(){return this.key_comp_}lower_bound(s){return Ymt(this.begin(),this.end(),this._Capsule_key(s),this.value_comp())}upper_bound(s){return Vmt(this.begin(),this.end(),this._Capsule_key(s),this.value_comp())}_Capsule_key(s){return{first:s}}_Handle_insert({},{}){}_Handle_erase({},{}){}}(function(o){o.Iterator=P3.Iterator,o.ReverseIterator=P3.ReverseIterator,o.__MODULE="experimental"})(smt||(smt={}));class NIe extends kIe{find(s){const p=this.lower_bound(s);return!p.equals(this.end())&&this._Key_eq(s,p.first)?p:this.end()}count(s){let p=this.find(s),y=0;for(;!p.equals(this.end())&&this._Key_eq(p.first,s);p=p.next())++y;return y}equal_range(s){return new rp(this.lower_bound(s),this.upper_bound(s))}value_comp(){return(s,p)=>this.key_comp()(s.first,p.first)}_Key_eq(s,p){return!this.key_comp()(s,p)&&!this.key_comp()(p,s)}emplace(s,p){let y=this.upper_bound(s);return y=this.data_.insert(y,new mk(s,p)),this._Handle_insert(y,y.next()),y}emplace_hint(s,p,y){const C=new mk(p,y);if(ey.emplacable(this,s,C)){const L=this.data_.insert(s,C);return this._Handle_insert(L,L.next()),L}else return this.emplace(p,y)}_Insert_by_range(s,p){for(let y=s;!y.equals(p);y=y.next())this.emplace(y.value.first,y.value.second)}}class omt extends NIe{constructor(...s){super(p=>new P3(p)),ey.construct(this,omt,p=>{this.key_comp_=p},...s)}swap(s){[this.data_,s.data_]=[s.data_,this.data_],P3._Swap_associative(this.data_,s.data_),[this.key_comp_,s.key_comp_]=[s.key_comp_,this.key_comp_]}nth(s){return this.data_.nth(s)}key_comp(){return this.key_comp_}lower_bound(s){return Ymt(this.begin(),this.end(),this._Capsule_key(s),this.value_comp())}upper_bound(s){return Vmt(this.begin(),this.end(),this._Capsule_key(s),this.value_comp())}_Capsule_key(s){return{first:s}}_Handle_insert({},{}){}_Handle_erase({},{}){}}(function(o){o.Iterator=P3.Iterator,o.ReverseIterator=P3.ReverseIterator,o.__MODULE="experimental"})(omt||(omt={}));class i$ extends KFt{_Create_neighbor(s){return new i$(s)}}class GFt extends WFt{reverse(){return new i$(this)}source(){return this._Get_array()}}class uC extends qFt{constructor(...s){if(super(),s.length===0)this.data_=[];else if(s[0]instanceof Array){const p=s[0];this.data_=s[1]===!0?p:p.slice()}else if(s.length===1&&s[0]instanceof uC){const p=s[0];this.data_=p.data_.slice()}else s.length===2&&(this.data_=[],this.assign(s[0],s[1]))}static wrap(s){return new uC(s,!0)}nth(s){return new uC.Iterator(this,s)}source(){return this}}(function(o){o.Iterator=GFt,o.ReverseIterator=i$})(uC||(uC={}));function CBt(o,s,p=a5){const y=s.index()-o.index();if(y<=0)return;const C=o.advance(Math.floor(y/2)),N=C.value;C.index()!==o.index()&&HDt(o,C);let L=1;for(let z=1;z<y;++z){const G=o.advance(z);p(G.value,N)&&(HDt(G,o.advance(L)),++L)}HDt(o,o.advance(L-1)),CBt(o,o.advance(L-1),p),CBt(o.advance(L),s,p)}function HDt(o,s){[o.value,s.value]=[s.value,o.value]}class qp extends UFt{constructor(...s){if(super(),s.length===0&&this.clear(),s.length===1&&s[0]instanceof Array){const p=s[0],y=new J2(p,0),C=new J2(p,p.length);this.assign(y,C)}else if(s.length===1&&s[0]instanceof qp){const p=s[0];this.assign(p.begin(),p.end())}else s.length===2&&this.assign(s[0],s[1])}assign(s,p){this.clear(),this.insert(this.end(),s,p)}clear(){this.matrix_=[[]],this.size_=0,this.capacity_=qp.MIN_CAPACITY}resize(s){s=qp._Emend(s,"resize");const p=s-this.size();p>0?this.insert(this.end(),p,void 0):p<0&&this.erase(this.end().advance(-p),this.end())}reserve(s){this._Reserve(qp._Emend(s,"reserve"))}_Reserve(s){const p=[[]],y=this._Compute_col_size(s);for(let C=0;C<this.matrix_.length;++C){const N=this.matrix_[C];for(let L=0;L<N.length;++L){let z=p[p.length-1];p.length<qp.ROW_SIZE&&z.length===y&&(z=[],p.push(z)),z.push(N[L])}}this.matrix_=p,this.capacity_=s}shrink_to_fit(){this._Reserve(this.size())}swap(s){this._Swap(s)}_Swap(s){[this.matrix_,s.matrix_]=[s.matrix_,this.matrix_],[this.size_,s.size_]=[s.size_,this.size_],[this.capacity_,s.capacity_]=[s.capacity_,this.capacity_]}static _Emend(s,p){if(s=Math.floor(s),s<=0)throw new UQ(`Error on Deque.${p}(): n must be positive integer -> (n = ${s})`);return s}size(){return this.size_}capacity(){return this.capacity_}nth(s){return new qp.Iterator(this,s)}[Symbol.iterator](){return new qp.ForOfAdaptor(this.matrix_)}source(){return this}_At(s){const p=this._Fetch_index(s);return this.matrix_[p.first][p.second]}_Set(s,p){const y=this._Fetch_index(s);this.matrix_[y.first][y.second]=p}_Fetch_index(s){let p;for(p=0;p<this.matrix_.length;p++){const y=this.matrix_[p];if(s<y.length)break;s-=y.length}return p===this.matrix_.length&&p--,new rp(p,s)}_Compute_col_size(s=this.capacity_){return Math.floor(s/qp.ROW_SIZE)}push(...s){if(s.length===0)return this.size();const p=new J2(s,0),y=new J2(s,s.length);return this._Insert_by_range(this.end(),p,y),this.size()}push_front(s){this._Try_expand_capacity(this.size_+1),this._Try_add_row_at_front(),this.matrix_[0].unshift(s),++this.size_}push_back(s){this._Try_expand_capacity(this.size_+1),this._Try_add_row_at_back(),this.matrix_[this.matrix_.length-1].push(s),++this.size_}pop_front(){if(this.empty()===!0)throw yd.empty(this.constructor,"pop_front");this.matrix_[0].shift(),this.matrix_[0].length===0&&this.matrix_.length>1&&this.matrix_.shift(),this.size_--}_Pop_back(){const s=this.matrix_[this.matrix_.length-1];s.pop(),s.length===0&&this.matrix_.length>1&&this.matrix_.pop(),this.size_--}_Insert_by_range(s,p,y){const C=this.size_+Kmt(p,y);if(C===this.size_)return s;if(s.equals(this.end())===!0)this._Try_expand_capacity(C),this._Insert_to_end(p,y),s=this.nth(this.size_);else if(C>this.capacity_){const N=new qp;N._Reserve(Math.max(C,Math.floor(this.capacity_*qp.MAGNIFIER))),N._Insert_to_end(this.begin(),s),N._Insert_to_end(p,y),N._Insert_to_end(s,this.end()),this._Swap(N)}else this._Insert_to_middle(s,p,y);return this.size_=C,s}_Insert_to_middle(s,p,y){const C=this._Compute_col_size(),N=this._Fetch_index(s.index());let L=this.matrix_[N.first];const z=N.second,G=L.splice(z);for(;!p.equals(y);p=p.next()){if(L.length===C&&this.matrix_.length<qp.ROW_SIZE){L=new Array;const q=this.matrix_.splice(++N.first);this.matrix_.push(L),this.matrix_.push(...q)}L.push(p.value)}for(let q=0;q<G.length;++q){if(L.length===C&&this.matrix_.length<qp.ROW_SIZE){L=new Array;const nt=this.matrix_.splice(++N.first);this.matrix_.push(L),this.matrix_.push(...nt)}L.push(G[q])}}_Insert_to_end(s,p){for(;!s.equals(p);s=s.next())this._Try_add_row_at_back(),this.matrix_[this.matrix_.length-1].push(s.value)}_Try_expand_capacity(s){return s<=this.capacity_?!1:(s=Math.max(s,Math.floor(this.capacity_*qp.MAGNIFIER)),this._Reserve(s),!0)}_Try_add_row_at_front(){const s=this._Compute_col_size();return this.matrix_[0].length>=s&&this.matrix_.length<qp.ROW_SIZE?(this.matrix_=[[]].concat(...this.matrix_),!0):!1}_Try_add_row_at_back(){const s=this._Compute_col_size();return this.matrix_[this.matrix_.length-1].length>=s&&this.matrix_.length<qp.ROW_SIZE?(this.matrix_.push([]),!0):!1}_Erase_by_range(s,p){if(s.index()>=this.size())return s;let y;p.index()>=this.size()?y=this.size()-s.index():y=p.index()-s.index(),this.size_-=y;let C=null,N=null,L=0;for(;y!==0;){const z=this._Fetch_index(s.index()),G=this.matrix_[z.first],q=z.second,nt=Math.min(y,G.length-q);G.splice(q,nt),G.length!==0&&(L===0?C=G:N=G),G.length===0&&this.matrix_.length>1&&this.matrix_.splice(z.first,1),y-=nt,++L}return C!==null&&N!==null&&C.length+N.length<=this._Compute_col_size()&&(C.push(...N),this.matrix_.splice(this.matrix_.indexOf(N),1)),s}}(function(o){o.Iterator=GFt,o.ReverseIterator=i$,o.ROW_SIZE=8,o.MIN_CAPACITY=36,o.MAGNIFIER=1.5;class s{constructor(y){this.matrix_=y,this.row_=0,this.col_=0}next(){if(this.row_===this.matrix_.length)return{done:!0,value:void 0};{const y=this.matrix_[this.row_][this.col_];return++this.col_===this.matrix_[this.row_].length&&(++this.row_,this.col_=0),{done:!1,value:y}}}[Symbol.iterator](){return this}}o.ForOfAdaptor=s})(qp||(qp={}));class _6{constructor(s,p,y){this.prev_=s,this.next_=p,this.value_=y}static _Set_prev(s,p){s.prev_=p}static _Set_next(s,p){s.next_=p}prev(){return this.prev_}next(){return this.next_}get value(){return this._Try_value(),this.value_}_Try_value(){if(this.value_===void 0&&this.equals(this.source().end())===!0)throw yd.iterator_end_value(this.source())}equals(s){return this===s}}class YFt extends qmt{constructor(){super(),this.end_=this._Create_iterator(null,null),this.clear()}assign(s,p){this.clear(),this.insert(this.end(),s,p)}clear(){_6._Set_prev(this.end_,this.end_),_6._Set_next(this.end_,this.end_),this.begin_=this.end_,this.size_=0}resize(s){const p=s-this.size();p>0?this.insert(this.end(),p,void 0):p<0&&this.erase(Gmt(this.end(),-p),this.end())}begin(){return this.begin_}end(){return this.end_}size(){return this.size_}push_front(s){this.insert(this.begin_,s)}push_back(s){this.insert(this.end_,s)}pop_front(){if(this.empty()===!0)throw yd.empty(this.end_.source().constructor.name,"pop_front");this.erase(this.begin_)}pop_back(){if(this.empty()===!0)throw yd.empty(this.end_.source().constructor.name,"pop_back");this.erase(this.end_.prev())}push(...s){if(s.length===0)return this.size();const p=new J2(s,0),y=new J2(s,s.length);return this._Insert_by_range(this.end(),p,y),this.size()}insert(s,...p){if(s.source()!==this.end_.source())throw yd.not_my_iterator(this.end_.source(),"insert");if(s.erased_===!0)throw yd.erased_iterator(this.end_.source(),"insert");return p.length===1?this._Insert_by_repeating_val(s,1,p[0]):p.length===2&&typeof p[0]=="number"?this._Insert_by_repeating_val(s,p[0],p[1]):this._Insert_by_range(s,p[0],p[1])}_Insert_by_repeating_val(s,p,y){const C=new VF(0,y),N=new VF(p);return this._Insert_by_range(s,C,N)}_Insert_by_range(s,p,y){let C=s.prev(),N=null,L=0;for(let z=p;z.equals(y)===!1;z=z.next()){const G=this._Create_iterator(C,null,z.value);L===0&&(N=G),_6._Set_next(C,G),C=G,++L}return s.equals(this.begin())===!0&&(this.begin_=N),_6._Set_next(C,s),_6._Set_prev(s,C),this.size_+=L,N}erase(s,p=s.next()){return this._Erase_by_range(s,p)}_Erase_by_range(s,p){if(s.source()!==this.end_.source())throw yd.not_my_iterator(this.end_.source(),"insert");if(s.erased_===!0)throw yd.erased_iterator(this.end_.source(),"insert");if(s.equals(this.end_))return this.end_;const y=s.prev();_6._Set_next(y,p),_6._Set_prev(p,y);for(let C=s;!C.equals(p);C=C.next())C.erased_=!0,--this.size_;return s.equals(this.begin_)&&(this.begin_=p),p}swap(s){[this.begin_,s.begin_]=[s.begin_,this.begin_],[this.end_,s.end_]=[s.end_,this.end_],[this.size_,s.size_]=[s.size_,this.size_]}}class Z_ extends YFt{constructor(...s){if(super(),this.ptr_={value:this},Z_.Iterator._Set_source_ptr(this.end_,this.ptr_),s.length!==0)if(s.length===1&&s[0]instanceof Array){const p=s[0];this.push(...p)}else if(s.length===1&&s[0]instanceof Z_){const p=s[0];this.assign(p.begin(),p.end())}else s.length===2&&this.assign(s[0],s[1])}_Create_iterator(s,p,y){return Z_.Iterator.create(this.ptr_,s,p,y)}front(s){if(arguments.length===0)return this.begin_.value;this.begin_.value=s}back(s){const p=this.end().prev();if(arguments.length===0)return p.value;p.value=s}unique(s=t5){let p=this.begin().next();for(;!p.equals(this.end());)s(p.value,p.prev().value)===!0?p=this.erase(p):p=p.next()}remove(s){return this.remove_if(p=>t5(p,s))}remove_if(s){let p=this.begin();for(;!p.equals(this.end());)s(p.value)===!0?p=this.erase(p):p=p.next()}merge(s,p=a5){if(this===s)return;let y=this.begin();for(;s.empty()===!1;){const C=s.begin();for(;!y.equals(this.end())&&p(y.value,C.value)===!0;)y=y.next();this.splice(y,s,C)}}splice(s,p,y,C){y===void 0?(y=p.begin(),C=p.end()):C===void 0&&(C=y.next()),this.insert(s,y,C),p.erase(y,C)}sort(s=a5){this._Quick_sort(this.begin(),this.end().prev(),s)}_Quick_sort(s,p,y){if(!s.equals(p)&&!p.equals(this.end())&&!s.equals(p.next())){const C=this._Quick_sort_partition(s,p,y);this._Quick_sort(s,C.prev(),y),this._Quick_sort(C.next(),p,y)}}_Quick_sort_partition(s,p,y){const C=p.value;let N=s.prev(),L=s;for(;!L.equals(p);L=L.next())y(L.value,C)&&(N=N.equals(this.end())?s:N.next(),[N.value,L.value]=[L.value,N.value]);return N=N.equals(this.end())?s:N.next(),[N.value,L.value]=[L.value,N.value],N}reverse(){const s=this.end_.prev(),p=this.begin();for(let y=this.begin();!y.equals(this.end());){const C=y.prev(),N=y.next();Z_.Iterator._Set_prev(y,N),Z_.Iterator._Set_next(y,C),y=N}this.begin_=s,Z_.Iterator._Set_prev(this.end_,p),Z_.Iterator._Set_next(this.end_,s)}swap(s){super.swap(s),[this.ptr_,s.ptr_]=[s.ptr_,this.ptr_],[this.ptr_.value,s.ptr_.value]=[s.ptr_.value,this.ptr_.value]}}(function(o){class s extends _6{constructor(C,N,L,z){super(N,L,z),this.source_ptr_=C}static create(C,N,L,z){return new s(C,N,L,z)}reverse(){return new p(this)}static _Set_source_ptr(C,N){C.source_ptr_=N}source(){return this.source_ptr_.value}get value(){return this._Try_value(),this.value_}set value(C){this._Try_value(),this.value_=C}equals(C){return this===C}}o.Iterator=s;class p extends Wmt{_Create_neighbor(C){return new p(C)}get value(){return this.base_.value}set value(C){this.base_.value=C}}o.ReverseIterator=p})(Z_||(Z_={}));class l0 extends YFt{constructor(s){super(),this.associative_=s}_Create_iterator(s,p,y){return l0.Iterator.create(this,s,p,y)}static _Swap_associative(s,p){[s.associative_,p.associative_]=[p.associative_,s.associative_]}associative(){return this.associative_}}(function(o){class s extends _6{constructor(C,N,L,z){super(N,L,z),this.list_=C}static create(C,N,L,z){return new s(C,N,L,z)}reverse(){return new p(this)}source(){return this.list_.associative()}get first(){return this.value.first}get second(){return this.value.second}set second(C){this.value.second=C}}o.Iterator=s;class p extends Wmt{_Create_neighbor(C){return new p(C)}get first(){return this.base_.first}get second(){return this.base_.second}set second(C){this.base_.second=C}}o.ReverseIterator=p})(l0||(l0={}));class PMn{constructor(s,p){this.value=s,this.color=p,this.parent=null,this.left=null,this.right=null}get grand(){return this.parent.parent}get sibling(){return this===this.parent.left?this.parent.right:this.parent.left}get uncle(){return this.parent.sibling}}class PIe{constructor(s){this.root_=null,this.comp_=s,this.equal_=function(p,y){return!s(p,y)&&!s(y,p)}}clear(){this.root_=null}root(){return this.root_}get(s){const p=this.nearest(s);return p===null||!this.equal_(s,p.value)?null:p}nearest(s){if(this.root_===null)return null;let p=this.root_;for(;;){let y=null;if(this.comp_(s,p.value))y=p.left;else if(this.comp_(p.value,s))y=p.right;else return p;if(y!==null)p=y;else break}return p}_Fetch_maximum(s){for(;s.right!==null;)s=s.right;return s}insert(s){const p=this.nearest(s),y=new PMn(s,1);p===null?this.root_=y:(y.parent=p,this.comp_(y.value,p.value)?p.left=y:p.right=y),this._Insert_case1(y)}_Insert_case1(s){s.parent===null?s.color=0:this._Insert_case2(s)}_Insert_case2(s){this._Fetch_color(s.parent)!==0&&this._Insert_case3(s)}_Insert_case3(s){this._Fetch_color(s.uncle)===1?(s.parent.color=0,s.uncle.color=0,s.grand.color=1,this._Insert_case1(s.grand)):this._Insert_case4(s)}_Insert_case4(s){s===s.parent.right&&s.parent===s.grand.left?(this._Rotate_left(s.parent),s=s.left):s===s.parent.left&&s.parent===s.grand.right&&(this._Rotate_right(s.parent),s=s.right),this._Insert_case5(s)}_Insert_case5(s){s.parent.color=0,s.grand.color=1,s===s.parent.left&&s.parent===s.grand.left?this._Rotate_right(s.grand):this._Rotate_left(s.grand)}erase(s){let p=this.get(s);if(p===null)return;if(p.left!==null&&p.right!==null){const C=this._Fetch_maximum(p.left);p.value=C.value,p=C}const y=p.right===null?p.left:p.right;this._Fetch_color(p)===0&&(p.color=this._Fetch_color(y),this._Erase_case1(p)),this._Replace_node(p,y),this._Fetch_color(this.root_)===1&&(this.root_.color=0)}_Erase_case1(s){s.parent!==null&&this._Erase_case2(s)}_Erase_case2(s){this._Fetch_color(s.sibling)===1&&(s.parent.color=1,s.sibling.color=0,s===s.parent.left?this._Rotate_left(s.parent):this._Rotate_right(s.parent)),this._Erase_case3(s)}_Erase_case3(s){this._Fetch_color(s.parent)===0&&this._Fetch_color(s.sibling)===0&&this._Fetch_color(s.sibling.left)===0&&this._Fetch_color(s.sibling.right)===0?(s.sibling.color=1,this._Erase_case1(s.parent)):this._Erase_case4(s)}_Erase_case4(s){this._Fetch_color(s.parent)===1&&s.sibling!==null&&this._Fetch_color(s.sibling)===0&&this._Fetch_color(s.sibling.left)===0&&this._Fetch_color(s.sibling.right)===0?(s.sibling.color=1,s.parent.color=0):this._Erase_case5(s)}_Erase_case5(s){s===s.parent.left&&s.sibling!==null&&this._Fetch_color(s.sibling)===0&&this._Fetch_color(s.sibling.left)===1&&this._Fetch_color(s.sibling.right)===0?(s.sibling.color=1,s.sibling.left.color=0,this._Rotate_right(s.sibling)):s===s.parent.right&&s.sibling!==null&&this._Fetch_color(s.sibling)===0&&this._Fetch_color(s.sibling.left)===0&&this._Fetch_color(s.sibling.right)===1&&(s.sibling.color=1,s.sibling.right.color=0,this._Rotate_left(s.sibling)),this._Erase_case6(s)}_Erase_case6(s){s.sibling.color=this._Fetch_color(s.parent),s.parent.color=0,s===s.parent.left?(s.sibling.right.color=0,this._Rotate_left(s.parent)):(s.sibling.left.color=0,this._Rotate_right(s.parent))}_Rotate_left(s){const p=s.right;this._Replace_node(s,p),s.right=p.left,p.left!==null&&(p.left.parent=s),p.left=s,s.parent=p}_Rotate_right(s){const p=s.left;this._Replace_node(s,p),s.left=p.right,p.right!==null&&(p.right.parent=s),p.right=s,s.parent=p}_Replace_node(s,p){s.parent===null?this.root_=p:s===s.parent.left?s.parent.left=p:s.parent.right=p,p!==null&&(p.parent=s.parent)}_Fetch_color(s){return s===null?0:s.color}}class LIe extends PIe{constructor(s,p,y){super(y),this.source_=s,this.key_compare_=p,this.key_eq_=function(C,N){return!p(C,N)&&!p(N,C)},this.value_compare_=function(C,N){return p(C.first,N.first)}}static _Swap_source(s,p){[s.source_,p.source_]=[p.source_,s.source_]}get_by_key(s){const p=this.nearest_by_key(s);return p===null||!this.key_eq_(s,p.value.first)?null:p}lower_bound(s){const p=this.nearest_by_key(s);return p===null?this.source().end():this.key_comp()(p.value.first,s)?p.value.next():p.value}equal_range(s){return new rp(this.lower_bound(s),this.upper_bound(s))}source(){return this.source_}key_comp(){return this.key_compare_}key_eq(){return this.key_eq_}value_comp(){return this.value_compare_}}class CCe extends LIe{constructor(s,p){super(s,p,(y,C)=>p(y.first,C.first))}nearest_by_key(s){if(this.root_===null)return null;let p=this.root_;for(;;){const y=p.value;let C=null;if(this.key_comp()(s,y.first))C=p.left;else if(this.key_comp()(y.first,s))C=p.right;else return p;if(C===null)break;p=C}return p}upper_bound(s){const p=this.nearest_by_key(s);if(p===null)return this.source().end();const y=p.value;return this.key_comp()(s,y.first)?y:y.next()}}class XF extends OIe{constructor(...s){super(p=>new l0(p)),ey.construct(this,XF,p=>{this.tree_=new CCe(this,p)},...s)}clear(){super.clear(),this.tree_.clear()}swap(s){[this.data_,s.data_]=[s.data_,this.data_],l0._Swap_associative(this.data_,s.data_),CCe._Swap_source(this.tree_,s.tree_),[this.tree_,s.tree_]=[s.tree_,this.tree_]}key_comp(){return this.tree_.key_comp()}lower_bound(s){return this.tree_.lower_bound(s)}upper_bound(s){return this.tree_.upper_bound(s)}_Handle_insert(s,p){for(;!s.equals(p);s=s.next())this.tree_.insert(s)}_Handle_erase(s,p){for(;!s.equals(p);s=s.next())this.tree_.erase(s)}}(function(o){o.Iterator=l0.Iterator,o.ReverseIterator=l0.ReverseIterator})(XF||(XF={}));class qQ extends UFt{constructor(...s){if(super(),s.length===1&&s[0]instanceof qQ){const p=s[0];this.data_=new XF(p.data_.begin(),p.data_.end()),this.size_=p.size_}else s.length===1&&s[0]instanceof Array?(this.clear(),this.push(...s[0])):s.length===2?this.assign(s[0],s[1]):this.clear()}assign(s,p){this.clear(),this.insert(this.end(),s,p)}clear(){this.data_=new XF,this.size_=0}resize(s){const p=s-this.size();p>0?this.insert(this.end(),p,!1):p<0&&this.erase(this.end().advance(-p),this.end())}flip(){for(const s of this.data_)s.second=!s.second}swap(s){[this.data_,s.data_]=[s.data_,this.data_],[this.size_,s.size_]=[s.size_,this.size_]}source(){return this}size(){return this.size_}_At(s){return this._Find_node(s).second}_Set(s,p){p=!!p;let y=this._Find_node(s);if(y.second===p||(y.first===s?y.second=p:y=this.data_.emplace(s,p).first,s===this.size()-1))return;const C=y.prev(),N=y.next();SMn(C,this.data_.end())&&C.second===y.second&&this.data_.erase(y),N.equals(this.data_.end())===!0||N.first!==s+1||N.second!==p?this.data_.emplace(s+1,!p):this.data_.erase(N)}nth(s){return new qQ.Iterator(this,s)}_Find_node(s){return this.data_.upper_bound(s).prev()}push(...s){if(s.length===0)return this.size();const p=new J2(s,0),y=new J2(s,s.length);return this._Insert_by_range(this.end(),p,y),this.size()}push_back(s){const p=this.data_.rbegin(),y=this.size_++;s=!!s,(this.data_.empty()||p.second!==s)&&this.data_.emplace(y,s)}_Pop_back(){const s=this.data_.rbegin(),p=--this.size_;s.first===p&&this.data_.erase(s.base())}_Insert_by_repeating_val(s,p,y){const C=[];return C.push(new rp(p,y)),s.equals(this.end())===!0?this._Insert_to_end(C):this._Insert_to_middle(s,C)}_Insert_by_range(s,p,y){const C=[];for(let N=p;!N.equals(y);N=N.next())C.length===0||C[C.length-1].second!==N.value?C.push(new rp(1,N.value)):++C[C.length-1].first;return s.equals(this.end())===!0?this._Insert_to_end(C):this._Insert_to_middle(s,C)}_Insert_to_middle(s,p){const y=this._Find_node(s.index());for(let C=y;!C.equals(this.data_.end());C=C.next()){const N=C.next(),L=C.first<s.index()?s.index():C.first,G=(N.equals(this.data_.end())?this.size():N.first)-L,q=!!C.second;p.push(new rp(G,q))}return this.size_=s.index(),this.data_.erase(y.first===s.index()?y:y.next(),this.data_.end()),this._Insert_to_end(p)}_Insert_to_end(s){const p=this.size(),y=this.data_.empty()?null:this.data_.rbegin().second;for(let C=0;C<s.length;++C){const N=s[C],L=this.size(),z=!!N.second;this.size_+=N.first,!(C===0&&z===y)&&this.data_.emplace(L,z)}return this.begin().advance(p)}_Erase_by_range(s,p){const y=[];if(p.equals(this.end())===!1){const C=Math.min(this.size(),p.index());for(let N=this._Find_node(C);!N.equals(this.data_.end());N=N.next()){const L=N.next(),z=Math.max(N.first,C),q=(L.equals(this.data_.end())?this.size():L.first)-z,nt=N.second;y.push(new rp(q,nt))}}return this.size_=s.index(),this.data_.erase(this.data_.lower_bound(this.size_),this.data_.end()),this._Insert_to_end(y)}}(function(o){o.Iterator=GFt,o.ReverseIterator=i$})(qQ||(qQ={}));class Sw{constructor(...s){if(this.ptr_={value:this},this.end_=Sw.Iterator.create(this.ptr_,null),this.before_begin_=Sw.Iterator.create(this.ptr_,this.end_),this.size_=0,s.length===1&&s[0]instanceof Array){const p=s[0];let y=this.before_begin();for(const C of p)y=this.insert_after(y,C)}else s.length===1&&s[0]instanceof Sw?this.assign(s[0].begin(),s[0].end()):s.length===2&&this.assign(s[0],s[1])}assign(s,p){this.clear(),this.insert_after(this.before_begin_,s,p)}clear(){Sw.Iterator._Set_next(this.before_begin_,this.end_),this.size_=0}size(){return this.size_}empty(){return this.size_===0}front(s){const p=this.begin();if(arguments.length===0)return p.value;p.value=s}before_begin(){return this.before_begin_}begin(){return this.before_begin_.next()}end(){return this.end_}[Symbol.iterator](){return new mIe(this.begin(),this.end())}push_front(s){this.insert_after(this.before_begin_,s)}insert_after(s,...p){let y;return p.length===1?y=this._Insert_by_repeating_val(s,1,p[0]):typeof p[0]=="number"?y=this._Insert_by_repeating_val(s,p[0],p[1]):y=this._Insert_by_range(s,p[0],p[1]),y}_Insert_by_repeating_val(s,p,y){const C=new VF(0,y),N=new VF(p);return this._Insert_by_range(s,C,N)}_Insert_by_range(s,p,y){const C=[];let N=0;for(;!p.equals(y);p=p.next()){const L=Sw.Iterator.create(this.ptr_,null,p.value);C.push(L),++N}if(N===0)return s;for(let L=0;L<N-1;++L)Sw.Iterator._Set_next(C[L],C[L+1]);return Sw.Iterator._Set_next(C[C.length-1],s.next()),Sw.Iterator._Set_next(s,C[0]),this.size_+=N,C[C.length-1]}pop_front(){this.erase_after(this.before_begin())}erase_after(s,p=Gmt(s,2)){return this.size_-=Math.max(0,Kmt(s,p)-1),Sw.Iterator._Set_next(s,p),p}unique(s=t5){for(let p=this.begin().next();!p.equals(this.end());p=p.next()){const y=p.next();if(y.equals(this.end()))break;s(p.value,y.value)&&this.erase_after(p)}}remove(s){return this.remove_if(p=>t5(p,s))}remove_if(s){let p=0;for(let y=this.before_begin();!y.next().equals(this.end());y=y.next())s(y.next().value)===!0&&(Sw.Iterator._Set_next(y,y.next().next()),++p);this.size_-=p}merge(s,p=a5){if(this===s)return;let y=this.before_begin();for(;s.empty()===!1;){const C=s.begin().value;for(;!y.next().equals(this.end())&&p(y.next().value,C);)y=y.next();this.splice_after(y,s,s.before_begin())}}splice_after(s,p,y=p.before_begin(),C=y.next().next()){C===null&&(C=p.end()),this.insert_after(s,y.next(),C),p.erase_after(y,C)}sort(s=a5){const p=new uC(this.begin(),this.end());CBt(p.begin(),p.end(),s),this.assign(p.begin(),p.end())}reverse(){const s=new uC(this.begin(),this.end());this.assign(s.rbegin(),s.rend())}swap(s){[this.size_,s.size_]=[s.size_,this.size_],[this.before_begin_,s.before_begin_]=[s.before_begin_,this.before_begin_],[this.end_,s.end_]=[s.end_,this.end_],[this.ptr_,s.ptr_]=[s.ptr_,this.ptr_],[this.ptr_.value,s.ptr_.value]=[s.ptr_.value,this.ptr_.value]}toJSON(){const s=[];for(const p of this)s.push(p);return s}}(function(o){class s{constructor(y,C,N){this.source_ptr_=y,this.next_=C,this.value_=N}static create(y,C,N){return new s(y,C,N)}source(){return this.source_ptr_.value}get value(){return this._Try_value(),this.value_}set value(y){this._Try_value(),this.value_=y}_Try_value(){if(this.value_===void 0){const y=this.source();if(this.equals(y.end())===!0)throw yd.iterator_end_value(y);if(this.equals(y.before_begin())===!0)throw yd.iterator_end_value(y,"before_begin")}}next(){return this.next_}equals(y){return this===y}static _Set_next(y,C){y.next_=C}}o.Iterator=s})(Sw||(Sw={}));class h0 extends YFt{constructor(s){super(),this.associative_=s}_Create_iterator(s,p,y){return h0.Iterator.create(this,s,p,y)}static _Swap_associative(s,p){[s.associative_,p.associative_]=[p.associative_,s.associative_]}associative(){return this.associative_}}(function(o){class s extends _6{constructor(C,N,L,z){super(N,L,z),this.source_=C}static create(C,N,L,z){return new s(C,N,L,z)}reverse(){return new p(this)}source(){return this.source_.associative()}}o.Iterator=s;class p extends Wmt{_Create_neighbor(C){return new p(C)}}o.ReverseIterator=p})(h0||(h0={}));class MIe extends PIe{constructor(s,p,y){super(y),this.source_=s,this.key_comp_=p,this.key_eq_=(C,N)=>!p(C,N)&&!p(N,C)}static _Swap_source(s,p){[s.source_,p.source_]=[p.source_,s.source_]}get_by_key(s){const p=this.nearest_by_key(s);return p===null||!this.key_eq_(s,p.value.value)?null:p}lower_bound(s){const p=this.nearest_by_key(s);return p===null?this.source_.end():this.key_comp_(p.value.value,s)?p.value.next():p.value}equal_range(s){return new rp(this.lower_bound(s),this.upper_bound(s))}source(){return this.source_}key_comp(){return this.key_comp_}key_eq(){return this.key_eq_}value_comp(){return this.key_comp_}}class ACe extends MIe{constructor(s,p){super(s,p,(y,C)=>p(y.value,C.value))}nearest_by_key(s){if(this.root_===null)return null;let p=this.root_;for(;;){const y=p.value;let C=null;if(this.key_comp()(s,y.value))C=p.left;else if(this.key_comp()(y.value,s))C=p.right;else return p;if(C===null)break;p=C}return p}upper_bound(s){const p=this.nearest_by_key(s);if(p===null)return this.source().end();const y=p.value;return this.key_comp()(s,y.value)?y:y.next()}}class cmt extends AIe{constructor(...s){super(p=>new h0(p)),ey.construct(this,cmt,p=>{this.tree_=new ACe(this,p)},...s)}clear(){super.clear(),this.tree_.clear()}swap(s){[this.data_,s.data_]=[s.data_,this.data_],h0._Swap_associative(this.data_,s.data_),ACe._Swap_source(this.tree_,s.tree_),[this.tree_,s.tree_]=[s.tree_,this.tree_]}key_comp(){return this.tree_.key_comp()}lower_bound(s){return this.tree_.lower_bound(s)}upper_bound(s){return this.tree_.upper_bound(s)}_Handle_insert(s,p){for(;!s.equals(p);s=s.next())this.tree_.insert(s)}_Handle_erase(s,p){for(;!s.equals(p);s=s.next())this.tree_.erase(s)}}(function(o){o.Iterator=h0.Iterator,o.ReverseIterator=h0.ReverseIterator})(cmt||(cmt={}));var QF;(function(o){function s(p,y,C,...N){let L=null,z=HFt,G=t5;if(N.length===1&&N[0]instanceof y){const q=N[0];z=q.hash_function(),G=q.key_eq(),L=()=>{const nt=q.begin(),tt=q.end();p.assign(nt,tt)}}else{const q=rmt.construct(p,...N);L=q.ramda,q.tail.length>=1&&(z=q.tail[0]),q.tail.length>=2&&(G=q.tail[1])}C(z,G),L!==null&&L()}o.construct=s})(QF||(QF={}));class RIe{constructor(s,p){this.fetcher_=s,this.hasher_=p,this.max_load_factor_=LMn,this.data_=[],this.size_=0,this.initialize()}clear(){this.data_=[],this.size_=0,this.initialize()}rehash(s){s=Math.max(s,ICe);const p=[];for(let y=0;y<s;++y)p.push([]);for(const y of this.data_)for(const C of y){const N=this.hasher_(this.fetcher_(C))%p.length;p[N].push(C)}this.data_=p}reserve(s){s>this.capacity()&&(s=Math.floor(s/this.max_load_factor_),this.rehash(s))}initialize(){for(let s=0;s<ICe;++s)this.data_.push([])}length(){return this.data_.length}capacity(){return this.data_.length*this.max_load_factor_}at(s){return this.data_[s]}load_factor(){return this.size_/this.length()}max_load_factor(s=null){if(s===null)return this.max_load_factor_;this.max_load_factor_=s}hash_function(){return this.hasher_}index(s){return this.hasher_(this.fetcher_(s))%this.length()}insert(s){const p=this.capacity();++this.size_>p&&this.reserve(p*2);const y=this.index(s);this.data_[y].push(s)}erase(s){const p=this.index(s),y=this.data_[p];for(let C=0;C<y.length;++C)if(y[C]===s){y.splice(C,1),--this.size_;break}}}const ICe=10,LMn=1;class umt extends RIe{constructor(s,p,y){super(MMn,p),this.source_=s,this.key_eq_=y}static _Swap_source(s,p){[s.source_,p.source_]=[p.source_,s.source_]}key_eq(){return this.key_eq_}find(s){const p=this.hash_function()(s)%this.length(),y=this.at(p);for(const C of y)if(this.key_eq_(C.value,s))return C;return this.source_.end()}}function MMn(o){return o.value}class lmt extends _Ie{constructor(...s){super(p=>new h0(p)),QF.construct(this,lmt,(p,y)=>{this.buckets_=new umt(this,p,y)},...s)}clear(){this.buckets_.clear(),super.clear()}swap(s){[this.data_,s.data_]=[s.data_,this.data_],h0._Swap_associative(this.data_,s.data_),umt._Swap_source(this.buckets_,s.buckets_),[this.buckets_,s.buckets_]=[s.buckets_,this.buckets_]}find(s){return this.buckets_.find(s)}begin(s=null){return s===null?super.begin():this.buckets_.at(s)[0]}end(s=null){if(s===null)return super.end();{const p=this.buckets_.at(s);return p[p.length-1].next()}}rbegin(s=null){return this.end(s).reverse()}rend(s=null){return this.begin(s).reverse()}bucket_count(){return this.buckets_.length()}bucket_size(s){return this.buckets_.at(s).length}load_factor(){return this.buckets_.load_factor()}hash_function(){return this.buckets_.hash_function()}key_eq(){return this.buckets_.key_eq()}bucket(s){return this.hash_function()(s)%this.buckets_.length()}max_load_factor(s=null){return this.buckets_.max_load_factor(s)}reserve(s){this.buckets_.reserve(s)}rehash(s){this.buckets_.rehash(s)}_Insert_by_key(s){let p=this.find(s);return p.equals(this.end())===!1?new rp(p,!1):(this.data_.push(s),p=p.prev(),this._Handle_insert(p,p.next()),new rp(p,!0))}_Insert_by_hint(s,p){let y=this.find(p);return y.equals(this.end())===!0&&(y=this.data_.insert(s,p),this._Handle_insert(y,y.next())),y}_Handle_insert(s,p){for(;!s.equals(p);s=s.next())this.buckets_.insert(s)}_Handle_erase(s,p){for(;!s.equals(p);s=s.next())this.buckets_.erase(s)}}(function(o){o.Iterator=h0.Iterator,o.ReverseIterator=h0.ReverseIterator})(lmt||(lmt={}));class OCe extends MIe{constructor(s,p){super(s,p,function(y,C){const N=p(y.value,C.value);return!N&&!p(C.value,y.value)?bk(y)<bk(C):N})}insert(s){bk(s),super.insert(s)}_Nearest_by_key(s,p){if(this.root_===null)return null;let y=this.root_,C=null;for(;;){const N=y.value;let L=null;if(this.key_comp()(s,N.value)?L=y.left:this.key_comp()(N.value,s)?L=y.right:(C=y,L=p(y)),L===null)break;y=L}return C!==null?C:y}nearest_by_key(s){return this._Nearest_by_key(s,function(p){return p.left})}upper_bound(s){const p=this._Nearest_by_key(s,function(C){return C.right});if(p===null)return this.source().end();const y=p.value;return this.key_comp()(s,y.value)?y:y.next()}}class hmt extends IIe{constructor(...s){super(p=>new h0(p)),ey.construct(this,hmt,p=>{this.tree_=new OCe(this,p)},...s)}clear(){super.clear(),this.tree_.clear()}swap(s){[this.data_,s.data_]=[s.data_,this.data_],h0._Swap_associative(this.data_,s.data_),OCe._Swap_source(this.tree_,s.tree_),[this.tree_,s.tree_]=[s.tree_,this.tree_]}key_comp(){return this.tree_.key_comp()}lower_bound(s){return this.tree_.lower_bound(s)}upper_bound(s){return this.tree_.upper_bound(s)}_Handle_insert(s,p){for(;!s.equals(p);s=s.next())this.tree_.insert(s)}_Handle_erase(s,p){for(;!s.equals(p);s=s.next())this.tree_.erase(s)}}(function(o){o.Iterator=h0.Iterator,o.ReverseIterator=h0.ReverseIterator})(hmt||(hmt={}));class fmt extends xIe{constructor(...s){super(p=>new h0(p)),QF.construct(this,fmt,(p,y)=>{this.buckets_=new umt(this,p,y)},...s)}clear(){this.buckets_.clear(),super.clear()}swap(s){[this.data_,s.data_]=[s.data_,this.data_],h0._Swap_associative(this.data_,s.data_),umt._Swap_source(this.buckets_,s.buckets_),[this.buckets_,s.buckets_]=[s.buckets_,this.buckets_]}find(s){return this.buckets_.find(s)}count(s){const p=this.bucket(s),y=this.buckets_.at(p);let C=0;for(let N of y)this.buckets_.key_eq()(N.value,s)&&++C;return C}begin(s=null){return s===null?super.begin():this.buckets_.at(s)[0]}end(s=null){if(s===null)return super.end();{const p=this.buckets_.at(s);return p[p.length-1].next()}}rbegin(s=null){return this.end(s).reverse()}rend(s=null){return this.begin(s).reverse()}bucket_count(){return this.buckets_.length()}bucket_size(s){return this.buckets_.at(s).length}load_factor(){return this.buckets_.load_factor()}hash_function(){return this.buckets_.hash_function()}key_eq(){return this.buckets_.key_eq()}bucket(s){return this.hash_function()(s)%this.buckets_.length()}max_load_factor(s=null){return this.buckets_.max_load_factor(s)}reserve(s){this.buckets_.rehash(Math.ceil(s*this.max_load_factor()))}rehash(s){s<=this.bucket_count()||this.buckets_.rehash(s)}_Key_eq(s,p){return this.key_eq()(s,p)}_Insert_by_key(s){const p=this.data_.insert(this.data_.end(),s);return this._Handle_insert(p,p.next()),p}_Insert_by_hint(s,p){const y=this.data_.insert(s,p);return this._Handle_insert(y,y.next()),y}_Insert_by_range(s,p){const y=this.data_.insert(this.data_.end(),s,p);this.size()>this.buckets_.capacity()&&this.reserve(Math.max(this.size(),this.buckets_.capacity()*2)),this._Handle_insert(y,this.end())}_Handle_insert(s,p){for(;!s.equals(p);s=s.next())this.buckets_.insert(s)}_Handle_erase(s,p){for(;!s.equals(p);s=s.next())this.buckets_.erase(s)}}(function(o){o.Iterator=h0.Iterator,o.ReverseIterator=h0.ReverseIterator})(fmt||(fmt={}));class dmt extends RIe{constructor(s,p,y){super(RMn,p),this.source_=s,this.key_eq_=y}static _Swap_source(s,p){[s.source_,p.source_]=[p.source_,s.source_]}key_eq(){return this.key_eq_}find(s){const p=this.hash_function()(s)%this.length(),y=this.at(p);for(const C of y)if(this.key_eq_(C.first,s))return C;return this.source_.end()}}function RMn(o){return o.first}class pmt extends TIe{constructor(...s){super(p=>new l0(p)),QF.construct(this,pmt,(p,y)=>{this.buckets_=new dmt(this,p,y)},...s)}clear(){this.buckets_.clear(),super.clear()}swap(s){[this.data_,s.data_]=[s.data_,this.data_],l0._Swap_associative(this.data_,s.data_),dmt._Swap_source(this.buckets_,s.buckets_),[this.buckets_,s.buckets_]=[s.buckets_,this.buckets_]}find(s){return this.buckets_.find(s)}begin(s=null){return s===null?super.begin():this.buckets_.at(s)[0]}end(s=null){if(s===null)return super.end();{const p=this.buckets_.at(s);return p[p.length-1].next()}}rbegin(s=null){return this.end(s).reverse()}rend(s=null){return this.begin(s).reverse()}bucket_count(){return this.buckets_.length()}bucket_size(s){return this.buckets_.at(s).length}load_factor(){return this.buckets_.load_factor()}hash_function(){return this.buckets_.hash_function()}key_eq(){return this.buckets_.key_eq()}bucket(s){return this.hash_function()(s)%this.buckets_.length()}max_load_factor(s=null){return this.buckets_.max_load_factor(s)}reserve(s){this.buckets_.reserve(s)}rehash(s){this.buckets_.rehash(s)}emplace(s,p){let y=this.find(s);return y.equals(this.end())===!1?new rp(y,!1):(this.data_.push(new mk(s,p)),y=y.prev(),this._Handle_insert(y,y.next()),new rp(y,!0))}emplace_hint(s,p,y){let C=this.find(p);return C.equals(this.end())===!0&&(C=this.data_.insert(s,new mk(p,y)),this._Handle_insert(C,C.next())),C}_Handle_insert(s,p){for(;!s.equals(p);s=s.next())this.buckets_.insert(s)}_Handle_erase(s,p){for(;!s.equals(p);s=s.next())this.buckets_.erase(s)}}(function(o){o.Iterator=l0.Iterator,o.ReverseIterator=l0.ReverseIterator})(pmt||(pmt={}));class NCe extends LIe{constructor(s,p){super(s,p,function(y,C){const N=p(y.first,C.first);return!N&&!p(C.first,y.first)?bk(y)<bk(C):N})}insert(s){bk(s),super.insert(s)}_Nearest_by_key(s,p){if(this.root_===null)return null;let y=this.root_,C=null;for(;;){const N=y.value;let L=null;if(this.key_comp()(s,N.first)?L=y.left:this.key_comp()(N.first,s)?L=y.right:(C=y,L=p(y)),L===null)break;y=L}return C!==null?C:y}nearest_by_key(s){return this._Nearest_by_key(s,function(p){return p.left})}upper_bound(s){const p=this._Nearest_by_key(s,function(C){return C.right});if(p===null)return this.source().end();const y=p.value;return this.key_comp()(s,y.first)?y:y.next()}}class gmt extends NIe{constructor(...s){super(p=>new l0(p)),ey.construct(this,gmt,p=>{this.tree_=new NCe(this,p)},...s)}clear(){super.clear(),this.tree_.clear()}swap(s){[this.data_,s.data_]=[s.data_,this.data_],l0._Swap_associative(this.data_,s.data_),NCe._Swap_source(this.tree_,s.tree_),[this.tree_,s.tree_]=[s.tree_,this.tree_]}key_comp(){return this.tree_.key_comp()}lower_bound(s){return this.tree_.lower_bound(s)}upper_bound(s){return this.tree_.upper_bound(s)}_Handle_insert(s,p){for(;!s.equals(p);s=s.next())this.tree_.insert(s)}_Handle_erase(s,p){for(;!s.equals(p);s=s.next())this.tree_.erase(s)}}(function(o){o.Iterator=l0.Iterator,o.ReverseIterator=l0.ReverseIterator})(gmt||(gmt={}));class bmt extends kIe{constructor(...s){super(p=>new l0(p)),QF.construct(this,bmt,(p,y)=>{this.buckets_=new dmt(this,p,y)},...s)}clear(){this.buckets_.clear(),super.clear()}swap(s){[this.data_,s.data_]=[s.data_,this.data_],l0._Swap_associative(this.data_,s.data_),dmt._Swap_source(this.buckets_,s.buckets_),[this.buckets_,s.buckets_]=[s.buckets_,this.buckets_]}find(s){return this.buckets_.find(s)}count(s){const p=this.bucket(s),y=this.buckets_.at(p);let C=0;for(let N of y)this.buckets_.key_eq()(N.first,s)&&++C;return C}begin(s=null){return s===null?super.begin():this.buckets_.at(s)[0]}end(s=null){if(s===null)return super.end();{const p=this.buckets_.at(s);return p[p.length-1].next()}}rbegin(s=null){return this.end(s).reverse()}rend(s=null){return this.begin(s).reverse()}bucket_count(){return this.buckets_.length()}bucket_size(s){return this.buckets_.at(s).length}load_factor(){return this.buckets_.load_factor()}hash_function(){return this.buckets_.hash_function()}key_eq(){return this.buckets_.key_eq()}bucket(s){return this.hash_function()(s)%this.buckets_.length()}max_load_factor(s=null){return this.buckets_.max_load_factor(s)}reserve(s){this.buckets_.reserve(s)}rehash(s){s<=this.bucket_count()||this.buckets_.rehash(s)}_Key_eq(s,p){return this.key_eq()(s,p)}emplace(s,p){const y=this.data_.insert(this.data_.end(),new mk(s,p));return this._Handle_insert(y,y.next()),y}emplace_hint(s,p,y){const C=this.data_.insert(s,new mk(p,y));return this._Handle_insert(C,C.next()),C}_Insert_by_range(s,p){const y=[];for(let N=s;!N.equals(p);N=N.next())y.push(new mk(N.value.first,N.value.second));const C=this.data_.insert(this.data_.end(),new J2(y,0),new J2(y,y.length));this.size()>this.buckets_.capacity()&&this.reserve(Math.max(this.size(),this.buckets_.capacity()*2)),this._Handle_insert(C,this.end())}_Handle_insert(s,p){for(;!s.equals(p);s=s.next())this.buckets_.insert(s)}_Handle_erase(s,p){for(;!s.equals(p);s=s.next())this.buckets_.erase(s)}}(function(o){o.Iterator=l0.Iterator,o.ReverseIterator=l0.ReverseIterator})(bmt||(bmt={}));var PCe;(function(o){function s(N){if(C.length<=N)for(let L=C.length;L<=N;++L)C.push(C[L-1]*L);return C[N]}o.factorial=s;function p(N,L,z,G=100*1e3){if(L>z)[L,z]=[z,L];else if(L===z)return 0;const q=(z-L)/G;let nt=0;for(;L<z;L+=q)nt+=N(L)*q;return nt}o.integral=p;function y(N,L,z){let G=0;for(;L<=z;++L)G+=N(L);return G}o.sigma=y;const C=[1,1]})(PCe||(PCe={}));function DMn(o){return new Promise(s=>{setTimeout(s,o)})}var S6;(function(o){async function s(C,N,L){await C(),await y(N,L)}o.lock=s;async function p(C,N,L){return await C()===!1?!1:(await y(N,L),!0)}o.try_lock=p;async function y(C,N){try{await N()}catch(L){throw await C(),L}await C()}})(S6||(S6={}));class LCe{}(function(o){function s(N,L){return S6.lock(()=>N.lock(),()=>N.unlock(),L)}o.lock=s;function p(N,L){return S6.try_lock(()=>N.try_lock(),()=>N.unlock(),L)}o.try_lock=p;function y(N,L,z){return S6.try_lock(()=>N.try_lock_for(L),()=>N.unlock(),z)}o.try_lock_for=y;function C(N,L,z){return S6.try_lock(()=>N.try_lock_until(L),()=>N.unlock(),z)}o.try_lock_until=C})(LCe||(LCe={}));class MCe{}(function(o){function s(N,L){return S6.lock(()=>N.lock_shared(),()=>N.unlock_shared(),L)}o.lock=s;function p(N,L){return S6.try_lock(()=>N.try_lock_shared(),()=>N.unlock_shared(),L)}o.try_lock=p;function y(N,L,z){return S6.try_lock(()=>N.try_lock_shared_for(L),()=>N.unlock_shared(),z)}o.try_lock_for=y;function C(N,L,z){return S6.try_lock(()=>N.try_lock_shared_until(L),()=>N.unlock_shared(),z)}o.try_lock_until=C})(MCe||(MCe={}));class ABt{constructor(s){this.queue_=new Z_,this.acquiring_=0,this.max_=s}max(){return this.max_}acquire(){return new Promise(s=>{this.acquiring_<this.max_?(++this.acquiring_,s()):this.queue_.push_back({handler:s,lockType:0})})}async try_acquire(){return this.acquiring_<this.max_?(++this.acquiring_,!0):!1}async try_acquire_for(s){return new Promise(p=>{if(this.acquiring_<this.max_)++this.acquiring_,p(!0);else{const y=this.queue_.insert(this.queue_.end(),{handler:p,lockType:1});DMn(s).then(()=>{y.value.handler!==null&&this._Cancel(y)})}})}try_acquire_until(s){const p=new Date,y=s.getTime()-p.getTime();return this.try_acquire_for(y)}async release(s=1){if(s<1)throw new UQ(`Error on std.Semaphore.release(): parametric n is less than 1 -> (n = ${s}).`);if(s>this.max_)throw new oC(`Error on std.Semaphore.release(): parametric n is greater than max -> (n = ${s}, max = ${this.max_}).`);if(s>this.acquiring_)throw new oC(`Error on std.Semaphore.release(): parametric n is greater than acquiring -> (n = ${s}, acquiring = ${this.acquiring_}).`);const p=[];for(;this.queue_.empty()===!1&&p.length<s;){const y=this.queue_.front();y.handler!==null&&p.push({...y}),this.queue_.pop_front(),y.handler=null}this.acquiring_-=s-p.length;for(const y of p)y.lockType===0?y.handler():y.handler(!0)}_Cancel(s){const p=s.value.handler;s.value.handler=null,this.queue_.erase(s),p(!1)}}(function(o){function s(y){return new p(y)}o.get_lockable=s;class p{constructor(C){this.semahpore_=C}lock(){return this.semahpore_.acquire()}unlock(){return this.semahpore_.release()}try_lock(){return this.semahpore_.try_acquire()}try_lock_for(C){return this.semahpore_.try_acquire_for(C)}try_lock_until(C){return this.semahpore_.try_acquire_until(C)}}o.Lockable=p})(ABt||(ABt={}));const Ng=[];for(let o=0;o<256;++o)Ng.push((o+256).toString(16).slice(1));function BMn(o,s=0){return(Ng[o[s+0]]+Ng[o[s+1]]+Ng[o[s+2]]+Ng[o[s+3]]+"-"+Ng[o[s+4]]+Ng[o[s+5]]+"-"+Ng[o[s+6]]+Ng[o[s+7]]+"-"+Ng[o[s+8]]+Ng[o[s+9]]+"-"+Ng[o[s+10]]+Ng[o[s+11]]+Ng[o[s+12]]+Ng[o[s+13]]+Ng[o[s+14]]+Ng[o[s+15]]).toLowerCase()}let zDt;const FMn=new Uint8Array(16);function $Mn(){if(!zDt){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");zDt=crypto.getRandomValues.bind(crypto)}return zDt(FMn)}const jMn=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),RCe={randomUUID:jMn};function wk(o,s,p){var C;if(RCe.randomUUID&&!o)return RCe.randomUUID();o=o||{};const y=o.random??((C=o.rng)==null?void 0:C.call(o))??$Mn();if(y.length<16)throw new Error("Random bytes length must be >= 16");return y[6]=y[6]&15|64,y[8]=y[8]&63|128,BMn(y)}function HMn(o){var C,N,L,z,G;const s=o.usage[o.kind];s.total+=o.completionUsage.total_tokens,s.input.total+=o.completionUsage.prompt_tokens,s.input.total+=((C=o.completionUsage.prompt_tokens_details)==null?void 0:C.audio_tokens)??0,s.input.cached+=((N=o.completionUsage.prompt_tokens_details)==null?void 0:N.cached_tokens)??0,s.output.total+=o.completionUsage.completion_tokens,s.output.accepted_prediction+=((L=o.completionUsage.completion_tokens_details)==null?void 0:L.accepted_prediction_tokens)??0,s.output.reasoning+=((z=o.completionUsage.completion_tokens_details)==null?void 0:z.reasoning_tokens)??0,s.output.rejected_prediction+=((G=o.completionUsage.completion_tokens_details)==null?void 0:G.rejected_prediction_tokens)??0;const p=q=>Object.entries(o.usage).filter(([nt])=>nt!=="aggregate").map(([,nt])=>q(nt)).reduce((nt,tt)=>nt+tt,0),y=o.usage.aggregate;y.total=p(q=>q.total),y.input.total=p(q=>q.input.total),y.input.cached=p(q=>q.input.cached),y.output.total=p(q=>q.output.total),y.output.reasoning=p(q=>q.output.reasoning),y.output.accepted_prediction=p(q=>q.output.accepted_prediction),y.output.rejected_prediction=p(q=>q.output.rejected_prediction)}const DIe={aggregate:HMn};class pP{constructor(s){if(s===void 0){const p=pP.zero();this.aggregate=p.aggregate,this.initialize=p.initialize,this.select=p.select,this.cancel=p.cancel,this.call=p.call,this.describe=p.describe}else this.aggregate=s.aggregate,this.initialize=s.initialize,this.select=s.select,this.cancel=s.cancel,this.call=s.call,this.describe=s.describe}increment(s){const p=(y,C)=>{y.total+=C.total,y.input.total+=C.input.total,y.input.cached+=C.input.cached,y.output.total+=C.output.total,y.output.reasoning+=C.output.reasoning,y.output.accepted_prediction+=C.output.accepted_prediction,y.output.rejected_prediction+=C.output.rejected_prediction};p(this.aggregate,s.aggregate),p(this.initialize,s.initialize),p(this.select,s.select),p(this.cancel,s.cancel),p(this.call,s.call),p(this.describe,s.describe)}use(s,p){DIe.aggregate({kind:s,completionUsage:p,usage:this})}toJSON(){return(()=>{const s=N=>({aggregate:p(N.aggregate),initialize:p(N.initialize),select:p(N.select),cancel:p(N.cancel),call:p(N.call),describe:p(N.describe)}),p=N=>({total:N.total,input:y(N.input),output:C(N.output)}),y=N=>({total:N.total,cached:N.cached}),C=N=>({total:N.total,reasoning:N.reasoning,accepted_prediction:N.accepted_prediction,rejected_prediction:N.rejected_prediction});return N=>s(N)})()(this)}static zero(){const s=()=>({total:0,input:{total:0,cached:0},output:{total:0,reasoning:0,accepted_prediction:0,rejected_prediction:0}});return new pP({aggregate:s(),initialize:s(),select:s(),cancel:s(),call:s(),describe:s()})}static plus(s,p){const y=new pP(s.toJSON());return y.increment(p.toJSON()),y}}function BIe(o,s,p){const y=o.get(s);if(y!==void 0)return y;const C=p();return o.set(s,C),C}function zMn(o){var z;const s=o.controllers.length===1||(()=>{const G=o.controllers.map(q=>q.application.functions.map(nt=>nt.name)).flat();return new Set(G).size===G.length})(),p=UMn({controllers:o.controllers,naming:(G,q)=>s?G:`_${q}_${G}`}),y=(z=o.config)==null?void 0:z.capacity,C=y!==void 0&&p.length>y?GMn({array:p,capacity:y}):void 0,N=new Map,L=new Map;for(const G of p)N.set(G.name,G),BIe(L,G.controller.name,()=>new Map).set(G.name,G);return{array:p,divided:C,flat:N,group:L}}function UMn(o){return o.controllers.flatMap((s,p)=>{switch(s.protocol){case"http":return qMn({controller:s,index:p,naming:o.naming});case"class":return WMn({controller:s,index:p,naming:o.naming});case"mcp":return KMn({controller:s,index:p,naming:o.naming});default:throw new Error(`Unsupported protocol: ${s.protocol}`)}})}function qMn(o){return o.controller.application.functions.map(s=>({protocol:"http",controller:o.controller,function:s,name:o.naming(s.name,o.index),toJSON:()=>({protocol:"http",controller:o.controller.name,function:s.name,name:o.naming(s.name,o.index)})}))}function WMn(o){return o.controller.application.functions.map(s=>({protocol:"class",controller:o.controller,function:s,name:o.naming(s.name,o.index),toJSON:()=>({protocol:"class",controller:o.controller.name,function:s.name,name:o.naming(s.name,o.index)})}))}function KMn(o){return o.controller.application.functions.map(s=>({protocol:"mcp",controller:o.controller,function:s,name:o.naming(s.name,o.index),toJSON:()=>({protocol:"mcp",controller:o.controller.name,function:s.name,name:o.naming(s.name,o.index)})}))}function GMn(o){if(o.capacity<=0)throw new Error("Capacity must be a positive integer");if(Number.isNaN(o.capacity))throw new TypeError("Capacity must be a positive integer");if(o.capacity===1/0)throw new Error("Capacity must be a positive integer");const s=Math.ceil(o.array.length/o.capacity),p=Math.ceil(o.array.length/s),y=o.array.slice();return Array.from({length:s},()=>y.splice(0,p))}const YMn={compose:zMn};function a$(o){if(o.type==="describe")return[];if(o.type==="select"||o.type==="cancel")return[{role:"assistant",tool_calls:[{type:"function",id:o.id,function:{name:`${o.type}Functions`,arguments:JSON.stringify({function:{name:o.selection.operation.name,reason:o.selection.reason}})}}]},{role:"tool",tool_call_id:o.id,content:""}];if(o.type==="execute")return[{role:"assistant",tool_calls:[{type:"function",id:o.id,function:{name:o.operation.name,arguments:JSON.stringify(o.arguments)}}]},{role:"tool",tool_call_id:o.id,content:JSON.stringify({function:{protocol:o.operation.protocol,description:o.operation.function.description,parameters:o.operation.function.parameters,output:o.operation.function.output,...o.operation.protocol==="http"?{method:o.operation.function.method,path:o.operation.function.path}:{}},...o.operation.protocol==="http"?{status:o.value.status,data:o.value.body}:{value:o.value}})}];if(o.type==="assistantMessage")return[{role:"assistant",content:o.text}];if(o.type==="systemMessage")return[{role:"system",content:o.text}];if(o.type==="userMessage")return[{role:"user",content:o.contents.map(s$)}];throw new Error(`Unsupported history type, value: ${JSON.stringify(o)}`)}function s$(o){if(o.type==="text")return o;if(o.type==="audio")return{type:"input_audio",input_audio:{data:o.data,format:o.format}};if(o.type==="file")return{type:"file",file:o.file.type==="base64"?{file_data:o.file.data,filename:o.file.name}:{file_id:o.file.id}};if(o.type==="image")return{type:"image_url",image_url:{url:o.image.type==="base64"?o.image.data:o.image.url,detail:o.detail}};throw new Error(`Unsupported user message content type, value: ${JSON.stringify(o)}`)}function FIe(o){return{type:"userMessage",id:o.id,created_at:o.created_at,contents:o.contents,toJSON:()=>({type:"userMessage",id:o.id,created_at:o.created_at,contents:o.contents})}}function VMn(o){const s={type:"assistantMessage",id:o.id,created_at:o.created_at,text:o.text};return{...s,toJSON:()=>s}}function XMn(o){const s={type:"systemMessage",id:o.id,created_at:o.created_at,text:o.text};return{...s,toJSON:()=>s}}function QMn(o){return{type:"describe",id:o.id,created_at:o.created_at,text:o.text,executes:o.executes,toJSON:()=>({type:"describe",id:o.id,created_at:o.created_at,text:o.text,executes:o.executes.map(s=>s.toJSON())})}}function $Ie(o){return{type:"select",id:o.id,selection:o.selection,created_at:o.created_at,toJSON:()=>({type:"select",id:o.id,created_at:o.created_at,selection:o.selection.toJSON()})}}function JMn(o){return{type:"cancel",id:o.id,created_at:o.created_at,selection:o.selection,toJSON:()=>({type:"cancel",id:o.id,created_at:o.created_at,selection:o.selection.toJSON()})}}function jIe(o){return{type:"execute",protocol:o.operation.protocol,id:o.id,created_at:o.created_at,operation:o.operation,arguments:o.arguments,value:o.value,success:o.success,toJSON:()=>({type:"execute",id:o.id,created_at:o.created_at,protocol:o.operation.protocol,operation:o.operation.toJSON(),arguments:o.arguments,value:o.value,success:o.success})}}function ZMn(){const o={id:wk(),type:"initialize",created_at:new Date().toISOString()};return{id:o.id,type:o.type,created_at:o.created_at,toJSON:()=>o}}function tRn(o){const s=wk(),p=new Date().toISOString();return{type:"select",id:s,created_at:p,selection:o.selection,toJSON:()=>({type:"select",id:s,created_at:p,selection:o.selection.toJSON()}),toHistory:()=>$Ie({id:s,created_at:p,selection:o.selection})}}function eRn(o){const s=wk(),p=new Date().toISOString();return{type:"cancel",id:s,created_at:p,selection:o.selection,toJSON:()=>({type:"cancel",id:s,created_at:p,selection:o.selection.toJSON()})}}function nRn(o){const s=new Date().toISOString();return{type:"call",id:o.id,created_at:s,operation:o.operation,arguments:o.arguments,toJSON:()=>({type:"call",id:o.id,created_at:s,operation:o.operation.toJSON(),arguments:o.arguments})}}function rRn(o){const s=new Date().toISOString();return{type:"jsonParseError",id:o.id,created_at:s,operation:o.operation,arguments:o.arguments,errorMessage:o.errorMessage}}function iRn(o){const s=new Date().toISOString();return{type:"validate",id:o.id,created_at:s,operation:o.operation,result:o.result,toJSON:()=>({type:"validate",id:o.id,created_at:s,operation:o.operation.toJSON(),result:o.result})}}function mmt(o){const s=wk(),p=new Date().toISOString();return{type:"execute",id:s,created_at:p,protocol:o.operation.protocol,operation:o.operation,arguments:o.arguments,value:o.value,success:o.success,toJSON:()=>({type:"execute",id:s,created_at:p,protocol:o.operation.protocol,operation:o.operation.toJSON(),arguments:o.arguments,value:o.value,success:o.success}),toHistory:()=>jIe({id:s,created_at:p,...o})}}function aRn(o){const s=wk(),p=new Date().toISOString();return{type:"userMessage",id:s,created_at:p,contents:o.contents,toJSON:()=>({type:"userMessage",id:s,created_at:p,contents:o.contents}),toHistory:()=>FIe({id:s,created_at:p,contents:o.contents})}}function VFt(o){const s=wk(),p=new Date().toISOString();return{type:"assistantMessage",id:s,created_at:p,stream:o.stream,join:o.join,toJSON:()=>({type:"assistantMessage",id:s,created_at:p,done:o.done(),text:o.get()}),toHistory:()=>({type:"assistantMessage",id:s,created_at:p,text:o.get(),toJSON:()=>({type:"assistantMessage",id:s,created_at:p,text:o.get()})})}}function sRn(o){const s=wk(),p=new Date().toISOString();return{type:"describe",id:s,created_at:p,executes:o.executes,stream:o.stream,join:o.join,toJSON:()=>({type:"describe",id:s,created_at:p,executes:o.executes.map(y=>y.toJSON()),done:o.done(),text:o.get()}),toHistory:()=>({type:"describe",id:s,created_at:p,executes:o.executes,text:o.get(),toJSON:()=>({type:"describe",id:s,created_at:p,executes:o.executes.map(y=>y.toJSON()),text:o.get()})})}}function oRn(o){const s=wk(),p=new Date().toISOString();return{type:"request",id:s,created_at:p,source:o.source,body:o.body,options:o.options}}var IBt;(function(o){o.is=s=>typeof s=="object"&&s!==null&&typeof s.openapi=="string"&&s.openapi.startsWith("3.0")})(IBt||(IBt={}));var OBt;(function(o){o.is=s=>typeof s=="object"&&s!==null&&typeof s.openapi=="string"&&s.openapi.startsWith("3.1")})(OBt||(OBt={}));var NBt;(function(o){o.is=s=>typeof s=="object"&&s!==null&&typeof s.swagger=="string"&&s.swagger.startsWith("2.0")})(NBt||(NBt={}));var ymt;(function(o){o.reference=s=>s.split("/").filter((p,y)=>!!p.length&&!(y===0&&p==="#")).join(".")})(ymt||(ymt={}));var lC;(function(o){o.take=s=>p=>y=>{const C=s.get(p);if(C)return C;const N=y();return s.set(p,N),N}})(lC||(lC={}));var JF;(function(o){o.variable=s=>o.reserved(s)===!1&&/^[a-zA-Z_$][a-zA-Z_$0-9]*$/g.test(s),o.reserved=s=>cRn.has(s)})(JF||(JF={}));const cRn=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","package","return","super","switch","this","throw","true","try","typeof","var","void","while","with"]);var hC;(function(o){o.cascade=s=>{var C,N;const p=s.schema.$ref.split(s.prefix)[1].split("."),y=p.slice(0,s.escape?p.length:p.length-1).map((L,z,G)=>G.slice(0,z+1).join(".")).map(L=>{var z,G;return{key:L,description:(G=(z=s.components.schemas)==null?void 0:z[L])==null?void 0:G.description}}).reverse().filter((L,z)=>z===0||!!(L!=null&&L.description));if(!(!((C=s.schema.description)!=null&&C.length)&&y.length===0))return[...(N=s.schema.description)!=null&&N.length?[s.schema.description]:[],...y.map((L,z)=>L.description===void 0?`Current Type: {@link ${L.key}}`:`Description of the ${z===0&&s.escape?"current":"parent"} {@link ${L.key}} type:
|
|
31
31
|
|
|
32
32
|
`+L.description.split(`
|
|
33
33
|
`).map(G=>`> ${G}`).join(`
|
|
@@ -1449,8 +1449,8 @@ You have been provided with \`IValidation.IError[][]\` containing **previous his
|
|
|
1449
1449
|
- Redesign the entire AST structure using proper architectural patterns
|
|
1450
1450
|
- Enhance with comprehensive business context and realistic data
|
|
1451
1451
|
|
|
1452
|
-
**Success means: the error path never appears in future correction cycles.**`};var wDn={};const vDn=new HIe(()=>{var o;return SIe()?((o=wDn.LANG)==null?void 0:o.split(".")[0])??"en-US":navigator.language}),_Dn=new HIe(()=>Intl.DateTimeFormat().resolvedOptions().timeZone);function xDn(o){var y;if(((y=o==null?void 0:o.systemPrompt)==null?void 0:y.common)!==void 0)return o.systemPrompt.common(o);const s=(o==null?void 0:o.locale)??vDn.get(),p=(o==null?void 0:o.timezone)??_Dn.get();return I6.COMMON.replace("${locale}",s).replace("${timezone}",p).replace("${datetime}",new Date().toISOString())}const o$={write:xDn};function EDn(o){return typeof o.initialize=="function"}var tFt;(o=>{function s(p){return new TextDecoder().decode(p)}o.toUtf8=s})(tFt||(tFt={}));function zIe(o,s){return{accepted_prediction_tokens:(o.accepted_prediction_tokens??0)+(s.accepted_prediction_tokens??0),reasoning_tokens:(o.reasoning_tokens??0)+(s.reasoning_tokens??0),rejected_prediction_tokens:(o.rejected_prediction_tokens??0)+(s.rejected_prediction_tokens??0)}}function UIe(o,s){return{audio_tokens:(o.audio_tokens??0)+(s.audio_tokens??0),cached_tokens:(o.cached_tokens??0)+(s.cached_tokens??0)}}function
|
|
1453
|
-
`),life:C,previousValidationErrors:y})}async function DDn(o,s,p,y){var C,N,L;return VIe(o,{giveUp:()=>mmt({operation:s.operation,arguments:{},value:{name:"JsonParseError",message:`Invalid JSON format. The parsing failed after ${yk.RETRY} retries.`,arguments:s.arguments,errorMessage:s.errorMessage}}),operation:s.operation,toolCall:{id:s.id,arguments:s.arguments,result:s.errorMessage},systemPrompt:((L=(N=(C=o.config)==null?void 0:C.systemPrompt)==null?void 0:N.jsonParseError)==null?void 0:L.call(N,s))??I6.JSON_PARSE_ERROR.replace("${{ERROR_MESSAGE}}",s.errorMessage),life:y,previousValidationErrors:p})}function BDn(o,s){try{const p=JSON.parse(s.function.arguments);return nRn({id:s.id,operation:o,arguments:p})}catch(p){return rRn({id:s.id,operation:o,arguments:s.function.arguments,errorMessage:p instanceof Error?p.message:String(p)})}}async function VIe(o,s){var L,z,G,q,nt,tt;if(s.life<=0)return s.giveUp();const p=await o.request("call",{messages:[{role:"system",content:o$.write(o.config)},...o.histories.map(a$).flat(),{role:"user",content:o.prompt.contents.map(s$)},{role:"system",content:((G=(z=(L=o.config)==null?void 0:L.systemPrompt)==null?void 0:z.execute)==null?void 0:G.call(z,o.histories))??I6.EXECUTE},{role:"assistant",tool_calls:[{type:"function",id:s.toolCall.id,function:{name:s.operation.name,arguments:s.toolCall.arguments}}]},{role:"tool",content:s.toolCall.result,tool_call_id:s.toolCall.id},{role:"system",content:s.systemPrompt}],tools:[{type:"function",function:{name:s.operation.name,description:s.operation.function.description,parameters:"separated"in s.operation.function&&s.operation.function.separated!==void 0?((q=s.operation.function.separated)==null?void 0:q.llm)??{$defs:{},type:"object",properties:{},additionalProperties:!1,required:[]}:s.operation.function.parameters}}],tool_choice:"required"}),y=await _C.readAll(p),N=(tt=(nt=L3.merge(y).choices[0])==null?void 0:nt.message.tool_calls)==null?void 0:tt.find(et=>et.function.name===s.operation.name);return N===void 0?s.giveUp():YIe(o,s.operation,N,s.previousValidationErrors,s.life)}async function FDn(o,s){try{const p=await(async()=>{switch(s.protocol){case"class":return $Dn(o,s);case"http":return jDn(o,s);case"mcp":return HDn(o,s);default:throw new Error("Unknown protocol")}})();return mmt({operation:o.operation,arguments:o.arguments,value:p})}catch(p){return mmt({operation:o.operation,arguments:o.arguments,value:p instanceof Error?{...p,name:p.name,message:p.message}:p})}}async function $Dn(o,s){const p=s.controller.execute;return typeof p=="function"?await p({application:s.controller.application,function:s.function,arguments:o.arguments}):await p[s.function.name](o.arguments)}async function jDn(o,s){const p=s.controller.execute;return typeof p=="function"?await p({connection:s.controller.connection,application:s.controller.application,function:s.function,arguments:o.arguments}):await ZBt.propagate({connection:s.controller.connection,application:s.controller.application,function:s.function,input:o.arguments})}async function HDn(o,s){return s.controller.client.callTool({method:s.function.name,name:s.function.name,arguments:o.arguments}).then(p=>p.content)}var XFt={};Object.defineProperty(XFt,"__esModule",{value:!0});var u$=XFt._validateReport=void 0;const zDn=o=>{const s=p=>{if(o.length===0)return!0;const y=o[o.length-1].path;return p.length>y.length||y.substring(0,p.length)!==p};return(p,y)=>{var C;return p&&s(y.path)&&(y.value===void 0&&((C=y.description)!==null&&C!==void 0||(y.description=["The value at this path is `undefined`.","",`Please fill the \`${y.expected}\` typed value next time.`].join(`
|
|
1452
|
+
**Success means: the error path never appears in future correction cycles.**`};var wDn={};const vDn=new HIe(()=>{var o;return SIe()?((o=wDn.LANG)==null?void 0:o.split(".")[0])??"en-US":navigator.language}),_Dn=new HIe(()=>Intl.DateTimeFormat().resolvedOptions().timeZone);function xDn(o){var y;if(((y=o==null?void 0:o.systemPrompt)==null?void 0:y.common)!==void 0)return o.systemPrompt.common(o);const s=(o==null?void 0:o.locale)??vDn.get(),p=(o==null?void 0:o.timezone)??_Dn.get();return I6.COMMON.replace("${locale}",s).replace("${timezone}",p).replace("${datetime}",new Date().toISOString())}const o$={write:xDn};function EDn(o){return typeof o.initialize=="function"}class TDn extends Error{constructor(s){super(s),this.name="AsyncQueueClosedError"}}class kDn{constructor(){this.queue=[],this.resolvers=[],this.closeResolvers=[],this.emptyResolvers=[],this.closed=!1}enqueue(s){var p;if(this.closed){console.error(new TDn("Cannot enqueue item: queue is closed."));return}this.queue.push(s),this.resolvers.length>0&&((p=this.resolvers.shift())==null||p({value:this.queue.shift(),done:!1}))}async dequeue(){const s=this.isEmpty()?this.isClosed()?{value:void 0,done:!0}:null:{value:this.queue.shift(),done:!1};return this.isEmpty()&&this.emptyResolvers.length!==0&&(this.emptyResolvers.forEach(p=>p()),this.emptyResolvers=[]),s!==null?s:new Promise(p=>this.resolvers.push(p))}isEmpty(){return this.queue.length===0}isClosed(){return this.closed}done(){return this.isClosed()&&this.isEmpty()}close(){var s;for(this.closed=!0;this.resolvers.length>0;)(s=this.resolvers.shift())==null||s({value:void 0,done:!0});this.closeResolvers.forEach(p=>p())}async waitUntilEmpty(){return this.isEmpty()?Promise.resolve():new Promise(s=>{this.emptyResolvers.push(s)})}async waitClosed(){return this.isClosed()?Promise.resolve():new Promise(s=>{this.closeResolvers.push(s)})}}var tFt;(o=>{function s(p){return new TextDecoder().decode(p)}o.toUtf8=s})(tFt||(tFt={}));function zIe(o,s){return{accepted_prediction_tokens:(o.accepted_prediction_tokens??0)+(s.accepted_prediction_tokens??0),reasoning_tokens:(o.reasoning_tokens??0)+(s.reasoning_tokens??0),rejected_prediction_tokens:(o.rejected_prediction_tokens??0)+(s.rejected_prediction_tokens??0)}}function UIe(o,s){return{audio_tokens:(o.audio_tokens??0)+(s.audio_tokens??0),cached_tokens:(o.cached_tokens??0)+(s.cached_tokens??0)}}function SDn(o,s){return{prompt_tokens:(o.prompt_tokens??0)+(s.prompt_tokens??0),completion_tokens:(o.completion_tokens??0)+(s.completion_tokens??0),total_tokens:(o.total_tokens??0)+(s.total_tokens??0),completion_tokens_details:zIe(o.completion_tokens_details??{accepted_prediction_tokens:0,reasoning_tokens:0,rejected_prediction_tokens:0},s.completion_tokens_details??{accepted_prediction_tokens:0,reasoning_tokens:0,rejected_prediction_tokens:0}),prompt_tokens_details:UIe(o.prompt_tokens_details??{audio_tokens:0,cached_tokens:0},s.prompt_tokens_details??{audio_tokens:0,cached_tokens:0})}}const CDn={sum:SDn,sumCompletionTokenDetail:zIe,sumPromptTokenDetail:UIe};function ADn(o){const s=o instanceof Uint8Array?tFt.toUtf8(o):o;return JSON.parse(s)}function qIe(o,s){const p=o.choices;s.choices.forEach(C=>{const N=p[C.index];if(N!=null){p[C.index]=WIe(N,C);return}p[C.index]={index:C.index,finish_reason:C.finish_reason??null,logprobs:C.logprobs??null,message:{tool_calls:C.delta.tool_calls!==void 0?C.delta.tool_calls.reduce((L,z)=>{var G,q;return L[z.index]={id:z.id??"",type:"function",function:{name:((G=z.function)==null?void 0:G.name)??"",arguments:((q=z.function)==null?void 0:q.arguments)??""}},L},[]):void 0,content:C.delta.content??null,refusal:C.delta.refusal??null,role:"assistant"}}});const y=s.usage==null?o.usage:o.usage==null?s.usage:CDn.sum(o.usage,s.usage);return{...o,choices:p,usage:y}}function IDn(o){const s=o[0];if(s===void 0)throw new Error("No chunks received");const p=o.reduce(qIe,{id:s.id,choices:[],created:s.created,model:s.model,object:"chat.completion",usage:void 0,service_tier:s.service_tier,system_fingerprint:s.system_fingerprint});return p.choices.forEach(y=>{var C;(C=y.message.tool_calls)==null||C.forEach(N=>{N.function.arguments===""&&(N.function.arguments="{}")})}),p}function WIe(o,s){var p;if(o.finish_reason==null&&s.finish_reason!=null&&(o.finish_reason=s.finish_reason),o.logprobs==null&&s.logprobs!=null&&(o.logprobs=s.logprobs),s.delta.content!=null&&(o.message.content==null?o.message.content=s.delta.content:o.message.content+=s.delta.content),s.delta.refusal!=null&&(o.message.refusal==null?o.message.refusal=s.delta.refusal:o.message.refusal+=s.delta.refusal),s.delta.tool_calls!=null){(p=o.message).tool_calls??(p.tool_calls=[]);const y=o.message.tool_calls;s.delta.tool_calls.forEach(C=>{var L,z;const N=y[C.index];if(N!=null){y[C.index]=KIe(N,C);return}y[C.index]={id:C.id??"",type:"function",function:{name:((L=C.function)==null?void 0:L.name)??"",arguments:((z=C.function)==null?void 0:z.arguments)??""}}})}return o}function KIe(o,s){return s.function!=null&&(o.function.arguments+=s.function.arguments??"",o.function.name+=s.function.name??""),o.id+=s.id??"",o}const L3={transformCompletionChunk:ADn,accumulate:qIe,merge:IDn,mergeChoice:WIe,mergeToolCalls:KIe};class Xmt{constructor(){this.queue=new kDn,this.consumer=new ReadableStream({pull:async s=>{const{value:p,done:y}=await this.queue.dequeue();if(y===!0){s.close();return}s.enqueue(p)}})}produce(s){this.queue.enqueue(s)}close(){this.queue.close()}done(){return this.queue.done()}async waitClosed(){await this.queue.waitClosed()}async waitUntilEmpty(){await this.queue.waitUntilEmpty()}}async function ODn(o){const s=o.getReader(),p=[];for(;;){const{done:y,value:C}=await s.read();if(y)break;p.push(C)}return p}async function NDn(o,s,p){const y=o.getReader(),C=c$(y);let N=p??null;for await(const L of C){if(N===null){N=L;continue}N=s(N,L)}return N}function PDn(o){return new ReadableStream({start:p=>{p.enqueue(o),p.close()}})}async function*c$(o){for(;;){const{done:s,value:p}=await o.read();if(s)break;yield p}}function LDn(o,s){const p=o.getReader();return new ReadableStream({pull:async y=>{const{done:C,value:N}=await p.read();C?y.close():y.enqueue(s(N))}})}const _C={readAll:ODn,reduce:NDn,from:PDn,transform:LDn};function Qmt(o){return{operation:o.operation,reason:o.reason,toJSON:()=>({operation:o.operation.toJSON(),reason:o.reason})}}function GIe(o,s){const p=o.stack.findIndex(N=>N.operation.name===s.name);if(p===-1)return;const y=o.stack[p];o.stack.splice(p,1);const C=eRn({selection:Qmt({operation:y.operation,reason:s.reason})});o.dispatch(C)}async function MDn(o,s){var G,q,nt,tt,et,st;const p=await o.request("call",{messages:[{role:"system",content:o$.write(o.config)},...o.histories.map(a$).flat(),{role:"user",content:o.prompt.contents.map(s$)},...((q=(G=o.config)==null?void 0:G.systemPrompt)==null?void 0:q.execute)===null?[]:[{role:"system",content:((et=(tt=(nt=o.config)==null?void 0:nt.systemPrompt)==null?void 0:tt.execute)==null?void 0:et.call(tt,o.histories))??I6.EXECUTE}]],tools:s.map(at=>({type:"function",function:{name:at.name,description:at.function.description,parameters:"separated"in at.function&&at.function.separated!==void 0?at.function.separated.llm??{type:"object",properties:{},required:[],additionalProperties:!1,$defs:{}}:at.function.parameters}})),tool_choice:"auto"}),y=[],N=await _C.reduce(p,async(at,It)=>{const Rt=await at,At=ee=>{var ae;for(const ve of ee){if(ve.finish_reason!=null){(ae=y[ve.index])==null||ae.mpsc.close();continue}if(ve.delta.content==null)continue;if(y[ve.index]!=null){y[ve.index].content+=ve.delta.content,y[ve.index].mpsc.produce(ve.delta.content);continue}const hn=new Xmt;y[ve.index]={content:ve.delta.content,mpsc:hn},hn.produce(ve.delta.content);const pe=VFt({stream:c$(hn.consumer.getReader()),done:()=>hn.done(),get:()=>{var pn;return((pn=y[ve.index])==null?void 0:pn.content)??""},join:async()=>(await hn.waitClosed(),y[ve.index].content)});o.dispatch(pe)}};return Rt.object==="chat.completion.chunk"?(At([Rt,It].flatMap(ee=>ee.choices)),L3.merge([Rt,It])):(At(It.choices),L3.accumulate(Rt,It))}),L=[],z=((st=o.config)==null?void 0:st.retry)??yk.RETRY;for(const at of N.choices)for(const It of at.message.tool_calls??[])if(It.type==="function"){const Rt=s.find(ee=>ee.name===It.function.name);if(Rt===void 0)continue;const At=await YIe(o,Rt,It,[],z);o.dispatch(At),L.push(At),EDn(o)&&GIe(o,{name:At.operation.name,reason:"completed"})}return L}async function YIe(o,s,p,y,C){const N=BDn(s,p);if(o.dispatch(N),N.type==="jsonParseError")return DDn(o,N,y,C-1);const L=s.function.validate(N.arguments);if(L.success===!1){const z=iRn({id:p.id,operation:s,result:L});return o.dispatch(z),RDn(o,N,z,[...y,z],C-1)}return FDn(N,s)}async function RDn(o,s,p,y,C){var N,L,z;return VIe(o,{giveUp:()=>mmt({operation:s.operation,arguments:s.arguments,value:{name:"ValidationError",message:`Invalid arguments. The validation failed after ${yk.RETRY} retries.`,errors:p.result.errors},success:!1}),operation:s.operation,toolCall:{id:s.id,arguments:JSON.stringify(s.arguments),result:JSON.stringify(p.result.errors)},systemPrompt:((z=(L=(N=o.config)==null?void 0:N.systemPrompt)==null?void 0:L.validate)==null?void 0:z.call(L,y.slice(0,-1)))??[I6.VALIDATE,...y.length>1?["",I6.VALIDATE_REPEATED.replace("${{HISTORICAL_ERRORS}}",JSON.stringify(y.slice(0,-1).map(G=>G.result.errors)))]:[]].join(`
|
|
1453
|
+
`),life:C,previousValidationErrors:y})}async function DDn(o,s,p,y){var C,N,L;return VIe(o,{giveUp:()=>mmt({operation:s.operation,arguments:{},value:{name:"JsonParseError",message:`Invalid JSON format. The parsing failed after ${yk.RETRY} retries.`,arguments:s.arguments,errorMessage:s.errorMessage},success:!1}),operation:s.operation,toolCall:{id:s.id,arguments:s.arguments,result:s.errorMessage},systemPrompt:((L=(N=(C=o.config)==null?void 0:C.systemPrompt)==null?void 0:N.jsonParseError)==null?void 0:L.call(N,s))??I6.JSON_PARSE_ERROR.replace("${{ERROR_MESSAGE}}",s.errorMessage),life:y,previousValidationErrors:p})}function BDn(o,s){try{const p=JSON.parse(s.function.arguments);return nRn({id:s.id,operation:o,arguments:p})}catch(p){return rRn({id:s.id,operation:o,arguments:s.function.arguments,errorMessage:p instanceof Error?p.message:String(p)})}}async function VIe(o,s){var L,z,G,q,nt,tt;if(s.life<=0)return s.giveUp();const p=await o.request("call",{messages:[{role:"system",content:o$.write(o.config)},...o.histories.map(a$).flat(),{role:"user",content:o.prompt.contents.map(s$)},{role:"system",content:((G=(z=(L=o.config)==null?void 0:L.systemPrompt)==null?void 0:z.execute)==null?void 0:G.call(z,o.histories))??I6.EXECUTE},{role:"assistant",tool_calls:[{type:"function",id:s.toolCall.id,function:{name:s.operation.name,arguments:s.toolCall.arguments}}]},{role:"tool",content:s.toolCall.result,tool_call_id:s.toolCall.id},{role:"system",content:s.systemPrompt}],tools:[{type:"function",function:{name:s.operation.name,description:s.operation.function.description,parameters:"separated"in s.operation.function&&s.operation.function.separated!==void 0?((q=s.operation.function.separated)==null?void 0:q.llm)??{$defs:{},type:"object",properties:{},additionalProperties:!1,required:[]}:s.operation.function.parameters}}],tool_choice:"required"}),y=await _C.readAll(p),N=(tt=(nt=L3.merge(y).choices[0])==null?void 0:nt.message.tool_calls)==null?void 0:tt.find(et=>et.function.name===s.operation.name);return N===void 0?s.giveUp():YIe(o,s.operation,N,s.previousValidationErrors,s.life)}async function FDn(o,s){try{const p=await(async()=>{switch(s.protocol){case"class":return $Dn(o,s);case"http":return jDn(o,s);case"mcp":return HDn(o,s);default:throw new Error("Unknown protocol")}})();return mmt({operation:o.operation,arguments:o.arguments,value:p,success:!0})}catch(p){return mmt({operation:o.operation,arguments:o.arguments,value:p instanceof Error?{...p,name:p.name,message:p.message}:p,success:!1})}}async function $Dn(o,s){const p=s.controller.execute;return typeof p=="function"?await p({application:s.controller.application,function:s.function,arguments:o.arguments}):await p[s.function.name](o.arguments)}async function jDn(o,s){const p=s.controller.execute;return typeof p=="function"?await p({connection:s.controller.connection,application:s.controller.application,function:s.function,arguments:o.arguments}):await ZBt.propagate({connection:s.controller.connection,application:s.controller.application,function:s.function,input:o.arguments})}async function HDn(o,s){return s.controller.client.callTool({method:s.function.name,name:s.function.name,arguments:o.arguments}).then(p=>p.content)}var XFt={};Object.defineProperty(XFt,"__esModule",{value:!0});var u$=XFt._validateReport=void 0;const zDn=o=>{const s=p=>{if(o.length===0)return!0;const y=o[o.length-1].path;return p.length>y.length||y.substring(0,p.length)!==p};return(p,y)=>{var C;return p&&s(y.path)&&(y.value===void 0&&((C=y.description)!==null&&C!==void 0||(y.description=["The value at this path is `undefined`.","",`Please fill the \`${y.expected}\` typed value next time.`].join(`
|
|
1454
1454
|
`))),o.push(y)),!1}};u$=XFt._validateReport=zDn;const qDt={functions:[{name:"cancelFunctions",parameters:{description:` Properties of the function
|
|
1455
1455
|
|
|
1456
1456
|
------------------------------
|
|
@@ -1471,7 +1471,7 @@ only one thing due to lack of specificity or homogeneity of candidate functions.
|
|
|
1471
1471
|
|
|
1472
1472
|
Additionally, if you A.I. agent wants to cancel same function multiply, you can
|
|
1473
1473
|
do it by assigning the same function name multiply in the \`functions\` property.`,validate:(()=>{const o=z=>Array.isArray(z.functions)&&z.functions.every(G=>typeof G=="object"&&G!==null&&s(G)),s=z=>typeof z.reason=="string"&&typeof z.name=="string",p=(z,G,q=!0)=>[(Array.isArray(z.functions)||L(q,{path:G+".functions",expected:"Array<___IChatFunctionReference>",value:z.functions}))&&z.functions.map((nt,tt)=>(typeof nt=="object"&&nt!==null||L(q,{path:G+".functions["+tt+"]",expected:"___IChatFunctionReference",value:nt}))&&y(nt,G+".functions["+tt+"]",q)||L(q,{path:G+".functions["+tt+"]",expected:"___IChatFunctionReference",value:nt})).every(nt=>nt)||L(q,{path:G+".functions",expected:"Array<___IChatFunctionReference>",value:z.functions})].every(nt=>nt),y=(z,G,q=!0)=>[typeof z.reason=="string"||L(q,{path:G+".reason",expected:"string",value:z.reason}),typeof z.name=="string"||L(q,{path:G+".name",expected:"string",value:z.name})].every(nt=>nt),C=z=>typeof z=="object"&&z!==null&&o(z);let N,L;return z=>{if(C(z)===!1){N=[],L=u$(N),((q,nt,tt=!0)=>(typeof q=="object"&&q!==null||L(!0,{path:nt+"",expected:"__IChatFunctionReference.IProps",value:q}))&&p(q,nt+"",!0)||L(!0,{path:nt+"",expected:"__IChatFunctionReference.IProps",value:q}))(z,"$input",!0);const G=N.length===0;return G?{success:G,data:z}:{success:G,errors:N,data:z}}return{success:!0,data:z}}})()}]};async function UDn(o){var y;if(o.operations.divided===void 0)return Hbt(o,o.operations.array,0);const s=o.operations.divided.map(()=>[]),p=[];if(await Promise.all(o.operations.divided.map(async(C,N)=>Hbt({...o,stack:s[N],dispatch:L=>(p.push(L),L)},C,0))),(((y=o.config)==null?void 0:y.eliticism)??yk.ELITICISM)===!0&&s.some(C=>C.length!==0))return Hbt(o,s.flat().map(C=>o.operations.group.get(C.operation.controller.name).get(C.operation.function.name)),0);{const C=p.filter(N=>N.type==="cancel");(C.length!==0?C:p).forEach(o.dispatch)}}async function Hbt(o,s,p,y){var z,G,q,nt;const C=await o.request("cancel",{messages:[{role:"system",content:o$.write(o.config)},{role:"assistant",tool_calls:[{type:"function",id:"getApiFunctions",function:{name:"getApiFunctions",arguments:JSON.stringify({})}}]},{role:"tool",tool_call_id:"getApiFunctions",content:JSON.stringify(s.map(tt=>({name:tt.name,description:tt.function.description,...tt.protocol==="http"?{method:tt.function.method,path:tt.function.path,tags:tt.function.tags}:{}})))},...o.histories.map(a$).flat(),{role:"user",content:o.prompt.contents.map(s$)},{role:"system",content:((q=(G=(z=o.config)==null?void 0:z.systemPrompt)==null?void 0:G.cancel)==null?void 0:q.call(G,o.histories))??I6.CANCEL},...qDn(y??[])],tools:[{type:"function",function:{name:qDt.functions[0].name,description:qDt.functions[0].description,parameters:qDt.functions[0].parameters}}],tool_choice:p===0?"auto":"required"}),N=await _C.readAll(C),L=L3.merge(N);if(p++<(((nt=o.config)==null?void 0:nt.retry)??yk.RETRY)){const tt=[];for(const et of L.choices)for(const st of et.message.tool_calls??[]){if(st.function.name!=="cancelFunctions")continue;const at=JSON.parse(st.function.arguments),It=(()=>{const Rt=pn=>Array.isArray(pn.functions)&&pn.functions.every(Yn=>typeof Yn=="object"&&Yn!==null&&At(Yn)),At=pn=>typeof pn.reason=="string"&&typeof pn.name=="string",ee=(pn,Yn,Ln=!0)=>[(Array.isArray(pn.functions)||pe(Ln,{path:Yn+".functions",expected:"Array<___IChatFunctionReference>",value:pn.functions}))&&pn.functions.map((zn,Qn)=>(typeof zn=="object"&&zn!==null||pe(Ln,{path:Yn+".functions["+Qn+"]",expected:"___IChatFunctionReference",value:zn}))&&ae(zn,Yn+".functions["+Qn+"]",Ln)||pe(Ln,{path:Yn+".functions["+Qn+"]",expected:"___IChatFunctionReference",value:zn})).every(zn=>zn)||pe(Ln,{path:Yn+".functions",expected:"Array<___IChatFunctionReference>",value:pn.functions})].every(zn=>zn),ae=(pn,Yn,Ln=!0)=>[typeof pn.reason=="string"||pe(Ln,{path:Yn+".reason",expected:"string",value:pn.reason}),typeof pn.name=="string"||pe(Ln,{path:Yn+".name",expected:"string",value:pn.name})].every(zn=>zn),ve=pn=>typeof pn=="object"&&pn!==null&&Rt(pn);let hn,pe;return pn=>{if(ve(pn)===!1){hn=[],pe=u$(hn),((Ln,zn,Qn=!0)=>(typeof Ln=="object"&&Ln!==null||pe(!0,{path:zn+"",expected:"__IChatFunctionReference.IProps",value:Ln}))&&ee(Ln,zn+"",!0)||pe(!0,{path:zn+"",expected:"__IChatFunctionReference.IProps",value:Ln}))(pn,"$input",!0);const Yn=hn.length===0;return Yn?{success:Yn,data:pn}:{success:Yn,errors:hn,data:pn}}return{success:!0,data:pn}}})()(at);It.success===!1&&tt.push({id:st.id,name:st.function.name,validation:It})}if(tt.length>0)return Hbt(o,s,p,tt)}for(const tt of L.choices)if(tt.message.tool_calls!=null)for(const et of tt.message.tool_calls){if(et.type!=="function")continue;if(et.function.name!=="cancelFunctions")continue;const st=(()=>{const at=At=>Array.isArray(At.functions)&&At.functions.every(ee=>typeof ee=="object"&&ee!==null&&It(ee)),It=At=>typeof At.reason=="string"&&typeof At.name=="string",Rt=At=>typeof At=="object"&&At!==null&&at(At);return At=>(At=JSON.parse(At),Rt(At)?At:null)})()(et.function.arguments);if(st!==null)for(const at of st.functions)GIe(o,at)}}function qDn(o){return o.map(s=>[{role:"assistant",tool_calls:[{type:"function",id:s.id,function:{name:s.name,arguments:JSON.stringify(s.validation.data)}}]},{role:"tool",content:JSON.stringify(s.validation.errors),tool_call_id:s.id},{role:"system",content:["You A.I. assistant has composed wrong typed arguments.","","Correct it at the next function calling."].join(`
|
|
1474
|
-
`)}]).flat()}async function WDn(o,s){var C,N,L;if(s.length===0)return;const p=await o.request("describe",{messages:[{role:"system",content:o$.write(o.config)},...s.map(a$).flat(),{role:"system",content:((L=(N=(C=o.config)==null?void 0:C.systemPrompt)==null?void 0:N.describe)==null?void 0:L.call(N,s))??I6.DESCRIBE}]}),y=[];await _C.reduce(p,async(z,G)=>{const q=await z,nt=tt=>{for(const et of tt){if(et.finish_reason!=null){y[et.index].mpsc.close();continue}if(et.delta.content==null)continue;if(y[et.index]!=null){y[et.index].content+=et.delta.content,y[et.index].mpsc.produce(et.delta.content);continue}const st=new
|
|
1474
|
+
`)}]).flat()}async function WDn(o,s){var C,N,L;if(s.length===0)return;const p=await o.request("describe",{messages:[{role:"system",content:o$.write(o.config)},...s.map(a$).flat(),{role:"system",content:((L=(N=(C=o.config)==null?void 0:C.systemPrompt)==null?void 0:N.describe)==null?void 0:L.call(N,s))??I6.DESCRIBE}]}),y=[];await _C.reduce(p,async(z,G)=>{const q=await z,nt=tt=>{for(const et of tt){if(et.finish_reason!=null){y[et.index].mpsc.close();continue}if(et.delta.content==null)continue;if(y[et.index]!=null){y[et.index].content+=et.delta.content,y[et.index].mpsc.produce(et.delta.content);continue}const st=new Xmt;y[et.index]={content:et.delta.content,mpsc:st},st.produce(et.delta.content);const at=sRn({executes:s,stream:c$(st.consumer.getReader()),done:()=>st.done(),get:()=>{var It;return((It=y[et.index])==null?void 0:It.content)??""},join:async()=>(await st.waitClosed(),y[et.index].content)});o.dispatch(at)}};return q.object==="chat.completion.chunk"?(nt([q,G].flatMap(tt=>tt.choices)),L3.merge([q,G])):(nt(G.choices),L3.accumulate(q,G))})}const Cbt=[{name:"getApiFunctions",parameters:{description:"Current Type: {@link object}",type:"object",properties:{},required:[],additionalProperties:!1,$defs:{IHttpLlmFunctionchatgpt:{description:`LLM function calling schema from HTTP (OpenAPI) operation.
|
|
1475
1475
|
|
|
1476
1476
|
\`IHttpLlmFunction\` is a data structure representing a function converted from
|
|
1477
1477
|
the {@link OpenApi.IOperation OpenAPI operation}, used for the LLM (Large
|
|
@@ -1807,7 +1807,7 @@ call this \`getApiFunctions()\` to get the list of candidate API functions
|
|
|
1807
1807
|
provided from this application.
|
|
1808
1808
|
|
|
1809
1809
|
Also, user just wants to list up every remote API functions that can be
|
|
1810
|
-
called from the backend server, utilize this function too.`,validate:(()=>{const o=N=>!0,s=(N,L,z=!0)=>!0,p=N=>typeof N=="object"&&N!==null&&Array.isArray(N)===!1&&o();let y,C;return N=>{if(p(N)===!1){y=[],C=u$(y),((z,G,q=!0)=>(typeof z=="object"&&z!==null&&Array.isArray(z)===!1||C(!0,{path:G+"",expected:"object",value:z}))&&s(z,G+"",!0)||C(!0,{path:G+"",expected:"object",value:z}))(N,"$input",!0);const L=y.length===0;return L?{success:L,data:N}:{success:L,errors:y,data:N}}return{success:!0,data:N}}})()}][0];async function KDn(o){var C,N,L;const s=await o.request("initialize",{messages:[{role:"system",content:o$.write(o.config)},...o.histories.map(a$).flat(),{role:"user",content:o.prompt.contents.map(s$)},{role:"system",content:((L=(N=(C=o.config)==null?void 0:C.systemPrompt)==null?void 0:N.initialize)==null?void 0:L.call(N,o.histories))??I6.INITIALIZE}],tools:[{type:"function",function:{name:Cbt.name,description:Cbt.description,parameters:Cbt.parameters}}],tool_choice:"auto"}),p=[],y=await _C.reduce(s,async(z,G)=>{const q=await z,nt=tt=>{var et;for(const st of tt){if(st.finish_reason!=null){(et=p[st.index])==null||et.mpsc.close();continue}if(st.delta.content==null||st.delta.content.length===0)continue;if(p[st.index]!=null){p[st.index].content+=st.delta.content,p[st.index].mpsc.produce(st.delta.content);continue}const at=new
|
|
1810
|
+
called from the backend server, utilize this function too.`,validate:(()=>{const o=N=>!0,s=(N,L,z=!0)=>!0,p=N=>typeof N=="object"&&N!==null&&Array.isArray(N)===!1&&o();let y,C;return N=>{if(p(N)===!1){y=[],C=u$(y),((z,G,q=!0)=>(typeof z=="object"&&z!==null&&Array.isArray(z)===!1||C(!0,{path:G+"",expected:"object",value:z}))&&s(z,G+"",!0)||C(!0,{path:G+"",expected:"object",value:z}))(N,"$input",!0);const L=y.length===0;return L?{success:L,data:N}:{success:L,errors:y,data:N}}return{success:!0,data:N}}})()}][0];async function KDn(o){var C,N,L;const s=await o.request("initialize",{messages:[{role:"system",content:o$.write(o.config)},...o.histories.map(a$).flat(),{role:"user",content:o.prompt.contents.map(s$)},{role:"system",content:((L=(N=(C=o.config)==null?void 0:C.systemPrompt)==null?void 0:N.initialize)==null?void 0:L.call(N,o.histories))??I6.INITIALIZE}],tools:[{type:"function",function:{name:Cbt.name,description:Cbt.description,parameters:Cbt.parameters}}],tool_choice:"auto"}),p=[],y=await _C.reduce(s,async(z,G)=>{const q=await z,nt=tt=>{var et;for(const st of tt){if(st.finish_reason!=null){(et=p[st.index])==null||et.mpsc.close();continue}if(st.delta.content==null||st.delta.content.length===0)continue;if(p[st.index]!=null){p[st.index].content+=st.delta.content,p[st.index].mpsc.produce(st.delta.content);continue}const at=new Xmt;p[st.index]={content:st.delta.content,mpsc:at},at.produce(st.delta.content);const It=VFt({stream:c$(at.consumer.getReader()),done:()=>at.done(),get:()=>p[st.index].content,join:async()=>(await at.waitClosed(),p[st.index].content)});o.dispatch(It)}};return q.object==="chat.completion.chunk"?(nt([q,G].flatMap(tt=>tt.choices)),L3.merge([q,G])):(nt(G.choices),L3.accumulate(q,G))});if(y===null)throw new Error("No completion received");y.choices.some(z=>z.message.tool_calls!=null&&z.message.tool_calls.some(G=>G.type==="function"&&G.function.name===Cbt.name))&&await o.initialize()}function GDn(o,s){const p=o.operations.flat.get(s.name);if(p===void 0)return;const y=Qmt({operation:p,reason:s.reason});o.stack.push(y);const C=tRn({selection:y});o.dispatch(C)}const WDt={functions:[{name:"selectFunctions",parameters:{description:` Properties of the function
|
|
1811
1811
|
|
|
1812
1812
|
------------------------------
|
|
1813
1813
|
|
|
@@ -1827,8 +1827,8 @@ them all into the \`functions\` property.
|
|
|
1827
1827
|
Also, if you A.I. agent can't specify a specific function to call due to lack
|
|
1828
1828
|
of specificity or homogeneity of candidate functions, just assign all of them
|
|
1829
1829
|
by in the\` functions\` property\` too. Instead, when you A.I. agent can specify
|
|
1830
|
-
a specific function to call, the others would be eliminated.`,validate:(()=>{const o=z=>Array.isArray(z.functions)&&z.functions.every(G=>typeof G=="object"&&G!==null&&s(G)),s=z=>typeof z.reason=="string"&&typeof z.name=="string",p=(z,G,q=!0)=>[(Array.isArray(z.functions)||L(q,{path:G+".functions",expected:"Array<___IChatFunctionReference>",value:z.functions}))&&z.functions.map((nt,tt)=>(typeof nt=="object"&&nt!==null||L(q,{path:G+".functions["+tt+"]",expected:"___IChatFunctionReference",value:nt}))&&y(nt,G+".functions["+tt+"]",q)||L(q,{path:G+".functions["+tt+"]",expected:"___IChatFunctionReference",value:nt})).every(nt=>nt)||L(q,{path:G+".functions",expected:"Array<___IChatFunctionReference>",value:z.functions})].every(nt=>nt),y=(z,G,q=!0)=>[typeof z.reason=="string"||L(q,{path:G+".reason",expected:"string",value:z.reason}),typeof z.name=="string"||L(q,{path:G+".name",expected:"string",value:z.name})].every(nt=>nt),C=z=>typeof z=="object"&&z!==null&&o(z);let N,L;return z=>{if(C(z)===!1){N=[],L=u$(N),((q,nt,tt=!0)=>(typeof q=="object"&&q!==null||L(!0,{path:nt+"",expected:"__IChatFunctionReference.IProps",value:q}))&&p(q,nt+"",!0)||L(!0,{path:nt+"",expected:"__IChatFunctionReference.IProps",value:q}))(z,"$input",!0);const G=N.length===0;return G?{success:G,data:z}:{success:G,errors:N,data:z}}return{success:!0,data:z}}})()}]};async function YDn(o){var y;if(o.operations.divided===void 0)return zbt(o,o.operations.array,0);const s=o.operations.divided.map(()=>[]),p=[];if(await Promise.all(o.operations.divided.map(async(C,N)=>zbt({...o,stack:s[N],dispatch:L=>(p.push(L),L)},C,0))),(((y=o.config)==null?void 0:y.eliticism)??yk.ELITICISM)===!0&&s.some(C=>C.length!==0))return zbt(o,s.flat().map(C=>o.operations.group.get(C.operation.controller.name).get(C.operation.function.name)),0);{const C=p.filter(N=>N.type==="select");(C.length!==0?C:p).forEach(o.dispatch)}}async function zbt(o,s,p,y){var G,q,nt,tt;const C=await o.request("select",{messages:[{role:"system",content:o$.write(o.config)},{role:"assistant",tool_calls:[{type:"function",id:"getApiFunctions",function:{name:"getApiFunctions",arguments:JSON.stringify({})}}]},{role:"tool",tool_call_id:"getApiFunctions",content:JSON.stringify(s.map(et=>({name:et.name,description:et.function.description,...et.protocol==="http"?{method:et.function.method,path:et.function.path,tags:et.function.tags}:{}})))},...o.histories.map(a$).flat(),{role:"user",content:o.prompt.contents.map(s$)},{role:"system",content:((nt=(q=(G=o.config)==null?void 0:G.systemPrompt)==null?void 0:q.select)==null?void 0:nt.call(q,o.histories))??I6.SELECT},...VDn(y??[])],tools:[{type:"function",function:{name:WDt.functions[0].name,description:WDt.functions[0].description,parameters:WDt.functions[0].parameters}}],tool_choice:p===0?"auto":"required"}),N=[],z=await _C.reduce(C,async(et,st)=>{const at=await et,It=Rt=>{var At;for(const ee of Rt){if(ee.finish_reason!=null){(At=N[ee.index])==null||At.mpsc.close();continue}if(ee.delta.content==null)continue;if(N[ee.index]!=null){N[ee.index].content+=ee.delta.content,N[ee.index].mpsc.produce(ee.delta.content);continue}const ae=new
|
|
1831
|
-
`)}]).flat()}function XDn(o){return async s=>{if(s.ready()===!1){if((o==null?void 0:o.initialize)!==!0&&typeof(o==null?void 0:o.initialize)!="function")await s.initialize();else if(await(typeof(o==null?void 0:o.initialize)=="function"?o.initialize:KDn)(s),s.ready()===!1)return}if(s.stack.length!==0&&await((o==null?void 0:o.cancel)??UDn)(s),await((o==null?void 0:o.select)??YDn)(s),s.stack.length!==0)for(;;){const p=await((o==null?void 0:o.call)??MDn)(s,s.stack.map(y=>y.operation));if((o==null?void 0:o.describe)!==null&&(o==null?void 0:o.describe)!==!1&&await(typeof(o==null?void 0:o.describe)=="function"?o.describe:WDn)(s,p),p.length===0||s.stack.length===0)break}}}function QDn(o){return o.history.type==="userMessage"?tBn({history:o.history}):o.history.type==="assistantMessage"?JDn({history:o.history}):o.history.type==="systemMessage"?ZDn({history:o.history}):o.history.type==="select"?eBn({operations:o.operations,history:o.history}):o.history.type==="cancel"?nBn({operations:o.operations,history:o.history}):o.history.type==="execute"?XIe({operations:o.operations,history:o.history}):rBn({operations:o.operations,history:o.history})}function JDn(o){return VMn(o.history)}function ZDn(o){return XMn(o.history)}function tBn(o){return FIe(o.history)}function eBn(o){return $Ie({id:o.history.id,created_at:o.history.created_at,selection:Xmt({operation:QFt({operations:o.operations,input:o.history.selection.operation}),reason:o.history.selection.reason})})}function nBn(o){return JMn({id:o.history.id,created_at:o.history.created_at,selection:Xmt({operation:QFt({operations:o.operations,input:o.history.selection.operation}),reason:o.history.selection.reason})})}function XIe(o){return jIe({id:o.history.id,created_at:o.history.created_at,operation:QFt({operations:o.operations,input:o.history.operation}),arguments:o.history.arguments,value:o.history.value})}function rBn(o){return QMn({id:o.history.id,created_at:o.history.created_at,text:o.history.text,executes:o.history.executes.map(s=>XIe({operations:o.operations,history:s}))})}function QFt(o){var p;const s=(p=o.operations.get(o.input.controller))==null?void 0:p.get(o.input.function);if(s===void 0)throw new Error(`No operation found: (controller: ${o.input.controller}, function: ${o.input.function})`);return s}class Emt{constructor(s){var p,y;this.props=s,this.operations_=YMn.compose({controllers:s.controllers,config:s.config}),this.stack_=[],this.listeners_=new Map,this.histories_=(s.histories??[]).map(C=>QDn({operations:this.operations_.group,history:C})),this.executor_=typeof((p=s.config)==null?void 0:p.executor)=="function"?s.config.executor:XDn(((y=s.config)==null?void 0:y.executor)??null),this.semaphore_=s.vendor.semaphore!=null?typeof s.vendor.semaphore=="object"?s.vendor.semaphore:new ABt(s.vendor.semaphore):null,this.token_usage_=this.props.tokenUsage!==void 0?this.props.tokenUsage instanceof pP?this.props.tokenUsage:new pP(this.props.tokenUsage):pP.zero(),this.ready_=!1}clone(){var s;return new Emt({...this.props,histories:(s=this.props.histories)==null?void 0:s.slice()})}async conversate(s,p={}){const y=[],C=z=>{this.dispatch(z).catch(()=>{}),"toHistory"in z&&("join"in z?y.push(async()=>(await z.join(),z.toHistory())):y.push(async()=>z.toHistory()))},N=aRn({contents:Array.isArray(s)?s:typeof s=="string"?[{type:"text",text:s}]:[s]});C(N),await this.executor_(this.getContext({dispatch:C,prompt:N.toHistory(),abortSignal:p.abortSignal,usage:this.token_usage_}));const L=await Promise.all(y.map(async z=>z()));return this.histories_.push(...L),L}getConfig(){return this.props.config}getVendor(){return this.props.vendor}getControllers(){return this.props.controllers}getOperations(){return this.operations_.array}getHistories(){return this.histories_}getTokenUsage(){return this.token_usage_}getContext(s){const p=async(y,C)=>{var at;const N=oRn({source:y,body:{...C,model:this.props.vendor.model,stream:!0,stream_options:{include_usage:!0}},options:{...this.props.vendor.options,signal:s.abortSignal}});s.dispatch(N);const L=((at=this.props.config)==null?void 0:at.backoffStrategy)??(It=>{throw It.error}),z=await(async()=>{let It=0;for(;;)try{return await this.props.vendor.api.chat.completions.create(N.body,N.options)}catch(Rt){const At=L({count:It,error:Rt});await new Promise(ee=>setTimeout(ee,At)),It++}})(),[G,q]=_C.transform(z.toReadableStream(),It=>L3.transformCompletionChunk(It)).tee(),[nt,tt]=q.tee();(async()=>{const It=nt.getReader();for(;;){const Rt=await It.read();if(Rt.done)break;Rt.value.usage!=null&&DIe.aggregate({kind:y,completionUsage:Rt.value.usage,usage:s.usage})}})().catch(()=>{});const[et,st]=G.tee();return s.dispatch({id:wk(),type:"response",source:y,stream:c$(et.getReader()),body:N.body,options:N.options,join:async()=>{const It=await _C.readAll(st);return L3.merge(It)},created_at:new Date().toISOString()}),tt};return{operations:this.operations_,config:this.props.config,histories:this.histories_,stack:this.stack_,ready:()=>this.ready_,prompt:s.prompt,abortSignal:s.abortSignal,dispatch:s.dispatch,request:this.semaphore_===null?p:async(y,C)=>{await this.semaphore_.acquire();try{return await p(y,C)}finally{this.semaphore_.release().catch(()=>{})}},initialize:async()=>{this.ready_=!0,s.dispatch(ZMn())}}}on(s,p){return BIe(this.listeners_,s,()=>new Set).add(p),this}off(s,p){const y=this.listeners_.get(s);return y!==void 0&&(y.delete(p),y.size===0&&this.listeners_.delete(s)),this}async dispatch(s){const p=this.listeners_.get(s.type);p!==void 0&&await Promise.all(Array.from(p).map(async y=>{try{await y(s)}catch{}}))}}function tc(o,s,p,y,C){if(typeof s=="function"?o!==s||!0:!s.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s.set(o,p),p}function wr(o,s,p,y){if(p==="a"&&!y)throw new TypeError("Private accessor was defined without a getter");if(typeof s=="function"?o!==s||!y:!s.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return p==="m"?y:p==="a"?y.call(o):y?y.value:s.get(o)}let QIe=function(){const{crypto:o}=globalThis;if(o!=null&&o.randomUUID)return QIe=o.randomUUID.bind(o),o.randomUUID();const s=new Uint8Array(1),p=o?()=>o.getRandomValues(s)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,y=>(+y^p()&15>>+y/4).toString(16))};function eFt(o){return typeof o=="object"&&o!==null&&("name"in o&&o.name==="AbortError"||"message"in o&&String(o.message).includes("FetchRequestCanceledException"))}const nFt=o=>{if(o instanceof Error)return o;if(typeof o=="object"&&o!==null){try{if(Object.prototype.toString.call(o)==="[object Error]"){const s=new Error(o.message,o.cause?{cause:o.cause}:{});return o.stack&&(s.stack=o.stack),o.cause&&!s.cause&&(s.cause=o.cause),o.name&&(s.name=o.name),s}}catch{}try{return new Error(JSON.stringify(o))}catch{}}return new Error(o)};class Ho extends Error{}class Lg extends Ho{constructor(s,p,y,C){super(`${Lg.makeMessage(s,p,y)}`),this.status=s,this.headers=C,this.requestID=C==null?void 0:C.get("x-request-id"),this.error=p;const N=p;this.code=N==null?void 0:N.code,this.param=N==null?void 0:N.param,this.type=N==null?void 0:N.type}static makeMessage(s,p,y){const C=p!=null&&p.message?typeof p.message=="string"?p.message:JSON.stringify(p.message):p?JSON.stringify(p):y;return s&&C?`${s} ${C}`:s?`${s} status code (no body)`:C||"(no status code or body)"}static generate(s,p,y,C){if(!s||!C)return new Jmt({message:y,cause:nFt(p)});const N=p==null?void 0:p.error;return s===400?new JIe(s,N,y,C):s===401?new ZIe(s,N,y,C):s===403?new tOe(s,N,y,C):s===404?new eOe(s,N,y,C):s===409?new nOe(s,N,y,C):s===422?new rOe(s,N,y,C):s===429?new iOe(s,N,y,C):s>=500?new aOe(s,N,y,C):new Lg(s,N,y,C)}}class O3 extends Lg{constructor({message:s}={}){super(void 0,void 0,s||"Request was aborted.",void 0)}}class Jmt extends Lg{constructor({message:s,cause:p}){super(void 0,void 0,s||"Connection error.",void 0),p&&(this.cause=p)}}class JFt extends Jmt{constructor({message:s}={}){super({message:s??"Request timed out."})}}class JIe extends Lg{}class ZIe extends Lg{}class tOe extends Lg{}class eOe extends Lg{}class nOe extends Lg{}class rOe extends Lg{}class iOe extends Lg{}class aOe extends Lg{}class sOe extends Ho{constructor(){super("Could not parse response content as the length limit was reached")}}class oOe extends Ho{constructor(){super("Could not parse response content as the request was rejected by the content filter")}}const iBn=/^[a-z][a-z0-9+.-]*:/i,aBn=o=>iBn.test(o);function sBn(o){return typeof o!="object"?{}:o??{}}function oBn(o){if(!o)return!0;for(const s in o)return!1;return!0}function cBn(o,s){return Object.prototype.hasOwnProperty.call(o,s)}function KDt(o){return o!=null&&typeof o=="object"&&!Array.isArray(o)}const uBn=(o,s)=>{if(typeof s!="number"||!Number.isInteger(s))throw new Ho(`${o} must be an integer`);if(s<0)throw new Ho(`${o} must be a positive integer`);return s},lBn=o=>{try{return JSON.parse(o)}catch{return}},tJ=o=>new Promise(s=>setTimeout(s,o)),Tmt={off:0,error:200,warn:300,info:400,debug:500},zCe=(o,s,p)=>{if(o){if(cBn(Tmt,o))return o;Tb(p).warn(`${s} was set to ${JSON.stringify(o)}, expected one of ${JSON.stringify(Object.keys(Tmt))}`)}};function wQ(){}function Abt(o,s,p){return!s||Tmt[o]>Tmt[p]?wQ:s[o].bind(s)}const hBn={error:wQ,warn:wQ,info:wQ,debug:wQ};let UCe=new WeakMap;function Tb(o){const s=o.logger,p=o.logLevel??"off";if(!s)return hBn;const y=UCe.get(s);if(y&&y[0]===p)return y[1];const C={error:Abt("error",s,p),warn:Abt("warn",s,p),info:Abt("info",s,p),debug:Abt("debug",s,p)};return UCe.set(s,[p,C]),C}const oP=o=>(o.options&&(o.options={...o.options},delete o.options.headers),o.headers&&(o.headers=Object.fromEntries((o.headers instanceof Headers?[...o.headers]:Object.entries(o.headers)).map(([s,p])=>[s,s.toLowerCase()==="authorization"||s.toLowerCase()==="cookie"||s.toLowerCase()==="set-cookie"?"***":p]))),"retryOfRequestLogID"in o&&(o.retryOfRequestLogID&&(o.retryOf=o.retryOfRequestLogID),delete o.retryOfRequestLogID),o),BF="5.2.0",fBn=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function dBn(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}const pBn=()=>{var p;const o=dBn();if(o==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":BF,"X-Stainless-OS":WCe(Deno.build.os),"X-Stainless-Arch":qCe(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:((p=Deno.version)==null?void 0:p.deno)??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":BF,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(o==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":BF,"X-Stainless-OS":WCe(globalThis.process.platform??"unknown"),"X-Stainless-Arch":qCe(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};const s=gBn();return s?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":BF,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${s.browser}`,"X-Stainless-Runtime-Version":s.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":BF,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function gBn(){if(typeof navigator>"u"||!navigator)return null;const o=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(const{key:s,pattern:p}of o){const y=p.exec(navigator.userAgent);if(y){const C=y[1]||0,N=y[2]||0,L=y[3]||0;return{browser:s,version:`${C}.${N}.${L}`}}}return null}const qCe=o=>o==="x32"?"x32":o==="x86_64"||o==="x64"?"x64":o==="arm"?"arm":o==="aarch64"||o==="arm64"?"arm64":o?`other:${o}`:"unknown",WCe=o=>(o=o.toLowerCase(),o.includes("ios")?"iOS":o==="android"?"Android":o==="darwin"?"MacOS":o==="win32"?"Windows":o==="freebsd"?"FreeBSD":o==="openbsd"?"OpenBSD":o==="linux"?"Linux":o?`Other:${o}`:"Unknown");let KCe;const bBn=()=>KCe??(KCe=pBn());function mBn(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function cOe(...o){const s=globalThis.ReadableStream;if(typeof s>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new s(...o)}function uOe(o){let s=Symbol.asyncIterator in o?o[Symbol.asyncIterator]():o[Symbol.iterator]();return cOe({start(){},async pull(p){const{done:y,value:C}=await s.next();y?p.close():p.enqueue(C)},async cancel(){var p;await((p=s.return)==null?void 0:p.call(s))}})}function lOe(o){if(o[Symbol.asyncIterator])return o;const s=o.getReader();return{async next(){try{const p=await s.read();return p!=null&&p.done&&s.releaseLock(),p}catch(p){throw s.releaseLock(),p}},async return(){const p=s.cancel();return s.releaseLock(),await p,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function yBn(o){var y,C;if(o===null||typeof o!="object")return;if(o[Symbol.asyncIterator]){await((C=(y=o[Symbol.asyncIterator]()).return)==null?void 0:C.call(y));return}const s=o.getReader(),p=s.cancel();s.releaseLock(),await p}const wBn=({headers:o,body:s})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(s)}),rFt="RFC3986",iFt={RFC1738:o=>String(o).replace(/%20/g,"+"),RFC3986:o=>String(o)},vBn="RFC1738",_Bn=Array.isArray,w6=(()=>{const o=[];for(let s=0;s<256;++s)o.push("%"+((s<16?"0":"")+s.toString(16)).toUpperCase());return o})(),GDt=1024,xBn=(o,s,p,y,C)=>{if(o.length===0)return o;let N=o;if(typeof o=="symbol"?N=Symbol.prototype.toString.call(o):typeof o!="string"&&(N=String(o)),p==="iso-8859-1")return escape(N).replace(/%u[0-9a-f]{4}/gi,function(z){return"%26%23"+parseInt(z.slice(2),16)+"%3B"});let L="";for(let z=0;z<N.length;z+=GDt){const G=N.length>=GDt?N.slice(z,z+GDt):N,q=[];for(let nt=0;nt<G.length;++nt){let tt=G.charCodeAt(nt);if(tt===45||tt===46||tt===95||tt===126||tt>=48&&tt<=57||tt>=65&&tt<=90||tt>=97&&tt<=122||C===vBn&&(tt===40||tt===41)){q[q.length]=G.charAt(nt);continue}if(tt<128){q[q.length]=w6[tt];continue}if(tt<2048){q[q.length]=w6[192|tt>>6]+w6[128|tt&63];continue}if(tt<55296||tt>=57344){q[q.length]=w6[224|tt>>12]+w6[128|tt>>6&63]+w6[128|tt&63];continue}nt+=1,tt=65536+((tt&1023)<<10|G.charCodeAt(nt)&1023),q[q.length]=w6[240|tt>>18]+w6[128|tt>>12&63]+w6[128|tt>>6&63]+w6[128|tt&63]}L+=q.join("")}return L};function EBn(o){return!o||typeof o!="object"?!1:!!(o.constructor&&o.constructor.isBuffer&&o.constructor.isBuffer(o))}function GCe(o,s){if(_Bn(o)){const p=[];for(let y=0;y<o.length;y+=1)p.push(s(o[y]));return p}return s(o)}const TBn=Object.prototype.hasOwnProperty,hOe={brackets(o){return String(o)+"[]"},comma:"comma",indices(o,s){return String(o)+"["+s+"]"},repeat(o){return String(o)}},x6=Array.isArray,kBn=Array.prototype.push,fOe=function(o,s){kBn.apply(o,x6(s)?s:[s])},SBn=Date.prototype.toISOString,np={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:xBn,encodeValuesOnly:!1,format:rFt,formatter:iFt[rFt],indices:!1,serializeDate(o){return SBn.call(o)},skipNulls:!1,strictNullHandling:!1};function CBn(o){return typeof o=="string"||typeof o=="number"||typeof o=="boolean"||typeof o=="symbol"||typeof o=="bigint"}const YDt={};function dOe(o,s,p,y,C,N,L,z,G,q,nt,tt,et,st,at,It,Rt,At){let ee=o,ae=At,ve=0,hn=!1;for(;(ae=ae.get(YDt))!==void 0&&!hn;){const zn=ae.get(o);if(ve+=1,typeof zn<"u"){if(zn===ve)throw new RangeError("Cyclic object value");hn=!0}typeof ae.get(YDt)>"u"&&(ve=0)}if(typeof q=="function"?ee=q(s,ee):ee instanceof Date?ee=et==null?void 0:et(ee):p==="comma"&&x6(ee)&&(ee=GCe(ee,function(zn){return zn instanceof Date?et==null?void 0:et(zn):zn})),ee===null){if(N)return G&&!It?G(s,np.encoder,Rt,"key",st):s;ee=""}if(CBn(ee)||EBn(ee)){if(G){const zn=It?s:G(s,np.encoder,Rt,"key",st);return[(at==null?void 0:at(zn))+"="+(at==null?void 0:at(G(ee,np.encoder,Rt,"value",st)))]}return[(at==null?void 0:at(s))+"="+(at==null?void 0:at(String(ee)))]}const pe=[];if(typeof ee>"u")return pe;let pn;if(p==="comma"&&x6(ee))It&&G&&(ee=GCe(ee,G)),pn=[{value:ee.length>0?ee.join(",")||null:void 0}];else if(x6(q))pn=q;else{const zn=Object.keys(ee);pn=nt?zn.sort(nt):zn}const Yn=z?String(s).replace(/\./g,"%2E"):String(s),Ln=y&&x6(ee)&&ee.length===1?Yn+"[]":Yn;if(C&&x6(ee)&&ee.length===0)return Ln+"[]";for(let zn=0;zn<pn.length;++zn){const Qn=pn[zn],ur=typeof Qn=="object"&&typeof Qn.value<"u"?Qn.value:ee[Qn];if(L&&ur===null)continue;const fi=tt&&z?Qn.replace(/\./g,"%2E"):Qn,pi=x6(ee)?typeof p=="function"?p(Ln,fi):Ln:Ln+(tt?"."+fi:"["+fi+"]");At.set(o,ve);const Or=new WeakMap;Or.set(YDt,At),fOe(pe,dOe(ur,pi,p,y,C,N,L,z,p==="comma"&&It&&x6(ee)?null:G,q,nt,tt,et,st,at,It,Rt,Or))}return pe}function ABn(o=np){if(typeof o.allowEmptyArrays<"u"&&typeof o.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof o.encodeDotInKeys<"u"&&typeof o.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(o.encoder!==null&&typeof o.encoder<"u"&&typeof o.encoder!="function")throw new TypeError("Encoder has to be a function.");const s=o.charset||np.charset;if(typeof o.charset<"u"&&o.charset!=="utf-8"&&o.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let p=rFt;if(typeof o.format<"u"){if(!TBn.call(iFt,o.format))throw new TypeError("Unknown format option provided.");p=o.format}const y=iFt[p];let C=np.filter;(typeof o.filter=="function"||x6(o.filter))&&(C=o.filter);let N;if(o.arrayFormat&&o.arrayFormat in hOe?N=o.arrayFormat:"indices"in o?N=o.indices?"indices":"repeat":N=np.arrayFormat,"commaRoundTrip"in o&&typeof o.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");const L=typeof o.allowDots>"u"?o.encodeDotInKeys?!0:np.allowDots:!!o.allowDots;return{addQueryPrefix:typeof o.addQueryPrefix=="boolean"?o.addQueryPrefix:np.addQueryPrefix,allowDots:L,allowEmptyArrays:typeof o.allowEmptyArrays=="boolean"?!!o.allowEmptyArrays:np.allowEmptyArrays,arrayFormat:N,charset:s,charsetSentinel:typeof o.charsetSentinel=="boolean"?o.charsetSentinel:np.charsetSentinel,commaRoundTrip:!!o.commaRoundTrip,delimiter:typeof o.delimiter>"u"?np.delimiter:o.delimiter,encode:typeof o.encode=="boolean"?o.encode:np.encode,encodeDotInKeys:typeof o.encodeDotInKeys=="boolean"?o.encodeDotInKeys:np.encodeDotInKeys,encoder:typeof o.encoder=="function"?o.encoder:np.encoder,encodeValuesOnly:typeof o.encodeValuesOnly=="boolean"?o.encodeValuesOnly:np.encodeValuesOnly,filter:C,format:p,formatter:y,serializeDate:typeof o.serializeDate=="function"?o.serializeDate:np.serializeDate,skipNulls:typeof o.skipNulls=="boolean"?o.skipNulls:np.skipNulls,sort:typeof o.sort=="function"?o.sort:null,strictNullHandling:typeof o.strictNullHandling=="boolean"?o.strictNullHandling:np.strictNullHandling}}function IBn(o,s={}){let p=o;const y=ABn(s);let C,N;typeof y.filter=="function"?(N=y.filter,p=N("",p)):x6(y.filter)&&(N=y.filter,C=N);const L=[];if(typeof p!="object"||p===null)return"";const z=hOe[y.arrayFormat],G=z==="comma"&&y.commaRoundTrip;C||(C=Object.keys(p)),y.sort&&C.sort(y.sort);const q=new WeakMap;for(let et=0;et<C.length;++et){const st=C[et];y.skipNulls&&p[st]===null||fOe(L,dOe(p[st],st,z,G,y.allowEmptyArrays,y.strictNullHandling,y.skipNulls,y.encodeDotInKeys,y.encode?y.encoder:null,y.filter,y.sort,y.allowDots,y.serializeDate,y.format,y.formatter,y.encodeValuesOnly,y.charset,q))}const nt=L.join(y.delimiter);let tt=y.addQueryPrefix===!0?"?":"";return y.charsetSentinel&&(y.charset==="iso-8859-1"?tt+="utf8=%26%2310003%3B&":tt+="utf8=%E2%9C%93&"),nt.length>0?tt+nt:""}function OBn(o){let s=0;for(const C of o)s+=C.length;const p=new Uint8Array(s);let y=0;for(const C of o)p.set(C,y),y+=C.length;return p}let YCe;function ZFt(o){let s;return(YCe??(s=new globalThis.TextEncoder,YCe=s.encode.bind(s)))(o)}let VCe;function XCe(o){let s;return(VCe??(s=new globalThis.TextDecoder,VCe=s.decode.bind(s)))(o)}var _w,xw;class Zmt{constructor(){_w.set(this,void 0),xw.set(this,void 0),tc(this,_w,new Uint8Array),tc(this,xw,null)}decode(s){if(s==null)return[];const p=s instanceof ArrayBuffer?new Uint8Array(s):typeof s=="string"?ZFt(s):s;tc(this,_w,OBn([wr(this,_w,"f"),p]));const y=[];let C;for(;(C=NBn(wr(this,_w,"f"),wr(this,xw,"f")))!=null;){if(C.carriage&&wr(this,xw,"f")==null){tc(this,xw,C.index);continue}if(wr(this,xw,"f")!=null&&(C.index!==wr(this,xw,"f")+1||C.carriage)){y.push(XCe(wr(this,_w,"f").subarray(0,wr(this,xw,"f")-1))),tc(this,_w,wr(this,_w,"f").subarray(wr(this,xw,"f"))),tc(this,xw,null);continue}const N=wr(this,xw,"f")!==null?C.preceding-1:C.preceding,L=XCe(wr(this,_w,"f").subarray(0,N));y.push(L),tc(this,_w,wr(this,_w,"f").subarray(C.index)),tc(this,xw,null)}return y}flush(){return wr(this,_w,"f").length?this.decode(`
|
|
1830
|
+
a specific function to call, the others would be eliminated.`,validate:(()=>{const o=z=>Array.isArray(z.functions)&&z.functions.every(G=>typeof G=="object"&&G!==null&&s(G)),s=z=>typeof z.reason=="string"&&typeof z.name=="string",p=(z,G,q=!0)=>[(Array.isArray(z.functions)||L(q,{path:G+".functions",expected:"Array<___IChatFunctionReference>",value:z.functions}))&&z.functions.map((nt,tt)=>(typeof nt=="object"&&nt!==null||L(q,{path:G+".functions["+tt+"]",expected:"___IChatFunctionReference",value:nt}))&&y(nt,G+".functions["+tt+"]",q)||L(q,{path:G+".functions["+tt+"]",expected:"___IChatFunctionReference",value:nt})).every(nt=>nt)||L(q,{path:G+".functions",expected:"Array<___IChatFunctionReference>",value:z.functions})].every(nt=>nt),y=(z,G,q=!0)=>[typeof z.reason=="string"||L(q,{path:G+".reason",expected:"string",value:z.reason}),typeof z.name=="string"||L(q,{path:G+".name",expected:"string",value:z.name})].every(nt=>nt),C=z=>typeof z=="object"&&z!==null&&o(z);let N,L;return z=>{if(C(z)===!1){N=[],L=u$(N),((q,nt,tt=!0)=>(typeof q=="object"&&q!==null||L(!0,{path:nt+"",expected:"__IChatFunctionReference.IProps",value:q}))&&p(q,nt+"",!0)||L(!0,{path:nt+"",expected:"__IChatFunctionReference.IProps",value:q}))(z,"$input",!0);const G=N.length===0;return G?{success:G,data:z}:{success:G,errors:N,data:z}}return{success:!0,data:z}}})()}]};async function YDn(o){var y;if(o.operations.divided===void 0)return zbt(o,o.operations.array,0);const s=o.operations.divided.map(()=>[]),p=[];if(await Promise.all(o.operations.divided.map(async(C,N)=>zbt({...o,stack:s[N],dispatch:L=>(p.push(L),L)},C,0))),(((y=o.config)==null?void 0:y.eliticism)??yk.ELITICISM)===!0&&s.some(C=>C.length!==0))return zbt(o,s.flat().map(C=>o.operations.group.get(C.operation.controller.name).get(C.operation.function.name)),0);{const C=p.filter(N=>N.type==="select");(C.length!==0?C:p).forEach(o.dispatch)}}async function zbt(o,s,p,y){var G,q,nt,tt;const C=await o.request("select",{messages:[{role:"system",content:o$.write(o.config)},{role:"assistant",tool_calls:[{type:"function",id:"getApiFunctions",function:{name:"getApiFunctions",arguments:JSON.stringify({})}}]},{role:"tool",tool_call_id:"getApiFunctions",content:JSON.stringify(s.map(et=>({name:et.name,description:et.function.description,...et.protocol==="http"?{method:et.function.method,path:et.function.path,tags:et.function.tags}:{}})))},...o.histories.map(a$).flat(),{role:"user",content:o.prompt.contents.map(s$)},{role:"system",content:((nt=(q=(G=o.config)==null?void 0:G.systemPrompt)==null?void 0:q.select)==null?void 0:nt.call(q,o.histories))??I6.SELECT},...VDn(y??[])],tools:[{type:"function",function:{name:WDt.functions[0].name,description:WDt.functions[0].description,parameters:WDt.functions[0].parameters}}],tool_choice:p===0?"auto":"required"}),N=[],z=await _C.reduce(C,async(et,st)=>{const at=await et,It=Rt=>{var At;for(const ee of Rt){if(ee.finish_reason!=null){(At=N[ee.index])==null||At.mpsc.close();continue}if(ee.delta.content==null)continue;if(N[ee.index]!=null){N[ee.index].content+=ee.delta.content,N[ee.index].mpsc.produce(ee.delta.content);continue}const ae=new Xmt;N[ee.index]={content:ee.delta.content,mpsc:ae},ae.produce(ee.delta.content);const ve=VFt({stream:c$(ae.consumer.getReader()),done:()=>ae.done(),get:()=>{var hn;return((hn=N[ee.index])==null?void 0:hn.content)??""},join:async()=>(await ae.waitClosed(),N[ee.index].content)});o.dispatch(ve)}};return at.object==="chat.completion.chunk"?(It([at,st].flatMap(Rt=>Rt.choices)),L3.merge([at,st])):(It(st.choices),L3.accumulate(at,st))});if(p++<(((tt=o.config)==null?void 0:tt.retry)??yk.RETRY)){const et=[];for(const st of z.choices)for(const at of st.message.tool_calls??[]){if(at.function.name!=="selectFunctions")continue;const It=JSON.parse(at.function.arguments),Rt=(()=>{const At=Yn=>Array.isArray(Yn.functions)&&Yn.functions.every(Ln=>typeof Ln=="object"&&Ln!==null&&ee(Ln)),ee=Yn=>typeof Yn.reason=="string"&&typeof Yn.name=="string",ae=(Yn,Ln,zn=!0)=>[(Array.isArray(Yn.functions)||pn(zn,{path:Ln+".functions",expected:"Array<___IChatFunctionReference>",value:Yn.functions}))&&Yn.functions.map((Qn,ur)=>(typeof Qn=="object"&&Qn!==null||pn(zn,{path:Ln+".functions["+ur+"]",expected:"___IChatFunctionReference",value:Qn}))&&ve(Qn,Ln+".functions["+ur+"]",zn)||pn(zn,{path:Ln+".functions["+ur+"]",expected:"___IChatFunctionReference",value:Qn})).every(Qn=>Qn)||pn(zn,{path:Ln+".functions",expected:"Array<___IChatFunctionReference>",value:Yn.functions})].every(Qn=>Qn),ve=(Yn,Ln,zn=!0)=>[typeof Yn.reason=="string"||pn(zn,{path:Ln+".reason",expected:"string",value:Yn.reason}),typeof Yn.name=="string"||pn(zn,{path:Ln+".name",expected:"string",value:Yn.name})].every(Qn=>Qn),hn=Yn=>typeof Yn=="object"&&Yn!==null&&At(Yn);let pe,pn;return Yn=>{if(hn(Yn)===!1){pe=[],pn=u$(pe),((zn,Qn,ur=!0)=>(typeof zn=="object"&&zn!==null||pn(!0,{path:Qn+"",expected:"__IChatFunctionReference.IProps",value:zn}))&&ae(zn,Qn+"",!0)||pn(!0,{path:Qn+"",expected:"__IChatFunctionReference.IProps",value:zn}))(Yn,"$input",!0);const Ln=pe.length===0;return Ln?{success:Ln,data:Yn}:{success:Ln,errors:pe,data:Yn}}return{success:!0,data:Yn}}})()(It);Rt.success===!1&&et.push({id:at.id,name:at.function.name,validation:Rt})}if(et.length>0)return zbt(o,s,p,et)}for(const et of z.choices)if(et.message.tool_calls!=null)for(const st of et.message.tool_calls){if(st.type!=="function")continue;if(st.function.name!=="selectFunctions")continue;const at=(()=>{const It=ee=>Array.isArray(ee.functions)&&ee.functions.every(ae=>typeof ae=="object"&&ae!==null&&Rt(ae)),Rt=ee=>typeof ee.reason=="string"&&typeof ee.name=="string",At=ee=>typeof ee=="object"&&ee!==null&&It(ee);return ee=>(ee=JSON.parse(ee),At(ee)?ee:null)})()(st.function.arguments);if(at!==null)for(const It of at.functions)GDn(o,It)}}function VDn(o){return o.map(s=>[{role:"assistant",tool_calls:[{type:"function",id:s.id,function:{name:s.name,arguments:JSON.stringify(s.validation.data)}}]},{role:"tool",content:JSON.stringify(s.validation.errors),tool_call_id:s.id},{role:"system",content:["You A.I. assistant has composed wrong typed arguments.","","Correct it at the next function calling."].join(`
|
|
1831
|
+
`)}]).flat()}function XDn(o){return async s=>{if(s.ready()===!1){if((o==null?void 0:o.initialize)!==!0&&typeof(o==null?void 0:o.initialize)!="function")await s.initialize();else if(await(typeof(o==null?void 0:o.initialize)=="function"?o.initialize:KDn)(s),s.ready()===!1)return}if(s.stack.length!==0&&await((o==null?void 0:o.cancel)??UDn)(s),await((o==null?void 0:o.select)??YDn)(s),s.stack.length!==0)for(;;){const p=await((o==null?void 0:o.call)??MDn)(s,s.stack.map(y=>y.operation));if((o==null?void 0:o.describe)!==null&&(o==null?void 0:o.describe)!==!1&&await(typeof(o==null?void 0:o.describe)=="function"?o.describe:WDn)(s,p),p.length===0||s.stack.length===0)break}}}function QDn(o){return o.history.type==="userMessage"?tBn({history:o.history}):o.history.type==="assistantMessage"?JDn({history:o.history}):o.history.type==="systemMessage"?ZDn({history:o.history}):o.history.type==="select"?eBn({operations:o.operations,history:o.history}):o.history.type==="cancel"?nBn({operations:o.operations,history:o.history}):o.history.type==="execute"?XIe({operations:o.operations,history:o.history}):rBn({operations:o.operations,history:o.history})}function JDn(o){return VMn(o.history)}function ZDn(o){return XMn(o.history)}function tBn(o){return FIe(o.history)}function eBn(o){return $Ie({id:o.history.id,created_at:o.history.created_at,selection:Qmt({operation:QFt({operations:o.operations,input:o.history.selection.operation}),reason:o.history.selection.reason})})}function nBn(o){return JMn({id:o.history.id,created_at:o.history.created_at,selection:Qmt({operation:QFt({operations:o.operations,input:o.history.selection.operation}),reason:o.history.selection.reason})})}function XIe(o){return jIe({id:o.history.id,created_at:o.history.created_at,operation:QFt({operations:o.operations,input:o.history.operation}),arguments:o.history.arguments,value:o.history.value,success:o.history.success})}function rBn(o){return QMn({id:o.history.id,created_at:o.history.created_at,text:o.history.text,executes:o.history.executes.map(s=>XIe({operations:o.operations,history:s}))})}function QFt(o){var p;const s=(p=o.operations.get(o.input.controller))==null?void 0:p.get(o.input.function);if(s===void 0)throw new Error(`No operation found: (controller: ${o.input.controller}, function: ${o.input.function})`);return s}class Emt{constructor(s){var p,y;this.props=s,this.operations_=YMn.compose({controllers:s.controllers,config:s.config}),this.stack_=[],this.listeners_=new Map,this.histories_=(s.histories??[]).map(C=>QDn({operations:this.operations_.group,history:C})),this.executor_=typeof((p=s.config)==null?void 0:p.executor)=="function"?s.config.executor:XDn(((y=s.config)==null?void 0:y.executor)??null),this.semaphore_=s.vendor.semaphore!=null?typeof s.vendor.semaphore=="object"?s.vendor.semaphore:new ABt(s.vendor.semaphore):null,this.token_usage_=this.props.tokenUsage!==void 0?this.props.tokenUsage instanceof pP?this.props.tokenUsage:new pP(this.props.tokenUsage):pP.zero(),this.ready_=!1}clone(){var s;return new Emt({...this.props,histories:(s=this.props.histories)==null?void 0:s.slice()})}async conversate(s,p={}){const y=[],C=z=>{this.dispatch(z).catch(()=>{}),"toHistory"in z&&("join"in z?y.push(async()=>(await z.join(),z.toHistory())):y.push(async()=>z.toHistory()))},N=aRn({contents:Array.isArray(s)?s:typeof s=="string"?[{type:"text",text:s}]:[s]});C(N),await this.executor_(this.getContext({dispatch:C,prompt:N.toHistory(),abortSignal:p.abortSignal,usage:this.token_usage_}));const L=await Promise.all(y.map(async z=>z()));return this.histories_.push(...L),L}getConfig(){return this.props.config}getVendor(){return this.props.vendor}getControllers(){return this.props.controllers}getOperations(){return this.operations_.array}getHistories(){return this.histories_}getTokenUsage(){return this.token_usage_}getContext(s){const p=async(y,C)=>{var at;const N=oRn({source:y,body:{...C,model:this.props.vendor.model,stream:!0,stream_options:{include_usage:!0}},options:{...this.props.vendor.options,signal:s.abortSignal}});s.dispatch(N);const L=((at=this.props.config)==null?void 0:at.backoffStrategy)??(It=>{throw It.error}),z=await(async()=>{let It=0;for(;;)try{return await this.props.vendor.api.chat.completions.create(N.body,N.options)}catch(Rt){const At=L({count:It,error:Rt});await new Promise(ee=>setTimeout(ee,At)),It++}})(),[G,q]=_C.transform(z.toReadableStream(),It=>L3.transformCompletionChunk(It)).tee(),[nt,tt]=q.tee();(async()=>{const It=nt.getReader();for(;;){const Rt=await It.read();if(Rt.done)break;Rt.value.usage!=null&&DIe.aggregate({kind:y,completionUsage:Rt.value.usage,usage:s.usage})}})().catch(()=>{});const[et,st]=G.tee();return s.dispatch({id:wk(),type:"response",source:y,stream:c$(et.getReader()),body:N.body,options:N.options,join:async()=>{const It=await _C.readAll(st);return L3.merge(It)},created_at:new Date().toISOString()}),tt};return{operations:this.operations_,config:this.props.config,histories:this.histories_,stack:this.stack_,ready:()=>this.ready_,prompt:s.prompt,abortSignal:s.abortSignal,dispatch:s.dispatch,request:this.semaphore_===null?p:async(y,C)=>{await this.semaphore_.acquire();try{return await p(y,C)}finally{this.semaphore_.release().catch(()=>{})}},initialize:async()=>{this.ready_=!0,s.dispatch(ZMn())}}}on(s,p){return BIe(this.listeners_,s,()=>new Set).add(p),this}off(s,p){const y=this.listeners_.get(s);return y!==void 0&&(y.delete(p),y.size===0&&this.listeners_.delete(s)),this}async dispatch(s){const p=this.listeners_.get(s.type);p!==void 0&&await Promise.all(Array.from(p).map(async y=>{try{await y(s)}catch{}}))}}function tc(o,s,p,y,C){if(typeof s=="function"?o!==s||!0:!s.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s.set(o,p),p}function wr(o,s,p,y){if(p==="a"&&!y)throw new TypeError("Private accessor was defined without a getter");if(typeof s=="function"?o!==s||!y:!s.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return p==="m"?y:p==="a"?y.call(o):y?y.value:s.get(o)}let QIe=function(){const{crypto:o}=globalThis;if(o!=null&&o.randomUUID)return QIe=o.randomUUID.bind(o),o.randomUUID();const s=new Uint8Array(1),p=o?()=>o.getRandomValues(s)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,y=>(+y^p()&15>>+y/4).toString(16))};function eFt(o){return typeof o=="object"&&o!==null&&("name"in o&&o.name==="AbortError"||"message"in o&&String(o.message).includes("FetchRequestCanceledException"))}const nFt=o=>{if(o instanceof Error)return o;if(typeof o=="object"&&o!==null){try{if(Object.prototype.toString.call(o)==="[object Error]"){const s=new Error(o.message,o.cause?{cause:o.cause}:{});return o.stack&&(s.stack=o.stack),o.cause&&!s.cause&&(s.cause=o.cause),o.name&&(s.name=o.name),s}}catch{}try{return new Error(JSON.stringify(o))}catch{}}return new Error(o)};class Ho extends Error{}class Lg extends Ho{constructor(s,p,y,C){super(`${Lg.makeMessage(s,p,y)}`),this.status=s,this.headers=C,this.requestID=C==null?void 0:C.get("x-request-id"),this.error=p;const N=p;this.code=N==null?void 0:N.code,this.param=N==null?void 0:N.param,this.type=N==null?void 0:N.type}static makeMessage(s,p,y){const C=p!=null&&p.message?typeof p.message=="string"?p.message:JSON.stringify(p.message):p?JSON.stringify(p):y;return s&&C?`${s} ${C}`:s?`${s} status code (no body)`:C||"(no status code or body)"}static generate(s,p,y,C){if(!s||!C)return new Jmt({message:y,cause:nFt(p)});const N=p==null?void 0:p.error;return s===400?new JIe(s,N,y,C):s===401?new ZIe(s,N,y,C):s===403?new tOe(s,N,y,C):s===404?new eOe(s,N,y,C):s===409?new nOe(s,N,y,C):s===422?new rOe(s,N,y,C):s===429?new iOe(s,N,y,C):s>=500?new aOe(s,N,y,C):new Lg(s,N,y,C)}}class O3 extends Lg{constructor({message:s}={}){super(void 0,void 0,s||"Request was aborted.",void 0)}}class Jmt extends Lg{constructor({message:s,cause:p}){super(void 0,void 0,s||"Connection error.",void 0),p&&(this.cause=p)}}class JFt extends Jmt{constructor({message:s}={}){super({message:s??"Request timed out."})}}class JIe extends Lg{}class ZIe extends Lg{}class tOe extends Lg{}class eOe extends Lg{}class nOe extends Lg{}class rOe extends Lg{}class iOe extends Lg{}class aOe extends Lg{}class sOe extends Ho{constructor(){super("Could not parse response content as the length limit was reached")}}class oOe extends Ho{constructor(){super("Could not parse response content as the request was rejected by the content filter")}}const iBn=/^[a-z][a-z0-9+.-]*:/i,aBn=o=>iBn.test(o);function sBn(o){return typeof o!="object"?{}:o??{}}function oBn(o){if(!o)return!0;for(const s in o)return!1;return!0}function cBn(o,s){return Object.prototype.hasOwnProperty.call(o,s)}function KDt(o){return o!=null&&typeof o=="object"&&!Array.isArray(o)}const uBn=(o,s)=>{if(typeof s!="number"||!Number.isInteger(s))throw new Ho(`${o} must be an integer`);if(s<0)throw new Ho(`${o} must be a positive integer`);return s},lBn=o=>{try{return JSON.parse(o)}catch{return}},tJ=o=>new Promise(s=>setTimeout(s,o)),Tmt={off:0,error:200,warn:300,info:400,debug:500},zCe=(o,s,p)=>{if(o){if(cBn(Tmt,o))return o;Tb(p).warn(`${s} was set to ${JSON.stringify(o)}, expected one of ${JSON.stringify(Object.keys(Tmt))}`)}};function wQ(){}function Abt(o,s,p){return!s||Tmt[o]>Tmt[p]?wQ:s[o].bind(s)}const hBn={error:wQ,warn:wQ,info:wQ,debug:wQ};let UCe=new WeakMap;function Tb(o){const s=o.logger,p=o.logLevel??"off";if(!s)return hBn;const y=UCe.get(s);if(y&&y[0]===p)return y[1];const C={error:Abt("error",s,p),warn:Abt("warn",s,p),info:Abt("info",s,p),debug:Abt("debug",s,p)};return UCe.set(s,[p,C]),C}const oP=o=>(o.options&&(o.options={...o.options},delete o.options.headers),o.headers&&(o.headers=Object.fromEntries((o.headers instanceof Headers?[...o.headers]:Object.entries(o.headers)).map(([s,p])=>[s,s.toLowerCase()==="authorization"||s.toLowerCase()==="cookie"||s.toLowerCase()==="set-cookie"?"***":p]))),"retryOfRequestLogID"in o&&(o.retryOfRequestLogID&&(o.retryOf=o.retryOfRequestLogID),delete o.retryOfRequestLogID),o),BF="5.2.0",fBn=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function dBn(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}const pBn=()=>{var p;const o=dBn();if(o==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":BF,"X-Stainless-OS":WCe(Deno.build.os),"X-Stainless-Arch":qCe(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:((p=Deno.version)==null?void 0:p.deno)??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":BF,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(o==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":BF,"X-Stainless-OS":WCe(globalThis.process.platform??"unknown"),"X-Stainless-Arch":qCe(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};const s=gBn();return s?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":BF,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${s.browser}`,"X-Stainless-Runtime-Version":s.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":BF,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function gBn(){if(typeof navigator>"u"||!navigator)return null;const o=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(const{key:s,pattern:p}of o){const y=p.exec(navigator.userAgent);if(y){const C=y[1]||0,N=y[2]||0,L=y[3]||0;return{browser:s,version:`${C}.${N}.${L}`}}}return null}const qCe=o=>o==="x32"?"x32":o==="x86_64"||o==="x64"?"x64":o==="arm"?"arm":o==="aarch64"||o==="arm64"?"arm64":o?`other:${o}`:"unknown",WCe=o=>(o=o.toLowerCase(),o.includes("ios")?"iOS":o==="android"?"Android":o==="darwin"?"MacOS":o==="win32"?"Windows":o==="freebsd"?"FreeBSD":o==="openbsd"?"OpenBSD":o==="linux"?"Linux":o?`Other:${o}`:"Unknown");let KCe;const bBn=()=>KCe??(KCe=pBn());function mBn(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function cOe(...o){const s=globalThis.ReadableStream;if(typeof s>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new s(...o)}function uOe(o){let s=Symbol.asyncIterator in o?o[Symbol.asyncIterator]():o[Symbol.iterator]();return cOe({start(){},async pull(p){const{done:y,value:C}=await s.next();y?p.close():p.enqueue(C)},async cancel(){var p;await((p=s.return)==null?void 0:p.call(s))}})}function lOe(o){if(o[Symbol.asyncIterator])return o;const s=o.getReader();return{async next(){try{const p=await s.read();return p!=null&&p.done&&s.releaseLock(),p}catch(p){throw s.releaseLock(),p}},async return(){const p=s.cancel();return s.releaseLock(),await p,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function yBn(o){var y,C;if(o===null||typeof o!="object")return;if(o[Symbol.asyncIterator]){await((C=(y=o[Symbol.asyncIterator]()).return)==null?void 0:C.call(y));return}const s=o.getReader(),p=s.cancel();s.releaseLock(),await p}const wBn=({headers:o,body:s})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(s)}),rFt="RFC3986",iFt={RFC1738:o=>String(o).replace(/%20/g,"+"),RFC3986:o=>String(o)},vBn="RFC1738",_Bn=Array.isArray,w6=(()=>{const o=[];for(let s=0;s<256;++s)o.push("%"+((s<16?"0":"")+s.toString(16)).toUpperCase());return o})(),GDt=1024,xBn=(o,s,p,y,C)=>{if(o.length===0)return o;let N=o;if(typeof o=="symbol"?N=Symbol.prototype.toString.call(o):typeof o!="string"&&(N=String(o)),p==="iso-8859-1")return escape(N).replace(/%u[0-9a-f]{4}/gi,function(z){return"%26%23"+parseInt(z.slice(2),16)+"%3B"});let L="";for(let z=0;z<N.length;z+=GDt){const G=N.length>=GDt?N.slice(z,z+GDt):N,q=[];for(let nt=0;nt<G.length;++nt){let tt=G.charCodeAt(nt);if(tt===45||tt===46||tt===95||tt===126||tt>=48&&tt<=57||tt>=65&&tt<=90||tt>=97&&tt<=122||C===vBn&&(tt===40||tt===41)){q[q.length]=G.charAt(nt);continue}if(tt<128){q[q.length]=w6[tt];continue}if(tt<2048){q[q.length]=w6[192|tt>>6]+w6[128|tt&63];continue}if(tt<55296||tt>=57344){q[q.length]=w6[224|tt>>12]+w6[128|tt>>6&63]+w6[128|tt&63];continue}nt+=1,tt=65536+((tt&1023)<<10|G.charCodeAt(nt)&1023),q[q.length]=w6[240|tt>>18]+w6[128|tt>>12&63]+w6[128|tt>>6&63]+w6[128|tt&63]}L+=q.join("")}return L};function EBn(o){return!o||typeof o!="object"?!1:!!(o.constructor&&o.constructor.isBuffer&&o.constructor.isBuffer(o))}function GCe(o,s){if(_Bn(o)){const p=[];for(let y=0;y<o.length;y+=1)p.push(s(o[y]));return p}return s(o)}const TBn=Object.prototype.hasOwnProperty,hOe={brackets(o){return String(o)+"[]"},comma:"comma",indices(o,s){return String(o)+"["+s+"]"},repeat(o){return String(o)}},x6=Array.isArray,kBn=Array.prototype.push,fOe=function(o,s){kBn.apply(o,x6(s)?s:[s])},SBn=Date.prototype.toISOString,np={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:xBn,encodeValuesOnly:!1,format:rFt,formatter:iFt[rFt],indices:!1,serializeDate(o){return SBn.call(o)},skipNulls:!1,strictNullHandling:!1};function CBn(o){return typeof o=="string"||typeof o=="number"||typeof o=="boolean"||typeof o=="symbol"||typeof o=="bigint"}const YDt={};function dOe(o,s,p,y,C,N,L,z,G,q,nt,tt,et,st,at,It,Rt,At){let ee=o,ae=At,ve=0,hn=!1;for(;(ae=ae.get(YDt))!==void 0&&!hn;){const zn=ae.get(o);if(ve+=1,typeof zn<"u"){if(zn===ve)throw new RangeError("Cyclic object value");hn=!0}typeof ae.get(YDt)>"u"&&(ve=0)}if(typeof q=="function"?ee=q(s,ee):ee instanceof Date?ee=et==null?void 0:et(ee):p==="comma"&&x6(ee)&&(ee=GCe(ee,function(zn){return zn instanceof Date?et==null?void 0:et(zn):zn})),ee===null){if(N)return G&&!It?G(s,np.encoder,Rt,"key",st):s;ee=""}if(CBn(ee)||EBn(ee)){if(G){const zn=It?s:G(s,np.encoder,Rt,"key",st);return[(at==null?void 0:at(zn))+"="+(at==null?void 0:at(G(ee,np.encoder,Rt,"value",st)))]}return[(at==null?void 0:at(s))+"="+(at==null?void 0:at(String(ee)))]}const pe=[];if(typeof ee>"u")return pe;let pn;if(p==="comma"&&x6(ee))It&&G&&(ee=GCe(ee,G)),pn=[{value:ee.length>0?ee.join(",")||null:void 0}];else if(x6(q))pn=q;else{const zn=Object.keys(ee);pn=nt?zn.sort(nt):zn}const Yn=z?String(s).replace(/\./g,"%2E"):String(s),Ln=y&&x6(ee)&&ee.length===1?Yn+"[]":Yn;if(C&&x6(ee)&&ee.length===0)return Ln+"[]";for(let zn=0;zn<pn.length;++zn){const Qn=pn[zn],ur=typeof Qn=="object"&&typeof Qn.value<"u"?Qn.value:ee[Qn];if(L&&ur===null)continue;const fi=tt&&z?Qn.replace(/\./g,"%2E"):Qn,pi=x6(ee)?typeof p=="function"?p(Ln,fi):Ln:Ln+(tt?"."+fi:"["+fi+"]");At.set(o,ve);const Or=new WeakMap;Or.set(YDt,At),fOe(pe,dOe(ur,pi,p,y,C,N,L,z,p==="comma"&&It&&x6(ee)?null:G,q,nt,tt,et,st,at,It,Rt,Or))}return pe}function ABn(o=np){if(typeof o.allowEmptyArrays<"u"&&typeof o.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof o.encodeDotInKeys<"u"&&typeof o.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(o.encoder!==null&&typeof o.encoder<"u"&&typeof o.encoder!="function")throw new TypeError("Encoder has to be a function.");const s=o.charset||np.charset;if(typeof o.charset<"u"&&o.charset!=="utf-8"&&o.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let p=rFt;if(typeof o.format<"u"){if(!TBn.call(iFt,o.format))throw new TypeError("Unknown format option provided.");p=o.format}const y=iFt[p];let C=np.filter;(typeof o.filter=="function"||x6(o.filter))&&(C=o.filter);let N;if(o.arrayFormat&&o.arrayFormat in hOe?N=o.arrayFormat:"indices"in o?N=o.indices?"indices":"repeat":N=np.arrayFormat,"commaRoundTrip"in o&&typeof o.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");const L=typeof o.allowDots>"u"?o.encodeDotInKeys?!0:np.allowDots:!!o.allowDots;return{addQueryPrefix:typeof o.addQueryPrefix=="boolean"?o.addQueryPrefix:np.addQueryPrefix,allowDots:L,allowEmptyArrays:typeof o.allowEmptyArrays=="boolean"?!!o.allowEmptyArrays:np.allowEmptyArrays,arrayFormat:N,charset:s,charsetSentinel:typeof o.charsetSentinel=="boolean"?o.charsetSentinel:np.charsetSentinel,commaRoundTrip:!!o.commaRoundTrip,delimiter:typeof o.delimiter>"u"?np.delimiter:o.delimiter,encode:typeof o.encode=="boolean"?o.encode:np.encode,encodeDotInKeys:typeof o.encodeDotInKeys=="boolean"?o.encodeDotInKeys:np.encodeDotInKeys,encoder:typeof o.encoder=="function"?o.encoder:np.encoder,encodeValuesOnly:typeof o.encodeValuesOnly=="boolean"?o.encodeValuesOnly:np.encodeValuesOnly,filter:C,format:p,formatter:y,serializeDate:typeof o.serializeDate=="function"?o.serializeDate:np.serializeDate,skipNulls:typeof o.skipNulls=="boolean"?o.skipNulls:np.skipNulls,sort:typeof o.sort=="function"?o.sort:null,strictNullHandling:typeof o.strictNullHandling=="boolean"?o.strictNullHandling:np.strictNullHandling}}function IBn(o,s={}){let p=o;const y=ABn(s);let C,N;typeof y.filter=="function"?(N=y.filter,p=N("",p)):x6(y.filter)&&(N=y.filter,C=N);const L=[];if(typeof p!="object"||p===null)return"";const z=hOe[y.arrayFormat],G=z==="comma"&&y.commaRoundTrip;C||(C=Object.keys(p)),y.sort&&C.sort(y.sort);const q=new WeakMap;for(let et=0;et<C.length;++et){const st=C[et];y.skipNulls&&p[st]===null||fOe(L,dOe(p[st],st,z,G,y.allowEmptyArrays,y.strictNullHandling,y.skipNulls,y.encodeDotInKeys,y.encode?y.encoder:null,y.filter,y.sort,y.allowDots,y.serializeDate,y.format,y.formatter,y.encodeValuesOnly,y.charset,q))}const nt=L.join(y.delimiter);let tt=y.addQueryPrefix===!0?"?":"";return y.charsetSentinel&&(y.charset==="iso-8859-1"?tt+="utf8=%26%2310003%3B&":tt+="utf8=%E2%9C%93&"),nt.length>0?tt+nt:""}function OBn(o){let s=0;for(const C of o)s+=C.length;const p=new Uint8Array(s);let y=0;for(const C of o)p.set(C,y),y+=C.length;return p}let YCe;function ZFt(o){let s;return(YCe??(s=new globalThis.TextEncoder,YCe=s.encode.bind(s)))(o)}let VCe;function XCe(o){let s;return(VCe??(s=new globalThis.TextDecoder,VCe=s.decode.bind(s)))(o)}var _w,xw;class Zmt{constructor(){_w.set(this,void 0),xw.set(this,void 0),tc(this,_w,new Uint8Array),tc(this,xw,null)}decode(s){if(s==null)return[];const p=s instanceof ArrayBuffer?new Uint8Array(s):typeof s=="string"?ZFt(s):s;tc(this,_w,OBn([wr(this,_w,"f"),p]));const y=[];let C;for(;(C=NBn(wr(this,_w,"f"),wr(this,xw,"f")))!=null;){if(C.carriage&&wr(this,xw,"f")==null){tc(this,xw,C.index);continue}if(wr(this,xw,"f")!=null&&(C.index!==wr(this,xw,"f")+1||C.carriage)){y.push(XCe(wr(this,_w,"f").subarray(0,wr(this,xw,"f")-1))),tc(this,_w,wr(this,_w,"f").subarray(wr(this,xw,"f"))),tc(this,xw,null);continue}const N=wr(this,xw,"f")!==null?C.preceding-1:C.preceding,L=XCe(wr(this,_w,"f").subarray(0,N));y.push(L),tc(this,_w,wr(this,_w,"f").subarray(C.index)),tc(this,xw,null)}return y}flush(){return wr(this,_w,"f").length?this.decode(`
|
|
1832
1832
|
`):[]}}_w=new WeakMap,xw=new WeakMap;Zmt.NEWLINE_CHARS=new Set([`
|
|
1833
1833
|
`,"\r"]);Zmt.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function NBn(o,s){for(let C=s??0;C<o.length;C++){if(o[C]===10)return{preceding:C,index:C+1,carriage:!1};if(o[C]===13)return{preceding:C,index:C+1,carriage:!0}}return null}function PBn(o){for(let y=0;y<o.length-1;y++){if(o[y]===10&&o[y+1]===10||o[y]===13&&o[y+1]===13)return y+2;if(o[y]===13&&o[y+1]===10&&y+3<o.length&&o[y+2]===13&&o[y+3]===10)return y+4}return-1}class C6{constructor(s,p){this.iterator=s,this.controller=p}static fromSSEResponse(s,p){let y=!1;async function*C(){if(y)throw new Ho("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");y=!0;let N=!1;try{for await(const L of LBn(s,p))if(!N){if(L.data.startsWith("[DONE]")){N=!0;continue}if(L.event===null||L.event.startsWith("response.")||L.event.startsWith("transcript.")){let z;try{z=JSON.parse(L.data)}catch(G){throw console.error("Could not parse message into JSON:",L.data),console.error("From chunk:",L.raw),G}if(z&&z.error)throw new Lg(void 0,z.error,void 0,s.headers);yield z}else{let z;try{z=JSON.parse(L.data)}catch(G){throw console.error("Could not parse message into JSON:",L.data),console.error("From chunk:",L.raw),G}if(L.event=="error")throw new Lg(void 0,z.error,z.message,void 0);yield{event:L.event,data:z}}}N=!0}catch(L){if(eFt(L))return;throw L}finally{N||p.abort()}}return new C6(C,p)}static fromReadableStream(s,p){let y=!1;async function*C(){const L=new Zmt,z=lOe(s);for await(const G of z)for(const q of L.decode(G))yield q;for(const G of L.flush())yield G}async function*N(){if(y)throw new Ho("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");y=!0;let L=!1;try{for await(const z of C())L||z&&(yield JSON.parse(z));L=!0}catch(z){if(eFt(z))return;throw z}finally{L||p.abort()}}return new C6(N,p)}[Symbol.asyncIterator](){return this.iterator()}tee(){const s=[],p=[],y=this.iterator(),C=N=>({next:()=>{if(N.length===0){const L=y.next();s.push(L),p.push(L)}return N.shift()}});return[new C6(()=>C(s),this.controller),new C6(()=>C(p),this.controller)]}toReadableStream(){const s=this;let p;return cOe({async start(){p=s[Symbol.asyncIterator]()},async pull(y){try{const{value:C,done:N}=await p.next();if(N)return y.close();const L=ZFt(JSON.stringify(C)+`
|
|
1834
1834
|
`);y.enqueue(L)}catch(C){y.error(C)}},async cancel(){var y;await((y=p.return)==null?void 0:y.call(p))}})}}async function*LBn(o,s){if(!o.body)throw s.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new Ho("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new Ho("Attempted to iterate over a response with no body");const p=new RBn,y=new Zmt,C=lOe(o.body);for await(const N of MBn(C))for(const L of y.decode(N)){const z=p.decode(L);z&&(yield z)}for(const N of y.flush()){const L=p.decode(N);L&&(yield L)}}async function*MBn(o){let s=new Uint8Array;for await(const p of o){if(p==null)continue;const y=p instanceof ArrayBuffer?new Uint8Array(p):typeof p=="string"?ZFt(p):p;let C=new Uint8Array(s.length+y.length);C.set(s),C.set(y,s.length),s=C;let N;for(;(N=PBn(s))!==-1;)yield s.slice(0,N),s=s.slice(N)}s.length>0&&(yield s)}class RBn{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(s){if(s.endsWith("\r")&&(s=s.substring(0,s.length-1)),!s){if(!this.event&&!this.data.length)return null;const N={event:this.event,data:this.data.join(`
|