@agentica/chat 0.30.2 → 0.30.3
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-C7DOR9VK.js → VendorConfigurationMovie-DXXxsaqZ.js} +57 -54
- package/dist/assets/bbs/{index-D7KR-pzp.js → index-Csew08S_.js} +90 -90
- package/dist/assets/shopping/{index.html-B6tsapyw.js → index.html-BuMXyzAL.js} +1 -1
- package/dist/assets/uploader/{index.html-CYIvUF8o.js → index.html-BGj4gsfz.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 +4 -4
package/dist/assets/{VendorConfigurationMovie-C7DOR9VK.js → VendorConfigurationMovie-DXXxsaqZ.js}
RENAMED
|
@@ -27,7 +27,10 @@ import{O as BAe,r as hn,P as jIn,Q as HIn,d as Im,S as zIn,U as UIn,V as FAe,x a
|
|
|
27
27
|
animation: ${xBt} 1.4s ease-in-out infinite;
|
|
28
28
|
`:null,WOn=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,zOn,s)},KOn=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:UOn||{animation:`${_Bt} 1.4s linear infinite`}},...Object.entries(o.palette).filter(Am()).map(([s])=>({props:{color:s},style:{color:(o.vars||o).palette[s].main}}))]}))),GOn=Ia("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(o,s)=>s.svg})({display:"block"}),YOn=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:qOn||{animation:`${xBt} 1.4s ease-in-out infinite`}}]}))),tIe=hn.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:et=0,variant:tt="indeterminate",...nt}=y,st={...y,color:N,disableShrink:L,size:z,thickness:q,value:et,variant:tt},at=WOn(st),Ot={},Dt={},St={};if(tt==="determinate"){const ie=2*Math.PI*((eC-q)/2);Ot.strokeDasharray=ie.toFixed(3),St["aria-valuenow"]=Math.round(et),Ot.strokeDashoffset=`${((100-et)/100*ie).toFixed(3)}px`,Dt.transform="rotate(-90deg)"}return le.jsx(KOn,{className:bo(at.root,C),style:{width:z,height:z,...Dt,...G},ownerState:st,ref:p,role:"progressbar",...St,...nt,children:le.jsx(GOn,{className:at.svg,ownerState:st,viewBox:`${eC/2} ${eC/2} ${eC} ${eC}`,children:le.jsx(YOn,{className:at.circle,style:Ot,ownerState:st,cx:eC,cy:eC,r:(eC-q)/2,fill:"none",strokeWidth:q})})})});function VOn(o){return Vc("MuiIconButton",o)}const GSe=au("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),XOn=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,VOn,s)},QOn=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)}}],[`&.${GSe.disabled}`]:{backgroundColor:"transparent",color:(o.vars||o).palette.action.disabled},[`&.${GSe.loading}`]:{color:"transparent"}}))),JOn=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"}}]})),YSe=hn.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:et="medium",id:tt,loading:nt=null,loadingIndicator:st,...at}=y,Ot=VQ(tt),Dt=st??le.jsx(tIe,{"aria-labelledby":Ot,color:"inherit",size:16}),St={...y,edge:C,color:z,disabled:G,disableFocusRipple:q,loading:nt,loadingIndicator:Dt,size:et},ie=XOn(St);return le.jsxs(QOn,{id:nt?Ot:tt,className:bo(ie.root,L),centerRipple:!0,focusRipple:!q,disabled:G||nt,ref:p,...at,ownerState:St,children:[typeof nt=="boolean"&&le.jsx("span",{className:ie.loadingWrapper,style:{display:"contents"},children:le.jsx(JOn,{className:ie.loadingIndicator,ownerState:St,children:nt&&Dt})}),N]})});function ZOn(o){return Vc("MuiAppBar",o)}au("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const tNn=o=>{const{color:s,position:p,classes:y}=o,C={root:["root",`color${fa(s)}`,`position${fa(p)}`]};return Hc(C,ZOn,y)},VSe=(o,s)=>o?`${o==null?void 0:o.replace(")","")}, ${s})`:s,eNn=Ia(XQ,{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?VSe(o.vars.palette.AppBar.darkBg,"var(--AppBar-background)"):null,color:o.vars?VSe(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"})}}]}))),XSe=hn.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},et=tNn(q);return le.jsx(eNn,{square:!0,component:"header",ownerState:q,elevation:4,className:bo(et.root,C,z==="fixed"&&"mui-fixed"),ref:p,...G})});function nNn(o){return typeof o=="function"?o():o}const rNn=hn.forwardRef(function(s,p){const{children:y,container:C,disablePortal:N=!1}=s,[L,z]=hn.useState(null),G=Im(hn.isValidElement(y)?r$(y):null,p);if(gP(()=>{N||z(nNn(C)||document.body)},[C,N]),gP(()=>{if(L&&!N)return USe(p,L),()=>{USe(p,null)}},[p,L,N]),N){if(hn.isValidElement(y)){const q={ref:G};return hn.cloneElement(y,q)}return y}return L&&XIn.createPortal(y,L)}),iNn=a5(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 aNn(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"]),sNn=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,aNn,s)},oNn=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}}}}))]}})),cNn=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 QSe(o){return o.key==="Backspace"||o.key==="Delete"}const QQ=hn.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:et=!1,icon:tt,label:nt,onClick:st,onDelete:at,onKeyDown:Ot,onKeyUp:Dt,size:St="medium",variant:ie="filled",tabIndex:ae,skipFocusWhenDisabled:Ne=!1,...pn}=y,de=hn.useRef(null),cn=Im(de,p),er=li=>{li.stopPropagation(),at&&at(li)},Dn=li=>{li.currentTarget===li.target&&QSe(li)&&li.preventDefault(),Ot&&Ot(li)},jn=li=>{li.currentTarget===li.target&&at&&QSe(li)&&at(li),Dt&&Dt(li)},or=L!==!1&&st?!0:L,gr=or||at?GF:G||"div",fi={...y,component:gr,disabled:et,size:St,color:z,iconColor:hn.isValidElement(tt)&&tt.props.color||z,onDelete:!!at,clickable:or,variant:ie},pi=sNn(fi),Or=gr===GF?{component:G||"div",focusVisibleClassName:pi.focusVisible,...at&&{disableRipple:!0}}:{};let di=null;at&&(di=q&&hn.isValidElement(q)?hn.cloneElement(q,{className:bo(q.props.className,pi.deleteIcon),onClick:er}):le.jsx(iNn,{className:bo(pi.deleteIcon),onClick:er}));let Ea=null;C&&hn.isValidElement(C)&&(Ea=hn.cloneElement(C,{className:bo(pi.avatar,C.props.className)}));let Qi=null;return tt&&hn.isValidElement(tt)&&(Qi=hn.cloneElement(tt,{className:bo(pi.icon,tt.props.className)})),le.jsxs(oNn,{as:gr,className:bo(pi.root,N),disabled:or&&et?!0:void 0,onClick:st,onKeyDown:Dn,onKeyUp:jn,ref:cn,tabIndex:Ne&&et?-1:ae,ownerState:fi,...Or,...pn,children:[Ea||Qi,le.jsx(cNn,{className:bo(pi.label),ownerState:fi,children:nt}),di]})});function _bt(o){return parseInt(o,10)||0}const uNn={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function lNn(o){for(const s in o)return!1;return!0}function JSe(o){return lNn(o)||o.outerHeightStyle===0&&!o.overflowing}const hNn=hn.forwardRef(function(s,p){const{onChange:y,maxRows:C,minRows:N=1,style:L,value:z,...G}=s,{current:q}=hn.useRef(z!=null),et=hn.useRef(null),tt=Im(p,et),nt=hn.useRef(null),st=hn.useRef(null),at=hn.useCallback(()=>{const ae=et.current,Ne=st.current;if(!ae||!Ne)return;const de=r5(ae).getComputedStyle(ae);if(de.width==="0px")return{outerHeightStyle:0,overflowing:!1};Ne.style.width=de.width,Ne.value=ae.value||s.placeholder||"x",Ne.value.slice(-1)===`
|
|
29
29
|
`&&(Ne.value+=" ");const cn=de.boxSizing,er=_bt(de.paddingBottom)+_bt(de.paddingTop),Dn=_bt(de.borderBottomWidth)+_bt(de.borderTopWidth),jn=Ne.scrollHeight;Ne.value="x";const or=Ne.scrollHeight;let gr=jn;N&&(gr=Math.max(Number(N)*or,gr)),C&&(gr=Math.min(Number(C)*or,gr)),gr=Math.max(gr,or);const fi=gr+(cn==="border-box"?er+Dn:0),pi=Math.abs(gr-jn)<=1;return{outerHeightStyle:fi,overflowing:pi}},[C,N,s.placeholder]),Ot=mBt(()=>{const ae=et.current,Ne=at();if(!ae||!Ne||JSe(Ne))return!1;const pn=Ne.outerHeightStyle;return nt.current!=null&&nt.current!==pn}),Dt=hn.useCallback(()=>{const ae=et.current,Ne=at();if(!ae||!Ne||JSe(Ne))return;const pn=Ne.outerHeightStyle;nt.current!==pn&&(nt.current=pn,ae.style.height=`${pn}px`),ae.style.overflow=Ne.overflowing?"hidden":""},[at]),St=hn.useRef(-1);gP(()=>{const ae=NFt(Dt),Ne=et==null?void 0:et.current;if(!Ne)return;const pn=r5(Ne);pn.addEventListener("resize",ae);let de;return typeof ResizeObserver<"u"&&(de=new ResizeObserver(()=>{Ot()&&(de.unobserve(Ne),cancelAnimationFrame(St.current),Dt(),St.current=requestAnimationFrame(()=>{de.observe(Ne)}))}),de.observe(Ne)),()=>{ae.clear(),cancelAnimationFrame(St.current),pn.removeEventListener("resize",ae),de&&de.disconnect()}},[at,Dt,Ot]),gP(()=>{Dt()});const ie=ae=>{q||Dt(),y&&y(ae)};return le.jsxs(hn.Fragment,{children:[le.jsx("textarea",{value:z,onChange:ie,ref:tt,rows:N,style:L,...G}),le.jsx("textarea",{"aria-hidden":!0,className:s.className,readOnly:!0,ref:st,tabIndex:-1,style:{...uNn.shadow,...L,paddingTop:0,paddingBottom:0}})]})});function _C({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 LFt=hn.createContext(void 0);function N6(){return hn.useContext(LFt)}function ZSe(o){return o!=null&&!(Array.isArray(o)&&o.length===0)}function nmt(o,s=!1){return o&&(ZSe(o.value)&&o.value!==""||s&&ZSe(o.defaultValue)&&o.defaultValue!=="")}function fNn(o){return o.startAdornment}function dNn(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 tCe;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]},pNn=o=>{const{classes:s,color:p,disabled:y,error:C,endAdornment:N,focused:L,formControl:z,fullWidth:G,hiddenLabel:q,multiline:et,readOnly:tt,size:nt,startAdornment:st,type:at}=o,Ot={root:["root",`color${fa(p)}`,y&&"disabled",C&&"error",G&&"fullWidth",L&&"focused",z&&"formControl",nt&&nt!=="medium"&&`size${fa(nt)}`,et&&"multiline",st&&"adornedStart",N&&"adornedEnd",q&&"hiddenLabel",tt&&"readOnly"],input:["input",y&&"disabled",at==="search"&&"inputTypeSearch",et&&"inputMultiline",nt==="small"&&"inputSizeSmall",q&&"inputHiddenLabel",st&&"inputAdornedStart",N&&"inputAdornedEnd",tt&&"readOnly"]};return Hc(Ot,dNn,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"}}]}})),eCe=QIn({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),MFt=hn.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:et={},defaultValue:tt,disabled:nt,disableInjectingGlobalStyles:st,endAdornment:at,error:Ot,fullWidth:Dt=!1,id:St,inputComponent:ie="input",inputProps:ae={},inputRef:Ne,margin:pn,maxRows:de,minRows:cn,multiline:er=!1,name:Dn,onBlur:jn,onChange:or,onClick:gr,onFocus:fi,onKeyDown:pi,onKeyUp:Or,placeholder:di,readOnly:Ea,renderSuffix:Qi,rows:li,size:ze,slotProps:Ba={},slots:Ts={},startAdornment:Ke,type:xo="text",value:Ss,...Pa}=y,zo=ae.value!=null?ae.value:Ss,{current:$u}=hn.useRef(zo!=null),gu=hn.useRef(),Ds=hn.useCallback(su=>{},[]),pc=Im(gu,Ne,ae.ref,Ds),[bu,P1]=hn.useState(!1),il=N6(),Rh=_C({props:y,muiFormControl:il,states:["color","disabled","error","hiddenLabel","size","required","filled"]});Rh.focused=il?il.focused:bu,hn.useEffect(()=>{!il&&nt&&bu&&(P1(!1),jn&&jn())},[il,nt,bu,jn]);const Mg=il&&il.onFilled,Rg=il&&il.onEmpty,Dg=hn.useCallback(su=>{nmt(su)?Mg&&Mg():Rg&&Rg()},[Mg,Rg]);gP(()=>{$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=>{jn&&jn(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(WAe(1));Dg({value:d0.value})}ae.onChange&&ae.onChange(su,...Bg),or&&or(su,...Bg)};hn.useEffect(()=>{Dg(gu.current)},[]);const Vp=su=>{gu.current&&su.currentTarget===su.target&&gu.current.focus(),gr&&gr(su)};let Iw=ie,Jd=ae;er&&Iw==="input"&&(li?Jd={type:void 0,minRows:li,maxRows:li,...Jd}:Jd={type:void 0,maxRows:de,minRows:cn,...Jd},Iw=hNn);const R3=su=>{Dg(su.animationName==="mui-auto-fill-cancel"?gu.current:{value:"x"})};hn.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:Dt,hiddenLabel:Rh.hiddenLabel,multiline:er,size:Rh.size,startAdornment:Ke,type:xo},da=pNn(Hr),Ws=Ts.root||q.Root||jmt,gc=Ba.root||et.root||{},Cu=Ts.input||q.Input||Hmt;return Jd={...Jd,...Ba.input??et.input},le.jsxs(hn.Fragment,{children:[!st&&typeof eCe=="function"&&(tCe||(tCe=le.jsx(eCe,{}))),le.jsxs(Ws,{...gc,ref:p,onClick:Vp,...Pa,...!yBt(Ws)&&{ownerState:{...Hr,...gc.ownerState}},className:bo(da.root,gc.className,z,Ea&&"MuiInputBase-readOnly"),children:[Ke,le.jsx(LFt.Provider,{value:null,children:le.jsx(Cu,{"aria-invalid":Rh.error,"aria-describedby":C,autoComplete:N,autoFocus:L,defaultValue:tt,disabled:Rh.disabled,id:St,onAnimationStart:R3,name:Dn,placeholder:di,readOnly:Ea,required:Rh.required,rows:li,value:zo,onKeyDown:pi,onKeyUp:Or,type:xo,...Jd,...!yBt(Cu)&&{as:Iw,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 gNn(o){return Vc("MuiInput",o)}const oQ={...YF,...au("MuiInput",["root","underline","input"])};function bNn(o){return Vc("MuiOutlinedInput",o)}const m6={...YF,...au("MuiOutlinedInput",["root","notchedOutline","input"])};function mNn(o){return Vc("MuiFilledInput",o)}const nP={...YF,...au("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},yNn=a5(le.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),wNn={entering:{opacity:1},entered:{opacity:1}},vNn=hn.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:et,onEntered:tt,onEntering:nt,onExit:st,onExited:at,onExiting:Ot,style:Dt,timeout:St=C,TransitionComponent:ie=L3,...ae}=s,Ne=hn.useRef(null),pn=Im(Ne,r$(z),p),de=pi=>Or=>{if(pi){const di=Ne.current;Or===void 0?pi(di):pi(di,Or)}},cn=de(nt),er=de((pi,Or)=>{PFt(pi);const di=pC({style:Dt,timeout:St,easing:G},{mode:"enter"});pi.style.webkitTransition=y.transitions.create("opacity",di),pi.style.transition=y.transitions.create("opacity",di),et&&et(pi,Or)}),Dn=de(tt),jn=de(Ot),or=de(pi=>{const Or=pC({style:Dt,timeout:St,easing:G},{mode:"exit"});pi.style.webkitTransition=y.transitions.create("opacity",Or),pi.style.transition=y.transitions.create("opacity",Or),st&&st(pi)}),gr=de(at),fi=pi=>{N&&N(Ne.current,pi)};return le.jsx(ie,{appear:L,in:q,nodeRef:Ne,onEnter:er,onEntered:Dn,onEntering:cn,onExit:or,onExited:gr,onExiting:jn,addEndListener:fi,timeout:St,...ae,children:(pi,{ownerState:Or,...di})=>hn.cloneElement(z,{style:{opacity:0,visibility:pi==="exited"&&!q?"hidden":void 0,...wNn[pi],...Dt,...z.props.style},ref:pn,...di})})});function _Nn(o){return Vc("MuiBackdrop",o)}au("MuiBackdrop",["root","invisible"]);const xNn=o=>{const{classes:s,invisible:p}=o;return Hc({root:["root",p&&"invisible"]},_Nn,s)},ENn=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"}}]}),TNn=hn.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:et={},slotProps:tt={},slots:nt={},TransitionComponent:st,transitionDuration:at,...Ot}=y,Dt={...y,component:L,invisible:z},St=xNn(Dt),ie={transition:st,root:q.Root,...nt},ae={...et,...tt},Ne={slots:ie,slotProps:ae},[pn,de]=wh("root",{elementType:ENn,externalForwardedProps:Ne,className:bo(St.root,N),ownerState:Dt}),[cn,er]=wh("transition",{elementType:vNn,externalForwardedProps:Ne,ownerState:Dt});return le.jsx(cn,{in:G,timeout:at,...Ot,...er,children:le.jsx(pn,{"aria-hidden":!0,...de,classes:St,ref:p,children:C})})});function kNn(o){return Vc("MuiButton",o)}const rP=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"]),SNn=hn.createContext({}),CNn=hn.createContext(void 0),ANn=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"]},et=Hc(q,kNn,G);return{...G,...et}},eIe=[{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}}}],INn=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"},[`&.${rP.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]},[`&.${rP.focusVisible}`]:{boxShadow:(o.vars||o).shadows[6]},[`&.${rP.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)",[`&.${rP.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"},[`&.${rP.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${rP.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}),[`&.${rP.loading}`]:{color:"transparent"}}}]}})),ONn=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}},...eIe]})),NNn=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}},...eIe]})),PNn=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}}]})),nCe=Ia("span",{name:"MuiButton",slot:"LoadingIconPlaceholder",overridesResolver:(o,s)=>s.loadingIconPlaceholder})({display:"inline-block",width:"1em",height:"1em"}),rmt=hn.forwardRef(function(s,p){const y=hn.useContext(SNn),C=hn.useContext(CNn),N=FAe(y,s),L=Su({props:N,name:"MuiButton"}),{children:z,color:G="primary",component:q="button",className:et,disabled:tt=!1,disableElevation:nt=!1,disableFocusRipple:st=!1,endIcon:at,focusVisibleClassName:Ot,fullWidth:Dt=!1,id:St,loading:ie=null,loadingIndicator:ae,loadingPosition:Ne="center",size:pn="medium",startIcon:de,type:cn,variant:er="text",...Dn}=L,jn=VQ(St),or=ae??le.jsx(tIe,{"aria-labelledby":jn,color:"inherit",size:16}),gr={...L,color:G,component:q,disabled:tt,disableElevation:nt,disableFocusRipple:st,fullWidth:Dt,loading:ie,loadingIndicator:or,loadingPosition:Ne,size:pn,type:cn,variant:er},fi=ANn(gr),pi=(de||ie&&Ne==="start")&&le.jsx(ONn,{className:fi.startIcon,ownerState:gr,children:de||le.jsx(nCe,{className:fi.loadingIconPlaceholder,ownerState:gr})}),Or=(at||ie&&Ne==="end")&&le.jsx(NNn,{className:fi.endIcon,ownerState:gr,children:at||le.jsx(nCe,{className:fi.loadingIconPlaceholder,ownerState:gr})}),di=C||"",Ea=typeof ie=="boolean"?le.jsx("span",{className:fi.loadingWrapper,style:{display:"contents"},children:ie&&le.jsx(PNn,{className:fi.loadingIndicator,ownerState:gr,children:or})}):null;return le.jsxs(INn,{ownerState:gr,className:bo(y.className,fi.root,et,di),component:q,disabled:tt||ie,focusRipple:!st,focusVisibleClassName:bo(fi.focusVisible,Ot),ref:p,type:cn,id:ie?jn:St,...Dn,classes:fi,children:[pi,Ne!=="end"&&Ea,z,Ne==="end"&&Ea,Or]})});function LNn(o){return Vc("MuiCard",o)}au("MuiCard",["root"]);const MNn=o=>{const{classes:s}=o;return Hc({root:["root"]},LNn,s)},RNn=Ia(XQ,{name:"MuiCard",slot:"Root",overridesResolver:(o,s)=>s.root})({overflow:"hidden"}),JQ=hn.forwardRef(function(s,p){const y=Su({props:s,name:"MuiCard"}),{className:C,raised:N=!1,...L}=y,z={...y,raised:N},G=MNn(z);return le.jsx(RNn,{className:bo(G.root,C),elevation:N?8:void 0,ref:p,ownerState:z,...L})});function DNn(o){return Vc("MuiCardActions",o)}au("MuiCardActions",["root","spacing"]);const BNn=o=>{const{classes:s,disableSpacing:p}=o;return Hc({root:["root",!p&&"spacing"]},DNn,s)},FNn=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}}}]}),nIe=hn.forwardRef(function(s,p){const y=Su({props:s,name:"MuiCardActions"}),{disableSpacing:C=!1,className:N,...L}=y,z={...y,disableSpacing:C},G=BNn(z);return le.jsx(FNn,{className:bo(G.root,N),ownerState:z,ref:p,...L})});function $Nn(o){return Vc("MuiCardContent",o)}au("MuiCardContent",["root"]);const jNn=o=>{const{classes:s}=o;return Hc({root:["root"]},$Nn,s)},HNn=Ia("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(o,s)=>s.root})({padding:16,"&:last-child":{paddingBottom:24}}),bP=hn.forwardRef(function(s,p){const y=Su({props:s,name:"MuiCardContent"}),{className:C,component:N="div",...L}=y,z={...y,component:N},G=jNn(z);return le.jsx(HNn,{as:N,className:bo(G.root,C),ownerState:z,ref:p,...L})});function zNn(o){return Vc("PrivateSwitchBase",o)}au("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const UNn=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,zNn,s)},qNn=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}}]}),WNn=Ia("input",{shouldForwardProp:ny})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),KNn=hn.forwardRef(function(s,p){const{autoFocus:y,checked:C,checkedIcon:N,defaultChecked:L,disabled:z,disableFocusRipple:G=!1,edge:q=!1,icon:et,id:tt,inputProps:nt,inputRef:st,name:at,onBlur:Ot,onChange:Dt,onFocus:St,readOnly:ie,required:ae=!1,tabIndex:Ne,type:pn,value:de,slots:cn={},slotProps:er={},...Dn}=s,[jn,or]=jQ({controlled:C,default:!!L,name:"SwitchBase",state:"checked"}),gr=N6(),fi=Ss=>{St&&St(Ss),gr&&gr.onFocus&&gr.onFocus(Ss)},pi=Ss=>{Ot&&Ot(Ss),gr&&gr.onBlur&&gr.onBlur(Ss)},Or=Ss=>{if(Ss.nativeEvent.defaultPrevented)return;const Pa=Ss.target.checked;or(Pa),Dt&&Dt(Ss,Pa)};let di=z;gr&&typeof di>"u"&&(di=gr.disabled);const Ea=pn==="checkbox"||pn==="radio",Qi={...s,checked:jn,disabled:di,disableFocusRipple:G,edge:q},li=UNn(Qi),ze={slots:cn,slotProps:{input:nt,...er}},[Ba,Ts]=wh("root",{ref:p,elementType:qNn,className:li.root,shouldForwardComponentProp:!0,externalForwardedProps:{...ze,component:"span",...Dn},getSlotProps:Ss=>({...Ss,onFocus:Pa=>{var zo;(zo=Ss.onFocus)==null||zo.call(Ss,Pa),fi(Pa)},onBlur:Pa=>{var zo;(zo=Ss.onBlur)==null||zo.call(Ss,Pa),pi(Pa)}}),ownerState:Qi,additionalProps:{centerRipple:!0,focusRipple:!G,disabled:di,role:void 0,tabIndex:null}}),[Ke,xo]=wh("input",{ref:st,elementType:WNn,className:li.input,externalForwardedProps:ze,getSlotProps:Ss=>({onChange:Pa=>{var zo;(zo=Ss.onChange)==null||zo.call(Ss,Pa),Or(Pa)}}),ownerState:Qi,additionalProps:{autoFocus:y,checked:C,defaultChecked:L,disabled:di,id:Ea?tt:void 0,name:at,readOnly:ie,required:ae,tabIndex:Ne,type:pn,...pn==="checkbox"&&de===void 0?{}:{value:de}}});return le.jsxs(Ba,{...Ts,children:[le.jsx(Ke,{...xo}),jn?N:et]})}),rCe=mOn({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 GNn(o){const s=n5(o);return s.body===o?r5(o).innerWidth>s.documentElement.clientWidth:o.scrollHeight>o.clientHeight}function CQ(o,s){s?o.setAttribute("aria-hidden","true"):o.removeAttribute("aria-hidden")}function iCe(o){return parseInt(r5(o).getComputedStyle(o).paddingRight,10)||0}function YNn(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 aCe(o,s,p,y,C){const N=[s,p,...y];[].forEach.call(o.children,L=>{const z=!N.includes(L),G=!YNn(L);z&&G&&CQ(L,C)})}function DDt(o,s){let p=-1;return o.some((y,C)=>s(y)?(p=C,!0):!1),p}function VNn(o,s){const p=[],y=o.container;if(!s.disableScrollLock){if(GNn(y)){const L=GAe(r5(y));p.push({value:y.style.paddingRight,property:"padding-right",el:y}),y.style.paddingRight=`${iCe(y)+L}px`;const z=n5(y).querySelectorAll(".mui-fixed");[].forEach.call(z,G=>{p.push({value:G.style.paddingRight,property:"padding-right",el:G}),G.style.paddingRight=`${iCe(G)+L}px`})}let N;if(y.parentNode instanceof DocumentFragment)N=n5(y).body;else{const L=y.parentElement,z=r5(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 XNn(o){const s=[];return[].forEach.call(o.children,p=>{p.getAttribute("aria-hidden")==="true"&&s.push(p)}),s}class QNn{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&&CQ(s.modalRef,!1);const C=XNn(p);aCe(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=VNn(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&&CQ(s.modalRef,p),aCe(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&&CQ(L.modalRef,!1)}return y}isTopModal(s){return this.modals.length>0&&this.modals[this.modals.length-1]===s}}const JNn=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function ZNn(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 tPn(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 ePn(o){return!(o.disabled||o.tagName==="INPUT"&&o.type==="hidden"||tPn(o))}function nPn(o){const s=[],p=[];return Array.from(o.querySelectorAll(JNn)).forEach((y,C)=>{const N=ZNn(y);N===-1||!ePn(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 rPn(){return!0}function iPn(o){const{children:s,disableAutoFocus:p=!1,disableEnforceFocus:y=!1,disableRestoreFocus:C=!1,getTabbable:N=nPn,isEnabled:L=rPn,open:z}=o,G=hn.useRef(!1),q=hn.useRef(null),et=hn.useRef(null),tt=hn.useRef(null),nt=hn.useRef(null),st=hn.useRef(!1),at=hn.useRef(null),Ot=Im(r$(s),at),Dt=hn.useRef(null);hn.useEffect(()=>{!z||!at.current||(st.current=!p)},[p,z]),hn.useEffect(()=>{if(!z||!at.current)return;const ae=n5(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]),hn.useEffect(()=>{if(!z||!at.current)return;const ae=n5(at.current),Ne=cn=>{Dt.current=cn,!(y||!L()||cn.key!=="Tab")&&ae.activeElement===at.current&&cn.shiftKey&&(G.current=!0,et.current&&et.current.focus())},pn=()=>{var Dn,jn;const cn=at.current;if(cn===null)return;if(!ae.hasFocus()||!L()||G.current){G.current=!1;return}if(cn.contains(ae.activeElement)||y&&ae.activeElement!==q.current&&ae.activeElement!==et.current)return;if(ae.activeElement!==nt.current)nt.current=null;else if(nt.current!==null)return;if(!st.current)return;let er=[];if((ae.activeElement===q.current||ae.activeElement===et.current)&&(er=N(at.current)),er.length>0){const or=!!((Dn=Dt.current)!=null&&Dn.shiftKey&&((jn=Dt.current)==null?void 0:jn.key)==="Tab"),gr=er[0],fi=er[er.length-1];typeof gr!="string"&&typeof fi!="string"&&(or?fi.focus():gr.focus())}else cn.focus()};ae.addEventListener("focusin",pn),ae.addEventListener("keydown",Ne,!0);const de=setInterval(()=>{ae.activeElement&&ae.activeElement.tagName==="BODY"&&pn()},50);return()=>{clearInterval(de),ae.removeEventListener("focusin",pn),ae.removeEventListener("keydown",Ne,!0)}},[p,y,C,L,z,N]);const St=ae=>{tt.current===null&&(tt.current=ae.relatedTarget),st.current=!0,nt.current=ae.target;const Ne=s.props.onFocus;Ne&&Ne(ae)},ie=ae=>{tt.current===null&&(tt.current=ae.relatedTarget),st.current=!0};return le.jsxs(hn.Fragment,{children:[le.jsx("div",{tabIndex:z?0:-1,onFocus:ie,ref:q,"data-testid":"sentinelStart"}),hn.cloneElement(s,{ref:Ot,onFocus:St}),le.jsx("div",{tabIndex:z?0:-1,onFocus:ie,ref:et,"data-testid":"sentinelEnd"})]})}function aPn(o){return typeof o=="function"?o():o}function sPn(o){return o?o.props.hasOwnProperty("in"):!1}const sCe=()=>{},xbt=new QNn;function oPn(o){const{container:s,disableEscapeKeyDown:p=!1,disableScrollLock:y=!1,closeAfterTransition:C=!1,onTransitionEnter:N,onTransitionExited:L,children:z,onClose:G,open:q,rootRef:et}=o,tt=hn.useRef({}),nt=hn.useRef(null),st=hn.useRef(null),at=Im(st,et),[Ot,Dt]=hn.useState(!q),St=sPn(z);let ie=!0;(o["aria-hidden"]==="false"||o["aria-hidden"]===!1)&&(ie=!1);const ae=()=>n5(nt.current),Ne=()=>(tt.current.modalRef=st.current,tt.current.mount=nt.current,tt.current),pn=()=>{xbt.mount(Ne(),{disableScrollLock:y}),st.current&&(st.current.scrollTop=0)},de=mBt(()=>{const Or=aPn(s)||ae().body;xbt.add(Ne(),Or),st.current&&pn()}),cn=()=>xbt.isTopModal(Ne()),er=mBt(Or=>{nt.current=Or,Or&&(q&&cn()?pn():st.current&&CQ(st.current,ie))}),Dn=hn.useCallback(()=>{xbt.remove(Ne(),ie)},[ie]);hn.useEffect(()=>()=>{Dn()},[Dn]),hn.useEffect(()=>{q?de():(!St||!C)&&Dn()},[q,Dn,St,C,de]);const jn=Or=>di=>{var Ea;(Ea=Or.onKeyDown)==null||Ea.call(Or,di),!(di.key!=="Escape"||di.which===229||!cn())&&(p||(di.stopPropagation(),G&&G(di,"escapeKeyDown")))},or=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=JIn(o);delete di.onTransitionEnter,delete di.onTransitionExited;const Ea={...di,...Or};return{role:"presentation",...Ea,onKeyDown:jn(Ea),ref:at}},getBackdropProps:(Or={})=>{const di=Or;return{"aria-hidden":!0,...di,onClick:or(di),open:q}},getTransitionProps:()=>{const Or=()=>{Dt(!1),N&&N()},di=()=>{Dt(!0),L&&L(),C&&Dn()};return{onEnter:wBt(Or,(z==null?void 0:z.props.onEnter)??sCe),onExited:wBt(di,(z==null?void 0:z.props.onExited)??sCe)}},rootRef:at,portalRef:er,isTopModal:cn,exited:Ot,hasTransition:St}}function cPn(o){return Vc("MuiModal",o)}au("MuiModal",["root","hidden","backdrop"]);const uPn=o=>{const{open:s,exited:p,classes:y}=o;return Hc({root:["root",!s&&p&&"hidden"],backdrop:["backdrop"]},cPn,y)},lPn=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"}}]}))),hPn=Ia(TNn,{name:"MuiModal",slot:"Backdrop",overridesResolver:(o,s)=>s.backdrop})({zIndex:-1}),rIe=hn.forwardRef(function(s,p){const y=Su({name:"MuiModal",props:s}),{BackdropComponent:C=hPn,BackdropProps:N,classes:L,className:z,closeAfterTransition:G=!1,children:q,container:et,component:tt,components:nt={},componentsProps:st={},disableAutoFocus:at=!1,disableEnforceFocus:Ot=!1,disableEscapeKeyDown:Dt=!1,disablePortal:St=!1,disableRestoreFocus:ie=!1,disableScrollLock:ae=!1,hideBackdrop:Ne=!1,keepMounted:pn=!1,onBackdropClick:de,onClose:cn,onTransitionEnter:er,onTransitionExited:Dn,open:jn,slotProps:or={},slots:gr={},theme:fi,...pi}=y,Or={...y,closeAfterTransition:G,disableAutoFocus:at,disableEnforceFocus:Ot,disableEscapeKeyDown:Dt,disablePortal:St,disableRestoreFocus:ie,disableScrollLock:ae,hideBackdrop:Ne,keepMounted:pn},{getRootProps:di,getBackdropProps:Ea,getTransitionProps:Qi,portalRef:li,isTopModal:ze,exited:Ba,hasTransition:Ts}=oPn({...Or,rootRef:p}),Ke={...Or,exited:Ba},xo=uPn(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 Pa={slots:{root:nt.Root,backdrop:nt.Backdrop,...gr},slotProps:{...st,...or}},[zo,$u]=wh("root",{ref:p,elementType:lPn,externalForwardedProps:{...Pa,...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:Pa,shouldForwardComponentProp:!0,additionalProps:N,getSlotProps:pc=>Ea({...pc,onClick:bu=>{de&&de(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!pn&&!jn&&(!Ts||Ba)?null:le.jsx(rNn,{ref:li,container:et,disablePortal:St,children:le.jsxs(zo,{...$u,children:[!Ne&&C?le.jsx(gu,{...Ds}):null,le.jsx(iPn,{disableEnforceFocus:Ot,disableAutoFocus:at,disableRestoreFocus:ie,isEnabled:ze,open:jn,children:hn.cloneElement(q,Ss)})]})})});function fPn(o,s,p){const y=s.getBoundingClientRect(),C=p&&p.getBoundingClientRect(),N=r5(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 dPn(o){return typeof o=="function"?o():o}function Ebt(o,s,p){const y=dPn(p),C=fPn(o,s,y);C&&(s.style.webkitTransform=C,s.style.transform=C)}const pPn=hn.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:et="down",easing:tt=C,in:nt,onEnter:st,onEntered:at,onEntering:Ot,onExit:Dt,onExited:St,onExiting:ie,style:ae,timeout:Ne=N,TransitionComponent:pn=L3,...de}=s,cn=hn.useRef(null),er=Im(r$(G),cn,p),Dn=Qi=>li=>{Qi&&(li===void 0?Qi(cn.current):Qi(cn.current,li))},jn=Dn((Qi,li)=>{Ebt(et,Qi,q),PFt(Qi),st&&st(Qi,li)}),or=Dn((Qi,li)=>{const ze=pC({timeout:Ne,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",Ot&&Ot(Qi,li)}),gr=Dn(at),fi=Dn(ie),pi=Dn(Qi=>{const li=pC({timeout:Ne,style:ae,easing:tt},{mode:"exit"});Qi.style.webkitTransition=y.transitions.create("-webkit-transform",li),Qi.style.transition=y.transitions.create("transform",li),Ebt(et,Qi,q),Dt&&Dt(Qi)}),Or=Dn(Qi=>{Qi.style.webkitTransition="",Qi.style.transition="",St&&St(Qi)}),di=Qi=>{L&&L(cn.current,Qi)},Ea=hn.useCallback(()=>{cn.current&&Ebt(et,cn.current,q)},[et,q]);return hn.useEffect(()=>{if(nt||et==="down"||et==="right")return;const Qi=NFt(()=>{cn.current&&Ebt(et,cn.current,q)}),li=r5(cn.current);return li.addEventListener("resize",Qi),()=>{Qi.clear(),li.removeEventListener("resize",Qi)}},[et,nt,q]),hn.useEffect(()=>{nt||Ea()},[nt,Ea]),le.jsx(pn,{nodeRef:cn,onEnter:jn,onEntered:gr,onEntering:or,onExit:pi,onExited:Or,onExiting:fi,addEndListener:di,appear:z,in:nt,timeout:Ne,...de,children:(Qi,{ownerState:li,...ze})=>hn.cloneElement(G,{ref:er,style:{visibility:Qi==="exited"&&!nt?"hidden":void 0,...ae,...G.props.style},...ze})})});function gPn(o){return Vc("MuiDrawer",o)}au("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const iIe=(o,s)=>{const{ownerState:p}=o;return[s.root,(p.variant==="permanent"||p.variant==="persistent")&&s.docked,s.modal]},bPn=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,gPn,s)},mPn=Ia(rIe,{name:"MuiDrawer",slot:"Root",overridesResolver:iIe})(pu(({theme:o})=>({zIndex:(o.vars||o).zIndex.drawer}))),yPn=Ia("div",{shouldForwardProp:ny,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:iIe})({flex:"0 0 auto"}),wPn=Ia(XQ,{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}`}}]}))),aIe={left:"right",right:"left",top:"down",bottom:"up"};function vPn(o){return["left","right"].includes(o)}function _Pn({direction:o},s){return o==="rtl"&&vPn(s)?aIe[s]:s}const xPn=hn.forwardRef(function(s,p){const y=Su({props:s,name:"MuiDrawer"}),C=vP(),N=QAe(),L={enter:C.transitions.duration.enteringScreen,exit:C.transitions.duration.leavingScreen},{anchor:z="left",BackdropProps:G,children:q,className:et,elevation:tt=16,hideBackdrop:nt=!1,ModalProps:{BackdropProps:st,...at}={},onClose:Ot,open:Dt=!1,PaperProps:St={},SlideProps:ie,TransitionComponent:ae,transitionDuration:Ne=L,variant:pn="temporary",slots:de={},slotProps:cn={},...er}=y,Dn=hn.useRef(!1);hn.useEffect(()=>{Dn.current=!0},[]);const jn=_Pn({direction:N?"rtl":"ltr"},z),gr={...y,anchor:z,elevation:tt,open:Dt,variant:pn,...er},fi=bPn(gr),pi={slots:{transition:ae,...de},slotProps:{paper:St,transition:ie,...cn,backdrop:JAe(cn.backdrop||{...G,...st},{transitionDuration:Ne})}},[Or,di]=wh("root",{ref:p,elementType:mPn,className:bo(fi.root,fi.modal,et),shouldForwardComponentProp:!0,ownerState:gr,externalForwardedProps:{...pi,...er,...at},additionalProps:{open:Dt,onClose:Ot,hideBackdrop:nt,slots:{backdrop:pi.slots.backdrop},slotProps:{backdrop:pi.slotProps.backdrop}}}),[Ea,Qi]=wh("paper",{elementType:wPn,shouldForwardComponentProp:!0,className:bo(fi.paper,St.className),ownerState:gr,externalForwardedProps:pi,additionalProps:{elevation:pn==="temporary"?tt:0,square:!0}}),[li,ze]=wh("docked",{elementType:yPn,ref:p,className:bo(fi.root,fi.docked,et),ownerState:gr,externalForwardedProps:pi,additionalProps:er}),[Ba,Ts]=wh("transition",{elementType:pPn,ownerState:gr,externalForwardedProps:pi,additionalProps:{in:Dt,direction:aIe[jn],timeout:Ne,appear:Dn.current}}),Ke=le.jsx(Ea,{...Qi,children:q});if(pn==="permanent")return le.jsx(li,{...ze,children:Ke});const xo=le.jsx(Ba,{...Ts,children:Ke});return pn==="persistent"?le.jsx(li,{...ze,children:xo}):le.jsx(Or,{...di,children:xo})}),EPn=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,mNn,s);return{...s,...q}},TPn=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}},[`&.${nP.focused}`]:{backgroundColor:o.vars?o.vars.palette.FilledInput.bg:y},[`&.${nP.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"},[`&.${nP.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${nP.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(.${nP.disabled}, .${nP.error}):before`]:{borderBottom:`1px solid ${(o.vars||o).palette.text.primary}`},[`&.${nP.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}}]}})),kPn=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}}]}))),RFt=hn.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:et=!1,slotProps:tt,slots:nt={},type:st="text",...at}=y,Ot={...y,disableUnderline:C,fullWidth:z,inputComponent:q,multiline:et,type:st},Dt=EPn(y),St={root:{ownerState:Ot},input:{ownerState:Ot}},ie=tt??L?OFt(St,tt??L):St,ae=nt.root??N.Root??TPn,Ne=nt.input??N.Input??kPn;return le.jsx(MFt,{slots:{root:ae,input:Ne},slotProps:ie,fullWidth:z,inputComponent:q,multiline:et,ref:p,type:st,...at,classes:Dt})});RFt.muiName="Input";function SPn(o){return Vc("MuiFormControl",o)}au("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const CPn=o=>{const{classes:s,margin:p,fullWidth:y}=o,C={root:["root",p!=="none"&&`margin${fa(p)}`,y&&"fullWidth"]};return Hc(C,SPn,s)},APn=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%"}}]}),IPn=hn.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:et,fullWidth:tt=!1,hiddenLabel:nt=!1,margin:st="none",required:at=!1,size:Ot="medium",variant:Dt="outlined",...St}=y,ie={...y,color:L,component:z,disabled:G,error:q,fullWidth:tt,hiddenLabel:nt,margin:st,required:at,size:Ot,variant:Dt},ae=CPn(ie),[Ne,pn]=hn.useState(()=>{let Or=!1;return C&&hn.Children.forEach(C,di=>{if(!RDt(di,["Input","Select"]))return;const Ea=RDt(di,["Select"])?di.props.input:di;Ea&&fNn(Ea.props)&&(Or=!0)}),Or}),[de,cn]=hn.useState(()=>{let Or=!1;return C&&hn.Children.forEach(C,di=>{RDt(di,["Input","Select"])&&(nmt(di.props,!0)||nmt(di.props.inputProps,!0))&&(Or=!0)}),Or}),[er,Dn]=hn.useState(!1);G&&er&&Dn(!1);const jn=et!==void 0&&!G?et:er;let or;hn.useRef(!1);const gr=hn.useCallback(()=>{cn(!0)},[]),fi=hn.useCallback(()=>{cn(!1)},[]),pi=hn.useMemo(()=>({adornedStart:Ne,setAdornedStart:pn,color:L,disabled:G,error:q,filled:de,focused:jn,fullWidth:tt,hiddenLabel:nt,size:Ot,onBlur:()=>{Dn(!1)},onFocus:()=>{Dn(!0)},onEmpty:fi,onFilled:gr,registerEffect:or,required:at,variant:Dt}),[Ne,L,G,q,de,jn,tt,nt,or,fi,gr,at,Ot,Dt]);return le.jsx(LFt.Provider,{value:pi,children:le.jsx(APn,{as:z,ownerState:ie,className:bo(ae.root,N),ref:p,...St,children:C})})});function OPn(o){return Vc("MuiFormControlLabel",o)}const mQ=au("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),NPn=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,OPn,s)},PPn=Ia("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[{[`& .${mQ.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,[`&.${mQ.disabled}`]:{cursor:"default"},[`& .${mQ.label}`]:{[`&.${mQ.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}}]}))),LPn=Ia("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(o,s)=>s.asterisk})(pu(({theme:o})=>({[`&.${mQ.error}`]:{color:(o.vars||o).palette.error.main}}))),hk=hn.forwardRef(function(s,p){const y=Su({props:s,name:"MuiFormControlLabel"}),{checked:C,className:N,componentsProps:L={},control:z,disabled:G,disableTypography:q,inputRef:et,label:tt,labelPlacement:nt="end",name:st,onChange:at,required:Ot,slots:Dt={},slotProps:St={},value:ie,...ae}=y,Ne=N6(),pn=G??z.props.disabled??(Ne==null?void 0:Ne.disabled),de=Ot??z.props.required,cn={disabled:pn,required:de};["checked","name","onChange","value","inputRef"].forEach(Or=>{typeof z.props[Or]>"u"&&typeof y[Or]<"u"&&(cn[Or]=y[Or])});const er=_C({props:y,muiFormControl:Ne,states:["error"]}),Dn={...y,disabled:pn,labelPlacement:nt,required:de,error:er.error},jn=NPn(Dn),or={slots:Dt,slotProps:{...L,...St}},[gr,fi]=wh("typography",{elementType:A3,externalForwardedProps:or,ownerState:Dn});let pi=tt;return pi!=null&&pi.type!==A3&&!q&&(pi=le.jsx(gr,{component:"span",...fi,className:bo(jn.label,fi==null?void 0:fi.className),children:pi})),le.jsxs(PPn,{className:bo(jn.root,N),ownerState:Dn,ref:p,...ae,children:[hn.cloneElement(z,cn),de?le.jsxs("div",{children:[pi,le.jsxs(LPn,{ownerState:Dn,"aria-hidden":!0,className:jn.asterisk,children:[" ","*"]})]}):pi]})});function MPn(o){return Vc("MuiFormGroup",o)}au("MuiFormGroup",["root","row","error"]);const RPn=o=>{const{classes:s,row:p,error:y}=o;return Hc({root:["root",p&&"row",y&&"error"]},MPn,s)},DPn=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"}}]}),BPn=hn.forwardRef(function(s,p){const y=Su({props:s,name:"MuiFormGroup"}),{className:C,row:N=!1,...L}=y,z=N6(),G=_C({props:y,muiFormControl:z,states:["error"]}),q={...y,row:N,error:G.error},et=RPn(q);return le.jsx(DPn,{className:bo(et.root,C),ownerState:q,ref:p,...L})});function FPn(o){return Vc("MuiFormHelperText",o)}const oCe=au("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var cCe;const $Pn=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,FPn,s)},jPn=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,[`&.${oCe.disabled}`]:{color:(o.vars||o).palette.text.disabled},[`&.${oCe.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}}]}))),HPn=hn.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:et,margin:tt,required:nt,variant:st,...at}=y,Ot=N6(),Dt=_C({props:y,muiFormControl:Ot,states:["variant","size","disabled","error","filled","focused","required"]}),St={...y,component:L,contained:Dt.variant==="filled"||Dt.variant==="outlined",variant:Dt.variant,size:Dt.size,disabled:Dt.disabled,error:Dt.error,filled:Dt.filled,focused:Dt.focused,required:Dt.required};delete St.ownerState;const ie=$Pn(St);return le.jsx(jPn,{as:L,className:bo(ie.root,N),ref:p,...at,ownerState:St,children:C===" "?cCe||(cCe=le.jsx("span",{className:"notranslate","aria-hidden":!0,children:""})):C})});function zPn(o){return Vc("MuiFormLabel",o)}const AQ=au("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),UPn=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,zPn,s)},qPn=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:{[`&.${AQ.focused}`]:{color:(o.vars||o).palette[s].main}}})),{props:{},style:{[`&.${AQ.disabled}`]:{color:(o.vars||o).palette.text.disabled},[`&.${AQ.error}`]:{color:(o.vars||o).palette.error.main}}}]}))),WPn=Ia("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(o,s)=>s.asterisk})(pu(({theme:o})=>({[`&.${AQ.error}`]:{color:(o.vars||o).palette.error.main}}))),KPn=hn.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:et,focused:tt,required:nt,...st}=y,at=N6(),Ot=_C({props:y,muiFormControl:at,states:["color","required","focused","disabled","error","filled"]}),Dt={...y,color:Ot.color||"primary",component:z,disabled:Ot.disabled,error:Ot.error,filled:Ot.filled,focused:Ot.focused,required:Ot.required},St=UPn(Dt);return le.jsxs(qPn,{as:z,ownerState:Dt,className:bo(St.root,N),ref:p,...st,children:[C,Ot.required&&le.jsxs(WPn,{ownerState:Dt,"aria-hidden":!0,className:St.asterisk,children:[" ","*"]})]})});function EBt(o){return`scale(${o}, ${o**2})`}const GPn={entering:{opacity:1,transform:EBt(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),TBt=hn.forwardRef(function(s,p){const{addEndListener:y,appear:C=!0,children:N,easing:L,in:z,onEnter:G,onEntered:q,onEntering:et,onExit:tt,onExited:nt,onExiting:st,style:at,timeout:Ot="auto",TransitionComponent:Dt=L3,...St}=s,ie=zAe(),ae=hn.useRef(),Ne=vP(),pn=hn.useRef(null),de=Im(pn,r$(N),p),cn=Or=>di=>{if(Or){const Ea=pn.current;di===void 0?Or(Ea):Or(Ea,di)}},er=cn(et),Dn=cn((Or,di)=>{PFt(Or);const{duration:Ea,delay:Qi,easing:li}=pC({style:at,timeout:Ot,easing:L},{mode:"enter"});let ze;Ot==="auto"?(ze=Ne.transitions.getAutoHeightDuration(Or.clientHeight),ae.current=ze):ze=Ea,Or.style.transition=[Ne.transitions.create("opacity",{duration:ze,delay:Qi}),Ne.transitions.create("transform",{duration:BDt?ze:ze*.666,delay:Qi,easing:li})].join(","),G&&G(Or,di)}),jn=cn(q),or=cn(st),gr=cn(Or=>{const{duration:di,delay:Ea,easing:Qi}=pC({style:at,timeout:Ot,easing:L},{mode:"exit"});let li;Ot==="auto"?(li=Ne.transitions.getAutoHeightDuration(Or.clientHeight),ae.current=li):li=di,Or.style.transition=[Ne.transitions.create("opacity",{duration:li,delay:Ea}),Ne.transitions.create("transform",{duration:BDt?li:li*.666,delay:BDt?Ea:Ea||li*.333,easing:Qi})].join(","),Or.style.opacity=0,Or.style.transform=EBt(.75),tt&&tt(Or)}),fi=cn(nt),pi=Or=>{Ot==="auto"&&ie.start(ae.current||0,Or),y&&y(pn.current,Or)};return le.jsx(Dt,{appear:C,in:z,nodeRef:pn,onEnter:Dn,onEntered:jn,onEntering:er,onExit:gr,onExited:fi,onExiting:or,addEndListener:pi,timeout:Ot==="auto"?null:Ot,...St,children:(Or,{ownerState:di,...Ea})=>hn.cloneElement(N,{style:{opacity:0,transform:EBt(.75),visibility:Or==="exited"&&!z?"hidden":void 0,...GPn[Or],...at,...N.props.style},ref:de,...Ea})})});TBt&&(TBt.muiSupportAuto=!0);const YPn=XAe({themeId:jAe}),VPn=o=>{const{classes:s,disableUnderline:p}=o,C=Hc({root:["root",!p&&"underline"],input:["input"]},gNn,s);return{...s,...C}},XPn=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"},[`&.${oQ.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${oQ.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(.${oQ.disabled}, .${oQ.error}):before`]:{borderBottom:`2px solid ${(o.vars||o).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${p}`}},[`&.${oQ.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}`}}}))]}})),QPn=Ia(Hmt,{name:"MuiInput",slot:"Input",overridesResolver:$mt})({}),zmt=hn.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:et,slots:tt={},type:nt="text",...st}=y,at=VPn(y),Dt={root:{ownerState:{disableUnderline:C}}},St=et??L?OFt(et??L,Dt):Dt,ie=tt.root??N.Root??XPn,ae=tt.input??N.Input??QPn;return le.jsx(MFt,{slots:{root:ie,input:ae},slotProps:St,fullWidth:z,inputComponent:G,multiline:q,ref:p,type:nt,...st,classes:at})});zmt.muiName="Input";function JPn(o){return Vc("MuiInputLabel",o)}au("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const ZPn=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,JPn,s);return{...s,...q}},tLn=Ia(KPn,{shouldForwardProp:o=>ny(o)||o==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[{[`& .${AQ.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)"}}]}))),eLn=hn.forwardRef(function(s,p){const y=Su({name:"MuiInputLabel",props:s}),{disableAnimation:C=!1,margin:N,shrink:L,variant:z,className:G,...q}=y,et=N6();let tt=L;typeof tt>"u"&&et&&(tt=et.filled||et.focused||et.adornedStart);const nt=_C({props:y,muiFormControl:et,states:["size","variant","required","focused"]}),st={...y,disableAnimation:C,formControl:et,shrink:tt,size:nt.size,variant:nt.variant,required:nt.required,focused:nt.focused},at=ZPn(st);return le.jsx(tLn,{"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 uCe(o,s,p){return o===s?p?o.firstChild:o.lastChild:s&&s.previousElementSibling?s.previousElementSibling:p?null:o.lastChild}function sIe(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 cQ(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")||!sIe(z,N)||G)z=C(o,z,p);else return z.focus(),!0}return!1}const nLn=hn.forwardRef(function(s,p){const{actions:y,autoFocus:C=!1,autoFocusItem:N=!1,children:L,className:z,disabledItemsFocusable:G=!1,disableListWrap:q=!1,onKeyDown:et,variant:tt="selectedMenu",...nt}=s,st=hn.useRef(null),at=hn.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});gP(()=>{C&&st.current.focus()},[C]),hn.useImperativeHandle(y,()=>({adjustStyleForScrollbar:(ae,{direction:Ne})=>{const pn=!st.current.style.width;if(ae.clientHeight<st.current.clientHeight&&pn){const de=`${GAe(r5(ae))}px`;st.current.style[Ne==="rtl"?"paddingLeft":"paddingRight"]=de,st.current.style.width=`calc(100% + ${de})`}return st.current}}),[]);const Ot=ae=>{const Ne=st.current,pn=ae.key;if(ae.ctrlKey||ae.metaKey||ae.altKey){et&&et(ae);return}const cn=n5(Ne).activeElement;if(pn==="ArrowDown")ae.preventDefault(),cQ(Ne,cn,q,G,FDt);else if(pn==="ArrowUp")ae.preventDefault(),cQ(Ne,cn,q,G,uCe);else if(pn==="Home")ae.preventDefault(),cQ(Ne,null,q,G,FDt);else if(pn==="End")ae.preventDefault(),cQ(Ne,null,q,G,uCe);else if(pn.length===1){const er=at.current,Dn=pn.toLowerCase(),jn=performance.now();er.keys.length>0&&(jn-er.lastTime>500?(er.keys=[],er.repeating=!0,er.previousKeyMatched=!0):er.repeating&&Dn!==er.keys[0]&&(er.repeating=!1)),er.lastTime=jn,er.keys.push(Dn);const or=cn&&!er.repeating&&sIe(cn,er);er.previousKeyMatched&&(or||cQ(Ne,cn,!1,G,FDt,er))?ae.preventDefault():er.previousKeyMatched=!1}et&&et(ae)},Dt=Im(st,p);let St=-1;hn.Children.forEach(L,(ae,Ne)=>{if(!hn.isValidElement(ae)){St===Ne&&(St+=1,St>=L.length&&(St=-1));return}ae.props.disabled||(tt==="selectedMenu"&&ae.props.selected||St===-1)&&(St=Ne),St===Ne&&(ae.props.disabled||ae.props.muiSkipListHighlight||ae.type.muiSkipListHighlight)&&(St+=1,St>=L.length&&(St=-1))});const ie=hn.Children.map(L,(ae,Ne)=>{if(Ne===St){const pn={};return N&&(pn.autoFocus=!0),ae.props.tabIndex===void 0&&tt==="selectedMenu"&&(pn.tabIndex=0),hn.cloneElement(ae,pn)}return ae});return le.jsx(ZIn,{role:"menu",ref:Dt,className:z,onKeyDown:Ot,tabIndex:C?0:-1,...nt,children:ie})});function rLn(o){return Vc("MuiPopover",o)}au("MuiPopover",["root","paper"]);function lCe(o,s){let p=0;return typeof s=="number"?p=s:s==="center"?p=o.height/2:s==="bottom"&&(p=o.height),p}function hCe(o,s){let p=0;return typeof s=="number"?p=s:s==="center"?p=o.width/2:s==="right"&&(p=o.width),p}function fCe(o){return[o.horizontal,o.vertical].map(s=>typeof s=="number"?`${s}px`:s).join(" ")}function Tbt(o){return typeof o=="function"?o():o}const iLn=o=>{const{classes:s}=o;return Hc({root:["root"],paper:["paper"]},rLn,s)},aLn=Ia(rIe,{name:"MuiPopover",slot:"Root",overridesResolver:(o,s)=>s.root})({}),oIe=Ia(XQ,{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}),sLn=hn.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:et,container:tt,elevation:nt=8,marginThreshold:st=16,open:at,PaperProps:Ot={},slots:Dt={},slotProps:St={},transformOrigin:ie={vertical:"top",horizontal:"left"},TransitionComponent:ae,transitionDuration:Ne="auto",TransitionProps:pn={},disableScrollLock:de=!1,...cn}=y,er=hn.useRef(),Dn={...y,anchorOrigin:L,anchorReference:G,elevation:nt,marginThreshold:st,transformOrigin:ie,TransitionComponent:ae,transitionDuration:Ne,TransitionProps:pn},jn=iLn(Dn),or=hn.useCallback(()=>{if(G==="anchorPosition")return z;const Ds=Tbt(N),bu=(Ds&&Ds.nodeType===1?Ds:n5(er.current).body).getBoundingClientRect();return{top:bu.top+lCe(bu,L.vertical),left:bu.left+hCe(bu,L.horizontal)}},[N,L.horizontal,L.vertical,z,G]),gr=hn.useCallback(Ds=>({vertical:lCe(Ds,ie.vertical),horizontal:hCe(Ds,ie.horizontal)}),[ie.horizontal,ie.vertical]),fi=hn.useCallback(Ds=>{const pc={width:Ds.offsetWidth,height:Ds.offsetHeight},bu=gr(pc);if(G==="none")return{top:null,left:null,transformOrigin:fCe(bu)};const P1=or();let il=P1.top-bu.vertical,Rh=P1.left-bu.horizontal;const Mg=il+pc.height,Rg=Rh+pc.width,Dg=r5(Tbt(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:fCe(bu)}},[N,G,or,gr,st]),[pi,Or]=hn.useState(at),di=hn.useCallback(()=>{const Ds=er.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]);hn.useEffect(()=>(de&&window.addEventListener("scroll",di),()=>window.removeEventListener("scroll",di)),[N,de,di]);const Ea=()=>{di()},Qi=()=>{Or(!1)};hn.useEffect(()=>{at&&di()}),hn.useImperativeHandle(C,()=>at?{updatePosition:()=>{di()}}:null,[at,di]),hn.useEffect(()=>{if(!at)return;const Ds=NFt(()=>{di()}),pc=r5(Tbt(N));return pc.addEventListener("resize",Ds),()=>{Ds.clear(),pc.removeEventListener("resize",Ds)}},[N,at,di]);let li=Ne;const ze={slots:{transition:ae,...Dt},slotProps:{transition:pn,paper:Ot,...St}},[Ba,Ts]=wh("transition",{elementType:TBt,externalForwardedProps:ze,ownerState:Dn,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}});Ne==="auto"&&!Ba.muiSupportAuto&&(li=void 0);const Ke=tt||(N?n5(Tbt(N)).body:void 0),[xo,{slots:Ss,slotProps:Pa,...zo}]=wh("root",{ref:p,elementType:aLn,externalForwardedProps:{...ze,...cn},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:Dt.backdrop},slotProps:{backdrop:JAe(typeof St.backdrop=="function"?St.backdrop(Dn):St.backdrop,{invisible:!0})},container:Ke,open:at},ownerState:Dn,className:bo(jn.root,et)}),[$u,gu]=wh("paper",{ref:er,className:jn.paper,elementType:oIe,externalForwardedProps:ze,shouldForwardComponentProp:!0,additionalProps:{elevation:nt,style:pi?void 0:{opacity:0}},ownerState:Dn});return le.jsx(xo,{...zo,...!yBt(xo)&&{slots:Ss,slotProps:Pa,disableScrollLock:de},children:le.jsx(Ba,{...Ts,timeout:li,children:le.jsx($u,{...gu,children:q})})})});function oLn(o){return Vc("MuiMenu",o)}au("MuiMenu",["root","paper","list"]);const cLn={vertical:"top",horizontal:"right"},uLn={vertical:"top",horizontal:"left"},lLn=o=>{const{classes:s}=o;return Hc({root:["root"],paper:["paper"],list:["list"]},oLn,s)},hLn=Ia(sLn,{shouldForwardProp:o=>ny(o)||o==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(o,s)=>s.root})({}),fLn=Ia(oIe,{name:"MuiMenu",slot:"Paper",overridesResolver:(o,s)=>s.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),dLn=Ia(nLn,{name:"MuiMenu",slot:"List",overridesResolver:(o,s)=>s.list})({outline:0}),pLn=hn.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:et,PaperProps:tt={},PopoverClasses:nt,transitionDuration:st="auto",TransitionProps:{onEntering:at,...Ot}={},variant:Dt="selectedMenu",slots:St={},slotProps:ie={},...ae}=y,Ne=QAe(),pn={...y,autoFocus:C,disableAutoFocusItem:z,MenuListProps:G,onEntering:at,PaperProps:tt,transitionDuration:st,TransitionProps:Ot,variant:Dt},de=lLn(pn),cn=C&&!z&&et,er=hn.useRef(null),Dn=(li,ze)=>{er.current&&er.current.adjustStyleForScrollbar(li,{direction:Ne?"rtl":"ltr"}),at&&at(li,ze)},jn=li=>{li.key==="Tab"&&(li.preventDefault(),q&&q(li,"tabKeyDown"))};let or=-1;hn.Children.map(N,(li,ze)=>{hn.isValidElement(li)&&(li.props.disabled||(Dt==="selectedMenu"&&li.props.selected||or===-1)&&(or=ze))});const gr={slots:St,slotProps:{list:G,transition:Ot,paper:tt,...ie}},fi=sOn({elementType:St.root,externalSlotProps:ie.root,ownerState:pn,className:[de.root,L]}),[pi,Or]=wh("paper",{className:de.paper,elementType:fLn,externalForwardedProps:gr,shouldForwardComponentProp:!0,ownerState:pn}),[di,Ea]=wh("list",{className:bo(de.list,G.className),elementType:dLn,shouldForwardComponentProp:!0,externalForwardedProps:gr,getSlotProps:li=>({...li,onKeyDown:ze=>{var Ba;jn(ze),(Ba=li.onKeyDown)==null||Ba.call(li,ze)}}),ownerState:pn}),Qi=typeof gr.slotProps.transition=="function"?gr.slotProps.transition(pn):gr.slotProps.transition;return le.jsx(hLn,{onClose:q,anchorOrigin:{vertical:"bottom",horizontal:Ne?"right":"left"},transformOrigin:Ne?cLn:uLn,slots:{root:St.root,paper:pi,backdrop:St.backdrop,...St.transition&&{transition:St.transition}},slotProps:{root:fi,paper:Or,backdrop:typeof ie.backdrop=="function"?ie.backdrop(pn):ie.backdrop,transition:{...Qi,onEntering:(...li)=>{var ze;Dn(...li),(ze=Qi==null?void 0:Qi.onEntering)==null||ze.call(Qi,...li)}}},open:et,ref:p,transitionDuration:st,ownerState:pn,...ae,classes:nt,children:le.jsx(di,{actions:er,autoFocus:C&&(or===-1||z),autoFocusItem:cn,variant:Dt,...Ea,children:N})})});function gLn(o){return Vc("MuiNativeSelect",o)}const DFt=au("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),bLn=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,gLn,s)},cIe=Ia("select")(({theme:o})=>({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${DFt.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}}}]})),mLn=Ia(cIe,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:ny,overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.select,s[p.variant],p.error&&s.error,{[`&.${DFt.multiple}`]:s.multiple}]}})({}),uIe=Ia("svg")(({theme:o})=>({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(o.vars||o).palette.action.active,[`&.${DFt.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}}]})),yLn=Ia(uIe,{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]}})({}),wLn=hn.forwardRef(function(s,p){const{className:y,disabled:C,error:N,IconComponent:L,inputRef:z,variant:G="standard",...q}=s,et={...s,disabled:C,variant:G,error:N},tt=bLn(et);return le.jsxs(hn.Fragment,{children:[le.jsx(mLn,{ownerState:et,className:bo(tt.select,y),disabled:C,ref:z||p,...q}),s.multiple?null:le.jsx(yLn,{as:L,ownerState:et,className:tt.icon})]})});var dCe;const vLn=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%"}),_Ln=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 xLn(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(vLn,{"aria-hidden":!0,className:y,ownerState:G,...L,children:le.jsx(_Ln,{ownerState:G,children:z?le.jsx("span",{children:C}):dCe||(dCe=le.jsx("span",{className:"notranslate","aria-hidden":!0,children:""}))})})}const ELn=o=>{const{classes:s}=o,y=Hc({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},bNn,s);return{...s,...y}},TLn=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 .${m6.notchedOutline}`]:{borderColor:(o.vars||o).palette.text.primary},"@media (hover: none)":{[`&:hover .${m6.notchedOutline}`]:{borderColor:o.vars?`rgba(${o.vars.palette.common.onBackgroundChannel} / 0.23)`:s}},[`&.${m6.focused} .${m6.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(o.palette).filter(Am()).map(([p])=>({props:{color:p},style:{[`&.${m6.focused} .${m6.notchedOutline}`]:{borderColor:(o.vars||o).palette[p].main}}})),{props:{},style:{[`&.${m6.error} .${m6.notchedOutline}`]:{borderColor:(o.vars||o).palette.error.main},[`&.${m6.disabled} .${m6.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"}}]}})),kLn=Ia(xLn,{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}})),SLn=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}}]}))),BFt=hn.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:et,slots:tt={},type:nt="text",...st}=C,at=ELn(C),Ot=N6(),Dt=_C({props:C,muiFormControl:Ot,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),St={...C,color:Dt.color||"primary",disabled:Dt.disabled,error:Dt.error,focused:Dt.focused,formControl:Ot,fullWidth:L,hiddenLabel:Dt.hiddenLabel,multiline:q,size:Dt.size,type:nt},ie=tt.root??N.Root??TLn,ae=tt.input??N.Input??SLn;return le.jsx(MFt,{slots:{root:ie,input:ae},renderSuffix:Ne=>le.jsx(kLn,{ownerState:St,className:at.notchedOutline,label:G!=null&&G!==""&&Dt.required?y||(y=le.jsxs(hn.Fragment,{children:[G," ","*"]})):G,notched:typeof et<"u"?et:!!(Ne.startAdornment||Ne.filled||Ne.focused)}),fullWidth:L,inputComponent:z,multiline:q,ref:p,type:nt,...st,classes:{...at,notchedOutline:null}})});BFt.muiName="Input";const CLn=a5(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"),ALn=a5(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"),ILn=Ia("span",{shouldForwardProp:ny})({position:"relative",display:"flex"}),OLn=Ia(CLn)({transform:"scale(1)"}),NLn=Ia(ALn)(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 lIe(o){const{checked:s=!1,classes:p={},fontSize:y}=o,C={...o,checked:s};return le.jsxs(ILn,{className:p.root,ownerState:C,children:[le.jsx(OLn,{fontSize:y,className:p.background,ownerState:C}),le.jsx(NLn,{fontSize:y,className:p.dot,ownerState:C})]})}const hIe=hn.createContext(void 0);function PLn(){return hn.useContext(hIe)}function LLn(o){return Vc("MuiRadio",o)}const pCe=au("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),MLn=o=>{const{classes:s,color:p,size:y}=o,C={root:["root",`color${fa(p)}`,y!=="medium"&&`size${fa(y)}`]};return{...s,...Hc(C,LLn,s)}},RLn=Ia(KNn,{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,[`&.${pCe.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:{[`&.${pCe.checked}`]:{color:(o.vars||o).palette[s].main}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]})));function DLn(o,s){return typeof s=="object"&&s!==null?o===s:String(o)===String(s)}const BLn=le.jsx(lIe,{checked:!0}),FLn=le.jsx(lIe,{}),fk=hn.forwardRef(function(s,p){const y=Su({props:s,name:"MuiRadio"}),{checked:C,checkedIcon:N=BLn,color:L="primary",icon:z=FLn,name:G,onChange:q,size:et="medium",className:tt,disabled:nt,disableRipple:st=!1,slots:at={},slotProps:Ot={},inputProps:Dt,...St}=y,ie=N6();let ae=nt;ie&&typeof ae>"u"&&(ae=ie.disabled),ae??(ae=!1);const Ne={...y,disabled:ae,disableRipple:st,color:L,size:et},pn=MLn(Ne),de=PLn();let cn=C;const er=wBt(q,de&&de.onChange);let Dn=G;de&&(typeof cn>"u"&&(cn=DLn(de.value,y.value)),typeof Dn>"u"&&(Dn=de.name));const jn=Ot.input??Dt,[or,gr]=wh("root",{ref:p,elementType:RLn,className:bo(pn.root,tt),shouldForwardComponentProp:!0,externalForwardedProps:{slots:at,slotProps:Ot,...St},getSlotProps:fi=>({...fi,onChange:(pi,...Or)=>{var di;(di=fi.onChange)==null||di.call(fi,pi,...Or),er(pi,...Or)}}),ownerState:Ne,additionalProps:{type:"radio",icon:hn.cloneElement(z,{fontSize:z.props.fontSize??et}),checkedIcon:hn.cloneElement(N,{fontSize:N.props.fontSize??et}),disabled:ae,name:Dn,checked:cn,slots:at,slotProps:{input:typeof jn=="function"?jn(Ne):jn}}});return le.jsx(or,{...gr,classes:pn})});function $Ln(o){return Vc("MuiRadioGroup",o)}au("MuiRadioGroup",["root","row","error"]);const jLn=o=>{const{classes:s,row:p,error:y}=o;return Hc({root:["root",p&&"row",y&&"error"]},$Ln,s)},gCe=hn.forwardRef(function(s,p){const{actions:y,children:C,className:N,defaultValue:L,name:z,onChange:G,value:q,...et}=s,tt=hn.useRef(null),nt=jLn(s),[st,at]=jQ({controlled:q,default:L,name:"RadioGroup"});hn.useImperativeHandle(y,()=>({focus:()=>{let ie=tt.current.querySelector("input:not(:disabled):checked");ie||(ie=tt.current.querySelector("input:not(:disabled)")),ie&&ie.focus()}}),[]);const Ot=Im(p,tt),Dt=VQ(z),St=hn.useMemo(()=>({name:Dt,onChange(ie){at(ie.target.value),G&&G(ie,ie.target.value)},value:st}),[Dt,G,at,st]);return le.jsx(hIe.Provider,{value:St,children:le.jsx(BPn,{role:"radiogroup",ref:Ot,className:bo(nt.root,N),...et,children:C})})});function fIe(o){return Vc("MuiSelect",o)}const uQ=au("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var bCe;const HLn=Ia(cIe,{name:"MuiSelect",slot:"Select",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[{[`&.${uQ.select}`]:s.select},{[`&.${uQ.select}`]:s[p.variant]},{[`&.${uQ.error}`]:s.error},{[`&.${uQ.multiple}`]:s.multiple}]}})({[`&.${uQ.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),zLn=Ia(uIe,{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]}})({}),ULn=Ia("input",{shouldForwardProp:o=>tOn(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 mCe(o,s){return typeof s=="object"&&s!==null?o===s:String(o)===String(s)}function qLn(o){return o==null||typeof o=="string"&&!o.trim()}const WLn=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,fIe,s)},KLn=hn.forwardRef(function(s,p){var o5;const{"aria-describedby":y,"aria-label":C,autoFocus:N,autoWidth:L,children:z,className:G,defaultOpen:q,defaultValue:et,disabled:tt,displayEmpty:nt,error:st=!1,IconComponent:at,inputRef:Ot,labelId:Dt,MenuProps:St={},multiple:ie,name:ae,onBlur:Ne,onChange:pn,onClose:de,onFocus:cn,onOpen:er,open:Dn,readOnly:jn,renderValue:or,required:gr,SelectDisplayProps:fi={},tabIndex:pi,type:Or,value:di,variant:Ea="standard",...Qi}=s,[li,ze]=jQ({controlled:di,default:et,name:"Select"}),[Ba,Ts]=jQ({controlled:Dn,default:q,name:"Select"}),Ke=hn.useRef(null),xo=hn.useRef(null),[Ss,Pa]=hn.useState(null),{current:zo}=hn.useRef(Dn!=null),[$u,gu]=hn.useState(),Ds=Im(p,Ot),pc=hn.useCallback(Ns=>{xo.current=Ns,Ns&&Pa(Ns)},[]),bu=Ss==null?void 0:Ss.parentNode;hn.useImperativeHandle(Ds,()=>({focus:()=>{xo.current.focus()},node:Ke.current,value:li}),[li]),hn.useEffect(()=>{q&&Ba&&Ss&&!zo&&(gu(L?null:bu.clientWidth),xo.current.focus())},[Ss,L]),hn.useEffect(()=>{N&&xo.current.focus()},[N]),hn.useEffect(()=>{if(!Dt)return;const Ns=n5(xo.current).getElementById(Dt);if(Ns){const zc=()=>{getSelection().isCollapsed&&xo.current.focus()};return Ns.addEventListener("click",zc),()=>{Ns.removeEventListener("click",zc)}}},[Dt]);const P1=(Ns,zc)=>{Ns?er&&er(zc):de&&de(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=hn.Children.toArray(z),Rg=Ns=>{const zc=Mg.find(Dh=>Dh.props.value===Ns.target.value);zc!==void 0&&(ze(zc.props.value),pn&&pn(Ns,zc))},Dg=Ns=>zc=>{let Dh;if(zc.currentTarget.hasAttribute("tabindex")){if(ie){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),pn)){const ap=zc.nativeEvent||zc,uJ=new ap.constructor(ap.type,ap);Object.defineProperty(uJ,"target",{writable:!0,value:{value:Dh,name:ae}}),pn(uJ,Ns)}ie||P1(!1,zc)}},iy=Ns=>{jn||[" ","ArrowUp","ArrowDown","Enter"].includes(Ns.key)&&(Ns.preventDefault(),P1(!0,Ns))},Yp=Ss!==null&&Ba,wd=Ns=>{!Yp&&Ne&&(Object.defineProperty(Ns,"target",{writable:!0,value:{value:li,name:ae}}),Ne(Ns))};delete Qi["aria-invalid"];let Vp,Iw;const Jd=[];let R3=!1;(nmt({value:li})||nt)&&(or?Vp=or(li):R3=!0);const Hr=Mg.map(Ns=>{if(!hn.isValidElement(Ns))return null;let zc;if(ie){if(!Array.isArray(li))throw new Error(WAe(2));zc=li.some(Dh=>mCe(Dh,Ns.props.value)),zc&&R3&&Jd.push(Ns.props.children)}else zc=mCe(li,Ns.props.value),zc&&R3&&(Iw=Ns.props.children);return hn.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})});R3&&(ie?Jd.length===0?Vp=null:Vp=Jd.reduce((Ns,zc,Dh)=>(Ns.push(zc),Dh<Jd.length-1&&Ns.push(", "),Ns),[]):Vp=Iw);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=WLn(Cu),Bg={...St.PaperProps,...(o5=St.slotProps)==null?void 0:o5.paper},d0=VQ();return le.jsxs(hn.Fragment,{children:[le.jsx(HLn,{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":[Dt,gc].filter(Boolean).join(" ")||void 0,"aria-describedby":y,"aria-required":gr?"true":void 0,"aria-invalid":st?"true":void 0,onKeyDown:iy,onMouseDown:tt||jn?null:il,onBlur:wd,onFocus:cn,...fi,ownerState:Cu,className:bo(fi.className,su.select,G),id:gc,children:qLn(Vp)?bCe||(bCe=le.jsx("span",{className:"notranslate","aria-hidden":!0,children:""})):Vp}),le.jsx(ULn,{"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:gr,...Qi,ownerState:Cu}),le.jsx(zLn,{as:at,className:su.icon,ownerState:Cu}),le.jsx(pLn,{id:`menu-${ae||""}`,anchorEl:bu,open:Yp,onClose:Rh,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...St,slotProps:{...St.slotProps,list:{"aria-labelledby":Dt,role:"listbox","aria-multiselectable":ie?"true":void 0,disableListWrap:!0,id:d0,...St.MenuListProps},paper:{...Bg,style:{minWidth:da,...Bg!=null?Bg.style:null}}},children:Hr})]})}),GLn=o=>{const{classes:s}=o,y=Hc({root:["root"]},fIe,s);return{...s,...y}},FFt={name:"MuiSelect",overridesResolver:(o,s)=>s.root,shouldForwardProp:o=>ny(o)&&o!=="variant",slot:"Root"},YLn=Ia(zmt,FFt)(""),VLn=Ia(BFt,FFt)(""),XLn=Ia(RFt,FFt)(""),dIe=hn.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:et=yNn,id:tt,input:nt,inputProps:st,label:at,labelId:Ot,MenuProps:Dt,multiple:St=!1,native:ie=!1,onClose:ae,onOpen:Ne,open:pn,renderValue:de,SelectDisplayProps:cn,variant:er="outlined",...Dn}=y,jn=ie?wLn:KLn,or=N6(),gr=_C({props:y,muiFormControl:or,states:["variant","error"]}),fi=gr.variant||er,pi={...y,variant:fi,classes:L},Or=GLn(pi),{root:di,...Ea}=Or,Qi=nt||{standard:le.jsx(YLn,{ownerState:pi}),outlined:le.jsx(VLn,{label:at,ownerState:pi}),filled:le.jsx(XLn,{ownerState:pi})}[fi],li=Im(p,r$(Qi));return le.jsx(hn.Fragment,{children:hn.cloneElement(Qi,{inputComponent:jn,inputProps:{children:N,error:gr.error,IconComponent:et,variant:fi,type:void 0,multiple:St,...ie?{id:tt}:{autoWidth:C,defaultOpen:G,displayEmpty:q,labelId:Ot,MenuProps:Dt,onClose:ae,onOpen:Ne,open:pn,renderValue:de,SelectDisplayProps:{id:tt,...cn}},...st,classes:st?OFt(Ea,st.classes):Ea,...nt?nt.props.inputProps:{}},...(St&&ie||q)&&fi==="outlined"?{notched:!0}:{},ref:li,className:bo(Qi.props.className,z,Or.root),...!nt&&{variant:fi},...Dn})})});dIe.muiName="Select";const pIe=hn.createContext();function QLn(o){return Vc("MuiTable",o)}au("MuiTable",["root","stickyHeader"]);const JLn=o=>{const{classes:s,stickyHeader:p}=o;return Hc({root:["root",p&&"stickyHeader"]},QLn,s)},ZLn=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"}}]}))),yCe="table",tMn=hn.forwardRef(function(s,p){const y=Su({props:s,name:"MuiTable"}),{className:C,component:N=yCe,padding:L="normal",size:z="medium",stickyHeader:G=!1,...q}=y,et={...y,component:N,padding:L,size:z,stickyHeader:G},tt=JLn(et),nt=hn.useMemo(()=>({padding:L,size:z,stickyHeader:G}),[L,z,G]);return le.jsx(pIe.Provider,{value:nt,children:le.jsx(ZLn,{as:N,role:N===yCe?null:"table",ref:p,className:bo(tt.root,C),ownerState:et,...q})})}),Umt=hn.createContext();function eMn(o){return Vc("MuiTableBody",o)}au("MuiTableBody",["root"]);const nMn=o=>{const{classes:s}=o;return Hc({root:["root"]},eMn,s)},rMn=Ia("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(o,s)=>s.root})({display:"table-row-group"}),iMn={variant:"body"},wCe="tbody",aMn=hn.forwardRef(function(s,p){const y=Su({props:s,name:"MuiTableBody"}),{className:C,component:N=wCe,...L}=y,z={...y,component:N},G=nMn(z);return le.jsx(Umt.Provider,{value:iMn,children:le.jsx(rMn,{className:bo(G.root,C),as:N,ref:p,role:N===wCe?null:"rowgroup",ownerState:z,...L})})});function sMn(o){return Vc("MuiTableCell",o)}const oMn=au("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),cMn=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,sMn,s)},uMn=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"?eOn(Ef(o.palette.divider,1),.88):nOn(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",[`&.${oMn.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}}]}))),k3=hn.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:et,variant:tt,...nt}=y,st=hn.useContext(pIe),at=hn.useContext(Umt),Ot=at&&at.variant==="head";let Dt;L?Dt=L:Dt=Ot?"th":"td";let St=G;Dt==="td"?St=void 0:!St&&Ot&&(St="col");const ie=tt||at&&at.variant,ae={...y,align:C,component:Dt,padding:z||(st&&st.padding?st.padding:"normal"),size:q||(st&&st.size?st.size:"medium"),sortDirection:et,stickyHeader:ie==="head"&&st&&st.stickyHeader,variant:ie},Ne=cMn(ae);let pn=null;return et&&(pn=et==="asc"?"ascending":"descending"),le.jsx(uMn,{as:Dt,ref:p,className:bo(Ne.root,N),"aria-sort":pn,scope:St,ownerState:ae,...nt})});function lMn(o){return Vc("MuiTableHead",o)}au("MuiTableHead",["root"]);const hMn=o=>{const{classes:s}=o;return Hc({root:["root"]},lMn,s)},fMn=Ia("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(o,s)=>s.root})({display:"table-header-group"}),dMn={variant:"head"},vCe="thead",pMn=hn.forwardRef(function(s,p){const y=Su({props:s,name:"MuiTableHead"}),{className:C,component:N=vCe,...L}=y,z={...y,component:N},G=hMn(z);return le.jsx(Umt.Provider,{value:dMn,children:le.jsx(fMn,{as:N,className:bo(G.root,C),ref:p,role:N===vCe?null:"rowgroup",ownerState:z,...L})})});function gMn(o){return Vc("MuiToolbar",o)}au("MuiToolbar",["root","gutters","regular","dense"]);const bMn=o=>{const{classes:s,disableGutters:p,variant:y}=o;return Hc({root:["root",!p&&"gutters",y]},gMn,s)},mMn=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}]}))),_Ce=hn.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},et=bMn(q);return le.jsx(mMn,{as:N,className:bo(et.root,C),ref:p,ownerState:q,...G})});function yMn(o){return Vc("MuiTableRow",o)}const xCe=au("MuiTableRow",["root","selected","hover","head","footer"]),wMn=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"]},yMn,s)},vMn=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,[`&.${xCe.hover}:hover`]:{backgroundColor:(o.vars||o).palette.action.hover},[`&.${xCe.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)}}}))),ECe="tr",kbt=hn.forwardRef(function(s,p){const y=Su({props:s,name:"MuiTableRow"}),{className:C,component:N=ECe,hover:L=!1,selected:z=!1,...G}=y,q=hn.useContext(Umt),et={...y,component:N,hover:L,selected:z,head:q&&q.variant==="head",footer:q&&q.variant==="footer"},tt=wMn(et);return le.jsx(vMn,{as:N,ref:p,className:bo(tt.root,C),role:N===ECe?null:"row",ownerState:et,...G})});function _Mn(o){return Vc("MuiTextField",o)}au("MuiTextField",["root"]);const xMn={standard:zmt,filled:RFt,outlined:BFt},EMn=o=>{const{classes:s}=o;return Hc({root:["root"]},_Mn,s)},TMn=Ia(IPn,{name:"MuiTextField",slot:"Root",overridesResolver:(o,s)=>s.root})({}),$Dt=hn.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:et=!1,error:tt=!1,FormHelperTextProps:nt,fullWidth:st=!1,helperText:at,id:Ot,InputLabelProps:Dt,inputProps:St,InputProps:ie,inputRef:ae,label:Ne,maxRows:pn,minRows:de,multiline:cn=!1,name:er,onBlur:Dn,onChange:jn,onFocus:or,placeholder:gr,required:fi=!1,rows:pi,select:Or=!1,SelectProps:di,slots:Ea={},slotProps:Qi={},type:li,value:ze,variant:Ba="outlined",...Ts}=y,Ke={...y,autoFocus:N,color:G,disabled:et,error:tt,fullWidth:st,multiline:cn,required:fi,select:Or,variant:Ba},xo=EMn(Ke),Ss=VQ(Ot),Pa=at&&Ss?`${Ss}-helper-text`:void 0,zo=Ne&&Ss?`${Ss}-label`:void 0,$u=xMn[Ba],gu={slots:Ea,slotProps:{input:ie,inputLabel:Dt,htmlInput:St,formHelperText:nt,select:di,...Qi}},Ds={},pc=gu.slotProps.inputLabel;Ba==="outlined"&&(pc&&typeof pc.shrink<"u"&&(Ds.notched=pc.shrink),Ds.label=Ne),Or&&((!di||!di.native)&&(Ds.id=void 0),Ds["aria-describedby"]=void 0);const[bu,P1]=wh("root",{elementType:TMn,shouldForwardComponentProp:!0,externalForwardedProps:{...gu,...Ts},ownerState:Ke,className:bo(xo.root,z),ref:p,additionalProps:{disabled:et,error:tt,fullWidth:st,required:fi,color:G,variant:Ba}}),[il,Rh]=wh("input",{elementType:$u,externalForwardedProps:gu,additionalProps:Ds,ownerState:Ke}),[Mg,Rg]=wh("inputLabel",{elementType:eLn,externalForwardedProps:gu,ownerState:Ke}),[Dg,iy]=wh("htmlInput",{elementType:"input",externalForwardedProps:gu,ownerState:Ke}),[Yp,wd]=wh("formHelperText",{elementType:HPn,externalForwardedProps:gu,ownerState:Ke}),[Vp,Iw]=wh("select",{elementType:dIe,externalForwardedProps:gu,ownerState:Ke}),Jd=le.jsx(il,{"aria-describedby":Pa,autoComplete:C,autoFocus:N,defaultValue:q,fullWidth:st,multiline:cn,name:er,rows:pi,maxRows:pn,minRows:de,type:li,value:ze,id:Ss,inputRef:ae,onBlur:Dn,onChange:jn,onFocus:or,placeholder:gr,inputProps:iy,slots:{input:Ea.htmlInput?Dg:void 0},...Rh});return le.jsxs(bu,{...P1,children:[Ne!=null&&Ne!==""&&le.jsx(Mg,{htmlFor:Ss,id:zo,...Rg,children:Ne}),Or?le.jsx(Vp,{"aria-describedby":Pa,id:Ss,labelId:zo,value:ze,input:Jd,...Iw,children:L}):Jd,at&&le.jsx(Yp,{id:Pa,...wd,children:at})]})});class gIe{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 gIe(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 bIe 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 mIe 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 yIe extends mIe{constructor(s){super(s)}}class zQ extends yIe{constructor(s){super(s)}}class oC extends yIe{constructor(s){super(s)}}var yd;(function(o){function s(et){if(typeof et=="string")return et;let tt=et.constructor.name;return et.constructor.__MODULE&&(tt=`${et.constructor.__MODULE}.${tt}`),`std.${tt}`}o.get_class_name=s;function p(et,tt){return new oC(`Error on ${s(et)}.${tt}(): it's empty container.`)}o.empty=p;function y(et,tt,nt){return new oC(`Error on ${s(et)}.${tt}(): parametric index is negative -> (index = ${nt}).`)}o.negative_index=y;function C(et,tt,nt,st){return new oC(`Error on ${s(et)}.${tt}(): parametric index is equal or greater than size -> (index = ${nt}, size: ${st}).`)}o.excessive_index=C;function N(et,tt){return new zQ(`Error on ${s(et)}.${tt}(): parametric iterator is not this container's own.`)}o.not_my_iterator=N;function L(et,tt){return new zQ(`Error on ${s(et)}.${tt}(): parametric iterator, it already has been erased.`)}o.erased_iterator=L;function z(et,tt,nt){return new oC(`Error on ${s(et)}.${tt}(): parametric iterator is directing negative position -> (index = ${nt}).`)}o.negative_iterator=z;function G(et,tt="end"){const nt=s(et);return new oC(`Error on ${nt}.Iterator.value: cannot access to the ${nt}.${tt}().value.`)}o.iterator_end_value=G;function q(et,tt,nt){throw new oC(`Error on ${s(et)}.${tt}(): unable to find the matched key -> ${nt}`)}o.key_nout_found=q})(yd||(yd={}));class wIe extends bIe{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 vIe extends bIe{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 _Ie 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 xIe extends _Ie{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 EIe extends _Ie{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 imt;(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})(imt||(imt={}));function TIe(){return jDt===null&&(jDt=typeof global=="object"&&kMn(global)),jDt}function kMn(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 SMn(){return lQ===null&&(lQ=TIe()?global:self,lQ.__s_iUID===void 0&&(lQ.__s_iUID=0)),lQ}let lQ=null;function bk(o){if(o instanceof Object){if(o.hasOwnProperty("__get_m_iUID")===!1){const s=++SMn().__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 Z_(o,s){return o=o&&o.valueOf(),s=s&&s.valueOf(),o instanceof Object&&o.equals instanceof Function?o.equals(s):o===s}function CMn(o,s){return!Z_(o,s)}function i5(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=i5;if(L.length===1&&L[0]instanceof C){const q=L[0];G=q.key_comp(),z=()=>{const et=q.begin(),tt=q.end();y.assign(et,tt)}}else{const q=imt.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 $Ft(...o){let s=IMn;for(let p of o){p=p&&p.valueOf();const y=typeof p;if(y==="boolean")s=AMn(p,s);else if(y==="number"||y==="bigint")s=TCe(p,s);else if(y==="string")s=kIe(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*=jFt}else s=TCe(bk(p),s)}return Math.abs(s)}function AMn(o,s){return s^=o?1:0,s*=jFt,s}function TCe(o,s){return kIe(o.toString(),s)}function kIe(o,s){for(let p=0;p<o.length;++p)s^=o.charCodeAt(p),s*=jFt;return Math.abs(s)}const IMn=2166136261,jFt=16777619;class rp{constructor(s,p){this.first=s,this.second=p}equals(s){return Z_(this.first,s.first)&&Z_(this.second,s.second)}less(s){return Z_(this.first,s.first)===!1?i5(this.first,s.first):i5(this.second,s.second)}hashCode(){return $Ft(this.first,this.second)}}class SIe extends wIe{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 OMn extends mIe{constructor(s){super(s)}}let NMn=class extends OMn{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 HFt 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 NMn(`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 zFt extends HFt{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 UFt{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 Z_(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 qFt 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 zFt{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 UFt{source(){return this._Get_array().source()}reverse(){return new p(this)}}o.Iterator=s;class p extends qFt{_Create_neighbor(C){return new p(C)}}o.ReverseIterator=p})(N3||(N3={}));function Kmt(o,s){if(o.index instanceof Function)return PMn(o,s);let p=0;for(;!o.equals(s);o=o.next())++p;return p}function PMn(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 zQ("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=i5){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=i5){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 amt extends SIe{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 CIe extends vIe{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 smt extends CIe{constructor(...s){super(p=>new N3(p)),ey.construct(this,smt,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"})(smt||(smt={}));class mk{constructor(s,p){this.first=s,this.second=p}equals(s){return Z_(this.first,s.first)}less(s){return i5(this.first,s.first)}hashCode(){return $Ft(this.first)}}class AIe extends xIe{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 zFt{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 UFt{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 qFt{_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 omt extends AIe{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 IIe extends EIe{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 cmt extends IIe{constructor(...s){super(p=>new P3(p)),ey.construct(this,cmt,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"})(cmt||(cmt={}));class i$ extends qFt{_Create_neighbor(s){return new i$(s)}}class WFt extends UFt{reverse(){return new i$(this)}source(){return this._Get_array()}}class uC extends zFt{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=WFt,o.ReverseIterator=i$})(uC||(uC={}));function kBt(o,s,p=i5){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)),kBt(o,o.advance(L-1),p),kBt(o.advance(L),s,p)}function HDt(o,s){[o.value,s.value]=[s.value,o.value]}class qp extends HFt{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 zQ(`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 et=this.matrix_.splice(++N.first);this.matrix_.push(L),this.matrix_.push(...et)}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,et=Math.min(y,G.length-q);G.splice(q,et),G.length!==0&&(L===0?C=G:N=G),G.length===0&&this.matrix_.length>1&&this.matrix_.splice(z.first,1),y-=et,++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=WFt,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 v6{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 KFt 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(){v6._Set_prev(this.end_,this.end_),v6._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),v6._Set_next(C,G),C=G,++L}return s.equals(this.begin())===!0&&(this.begin_=N),v6._Set_next(C,s),v6._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();v6._Set_next(y,p),v6._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 J_ extends KFt{constructor(...s){if(super(),this.ptr_={value:this},J_.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 J_){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 J_.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=Z_){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=>Z_(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=i5){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=i5){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();J_.Iterator._Set_prev(y,N),J_.Iterator._Set_next(y,C),y=N}this.begin_=s,J_.Iterator._Set_prev(this.end_,p),J_.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 v6{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})(J_||(J_={}));class l0 extends KFt{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 v6{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 LMn{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 OIe{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 LMn(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 NIe extends OIe{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 kCe extends NIe{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 AIe{constructor(...s){super(p=>new l0(p)),ey.construct(this,XF,p=>{this.tree_=new kCe(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_),kCe._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 UQ extends HFt{constructor(...s){if(super(),s.length===1&&s[0]instanceof UQ){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();CMn(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 UQ.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,et=N.second;y.push(new rp(q,et))}}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=WFt,o.ReverseIterator=i$})(UQ||(UQ={}));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 gIe(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=Z_){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=>Z_(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=i5){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=i5){const p=new uC(this.begin(),this.end());kBt(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 KFt{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 v6{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 PIe extends OIe{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 SCe extends PIe{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 umt extends SIe{constructor(...s){super(p=>new h0(p)),ey.construct(this,umt,p=>{this.tree_=new SCe(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_),SCe._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})(umt||(umt={}));var QF;(function(o){function s(p,y,C,...N){let L=null,z=$Ft,G=Z_;if(N.length===1&&N[0]instanceof y){const q=N[0];z=q.hash_function(),G=q.key_eq(),L=()=>{const et=q.begin(),tt=q.end();p.assign(et,tt)}}else{const q=imt.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 LIe{constructor(s,p){this.fetcher_=s,this.hasher_=p,this.max_load_factor_=MMn,this.data_=[],this.size_=0,this.initialize()}clear(){this.data_=[],this.size_=0,this.initialize()}rehash(s){s=Math.max(s,CCe);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<CCe;++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 CCe=10,MMn=1;class lmt extends LIe{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.value,s))return C;return this.source_.end()}}function RMn(o){return o.value}class hmt extends wIe{constructor(...s){super(p=>new h0(p)),QF.construct(this,hmt,(p,y)=>{this.buckets_=new lmt(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_),lmt._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})(hmt||(hmt={}));class ACe extends PIe{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 fmt extends CIe{constructor(...s){super(p=>new h0(p)),ey.construct(this,fmt,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})(fmt||(fmt={}));class dmt extends vIe{constructor(...s){super(p=>new h0(p)),QF.construct(this,dmt,(p,y)=>{this.buckets_=new lmt(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_),lmt._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})(dmt||(dmt={}));class pmt extends LIe{constructor(s,p,y){super(DMn,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 DMn(o){return o.first}class gmt extends xIe{constructor(...s){super(p=>new l0(p)),QF.construct(this,gmt,(p,y)=>{this.buckets_=new pmt(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_),pmt._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})(gmt||(gmt={}));class ICe extends NIe{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 bmt extends IIe{constructor(...s){super(p=>new l0(p)),ey.construct(this,bmt,p=>{this.tree_=new ICe(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_),ICe._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})(bmt||(bmt={}));class mmt extends EIe{constructor(...s){super(p=>new l0(p)),QF.construct(this,mmt,(p,y)=>{this.buckets_=new pmt(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_),pmt._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})(mmt||(mmt={}));var OCe;(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 et=0;for(;L<z;L+=q)et+=N(L)*q;return et}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]})(OCe||(OCe={}));function BMn(o){return new Promise(s=>{setTimeout(s,o)})}var k6;(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()}})(k6||(k6={}));class NCe{}(function(o){function s(N,L){return k6.lock(()=>N.lock(),()=>N.unlock(),L)}o.lock=s;function p(N,L){return k6.try_lock(()=>N.try_lock(),()=>N.unlock(),L)}o.try_lock=p;function y(N,L,z){return k6.try_lock(()=>N.try_lock_for(L),()=>N.unlock(),z)}o.try_lock_for=y;function C(N,L,z){return k6.try_lock(()=>N.try_lock_until(L),()=>N.unlock(),z)}o.try_lock_until=C})(NCe||(NCe={}));class PCe{}(function(o){function s(N,L){return k6.lock(()=>N.lock_shared(),()=>N.unlock_shared(),L)}o.lock=s;function p(N,L){return k6.try_lock(()=>N.try_lock_shared(),()=>N.unlock_shared(),L)}o.try_lock=p;function y(N,L,z){return k6.try_lock(()=>N.try_lock_shared_for(L),()=>N.unlock_shared(),z)}o.try_lock_for=y;function C(N,L,z){return k6.try_lock(()=>N.try_lock_shared_until(L),()=>N.unlock_shared(),z)}o.try_lock_until=C})(PCe||(PCe={}));class SBt{constructor(s){this.queue_=new J_,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});BMn(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 zQ(`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})(SBt||(SBt={}));const Ng=[];for(let o=0;o<256;++o)Ng.push((o+256).toString(16).slice(1));function FMn(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 $Mn=new Uint8Array(16);function jMn(){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($Mn)}const HMn=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),LCe={randomUUID:HMn};function wk(o,s,p){var C;if(LCe.randomUUID&&!o)return LCe.randomUUID();o=o||{};const y=o.random??((C=o.rng)==null?void 0:C.call(o))??jMn();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,FMn(y)}function zMn(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(([et])=>et!=="aggregate").map(([,et])=>q(et)).reduce((et,tt)=>et+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 MIe={aggregate:zMn};class dP{constructor(s){if(s===void 0){const p=dP.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){MIe.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 dP({aggregate:s(),initialize:s(),select:s(),cancel:s(),call:s(),describe:s()})}static plus(s,p){const y=new dP(s);return y.increment(p.toJSON()),y}}function RIe(o,s,p){const y=o.get(s);if(y!==void 0)return y;const C=p();return o.set(s,C),C}function UMn(o){var z;const s=o.controllers.length===1||(()=>{const G=o.controllers.map(q=>q.application.functions.map(et=>et.name)).flat();return new Set(G).size===G.length})(),p=qMn({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?YMn({array:p,capacity:y}):void 0,N=new Map,L=new Map;for(const G of p)N.set(G.name,G),RIe(L,G.controller.name,()=>new Map).set(G.name,G);return{array:p,divided:C,flat:N,group:L}}function qMn(o){return o.controllers.flatMap((s,p)=>{switch(s.protocol){case"http":return WMn({controller:s,index:p,naming:o.naming});case"class":return KMn({controller:s,index:p,naming:o.naming});case"mcp":return GMn({controller:s,index:p,naming:o.naming});default:throw new Error(`Unsupported protocol: ${s.protocol}`)}})}function WMn(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 KMn(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 GMn(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 YMn(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 VMn={compose:UMn};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==="data"?{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.url,detail:o.detail}};throw new Error(`Unsupported user message content type, value: ${JSON.stringify(o)}`)}function DIe(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 XMn(o){const s={type:"assistantMessage",id:o.id,created_at:o.created_at,text:o.text};return{...s,toJSON:()=>s}}function QMn(o){const s={type:"systemMessage",id:o.id,created_at:o.created_at,text:o.text};return{...s,toJSON:()=>s}}function JMn(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 BIe(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 ZMn(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 FIe(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 tRn(){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 eRn(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:()=>BIe({id:s,created_at:p,selection:o.selection})}}function nRn(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 rRn(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 iRn(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 aRn(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 ymt(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:()=>FIe({id:s,created_at:p,...o})}}function sRn(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:()=>DIe({id:s,created_at:p,contents:o.contents})}}function GFt(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 oRn(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 cRn(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 CBt;(function(o){o.is=s=>typeof s=="object"&&s!==null&&typeof s.openapi=="string"&&s.openapi.startsWith("3.0")})(CBt||(CBt={}));var ABt;(function(o){o.is=s=>typeof s=="object"&&s!==null&&typeof s.openapi=="string"&&s.openapi.startsWith("3.1")})(ABt||(ABt={}));var IBt;(function(o){o.is=s=>typeof s=="object"&&s!==null&&typeof s.swagger=="string"&&s.swagger.startsWith("2.0")})(IBt||(IBt={}));var wmt;(function(o){o.reference=s=>s.split("/").filter((p,y)=>!!p.length&&!(y===0&&p==="#")).join(".")})(wmt||(wmt={}));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=>uRn.has(s)})(JF||(JF={}));const uRn=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"?eOn(Ef(o.palette.divider,1),.88):nOn(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",[`&.${oMn.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}}]}))),k3=hn.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:et,variant:tt,...nt}=y,st=hn.useContext(pIe),at=hn.useContext(Umt),Ot=at&&at.variant==="head";let Dt;L?Dt=L:Dt=Ot?"th":"td";let St=G;Dt==="td"?St=void 0:!St&&Ot&&(St="col");const ie=tt||at&&at.variant,ae={...y,align:C,component:Dt,padding:z||(st&&st.padding?st.padding:"normal"),size:q||(st&&st.size?st.size:"medium"),sortDirection:et,stickyHeader:ie==="head"&&st&&st.stickyHeader,variant:ie},Ne=cMn(ae);let pn=null;return et&&(pn=et==="asc"?"ascending":"descending"),le.jsx(uMn,{as:Dt,ref:p,className:bo(Ne.root,N),"aria-sort":pn,scope:St,ownerState:ae,...nt})});function lMn(o){return Vc("MuiTableHead",o)}au("MuiTableHead",["root"]);const hMn=o=>{const{classes:s}=o;return Hc({root:["root"]},lMn,s)},fMn=Ia("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(o,s)=>s.root})({display:"table-header-group"}),dMn={variant:"head"},vCe="thead",pMn=hn.forwardRef(function(s,p){const y=Su({props:s,name:"MuiTableHead"}),{className:C,component:N=vCe,...L}=y,z={...y,component:N},G=hMn(z);return le.jsx(Umt.Provider,{value:dMn,children:le.jsx(fMn,{as:N,className:bo(G.root,C),ref:p,role:N===vCe?null:"rowgroup",ownerState:z,...L})})});function gMn(o){return Vc("MuiToolbar",o)}au("MuiToolbar",["root","gutters","regular","dense"]);const bMn=o=>{const{classes:s,disableGutters:p,variant:y}=o;return Hc({root:["root",!p&&"gutters",y]},gMn,s)},mMn=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}]}))),_Ce=hn.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},et=bMn(q);return le.jsx(mMn,{as:N,className:bo(et.root,C),ref:p,ownerState:q,...G})});function yMn(o){return Vc("MuiTableRow",o)}const xCe=au("MuiTableRow",["root","selected","hover","head","footer"]),wMn=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"]},yMn,s)},vMn=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,[`&.${xCe.hover}:hover`]:{backgroundColor:(o.vars||o).palette.action.hover},[`&.${xCe.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)}}}))),ECe="tr",kbt=hn.forwardRef(function(s,p){const y=Su({props:s,name:"MuiTableRow"}),{className:C,component:N=ECe,hover:L=!1,selected:z=!1,...G}=y,q=hn.useContext(Umt),et={...y,component:N,hover:L,selected:z,head:q&&q.variant==="head",footer:q&&q.variant==="footer"},tt=wMn(et);return le.jsx(vMn,{as:N,ref:p,className:bo(tt.root,C),role:N===ECe?null:"row",ownerState:et,...G})});function _Mn(o){return Vc("MuiTextField",o)}au("MuiTextField",["root"]);const xMn={standard:zmt,filled:RFt,outlined:BFt},EMn=o=>{const{classes:s}=o;return Hc({root:["root"]},_Mn,s)},TMn=Ia(IPn,{name:"MuiTextField",slot:"Root",overridesResolver:(o,s)=>s.root})({}),$Dt=hn.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:et=!1,error:tt=!1,FormHelperTextProps:nt,fullWidth:st=!1,helperText:at,id:Ot,InputLabelProps:Dt,inputProps:St,InputProps:ie,inputRef:ae,label:Ne,maxRows:pn,minRows:de,multiline:cn=!1,name:er,onBlur:Dn,onChange:jn,onFocus:or,placeholder:gr,required:fi=!1,rows:pi,select:Or=!1,SelectProps:di,slots:Ea={},slotProps:Qi={},type:li,value:ze,variant:Ba="outlined",...Ts}=y,Ke={...y,autoFocus:N,color:G,disabled:et,error:tt,fullWidth:st,multiline:cn,required:fi,select:Or,variant:Ba},xo=EMn(Ke),Ss=VQ(Ot),Pa=at&&Ss?`${Ss}-helper-text`:void 0,zo=Ne&&Ss?`${Ss}-label`:void 0,$u=xMn[Ba],gu={slots:Ea,slotProps:{input:ie,inputLabel:Dt,htmlInput:St,formHelperText:nt,select:di,...Qi}},Ds={},pc=gu.slotProps.inputLabel;Ba==="outlined"&&(pc&&typeof pc.shrink<"u"&&(Ds.notched=pc.shrink),Ds.label=Ne),Or&&((!di||!di.native)&&(Ds.id=void 0),Ds["aria-describedby"]=void 0);const[bu,P1]=wh("root",{elementType:TMn,shouldForwardComponentProp:!0,externalForwardedProps:{...gu,...Ts},ownerState:Ke,className:bo(xo.root,z),ref:p,additionalProps:{disabled:et,error:tt,fullWidth:st,required:fi,color:G,variant:Ba}}),[il,Rh]=wh("input",{elementType:$u,externalForwardedProps:gu,additionalProps:Ds,ownerState:Ke}),[Mg,Rg]=wh("inputLabel",{elementType:eLn,externalForwardedProps:gu,ownerState:Ke}),[Dg,iy]=wh("htmlInput",{elementType:"input",externalForwardedProps:gu,ownerState:Ke}),[Yp,wd]=wh("formHelperText",{elementType:HPn,externalForwardedProps:gu,ownerState:Ke}),[Vp,Iw]=wh("select",{elementType:dIe,externalForwardedProps:gu,ownerState:Ke}),Jd=le.jsx(il,{"aria-describedby":Pa,autoComplete:C,autoFocus:N,defaultValue:q,fullWidth:st,multiline:cn,name:er,rows:pi,maxRows:pn,minRows:de,type:li,value:ze,id:Ss,inputRef:ae,onBlur:Dn,onChange:jn,onFocus:or,placeholder:gr,inputProps:iy,slots:{input:Ea.htmlInput?Dg:void 0},...Rh});return le.jsxs(bu,{...P1,children:[Ne!=null&&Ne!==""&&le.jsx(Mg,{htmlFor:Ss,id:zo,...Rg,children:Ne}),Or?le.jsx(Vp,{"aria-describedby":Pa,id:Ss,labelId:zo,value:ze,input:Jd,...Iw,children:L}):Jd,at&&le.jsx(Yp,{id:Pa,...wd,children:at})]})});class gIe{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 gIe(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 bIe 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 mIe 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 yIe extends mIe{constructor(s){super(s)}}class zQ extends yIe{constructor(s){super(s)}}class oC extends yIe{constructor(s){super(s)}}var yd;(function(o){function s(et){if(typeof et=="string")return et;let tt=et.constructor.name;return et.constructor.__MODULE&&(tt=`${et.constructor.__MODULE}.${tt}`),`std.${tt}`}o.get_class_name=s;function p(et,tt){return new oC(`Error on ${s(et)}.${tt}(): it's empty container.`)}o.empty=p;function y(et,tt,nt){return new oC(`Error on ${s(et)}.${tt}(): parametric index is negative -> (index = ${nt}).`)}o.negative_index=y;function C(et,tt,nt,st){return new oC(`Error on ${s(et)}.${tt}(): parametric index is equal or greater than size -> (index = ${nt}, size: ${st}).`)}o.excessive_index=C;function N(et,tt){return new zQ(`Error on ${s(et)}.${tt}(): parametric iterator is not this container's own.`)}o.not_my_iterator=N;function L(et,tt){return new zQ(`Error on ${s(et)}.${tt}(): parametric iterator, it already has been erased.`)}o.erased_iterator=L;function z(et,tt,nt){return new oC(`Error on ${s(et)}.${tt}(): parametric iterator is directing negative position -> (index = ${nt}).`)}o.negative_iterator=z;function G(et,tt="end"){const nt=s(et);return new oC(`Error on ${nt}.Iterator.value: cannot access to the ${nt}.${tt}().value.`)}o.iterator_end_value=G;function q(et,tt,nt){throw new oC(`Error on ${s(et)}.${tt}(): unable to find the matched key -> ${nt}`)}o.key_nout_found=q})(yd||(yd={}));class wIe extends bIe{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 vIe extends bIe{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 _Ie 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 xIe extends _Ie{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 EIe extends _Ie{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 imt;(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})(imt||(imt={}));function TIe(){return jDt===null&&(jDt=typeof global=="object"&&kMn(global)),jDt}function kMn(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 SMn(){return lQ===null&&(lQ=TIe()?global:self,lQ.__s_iUID===void 0&&(lQ.__s_iUID=0)),lQ}let lQ=null;function bk(o){if(o instanceof Object){if(o.hasOwnProperty("__get_m_iUID")===!1){const s=++SMn().__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 Z_(o,s){return o=o&&o.valueOf(),s=s&&s.valueOf(),o instanceof Object&&o.equals instanceof Function?o.equals(s):o===s}function CMn(o,s){return!Z_(o,s)}function i5(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=i5;if(L.length===1&&L[0]instanceof C){const q=L[0];G=q.key_comp(),z=()=>{const et=q.begin(),tt=q.end();y.assign(et,tt)}}else{const q=imt.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 $Ft(...o){let s=IMn;for(let p of o){p=p&&p.valueOf();const y=typeof p;if(y==="boolean")s=AMn(p,s);else if(y==="number"||y==="bigint")s=TCe(p,s);else if(y==="string")s=kIe(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*=jFt}else s=TCe(bk(p),s)}return Math.abs(s)}function AMn(o,s){return s^=o?1:0,s*=jFt,s}function TCe(o,s){return kIe(o.toString(),s)}function kIe(o,s){for(let p=0;p<o.length;++p)s^=o.charCodeAt(p),s*=jFt;return Math.abs(s)}const IMn=2166136261,jFt=16777619;class rp{constructor(s,p){this.first=s,this.second=p}equals(s){return Z_(this.first,s.first)&&Z_(this.second,s.second)}less(s){return Z_(this.first,s.first)===!1?i5(this.first,s.first):i5(this.second,s.second)}hashCode(){return $Ft(this.first,this.second)}}class SIe extends wIe{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 OMn extends mIe{constructor(s){super(s)}}let NMn=class extends OMn{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 HFt 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 NMn(`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 zFt extends HFt{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 UFt{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 Z_(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 qFt 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 zFt{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 UFt{source(){return this._Get_array().source()}reverse(){return new p(this)}}o.Iterator=s;class p extends qFt{_Create_neighbor(C){return new p(C)}}o.ReverseIterator=p})(N3||(N3={}));function Kmt(o,s){if(o.index instanceof Function)return PMn(o,s);let p=0;for(;!o.equals(s);o=o.next())++p;return p}function PMn(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 zQ("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=i5){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=i5){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 amt extends SIe{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 CIe extends vIe{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 smt extends CIe{constructor(...s){super(p=>new N3(p)),ey.construct(this,smt,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"})(smt||(smt={}));class mk{constructor(s,p){this.first=s,this.second=p}equals(s){return Z_(this.first,s.first)}less(s){return i5(this.first,s.first)}hashCode(){return $Ft(this.first)}}class AIe extends xIe{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 zFt{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 UFt{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 qFt{_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 omt extends AIe{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 IIe extends EIe{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 cmt extends IIe{constructor(...s){super(p=>new P3(p)),ey.construct(this,cmt,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"})(cmt||(cmt={}));class i$ extends qFt{_Create_neighbor(s){return new i$(s)}}class WFt extends UFt{reverse(){return new i$(this)}source(){return this._Get_array()}}class uC extends zFt{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=WFt,o.ReverseIterator=i$})(uC||(uC={}));function kBt(o,s,p=i5){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)),kBt(o,o.advance(L-1),p),kBt(o.advance(L),s,p)}function HDt(o,s){[o.value,s.value]=[s.value,o.value]}class qp extends HFt{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 zQ(`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 et=this.matrix_.splice(++N.first);this.matrix_.push(L),this.matrix_.push(...et)}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,et=Math.min(y,G.length-q);G.splice(q,et),G.length!==0&&(L===0?C=G:N=G),G.length===0&&this.matrix_.length>1&&this.matrix_.splice(z.first,1),y-=et,++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=WFt,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 v6{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 KFt 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(){v6._Set_prev(this.end_,this.end_),v6._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),v6._Set_next(C,G),C=G,++L}return s.equals(this.begin())===!0&&(this.begin_=N),v6._Set_next(C,s),v6._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();v6._Set_next(y,p),v6._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 J_ extends KFt{constructor(...s){if(super(),this.ptr_={value:this},J_.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 J_){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 J_.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=Z_){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=>Z_(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=i5){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=i5){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();J_.Iterator._Set_prev(y,N),J_.Iterator._Set_next(y,C),y=N}this.begin_=s,J_.Iterator._Set_prev(this.end_,p),J_.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 v6{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})(J_||(J_={}));class l0 extends KFt{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 v6{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 LMn{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 OIe{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 LMn(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 NIe extends OIe{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 kCe extends NIe{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 AIe{constructor(...s){super(p=>new l0(p)),ey.construct(this,XF,p=>{this.tree_=new kCe(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_),kCe._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 UQ extends HFt{constructor(...s){if(super(),s.length===1&&s[0]instanceof UQ){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();CMn(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 UQ.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,et=N.second;y.push(new rp(q,et))}}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=WFt,o.ReverseIterator=i$})(UQ||(UQ={}));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 gIe(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=Z_){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=>Z_(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=i5){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=i5){const p=new uC(this.begin(),this.end());kBt(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 KFt{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 v6{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 PIe extends OIe{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 SCe extends PIe{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 umt extends SIe{constructor(...s){super(p=>new h0(p)),ey.construct(this,umt,p=>{this.tree_=new SCe(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_),SCe._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})(umt||(umt={}));var QF;(function(o){function s(p,y,C,...N){let L=null,z=$Ft,G=Z_;if(N.length===1&&N[0]instanceof y){const q=N[0];z=q.hash_function(),G=q.key_eq(),L=()=>{const et=q.begin(),tt=q.end();p.assign(et,tt)}}else{const q=imt.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 LIe{constructor(s,p){this.fetcher_=s,this.hasher_=p,this.max_load_factor_=MMn,this.data_=[],this.size_=0,this.initialize()}clear(){this.data_=[],this.size_=0,this.initialize()}rehash(s){s=Math.max(s,CCe);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<CCe;++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 CCe=10,MMn=1;class lmt extends LIe{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.value,s))return C;return this.source_.end()}}function RMn(o){return o.value}class hmt extends wIe{constructor(...s){super(p=>new h0(p)),QF.construct(this,hmt,(p,y)=>{this.buckets_=new lmt(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_),lmt._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})(hmt||(hmt={}));class ACe extends PIe{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 fmt extends CIe{constructor(...s){super(p=>new h0(p)),ey.construct(this,fmt,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})(fmt||(fmt={}));class dmt extends vIe{constructor(...s){super(p=>new h0(p)),QF.construct(this,dmt,(p,y)=>{this.buckets_=new lmt(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_),lmt._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})(dmt||(dmt={}));class pmt extends LIe{constructor(s,p,y){super(DMn,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 DMn(o){return o.first}class gmt extends xIe{constructor(...s){super(p=>new l0(p)),QF.construct(this,gmt,(p,y)=>{this.buckets_=new pmt(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_),pmt._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})(gmt||(gmt={}));class ICe extends NIe{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 bmt extends IIe{constructor(...s){super(p=>new l0(p)),ey.construct(this,bmt,p=>{this.tree_=new ICe(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_),ICe._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})(bmt||(bmt={}));class mmt extends EIe{constructor(...s){super(p=>new l0(p)),QF.construct(this,mmt,(p,y)=>{this.buckets_=new pmt(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_),pmt._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})(mmt||(mmt={}));var OCe;(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 et=0;for(;L<z;L+=q)et+=N(L)*q;return et}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]})(OCe||(OCe={}));function BMn(o){return new Promise(s=>{setTimeout(s,o)})}var k6;(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()}})(k6||(k6={}));class NCe{}(function(o){function s(N,L){return k6.lock(()=>N.lock(),()=>N.unlock(),L)}o.lock=s;function p(N,L){return k6.try_lock(()=>N.try_lock(),()=>N.unlock(),L)}o.try_lock=p;function y(N,L,z){return k6.try_lock(()=>N.try_lock_for(L),()=>N.unlock(),z)}o.try_lock_for=y;function C(N,L,z){return k6.try_lock(()=>N.try_lock_until(L),()=>N.unlock(),z)}o.try_lock_until=C})(NCe||(NCe={}));class PCe{}(function(o){function s(N,L){return k6.lock(()=>N.lock_shared(),()=>N.unlock_shared(),L)}o.lock=s;function p(N,L){return k6.try_lock(()=>N.try_lock_shared(),()=>N.unlock_shared(),L)}o.try_lock=p;function y(N,L,z){return k6.try_lock(()=>N.try_lock_shared_for(L),()=>N.unlock_shared(),z)}o.try_lock_for=y;function C(N,L,z){return k6.try_lock(()=>N.try_lock_shared_until(L),()=>N.unlock_shared(),z)}o.try_lock_until=C})(PCe||(PCe={}));class SBt{constructor(s){this.queue_=new J_,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});BMn(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 zQ(`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})(SBt||(SBt={}));const Ng=[];for(let o=0;o<256;++o)Ng.push((o+256).toString(16).slice(1));function FMn(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 $Mn=new Uint8Array(16);function jMn(){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($Mn)}const HMn=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),LCe={randomUUID:HMn};function wk(o,s,p){var C;if(LCe.randomUUID&&!o)return LCe.randomUUID();o=o||{};const y=o.random??((C=o.rng)==null?void 0:C.call(o))??jMn();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,FMn(y)}function zMn(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(([et])=>et!=="aggregate").map(([,et])=>q(et)).reduce((et,tt)=>et+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 MIe={aggregate:zMn};class dP{constructor(s){if(s===void 0){const p=dP.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){MIe.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 dP({aggregate:s(),initialize:s(),select:s(),cancel:s(),call:s(),describe:s()})}static plus(s,p){const y=new dP(s);return y.increment(p.toJSON()),y}}function RIe(o,s,p){const y=o.get(s);if(y!==void 0)return y;const C=p();return o.set(s,C),C}function UMn(o){var z;const s=o.controllers.length===1||(()=>{const G=o.controllers.map(q=>q.application.functions.map(et=>et.name)).flat();return new Set(G).size===G.length})(),p=qMn({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?YMn({array:p,capacity:y}):void 0,N=new Map,L=new Map;for(const G of p)N.set(G.name,G),RIe(L,G.controller.name,()=>new Map).set(G.name,G);return{array:p,divided:C,flat:N,group:L}}function qMn(o){return o.controllers.flatMap((s,p)=>{switch(s.protocol){case"http":return WMn({controller:s,index:p,naming:o.naming});case"class":return KMn({controller:s,index:p,naming:o.naming});case"mcp":return GMn({controller:s,index:p,naming:o.naming});default:throw new Error(`Unsupported protocol: ${s.protocol}`)}})}function WMn(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 KMn(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 GMn(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 YMn(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 VMn={compose:UMn};function XMn(o){for(const s of o.errors){if(s.value!==void 0)continue;const p=["> You AI have not defined the value (`undefined`).",">",`> Please fill the \`${s.expected}\` typed value at the next time.`].join(`
|
|
31
|
+
`);s.description===void 0||s.description.length===0?s.description=p:s.description+=`
|
|
32
|
+
|
|
33
|
+
${p}`}}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==="data"?{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.url,detail:o.detail}};throw new Error(`Unsupported user message content type, value: ${JSON.stringify(o)}`)}function DIe(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 QMn(o){const s={type:"assistantMessage",id:o.id,created_at:o.created_at,text:o.text};return{...s,toJSON:()=>s}}function JMn(o){const s={type:"systemMessage",id:o.id,created_at:o.created_at,text:o.text};return{...s,toJSON:()=>s}}function ZMn(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 BIe(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 tRn(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 FIe(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 eRn(){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 nRn(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:()=>BIe({id:s,created_at:p,selection:o.selection})}}function rRn(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 iRn(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 aRn(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 sRn(o){XMn(o.result);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 ymt(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:()=>FIe({id:s,created_at:p,...o})}}function oRn(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:()=>DIe({id:s,created_at:p,contents:o.contents})}}function GFt(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 cRn(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 uRn(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 CBt;(function(o){o.is=s=>typeof s=="object"&&s!==null&&typeof s.openapi=="string"&&s.openapi.startsWith("3.0")})(CBt||(CBt={}));var ABt;(function(o){o.is=s=>typeof s=="object"&&s!==null&&typeof s.openapi=="string"&&s.openapi.startsWith("3.1")})(ABt||(ABt={}));var IBt;(function(o){o.is=s=>typeof s=="object"&&s!==null&&typeof s.swagger=="string"&&s.swagger.startsWith("2.0")})(IBt||(IBt={}));var wmt;(function(o){o.reference=s=>s.split("/").filter((p,y)=>!!p.length&&!(y===0&&p==="#")).join(".")})(wmt||(wmt={}));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=>lRn.has(s)})(JF||(JF={}));const lRn=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
34
|
|
|
32
35
|
`+L.description.split(`
|
|
33
36
|
`).map(G=>`> ${G}`).join(`
|
|
@@ -41,7 +44,7 @@ import{O as BAe,r as hn,P as jIn,Q as HIn,d as Im,S as zIn,U as UIn,V as FAe,x a
|
|
|
41
44
|
`).map(L=>`> ${L}`).join(`
|
|
42
45
|
`))].join(`
|
|
43
46
|
|
|
44
|
-
`);return p.length?p:void 0}})(hC||(hC={}));var rl;(function(o){o.isNull=at=>at.type==="null",o.isUnknown=at=>at.type===void 0&&!o.isConstant(at)&&!o.isOneOf(at)&&!o.isReference(at),o.isConstant=at=>at.const!==void 0,o.isBoolean=at=>at.type==="boolean",o.isInteger=at=>at.type==="integer",o.isNumber=at=>at.type==="number",o.isString=at=>at.type==="string",o.isArray=at=>at.type==="array"&&at.items!==void 0,o.isTuple=at=>at.type==="array"&&at.prefixItems!==void 0,o.isObject=at=>at.type==="object",o.isReference=at=>at.$ref!==void 0,o.isOneOf=at=>at.oneOf!==void 0,o.isRecursiveReference=at=>{if(o.isReference(at.schema)===!1)return!1;const Ot=at.schema.$ref.split(at.prefix)[1];let Dt=0;return o.visit({prefix:at.prefix,components:at.components,schema:at.schema,closure:St=>{if(o.isReference(St)){const ie=St.$ref.split(at.prefix)[1];Ot===ie&&++Dt}}}),Dt>1},o.unreference=at=>{const Ot=[],Dt=s({prefix:at.prefix,refAccessor:at.refAccessor??`$input.${at.prefix.substring(2).split("/").filter(St=>!!St.length).join(".")}`,accessor:at.accessor??"$input.schema",components:at.components,schema:at.schema,reasons:Ot});return Dt===null?{success:!1,error:{method:at.method,message:"failed to unreference due to unable to find.",reasons:Ot}}:{success:!0,value:Dt}},o.escape=at=>{const Ot=[],Dt=p({...at,reasons:Ot,visited:new Map,accessor:at.accessor??"$input.schema",refAccessor:at.refAccessor??wmt.reference(at.prefix)})||null;return Dt===null?{success:!1,error:{method:at.method,message:`failed to escape some reference type(s) due to unable to find${Number(at.recursive)===0?" or recursive relationship":""}.`,reasons:Ot}}:{success:!0,value:Dt}},o.visit=at=>{const Ot=new Set,Dt=at.refAccessor??`$input.${wmt.reference(at.prefix)}`,St=(ie,ae)=>{var Ne;if(at.closure(ie,ae),o.isReference(ie)){const pn=ie.$ref.split(at.prefix).pop();if(Ot.has(pn)===!0)return;Ot.add(pn);const de=(Ne=at.components.schemas)==null?void 0:Ne[pn];de!==void 0&&St(de,`${Dt}[${JSON.stringify(pn)}]`)}else if(o.isOneOf(ie))ie.oneOf.forEach((pn,de)=>St(pn,`${ae}.oneOf[${de}]`));else if(o.isObject(ie)){for(const[pn,de]of Object.entries(ie.properties??{}))St(de,`${ae}.properties[${JSON.stringify(pn)}]`);typeof ie.additionalProperties=="object"&&ie.additionalProperties!==null&&St(ie.additionalProperties,`${ae}.additionalProperties`)}else o.isArray(ie)?St(ie.items,`${ae}.items`):o.isTuple(ie)&&((ie.prefixItems??[]).forEach((pn,de)=>St(pn,`${ae}.prefixItems[${de}]`)),typeof ie.additionalItems=="object"&&ie.additionalItems!==null&&St(ie.additionalItems,`${ae}.additionalItems`))};St(at.schema,at.accessor??"$input.schema")},o.covers=at=>y({prefix:at.prefix,components:at.components,x:at.x,y:at.y,visited:new Map});const s=at=>{var St;if(o.isReference(at.schema)===!1)return at.schema;const Ot=at.schema.$ref.split(at.prefix).pop(),Dt=(St=at.components.schemas)==null?void 0:St[Ot];return Dt===void 0?(at.reasons.push({schema:at.schema,accessor:at.accessor,message:`unable to find reference type ${JSON.stringify(Ot)}.`}),null):o.isReference(Dt)===!1?Dt:at.first===Ot?(at.reasons.push({schema:at.schema,accessor:at.accessor,message:`recursive reference type ${JSON.stringify(Ot)}.`}),null):s({...at,accessor:`${at.refAccessor}[${JSON.stringify(Ot)}]`,first:Ot})},p=at=>{var Ot,Dt;if(o.isReference(at.schema)){const St=at.schema.$ref.split(at.prefix)[1],ie=(Ot=at.components.schemas)==null?void 0:Ot[St];if(ie===void 0)return at.reasons.push({schema:at.schema,accessor:at.accessor,message:`unable to find reference type ${JSON.stringify(St)}.`}),null;if(at.visited.has(St)===!0){if(at.recursive===!1)return null;const ae=at.visited.get(St);if(ae>at.recursive)return at.recursive===0?(at.reasons.push({schema:at.schema,accessor:at.accessor,message:`recursive reference type ${JSON.stringify(St)}.`}),null):void 0;at.visited.set(St,ae+1);const Ne=p({...at,schema:ie,accessor:`${at.refAccessor}[${JSON.stringify(St)}]`});return Ne&&{...Ne,description:hC.cascade({prefix:at.prefix,components:at.components,schema:at.schema,escape:!0})}}else{const ae=p({...at,schema:ie,accessor:`${at.refAccessor}[${JSON.stringify(St)}]`,visited:new Map([...at.visited,[St,1]])});return ae&&{...ae,description:hC.cascade({prefix:at.prefix,components:at.components,schema:at.schema,escape:!0})}}}else if(o.isOneOf(at.schema)){const St=at.schema.oneOf.map((ae,Ne)=>p({...at,schema:ae,accessor:`${at.accessor}.oneOf[${Ne}]`}));if(St.some(ae=>ae===null))return null;const ie=St.filter(ae=>ae!==void 0);return ie.length===0?void 0:{...at.schema,oneOf:ie.map(ae=>nt({prefix:at.prefix,components:at.components,schema:ae})).flat()}}else if(o.isObject(at.schema)){const St=at.schema,ie=Object.entries(St.properties??{}).map(([Ne,pn])=>[Ne,p({...at,schema:pn,visited:at.visited,accessor:`${at.accessor}.properties[${JSON.stringify(Ne)}]`})]),ae=St.additionalProperties?typeof St.additionalProperties=="object"&&St.additionalProperties!==null?p({...at,schema:St.additionalProperties,accessor:`${at.accessor}.additionalProperties`}):St.additionalProperties:!1;return ie.some(([Ne,pn])=>pn===null)||ae===null?null:ie.some(([Ne,pn])=>{var de;return pn===void 0&&((de=St.required)==null?void 0:de.includes(Ne))===!0})===!0?void 0:{...St,properties:Object.fromEntries(ie.filter(([Ne,pn])=>pn!==void 0)),additionalProperties:ae??!1,required:((Dt=St.required)==null?void 0:Dt.filter(Ne=>ie.some(([pn,de])=>pn===Ne&&de!==void 0)))??[]}}else if(o.isTuple(at.schema)){const St=at.schema.prefixItems.map((ae,Ne)=>p({...at,schema:ae,accessor:`${at.accessor}.prefixItems[${Ne}]`})),ie=at.schema.additionalItems?typeof at.schema.additionalItems=="object"&&at.schema.additionalItems!==null?p({...at,schema:at.schema.additionalItems,accessor:`${at.accessor}.additionalItems`}):at.schema.additionalItems:!1;return St.some(ae=>ae===null)||ie===null?null:St.some(ae=>ae===void 0)?void 0:{...at.schema,prefixItems:St,additionalItems:ie??!1}}else if(o.isArray(at.schema)){const St=p({...at,schema:at.schema.items,accessor:`${at.accessor}.items`});return St===null?null:St===void 0?{...at.schema,minItems:void 0,maxItems:0,items:{}}:{...at.schema,items:St}}return at.schema},y=at=>{var ie;const Ot=(ie=at.visited.get(at.x))==null?void 0:ie.get(at.y);if(Ot!==void 0)return Ot;const Dt=lC.take(at.visited)(at.x)(()=>new Map);Dt.set(at.y,!0);const St=C(at);return Dt.set(at.y,St),St},C=at=>{if(at.x===at.y)return!0;if(o.isReference(at.x)&&o.isReference(at.y)&&at.x.$ref===at.y.$ref)return!0;const Ot=nt({prefix:at.prefix,components:at.components,schema:at.x}),Dt=nt({prefix:at.prefix,components:at.components,schema:at.y});return Ot.some(St=>o.isUnknown(St))?!0:Dt.some(St=>o.isUnknown(St))?!1:Dt.every(St=>Ot.some(ie=>N({prefix:at.prefix,components:at.components,visited:at.visited,x:ie,y:St})))},N=at=>at.x===at.y||o.isUnknown(at.x)?!0:o.isUnknown(at.y)?!1:o.isNull(at.x)?o.isNull(at.y):o.isConstant(at.x)?o.isConstant(at.y)&&at.x.const===at.y.const:o.isBoolean(at.x)?o.isBoolean(at.y)||o.isConstant(at.y)&&typeof at.y.const=="boolean":o.isInteger(at.x)?(o.isInteger(at.y)||o.isConstant(at.y))&&G(at.x,at.y):o.isNumber(at.x)?(o.isConstant(at.y)||o.isInteger(at.y)||o.isNumber(at.y))&&q(at.x,at.y):o.isString(at.x)?(o.isConstant(at.y)||o.isString(at.y))&&et(at.x,at.y):o.isArray(at.x)?(o.isArray(at.y)||o.isTuple(at.y))&&L({prefix:at.prefix,components:at.components,visited:at.visited,x:at.x,y:at.y}):o.isObject(at.x)?o.isObject(at.y)&&z({prefix:at.prefix,components:at.components,visited:at.visited,x:at.x,y:at.y}):o.isReference(at.x)?o.isReference(at.y)&&at.x.$ref===at.y.$ref:!1,L=at=>{if(o.isTuple(at.y))return at.y.prefixItems.every(Ot=>y({prefix:at.prefix,components:at.components,visited:at.visited,x:at.x.items,y:Ot}))&&(at.y.additionalItems===void 0||typeof at.y.additionalItems=="object"&&y({prefix:at.prefix,components:at.components,visited:at.visited,x:at.x.items,y:at.y.additionalItems}));if(at.x.minItems===void 0||at.y.minItems!==void 0&&at.x.minItems<=at.y.minItems){if(!(at.x.maxItems===void 0||at.y.maxItems!==void 0&&at.x.maxItems>=at.y.maxItems))return!1}else return!1;return y({prefix:at.prefix,components:at.components,visited:at.visited,x:at.x.items,y:at.y.items})},z=at=>!at.x.additionalProperties&&at.y.additionalProperties||at.x.additionalProperties&&at.y.additionalProperties&&(typeof at.x.additionalProperties=="object"&&at.y.additionalProperties===!0||typeof at.x.additionalProperties=="object"&&typeof at.y.additionalProperties=="object"&&!y({prefix:at.prefix,components:at.components,visited:at.visited,x:at.x.additionalProperties,y:at.y.additionalProperties}))?!1:Object.entries(at.y.properties??{}).every(([Ot,Dt])=>{var ie,ae,Ne;const St=(ie=at.x.properties)==null?void 0:ie[Ot];return St===void 0||((ae=at.x.required)==null?void 0:ae.includes(Ot))===!0&&(((Ne=at.y.required)==null?void 0:Ne.includes(Ot))??!1)===!1?!1:y({prefix:at.prefix,components:at.components,visited:at.visited,x:St,y:Dt})}),G=(at,Ot)=>o.isConstant(Ot)?typeof Ot.const=="number"&&Number.isInteger(Ot.const):at.type===Ot.type&&o.coverNumericRange(at,Ot),q=(at,Ot)=>o.isConstant(Ot)?typeof Ot.const=="number":(at.type===Ot.type||at.type==="number"&&Ot.type==="integer")&&o.coverNumericRange(at,Ot),et=(at,Ot)=>o.isConstant(Ot)?typeof Ot.const=="string":[at.format===void 0||Ot.format!==void 0&&tt(at.format,Ot.format),at.pattern===void 0||at.pattern===Ot.pattern,at.minLength===void 0||Ot.minLength!==void 0&&at.minLength<=Ot.minLength,at.maxLength===void 0||Ot.maxLength!==void 0&&at.maxLength>=Ot.maxLength].every(Dt=>Dt),tt=(at,Ot)=>at===Ot||at==="idn-email"&&Ot==="email"||at==="idn-hostname"&&Ot==="hostname"||["uri","iri"].includes(at)&&Ot==="url"||at==="iri"&&Ot==="uri"||at==="iri-reference"&&Ot==="uri-reference",nt=at=>{const Ot=st(at);return o.isOneOf(Ot)?Ot.oneOf.map(Dt=>nt({prefix:at.prefix,components:at.components,schema:Dt})).flat():[Ot]},st=at=>{var St;if(o.isReference(at.schema)===!1)return at.schema;const Ot=at.schema.$ref.replace(at.prefix,""),Dt=st({prefix:at.prefix,components:at.components,schema:((St=at.components.schemas)==null?void 0:St[Ot])??{}});if(Dt===void 0)throw new Error(`Reference type not found: ${JSON.stringify(at.schema.$ref)}`);return st({prefix:at.prefix,components:at.components,schema:Dt})};o.coverNumericRange=(at,Ot)=>[at.minimum===void 0||Ot.minimum!==void 0&&at.minimum<=Ot.minimum||Ot.exclusiveMinimum!==void 0&&at.minimum<Ot.exclusiveMinimum,at.maximum===void 0||Ot.maximum!==void 0&&at.maximum>=Ot.maximum||Ot.exclusiveMaximum!==void 0&&at.maximum>Ot.exclusiveMaximum,at.exclusiveMinimum===void 0||Ot.minimum!==void 0&&at.exclusiveMinimum<=Ot.minimum||Ot.exclusiveMinimum!==void 0&&at.exclusiveMinimum<=Ot.exclusiveMinimum,at.exclusiveMaximum===void 0||Ot.maximum!==void 0&&at.exclusiveMaximum>=Ot.maximum||Ot.exclusiveMaximum!==void 0&&at.exclusiveMaximum>=Ot.exclusiveMaximum,at.multipleOf===void 0||Ot.multipleOf!==void 0&&Ot.multipleOf/at.multipleOf===Math.floor(Ot.multipleOf/at.multipleOf)].every(Dt=>Dt)})(rl||(rl={}));var Pr;(function(o){o.isNull=s=>rl.isNull(s),o.isUnknown=s=>rl.isUnknown(s),o.isConstant=s=>rl.isConstant(s),o.isBoolean=s=>rl.isBoolean(s),o.isInteger=s=>rl.isInteger(s),o.isNumber=s=>rl.isNumber(s),o.isString=s=>rl.isString(s),o.isArray=s=>rl.isArray(s),o.isTuple=s=>rl.isTuple(s),o.isObject=s=>rl.isObject(s),o.isReference=s=>rl.isReference(s),o.isOneOf=s=>rl.isOneOf(s),o.isRecursiveReference=s=>rl.isRecursiveReference({prefix:"#/components/schemas/",components:s.components,schema:s.schema}),o.escape=s=>rl.escape({...s,prefix:"#/components/schemas/",method:"OpenApiTypeChecker.method"}),o.unreference=s=>rl.unreference({...s,prefix:"#/components/schemas/",method:"OpenApiTypeChecker.unreference"}),o.visit=s=>rl.visit({...s,prefix:"#/components/schemas/"}),o.covers=s=>rl.covers({prefix:"#/components/schemas/",components:s.components,x:s.x,y:s.y})})(Pr||(Pr={}));var vmt;(function(o){o.downgrade=q=>{const et=o.downgradeComponents(q.components);return{openapi:"3.0.0",servers:q.servers,info:q.info,components:et.downgraded,paths:q.paths?Object.fromEntries(Object.entries(q.paths).filter(([tt,nt])=>nt!==void 0).map(([tt,nt])=>[tt,s(et)(nt)])):void 0,security:q.security,tags:q.tags}};const s=q=>et=>({...et,...et.get?{get:p(q)(et.get)}:void 0,...et.put?{put:p(q)(et.put)}:void 0,...et.post?{post:p(q)(et.post)}:void 0,...et.delete?{delete:p(q)(et.delete)}:void 0,...et.options?{options:p(q)(et.options)}:void 0,...et.head?{head:p(q)(et.head)}:void 0,...et.patch?{patch:p(q)(et.patch)}:void 0,...et.trace?{trace:p(q)(et.trace)}:void 0}),p=q=>et=>({...et,parameters:et.parameters?et.parameters.map(y(q)):void 0,requestBody:et.requestBody?C(q)(et.requestBody):void 0,responses:et.responses?Object.fromEntries(Object.entries(et.responses).filter(([tt,nt])=>nt!==void 0).map(([tt,nt])=>[tt,N(q)(nt)])):void 0}),y=q=>et=>({...et,schema:o.downgradeSchema(q)(et.schema)}),C=q=>et=>({...et,content:et.content?L(q)(et.content):void 0}),N=q=>et=>({...et,content:et.content?L(q)(et.content):void 0,headers:et.headers?Object.fromEntries(Object.entries(et.headers).filter(([tt,nt])=>nt!==void 0).map(([tt,nt])=>[tt,{...nt,schema:o.downgradeSchema(q)(nt.schema)}])):void 0}),L=q=>et=>Object.fromEntries(Object.entries(et).filter(([tt,nt])=>nt!==void 0).map(([tt,nt])=>[tt,{...nt,schema:nt!=null&&nt.schema?o.downgradeSchema(q)(nt.schema):void 0}]));o.downgradeComponents=q=>{const et={original:q,downgraded:{securitySchemes:q.securitySchemes}};if(q.schemas){et.downgraded.schemas={};for(const[tt,nt]of Object.entries(q.schemas))nt!==void 0&&(et.downgraded.schemas[tt]=o.downgradeSchema(et)(nt))}return et},o.downgradeSchema=q=>et=>{const tt=G(new Set)(q.original)(et),nt=[],st={title:et.title,description:et.description,example:et.example,examples:et.examples,...Object.fromEntries(Object.entries(et).filter(([Dt,St])=>Dt.startsWith("x-")&&St!==void 0))},at=Dt=>{Pr.isBoolean(Dt)?nt.push({type:"boolean"}):Pr.isBoolean(Dt)||Pr.isInteger(Dt)||Pr.isNumber(Dt)||Pr.isString(Dt)||Pr.isReference(Dt)?nt.push({...Dt}):Pr.isArray(Dt)?nt.push({...Dt,items:o.downgradeSchema(q)(Dt.items)}):Pr.isTuple(Dt)?nt.push({...Dt,items:(()=>{if(Dt.additionalItems===!0)return{};const St=[...Dt.prefixItems,...typeof Dt.additionalItems=="object"?[o.downgradeSchema(q)(Dt.additionalItems)]:[]];return St.length===0?{}:{oneOf:St.map(o.downgradeSchema(q))}})(),minItems:Dt.prefixItems.length,maxItems:Dt.additionalItems?void 0:Dt.prefixItems.length,prefixItems:void 0,additionalItems:void 0}):Pr.isObject(Dt)?nt.push({...Dt,properties:Dt.properties?Object.fromEntries(Object.entries(Dt.properties).filter(([St,ie])=>ie!==void 0).map(([St,ie])=>[St,o.downgradeSchema(q)(ie)])):void 0,additionalProperties:typeof Dt.additionalProperties=="object"?o.downgradeSchema(q)(Dt.additionalProperties):Dt.additionalProperties,required:Dt.required}):Pr.isOneOf(Dt)&&Dt.oneOf.forEach(at)},Ot=Dt=>{const St=ie=>{const ae=nt.find(Ne=>Ne.type===typeof ie);ae!==void 0?(ae.enum??(ae.enum=[]),ae.enum.push(ie)):nt.push({type:typeof ie,enum:[ie]})};if(Pr.isConstant(Dt))St(Dt.const);else if(Pr.isOneOf(Dt))for(const ie of Dt.oneOf)Pr.isConstant(ie)&&St(ie.const)};if(at(et),Ot(et),tt===!0)for(const Dt of nt)Pr.isReference(Dt)?z(new Set)(q)(Dt):Dt.nullable=!0;return tt===!0&&nt.length===0?{type:"null",...st}:{...nt.length===0?{type:void 0}:nt.length===1?{...nt[0]}:{oneOf:nt},...st}};const z=q=>et=>tt=>{var Ot,Dt;var nt;const st=tt.$ref.split("/").pop();if(st.endsWith(".Nullable"))return;const at=(Ot=et.original.schemas)==null?void 0:Ot[st];if(at!==void 0){{if(G(q)(et.original)(at)===!0)return;((Dt=et.downgraded.schemas)==null?void 0:Dt[`${st}.Nullable`])===void 0&&((nt=et.downgraded).schemas??(nt.schemas={}),et.downgraded.schemas[`${st}.Nullable`]={},et.downgraded.schemas[`${st}.Nullable`]=o.downgradeSchema(et)(Pr.isOneOf(at)?{...at,oneOf:[...at.oneOf,{type:"null"}]}:{oneOf:[at,{type:"null"}],title:at.title,description:at.description,example:at.example,examples:at.examples,...Object.fromEntries(Object.entries(at).filter(([St,ie])=>St.startsWith("x-")&&ie!==void 0))}))}tt.$ref+=".Nullable"}},G=q=>et=>tt=>{var nt;if(Pr.isNull(tt))return!0;if(Pr.isReference(tt)){if(q.has(tt.$ref))return!1;q.add(tt.$ref);const st=tt.$ref.split("/").pop(),at=(nt=et.schemas)==null?void 0:nt[st];return at?G(q)(et)(at):!1}return Pr.isOneOf(tt)&&tt.oneOf.some(G(q)(et))}})(vmt||(vmt={}));var mP;(function(o){o.emend=s=>{const p=typeof s.minimum=="number"&&typeof s.exclusiveMinimum=="number"?{minimum:s.minimum>s.exclusiveMinimum?s.minimum:void 0,exclusiveMinimum:s.minimum>s.exclusiveMinimum?void 0:s.exclusiveMinimum}:{},y=typeof s.maximum=="number"&&typeof s.exclusiveMaximum=="number"?{maximum:s.maximum<s.exclusiveMaximum?s.maximum:void 0,exclusiveMaximum:s.maximum<s.exclusiveMaximum?void 0:s.exclusiveMaximum}:{};return{...s,...p,...y}}})(mP||(mP={}));var _mt;(function(o){o.convert=et=>({...et,components:o.convertComponents(et.components??{}),paths:et.paths?Object.fromEntries(Object.entries(et.paths).filter(([tt,nt])=>nt!==void 0).map(([tt,nt])=>[tt,s(et)(nt)])):void 0,openapi:"3.1.0","x-samchon-emended-v4":!0});const s=et=>tt=>({...tt,...tt.get?{get:p(et)(tt)(tt.get)}:void 0,...tt.put?{put:p(et)(tt)(tt.put)}:void 0,...tt.post?{post:p(et)(tt)(tt.post)}:void 0,...tt.delete?{delete:p(et)(tt)(tt.delete)}:void 0,...tt.options?{options:p(et)(tt)(tt.options)}:void 0,...tt.head?{head:p(et)(tt)(tt.head)}:void 0,...tt.patch?{patch:p(et)(tt)(tt.patch)}:void 0,...tt.trace?{trace:p(et)(tt)(tt.trace)}:void 0}),p=et=>tt=>nt=>({...nt,parameters:tt.parameters!==void 0||nt.parameters!==void 0?[...tt.parameters??[],...nt.parameters??[]].map(st=>{var Ot,Dt,St,ie;if(!q.isReference(st))return y(et.components??{})(st);const at=st.$ref.startsWith("#/components/headers/")?(Dt=(Ot=et.components)==null?void 0:Ot.headers)==null?void 0:Dt[st.$ref.split("/").pop()??""]:(ie=(St=et.components)==null?void 0:St.parameters)==null?void 0:ie[st.$ref.split("/").pop()??""];return at!==void 0?y(et.components??{})({...at,in:"header"}):void 0}).filter((st,at)=>at!==void 0):void 0,requestBody:nt.requestBody?C(et)(nt.requestBody):void 0,responses:nt.responses?Object.fromEntries(Object.entries(nt.responses).filter(([st,at])=>at!==void 0).map(([st,at])=>[st,N(et)(at)]).filter(([st,at])=>at!==void 0)):void 0}),y=et=>tt=>({...tt,schema:o.convertSchema(et)(tt.schema),examples:tt.examples?Object.fromEntries(Object.entries(tt.examples).map(([nt,st])=>{var at;return[nt,q.isReference(st)?(at=et.examples)==null?void 0:at[st.$ref.split("/").pop()??""]:st]}).filter(([nt,st])=>st!==void 0)):void 0}),C=et=>tt=>{var nt,st;if(q.isReference(tt)){const at=(st=(nt=et.components)==null?void 0:nt.requestBodies)==null?void 0:st[tt.$ref.split("/").pop()??""];if(at===void 0)return;tt=at}return{...tt,content:tt.content?L(et.components??{})(tt.content):void 0}},N=et=>tt=>{var nt,st;if(q.isReference(tt)){const at=(st=(nt=et.components)==null?void 0:nt.responses)==null?void 0:st[tt.$ref.split("/").pop()??""];if(at===void 0)return;tt=at}return{...tt,content:tt.content?L(et.components??{})(tt.content):void 0,headers:tt.headers?Object.fromEntries(Object.entries(tt.headers).filter(([at,Ot])=>Ot!==void 0).map(([at,Ot])=>[at,(()=>{var St,ie;if(q.isReference(Ot)===!1)return y(et.components??{})({...Ot,in:"header"});const Dt=Ot.$ref.startsWith("#/components/headers/")?(ie=(St=et.components)==null?void 0:St.headers)==null?void 0:ie[Ot.$ref.split("/").pop()??""]:void 0;return Dt!==void 0?y(et.components??{})({...Dt,in:"header"}):void 0})()]).filter(([at,Ot])=>Ot!==void 0)):void 0}},L=et=>tt=>Object.fromEntries(Object.entries(tt).filter(([nt,st])=>st!==void 0).map(([nt,st])=>[nt,{...st,schema:st.schema?o.convertSchema(et)(st.schema):void 0,examples:st.examples?Object.fromEntries(Object.entries(st.examples).map(([at,Ot])=>{var Dt;return[at,q.isReference(Ot)?(Dt=et.examples)==null?void 0:Dt[Ot.$ref.split("/").pop()??""]:Ot]}).filter(([at,Ot])=>Ot!==void 0)):void 0}]));o.convertComponents=et=>({schemas:Object.fromEntries(Object.entries(et.schemas??{}).filter(([tt,nt])=>nt!==void 0).map(([tt,nt])=>[tt,o.convertSchema(et)(nt)])),securitySchemes:et.securitySchemes}),o.convertSchema=et=>tt=>{const nt={value:!1,default:void 0},st=[],at={title:tt.title,description:tt.description,...Object.fromEntries(Object.entries(tt).filter(([Dt,St])=>Dt.startsWith("x-")&&St!==void 0)),example:tt.example,examples:Array.isArray(tt.examples)?Object.fromEntries(tt.examples.map((Dt,St)=>[`v${St}`,Dt])):tt.examples},Ot=Dt=>{var St,ie,ae;Dt.nullable===!0&&(nt.value||(nt.value=!0),Dt.default===null&&(nt.default=null)),Array.isArray(Dt.enum)&&((St=Dt.enum)!=null&&St.length)&&((ie=Dt.enum)!=null&&ie.some(Ne=>Ne===null))&&(nt.value||(nt.value=!0)),q.isAnyOf(Dt)?Dt.anyOf.forEach(Ot):q.isOneOf(Dt)?Dt.oneOf.forEach(Ot):q.isAllOf(Dt)?Dt.allOf.length===1?Ot(Dt.allOf[0]):st.push(z(et)(Dt)):q.isBoolean(Dt)||q.isInteger(Dt)||q.isNumber(Dt)||q.isString(Dt)?(ae=Dt.enum)!=null&&ae.length&&Dt.enum.filter(Ne=>Ne!==null).length?st.push(...Dt.enum.filter(Ne=>Ne!==null).map(Ne=>({const:Ne}))):q.isInteger(Dt)||q.isNumber(Dt)?st.push(mP.emend({...Dt,default:Dt.default??void 0,exclusiveMinimum:typeof Dt.exclusiveMinimum=="boolean"?Dt.exclusiveMinimum===!0?Dt.minimum:void 0:Dt.exclusiveMinimum,exclusiveMaximum:typeof Dt.exclusiveMaximum=="boolean"?Dt.exclusiveMaximum===!0?Dt.maximum:void 0:Dt.exclusiveMaximum,minimum:Dt.exclusiveMinimum===!0?void 0:Dt.minimum,maximum:Dt.exclusiveMaximum===!0?void 0:Dt.maximum,enum:void 0})):st.push({...Dt,default:Dt.default??void 0,enum:void 0}):q.isArray(Dt)?st.push({...Dt,items:o.convertSchema(et)(Dt.items)}):q.isObject(Dt)?st.push({...Dt,properties:Dt.properties?Object.fromEntries(Object.entries(Dt.properties).filter(([Ne,pn])=>pn!==void 0).map(([Ne,pn])=>[Ne,o.convertSchema(et)(pn)])):{},additionalProperties:Dt.additionalProperties?typeof Dt.additionalProperties=="object"&&Dt.additionalProperties!==null?o.convertSchema(et)(Dt.additionalProperties):Dt.additionalProperties:void 0,required:Dt.required??[]}):(q.isReference(Dt),st.push(Dt))};if(Ot(tt),nt.value===!0&&!st.some(Dt=>Dt.type==="null")&&st.push({type:"null",default:nt.default}),st.length===2&&st.filter(Dt=>Pr.isNull(Dt)).length===1){const Dt=st.filter(St=>Pr.isNull(St)===!1)[0];for(const St of["title","description","deprecated","example","examples"])Dt[St]!==void 0&&delete Dt[St]}return{...st.length===0?{type:void 0}:st.length===1?{...st[0]}:{oneOf:st.map(Dt=>({...Dt,nullable:void 0}))},...at,nullable:void 0}};const z=et=>tt=>{const nt=tt.allOf.map(st=>G(et)(st));return nt.some(st=>st===null)?{type:void 0,allOf:void 0}:{...tt,type:"object",properties:Object.fromEntries(nt.map(st=>Object.entries((st==null?void 0:st.properties)??{})).flat().map(([st,at])=>[st,o.convertSchema(et)(at)])),allOf:void 0,required:[...new Set(nt.map(st=>(st==null?void 0:st.required)??[]).flat())]}},G=et=>(tt,nt=new Set)=>{var st;return q.isObject(tt)?tt.properties!==void 0&&!tt.additionalProperties?tt:null:nt.has(tt)?null:(nt.add(tt),q.isReference(tt)?G(et)(((st=et.schemas)==null?void 0:st[tt.$ref.split("/").pop()??""])??{},nt):null)};let q;(function(et){et.isBoolean=tt=>tt.type==="boolean",et.isInteger=tt=>tt.type==="integer",et.isNumber=tt=>tt.type==="number",et.isString=tt=>tt.type==="string",et.isArray=tt=>tt.type==="array",et.isObject=tt=>tt.type==="object",et.isReference=tt=>tt.$ref!==void 0,et.isAllOf=tt=>tt.allOf!==void 0,et.isAnyOf=tt=>tt.anyOf!==void 0,et.isOneOf=tt=>tt.oneOf!==void 0,et.isNullOnly=tt=>tt.type==="null"})(q=o.TypeChecker||(o.TypeChecker={}))})(_mt||(_mt={}));var OBt;(function(o){o.convert=tt=>tt["x-samchon-emended-v4"]===!0?tt:{...tt,components:o.convertComponents(tt.components??{}),paths:tt.paths?Object.fromEntries(Object.entries(tt.paths).filter(([nt,st])=>st!==void 0).map(([nt,st])=>[nt,p(tt)(st)])):void 0,webhooks:tt.webhooks?Object.fromEntries(Object.entries(tt.webhooks).filter(([nt,st])=>st!==void 0).map(([nt,st])=>[nt,s(tt)(st)]).filter(([nt,st])=>st!==void 0)):void 0,"x-samchon-emended-v4":!0};const s=tt=>nt=>{var at,Ot;if(!et.isReference(nt))return p(tt)(nt);const st=(Ot=(at=tt.components)==null?void 0:at.pathItems)==null?void 0:Ot[nt.$ref.split("/").pop()??""];return st?p(tt)(st):void 0},p=tt=>nt=>({...nt,...nt.get?{get:y(tt)(nt)(nt.get)}:void 0,...nt.put?{put:y(tt)(nt)(nt.put)}:void 0,...nt.post?{post:y(tt)(nt)(nt.post)}:void 0,...nt.delete?{delete:y(tt)(nt)(nt.delete)}:void 0,...nt.options?{options:y(tt)(nt)(nt.options)}:void 0,...nt.head?{head:y(tt)(nt)(nt.head)}:void 0,...nt.patch?{patch:y(tt)(nt)(nt.patch)}:void 0,...nt.trace?{trace:y(tt)(nt)(nt.trace)}:void 0}),y=tt=>nt=>st=>({...st,parameters:nt.parameters!==void 0||st.parameters!==void 0?[...nt.parameters??[],...st.parameters??[]].map(at=>{var Dt,St,ie,ae;if(!et.isReference(at))return C(tt.components??{})(at);const Ot=at.$ref.startsWith("#/components/headers/")?(St=(Dt=tt.components)==null?void 0:Dt.headers)==null?void 0:St[at.$ref.split("/").pop()??""]:(ae=(ie=tt.components)==null?void 0:ie.parameters)==null?void 0:ae[at.$ref.split("/").pop()??""];return Ot!==void 0?C(tt.components??{})({...Ot,in:"header"}):void 0}).filter((at,Ot)=>Ot!==void 0):void 0,requestBody:st.requestBody?N(tt)(st.requestBody):void 0,responses:st.responses?Object.fromEntries(Object.entries(st.responses).filter(([at,Ot])=>Ot!==void 0).map(([at,Ot])=>[at,L(tt)(Ot)]).filter(([at,Ot])=>Ot!==void 0)):void 0}),C=tt=>nt=>({...nt,schema:o.convertSchema(tt)(nt.schema),examples:nt.examples?Object.fromEntries(Object.entries(nt.examples).map(([st,at])=>{var Ot;return[st,et.isReference(at)?(Ot=tt.examples)==null?void 0:Ot[at.$ref.split("/").pop()??""]:at]}).filter(([st,at])=>at!==void 0)):void 0}),N=tt=>nt=>{var st,at;if(et.isReference(nt)){const Ot=(at=(st=tt.components)==null?void 0:st.requestBodies)==null?void 0:at[nt.$ref.split("/").pop()??""];if(Ot===void 0)return;nt=Ot}return{...nt,content:nt.content?z(tt.components??{})(nt.content):void 0}},L=tt=>nt=>{var st,at;if(et.isReference(nt)){const Ot=(at=(st=tt.components)==null?void 0:st.responses)==null?void 0:at[nt.$ref.split("/").pop()??""];if(Ot===void 0)return;nt=Ot}return{...nt,content:nt.content?z(tt.components??{})(nt.content):void 0,headers:nt.headers?Object.fromEntries(Object.entries(nt.headers).filter(([Ot,Dt])=>Dt!==void 0).map(([Ot,Dt])=>[Ot,(()=>{var ie,ae;if(et.isReference(Dt)===!1)return C(tt.components??{})({...Dt,in:"header"});const St=Dt.$ref.startsWith("#/components/headers/")?(ae=(ie=tt.components)==null?void 0:ie.headers)==null?void 0:ae[Dt.$ref.split("/").pop()??""]:void 0;return St!==void 0?C(tt.components??{})({...St,in:"header"}):void 0})()]).filter(([Ot,Dt])=>Dt!==void 0)):void 0}},z=tt=>nt=>Object.fromEntries(Object.entries(nt).filter(([st,at])=>at!==void 0).map(([st,at])=>[st,{...at,schema:at.schema?o.convertSchema(tt)(at.schema):void 0,examples:at.examples?Object.fromEntries(Object.entries(at.examples).map(([Ot,Dt])=>{var St;return[Ot,et.isReference(Dt)?(St=tt.examples)==null?void 0:St[Dt.$ref.split("/").pop()??""]:Dt]}).filter(([Ot,Dt])=>Dt!==void 0)):void 0}]));o.convertComponents=tt=>({schemas:Object.fromEntries(Object.entries(tt.schemas??{}).filter(([nt,st])=>st!==void 0).map(([nt,st])=>[nt,o.convertSchema(tt)(st)])),securitySchemes:tt.securitySchemes}),o.convertSchema=tt=>nt=>{const st=[],at={title:nt.title,description:nt.description,...Object.fromEntries(Object.entries(nt).filter(([St,ie])=>St.startsWith("x-")&&ie!==void 0)),examples:Array.isArray(nt.examples)?Object.fromEntries(nt.examples.map((St,ie)=>[`v${ie}`,St])):nt.examples},Ot={value:!1,default:void 0},Dt=St=>{var ie,ae,Ne,pn,de,cn,er;if(St.nullable===!0&&(Ot.value||(Ot.value=!0),St.default===null&&(Ot.default=null)),Array.isArray(St.enum)&&((ie=St.enum)!=null&&ie.length)&&((ae=St.enum)!=null&&ae.some(Dn=>Dn===null))&&(Ot.value||(Ot.value=!0)),et.isMixed(St)){St.const!==void 0&&Dt({...St,type:void 0,oneOf:void 0,anyOf:void 0,allOf:void 0,$ref:void 0}),St.oneOf!==void 0&&Dt({...St,type:void 0,anyOf:void 0,allOf:void 0,$ref:void 0}),St.anyOf!==void 0&&Dt({...St,type:void 0,oneOf:void 0,allOf:void 0,$ref:void 0}),St.allOf!==void 0&&Dt({...St,type:void 0,oneOf:void 0,anyOf:void 0,$ref:void 0});for(const Dn of St.type)Dt(Dn==="boolean"||Dn==="number"||Dn==="string"?{...St,enum:(Ne=St.enum)!=null&&Ne.length&&St.enum.filter(jn=>jn!==null)?St.enum.filter(jn=>typeof jn===Dn):void 0,type:Dn}:Dn==="integer"?{...St,enum:(pn=St.enum)!=null&&pn.length&&St.enum.filter(jn=>jn!==null)?St.enum.filter(jn=>jn!==null&&typeof jn=="number"&&Number.isInteger(jn)):void 0,type:Dn}:{...St,type:Dn})}else if(et.isOneOf(St))St.oneOf.forEach(Dt);else if(et.isAnyOf(St))St.anyOf.forEach(Dt);else if(et.isAllOf(St))St.allOf.length===1?Dt(St.allOf[0]):st.push(G(tt)(St));else if(et.isBoolean(St))if((de=St.enum)!=null&&de.length&&St.enum.filter(Dn=>Dn!==null).length)for(const Dn of St.enum.filter(jn=>jn!==null))st.push({const:Dn,...St,type:void 0,enum:void 0,default:void 0});else st.push({...St,default:St.default??void 0,enum:void 0});else if(et.isInteger(St)||et.isNumber(St))if((cn=St.enum)!=null&&cn.length&&St.enum.filter(Dn=>Dn!==null))for(const Dn of St.enum.filter(jn=>jn!==null))st.push({const:Dn,...St,type:void 0,enum:void 0,default:void 0,minimum:void 0,maximum:void 0,exclusiveMinimum:void 0,exclusiveMaximum:void 0,multipleOf:void 0});else st.push(mP.emend({...St,default:St.default??void 0,enum:void 0,exclusiveMinimum:typeof St.exclusiveMinimum=="boolean"?St.exclusiveMinimum===!0?St.minimum:void 0:St.exclusiveMinimum,exclusiveMaximum:typeof St.exclusiveMaximum=="boolean"?St.exclusiveMaximum===!0?St.maximum:void 0:St.exclusiveMaximum,minimum:St.exclusiveMinimum===!0?void 0:St.minimum,maximum:St.exclusiveMaximum===!0?void 0:St.maximum}));else if(et.isString(St))if((er=St.enum)!=null&&er.length&&St.enum.filter(Dn=>Dn!==null).length)for(const Dn of St.enum.filter(jn=>jn!==null))st.push({const:Dn,...St,type:void 0,enum:void 0,default:void 0});else st.push({...St,default:St.default??void 0,enum:void 0});else et.isArray(St)?Array.isArray(St.items)?st.push({...St,items:void 0,prefixItems:St.items.map(o.convertSchema(tt)),additionalItems:typeof St.additionalItems=="object"&&St.additionalItems!==null?o.convertSchema(tt)(St.additionalItems):St.additionalItems}):Array.isArray(St.prefixItems)?st.push({...St,items:void 0,prefixItems:St.prefixItems.map(o.convertSchema(tt)),additionalItems:typeof St.additionalItems=="object"&&St.additionalItems!==null?o.convertSchema(tt)(St.additionalItems):St.additionalItems}):St.items===void 0?st.push({...St,items:void 0,prefixItems:[]}):st.push({...St,items:o.convertSchema(tt)(St.items),prefixItems:void 0,additionalItems:void 0}):et.isObject(St)?st.push({...St,properties:St.properties?Object.fromEntries(Object.entries(St.properties).filter(([Dn,jn])=>jn!==void 0).map(([Dn,jn])=>[Dn,o.convertSchema(tt)(jn)])):{},additionalProperties:St.additionalProperties?typeof St.additionalProperties=="object"&&St.additionalProperties!==null?o.convertSchema(tt)(St.additionalProperties):St.additionalProperties:void 0,required:St.required??[]}):et.isReference(St)?st.push({...St,$ref:`#/components/schemas/${St.$ref.split("/").pop()}`}):et.isRecursiveReference(St)?st.push({...St,$ref:`#/components/schemas/${St.$recursiveRef.split("/").pop()}`,$recursiveRef:void 0}):st.push(St)};return Dt(nt),Ot.value===!0&&!st.some(St=>St.type==="null")&&st.push({type:"null",default:Ot.default}),{...st.length===0?{type:void 0}:st.length===1?{...st[0]}:{oneOf:st.map(St=>({...St,nullable:void 0,$defs:void 0}))},...at,nullable:void 0,$defs:void 0}};const G=tt=>nt=>{const st=nt.allOf.map(at=>q(tt)(at));return st.some(at=>at===null)?{type:void 0,allOf:void 0}:{...nt,type:"object",properties:Object.fromEntries(st.map(at=>Object.entries((at==null?void 0:at.properties)??{})).flat().map(([at,Ot])=>[at,o.convertSchema(tt)(Ot)])),allOf:void 0,required:[...new Set(st.map(at=>(at==null?void 0:at.required)??[]).flat())]}},q=tt=>(nt,st=new Set)=>{var at,Ot;return et.isObject(nt)?nt.properties!==void 0&&!nt.additionalProperties?nt:null:st.has(nt)?null:(st.add(nt),et.isReference(nt)?q(tt)(((at=tt.schemas)==null?void 0:at[nt.$ref.split("/").pop()??""])??{},st):et.isRecursiveReference(nt)?q(tt)(((Ot=tt.schemas)==null?void 0:Ot[nt.$recursiveRef.split("/").pop()??""])??{},st):null)};let et;(function(tt){tt.isConstant=nt=>nt.const!==void 0,tt.isBoolean=nt=>nt.type==="boolean",tt.isInteger=nt=>nt.type==="integer",tt.isNumber=nt=>nt.type==="number",tt.isString=nt=>nt.type==="string",tt.isArray=nt=>nt.type==="array",tt.isObject=nt=>nt.type==="object",tt.isReference=nt=>nt.$ref!==void 0,tt.isRecursiveReference=nt=>nt.$recursiveRef!==void 0,tt.isAllOf=nt=>nt.allOf!==void 0,tt.isAnyOf=nt=>nt.anyOf!==void 0,tt.isOneOf=nt=>nt.oneOf!==void 0,tt.isNullOnly=nt=>nt.type==="null",tt.isMixed=nt=>Array.isArray(nt.type)})(et||(et={}))})(OBt||(OBt={}));var NBt;(function(o){o.downgrade=q=>{var tt,nt,st;const et=o.downgradeComponents(q.components);return{swagger:"2.0",info:q.info,host:(nt=(tt=q.servers)==null?void 0:tt[0])!=null&&nt.url?q.servers[0].url.split("://").pop():"",definitions:et.downgraded,securityDefinitions:(st=q.components)!=null&&st.securitySchemes?Object.fromEntries(Object.entries(q.components.securitySchemes).filter(([at,Ot])=>Ot!==void 0).map(([at,Ot])=>z(Ot).map(Dt=>[at,Dt])).flat()):void 0,paths:q.paths?Object.fromEntries(Object.entries(q.paths).filter(([at,Ot])=>Ot!==void 0).map(([at,Ot])=>[at,s(et)(Ot)])):void 0,security:q.security,tags:q.tags}};const s=q=>et=>({...et,...et.get?{get:p(q)(et.get)}:void 0,...et.put?{put:p(q)(et.put)}:void 0,...et.post?{post:p(q)(et.post)}:void 0,...et.delete?{delete:p(q)(et.delete)}:void 0,...et.options?{options:p(q)(et.options)}:void 0,...et.head?{head:p(q)(et.head)}:void 0,...et.patch?{patch:p(q)(et.patch)}:void 0,...et.trace?{trace:p(q)(et.trace)}:void 0}),p=q=>et=>({...et,parameters:et.parameters!==void 0||et.requestBody!==void 0?[...(et.parameters??[]).map(y(q)),...et.requestBody?[C(q)(et.requestBody)]:[]]:void 0,responses:et.responses?Object.fromEntries(Object.entries(et.responses).filter(([tt,nt])=>nt!==void 0).map(([tt,nt])=>[tt,N(q)(nt)])):void 0,requestBody:void 0,servers:void 0}),y=q=>(et,tt)=>{var nt;return{...o.downgradeSchema(q)(et.schema),...et,required:(nt=et.schema)==null?void 0:nt.required,schema:void 0,name:et.name??`p${tt}`,example:void 0,examples:void 0}},C=q=>et=>{var tt;return{name:"body",in:"body",description:et.description,required:et.required,schema:o.downgradeSchema(q)(((tt=Object.values(et.content??{})[0])==null?void 0:tt.schema)??{})}},N=q=>et=>{var tt;return{description:et.description,schema:o.downgradeSchema(q)(((tt=Object.values(et.content??{})[0])==null?void 0:tt.schema)??{}),headers:et.headers?Object.fromEntries(Object.entries(et.headers).filter(([nt,st])=>st!==void 0).map(([nt,st])=>[nt,{...st,schema:o.downgradeSchema(q)(st.schema),example:void 0,examples:void 0}])):void 0}};o.downgradeComponents=q=>{const et={original:q,downgraded:{}};if(q.schemas){et.downgraded.schemas={};for(const[tt,nt]of Object.entries(q.schemas))nt!==void 0&&(et.downgraded[tt.split("/").pop()]=o.downgradeSchema(et)(nt))}return et},o.downgradeSchema=q=>et=>{const tt=G(new Set)(q.original)(et),nt=[],st={title:et.title,description:et.description,example:et.example,examples:et.examples?Object.values(et.examples):void 0,...Object.fromEntries(Object.entries(et).filter(([Ot,Dt])=>Ot.startsWith("x-")&&Dt!==void 0))},at=Ot=>{Pr.isBoolean(Ot)?nt.push({type:"boolean"}):Pr.isBoolean(Ot)||Pr.isInteger(Ot)||Pr.isNumber(Ot)||Pr.isString(Ot)?nt.push({...Ot,examples:Ot.examples?Object.values(Ot.examples):void 0}):Pr.isReference(Ot)?nt.push({$ref:`#/definitions/${Ot.$ref.split("/").pop()}`}):Pr.isArray(Ot)?nt.push({...Ot,items:o.downgradeSchema(q)(Ot.items),examples:Ot.examples?Object.values(Ot.examples):void 0}):Pr.isTuple(Ot)?nt.push({...Ot,items:(()=>{if(Ot.additionalItems===!0)return{};const Dt=[...Ot.prefixItems,...typeof Ot.additionalItems=="object"?[o.downgradeSchema(q)(Ot.additionalItems)]:[]];return Dt.length===0?{}:{"x-oneOf":Dt.map(o.downgradeSchema(q))}})(),minItems:Ot.prefixItems.length,maxItems:Ot.additionalItems?void 0:Ot.prefixItems.length,prefixItems:void 0,additionalItems:void 0,examples:Ot.examples?Object.values(Ot.examples):void 0}):Pr.isObject(Ot)?nt.push({...Ot,properties:Ot.properties?Object.fromEntries(Object.entries(Ot.properties).filter(([Dt,St])=>St!==void 0).map(([Dt,St])=>[Dt,o.downgradeSchema(q)(St)])):void 0,additionalProperties:typeof Ot.additionalProperties=="object"?o.downgradeSchema(q)(Ot.additionalProperties):Ot.additionalProperties,required:Ot.required,examples:Ot.examples?Object.values(Ot.examples):void 0}):Pr.isOneOf(Ot)&&Ot.oneOf.forEach(at)};if(at(et),tt)for(const Ot of nt)Pr.isReference(Ot)?L(new Set)(q)(Ot):Ot["x-nullable"]=!0;return tt===!0&&nt.length===0?{type:"null",...st}:{...nt.length===0?{type:void 0}:nt.length===1?{...nt[0]}:{"x-oneOf":nt},...st,...nt.length>1?{discriminator:void 0}:{}}};const L=q=>et=>tt=>{var at;const nt=tt.$ref.split("/").pop();if(nt.endsWith(".Nullable"))return;const st=(at=et.original.schemas)==null?void 0:at[nt];if(st!==void 0){{if(G(q)(et.original)(st)===!0)return;et.downgraded[`${nt}.Nullable`]===void 0&&(et.downgraded[`${nt}.Nullable`]={},et.downgraded[`${nt}.Nullable`]=o.downgradeSchema(et)(Pr.isOneOf(st)?{...st,oneOf:[...st.oneOf,{type:"null"}]}:{title:st.title,description:st.description,example:st.example,examples:st.examples?Object.values(st.examples):void 0,...Object.fromEntries(Object.entries(st).filter(([Ot,Dt])=>Ot.startsWith("x-")&&Dt!==void 0)),oneOf:[st,{type:"null"}]}))}tt.$ref+=".Nullable"}},z=q=>{if(q.type==="apiKey")return[q];if(q.type==="http")return q.scheme==="basic"?[{type:"basic",description:q.description}]:[];if(q.type==="oauth2"){const et=[];return q.flows.implicit&&et.push({type:"oauth2",flow:"implicit",authorizationUrl:q.flows.implicit.authorizationUrl,scopes:q.flows.implicit.scopes}),q.flows.password&&et.push({type:"oauth2",flow:"password",tokenUrl:q.flows.password.tokenUrl,scopes:q.flows.password.scopes}),q.flows.clientCredentials&&et.push({type:"oauth2",flow:"application",tokenUrl:q.flows.clientCredentials.tokenUrl,scopes:q.flows.clientCredentials.scopes}),q.flows.authorizationCode&&et.push({type:"oauth2",flow:"accessCode",authorizationUrl:q.flows.authorizationCode.authorizationUrl,tokenUrl:q.flows.authorizationCode.tokenUrl,scopes:q.flows.authorizationCode.scopes}),et}return[]},G=q=>et=>tt=>{var nt;if(Pr.isNull(tt))return!0;if(Pr.isReference(tt)){if(q.has(tt.$ref))return!1;q.add(tt.$ref);const st=tt.$ref.split("/").pop(),at=(nt=et.schemas)==null?void 0:nt[st];return at?G(q)(et)(at):!1}return Pr.isOneOf(tt)&&tt.oneOf.some(G(q)(et))}})(NBt||(NBt={}));var PBt;(function(o){o.convert=tt=>({openapi:"3.1.0",info:tt.info,components:L(tt),paths:tt.paths?Object.fromEntries(Object.entries(tt.paths).filter(([nt,st])=>st!==void 0).map(([nt,st])=>[nt,s(tt)(st)])):void 0,servers:tt.host?[{url:tt.host}]:void 0,security:tt.security,tags:tt.tags,"x-samchon-emended-v4":!0});const s=tt=>nt=>({...nt,...nt.get?{get:p(tt)(nt)(nt.get)}:void 0,...nt.put?{put:p(tt)(nt)(nt.put)}:void 0,...nt.post?{post:p(tt)(nt)(nt.post)}:void 0,...nt.delete?{delete:p(tt)(nt)(nt.delete)}:void 0,...nt.options?{options:p(tt)(nt)(nt.options)}:void 0,...nt.head?{head:p(tt)(nt)(nt.head)}:void 0,...nt.patch?{patch:p(tt)(nt)(nt.patch)}:void 0,...nt.trace?{trace:p(tt)(nt)(nt.trace)}:void 0}),p=tt=>nt=>st=>({...st,parameters:nt.parameters!==void 0||st.parameters!==void 0?[...nt.parameters??[],...st.parameters??[]].map(at=>{var Ot;return et.isReference(at)?(Ot=tt.parameters)==null?void 0:Ot[at.$ref.split("/").pop()??""]:at}).filter(at=>at!==void 0&&at.in!=="body"&&at.schema===void 0).map(y(tt.definitions??{})):void 0,requestBody:(()=>{var Ot;const at=(Ot=st.parameters)==null?void 0:Ot.find(Dt=>{var St;return et.isReference(Dt)&&(Dt=(St=tt.parameters)==null?void 0:St[Dt.$ref.split("/").pop()??""]),(Dt==null?void 0:Dt.schema)!==void 0});return at?C(tt.definitions??{})(at):void 0})(),responses:st.responses?Object.fromEntries(Object.entries(st.responses).filter(([at,Ot])=>Ot!==void 0).map(([at,Ot])=>[at,N(tt)(Ot)]).filter(([at,Ot])=>Ot!==void 0)):void 0}),y=tt=>nt=>({name:nt.name,in:nt.in,description:nt.description,schema:o.convertSchema(tt)(nt),required:!0}),C=tt=>nt=>({description:nt.description,content:{"application/json":{schema:o.convertSchema(tt)(nt.schema)}}}),N=tt=>nt=>{var st;if(et.isReference(nt)){const at=(st=tt.responses)==null?void 0:st[nt.$ref.split("/").pop()??""];if(at===void 0)return;nt=at}return{description:nt.description,content:nt.schema?{"application/json":{schema:o.convertSchema(tt.definitions??{})(nt.schema),example:nt.example}}:void 0,headers:nt.headers?Object.fromEntries(Object.entries(nt.headers).filter(([at,Ot])=>Ot!==void 0).map(([at,Ot])=>[at,{schema:o.convertSchema(tt.definitions??{})(Ot),in:"header"}])):void 0}},L=tt=>({schemas:Object.fromEntries(Object.entries(tt.definitions??{}).filter(([nt,st])=>st!==void 0).map(([nt,st])=>[nt,o.convertSchema(tt.definitions??{})(st)])),securitySchemes:tt.securityDefinitions?Object.fromEntries(Object.entries(tt.securityDefinitions).filter(([nt,st])=>st!==void 0).map(([nt,st])=>[nt,z(st)]).filter(([nt,st])=>st!==void 0)):void 0}),z=tt=>{if(tt.type==="apiKey")return tt;if(tt.type==="basic")return{type:"http",scheme:"basic",description:tt.description};if(tt.type==="oauth2")return tt.flow==="implicit"?{type:"oauth2",description:tt.description,flows:{implicit:{authorizationUrl:tt.authorizationUrl,scopes:tt.scopes}}}:tt.flow==="accessCode"?{type:"oauth2",description:tt.description,flows:{authorizationCode:{authorizationUrl:tt.authorizationUrl,tokenUrl:tt.tokenUrl,scopes:tt.scopes}}}:tt.flow==="password"?{type:"oauth2",description:tt.description,flows:{password:{tokenUrl:tt.tokenUrl,scopes:tt.scopes}}}:tt.flow==="application"?{type:"oauth2",description:tt.description,flows:{clientCredentials:{tokenUrl:tt.tokenUrl,scopes:tt.scopes}}}:void 0};o.convertSchema=tt=>nt=>{const st={value:!1,default:void 0},at=[],Ot={title:nt.title,description:nt.description,...Object.fromEntries(Object.entries(nt).filter(([St,ie])=>St.startsWith("x-")&&ie!==void 0)),example:nt.example,examples:nt.examples?Object.fromEntries(nt.examples.map((St,ie)=>[`v${ie}`,St])):void 0},Dt=St=>{var ie,ae,Ne;St["x-nullable"]===!0&&(st.value||(st.value=!0),St.default===null&&(st.default=null)),Array.isArray(St.enum)&&((ie=St.enum)!=null&&ie.length)&&((ae=St.enum)!=null&&ae.some(pn=>pn===null))&&(st.value||(st.value=!0)),et.isAnyOf(St)?St["x-anyOf"].forEach(Dt):et.isOneOf(St)?St["x-oneOf"].forEach(Dt):et.isAllOf(St)?St.allOf.length===1?Dt(St.allOf[0]):at.push(G(tt)(St)):et.isBoolean(St)||et.isInteger(St)||et.isNumber(St)||et.isString(St)?(Ne=St.enum)!=null&&Ne.length&&St.enum.filter(pn=>pn!==null).length?at.push(...St.enum.filter(pn=>pn!==null).map(pn=>({const:pn}))):et.isInteger(St)||et.isNumber(St)?at.push(mP.emend({...St,default:St.default??void 0,examples:St.examples?Object.fromEntries(St.examples.map((pn,de)=>[`v${de}`,pn])):void 0,exclusiveMinimum:typeof St.exclusiveMinimum=="boolean"?St.exclusiveMinimum===!0?St.minimum:void 0:St.exclusiveMinimum,exclusiveMaximum:typeof St.exclusiveMaximum=="boolean"?St.exclusiveMaximum===!0?St.maximum:void 0:St.exclusiveMaximum,minimum:St.exclusiveMinimum===!0?void 0:St.minimum,maximum:St.exclusiveMaximum===!0?void 0:St.maximum,enum:void 0})):at.push({...St,default:St.default??void 0,examples:St.examples?Object.fromEntries(St.examples.map((pn,de)=>[`v${de}`,pn])):void 0,enum:void 0}):et.isArray(St)?at.push({...St,items:o.convertSchema(tt)(St.items),examples:St.examples?Object.fromEntries(St.examples.map((pn,de)=>[`v${de}`,pn])):void 0}):et.isObject(St)?at.push({...St,properties:St.properties?Object.fromEntries(Object.entries(St.properties).filter(([pn,de])=>de!==void 0).map(([pn,de])=>[pn,o.convertSchema(tt)(de)])):{},additionalProperties:St.additionalProperties?typeof St.additionalProperties=="object"&&St.additionalProperties!==null?o.convertSchema(tt)(St.additionalProperties):St.additionalProperties:void 0,examples:St.examples?Object.fromEntries(St.examples.map((pn,de)=>[`v${de}`,pn])):void 0,required:St.required??[]}):et.isReference(St)?at.push({...St,$ref:St.$ref.replace("#/definitions/","#/components/schemas/"),examples:St.examples?Object.fromEntries(St.examples.map((pn,de)=>[`v${de}`,pn])):void 0}):at.push({...St,examples:St.examples?Object.fromEntries(St.examples.map((pn,de)=>[`v${de}`,pn])):void 0})};if(Dt(nt),st.value===!0&&!at.some(St=>St.type==="null")&&at.push({type:"null",default:st.default}),at.length===2&&at.filter(St=>Pr.isNull(St)).length===1){const St=at.filter(ie=>Pr.isNull(ie)===!1)[0];for(const ie of["title","description","deprecated","example","examples"])St[ie]!==void 0&&delete St[ie]}return{...at.length===0?{type:void 0}:at.length===1?{...at[0]}:{oneOf:at.map(St=>({...St,"x-nullable":void 0}))},...Ot,"x-nullable":void 0}};const G=tt=>nt=>{const st=nt.allOf.map(at=>q(tt)(at));return st.some(at=>at===null)?{type:void 0,allOf:void 0}:{...nt,type:"object",properties:Object.fromEntries(st.map(at=>Object.entries((at==null?void 0:at.properties)??{})).flat().map(([at,Ot])=>[at,o.convertSchema(tt)(Ot)])),allOf:void 0,required:[...new Set(st.map(at=>(at==null?void 0:at.required)??[]).flat())]}},q=tt=>(nt,st=new Set)=>et.isObject(nt)?nt.properties!==void 0&&!nt.additionalProperties?nt:null:st.has(nt)?null:(st.add(nt),et.isReference(nt)?q(tt)((tt==null?void 0:tt[nt.$ref.split("/").pop()??""])??{},st):null);let et;(function(tt){tt.isBoolean=nt=>nt.type==="boolean",tt.isInteger=nt=>nt.type==="integer",tt.isNumber=nt=>nt.type==="number",tt.isString=nt=>nt.type==="string",tt.isArray=nt=>nt.type==="array",tt.isObject=nt=>nt.type==="object",tt.isReference=nt=>nt.$ref!==void 0,tt.isAllOf=nt=>nt.allOf!==void 0,tt.isOneOf=nt=>nt["x-oneOf"]!==void 0,tt.isAnyOf=nt=>nt["x-anyOf"]!==void 0,tt.isNullOnly=nt=>nt.type==="null"})(et||(et={}))})(PBt||(PBt={}));var LBt;(function(o){function s(y){if(ABt.is(y))return OBt.convert(y);if(CBt.is(y))return _mt.convert(y);if(IBt.is(y))return PBt.convert(y);throw new TypeError("Unrecognized Swagger/OpenAPI version.")}o.convert=s;function p(y,C){if(C==="2.0")return NBt.downgrade(y);if(C==="3.0")return vmt.downgrade(y);throw new TypeError("Unrecognized Swagger/OpenAPI version.")}o.downgrade=p})(LBt||(LBt={}));class lRn extends Error{constructor(s,p,y,C,N){super(N),this.body_=MCe,this.method=s,this.path=p,this.status=y,this.headers=C;const L=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,L):this.__proto__=L}toJSON(){if(this.body_===MCe)try{this.body_=JSON.parse(this.message)}catch{this.body_=this.message}return{method:this.method,path:this.path,status:this.status,headers:this.headers,message:this.body_}}}const MCe={};var yP;(function(o){function s(N){const L=[];for(let G=0;G<N.length;G++){const q=N.charCodeAt(G);65<=q&&q<=90&&L.push(G)}for(let G=L.length-1;G>0;--G){const q=L[G],et=L[G-1];q-et===1&&L.splice(G,1)}if(L.length!==0&&L[0]===0&&L.splice(0,1),L.length===0)return N.toLowerCase();let z="";for(let G=0;G<L.length;G++){const q=G===0?0:L[G-1],et=L[G];z+=N.substring(q,et).toLowerCase(),z+="_"}return z+=N.substring(L[L.length-1]).toLowerCase(),z}o.snake=s;function p(N){return C(L=>L.length===0?L:L[0]===L[0].toUpperCase()?L[0].toLowerCase()+L.substring(1):L)(N)}o.camel=p;function y(N){return C(L=>L.length===0?L:L[0]===L[0].toLowerCase()?L[0].toUpperCase()+L.substring(1):L)(N)}o.pascal=y;const C=N=>L=>{let z="";for(let nt=0;nt<L.length&&L[nt]==="_";nt++)z+="_";z.length!==0&&(L=L.substring(z.length));const G=[];for(let nt=0;nt<L.length;nt++){if(L[nt]!=="_")continue;const at=G[G.length-1];at===void 0||at[0]+at[1]!==nt?G.push([nt,1]):++at[1]}if(G.length===0)return z+N(L);let q="";for(let nt=0;nt<G.length;nt++){const[st]=G[nt];if(nt===0)st===0?q+="_":q+=L.substring(0,st);else{const[at,Ot]=G[nt-1],Dt=L.substring(at+Ot,st);Dt.length&&(q+=o.capitalize(Dt))}}const et=G[G.length-1],tt=L.substring(et[0]+et[1]);return et.length&&(q+=o.capitalize(tt)),z+N(q)};o.capitalize=N=>N.length!==0?N[0].toUpperCase()+N.slice(1).toLowerCase():N,o.variable=N=>o.reserved(N)===!1&&/^[a-zA-Z_$][a-zA-Z_$0-9]*$/g.test(N),o.reserved=N=>hRn.has(N)})(yP||(yP={}));const hRn=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","module","new","null","package","public","private","protected","return","super","switch","this","throw","true","try","typeof","var","void","while","with"]);var Kp;(function(o){o.capitalize=s=>s.length!==0?s[0].toUpperCase()+s.slice(1).toLowerCase():s,o.pascal=s=>o.splitWithNormalization(s).filter(p=>p[0]!=="{").map(yP.pascal).join(""),o.splitWithNormalization=s=>s.split("/").map(p=>o.normalize(p.trim())).filter(p=>!!p.length),o.reJoinWithDecimalParameters=s=>(s=s.split("/").map(p=>p[0]==="{"&&p[p.length-1]==="}"?`:${p.substring(1,p.length-1)}`:p).join("/"),`${s.startsWith("/")?"":"/"}${s}`),o.normalize=s=>(s=s.split(".").join("_").split("-").join("_").trim(),fRn.has(s)?`_${s}`:(s.length!==0&&"0"<=s[0]&&s[0]<="9"&&(s=`_${s}`),s)),o.escapeDuplicate=s=>p=>s.includes(p)?o.escapeDuplicate(s)(`_${p}`):p})(Kp||(Kp={}));const fRn=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","module","new","null","package","public","private","protected","return","super","switch","this","throw","true","try","typeof","var","void","while","with"]);var MBt;(function(o){o.overwrite=C=>{const N=y(C),L=s(z=>z.emendedPath.split("/").filter(G=>!!G.length&&G[0]!==":").map(Kp.normalize).map(G=>JF.variable(G)?G:`_${G}`))(C);for(const z of L.values())z.entries.forEach((G,q)=>{G.alias=Kp.escapeDuplicate([...z.children,...z.entries.filter((nt,st)=>q!==st).map(nt=>nt.alias)].map(Kp.normalize))(Kp.normalize(G.alias));const et=[...G.route.parameters,...G.route.body?[G.route.body]:[],...G.route.headers?[G.route.headers]:[],...G.route.query?[G.route.query]:[]];et.forEach((nt,st)=>nt.key=Kp.escapeDuplicate(["connection",G.alias,...et.filter((at,Ot)=>st!==Ot).map(at=>at.key)])(nt.key));const tt=G.route.operation()["x-samchon-accessor"];tt!==void 0&&N.get(tt.join("."))===1?G.route.accessor=tt:G.route.accessor=[...z.namespace,G.alias]})};const s=C=>N=>{const L=new Map;for(const z of N){const G=C(z);let q=lC.take(L)(G.join("."))(()=>({namespace:G,children:new Set,entries:[]}));q.entries.push({route:z,alias:p(z)}),G.slice(0,-1).forEach((tt,nt,st)=>{const at=G.slice(0,st.length-nt);lC.take(L)(at.join("."))(()=>({namespace:at,children:new Set,entries:[]})).children.add(q.namespace.at(-1))});const et=lC.take(L)("")(()=>({namespace:[],children:new Set,entries:[]}));G.length&&et.children.add(G[0])}return L},p=C=>{const N=C.method==="delete"?"erase":C.method;return C.parameters.length===0?N:N+"By"+C.parameters.map(L=>Kp.capitalize(L.key)).join("And")},y=C=>{var L;const N=new Map;for(const z of C){const G=(L=z.operation()["x-samchon-accessor"])==null?void 0:L.join(".");G!==void 0&&(N.has(G)?N.set(G,N.get(G)+1):N.set(G,1))}return N}})(MBt||(MBt={}));var RBt;(function(o){o.compose=L=>{const z=y("request")(Ot=>C({document:L.document,name:Kp.pascal(`I/Api/${L.path}`)+"."+Kp.pascal(`${L.method}/Body`),schema:Ot}))(L.operation.requestBody),G=(()=>{var Dt,St,ie,ae,Ne;const Ot=y("response")(pn=>C({document:L.document,name:Kp.pascal(`I/Api/${L.path}`)+"."+Kp.pascal(`${L.method}/Response`),schema:pn}))(((Dt=L.operation.responses)==null?void 0:Dt["201"])??((St=L.operation.responses)==null?void 0:St["200"])??((ie=L.operation.responses)==null?void 0:ie.default));return Ot&&{...Ot,status:(ae=L.operation.responses)!=null&&ae["201"]?"201":(Ne=L.operation.responses)!=null&&Ne["200"]?"200":"default"}})(),q=[];z===!1&&q.push('supports only "application/json", "application/x-www-form-urlencoded", "multipart/form-data" and "text/plain" content type in the request body.'),G===!1&&q.push('supports only "application/json", "application/x-www-form-urlencoded" and "text/plain" content type in the response body.');const[et,tt]=["header","query"].map(Ot=>{const Dt=(L.operation.parameters??[]).filter(de=>de.in===Ot);if(Dt.length===0)return null;const St=Dt.map(de=>{var cn;return Pr.isObject(de.schema)||Pr.isReference(de.schema)&&Pr.isObject(((cn=L.document.components.schemas)==null?void 0:cn[de.schema.$ref.replace("#/components/schemas/","")])??{})?de.schema:null}).filter(de=>!!de),ie=Dt.filter(de=>Pr.isBoolean(de.schema)||Pr.isInteger(de.schema)||Pr.isNumber(de.schema)||Pr.isString(de.schema)||Pr.isArray(de.schema)||Pr.isTuple(de.schema)),ae=de=>({...de,name:Ot,key:Ot,title:()=>de.title,description:()=>de.description,example:()=>de.example,examples:()=>de.examples});if(St.length===1&&ie.length===0)return ae(Dt[0]);if(St.length>1)return q.push(`${Ot} typed parameters must be only one object type`),!1;const Ne=St[0]?Pr.isObject(St[0])?St[0]:(L.document.components.schemas??{})[St[0].$ref.replace("#/components/schemas/","")]:null,pn=[...St.map(de=>{var cn;return Pr.isObject(de)?de:(cn=L.document.components.schemas)==null?void 0:cn[de.$ref.replace("#/components/schemas/","")]}),{type:"object",properties:Object.fromEntries([...ie.map(de=>[de.name,{...de.schema,description:de.schema.description??de.description}]),...Ne?Object.entries(Ne.properties??{}):[]]),required:[...new Set([...ie.filter(de=>de.required).map(de=>de.name),...(Ne==null?void 0:Ne.required)??[]])]}];return Dt.length===0?null:ae({schema:C({document:L.document,name:Kp.pascal(`I/Api/${L.path}`)+"."+Kp.pascal(`${L.method}/${Ot}`),schema:{type:"object",properties:Object.fromEntries([...new Map(pn.map(de=>Object.entries(de.properties??{}).map(([cn,er])=>[cn,{...er,description:er.description??er.description}])).flat())]),required:[...new Set(pn.map(de=>de.required??[]).flat())]}})})}),nt=Kp.splitWithNormalization(L.emendedPath).filter(Ot=>Ot[0]===":").map(Ot=>Ot.substring(1)),st=(L.operation.parameters??[]).filter(Ot=>Ot.in==="path");if(nt.length!==st.length)if(st.length<nt.length&&st.every(Ot=>Ot.name!==void 0&&nt.includes(Ot.name))){for(const Ot of nt)st.find(Dt=>Dt.name===Ot)===void 0&&st.push({name:Ot,in:"path",schema:{type:"string"}});st.sort((Ot,Dt)=>nt.indexOf(Ot.name)-nt.indexOf(Dt.name)),L.operation.parameters=[...st,...(L.operation.parameters??[]).filter(Ot=>Ot.in!=="path")]}else q.push("number of path parameters are not matched with its full path.");if(q.length)return q;const at=(L.operation.parameters??[]).filter(Ot=>Ot.in==="path").map((Ot,Dt)=>({name:nt[Dt],key:(()=>{let St=Kp.normalize(nt[Dt]);if(JF.variable(St))return St;for(;;)if(St="_"+St,!nt.some(ie=>ie===St))return St})(),schema:Ot.schema,parameter:()=>Ot}));return{method:L.method,path:L.path,emendedPath:L.emendedPath,accessor:["@lazy"],parameters:(L.operation.parameters??[]).filter(Ot=>Ot.in==="path").map((Ot,Dt)=>({name:nt[Dt],key:(()=>{let St=Kp.normalize(nt[Dt]);if(JF.variable(St))return St;for(;;)if(St="_"+St,!nt.some(ie=>ie===St))return St})(),schema:Ot.schema,parameter:()=>Ot})),headers:et||null,query:tt||null,body:z||null,success:G||null,exceptions:Object.fromEntries(Object.entries(L.operation.responses??{}).filter(([Ot])=>Ot!=="200"&&Ot!=="201"&&Ot!=="default").map(([Ot,Dt])=>{var St,ie;return[Ot,{schema:((ie=(St=Dt.content)==null?void 0:St["application/json"])==null?void 0:ie.schema)??{},response:()=>Dt,media:()=>{var ae;return((ae=Dt.content)==null?void 0:ae["application/json"])??{}}}]})),comment:()=>s({operation:L.operation,parameters:at,body:z||null}),operation:()=>L.operation}};const s=L=>{var et,tt,nt;const z=[],G=st=>{z.every(at=>at!==st)&&z.push(st)};let q=L.operation.description??"";if((et=L.operation.summary)!=null&&et.length){const st=L.operation.summary.endsWith(".")?L.operation.summary:L.operation.summary+".";q.length&&!q.startsWith(L.operation.summary)&&(q=`${st}
|
|
47
|
+
`);return p.length?p:void 0}})(hC||(hC={}));var rl;(function(o){o.isNull=at=>at.type==="null",o.isUnknown=at=>at.type===void 0&&!o.isConstant(at)&&!o.isOneOf(at)&&!o.isReference(at),o.isConstant=at=>at.const!==void 0,o.isBoolean=at=>at.type==="boolean",o.isInteger=at=>at.type==="integer",o.isNumber=at=>at.type==="number",o.isString=at=>at.type==="string",o.isArray=at=>at.type==="array"&&at.items!==void 0,o.isTuple=at=>at.type==="array"&&at.prefixItems!==void 0,o.isObject=at=>at.type==="object",o.isReference=at=>at.$ref!==void 0,o.isOneOf=at=>at.oneOf!==void 0,o.isRecursiveReference=at=>{if(o.isReference(at.schema)===!1)return!1;const Ot=at.schema.$ref.split(at.prefix)[1];let Dt=0;return o.visit({prefix:at.prefix,components:at.components,schema:at.schema,closure:St=>{if(o.isReference(St)){const ie=St.$ref.split(at.prefix)[1];Ot===ie&&++Dt}}}),Dt>1},o.unreference=at=>{const Ot=[],Dt=s({prefix:at.prefix,refAccessor:at.refAccessor??`$input.${at.prefix.substring(2).split("/").filter(St=>!!St.length).join(".")}`,accessor:at.accessor??"$input.schema",components:at.components,schema:at.schema,reasons:Ot});return Dt===null?{success:!1,error:{method:at.method,message:"failed to unreference due to unable to find.",reasons:Ot}}:{success:!0,value:Dt}},o.escape=at=>{const Ot=[],Dt=p({...at,reasons:Ot,visited:new Map,accessor:at.accessor??"$input.schema",refAccessor:at.refAccessor??wmt.reference(at.prefix)})||null;return Dt===null?{success:!1,error:{method:at.method,message:`failed to escape some reference type(s) due to unable to find${Number(at.recursive)===0?" or recursive relationship":""}.`,reasons:Ot}}:{success:!0,value:Dt}},o.visit=at=>{const Ot=new Set,Dt=at.refAccessor??`$input.${wmt.reference(at.prefix)}`,St=(ie,ae)=>{var Ne;if(at.closure(ie,ae),o.isReference(ie)){const pn=ie.$ref.split(at.prefix).pop();if(Ot.has(pn)===!0)return;Ot.add(pn);const de=(Ne=at.components.schemas)==null?void 0:Ne[pn];de!==void 0&&St(de,`${Dt}[${JSON.stringify(pn)}]`)}else if(o.isOneOf(ie))ie.oneOf.forEach((pn,de)=>St(pn,`${ae}.oneOf[${de}]`));else if(o.isObject(ie)){for(const[pn,de]of Object.entries(ie.properties??{}))St(de,`${ae}.properties[${JSON.stringify(pn)}]`);typeof ie.additionalProperties=="object"&&ie.additionalProperties!==null&&St(ie.additionalProperties,`${ae}.additionalProperties`)}else o.isArray(ie)?St(ie.items,`${ae}.items`):o.isTuple(ie)&&((ie.prefixItems??[]).forEach((pn,de)=>St(pn,`${ae}.prefixItems[${de}]`)),typeof ie.additionalItems=="object"&&ie.additionalItems!==null&&St(ie.additionalItems,`${ae}.additionalItems`))};St(at.schema,at.accessor??"$input.schema")},o.covers=at=>y({prefix:at.prefix,components:at.components,x:at.x,y:at.y,visited:new Map});const s=at=>{var St;if(o.isReference(at.schema)===!1)return at.schema;const Ot=at.schema.$ref.split(at.prefix).pop(),Dt=(St=at.components.schemas)==null?void 0:St[Ot];return Dt===void 0?(at.reasons.push({schema:at.schema,accessor:at.accessor,message:`unable to find reference type ${JSON.stringify(Ot)}.`}),null):o.isReference(Dt)===!1?Dt:at.first===Ot?(at.reasons.push({schema:at.schema,accessor:at.accessor,message:`recursive reference type ${JSON.stringify(Ot)}.`}),null):s({...at,accessor:`${at.refAccessor}[${JSON.stringify(Ot)}]`,first:Ot})},p=at=>{var Ot,Dt;if(o.isReference(at.schema)){const St=at.schema.$ref.split(at.prefix)[1],ie=(Ot=at.components.schemas)==null?void 0:Ot[St];if(ie===void 0)return at.reasons.push({schema:at.schema,accessor:at.accessor,message:`unable to find reference type ${JSON.stringify(St)}.`}),null;if(at.visited.has(St)===!0){if(at.recursive===!1)return null;const ae=at.visited.get(St);if(ae>at.recursive)return at.recursive===0?(at.reasons.push({schema:at.schema,accessor:at.accessor,message:`recursive reference type ${JSON.stringify(St)}.`}),null):void 0;at.visited.set(St,ae+1);const Ne=p({...at,schema:ie,accessor:`${at.refAccessor}[${JSON.stringify(St)}]`});return Ne&&{...Ne,description:hC.cascade({prefix:at.prefix,components:at.components,schema:at.schema,escape:!0})}}else{const ae=p({...at,schema:ie,accessor:`${at.refAccessor}[${JSON.stringify(St)}]`,visited:new Map([...at.visited,[St,1]])});return ae&&{...ae,description:hC.cascade({prefix:at.prefix,components:at.components,schema:at.schema,escape:!0})}}}else if(o.isOneOf(at.schema)){const St=at.schema.oneOf.map((ae,Ne)=>p({...at,schema:ae,accessor:`${at.accessor}.oneOf[${Ne}]`}));if(St.some(ae=>ae===null))return null;const ie=St.filter(ae=>ae!==void 0);return ie.length===0?void 0:{...at.schema,oneOf:ie.map(ae=>nt({prefix:at.prefix,components:at.components,schema:ae})).flat()}}else if(o.isObject(at.schema)){const St=at.schema,ie=Object.entries(St.properties??{}).map(([Ne,pn])=>[Ne,p({...at,schema:pn,visited:at.visited,accessor:`${at.accessor}.properties[${JSON.stringify(Ne)}]`})]),ae=St.additionalProperties?typeof St.additionalProperties=="object"&&St.additionalProperties!==null?p({...at,schema:St.additionalProperties,accessor:`${at.accessor}.additionalProperties`}):St.additionalProperties:!1;return ie.some(([Ne,pn])=>pn===null)||ae===null?null:ie.some(([Ne,pn])=>{var de;return pn===void 0&&((de=St.required)==null?void 0:de.includes(Ne))===!0})===!0?void 0:{...St,properties:Object.fromEntries(ie.filter(([Ne,pn])=>pn!==void 0)),additionalProperties:ae??!1,required:((Dt=St.required)==null?void 0:Dt.filter(Ne=>ie.some(([pn,de])=>pn===Ne&&de!==void 0)))??[]}}else if(o.isTuple(at.schema)){const St=at.schema.prefixItems.map((ae,Ne)=>p({...at,schema:ae,accessor:`${at.accessor}.prefixItems[${Ne}]`})),ie=at.schema.additionalItems?typeof at.schema.additionalItems=="object"&&at.schema.additionalItems!==null?p({...at,schema:at.schema.additionalItems,accessor:`${at.accessor}.additionalItems`}):at.schema.additionalItems:!1;return St.some(ae=>ae===null)||ie===null?null:St.some(ae=>ae===void 0)?void 0:{...at.schema,prefixItems:St,additionalItems:ie??!1}}else if(o.isArray(at.schema)){const St=p({...at,schema:at.schema.items,accessor:`${at.accessor}.items`});return St===null?null:St===void 0?{...at.schema,minItems:void 0,maxItems:0,items:{}}:{...at.schema,items:St}}return at.schema},y=at=>{var ie;const Ot=(ie=at.visited.get(at.x))==null?void 0:ie.get(at.y);if(Ot!==void 0)return Ot;const Dt=lC.take(at.visited)(at.x)(()=>new Map);Dt.set(at.y,!0);const St=C(at);return Dt.set(at.y,St),St},C=at=>{if(at.x===at.y)return!0;if(o.isReference(at.x)&&o.isReference(at.y)&&at.x.$ref===at.y.$ref)return!0;const Ot=nt({prefix:at.prefix,components:at.components,schema:at.x}),Dt=nt({prefix:at.prefix,components:at.components,schema:at.y});return Ot.some(St=>o.isUnknown(St))?!0:Dt.some(St=>o.isUnknown(St))?!1:Dt.every(St=>Ot.some(ie=>N({prefix:at.prefix,components:at.components,visited:at.visited,x:ie,y:St})))},N=at=>at.x===at.y||o.isUnknown(at.x)?!0:o.isUnknown(at.y)?!1:o.isNull(at.x)?o.isNull(at.y):o.isConstant(at.x)?o.isConstant(at.y)&&at.x.const===at.y.const:o.isBoolean(at.x)?o.isBoolean(at.y)||o.isConstant(at.y)&&typeof at.y.const=="boolean":o.isInteger(at.x)?(o.isInteger(at.y)||o.isConstant(at.y))&&G(at.x,at.y):o.isNumber(at.x)?(o.isConstant(at.y)||o.isInteger(at.y)||o.isNumber(at.y))&&q(at.x,at.y):o.isString(at.x)?(o.isConstant(at.y)||o.isString(at.y))&&et(at.x,at.y):o.isArray(at.x)?(o.isArray(at.y)||o.isTuple(at.y))&&L({prefix:at.prefix,components:at.components,visited:at.visited,x:at.x,y:at.y}):o.isObject(at.x)?o.isObject(at.y)&&z({prefix:at.prefix,components:at.components,visited:at.visited,x:at.x,y:at.y}):o.isReference(at.x)?o.isReference(at.y)&&at.x.$ref===at.y.$ref:!1,L=at=>{if(o.isTuple(at.y))return at.y.prefixItems.every(Ot=>y({prefix:at.prefix,components:at.components,visited:at.visited,x:at.x.items,y:Ot}))&&(at.y.additionalItems===void 0||typeof at.y.additionalItems=="object"&&y({prefix:at.prefix,components:at.components,visited:at.visited,x:at.x.items,y:at.y.additionalItems}));if(at.x.minItems===void 0||at.y.minItems!==void 0&&at.x.minItems<=at.y.minItems){if(!(at.x.maxItems===void 0||at.y.maxItems!==void 0&&at.x.maxItems>=at.y.maxItems))return!1}else return!1;return y({prefix:at.prefix,components:at.components,visited:at.visited,x:at.x.items,y:at.y.items})},z=at=>!at.x.additionalProperties&&at.y.additionalProperties||at.x.additionalProperties&&at.y.additionalProperties&&(typeof at.x.additionalProperties=="object"&&at.y.additionalProperties===!0||typeof at.x.additionalProperties=="object"&&typeof at.y.additionalProperties=="object"&&!y({prefix:at.prefix,components:at.components,visited:at.visited,x:at.x.additionalProperties,y:at.y.additionalProperties}))?!1:Object.entries(at.y.properties??{}).every(([Ot,Dt])=>{var ie,ae,Ne;const St=(ie=at.x.properties)==null?void 0:ie[Ot];return St===void 0||((ae=at.x.required)==null?void 0:ae.includes(Ot))===!0&&(((Ne=at.y.required)==null?void 0:Ne.includes(Ot))??!1)===!1?!1:y({prefix:at.prefix,components:at.components,visited:at.visited,x:St,y:Dt})}),G=(at,Ot)=>o.isConstant(Ot)?typeof Ot.const=="number"&&Number.isInteger(Ot.const):at.type===Ot.type&&o.coverNumericRange(at,Ot),q=(at,Ot)=>o.isConstant(Ot)?typeof Ot.const=="number":(at.type===Ot.type||at.type==="number"&&Ot.type==="integer")&&o.coverNumericRange(at,Ot),et=(at,Ot)=>o.isConstant(Ot)?typeof Ot.const=="string":[at.format===void 0||Ot.format!==void 0&&tt(at.format,Ot.format),at.pattern===void 0||at.pattern===Ot.pattern,at.minLength===void 0||Ot.minLength!==void 0&&at.minLength<=Ot.minLength,at.maxLength===void 0||Ot.maxLength!==void 0&&at.maxLength>=Ot.maxLength].every(Dt=>Dt),tt=(at,Ot)=>at===Ot||at==="idn-email"&&Ot==="email"||at==="idn-hostname"&&Ot==="hostname"||["uri","iri"].includes(at)&&Ot==="url"||at==="iri"&&Ot==="uri"||at==="iri-reference"&&Ot==="uri-reference",nt=at=>{const Ot=st(at);return o.isOneOf(Ot)?Ot.oneOf.map(Dt=>nt({prefix:at.prefix,components:at.components,schema:Dt})).flat():[Ot]},st=at=>{var St;if(o.isReference(at.schema)===!1)return at.schema;const Ot=at.schema.$ref.replace(at.prefix,""),Dt=st({prefix:at.prefix,components:at.components,schema:((St=at.components.schemas)==null?void 0:St[Ot])??{}});if(Dt===void 0)throw new Error(`Reference type not found: ${JSON.stringify(at.schema.$ref)}`);return st({prefix:at.prefix,components:at.components,schema:Dt})};o.coverNumericRange=(at,Ot)=>[at.minimum===void 0||Ot.minimum!==void 0&&at.minimum<=Ot.minimum||Ot.exclusiveMinimum!==void 0&&at.minimum<Ot.exclusiveMinimum,at.maximum===void 0||Ot.maximum!==void 0&&at.maximum>=Ot.maximum||Ot.exclusiveMaximum!==void 0&&at.maximum>Ot.exclusiveMaximum,at.exclusiveMinimum===void 0||Ot.minimum!==void 0&&at.exclusiveMinimum<=Ot.minimum||Ot.exclusiveMinimum!==void 0&&at.exclusiveMinimum<=Ot.exclusiveMinimum,at.exclusiveMaximum===void 0||Ot.maximum!==void 0&&at.exclusiveMaximum>=Ot.maximum||Ot.exclusiveMaximum!==void 0&&at.exclusiveMaximum>=Ot.exclusiveMaximum,at.multipleOf===void 0||Ot.multipleOf!==void 0&&Ot.multipleOf/at.multipleOf===Math.floor(Ot.multipleOf/at.multipleOf)].every(Dt=>Dt)})(rl||(rl={}));var Pr;(function(o){o.isNull=s=>rl.isNull(s),o.isUnknown=s=>rl.isUnknown(s),o.isConstant=s=>rl.isConstant(s),o.isBoolean=s=>rl.isBoolean(s),o.isInteger=s=>rl.isInteger(s),o.isNumber=s=>rl.isNumber(s),o.isString=s=>rl.isString(s),o.isArray=s=>rl.isArray(s),o.isTuple=s=>rl.isTuple(s),o.isObject=s=>rl.isObject(s),o.isReference=s=>rl.isReference(s),o.isOneOf=s=>rl.isOneOf(s),o.isRecursiveReference=s=>rl.isRecursiveReference({prefix:"#/components/schemas/",components:s.components,schema:s.schema}),o.escape=s=>rl.escape({...s,prefix:"#/components/schemas/",method:"OpenApiTypeChecker.method"}),o.unreference=s=>rl.unreference({...s,prefix:"#/components/schemas/",method:"OpenApiTypeChecker.unreference"}),o.visit=s=>rl.visit({...s,prefix:"#/components/schemas/"}),o.covers=s=>rl.covers({prefix:"#/components/schemas/",components:s.components,x:s.x,y:s.y})})(Pr||(Pr={}));var vmt;(function(o){o.downgrade=q=>{const et=o.downgradeComponents(q.components);return{openapi:"3.0.0",servers:q.servers,info:q.info,components:et.downgraded,paths:q.paths?Object.fromEntries(Object.entries(q.paths).filter(([tt,nt])=>nt!==void 0).map(([tt,nt])=>[tt,s(et)(nt)])):void 0,security:q.security,tags:q.tags}};const s=q=>et=>({...et,...et.get?{get:p(q)(et.get)}:void 0,...et.put?{put:p(q)(et.put)}:void 0,...et.post?{post:p(q)(et.post)}:void 0,...et.delete?{delete:p(q)(et.delete)}:void 0,...et.options?{options:p(q)(et.options)}:void 0,...et.head?{head:p(q)(et.head)}:void 0,...et.patch?{patch:p(q)(et.patch)}:void 0,...et.trace?{trace:p(q)(et.trace)}:void 0}),p=q=>et=>({...et,parameters:et.parameters?et.parameters.map(y(q)):void 0,requestBody:et.requestBody?C(q)(et.requestBody):void 0,responses:et.responses?Object.fromEntries(Object.entries(et.responses).filter(([tt,nt])=>nt!==void 0).map(([tt,nt])=>[tt,N(q)(nt)])):void 0}),y=q=>et=>({...et,schema:o.downgradeSchema(q)(et.schema)}),C=q=>et=>({...et,content:et.content?L(q)(et.content):void 0}),N=q=>et=>({...et,content:et.content?L(q)(et.content):void 0,headers:et.headers?Object.fromEntries(Object.entries(et.headers).filter(([tt,nt])=>nt!==void 0).map(([tt,nt])=>[tt,{...nt,schema:o.downgradeSchema(q)(nt.schema)}])):void 0}),L=q=>et=>Object.fromEntries(Object.entries(et).filter(([tt,nt])=>nt!==void 0).map(([tt,nt])=>[tt,{...nt,schema:nt!=null&&nt.schema?o.downgradeSchema(q)(nt.schema):void 0}]));o.downgradeComponents=q=>{const et={original:q,downgraded:{securitySchemes:q.securitySchemes}};if(q.schemas){et.downgraded.schemas={};for(const[tt,nt]of Object.entries(q.schemas))nt!==void 0&&(et.downgraded.schemas[tt]=o.downgradeSchema(et)(nt))}return et},o.downgradeSchema=q=>et=>{const tt=G(new Set)(q.original)(et),nt=[],st={title:et.title,description:et.description,example:et.example,examples:et.examples,...Object.fromEntries(Object.entries(et).filter(([Dt,St])=>Dt.startsWith("x-")&&St!==void 0))},at=Dt=>{Pr.isBoolean(Dt)?nt.push({type:"boolean"}):Pr.isBoolean(Dt)||Pr.isInteger(Dt)||Pr.isNumber(Dt)||Pr.isString(Dt)||Pr.isReference(Dt)?nt.push({...Dt}):Pr.isArray(Dt)?nt.push({...Dt,items:o.downgradeSchema(q)(Dt.items)}):Pr.isTuple(Dt)?nt.push({...Dt,items:(()=>{if(Dt.additionalItems===!0)return{};const St=[...Dt.prefixItems,...typeof Dt.additionalItems=="object"?[o.downgradeSchema(q)(Dt.additionalItems)]:[]];return St.length===0?{}:{oneOf:St.map(o.downgradeSchema(q))}})(),minItems:Dt.prefixItems.length,maxItems:Dt.additionalItems?void 0:Dt.prefixItems.length,prefixItems:void 0,additionalItems:void 0}):Pr.isObject(Dt)?nt.push({...Dt,properties:Dt.properties?Object.fromEntries(Object.entries(Dt.properties).filter(([St,ie])=>ie!==void 0).map(([St,ie])=>[St,o.downgradeSchema(q)(ie)])):void 0,additionalProperties:typeof Dt.additionalProperties=="object"?o.downgradeSchema(q)(Dt.additionalProperties):Dt.additionalProperties,required:Dt.required}):Pr.isOneOf(Dt)&&Dt.oneOf.forEach(at)},Ot=Dt=>{const St=ie=>{const ae=nt.find(Ne=>Ne.type===typeof ie);ae!==void 0?(ae.enum??(ae.enum=[]),ae.enum.push(ie)):nt.push({type:typeof ie,enum:[ie]})};if(Pr.isConstant(Dt))St(Dt.const);else if(Pr.isOneOf(Dt))for(const ie of Dt.oneOf)Pr.isConstant(ie)&&St(ie.const)};if(at(et),Ot(et),tt===!0)for(const Dt of nt)Pr.isReference(Dt)?z(new Set)(q)(Dt):Dt.nullable=!0;return tt===!0&&nt.length===0?{type:"null",...st}:{...nt.length===0?{type:void 0}:nt.length===1?{...nt[0]}:{oneOf:nt},...st}};const z=q=>et=>tt=>{var Ot,Dt;var nt;const st=tt.$ref.split("/").pop();if(st.endsWith(".Nullable"))return;const at=(Ot=et.original.schemas)==null?void 0:Ot[st];if(at!==void 0){{if(G(q)(et.original)(at)===!0)return;((Dt=et.downgraded.schemas)==null?void 0:Dt[`${st}.Nullable`])===void 0&&((nt=et.downgraded).schemas??(nt.schemas={}),et.downgraded.schemas[`${st}.Nullable`]={},et.downgraded.schemas[`${st}.Nullable`]=o.downgradeSchema(et)(Pr.isOneOf(at)?{...at,oneOf:[...at.oneOf,{type:"null"}]}:{oneOf:[at,{type:"null"}],title:at.title,description:at.description,example:at.example,examples:at.examples,...Object.fromEntries(Object.entries(at).filter(([St,ie])=>St.startsWith("x-")&&ie!==void 0))}))}tt.$ref+=".Nullable"}},G=q=>et=>tt=>{var nt;if(Pr.isNull(tt))return!0;if(Pr.isReference(tt)){if(q.has(tt.$ref))return!1;q.add(tt.$ref);const st=tt.$ref.split("/").pop(),at=(nt=et.schemas)==null?void 0:nt[st];return at?G(q)(et)(at):!1}return Pr.isOneOf(tt)&&tt.oneOf.some(G(q)(et))}})(vmt||(vmt={}));var mP;(function(o){o.emend=s=>{const p=typeof s.minimum=="number"&&typeof s.exclusiveMinimum=="number"?{minimum:s.minimum>s.exclusiveMinimum?s.minimum:void 0,exclusiveMinimum:s.minimum>s.exclusiveMinimum?void 0:s.exclusiveMinimum}:{},y=typeof s.maximum=="number"&&typeof s.exclusiveMaximum=="number"?{maximum:s.maximum<s.exclusiveMaximum?s.maximum:void 0,exclusiveMaximum:s.maximum<s.exclusiveMaximum?void 0:s.exclusiveMaximum}:{};return{...s,...p,...y}}})(mP||(mP={}));var _mt;(function(o){o.convert=et=>({...et,components:o.convertComponents(et.components??{}),paths:et.paths?Object.fromEntries(Object.entries(et.paths).filter(([tt,nt])=>nt!==void 0).map(([tt,nt])=>[tt,s(et)(nt)])):void 0,openapi:"3.1.0","x-samchon-emended-v4":!0});const s=et=>tt=>({...tt,...tt.get?{get:p(et)(tt)(tt.get)}:void 0,...tt.put?{put:p(et)(tt)(tt.put)}:void 0,...tt.post?{post:p(et)(tt)(tt.post)}:void 0,...tt.delete?{delete:p(et)(tt)(tt.delete)}:void 0,...tt.options?{options:p(et)(tt)(tt.options)}:void 0,...tt.head?{head:p(et)(tt)(tt.head)}:void 0,...tt.patch?{patch:p(et)(tt)(tt.patch)}:void 0,...tt.trace?{trace:p(et)(tt)(tt.trace)}:void 0}),p=et=>tt=>nt=>({...nt,parameters:tt.parameters!==void 0||nt.parameters!==void 0?[...tt.parameters??[],...nt.parameters??[]].map(st=>{var Ot,Dt,St,ie;if(!q.isReference(st))return y(et.components??{})(st);const at=st.$ref.startsWith("#/components/headers/")?(Dt=(Ot=et.components)==null?void 0:Ot.headers)==null?void 0:Dt[st.$ref.split("/").pop()??""]:(ie=(St=et.components)==null?void 0:St.parameters)==null?void 0:ie[st.$ref.split("/").pop()??""];return at!==void 0?y(et.components??{})({...at,in:"header"}):void 0}).filter((st,at)=>at!==void 0):void 0,requestBody:nt.requestBody?C(et)(nt.requestBody):void 0,responses:nt.responses?Object.fromEntries(Object.entries(nt.responses).filter(([st,at])=>at!==void 0).map(([st,at])=>[st,N(et)(at)]).filter(([st,at])=>at!==void 0)):void 0}),y=et=>tt=>({...tt,schema:o.convertSchema(et)(tt.schema),examples:tt.examples?Object.fromEntries(Object.entries(tt.examples).map(([nt,st])=>{var at;return[nt,q.isReference(st)?(at=et.examples)==null?void 0:at[st.$ref.split("/").pop()??""]:st]}).filter(([nt,st])=>st!==void 0)):void 0}),C=et=>tt=>{var nt,st;if(q.isReference(tt)){const at=(st=(nt=et.components)==null?void 0:nt.requestBodies)==null?void 0:st[tt.$ref.split("/").pop()??""];if(at===void 0)return;tt=at}return{...tt,content:tt.content?L(et.components??{})(tt.content):void 0}},N=et=>tt=>{var nt,st;if(q.isReference(tt)){const at=(st=(nt=et.components)==null?void 0:nt.responses)==null?void 0:st[tt.$ref.split("/").pop()??""];if(at===void 0)return;tt=at}return{...tt,content:tt.content?L(et.components??{})(tt.content):void 0,headers:tt.headers?Object.fromEntries(Object.entries(tt.headers).filter(([at,Ot])=>Ot!==void 0).map(([at,Ot])=>[at,(()=>{var St,ie;if(q.isReference(Ot)===!1)return y(et.components??{})({...Ot,in:"header"});const Dt=Ot.$ref.startsWith("#/components/headers/")?(ie=(St=et.components)==null?void 0:St.headers)==null?void 0:ie[Ot.$ref.split("/").pop()??""]:void 0;return Dt!==void 0?y(et.components??{})({...Dt,in:"header"}):void 0})()]).filter(([at,Ot])=>Ot!==void 0)):void 0}},L=et=>tt=>Object.fromEntries(Object.entries(tt).filter(([nt,st])=>st!==void 0).map(([nt,st])=>[nt,{...st,schema:st.schema?o.convertSchema(et)(st.schema):void 0,examples:st.examples?Object.fromEntries(Object.entries(st.examples).map(([at,Ot])=>{var Dt;return[at,q.isReference(Ot)?(Dt=et.examples)==null?void 0:Dt[Ot.$ref.split("/").pop()??""]:Ot]}).filter(([at,Ot])=>Ot!==void 0)):void 0}]));o.convertComponents=et=>({schemas:Object.fromEntries(Object.entries(et.schemas??{}).filter(([tt,nt])=>nt!==void 0).map(([tt,nt])=>[tt,o.convertSchema(et)(nt)])),securitySchemes:et.securitySchemes}),o.convertSchema=et=>tt=>{const nt={value:!1,default:void 0},st=[],at={title:tt.title,description:tt.description,...Object.fromEntries(Object.entries(tt).filter(([Dt,St])=>Dt.startsWith("x-")&&St!==void 0)),example:tt.example,examples:Array.isArray(tt.examples)?Object.fromEntries(tt.examples.map((Dt,St)=>[`v${St}`,Dt])):tt.examples},Ot=Dt=>{var St,ie,ae;Dt.nullable===!0&&(nt.value||(nt.value=!0),Dt.default===null&&(nt.default=null)),Array.isArray(Dt.enum)&&((St=Dt.enum)!=null&&St.length)&&((ie=Dt.enum)!=null&&ie.some(Ne=>Ne===null))&&(nt.value||(nt.value=!0)),q.isAnyOf(Dt)?Dt.anyOf.forEach(Ot):q.isOneOf(Dt)?Dt.oneOf.forEach(Ot):q.isAllOf(Dt)?Dt.allOf.length===1?Ot(Dt.allOf[0]):st.push(z(et)(Dt)):q.isBoolean(Dt)||q.isInteger(Dt)||q.isNumber(Dt)||q.isString(Dt)?(ae=Dt.enum)!=null&&ae.length&&Dt.enum.filter(Ne=>Ne!==null).length?st.push(...Dt.enum.filter(Ne=>Ne!==null).map(Ne=>({const:Ne}))):q.isInteger(Dt)||q.isNumber(Dt)?st.push(mP.emend({...Dt,default:Dt.default??void 0,exclusiveMinimum:typeof Dt.exclusiveMinimum=="boolean"?Dt.exclusiveMinimum===!0?Dt.minimum:void 0:Dt.exclusiveMinimum,exclusiveMaximum:typeof Dt.exclusiveMaximum=="boolean"?Dt.exclusiveMaximum===!0?Dt.maximum:void 0:Dt.exclusiveMaximum,minimum:Dt.exclusiveMinimum===!0?void 0:Dt.minimum,maximum:Dt.exclusiveMaximum===!0?void 0:Dt.maximum,enum:void 0})):st.push({...Dt,default:Dt.default??void 0,enum:void 0}):q.isArray(Dt)?st.push({...Dt,items:o.convertSchema(et)(Dt.items)}):q.isObject(Dt)?st.push({...Dt,properties:Dt.properties?Object.fromEntries(Object.entries(Dt.properties).filter(([Ne,pn])=>pn!==void 0).map(([Ne,pn])=>[Ne,o.convertSchema(et)(pn)])):{},additionalProperties:Dt.additionalProperties?typeof Dt.additionalProperties=="object"&&Dt.additionalProperties!==null?o.convertSchema(et)(Dt.additionalProperties):Dt.additionalProperties:void 0,required:Dt.required??[]}):(q.isReference(Dt),st.push(Dt))};if(Ot(tt),nt.value===!0&&!st.some(Dt=>Dt.type==="null")&&st.push({type:"null",default:nt.default}),st.length===2&&st.filter(Dt=>Pr.isNull(Dt)).length===1){const Dt=st.filter(St=>Pr.isNull(St)===!1)[0];for(const St of["title","description","deprecated","example","examples"])Dt[St]!==void 0&&delete Dt[St]}return{...st.length===0?{type:void 0}:st.length===1?{...st[0]}:{oneOf:st.map(Dt=>({...Dt,nullable:void 0}))},...at,nullable:void 0}};const z=et=>tt=>{const nt=tt.allOf.map(st=>G(et)(st));return nt.some(st=>st===null)?{type:void 0,allOf:void 0}:{...tt,type:"object",properties:Object.fromEntries(nt.map(st=>Object.entries((st==null?void 0:st.properties)??{})).flat().map(([st,at])=>[st,o.convertSchema(et)(at)])),allOf:void 0,required:[...new Set(nt.map(st=>(st==null?void 0:st.required)??[]).flat())]}},G=et=>(tt,nt=new Set)=>{var st;return q.isObject(tt)?tt.properties!==void 0&&!tt.additionalProperties?tt:null:nt.has(tt)?null:(nt.add(tt),q.isReference(tt)?G(et)(((st=et.schemas)==null?void 0:st[tt.$ref.split("/").pop()??""])??{},nt):null)};let q;(function(et){et.isBoolean=tt=>tt.type==="boolean",et.isInteger=tt=>tt.type==="integer",et.isNumber=tt=>tt.type==="number",et.isString=tt=>tt.type==="string",et.isArray=tt=>tt.type==="array",et.isObject=tt=>tt.type==="object",et.isReference=tt=>tt.$ref!==void 0,et.isAllOf=tt=>tt.allOf!==void 0,et.isAnyOf=tt=>tt.anyOf!==void 0,et.isOneOf=tt=>tt.oneOf!==void 0,et.isNullOnly=tt=>tt.type==="null"})(q=o.TypeChecker||(o.TypeChecker={}))})(_mt||(_mt={}));var OBt;(function(o){o.convert=tt=>tt["x-samchon-emended-v4"]===!0?tt:{...tt,components:o.convertComponents(tt.components??{}),paths:tt.paths?Object.fromEntries(Object.entries(tt.paths).filter(([nt,st])=>st!==void 0).map(([nt,st])=>[nt,p(tt)(st)])):void 0,webhooks:tt.webhooks?Object.fromEntries(Object.entries(tt.webhooks).filter(([nt,st])=>st!==void 0).map(([nt,st])=>[nt,s(tt)(st)]).filter(([nt,st])=>st!==void 0)):void 0,"x-samchon-emended-v4":!0};const s=tt=>nt=>{var at,Ot;if(!et.isReference(nt))return p(tt)(nt);const st=(Ot=(at=tt.components)==null?void 0:at.pathItems)==null?void 0:Ot[nt.$ref.split("/").pop()??""];return st?p(tt)(st):void 0},p=tt=>nt=>({...nt,...nt.get?{get:y(tt)(nt)(nt.get)}:void 0,...nt.put?{put:y(tt)(nt)(nt.put)}:void 0,...nt.post?{post:y(tt)(nt)(nt.post)}:void 0,...nt.delete?{delete:y(tt)(nt)(nt.delete)}:void 0,...nt.options?{options:y(tt)(nt)(nt.options)}:void 0,...nt.head?{head:y(tt)(nt)(nt.head)}:void 0,...nt.patch?{patch:y(tt)(nt)(nt.patch)}:void 0,...nt.trace?{trace:y(tt)(nt)(nt.trace)}:void 0}),y=tt=>nt=>st=>({...st,parameters:nt.parameters!==void 0||st.parameters!==void 0?[...nt.parameters??[],...st.parameters??[]].map(at=>{var Dt,St,ie,ae;if(!et.isReference(at))return C(tt.components??{})(at);const Ot=at.$ref.startsWith("#/components/headers/")?(St=(Dt=tt.components)==null?void 0:Dt.headers)==null?void 0:St[at.$ref.split("/").pop()??""]:(ae=(ie=tt.components)==null?void 0:ie.parameters)==null?void 0:ae[at.$ref.split("/").pop()??""];return Ot!==void 0?C(tt.components??{})({...Ot,in:"header"}):void 0}).filter((at,Ot)=>Ot!==void 0):void 0,requestBody:st.requestBody?N(tt)(st.requestBody):void 0,responses:st.responses?Object.fromEntries(Object.entries(st.responses).filter(([at,Ot])=>Ot!==void 0).map(([at,Ot])=>[at,L(tt)(Ot)]).filter(([at,Ot])=>Ot!==void 0)):void 0}),C=tt=>nt=>({...nt,schema:o.convertSchema(tt)(nt.schema),examples:nt.examples?Object.fromEntries(Object.entries(nt.examples).map(([st,at])=>{var Ot;return[st,et.isReference(at)?(Ot=tt.examples)==null?void 0:Ot[at.$ref.split("/").pop()??""]:at]}).filter(([st,at])=>at!==void 0)):void 0}),N=tt=>nt=>{var st,at;if(et.isReference(nt)){const Ot=(at=(st=tt.components)==null?void 0:st.requestBodies)==null?void 0:at[nt.$ref.split("/").pop()??""];if(Ot===void 0)return;nt=Ot}return{...nt,content:nt.content?z(tt.components??{})(nt.content):void 0}},L=tt=>nt=>{var st,at;if(et.isReference(nt)){const Ot=(at=(st=tt.components)==null?void 0:st.responses)==null?void 0:at[nt.$ref.split("/").pop()??""];if(Ot===void 0)return;nt=Ot}return{...nt,content:nt.content?z(tt.components??{})(nt.content):void 0,headers:nt.headers?Object.fromEntries(Object.entries(nt.headers).filter(([Ot,Dt])=>Dt!==void 0).map(([Ot,Dt])=>[Ot,(()=>{var ie,ae;if(et.isReference(Dt)===!1)return C(tt.components??{})({...Dt,in:"header"});const St=Dt.$ref.startsWith("#/components/headers/")?(ae=(ie=tt.components)==null?void 0:ie.headers)==null?void 0:ae[Dt.$ref.split("/").pop()??""]:void 0;return St!==void 0?C(tt.components??{})({...St,in:"header"}):void 0})()]).filter(([Ot,Dt])=>Dt!==void 0)):void 0}},z=tt=>nt=>Object.fromEntries(Object.entries(nt).filter(([st,at])=>at!==void 0).map(([st,at])=>[st,{...at,schema:at.schema?o.convertSchema(tt)(at.schema):void 0,examples:at.examples?Object.fromEntries(Object.entries(at.examples).map(([Ot,Dt])=>{var St;return[Ot,et.isReference(Dt)?(St=tt.examples)==null?void 0:St[Dt.$ref.split("/").pop()??""]:Dt]}).filter(([Ot,Dt])=>Dt!==void 0)):void 0}]));o.convertComponents=tt=>({schemas:Object.fromEntries(Object.entries(tt.schemas??{}).filter(([nt,st])=>st!==void 0).map(([nt,st])=>[nt,o.convertSchema(tt)(st)])),securitySchemes:tt.securitySchemes}),o.convertSchema=tt=>nt=>{const st=[],at={title:nt.title,description:nt.description,...Object.fromEntries(Object.entries(nt).filter(([St,ie])=>St.startsWith("x-")&&ie!==void 0)),examples:Array.isArray(nt.examples)?Object.fromEntries(nt.examples.map((St,ie)=>[`v${ie}`,St])):nt.examples},Ot={value:!1,default:void 0},Dt=St=>{var ie,ae,Ne,pn,de,cn,er;if(St.nullable===!0&&(Ot.value||(Ot.value=!0),St.default===null&&(Ot.default=null)),Array.isArray(St.enum)&&((ie=St.enum)!=null&&ie.length)&&((ae=St.enum)!=null&&ae.some(Dn=>Dn===null))&&(Ot.value||(Ot.value=!0)),et.isMixed(St)){St.const!==void 0&&Dt({...St,type:void 0,oneOf:void 0,anyOf:void 0,allOf:void 0,$ref:void 0}),St.oneOf!==void 0&&Dt({...St,type:void 0,anyOf:void 0,allOf:void 0,$ref:void 0}),St.anyOf!==void 0&&Dt({...St,type:void 0,oneOf:void 0,allOf:void 0,$ref:void 0}),St.allOf!==void 0&&Dt({...St,type:void 0,oneOf:void 0,anyOf:void 0,$ref:void 0});for(const Dn of St.type)Dt(Dn==="boolean"||Dn==="number"||Dn==="string"?{...St,enum:(Ne=St.enum)!=null&&Ne.length&&St.enum.filter(jn=>jn!==null)?St.enum.filter(jn=>typeof jn===Dn):void 0,type:Dn}:Dn==="integer"?{...St,enum:(pn=St.enum)!=null&&pn.length&&St.enum.filter(jn=>jn!==null)?St.enum.filter(jn=>jn!==null&&typeof jn=="number"&&Number.isInteger(jn)):void 0,type:Dn}:{...St,type:Dn})}else if(et.isOneOf(St))St.oneOf.forEach(Dt);else if(et.isAnyOf(St))St.anyOf.forEach(Dt);else if(et.isAllOf(St))St.allOf.length===1?Dt(St.allOf[0]):st.push(G(tt)(St));else if(et.isBoolean(St))if((de=St.enum)!=null&&de.length&&St.enum.filter(Dn=>Dn!==null).length)for(const Dn of St.enum.filter(jn=>jn!==null))st.push({const:Dn,...St,type:void 0,enum:void 0,default:void 0});else st.push({...St,default:St.default??void 0,enum:void 0});else if(et.isInteger(St)||et.isNumber(St))if((cn=St.enum)!=null&&cn.length&&St.enum.filter(Dn=>Dn!==null))for(const Dn of St.enum.filter(jn=>jn!==null))st.push({const:Dn,...St,type:void 0,enum:void 0,default:void 0,minimum:void 0,maximum:void 0,exclusiveMinimum:void 0,exclusiveMaximum:void 0,multipleOf:void 0});else st.push(mP.emend({...St,default:St.default??void 0,enum:void 0,exclusiveMinimum:typeof St.exclusiveMinimum=="boolean"?St.exclusiveMinimum===!0?St.minimum:void 0:St.exclusiveMinimum,exclusiveMaximum:typeof St.exclusiveMaximum=="boolean"?St.exclusiveMaximum===!0?St.maximum:void 0:St.exclusiveMaximum,minimum:St.exclusiveMinimum===!0?void 0:St.minimum,maximum:St.exclusiveMaximum===!0?void 0:St.maximum}));else if(et.isString(St))if((er=St.enum)!=null&&er.length&&St.enum.filter(Dn=>Dn!==null).length)for(const Dn of St.enum.filter(jn=>jn!==null))st.push({const:Dn,...St,type:void 0,enum:void 0,default:void 0});else st.push({...St,default:St.default??void 0,enum:void 0});else et.isArray(St)?Array.isArray(St.items)?st.push({...St,items:void 0,prefixItems:St.items.map(o.convertSchema(tt)),additionalItems:typeof St.additionalItems=="object"&&St.additionalItems!==null?o.convertSchema(tt)(St.additionalItems):St.additionalItems}):Array.isArray(St.prefixItems)?st.push({...St,items:void 0,prefixItems:St.prefixItems.map(o.convertSchema(tt)),additionalItems:typeof St.additionalItems=="object"&&St.additionalItems!==null?o.convertSchema(tt)(St.additionalItems):St.additionalItems}):St.items===void 0?st.push({...St,items:void 0,prefixItems:[]}):st.push({...St,items:o.convertSchema(tt)(St.items),prefixItems:void 0,additionalItems:void 0}):et.isObject(St)?st.push({...St,properties:St.properties?Object.fromEntries(Object.entries(St.properties).filter(([Dn,jn])=>jn!==void 0).map(([Dn,jn])=>[Dn,o.convertSchema(tt)(jn)])):{},additionalProperties:St.additionalProperties?typeof St.additionalProperties=="object"&&St.additionalProperties!==null?o.convertSchema(tt)(St.additionalProperties):St.additionalProperties:void 0,required:St.required??[]}):et.isReference(St)?st.push({...St,$ref:`#/components/schemas/${St.$ref.split("/").pop()}`}):et.isRecursiveReference(St)?st.push({...St,$ref:`#/components/schemas/${St.$recursiveRef.split("/").pop()}`,$recursiveRef:void 0}):st.push(St)};return Dt(nt),Ot.value===!0&&!st.some(St=>St.type==="null")&&st.push({type:"null",default:Ot.default}),{...st.length===0?{type:void 0}:st.length===1?{...st[0]}:{oneOf:st.map(St=>({...St,nullable:void 0,$defs:void 0}))},...at,nullable:void 0,$defs:void 0}};const G=tt=>nt=>{const st=nt.allOf.map(at=>q(tt)(at));return st.some(at=>at===null)?{type:void 0,allOf:void 0}:{...nt,type:"object",properties:Object.fromEntries(st.map(at=>Object.entries((at==null?void 0:at.properties)??{})).flat().map(([at,Ot])=>[at,o.convertSchema(tt)(Ot)])),allOf:void 0,required:[...new Set(st.map(at=>(at==null?void 0:at.required)??[]).flat())]}},q=tt=>(nt,st=new Set)=>{var at,Ot;return et.isObject(nt)?nt.properties!==void 0&&!nt.additionalProperties?nt:null:st.has(nt)?null:(st.add(nt),et.isReference(nt)?q(tt)(((at=tt.schemas)==null?void 0:at[nt.$ref.split("/").pop()??""])??{},st):et.isRecursiveReference(nt)?q(tt)(((Ot=tt.schemas)==null?void 0:Ot[nt.$recursiveRef.split("/").pop()??""])??{},st):null)};let et;(function(tt){tt.isConstant=nt=>nt.const!==void 0,tt.isBoolean=nt=>nt.type==="boolean",tt.isInteger=nt=>nt.type==="integer",tt.isNumber=nt=>nt.type==="number",tt.isString=nt=>nt.type==="string",tt.isArray=nt=>nt.type==="array",tt.isObject=nt=>nt.type==="object",tt.isReference=nt=>nt.$ref!==void 0,tt.isRecursiveReference=nt=>nt.$recursiveRef!==void 0,tt.isAllOf=nt=>nt.allOf!==void 0,tt.isAnyOf=nt=>nt.anyOf!==void 0,tt.isOneOf=nt=>nt.oneOf!==void 0,tt.isNullOnly=nt=>nt.type==="null",tt.isMixed=nt=>Array.isArray(nt.type)})(et||(et={}))})(OBt||(OBt={}));var NBt;(function(o){o.downgrade=q=>{var tt,nt,st;const et=o.downgradeComponents(q.components);return{swagger:"2.0",info:q.info,host:(nt=(tt=q.servers)==null?void 0:tt[0])!=null&&nt.url?q.servers[0].url.split("://").pop():"",definitions:et.downgraded,securityDefinitions:(st=q.components)!=null&&st.securitySchemes?Object.fromEntries(Object.entries(q.components.securitySchemes).filter(([at,Ot])=>Ot!==void 0).map(([at,Ot])=>z(Ot).map(Dt=>[at,Dt])).flat()):void 0,paths:q.paths?Object.fromEntries(Object.entries(q.paths).filter(([at,Ot])=>Ot!==void 0).map(([at,Ot])=>[at,s(et)(Ot)])):void 0,security:q.security,tags:q.tags}};const s=q=>et=>({...et,...et.get?{get:p(q)(et.get)}:void 0,...et.put?{put:p(q)(et.put)}:void 0,...et.post?{post:p(q)(et.post)}:void 0,...et.delete?{delete:p(q)(et.delete)}:void 0,...et.options?{options:p(q)(et.options)}:void 0,...et.head?{head:p(q)(et.head)}:void 0,...et.patch?{patch:p(q)(et.patch)}:void 0,...et.trace?{trace:p(q)(et.trace)}:void 0}),p=q=>et=>({...et,parameters:et.parameters!==void 0||et.requestBody!==void 0?[...(et.parameters??[]).map(y(q)),...et.requestBody?[C(q)(et.requestBody)]:[]]:void 0,responses:et.responses?Object.fromEntries(Object.entries(et.responses).filter(([tt,nt])=>nt!==void 0).map(([tt,nt])=>[tt,N(q)(nt)])):void 0,requestBody:void 0,servers:void 0}),y=q=>(et,tt)=>{var nt;return{...o.downgradeSchema(q)(et.schema),...et,required:(nt=et.schema)==null?void 0:nt.required,schema:void 0,name:et.name??`p${tt}`,example:void 0,examples:void 0}},C=q=>et=>{var tt;return{name:"body",in:"body",description:et.description,required:et.required,schema:o.downgradeSchema(q)(((tt=Object.values(et.content??{})[0])==null?void 0:tt.schema)??{})}},N=q=>et=>{var tt;return{description:et.description,schema:o.downgradeSchema(q)(((tt=Object.values(et.content??{})[0])==null?void 0:tt.schema)??{}),headers:et.headers?Object.fromEntries(Object.entries(et.headers).filter(([nt,st])=>st!==void 0).map(([nt,st])=>[nt,{...st,schema:o.downgradeSchema(q)(st.schema),example:void 0,examples:void 0}])):void 0}};o.downgradeComponents=q=>{const et={original:q,downgraded:{}};if(q.schemas){et.downgraded.schemas={};for(const[tt,nt]of Object.entries(q.schemas))nt!==void 0&&(et.downgraded[tt.split("/").pop()]=o.downgradeSchema(et)(nt))}return et},o.downgradeSchema=q=>et=>{const tt=G(new Set)(q.original)(et),nt=[],st={title:et.title,description:et.description,example:et.example,examples:et.examples?Object.values(et.examples):void 0,...Object.fromEntries(Object.entries(et).filter(([Ot,Dt])=>Ot.startsWith("x-")&&Dt!==void 0))},at=Ot=>{Pr.isBoolean(Ot)?nt.push({type:"boolean"}):Pr.isBoolean(Ot)||Pr.isInteger(Ot)||Pr.isNumber(Ot)||Pr.isString(Ot)?nt.push({...Ot,examples:Ot.examples?Object.values(Ot.examples):void 0}):Pr.isReference(Ot)?nt.push({$ref:`#/definitions/${Ot.$ref.split("/").pop()}`}):Pr.isArray(Ot)?nt.push({...Ot,items:o.downgradeSchema(q)(Ot.items),examples:Ot.examples?Object.values(Ot.examples):void 0}):Pr.isTuple(Ot)?nt.push({...Ot,items:(()=>{if(Ot.additionalItems===!0)return{};const Dt=[...Ot.prefixItems,...typeof Ot.additionalItems=="object"?[o.downgradeSchema(q)(Ot.additionalItems)]:[]];return Dt.length===0?{}:{"x-oneOf":Dt.map(o.downgradeSchema(q))}})(),minItems:Ot.prefixItems.length,maxItems:Ot.additionalItems?void 0:Ot.prefixItems.length,prefixItems:void 0,additionalItems:void 0,examples:Ot.examples?Object.values(Ot.examples):void 0}):Pr.isObject(Ot)?nt.push({...Ot,properties:Ot.properties?Object.fromEntries(Object.entries(Ot.properties).filter(([Dt,St])=>St!==void 0).map(([Dt,St])=>[Dt,o.downgradeSchema(q)(St)])):void 0,additionalProperties:typeof Ot.additionalProperties=="object"?o.downgradeSchema(q)(Ot.additionalProperties):Ot.additionalProperties,required:Ot.required,examples:Ot.examples?Object.values(Ot.examples):void 0}):Pr.isOneOf(Ot)&&Ot.oneOf.forEach(at)};if(at(et),tt)for(const Ot of nt)Pr.isReference(Ot)?L(new Set)(q)(Ot):Ot["x-nullable"]=!0;return tt===!0&&nt.length===0?{type:"null",...st}:{...nt.length===0?{type:void 0}:nt.length===1?{...nt[0]}:{"x-oneOf":nt},...st,...nt.length>1?{discriminator:void 0}:{}}};const L=q=>et=>tt=>{var at;const nt=tt.$ref.split("/").pop();if(nt.endsWith(".Nullable"))return;const st=(at=et.original.schemas)==null?void 0:at[nt];if(st!==void 0){{if(G(q)(et.original)(st)===!0)return;et.downgraded[`${nt}.Nullable`]===void 0&&(et.downgraded[`${nt}.Nullable`]={},et.downgraded[`${nt}.Nullable`]=o.downgradeSchema(et)(Pr.isOneOf(st)?{...st,oneOf:[...st.oneOf,{type:"null"}]}:{title:st.title,description:st.description,example:st.example,examples:st.examples?Object.values(st.examples):void 0,...Object.fromEntries(Object.entries(st).filter(([Ot,Dt])=>Ot.startsWith("x-")&&Dt!==void 0)),oneOf:[st,{type:"null"}]}))}tt.$ref+=".Nullable"}},z=q=>{if(q.type==="apiKey")return[q];if(q.type==="http")return q.scheme==="basic"?[{type:"basic",description:q.description}]:[];if(q.type==="oauth2"){const et=[];return q.flows.implicit&&et.push({type:"oauth2",flow:"implicit",authorizationUrl:q.flows.implicit.authorizationUrl,scopes:q.flows.implicit.scopes}),q.flows.password&&et.push({type:"oauth2",flow:"password",tokenUrl:q.flows.password.tokenUrl,scopes:q.flows.password.scopes}),q.flows.clientCredentials&&et.push({type:"oauth2",flow:"application",tokenUrl:q.flows.clientCredentials.tokenUrl,scopes:q.flows.clientCredentials.scopes}),q.flows.authorizationCode&&et.push({type:"oauth2",flow:"accessCode",authorizationUrl:q.flows.authorizationCode.authorizationUrl,tokenUrl:q.flows.authorizationCode.tokenUrl,scopes:q.flows.authorizationCode.scopes}),et}return[]},G=q=>et=>tt=>{var nt;if(Pr.isNull(tt))return!0;if(Pr.isReference(tt)){if(q.has(tt.$ref))return!1;q.add(tt.$ref);const st=tt.$ref.split("/").pop(),at=(nt=et.schemas)==null?void 0:nt[st];return at?G(q)(et)(at):!1}return Pr.isOneOf(tt)&&tt.oneOf.some(G(q)(et))}})(NBt||(NBt={}));var PBt;(function(o){o.convert=tt=>({openapi:"3.1.0",info:tt.info,components:L(tt),paths:tt.paths?Object.fromEntries(Object.entries(tt.paths).filter(([nt,st])=>st!==void 0).map(([nt,st])=>[nt,s(tt)(st)])):void 0,servers:tt.host?[{url:tt.host}]:void 0,security:tt.security,tags:tt.tags,"x-samchon-emended-v4":!0});const s=tt=>nt=>({...nt,...nt.get?{get:p(tt)(nt)(nt.get)}:void 0,...nt.put?{put:p(tt)(nt)(nt.put)}:void 0,...nt.post?{post:p(tt)(nt)(nt.post)}:void 0,...nt.delete?{delete:p(tt)(nt)(nt.delete)}:void 0,...nt.options?{options:p(tt)(nt)(nt.options)}:void 0,...nt.head?{head:p(tt)(nt)(nt.head)}:void 0,...nt.patch?{patch:p(tt)(nt)(nt.patch)}:void 0,...nt.trace?{trace:p(tt)(nt)(nt.trace)}:void 0}),p=tt=>nt=>st=>({...st,parameters:nt.parameters!==void 0||st.parameters!==void 0?[...nt.parameters??[],...st.parameters??[]].map(at=>{var Ot;return et.isReference(at)?(Ot=tt.parameters)==null?void 0:Ot[at.$ref.split("/").pop()??""]:at}).filter(at=>at!==void 0&&at.in!=="body"&&at.schema===void 0).map(y(tt.definitions??{})):void 0,requestBody:(()=>{var Ot;const at=(Ot=st.parameters)==null?void 0:Ot.find(Dt=>{var St;return et.isReference(Dt)&&(Dt=(St=tt.parameters)==null?void 0:St[Dt.$ref.split("/").pop()??""]),(Dt==null?void 0:Dt.schema)!==void 0});return at?C(tt.definitions??{})(at):void 0})(),responses:st.responses?Object.fromEntries(Object.entries(st.responses).filter(([at,Ot])=>Ot!==void 0).map(([at,Ot])=>[at,N(tt)(Ot)]).filter(([at,Ot])=>Ot!==void 0)):void 0}),y=tt=>nt=>({name:nt.name,in:nt.in,description:nt.description,schema:o.convertSchema(tt)(nt),required:!0}),C=tt=>nt=>({description:nt.description,content:{"application/json":{schema:o.convertSchema(tt)(nt.schema)}}}),N=tt=>nt=>{var st;if(et.isReference(nt)){const at=(st=tt.responses)==null?void 0:st[nt.$ref.split("/").pop()??""];if(at===void 0)return;nt=at}return{description:nt.description,content:nt.schema?{"application/json":{schema:o.convertSchema(tt.definitions??{})(nt.schema),example:nt.example}}:void 0,headers:nt.headers?Object.fromEntries(Object.entries(nt.headers).filter(([at,Ot])=>Ot!==void 0).map(([at,Ot])=>[at,{schema:o.convertSchema(tt.definitions??{})(Ot),in:"header"}])):void 0}},L=tt=>({schemas:Object.fromEntries(Object.entries(tt.definitions??{}).filter(([nt,st])=>st!==void 0).map(([nt,st])=>[nt,o.convertSchema(tt.definitions??{})(st)])),securitySchemes:tt.securityDefinitions?Object.fromEntries(Object.entries(tt.securityDefinitions).filter(([nt,st])=>st!==void 0).map(([nt,st])=>[nt,z(st)]).filter(([nt,st])=>st!==void 0)):void 0}),z=tt=>{if(tt.type==="apiKey")return tt;if(tt.type==="basic")return{type:"http",scheme:"basic",description:tt.description};if(tt.type==="oauth2")return tt.flow==="implicit"?{type:"oauth2",description:tt.description,flows:{implicit:{authorizationUrl:tt.authorizationUrl,scopes:tt.scopes}}}:tt.flow==="accessCode"?{type:"oauth2",description:tt.description,flows:{authorizationCode:{authorizationUrl:tt.authorizationUrl,tokenUrl:tt.tokenUrl,scopes:tt.scopes}}}:tt.flow==="password"?{type:"oauth2",description:tt.description,flows:{password:{tokenUrl:tt.tokenUrl,scopes:tt.scopes}}}:tt.flow==="application"?{type:"oauth2",description:tt.description,flows:{clientCredentials:{tokenUrl:tt.tokenUrl,scopes:tt.scopes}}}:void 0};o.convertSchema=tt=>nt=>{const st={value:!1,default:void 0},at=[],Ot={title:nt.title,description:nt.description,...Object.fromEntries(Object.entries(nt).filter(([St,ie])=>St.startsWith("x-")&&ie!==void 0)),example:nt.example,examples:nt.examples?Object.fromEntries(nt.examples.map((St,ie)=>[`v${ie}`,St])):void 0},Dt=St=>{var ie,ae,Ne;St["x-nullable"]===!0&&(st.value||(st.value=!0),St.default===null&&(st.default=null)),Array.isArray(St.enum)&&((ie=St.enum)!=null&&ie.length)&&((ae=St.enum)!=null&&ae.some(pn=>pn===null))&&(st.value||(st.value=!0)),et.isAnyOf(St)?St["x-anyOf"].forEach(Dt):et.isOneOf(St)?St["x-oneOf"].forEach(Dt):et.isAllOf(St)?St.allOf.length===1?Dt(St.allOf[0]):at.push(G(tt)(St)):et.isBoolean(St)||et.isInteger(St)||et.isNumber(St)||et.isString(St)?(Ne=St.enum)!=null&&Ne.length&&St.enum.filter(pn=>pn!==null).length?at.push(...St.enum.filter(pn=>pn!==null).map(pn=>({const:pn}))):et.isInteger(St)||et.isNumber(St)?at.push(mP.emend({...St,default:St.default??void 0,examples:St.examples?Object.fromEntries(St.examples.map((pn,de)=>[`v${de}`,pn])):void 0,exclusiveMinimum:typeof St.exclusiveMinimum=="boolean"?St.exclusiveMinimum===!0?St.minimum:void 0:St.exclusiveMinimum,exclusiveMaximum:typeof St.exclusiveMaximum=="boolean"?St.exclusiveMaximum===!0?St.maximum:void 0:St.exclusiveMaximum,minimum:St.exclusiveMinimum===!0?void 0:St.minimum,maximum:St.exclusiveMaximum===!0?void 0:St.maximum,enum:void 0})):at.push({...St,default:St.default??void 0,examples:St.examples?Object.fromEntries(St.examples.map((pn,de)=>[`v${de}`,pn])):void 0,enum:void 0}):et.isArray(St)?at.push({...St,items:o.convertSchema(tt)(St.items),examples:St.examples?Object.fromEntries(St.examples.map((pn,de)=>[`v${de}`,pn])):void 0}):et.isObject(St)?at.push({...St,properties:St.properties?Object.fromEntries(Object.entries(St.properties).filter(([pn,de])=>de!==void 0).map(([pn,de])=>[pn,o.convertSchema(tt)(de)])):{},additionalProperties:St.additionalProperties?typeof St.additionalProperties=="object"&&St.additionalProperties!==null?o.convertSchema(tt)(St.additionalProperties):St.additionalProperties:void 0,examples:St.examples?Object.fromEntries(St.examples.map((pn,de)=>[`v${de}`,pn])):void 0,required:St.required??[]}):et.isReference(St)?at.push({...St,$ref:St.$ref.replace("#/definitions/","#/components/schemas/"),examples:St.examples?Object.fromEntries(St.examples.map((pn,de)=>[`v${de}`,pn])):void 0}):at.push({...St,examples:St.examples?Object.fromEntries(St.examples.map((pn,de)=>[`v${de}`,pn])):void 0})};if(Dt(nt),st.value===!0&&!at.some(St=>St.type==="null")&&at.push({type:"null",default:st.default}),at.length===2&&at.filter(St=>Pr.isNull(St)).length===1){const St=at.filter(ie=>Pr.isNull(ie)===!1)[0];for(const ie of["title","description","deprecated","example","examples"])St[ie]!==void 0&&delete St[ie]}return{...at.length===0?{type:void 0}:at.length===1?{...at[0]}:{oneOf:at.map(St=>({...St,"x-nullable":void 0}))},...Ot,"x-nullable":void 0}};const G=tt=>nt=>{const st=nt.allOf.map(at=>q(tt)(at));return st.some(at=>at===null)?{type:void 0,allOf:void 0}:{...nt,type:"object",properties:Object.fromEntries(st.map(at=>Object.entries((at==null?void 0:at.properties)??{})).flat().map(([at,Ot])=>[at,o.convertSchema(tt)(Ot)])),allOf:void 0,required:[...new Set(st.map(at=>(at==null?void 0:at.required)??[]).flat())]}},q=tt=>(nt,st=new Set)=>et.isObject(nt)?nt.properties!==void 0&&!nt.additionalProperties?nt:null:st.has(nt)?null:(st.add(nt),et.isReference(nt)?q(tt)((tt==null?void 0:tt[nt.$ref.split("/").pop()??""])??{},st):null);let et;(function(tt){tt.isBoolean=nt=>nt.type==="boolean",tt.isInteger=nt=>nt.type==="integer",tt.isNumber=nt=>nt.type==="number",tt.isString=nt=>nt.type==="string",tt.isArray=nt=>nt.type==="array",tt.isObject=nt=>nt.type==="object",tt.isReference=nt=>nt.$ref!==void 0,tt.isAllOf=nt=>nt.allOf!==void 0,tt.isOneOf=nt=>nt["x-oneOf"]!==void 0,tt.isAnyOf=nt=>nt["x-anyOf"]!==void 0,tt.isNullOnly=nt=>nt.type==="null"})(et||(et={}))})(PBt||(PBt={}));var LBt;(function(o){function s(y){if(ABt.is(y))return OBt.convert(y);if(CBt.is(y))return _mt.convert(y);if(IBt.is(y))return PBt.convert(y);throw new TypeError("Unrecognized Swagger/OpenAPI version.")}o.convert=s;function p(y,C){if(C==="2.0")return NBt.downgrade(y);if(C==="3.0")return vmt.downgrade(y);throw new TypeError("Unrecognized Swagger/OpenAPI version.")}o.downgrade=p})(LBt||(LBt={}));class hRn extends Error{constructor(s,p,y,C,N){super(N),this.body_=MCe,this.method=s,this.path=p,this.status=y,this.headers=C;const L=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,L):this.__proto__=L}toJSON(){if(this.body_===MCe)try{this.body_=JSON.parse(this.message)}catch{this.body_=this.message}return{method:this.method,path:this.path,status:this.status,headers:this.headers,message:this.body_}}}const MCe={};var yP;(function(o){function s(N){const L=[];for(let G=0;G<N.length;G++){const q=N.charCodeAt(G);65<=q&&q<=90&&L.push(G)}for(let G=L.length-1;G>0;--G){const q=L[G],et=L[G-1];q-et===1&&L.splice(G,1)}if(L.length!==0&&L[0]===0&&L.splice(0,1),L.length===0)return N.toLowerCase();let z="";for(let G=0;G<L.length;G++){const q=G===0?0:L[G-1],et=L[G];z+=N.substring(q,et).toLowerCase(),z+="_"}return z+=N.substring(L[L.length-1]).toLowerCase(),z}o.snake=s;function p(N){return C(L=>L.length===0?L:L[0]===L[0].toUpperCase()?L[0].toLowerCase()+L.substring(1):L)(N)}o.camel=p;function y(N){return C(L=>L.length===0?L:L[0]===L[0].toLowerCase()?L[0].toUpperCase()+L.substring(1):L)(N)}o.pascal=y;const C=N=>L=>{let z="";for(let nt=0;nt<L.length&&L[nt]==="_";nt++)z+="_";z.length!==0&&(L=L.substring(z.length));const G=[];for(let nt=0;nt<L.length;nt++){if(L[nt]!=="_")continue;const at=G[G.length-1];at===void 0||at[0]+at[1]!==nt?G.push([nt,1]):++at[1]}if(G.length===0)return z+N(L);let q="";for(let nt=0;nt<G.length;nt++){const[st]=G[nt];if(nt===0)st===0?q+="_":q+=L.substring(0,st);else{const[at,Ot]=G[nt-1],Dt=L.substring(at+Ot,st);Dt.length&&(q+=o.capitalize(Dt))}}const et=G[G.length-1],tt=L.substring(et[0]+et[1]);return et.length&&(q+=o.capitalize(tt)),z+N(q)};o.capitalize=N=>N.length!==0?N[0].toUpperCase()+N.slice(1).toLowerCase():N,o.variable=N=>o.reserved(N)===!1&&/^[a-zA-Z_$][a-zA-Z_$0-9]*$/g.test(N),o.reserved=N=>fRn.has(N)})(yP||(yP={}));const fRn=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","module","new","null","package","public","private","protected","return","super","switch","this","throw","true","try","typeof","var","void","while","with"]);var Kp;(function(o){o.capitalize=s=>s.length!==0?s[0].toUpperCase()+s.slice(1).toLowerCase():s,o.pascal=s=>o.splitWithNormalization(s).filter(p=>p[0]!=="{").map(yP.pascal).join(""),o.splitWithNormalization=s=>s.split("/").map(p=>o.normalize(p.trim())).filter(p=>!!p.length),o.reJoinWithDecimalParameters=s=>(s=s.split("/").map(p=>p[0]==="{"&&p[p.length-1]==="}"?`:${p.substring(1,p.length-1)}`:p).join("/"),`${s.startsWith("/")?"":"/"}${s}`),o.normalize=s=>(s=s.split(".").join("_").split("-").join("_").trim(),dRn.has(s)?`_${s}`:(s.length!==0&&"0"<=s[0]&&s[0]<="9"&&(s=`_${s}`),s)),o.escapeDuplicate=s=>p=>s.includes(p)?o.escapeDuplicate(s)(`_${p}`):p})(Kp||(Kp={}));const dRn=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","module","new","null","package","public","private","protected","return","super","switch","this","throw","true","try","typeof","var","void","while","with"]);var MBt;(function(o){o.overwrite=C=>{const N=y(C),L=s(z=>z.emendedPath.split("/").filter(G=>!!G.length&&G[0]!==":").map(Kp.normalize).map(G=>JF.variable(G)?G:`_${G}`))(C);for(const z of L.values())z.entries.forEach((G,q)=>{G.alias=Kp.escapeDuplicate([...z.children,...z.entries.filter((nt,st)=>q!==st).map(nt=>nt.alias)].map(Kp.normalize))(Kp.normalize(G.alias));const et=[...G.route.parameters,...G.route.body?[G.route.body]:[],...G.route.headers?[G.route.headers]:[],...G.route.query?[G.route.query]:[]];et.forEach((nt,st)=>nt.key=Kp.escapeDuplicate(["connection",G.alias,...et.filter((at,Ot)=>st!==Ot).map(at=>at.key)])(nt.key));const tt=G.route.operation()["x-samchon-accessor"];tt!==void 0&&N.get(tt.join("."))===1?G.route.accessor=tt:G.route.accessor=[...z.namespace,G.alias]})};const s=C=>N=>{const L=new Map;for(const z of N){const G=C(z);let q=lC.take(L)(G.join("."))(()=>({namespace:G,children:new Set,entries:[]}));q.entries.push({route:z,alias:p(z)}),G.slice(0,-1).forEach((tt,nt,st)=>{const at=G.slice(0,st.length-nt);lC.take(L)(at.join("."))(()=>({namespace:at,children:new Set,entries:[]})).children.add(q.namespace.at(-1))});const et=lC.take(L)("")(()=>({namespace:[],children:new Set,entries:[]}));G.length&&et.children.add(G[0])}return L},p=C=>{const N=C.method==="delete"?"erase":C.method;return C.parameters.length===0?N:N+"By"+C.parameters.map(L=>Kp.capitalize(L.key)).join("And")},y=C=>{var L;const N=new Map;for(const z of C){const G=(L=z.operation()["x-samchon-accessor"])==null?void 0:L.join(".");G!==void 0&&(N.has(G)?N.set(G,N.get(G)+1):N.set(G,1))}return N}})(MBt||(MBt={}));var RBt;(function(o){o.compose=L=>{const z=y("request")(Ot=>C({document:L.document,name:Kp.pascal(`I/Api/${L.path}`)+"."+Kp.pascal(`${L.method}/Body`),schema:Ot}))(L.operation.requestBody),G=(()=>{var Dt,St,ie,ae,Ne;const Ot=y("response")(pn=>C({document:L.document,name:Kp.pascal(`I/Api/${L.path}`)+"."+Kp.pascal(`${L.method}/Response`),schema:pn}))(((Dt=L.operation.responses)==null?void 0:Dt["201"])??((St=L.operation.responses)==null?void 0:St["200"])??((ie=L.operation.responses)==null?void 0:ie.default));return Ot&&{...Ot,status:(ae=L.operation.responses)!=null&&ae["201"]?"201":(Ne=L.operation.responses)!=null&&Ne["200"]?"200":"default"}})(),q=[];z===!1&&q.push('supports only "application/json", "application/x-www-form-urlencoded", "multipart/form-data" and "text/plain" content type in the request body.'),G===!1&&q.push('supports only "application/json", "application/x-www-form-urlencoded" and "text/plain" content type in the response body.');const[et,tt]=["header","query"].map(Ot=>{const Dt=(L.operation.parameters??[]).filter(de=>de.in===Ot);if(Dt.length===0)return null;const St=Dt.map(de=>{var cn;return Pr.isObject(de.schema)||Pr.isReference(de.schema)&&Pr.isObject(((cn=L.document.components.schemas)==null?void 0:cn[de.schema.$ref.replace("#/components/schemas/","")])??{})?de.schema:null}).filter(de=>!!de),ie=Dt.filter(de=>Pr.isBoolean(de.schema)||Pr.isInteger(de.schema)||Pr.isNumber(de.schema)||Pr.isString(de.schema)||Pr.isArray(de.schema)||Pr.isTuple(de.schema)),ae=de=>({...de,name:Ot,key:Ot,title:()=>de.title,description:()=>de.description,example:()=>de.example,examples:()=>de.examples});if(St.length===1&&ie.length===0)return ae(Dt[0]);if(St.length>1)return q.push(`${Ot} typed parameters must be only one object type`),!1;const Ne=St[0]?Pr.isObject(St[0])?St[0]:(L.document.components.schemas??{})[St[0].$ref.replace("#/components/schemas/","")]:null,pn=[...St.map(de=>{var cn;return Pr.isObject(de)?de:(cn=L.document.components.schemas)==null?void 0:cn[de.$ref.replace("#/components/schemas/","")]}),{type:"object",properties:Object.fromEntries([...ie.map(de=>[de.name,{...de.schema,description:de.schema.description??de.description}]),...Ne?Object.entries(Ne.properties??{}):[]]),required:[...new Set([...ie.filter(de=>de.required).map(de=>de.name),...(Ne==null?void 0:Ne.required)??[]])]}];return Dt.length===0?null:ae({schema:C({document:L.document,name:Kp.pascal(`I/Api/${L.path}`)+"."+Kp.pascal(`${L.method}/${Ot}`),schema:{type:"object",properties:Object.fromEntries([...new Map(pn.map(de=>Object.entries(de.properties??{}).map(([cn,er])=>[cn,{...er,description:er.description??er.description}])).flat())]),required:[...new Set(pn.map(de=>de.required??[]).flat())]}})})}),nt=Kp.splitWithNormalization(L.emendedPath).filter(Ot=>Ot[0]===":").map(Ot=>Ot.substring(1)),st=(L.operation.parameters??[]).filter(Ot=>Ot.in==="path");if(nt.length!==st.length)if(st.length<nt.length&&st.every(Ot=>Ot.name!==void 0&&nt.includes(Ot.name))){for(const Ot of nt)st.find(Dt=>Dt.name===Ot)===void 0&&st.push({name:Ot,in:"path",schema:{type:"string"}});st.sort((Ot,Dt)=>nt.indexOf(Ot.name)-nt.indexOf(Dt.name)),L.operation.parameters=[...st,...(L.operation.parameters??[]).filter(Ot=>Ot.in!=="path")]}else q.push("number of path parameters are not matched with its full path.");if(q.length)return q;const at=(L.operation.parameters??[]).filter(Ot=>Ot.in==="path").map((Ot,Dt)=>({name:nt[Dt],key:(()=>{let St=Kp.normalize(nt[Dt]);if(JF.variable(St))return St;for(;;)if(St="_"+St,!nt.some(ie=>ie===St))return St})(),schema:Ot.schema,parameter:()=>Ot}));return{method:L.method,path:L.path,emendedPath:L.emendedPath,accessor:["@lazy"],parameters:(L.operation.parameters??[]).filter(Ot=>Ot.in==="path").map((Ot,Dt)=>({name:nt[Dt],key:(()=>{let St=Kp.normalize(nt[Dt]);if(JF.variable(St))return St;for(;;)if(St="_"+St,!nt.some(ie=>ie===St))return St})(),schema:Ot.schema,parameter:()=>Ot})),headers:et||null,query:tt||null,body:z||null,success:G||null,exceptions:Object.fromEntries(Object.entries(L.operation.responses??{}).filter(([Ot])=>Ot!=="200"&&Ot!=="201"&&Ot!=="default").map(([Ot,Dt])=>{var St,ie;return[Ot,{schema:((ie=(St=Dt.content)==null?void 0:St["application/json"])==null?void 0:ie.schema)??{},response:()=>Dt,media:()=>{var ae;return((ae=Dt.content)==null?void 0:ae["application/json"])??{}}}]})),comment:()=>s({operation:L.operation,parameters:at,body:z||null}),operation:()=>L.operation}};const s=L=>{var et,tt,nt;const z=[],G=st=>{z.every(at=>at!==st)&&z.push(st)};let q=L.operation.description??"";if((et=L.operation.summary)!=null&&et.length){const st=L.operation.summary.endsWith(".")?L.operation.summary:L.operation.summary+".";q.length&&!q.startsWith(L.operation.summary)&&(q=`${st}
|
|
45
48
|
|
|
46
49
|
${q}`)}q=q.split(`
|
|
47
50
|
`).map(st=>st.trim()).join(`
|
|
@@ -51,17 +54,17 @@ ${z.join(`
|
|
|
51
54
|
`)}`:q:z.join(`
|
|
52
55
|
`),q=q.split("*/").join("*\\/"),q},p=(L,z)=>L.split(`
|
|
53
56
|
`).map(G=>G.trim()).map((G,q)=>q===0?G:`${" ".repeat(z)}${G}`).join(`
|
|
54
|
-
`),y=L=>z=>G=>{if(!(G!=null&&G.content))return null;const q=Object.entries(G.content).filter(([st,at])=>!!at),et=q.find(st=>G["x-nestia-encrypted"]===!0?st[0].includes("text/plain")||st[0].includes("application/json"):st[0].includes("application/json")||st[0].includes("*/*"));if(et){const{schema:st}=et[1];return st||L==="response"?{type:"application/json",name:"body",key:"body",schema:st?N(st)?st:z(st):{},description:()=>G.description,media:()=>et[1],"x-nestia-encrypted":G["x-nestia-encrypted"]}:null}const tt=q.find(st=>st[0].includes("application/x-www-form-urlencoded"));if(tt){const{schema:st}=tt[1];return st||L==="response"?{type:"application/x-www-form-urlencoded",name:"body",key:"body",schema:st?N(st)?st:z(st):{},description:()=>G.description,media:()=>tt[1]}:null}const nt=q.find(st=>st[0].includes("text/plain"));if(nt)return{type:"text/plain",name:"body",key:"body",schema:{type:"string"},description:()=>G.description,media:()=>nt[1]};if(L==="request"){const st=q.find(at=>at[0].includes("multipart/form-data"));if(st){const{schema:at}=st[1];return{type:"multipart/form-data",name:"body",key:"body",schema:at?N(at)?at:z(at):{},description:()=>G.description,media:()=>st[1]}}}return!1},C=L=>{var z;return(z=L.document.components).schemas??(z.schemas={}),L.document.components.schemas[L.name]=L.schema,{$ref:`#/components/schemas/${L.name}`}},N=L=>Pr.isReference(L)||Pr.isBoolean(L)||Pr.isNumber(L)||Pr.isString(L)||Pr.isUnknown(L)||Pr.isOneOf(L)&&L.oneOf.every(N)||Pr.isArray(L)&&N(L.items)})(RBt||(RBt={}));var DBt;(function(o){o.compose=s=>{const p=[],C=Object.entries({...s.paths??{},...s.webhooks??{}}).map(([N,L])=>["head","get","post","put","patch","delete"].filter(z=>L[z]!==void 0).map(z=>{const G=L[z],q=RBt.compose({document:s,method:z,path:N,emendedPath:Kp.reJoinWithDecimalParameters(N),operation:G});return Array.isArray(q)?(p.push({method:z,path:N,operation:()=>G,messages:q}),null):q})).flat().filter(N=>!!N);return MBt.overwrite(C),{document:()=>s,routes:C,errors:p}}})(DBt||(DBt={}));var ZF;(function(o){o.execute=async s=>{var y;const p=await RCe("request",s);if((y=s.route.success)==null||y.media,p.status!==200&&p.status!==201)throw new lRn(s.route.method.toUpperCase(),s.route.path,p.status,p.headers,p.body);return p.body},o.propagate=s=>RCe("propagate",s)})(ZF||(ZF={}));const RCe=async(o,s)=>{var et,tt,nt,st;const p=at=>new Error(`Error on MigrateRouteFetcher.${o}(): ${at}`);if(Array.isArray(s.parameters)){if(s.route.parameters.length!==s.parameters.length)throw p("number of parameters is not matched.")}else if(s.route.parameters.every(at=>s.parameters[at.key]!==void 0)===!1)throw p("number of parameters is not matched.");if(!!s.route.query!=!!s.query)throw p("query is not matched.");if(!!s.route.body!=(s.body!==void 0))throw p("body is not matched.");const y={...s.connection.headers??{},...(et=s.route.body)!=null&&et.type&&s.route.body.type!=="multipart/form-data"?{"Content-Type":s.route.body.type}:{}},C={...s.connection.options??{},method:s.route.method.toUpperCase(),headers:(()=>{const at=[];for(const[Ot,Dt]of Object.entries(y))if(Dt!==void 0)if(Array.isArray(Dt))for(const St of Dt)at.push([Ot,String(St)]);else at.push([Ot,String(Dt)]);return at})()};s.body!==void 0&&(C.body=((tt=s.route.body)==null?void 0:tt.type)==="application/x-www-form-urlencoded"?pRn(s.body):((nt=s.route.body)==null?void 0:nt.type)==="multipart/form-data"?gRn(s.body):((st=s.route.body)==null?void 0:st.type)==="application/json"?JSON.stringify(s.body):s.body);const N=s.connection.host.endsWith("/")===!1&&s.route.emendedPath.startsWith("/")===!1?`/${DCe(s)}`:DCe(s),L=new URL(`${s.connection.host}${N}`),z=await(s.connection.fetch??fetch)(L,C),G=z.status,q=at=>({status:G,headers:bRn(z.headers),body:at});if(G===200||G===201){if(s.route.method.toUpperCase()==="HEAD")return q(void 0);if(s.route.success===null||s.route.success.type==="text/plain")return q(await z.text());if(s.route.success.type==="application/json"){const at=await z.text();return q(at.length?JSON.parse(at):void 0)}else{if(s.route.success.type==="application/x-www-form-urlencoded")return q(new URLSearchParams(await z.text()));if(s.route.success.type==="multipart/form-data")return q(await z.formData())}throw p("Unsupported response body type.")}else{const at=(z.headers.get("content-type")??z.headers.get("Content-Type")??"").split(";")[0].trim();return at===""||at.startsWith("text/")?q(await z.text()):q(at==="application/json"?await z.json():at==="application/x-www-form-urlencoded"?new URLSearchParams(await z.text()):at==="multipart/form-data"?await z.formData():at==="application/octet-stream"?await z.blob():await z.text())}},DCe=o=>{let s=o.route.emendedPath;return o.route.parameters.forEach((p,y)=>{s=s.replace(`:${p.key}`,encodeURIComponent(String((Array.isArray(o.parameters)?o.parameters[y]:o.parameters[p.key])??"null")))}),o.route.query&&(s+=dRn(o.query??{})),s},dRn=o=>{const s=new URLSearchParams;for(const[p,y]of Object.entries(o))y!==void 0&&(Array.isArray(y)?y.forEach(C=>s.append(p,String(C))):s.set(p,String(y)));return s.size===0?"":`?${s.toString()}`},pRn=o=>{const s=new URLSearchParams;for(const[p,y]of Object.entries(o))y!==void 0&&(Array.isArray(y)?y.forEach(C=>s.append(p,String(C))):s.set(p,String(y)));return s},gRn=o=>{const s=new FormData,p=y=>C=>{C!==void 0&&(typeof File=="function"&&C instanceof File?s.append(y,C,C.name):s.append(y,C))};for(const[y,C]of Object.entries(o))Array.isArray(C)?C.map(p(y)):p(y)(C);return s},bRn=o=>{const s={};return o.forEach((p,y)=>{y==="set-cookie"?(s[y]??(s[y]=[]),s[y].push(...p.split(";").map(C=>C.trim()))):s[y]=p}),s};var BBt;(function(o){o.application=s=>DBt.compose(LBt.convert(s)),o.execute=s=>ZF.execute(s),o.propagate=s=>ZF.propagate(s)})(BBt||(BBt={}));var O1;(function(o){o.isNull=nt=>nt.type==="null",o.isUnknown=nt=>nt.type===void 0&&!o.isAnyOf(nt)&&!o.isReference(nt),o.isBoolean=nt=>nt.type==="boolean",o.isInteger=nt=>nt.type==="integer",o.isNumber=nt=>nt.type==="number",o.isString=nt=>nt.type==="string",o.isArray=nt=>nt.type==="array"&&nt.items!==void 0,o.isObject=nt=>nt.type==="object",o.isReference=nt=>nt.$ref!==void 0,o.isAnyOf=nt=>nt.anyOf!==void 0,o.visit=nt=>{const st=new Set,at=nt.refAccessor??"$input.$defs",Ot=(Dt,St)=>{var ie;if(nt.closure(Dt,St),o.isReference(Dt)){const ae=Dt.$ref.split("#/$defs/").pop();if(st.has(ae)===!0)return;st.add(ae);const Ne=(ie=nt.$defs)==null?void 0:ie[ae];Ne!==void 0&&Ot(Ne,`${at}[${ae}]`)}else if(o.isAnyOf(Dt))Dt.anyOf.forEach((ae,Ne)=>Ot(ae,`${St}.anyOf[${Ne}]`));else if(o.isObject(Dt)){for(const[ae,Ne]of Object.entries(Dt.properties))Ot(Ne,`${St}.properties[${JSON.stringify(ae)}]`);typeof Dt.additionalProperties=="object"&&Dt.additionalProperties!==null&&Ot(Dt.additionalProperties,`${St}.additionalProperties`)}else o.isArray(Dt)&&Ot(Dt.items,`${St}.items`)};Ot(nt.schema,nt.accessor??"$input.schemas")},o.covers=nt=>s({$defs:nt.$defs,x:nt.x,y:nt.y,visited:new Map});const s=nt=>{var Dt;const st=(Dt=nt.visited.get(nt.x))==null?void 0:Dt.get(nt.y);if(st!==void 0)return st;const at=lC.take(nt.visited)(nt.x)(()=>new Map);at.set(nt.y,!0);const Ot=p(nt);return at.set(nt.y,Ot),Ot},p=nt=>{if(nt.x===nt.y)return!0;if(o.isReference(nt.x)&&o.isReference(nt.y)&&nt.x.$ref===nt.y.$ref)return!0;const st=et(nt.$defs,nt.x),at=et(nt.$defs,nt.y);return st.some(Ot=>o.isUnknown(Ot))?!0:at.some(Ot=>o.isUnknown(Ot))?!1:at.every(Ot=>st.some(Dt=>y({$defs:nt.$defs,visited:nt.visited,x:Dt,y:Ot})))},y=nt=>nt.x===nt.y||o.isUnknown(nt.x)?!0:o.isUnknown(nt.y)?!1:o.isNull(nt.x)?o.isNull(nt.y):o.isBoolean(nt.x)?o.isBoolean(nt.y)&&L(nt.x,nt.y):o.isInteger(nt.x)?o.isInteger(nt.y)&&z(nt.x,nt.y):o.isNumber(nt.x)?o.isNumber(nt.y)&&G(nt.x,nt.y):o.isString(nt.x)?o.isString(nt.y)&&q(nt.x,nt.y):o.isArray(nt.x)?o.isArray(nt.y)&&C({$defs:nt.$defs,visited:nt.visited,x:nt.x,y:nt.y}):o.isObject(nt.x)?o.isObject(nt.y)&&N({$defs:nt.$defs,visited:nt.visited,x:nt.x,y:nt.y}):o.isReference(nt.x)?o.isReference(nt.y)&&nt.x.$ref===nt.y.$ref:!1,C=nt=>s({$defs:nt.$defs,visited:nt.visited,x:nt.x.items,y:nt.y.items}),N=nt=>!nt.x.additionalProperties&&nt.y.additionalProperties||nt.x.additionalProperties&&nt.y.additionalProperties&&(typeof nt.x.additionalProperties=="object"&&nt.y.additionalProperties===!0||typeof nt.x.additionalProperties=="object"&&typeof nt.y.additionalProperties=="object"&&!s({$defs:nt.$defs,visited:nt.visited,x:nt.x.additionalProperties,y:nt.y.additionalProperties}))?!1:Object.entries(nt.y.properties??{}).every(([st,at])=>{var Dt,St,ie;const Ot=(Dt=nt.x.properties)==null?void 0:Dt[st];return Ot===void 0||(((St=nt.x.required)==null?void 0:St.includes(st))??!1)===!0&&(((ie=nt.y.required)==null?void 0:ie.includes(st))??!1)===!1?!1:s({$defs:nt.$defs,visited:nt.visited,x:Ot,y:at})}),L=(nt,st)=>{var at,Ot;return(at=nt.enum)!=null&&at.length?!!((Ot=st.enum)!=null&&Ot.length)&&st.enum.every(Dt=>nt.enum.includes(Dt)):!0},z=(nt,st)=>{var at,Ot;return(at=nt.enum)!=null&&at.length?!!((Ot=st.enum)!=null&&Ot.length)&&st.enum.every(Dt=>nt.enum.includes(Dt)):nt.type===st.type},G=(nt,st)=>{var at,Ot;return(at=nt.enum)!=null&&at.length?!!((Ot=st.enum)!=null&&Ot.length)&&st.enum.every(Dt=>nt.enum.includes(Dt)):nt.type===st.type||nt.type==="number"&&st.type==="integer"},q=(nt,st)=>{var at,Ot;return(at=nt.enum)!=null&&at.length?!!((Ot=st.enum)!=null&&Ot.length)&&st.enum.every(Dt=>nt.enum.includes(Dt)):nt.type===st.type},et=(nt,st)=>(st=tt(nt,st),o.isAnyOf(st)?st.anyOf.map(at=>et(nt,at)).flat():[st]),tt=(nt,st)=>o.isReference(st)?tt(nt,nt[st.$ref.replace("#/$defs/","")]):st})(O1||(O1={}));var xf;(function(o){o.isNull=s=>rl.isNull(s),o.isUnknown=s=>rl.isUnknown(s),o.isConstant=s=>rl.isConstant(s),o.isBoolean=s=>rl.isBoolean(s),o.isInteger=s=>rl.isInteger(s),o.isNumber=s=>rl.isNumber(s),o.isString=s=>rl.isString(s),o.isArray=s=>rl.isArray(s),o.isObject=s=>rl.isObject(s),o.isReference=s=>rl.isReference(s),o.isOneOf=s=>rl.isOneOf(s),o.isRecursiveReference=s=>rl.isRecursiveReference({prefix:"#/$defs/",components:{schemas:s.$defs},schema:s.schema}),o.covers=s=>rl.covers({prefix:"#/$defs/",components:{schemas:s.$defs},x:s.x,y:s.y}),o.visit=s=>rl.visit({prefix:"#/$defs/",components:{schemas:s.$defs},closure:s.closure,schema:s.schema})})(xf||(xf={}));const mRn=xf,yRn=xf;var FBt;(function(o){o.visit=z=>{const G=z.accessor??"$input.schema";z.closure(z.schema,G),o.isObject(z.schema)?Object.entries(z.schema.properties??{}).forEach(([q,et])=>o.visit({closure:z.closure,schema:et,accessor:`${G}.properties[${JSON.stringify(q)}]`})):o.isArray(z.schema)&&o.visit({closure:z.closure,schema:z.schema.items,accessor:`${G}.items`})},o.covers=(z,G)=>z===G||o.isUnknown(z)?!0:o.isUnknown(G)?!1:o.isNullOnly(z)?o.isNullOnly(G):o.isNullOnly(G)?z.nullable===!0:z.nullable===!0&&!G.nullable?!1:o.isBoolean(z)?o.isBoolean(G)&&s(z,G):o.isInteger(z)?o.isInteger(G)&&p(z,G):o.isNumber(z)?(o.isNumber(G)||o.isInteger(G))&&y(z,G):o.isString(z)?o.isString(G)&&C(z,G):o.isArray(z)?o.isArray(G)&&N(z,G):o.isObject(z)?o.isObject(G)&&L(z,G):!1;const s=(z,G)=>z.enum===void 0||G.enum!==void 0&&z.enum.every(q=>G.enum.includes(q)),p=(z,G)=>z.enum!==void 0?G.enum!==void 0&&z.enum.every(q=>G.enum.includes(q)):z.type===G.type,y=(z,G)=>z.enum!==void 0?G.enum!==void 0&&z.enum.every(q=>G.enum.includes(q)):z.type===G.type,C=(z,G)=>z.enum!==void 0?G.enum!==void 0&&z.enum.every(q=>G.enum.includes(q)):z.type===G.type,N=(z,G)=>o.covers(z.items,G.items),L=(z,G)=>Object.entries(G.properties??{}).every(([q,et])=>{var nt,st,at;const tt=(nt=z.properties)==null?void 0:nt[q];return tt===void 0||(((st=z.required)==null?void 0:st.includes(q))??!1)===!0&&(((at=G.required)==null?void 0:at.includes(q))??!1)===!1?!1:o.covers(tt,et)});o.isBoolean=z=>z.type==="boolean",o.isInteger=z=>z.type==="integer",o.isNumber=z=>z.type==="number",o.isString=z=>z.type==="string",o.isArray=z=>z.type==="array",o.isObject=z=>z.type==="object",o.isNullOnly=z=>z.type==="null",o.isNullable=z=>!o.isUnknown(z)&&(o.isNullOnly(z)||z.nullable===!0),o.isUnknown=z=>z.type===void 0})(FBt||(FBt={}));const wRn=xf;var Eb;(function(o){o.visit=q=>{const et=q.accessor??"$input.schema";if(q.closure(q.schema,et),o.isOneOf(q.schema))q.schema.oneOf.forEach((tt,nt)=>o.visit({closure:q.closure,schema:tt,accessor:`${et}.oneOf[${nt}]`}));else if(o.isObject(q.schema)){for(const[tt,nt]of Object.entries(q.schema.properties))o.visit({closure:q.closure,schema:nt,accessor:`${et}.properties[${JSON.stringify(tt)}]`});typeof q.schema.additionalProperties=="object"&&q.schema.additionalProperties!==null&&o.visit({closure:q.closure,schema:q.schema.additionalProperties,accessor:`${et}.additionalProperties`})}else o.isArray(q.schema)&&o.visit({closure:q.closure,schema:q.schema.items,accessor:`${et}.items`})},o.covers=(q,et)=>{const tt=G(q),nt=G(et);return tt.some(st=>o.isUnknown(st))?!0:nt.some(st=>o.isUnknown(st))?!1:nt.every(st=>tt.some(at=>{if(at===st)return!0;if(o.isUnknown(at))return!0;if(o.isUnknown(st))return!1;if(o.isNullOnly(at))return o.isNullOnly(st);if(o.isNullOnly(st))return o.isNullable(at);if(o.isNullable(at)&&!o.isNullable(st))return!1;if(o.isBoolean(at))return o.isBoolean(st)&&s(at,st);if(o.isInteger(at))return o.isInteger(st)&&p(at,st);if(o.isNumber(at))return(o.isNumber(st)||o.isInteger(st))&&y(at,st);if(o.isString(at))return o.isString(st)&&C(at,st);if(o.isArray(at))return o.isArray(st)&&L(at,st);if(o.isObject(at))return o.isObject(st)&&z(at,st);if(o.isOneOf(at))return!1}))};const s=(q,et)=>q.enum===void 0||et.enum!==void 0&&q.enum.every(tt=>et.enum.includes(tt)),p=(q,et)=>q.enum!==void 0?et.enum!==void 0&&q.enum.every(tt=>et.enum.includes(tt)):q.type===et.type&&rl.coverNumericRange(q,et),y=(q,et)=>q.enum!==void 0?et.enum!==void 0&&q.enum.every(tt=>et.enum.includes(tt)):(q.type===et.type||q.type==="number"&&et.type==="integer")&&rl.coverNumericRange(q,et),C=(q,et)=>q.enum!==void 0?et.enum!==void 0&&q.enum.every(tt=>et.enum.includes(tt)):[q.type===et.type,q.format===void 0||et.format!==void 0&&N(q.format,et.format),q.pattern===void 0||q.pattern===et.pattern,q.minLength===void 0||et.minLength!==void 0&&q.minLength<=et.minLength,q.maxLength===void 0||et.maxLength!==void 0&&q.maxLength>=et.maxLength].every(tt=>tt),N=(q,et)=>q===et||q==="idn-email"&&et==="email"||q==="idn-hostname"&&et==="hostname"||["uri","iri"].includes(q)&&et==="url"||q==="iri"&&et==="uri"||q==="iri-reference"&&et==="uri-reference",L=(q,et)=>o.covers(q.items,et.items),z=(q,et)=>!q.additionalProperties&&et.additionalProperties||q.additionalProperties&&et.additionalProperties&&typeof q.additionalProperties=="object"&&et.additionalProperties===!0||typeof q.additionalProperties=="object"&&typeof et.additionalProperties=="object"&&!o.covers(q.additionalProperties,et.additionalProperties)?!1:Object.entries(et.properties??{}).every(([tt,nt])=>{var at,Ot,Dt;const st=(at=q.properties)==null?void 0:at[tt];return st===void 0||(((Ot=q.required)==null?void 0:Ot.includes(tt))??!1)===!0&&(((Dt=et.required)==null?void 0:Dt.includes(tt))??!1)===!1?!1:o.covers(st,nt)}),G=q=>o.isOneOf(q)?q.oneOf.flatMap(G):[q];o.isOneOf=q=>q.oneOf!==void 0,o.isObject=q=>q.type==="object",o.isArray=q=>q.type==="array",o.isBoolean=q=>q.type==="boolean",o.isInteger=q=>q.type==="integer",o.isNumber=q=>q.type==="number",o.isString=q=>q.type==="string",o.isNullOnly=q=>q.type==="null",o.isNullable=q=>!o.isUnknown(q)&&(o.isNullOnly(q)||(o.isOneOf(q)?q.oneOf.some(o.isNullable):q.nullable===!0)),o.isUnknown=q=>!o.isOneOf(q)&&q.type===void 0})(Eb||(Eb={}));const vRn=o=>{if(o.length<2)return!0;if(["boolean","bigint","number","string"].includes(typeof o[0]))return new Set(o).size===o.length;for(let s=0;s<o.length;s++)for(let p=s+1;p<o.length;p++)if(_Rn(new WeakMap)(o[s],o[p]))return!1;return!0},_Rn=o=>{const s=(p,y)=>{if(p===y)return!0;if(typeof p!=typeof y||typeof p!="object")return!1;if(Array.isArray(p))return Array.isArray(y)&&p.map((C,N)=>s(C,y[N])).every(C=>C);if(p instanceof Set)return y instanceof Set&&p.size===y.size&&[...p].every(C=>y.has(C));if(p instanceof Map)return y instanceof Map&&p.size===y.size&&[...p].every(([C,N])=>y.has(C)&&s(N,y.get(C)));if(p instanceof Boolean)return y instanceof Boolean?p.valueOf()===y.valueOf():p.valueOf()===y;if(p instanceof BigInt)return y instanceof BigInt?p===y:p===BigInt(y);if(p instanceof Number)return y instanceof Number?p.valueOf()===y.valueOf():p.valueOf()===y;if(p instanceof String)return y instanceof String?p.valueOf()===y.valueOf():p.valueOf()===y;if(p instanceof Date)return y instanceof Date&&p.getTime()===y.getTime();if(p instanceof Uint8Array)return y instanceof Uint8Array&&p.length===y.length&&p.every((C,N)=>C===y[N]);if(p instanceof Uint8ClampedArray)return y instanceof Uint8ClampedArray&&p.length===y.length&&p.every((C,N)=>C===y[N]);if(p instanceof Uint16Array)return y instanceof Uint16Array&&p.length===y.length&&p.every((C,N)=>C===y[N]);if(p instanceof Uint32Array)return y instanceof Uint32Array&&p.length===y.length&&p.every((C,N)=>C===y[N]);if(p instanceof BigUint64Array)return y instanceof BigUint64Array&&p.length===y.length&&p.every((C,N)=>C===y[N]);if(p instanceof Int8Array)return y instanceof Int8Array&&p.length===y.length&&p.every((C,N)=>C===y[N]);if(p instanceof Int16Array)return y instanceof Int16Array&&p.length===y.length&&p.every((C,N)=>C===y[N]);if(p instanceof Int32Array)return y instanceof Int32Array&&p.length===y.length&&p.every((C,N)=>C===y[N]);if(p instanceof BigInt64Array)return y instanceof BigInt64Array&&p.length===y.length&&p.every((C,N)=>C===y[N]);if(p instanceof Float32Array)return y instanceof Float32Array&&p.length===y.length&&p.every((C,N)=>C===y[N]);if(p instanceof Float64Array)return y instanceof Float64Array&&p.length===y.length&&p.every((C,N)=>C===y[N]);if(p instanceof ArrayBuffer){if(!(y instanceof ArrayBuffer)||p.byteLength!==y.byteLength)return!1;const C=new Uint8Array(p),N=new Uint8Array(y);return C.every((L,z)=>L===N[z])}else if(p instanceof SharedArrayBuffer){if(!(y instanceof SharedArrayBuffer)||p.byteLength!==y.byteLength)return!1;const C=new Uint8Array(p),N=new Uint8Array(y);return C.every((L,z)=>L===N[z])}else if(p instanceof DataView){if(!(y instanceof DataView)||p.byteLength!==y.byteLength)return!1;const C=new Uint8Array(p.buffer),N=new Uint8Array(y.buffer);return C.every((L,z)=>L===N[z])}else{if(p instanceof File)return y instanceof File&&p.name===y.name&&p.size===y.size&&p.type===y.type&&s(p.slice(),y.slice());if(p!==null&&y!==null){if(o.has(p)&&o.get(p).has(y))return o.get(p).get(y);o.has(p)||o.set(p,new WeakMap),o.get(p).set(y,!0);const C=Object.keys(p).length===Object.keys(y).length&&Object.keys(p).every(N=>s(p[N],y[N]));return o.get(p).set(y,C),C}}return!1};return s};var $Bt;(function(o){o.validate=s=>Array.isArray(s.value)===!1?s.report(s):[s.value.map((p,y)=>O3.validate({...s,schema:s.schema.items,value:p,path:`${s.path}[${y}]`,required:!0})).every(p=>p),s.schema.minItems!==void 0?s.value.length>=s.schema.minItems||s.report({...s,expected:`Array<> & MinItems<${s.schema.minItems}>`}):!0,s.schema.maxItems!==void 0?s.value.length<=s.schema.maxItems||s.report({...s,expected:`Array<> & MaxItems<${s.schema.maxItems}>`}):!0,s.schema.uniqueItems!==void 0&&s.schema.uniqueItems?vRn(s.value)||s.report({...s,expected:"Array<> & UniqueItems"}):!0].every(p=>p)})($Bt||($Bt={}));var jBt;(function(o){o.validate=s=>typeof s.value=="boolean"||s.report(s)})(jBt||(jBt={}));var HBt;(function(o){o.validate=s=>s.value===s.schema.const||s.report(s)})(HBt||(HBt={}));var zBt;(function(o){o.validate=s=>typeof s.value!="number"||Math.floor(s.value)!==s.value?s.report(s):[s.schema.minimum!==void 0?s.schema.exclusiveMinimum?s.value>s.schema.minimum||s.report({...s,expected:`number & Type<"int32"> & ExclusiveMinimum<${s.schema.minimum}>`}):s.value>=s.schema.minimum||s.report({...s,expected:`number & Type<"int32"> & Minimum<${s.schema.minimum}>`}):!0,s.schema.maximum!==void 0?s.schema.exclusiveMaximum?s.value<s.schema.maximum||s.report({...s,expected:`number & Type<"int32"> & ExclusiveMaximum<${s.schema.maximum}>`}):s.value<=s.schema.maximum||s.report({...s,expected:`number & Type<"int32"> & Maximum<${s.schema.maximum}>`}):!0,s.schema.multipleOf!==void 0?s.value%s.schema.multipleOf===0||s.report({...s,expected:`number & Type<"int32"> & MultipleOf<${s.schema.multipleOf}>`}):!0].every(p=>p)})(zBt||(zBt={}));var UBt;(function(o){o.validate=s=>typeof s.value!="number"?s.report(s):[s.schema.minimum!==void 0?s.schema.exclusiveMinimum?s.value>s.schema.minimum||s.report({...s,expected:`number & ExclusiveMinimum<${s.schema.minimum}>`}):s.value>=s.schema.minimum||s.report({...s,expected:`number & Minimum<${s.schema.minimum}>`}):!0,s.schema.maximum!==void 0?s.schema.exclusiveMaximum?s.value<s.schema.maximum||s.report({...s,expected:`number & ExclusiveMaximum<${s.schema.maximum}>`}):s.value<=s.schema.maximum||s.report({...s,expected:`number & Maximum<${s.schema.maximum}>`}):!0,s.schema.multipleOf!==void 0?s.value%s.schema.multipleOf===0||s.report({...s,expected:`number & MultipleOf<${s.schema.multipleOf}>`}):!0].every(p=>p)})(UBt||(UBt={}));var qBt;(function(o){o.validate=s=>typeof s.value!="object"||s.value===null?s.report(s):[...Object.entries(s.schema.properties??{}).map(([p,y])=>{var C;return O3.validate({...s,schema:y,value:s.value[p],path:s.path+(yP.variable(p)?`.${p}`:`[${JSON.stringify(p)}]`),required:((C=s.schema.required)==null?void 0:C.includes(p))??!1})}),...typeof s.schema.additionalProperties=="object"&&s.schema.additionalProperties!==null?Object.entries(s.value).filter(([p])=>Object.keys(s.schema.properties??{}).includes(p)===!1).map(([p,y])=>O3.validate({...s,schema:s.schema.additionalProperties,value:y,path:s.path+(yP.variable(p)?`.${p}`:`[${JSON.stringify(p)}]`),required:!0})):[]].every(p=>p)})(qBt||(qBt={}));var WBt;(function(o){o.validate=C=>{const N=s(C);for(const L of N.branches)if(L.predicator(C.value))return O3.validate({...C,schema:L.schema});return N.branches.length===0?N.remainders.map(L=>O3.validate({...C,schema:L,exceptionable:!1})).some(L=>L)||C.report(C):o.validate({...C,schema:{oneOf:N.remainders}})};const s=C=>{const N=C.schema.oneOf.map(nt=>KBt({components:C.components,schema:nt,visited:new Set})),L=N.find(nt=>Pr.isUnknown(nt.escaped));if(L)return{branches:[],remainders:[L.schema]};const z=N.filter(nt=>Pr.isNull(nt.schema)),G=N.filter(nt=>Pr.isNull(nt.escaped)===!1);if(G.length===1)return{branches:[{schema:G[0].schema,predicator:nt=>nt!==null}],remainders:z.map(nt=>nt.schema)};const q=G.filter(nt=>Pr.isTuple(nt.escaped)),et=G.filter(nt=>Pr.isArray(nt.escaped)),tt=[...q.length===0&&et.length!==0?p(C,G.filter(nt=>Pr.isArray(nt.schema))):[],...y(C,G.filter(nt=>Pr.isObject(nt.escaped)),q.length+et.length===0)];return{branches:tt,remainders:C.schema.oneOf.filter(nt=>tt.some(st=>st.schema===nt)===!1)}},p=(C,N)=>N.length===1?[{schema:N[0].schema,predicator:L=>Array.isArray(L)}]:N.filter((L,z,G)=>G.every((q,et)=>z===et||!Pr.covers({components:C.components,x:q.escaped.items,y:L.escaped.items}))).map(L=>({schema:L.schema,predicator:z=>Array.isArray(z)&&(z.length===0||O3.validate({...C,schema:L.escaped.items,value:z[0],path:`${C.path}[0]`,exceptionable:!1}))})),y=(C,N,L)=>{if(N.length===1)return[{schema:N[0].schema,predicator:L?G=>typeof G=="object"&&G!==null:G=>typeof G=="object"&&G!==null&&Array.isArray(G)===!1}];N=N.filter(G=>G.escaped.properties!==void 0&&G.escaped.required!==void 0).map(G=>({...G,escaped:{...G.escaped,properties:Object.fromEntries(Object.entries(G.escaped.properties??{}).map(([q,et])=>[q,KBt({components:C.components,schema:et,visited:new Set}).escaped]))}}));const z=new Map;return N.forEach((G,q)=>{var et;for(const[tt,nt]of Object.entries(G.escaped.properties??{}))(et=G.escaped.required)!=null&&et.includes(tt)&&(lC.take(z)(tt)(()=>new Array(N.length).fill(null))[q]=nt)}),N.map((G,q)=>{var st;const et=[];for(const[at,Ot]of Object.entries(G.escaped.properties??{})){if(!((st=G.escaped.required)!=null&&st.includes(at)))continue;const Dt=z.get(at).filter((ie,ae)=>q!==ae).filter(ie=>ie!==null);(Pr.isConstant(Ot)?Dt.every(ie=>Pr.isConstant(ie)&&Ot.const!==ie.const):Dt.length===0)&&et.push(at)}if(et.length===0)return null;const tt=et.find(at=>Pr.isConstant(G.escaped.properties[at]))??et[0],nt=G.escaped.properties[tt];return{schema:G.schema,predicator:Pr.isConstant(nt)?at=>typeof at=="object"&&at!==null&&at[tt]===nt.const:at=>typeof at=="object"&&at!==null&&at[tt]!==void 0}}).filter(G=>G!==null)}})(WBt||(WBt={}));const KBt=o=>{var s;if(Pr.isReference(o.schema)){const p=o.schema.$ref.split("/").pop()??"";return o.visited.has(p)?{schema:o.schema,escaped:{}}:(o.visited.add(p),{...KBt({components:o.components,schema:((s=o.components.schemas)==null?void 0:s[p])??{},visited:o.visited}),schema:o.schema})}return{schema:o.schema,escaped:o.schema}};var GBt;(function(o){o.getName=(z,G=!1)=>Pr.isUnknown(z)?"unknown":Pr.isNull(z)?"null":Pr.isOneOf(z)?z.oneOf.map(q=>o.getName(q,!0)).join(" | "):Pr.isConstant(z)?JSON.stringify(z.const):Pr.isBoolean(z)?"boolean":Pr.isInteger(z)?L(s(z),G):Pr.isNumber(z)?L(p(z),G):Pr.isString(z)?L(y(z),G):Pr.isReference(z)?z.$ref.split("/").pop()??"unknown":Pr.isObject(z)?"__object":Pr.isArray(z)?L(C(z),G):Pr.isTuple(z)?N(z):"unknown";const s=z=>["number",...z.minimum!==void 0?[z.exclusiveMinimum?`tags.ExclusiveMinimum<${z.minimum}>`:`tags.Minimum<${z.minimum}>`]:[],...z.maximum!==void 0?[z.exclusiveMaximum?`tags.ExclusiveMaximum<${z.maximum}>`:`tags.Maximum<${z.maximum}>`]:[],...z.multipleOf!==void 0?[`tags.MultipleOf<${z.multipleOf}>`]:[]],p=z=>["number",...z.minimum!==void 0?[z.exclusiveMinimum?`tags.ExclusiveMinimum<${z.minimum}>`:`tags.Minimum<${z.minimum}>`]:[],...z.maximum!==void 0?[z.exclusiveMaximum?`tags.ExclusiveMaximum<${z.maximum}>`:`tags.Maximum<${z.maximum}>`]:[],...z.multipleOf!==void 0?[`tags.MultipleOf<${z.multipleOf}>`]:[]],y=z=>["string",...z.format!==void 0?[`tags.Format<${JSON.stringify(z.format)}>`]:[],...z.pattern!==void 0&&z.format===void 0?[`tags.Pattern<${JSON.stringify(z.pattern)}>`]:[],...z.contentMediaType!==void 0?[`tags.ContentMediaType<${JSON.stringify(z.contentMediaType)}>`]:[],...z.minLength!==void 0?[`tags.MinLength<${z.minLength}>`]:[],...z.maxLength!==void 0?[`tags.MaxLength<${z.maxLength}>`]:[]],C=z=>[`Array<${o.getName(z.items)}>`,...z.minItems!==void 0?[`tags.MinItems<${z.minItems}>`]:[],...z.maxItems!==void 0?[`tags.MaxItems<${z.maxItems}>`]:[],...z.uniqueItems!==void 0?["tags.UniqueItems"]:[]],N=z=>"["+[...z.prefixItems.map(G=>o.getName(G)),...z.additionalItems===!0?["...Array<unknown>"]:typeof z.additionalItems=="object"&&z.additionalItems!==null?[`...Array<${o.getName(z.additionalItems)}>`]:[]].join(", ")+"]",L=(z,G)=>{const q=z.join(" & ");return G?`(${q})`:q}})(GBt||(GBt={}));const xRn=o=>(BCe.lastIndex=0,BCe.test(o)),BCe=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm,ERn=o=>TRn.test(o),TRn=/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/,kRn=o=>SRn.test(o),SRn=/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(T|\s)([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](?:\.[0-9]{1,9})?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])$/i,CRn=o=>ARn.test(o),ARn=/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,IRn=o=>ORn.test(o),ORn=/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,NRn=o=>PRn.test(o),PRn=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,LRn=o=>MRn.test(o),MRn=/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i,RRn=o=>DRn.test(o),DRn=/^([a-z0-9\u00a1-\uffff0-9]+(-[a-z0-9\u00a1-\uffff0-9]+)*\.)+[a-z\u00a1-\uffff]{2,}$/i,BRn=o=>FRn.test(o),FRn=/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,$Rn=o=>jRn.test(o),jRn=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,HRn=o=>zRn.test(o),zRn=/^[A-Za-z][\d+-.A-Za-z]*:[^\u0000-\u0020"<>\\^`{|}]*$/u,URn=o=>qRn.test(o),qRn=/^[A-Za-z][\d+-.A-Za-z]*:[^\u0000-\u0020"<>\\^`{|}]*$/u,WRn=o=>KRn.test(o),KRn=/^(?:\/(?:[^~/]|~0|~1)*)*$/,GRn=o=>{try{return new RegExp(o),!0}catch{return!1}},YRn=o=>VRn.test(o),VRn=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,XRn=o=>QRn.test(o),QRn=/^([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](?:\.[0-9]{1,9})?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])$/i,JRn=o=>ZRn.test(o)&&tDn.test(o),ZRn=/\/|:/,tDn=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,eDn=o=>nDn.test(o),nDn=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,rDn=o=>iDn.test(o),iDn=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,aDn=o=>sDn.test(o),sDn=/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,oDn=o=>cDn.test(o),cDn=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;var YBt;(function(o){o.validate=s=>typeof s.value!="string"?s.report(s):[s.schema.minLength!==void 0?s.value.length>=s.schema.minLength||s.report({...s,expected:`string & MinLength<${s.schema.minLength}>`}):!0,s.schema.maxLength!==void 0?s.value.length<=s.schema.maxLength||s.report({...s,expected:`string & MaxLength<${s.schema.maxLength}>`}):!0,s.schema.pattern!==void 0?new RegExp(s.schema.pattern).test(s.value)||s.report({...s,expected:`string & Pattern<${JSON.stringify(s.schema.pattern)}>`}):!0,s.schema.format&&FCe[s.schema.format]?FCe[s.schema.format](s.value)||s.report({...s,expected:`string & Format<${JSON.stringify(s.schema.format)}>`}):!0].every(p=>p)||s.report(s)})(YBt||(YBt={}));const FCe={byte:xRn,regex:GRn,uuid:oDn,email:IRn,hostname:NRn,"idn-email":LRn,"idn-hostname":RRn,iri:HRn,"iri-reference":URn,ipv4:BRn,ipv6:$Rn,uri:JRn,"uri-reference":eDn,"uri-template":rDn,url:aDn,"date-time":kRn,date:ERn,time:XRn,duration:CRn,"json-pointer":WRn,"relative-json-pointer":YRn};var VBt;(function(o){o.validate=s=>{if(Array.isArray(s.value)){if(!s.schema.additionalItems)return s.value.length!==s.schema.prefixItems.length?s.report(s):s.value.map((y,C)=>O3.validate({...s,schema:s.schema.prefixItems[C],value:y,path:`${s.path}[${C}]`})).every(y=>y)}else return s.report(s);if(s.value.length<s.schema.prefixItems.length)return s.report(s);const p=typeof s.schema.additionalItems=="object"&&s.schema.additionalItems!==null?(y,C)=>O3.validate({...s,schema:s.schema.additionalItems,value:y,path:`${s.path}[${C}]`}):()=>!0;return s.value.length>=s.schema.prefixItems.length&&s.value.map((y,C)=>C<s.schema.prefixItems.length?O3.validate({...s,schema:s.schema.prefixItems[C],value:y,path:`${s.path}[${C}]`}):p(y,C)).every(y=>y)}})(VBt||(VBt={}));var O3;(function(o){o.validate=(s,p)=>{var y;if(p??(p=(()=>{const C=GBt.getName(s.schema);return s.required?C:`${C} | undefined`})()),Pr.isUnknown(s.schema))return!0;if(s.value===void 0)return s.required===!1||s.report({...s,expected:p});if(Pr.isNull(s.schema))return s.value===null||s.report({...s,expected:p});if(Pr.isReference(s.schema)){const C=(y=s.components.schemas)==null?void 0:y[s.schema.$ref.split("/").pop()??""];return C===void 0?!0:o.validate({...s,schema:C},p)}else{if(Pr.isOneOf(s.schema))return WBt.validate({...s,schema:s.schema,expected:p});if(Pr.isConstant(s.schema))return HBt.validate({...s,schema:s.schema,expected:p});if(Pr.isBoolean(s.schema))return jBt.validate({...s,schema:s.schema,expected:p});if(Pr.isInteger(s.schema))return zBt.validate({...s,schema:s.schema,expected:p});if(Pr.isNumber(s.schema))return UBt.validate({...s,schema:s.schema,expected:p});if(Pr.isString(s.schema))return YBt.validate({...s,schema:s.schema,expected:p});if(Pr.isArray(s.schema))return $Bt.validate({...s,schema:s.schema,expected:p});if(Pr.isTuple(s.schema))return VBt.validate({...s,schema:s.schema,expected:p});if(Pr.isObject(s.schema))return qBt.validate({...s,schema:s.schema,expected:p})}return!0}})(O3||(O3={}));var t$;(function(o){o.create=p=>y=>o.validate({...p,value:y}),o.validate=p=>{const y=[];return O3.validate({...p,path:"$input",exceptionable:!0,report:s(y)}),y.length===0?{success:!0,data:p.value}:{success:!1,data:p.value,errors:y}};const s=p=>{const y=C=>{if(p.length===0)return!0;const N=p[p.length-1].path;return C.length>N.length||N.substring(0,C.length)!==C};return C=>(C.exceptionable&&y(C.path)&&p.push({path:C.path,expected:C.expected,value:C.value}),!1)}})(t$||(t$={}));var t5;(function(o){o.numeric=C=>{if(C===void 0)return{};const N=C.split(`
|
|
57
|
+
`),y=L=>z=>G=>{if(!(G!=null&&G.content))return null;const q=Object.entries(G.content).filter(([st,at])=>!!at),et=q.find(st=>G["x-nestia-encrypted"]===!0?st[0].includes("text/plain")||st[0].includes("application/json"):st[0].includes("application/json")||st[0].includes("*/*"));if(et){const{schema:st}=et[1];return st||L==="response"?{type:"application/json",name:"body",key:"body",schema:st?N(st)?st:z(st):{},description:()=>G.description,media:()=>et[1],"x-nestia-encrypted":G["x-nestia-encrypted"]}:null}const tt=q.find(st=>st[0].includes("application/x-www-form-urlencoded"));if(tt){const{schema:st}=tt[1];return st||L==="response"?{type:"application/x-www-form-urlencoded",name:"body",key:"body",schema:st?N(st)?st:z(st):{},description:()=>G.description,media:()=>tt[1]}:null}const nt=q.find(st=>st[0].includes("text/plain"));if(nt)return{type:"text/plain",name:"body",key:"body",schema:{type:"string"},description:()=>G.description,media:()=>nt[1]};if(L==="request"){const st=q.find(at=>at[0].includes("multipart/form-data"));if(st){const{schema:at}=st[1];return{type:"multipart/form-data",name:"body",key:"body",schema:at?N(at)?at:z(at):{},description:()=>G.description,media:()=>st[1]}}}return!1},C=L=>{var z;return(z=L.document.components).schemas??(z.schemas={}),L.document.components.schemas[L.name]=L.schema,{$ref:`#/components/schemas/${L.name}`}},N=L=>Pr.isReference(L)||Pr.isBoolean(L)||Pr.isNumber(L)||Pr.isString(L)||Pr.isUnknown(L)||Pr.isOneOf(L)&&L.oneOf.every(N)||Pr.isArray(L)&&N(L.items)})(RBt||(RBt={}));var DBt;(function(o){o.compose=s=>{const p=[],C=Object.entries({...s.paths??{},...s.webhooks??{}}).map(([N,L])=>["head","get","post","put","patch","delete"].filter(z=>L[z]!==void 0).map(z=>{const G=L[z],q=RBt.compose({document:s,method:z,path:N,emendedPath:Kp.reJoinWithDecimalParameters(N),operation:G});return Array.isArray(q)?(p.push({method:z,path:N,operation:()=>G,messages:q}),null):q})).flat().filter(N=>!!N);return MBt.overwrite(C),{document:()=>s,routes:C,errors:p}}})(DBt||(DBt={}));var ZF;(function(o){o.execute=async s=>{var y;const p=await RCe("request",s);if((y=s.route.success)==null||y.media,p.status!==200&&p.status!==201)throw new hRn(s.route.method.toUpperCase(),s.route.path,p.status,p.headers,p.body);return p.body},o.propagate=s=>RCe("propagate",s)})(ZF||(ZF={}));const RCe=async(o,s)=>{var et,tt,nt,st;const p=at=>new Error(`Error on MigrateRouteFetcher.${o}(): ${at}`);if(Array.isArray(s.parameters)){if(s.route.parameters.length!==s.parameters.length)throw p("number of parameters is not matched.")}else if(s.route.parameters.every(at=>s.parameters[at.key]!==void 0)===!1)throw p("number of parameters is not matched.");if(!!s.route.query!=!!s.query)throw p("query is not matched.");if(!!s.route.body!=(s.body!==void 0))throw p("body is not matched.");const y={...s.connection.headers??{},...(et=s.route.body)!=null&&et.type&&s.route.body.type!=="multipart/form-data"?{"Content-Type":s.route.body.type}:{}},C={...s.connection.options??{},method:s.route.method.toUpperCase(),headers:(()=>{const at=[];for(const[Ot,Dt]of Object.entries(y))if(Dt!==void 0)if(Array.isArray(Dt))for(const St of Dt)at.push([Ot,String(St)]);else at.push([Ot,String(Dt)]);return at})()};s.body!==void 0&&(C.body=((tt=s.route.body)==null?void 0:tt.type)==="application/x-www-form-urlencoded"?gRn(s.body):((nt=s.route.body)==null?void 0:nt.type)==="multipart/form-data"?bRn(s.body):((st=s.route.body)==null?void 0:st.type)==="application/json"?JSON.stringify(s.body):s.body);const N=s.connection.host.endsWith("/")===!1&&s.route.emendedPath.startsWith("/")===!1?`/${DCe(s)}`:DCe(s),L=new URL(`${s.connection.host}${N}`),z=await(s.connection.fetch??fetch)(L,C),G=z.status,q=at=>({status:G,headers:mRn(z.headers),body:at});if(G===200||G===201){if(s.route.method.toUpperCase()==="HEAD")return q(void 0);if(s.route.success===null||s.route.success.type==="text/plain")return q(await z.text());if(s.route.success.type==="application/json"){const at=await z.text();return q(at.length?JSON.parse(at):void 0)}else{if(s.route.success.type==="application/x-www-form-urlencoded")return q(new URLSearchParams(await z.text()));if(s.route.success.type==="multipart/form-data")return q(await z.formData())}throw p("Unsupported response body type.")}else{const at=(z.headers.get("content-type")??z.headers.get("Content-Type")??"").split(";")[0].trim();return at===""||at.startsWith("text/")?q(await z.text()):q(at==="application/json"?await z.json():at==="application/x-www-form-urlencoded"?new URLSearchParams(await z.text()):at==="multipart/form-data"?await z.formData():at==="application/octet-stream"?await z.blob():await z.text())}},DCe=o=>{let s=o.route.emendedPath;return o.route.parameters.forEach((p,y)=>{s=s.replace(`:${p.key}`,encodeURIComponent(String((Array.isArray(o.parameters)?o.parameters[y]:o.parameters[p.key])??"null")))}),o.route.query&&(s+=pRn(o.query??{})),s},pRn=o=>{const s=new URLSearchParams;for(const[p,y]of Object.entries(o))y!==void 0&&(Array.isArray(y)?y.forEach(C=>s.append(p,String(C))):s.set(p,String(y)));return s.size===0?"":`?${s.toString()}`},gRn=o=>{const s=new URLSearchParams;for(const[p,y]of Object.entries(o))y!==void 0&&(Array.isArray(y)?y.forEach(C=>s.append(p,String(C))):s.set(p,String(y)));return s},bRn=o=>{const s=new FormData,p=y=>C=>{C!==void 0&&(typeof File=="function"&&C instanceof File?s.append(y,C,C.name):s.append(y,C))};for(const[y,C]of Object.entries(o))Array.isArray(C)?C.map(p(y)):p(y)(C);return s},mRn=o=>{const s={};return o.forEach((p,y)=>{y==="set-cookie"?(s[y]??(s[y]=[]),s[y].push(...p.split(";").map(C=>C.trim()))):s[y]=p}),s};var BBt;(function(o){o.application=s=>DBt.compose(LBt.convert(s)),o.execute=s=>ZF.execute(s),o.propagate=s=>ZF.propagate(s)})(BBt||(BBt={}));var O1;(function(o){o.isNull=nt=>nt.type==="null",o.isUnknown=nt=>nt.type===void 0&&!o.isAnyOf(nt)&&!o.isReference(nt),o.isBoolean=nt=>nt.type==="boolean",o.isInteger=nt=>nt.type==="integer",o.isNumber=nt=>nt.type==="number",o.isString=nt=>nt.type==="string",o.isArray=nt=>nt.type==="array"&&nt.items!==void 0,o.isObject=nt=>nt.type==="object",o.isReference=nt=>nt.$ref!==void 0,o.isAnyOf=nt=>nt.anyOf!==void 0,o.visit=nt=>{const st=new Set,at=nt.refAccessor??"$input.$defs",Ot=(Dt,St)=>{var ie;if(nt.closure(Dt,St),o.isReference(Dt)){const ae=Dt.$ref.split("#/$defs/").pop();if(st.has(ae)===!0)return;st.add(ae);const Ne=(ie=nt.$defs)==null?void 0:ie[ae];Ne!==void 0&&Ot(Ne,`${at}[${ae}]`)}else if(o.isAnyOf(Dt))Dt.anyOf.forEach((ae,Ne)=>Ot(ae,`${St}.anyOf[${Ne}]`));else if(o.isObject(Dt)){for(const[ae,Ne]of Object.entries(Dt.properties))Ot(Ne,`${St}.properties[${JSON.stringify(ae)}]`);typeof Dt.additionalProperties=="object"&&Dt.additionalProperties!==null&&Ot(Dt.additionalProperties,`${St}.additionalProperties`)}else o.isArray(Dt)&&Ot(Dt.items,`${St}.items`)};Ot(nt.schema,nt.accessor??"$input.schemas")},o.covers=nt=>s({$defs:nt.$defs,x:nt.x,y:nt.y,visited:new Map});const s=nt=>{var Dt;const st=(Dt=nt.visited.get(nt.x))==null?void 0:Dt.get(nt.y);if(st!==void 0)return st;const at=lC.take(nt.visited)(nt.x)(()=>new Map);at.set(nt.y,!0);const Ot=p(nt);return at.set(nt.y,Ot),Ot},p=nt=>{if(nt.x===nt.y)return!0;if(o.isReference(nt.x)&&o.isReference(nt.y)&&nt.x.$ref===nt.y.$ref)return!0;const st=et(nt.$defs,nt.x),at=et(nt.$defs,nt.y);return st.some(Ot=>o.isUnknown(Ot))?!0:at.some(Ot=>o.isUnknown(Ot))?!1:at.every(Ot=>st.some(Dt=>y({$defs:nt.$defs,visited:nt.visited,x:Dt,y:Ot})))},y=nt=>nt.x===nt.y||o.isUnknown(nt.x)?!0:o.isUnknown(nt.y)?!1:o.isNull(nt.x)?o.isNull(nt.y):o.isBoolean(nt.x)?o.isBoolean(nt.y)&&L(nt.x,nt.y):o.isInteger(nt.x)?o.isInteger(nt.y)&&z(nt.x,nt.y):o.isNumber(nt.x)?o.isNumber(nt.y)&&G(nt.x,nt.y):o.isString(nt.x)?o.isString(nt.y)&&q(nt.x,nt.y):o.isArray(nt.x)?o.isArray(nt.y)&&C({$defs:nt.$defs,visited:nt.visited,x:nt.x,y:nt.y}):o.isObject(nt.x)?o.isObject(nt.y)&&N({$defs:nt.$defs,visited:nt.visited,x:nt.x,y:nt.y}):o.isReference(nt.x)?o.isReference(nt.y)&&nt.x.$ref===nt.y.$ref:!1,C=nt=>s({$defs:nt.$defs,visited:nt.visited,x:nt.x.items,y:nt.y.items}),N=nt=>!nt.x.additionalProperties&&nt.y.additionalProperties||nt.x.additionalProperties&&nt.y.additionalProperties&&(typeof nt.x.additionalProperties=="object"&&nt.y.additionalProperties===!0||typeof nt.x.additionalProperties=="object"&&typeof nt.y.additionalProperties=="object"&&!s({$defs:nt.$defs,visited:nt.visited,x:nt.x.additionalProperties,y:nt.y.additionalProperties}))?!1:Object.entries(nt.y.properties??{}).every(([st,at])=>{var Dt,St,ie;const Ot=(Dt=nt.x.properties)==null?void 0:Dt[st];return Ot===void 0||(((St=nt.x.required)==null?void 0:St.includes(st))??!1)===!0&&(((ie=nt.y.required)==null?void 0:ie.includes(st))??!1)===!1?!1:s({$defs:nt.$defs,visited:nt.visited,x:Ot,y:at})}),L=(nt,st)=>{var at,Ot;return(at=nt.enum)!=null&&at.length?!!((Ot=st.enum)!=null&&Ot.length)&&st.enum.every(Dt=>nt.enum.includes(Dt)):!0},z=(nt,st)=>{var at,Ot;return(at=nt.enum)!=null&&at.length?!!((Ot=st.enum)!=null&&Ot.length)&&st.enum.every(Dt=>nt.enum.includes(Dt)):nt.type===st.type},G=(nt,st)=>{var at,Ot;return(at=nt.enum)!=null&&at.length?!!((Ot=st.enum)!=null&&Ot.length)&&st.enum.every(Dt=>nt.enum.includes(Dt)):nt.type===st.type||nt.type==="number"&&st.type==="integer"},q=(nt,st)=>{var at,Ot;return(at=nt.enum)!=null&&at.length?!!((Ot=st.enum)!=null&&Ot.length)&&st.enum.every(Dt=>nt.enum.includes(Dt)):nt.type===st.type},et=(nt,st)=>(st=tt(nt,st),o.isAnyOf(st)?st.anyOf.map(at=>et(nt,at)).flat():[st]),tt=(nt,st)=>o.isReference(st)?tt(nt,nt[st.$ref.replace("#/$defs/","")]):st})(O1||(O1={}));var xf;(function(o){o.isNull=s=>rl.isNull(s),o.isUnknown=s=>rl.isUnknown(s),o.isConstant=s=>rl.isConstant(s),o.isBoolean=s=>rl.isBoolean(s),o.isInteger=s=>rl.isInteger(s),o.isNumber=s=>rl.isNumber(s),o.isString=s=>rl.isString(s),o.isArray=s=>rl.isArray(s),o.isObject=s=>rl.isObject(s),o.isReference=s=>rl.isReference(s),o.isOneOf=s=>rl.isOneOf(s),o.isRecursiveReference=s=>rl.isRecursiveReference({prefix:"#/$defs/",components:{schemas:s.$defs},schema:s.schema}),o.covers=s=>rl.covers({prefix:"#/$defs/",components:{schemas:s.$defs},x:s.x,y:s.y}),o.visit=s=>rl.visit({prefix:"#/$defs/",components:{schemas:s.$defs},closure:s.closure,schema:s.schema})})(xf||(xf={}));const yRn=xf,wRn=xf;var FBt;(function(o){o.visit=z=>{const G=z.accessor??"$input.schema";z.closure(z.schema,G),o.isObject(z.schema)?Object.entries(z.schema.properties??{}).forEach(([q,et])=>o.visit({closure:z.closure,schema:et,accessor:`${G}.properties[${JSON.stringify(q)}]`})):o.isArray(z.schema)&&o.visit({closure:z.closure,schema:z.schema.items,accessor:`${G}.items`})},o.covers=(z,G)=>z===G||o.isUnknown(z)?!0:o.isUnknown(G)?!1:o.isNullOnly(z)?o.isNullOnly(G):o.isNullOnly(G)?z.nullable===!0:z.nullable===!0&&!G.nullable?!1:o.isBoolean(z)?o.isBoolean(G)&&s(z,G):o.isInteger(z)?o.isInteger(G)&&p(z,G):o.isNumber(z)?(o.isNumber(G)||o.isInteger(G))&&y(z,G):o.isString(z)?o.isString(G)&&C(z,G):o.isArray(z)?o.isArray(G)&&N(z,G):o.isObject(z)?o.isObject(G)&&L(z,G):!1;const s=(z,G)=>z.enum===void 0||G.enum!==void 0&&z.enum.every(q=>G.enum.includes(q)),p=(z,G)=>z.enum!==void 0?G.enum!==void 0&&z.enum.every(q=>G.enum.includes(q)):z.type===G.type,y=(z,G)=>z.enum!==void 0?G.enum!==void 0&&z.enum.every(q=>G.enum.includes(q)):z.type===G.type,C=(z,G)=>z.enum!==void 0?G.enum!==void 0&&z.enum.every(q=>G.enum.includes(q)):z.type===G.type,N=(z,G)=>o.covers(z.items,G.items),L=(z,G)=>Object.entries(G.properties??{}).every(([q,et])=>{var nt,st,at;const tt=(nt=z.properties)==null?void 0:nt[q];return tt===void 0||(((st=z.required)==null?void 0:st.includes(q))??!1)===!0&&(((at=G.required)==null?void 0:at.includes(q))??!1)===!1?!1:o.covers(tt,et)});o.isBoolean=z=>z.type==="boolean",o.isInteger=z=>z.type==="integer",o.isNumber=z=>z.type==="number",o.isString=z=>z.type==="string",o.isArray=z=>z.type==="array",o.isObject=z=>z.type==="object",o.isNullOnly=z=>z.type==="null",o.isNullable=z=>!o.isUnknown(z)&&(o.isNullOnly(z)||z.nullable===!0),o.isUnknown=z=>z.type===void 0})(FBt||(FBt={}));const vRn=xf;var Eb;(function(o){o.visit=q=>{const et=q.accessor??"$input.schema";if(q.closure(q.schema,et),o.isOneOf(q.schema))q.schema.oneOf.forEach((tt,nt)=>o.visit({closure:q.closure,schema:tt,accessor:`${et}.oneOf[${nt}]`}));else if(o.isObject(q.schema)){for(const[tt,nt]of Object.entries(q.schema.properties))o.visit({closure:q.closure,schema:nt,accessor:`${et}.properties[${JSON.stringify(tt)}]`});typeof q.schema.additionalProperties=="object"&&q.schema.additionalProperties!==null&&o.visit({closure:q.closure,schema:q.schema.additionalProperties,accessor:`${et}.additionalProperties`})}else o.isArray(q.schema)&&o.visit({closure:q.closure,schema:q.schema.items,accessor:`${et}.items`})},o.covers=(q,et)=>{const tt=G(q),nt=G(et);return tt.some(st=>o.isUnknown(st))?!0:nt.some(st=>o.isUnknown(st))?!1:nt.every(st=>tt.some(at=>{if(at===st)return!0;if(o.isUnknown(at))return!0;if(o.isUnknown(st))return!1;if(o.isNullOnly(at))return o.isNullOnly(st);if(o.isNullOnly(st))return o.isNullable(at);if(o.isNullable(at)&&!o.isNullable(st))return!1;if(o.isBoolean(at))return o.isBoolean(st)&&s(at,st);if(o.isInteger(at))return o.isInteger(st)&&p(at,st);if(o.isNumber(at))return(o.isNumber(st)||o.isInteger(st))&&y(at,st);if(o.isString(at))return o.isString(st)&&C(at,st);if(o.isArray(at))return o.isArray(st)&&L(at,st);if(o.isObject(at))return o.isObject(st)&&z(at,st);if(o.isOneOf(at))return!1}))};const s=(q,et)=>q.enum===void 0||et.enum!==void 0&&q.enum.every(tt=>et.enum.includes(tt)),p=(q,et)=>q.enum!==void 0?et.enum!==void 0&&q.enum.every(tt=>et.enum.includes(tt)):q.type===et.type&&rl.coverNumericRange(q,et),y=(q,et)=>q.enum!==void 0?et.enum!==void 0&&q.enum.every(tt=>et.enum.includes(tt)):(q.type===et.type||q.type==="number"&&et.type==="integer")&&rl.coverNumericRange(q,et),C=(q,et)=>q.enum!==void 0?et.enum!==void 0&&q.enum.every(tt=>et.enum.includes(tt)):[q.type===et.type,q.format===void 0||et.format!==void 0&&N(q.format,et.format),q.pattern===void 0||q.pattern===et.pattern,q.minLength===void 0||et.minLength!==void 0&&q.minLength<=et.minLength,q.maxLength===void 0||et.maxLength!==void 0&&q.maxLength>=et.maxLength].every(tt=>tt),N=(q,et)=>q===et||q==="idn-email"&&et==="email"||q==="idn-hostname"&&et==="hostname"||["uri","iri"].includes(q)&&et==="url"||q==="iri"&&et==="uri"||q==="iri-reference"&&et==="uri-reference",L=(q,et)=>o.covers(q.items,et.items),z=(q,et)=>!q.additionalProperties&&et.additionalProperties||q.additionalProperties&&et.additionalProperties&&typeof q.additionalProperties=="object"&&et.additionalProperties===!0||typeof q.additionalProperties=="object"&&typeof et.additionalProperties=="object"&&!o.covers(q.additionalProperties,et.additionalProperties)?!1:Object.entries(et.properties??{}).every(([tt,nt])=>{var at,Ot,Dt;const st=(at=q.properties)==null?void 0:at[tt];return st===void 0||(((Ot=q.required)==null?void 0:Ot.includes(tt))??!1)===!0&&(((Dt=et.required)==null?void 0:Dt.includes(tt))??!1)===!1?!1:o.covers(st,nt)}),G=q=>o.isOneOf(q)?q.oneOf.flatMap(G):[q];o.isOneOf=q=>q.oneOf!==void 0,o.isObject=q=>q.type==="object",o.isArray=q=>q.type==="array",o.isBoolean=q=>q.type==="boolean",o.isInteger=q=>q.type==="integer",o.isNumber=q=>q.type==="number",o.isString=q=>q.type==="string",o.isNullOnly=q=>q.type==="null",o.isNullable=q=>!o.isUnknown(q)&&(o.isNullOnly(q)||(o.isOneOf(q)?q.oneOf.some(o.isNullable):q.nullable===!0)),o.isUnknown=q=>!o.isOneOf(q)&&q.type===void 0})(Eb||(Eb={}));const _Rn=o=>{if(o.length<2)return!0;if(["boolean","bigint","number","string"].includes(typeof o[0]))return new Set(o).size===o.length;for(let s=0;s<o.length;s++)for(let p=s+1;p<o.length;p++)if(xRn(new WeakMap)(o[s],o[p]))return!1;return!0},xRn=o=>{const s=(p,y)=>{if(p===y)return!0;if(typeof p!=typeof y||typeof p!="object")return!1;if(Array.isArray(p))return Array.isArray(y)&&p.map((C,N)=>s(C,y[N])).every(C=>C);if(p instanceof Set)return y instanceof Set&&p.size===y.size&&[...p].every(C=>y.has(C));if(p instanceof Map)return y instanceof Map&&p.size===y.size&&[...p].every(([C,N])=>y.has(C)&&s(N,y.get(C)));if(p instanceof Boolean)return y instanceof Boolean?p.valueOf()===y.valueOf():p.valueOf()===y;if(p instanceof BigInt)return y instanceof BigInt?p===y:p===BigInt(y);if(p instanceof Number)return y instanceof Number?p.valueOf()===y.valueOf():p.valueOf()===y;if(p instanceof String)return y instanceof String?p.valueOf()===y.valueOf():p.valueOf()===y;if(p instanceof Date)return y instanceof Date&&p.getTime()===y.getTime();if(p instanceof Uint8Array)return y instanceof Uint8Array&&p.length===y.length&&p.every((C,N)=>C===y[N]);if(p instanceof Uint8ClampedArray)return y instanceof Uint8ClampedArray&&p.length===y.length&&p.every((C,N)=>C===y[N]);if(p instanceof Uint16Array)return y instanceof Uint16Array&&p.length===y.length&&p.every((C,N)=>C===y[N]);if(p instanceof Uint32Array)return y instanceof Uint32Array&&p.length===y.length&&p.every((C,N)=>C===y[N]);if(p instanceof BigUint64Array)return y instanceof BigUint64Array&&p.length===y.length&&p.every((C,N)=>C===y[N]);if(p instanceof Int8Array)return y instanceof Int8Array&&p.length===y.length&&p.every((C,N)=>C===y[N]);if(p instanceof Int16Array)return y instanceof Int16Array&&p.length===y.length&&p.every((C,N)=>C===y[N]);if(p instanceof Int32Array)return y instanceof Int32Array&&p.length===y.length&&p.every((C,N)=>C===y[N]);if(p instanceof BigInt64Array)return y instanceof BigInt64Array&&p.length===y.length&&p.every((C,N)=>C===y[N]);if(p instanceof Float32Array)return y instanceof Float32Array&&p.length===y.length&&p.every((C,N)=>C===y[N]);if(p instanceof Float64Array)return y instanceof Float64Array&&p.length===y.length&&p.every((C,N)=>C===y[N]);if(p instanceof ArrayBuffer){if(!(y instanceof ArrayBuffer)||p.byteLength!==y.byteLength)return!1;const C=new Uint8Array(p),N=new Uint8Array(y);return C.every((L,z)=>L===N[z])}else if(p instanceof SharedArrayBuffer){if(!(y instanceof SharedArrayBuffer)||p.byteLength!==y.byteLength)return!1;const C=new Uint8Array(p),N=new Uint8Array(y);return C.every((L,z)=>L===N[z])}else if(p instanceof DataView){if(!(y instanceof DataView)||p.byteLength!==y.byteLength)return!1;const C=new Uint8Array(p.buffer),N=new Uint8Array(y.buffer);return C.every((L,z)=>L===N[z])}else{if(p instanceof File)return y instanceof File&&p.name===y.name&&p.size===y.size&&p.type===y.type&&s(p.slice(),y.slice());if(p!==null&&y!==null){if(o.has(p)&&o.get(p).has(y))return o.get(p).get(y);o.has(p)||o.set(p,new WeakMap),o.get(p).set(y,!0);const C=Object.keys(p).length===Object.keys(y).length&&Object.keys(p).every(N=>s(p[N],y[N]));return o.get(p).set(y,C),C}}return!1};return s};var $Bt;(function(o){o.validate=s=>Array.isArray(s.value)===!1?s.report(s):[s.value.map((p,y)=>O3.validate({...s,schema:s.schema.items,value:p,path:`${s.path}[${y}]`,required:!0})).every(p=>p),s.schema.minItems!==void 0?s.value.length>=s.schema.minItems||s.report({...s,expected:`Array<> & MinItems<${s.schema.minItems}>`}):!0,s.schema.maxItems!==void 0?s.value.length<=s.schema.maxItems||s.report({...s,expected:`Array<> & MaxItems<${s.schema.maxItems}>`}):!0,s.schema.uniqueItems!==void 0&&s.schema.uniqueItems?_Rn(s.value)||s.report({...s,expected:"Array<> & UniqueItems"}):!0].every(p=>p)})($Bt||($Bt={}));var jBt;(function(o){o.validate=s=>typeof s.value=="boolean"||s.report(s)})(jBt||(jBt={}));var HBt;(function(o){o.validate=s=>s.value===s.schema.const||s.report(s)})(HBt||(HBt={}));var zBt;(function(o){o.validate=s=>typeof s.value!="number"||Math.floor(s.value)!==s.value?s.report(s):[s.schema.minimum!==void 0?s.schema.exclusiveMinimum?s.value>s.schema.minimum||s.report({...s,expected:`number & Type<"int32"> & ExclusiveMinimum<${s.schema.minimum}>`}):s.value>=s.schema.minimum||s.report({...s,expected:`number & Type<"int32"> & Minimum<${s.schema.minimum}>`}):!0,s.schema.maximum!==void 0?s.schema.exclusiveMaximum?s.value<s.schema.maximum||s.report({...s,expected:`number & Type<"int32"> & ExclusiveMaximum<${s.schema.maximum}>`}):s.value<=s.schema.maximum||s.report({...s,expected:`number & Type<"int32"> & Maximum<${s.schema.maximum}>`}):!0,s.schema.multipleOf!==void 0?s.value%s.schema.multipleOf===0||s.report({...s,expected:`number & Type<"int32"> & MultipleOf<${s.schema.multipleOf}>`}):!0].every(p=>p)})(zBt||(zBt={}));var UBt;(function(o){o.validate=s=>typeof s.value!="number"?s.report(s):[s.schema.minimum!==void 0?s.schema.exclusiveMinimum?s.value>s.schema.minimum||s.report({...s,expected:`number & ExclusiveMinimum<${s.schema.minimum}>`}):s.value>=s.schema.minimum||s.report({...s,expected:`number & Minimum<${s.schema.minimum}>`}):!0,s.schema.maximum!==void 0?s.schema.exclusiveMaximum?s.value<s.schema.maximum||s.report({...s,expected:`number & ExclusiveMaximum<${s.schema.maximum}>`}):s.value<=s.schema.maximum||s.report({...s,expected:`number & Maximum<${s.schema.maximum}>`}):!0,s.schema.multipleOf!==void 0?s.value%s.schema.multipleOf===0||s.report({...s,expected:`number & MultipleOf<${s.schema.multipleOf}>`}):!0].every(p=>p)})(UBt||(UBt={}));var qBt;(function(o){o.validate=s=>typeof s.value!="object"||s.value===null?s.report(s):[...Object.entries(s.schema.properties??{}).map(([p,y])=>{var C;return O3.validate({...s,schema:y,value:s.value[p],path:s.path+(yP.variable(p)?`.${p}`:`[${JSON.stringify(p)}]`),required:((C=s.schema.required)==null?void 0:C.includes(p))??!1})}),...typeof s.schema.additionalProperties=="object"&&s.schema.additionalProperties!==null?Object.entries(s.value).filter(([p])=>Object.keys(s.schema.properties??{}).includes(p)===!1).map(([p,y])=>O3.validate({...s,schema:s.schema.additionalProperties,value:y,path:s.path+(yP.variable(p)?`.${p}`:`[${JSON.stringify(p)}]`),required:!0})):[]].every(p=>p)})(qBt||(qBt={}));var WBt;(function(o){o.validate=C=>{const N=s(C);for(const L of N.branches)if(L.predicator(C.value))return O3.validate({...C,schema:L.schema});return N.branches.length===0?N.remainders.map(L=>O3.validate({...C,schema:L,exceptionable:!1})).some(L=>L)||C.report(C):o.validate({...C,schema:{oneOf:N.remainders}})};const s=C=>{const N=C.schema.oneOf.map(nt=>KBt({components:C.components,schema:nt,visited:new Set})),L=N.find(nt=>Pr.isUnknown(nt.escaped));if(L)return{branches:[],remainders:[L.schema]};const z=N.filter(nt=>Pr.isNull(nt.schema)),G=N.filter(nt=>Pr.isNull(nt.escaped)===!1);if(G.length===1)return{branches:[{schema:G[0].schema,predicator:nt=>nt!==null}],remainders:z.map(nt=>nt.schema)};const q=G.filter(nt=>Pr.isTuple(nt.escaped)),et=G.filter(nt=>Pr.isArray(nt.escaped)),tt=[...q.length===0&&et.length!==0?p(C,G.filter(nt=>Pr.isArray(nt.schema))):[],...y(C,G.filter(nt=>Pr.isObject(nt.escaped)),q.length+et.length===0)];return{branches:tt,remainders:C.schema.oneOf.filter(nt=>tt.some(st=>st.schema===nt)===!1)}},p=(C,N)=>N.length===1?[{schema:N[0].schema,predicator:L=>Array.isArray(L)}]:N.filter((L,z,G)=>G.every((q,et)=>z===et||!Pr.covers({components:C.components,x:q.escaped.items,y:L.escaped.items}))).map(L=>({schema:L.schema,predicator:z=>Array.isArray(z)&&(z.length===0||O3.validate({...C,schema:L.escaped.items,value:z[0],path:`${C.path}[0]`,exceptionable:!1}))})),y=(C,N,L)=>{if(N.length===1)return[{schema:N[0].schema,predicator:L?G=>typeof G=="object"&&G!==null:G=>typeof G=="object"&&G!==null&&Array.isArray(G)===!1}];N=N.filter(G=>G.escaped.properties!==void 0&&G.escaped.required!==void 0).map(G=>({...G,escaped:{...G.escaped,properties:Object.fromEntries(Object.entries(G.escaped.properties??{}).map(([q,et])=>[q,KBt({components:C.components,schema:et,visited:new Set}).escaped]))}}));const z=new Map;return N.forEach((G,q)=>{var et;for(const[tt,nt]of Object.entries(G.escaped.properties??{}))(et=G.escaped.required)!=null&&et.includes(tt)&&(lC.take(z)(tt)(()=>new Array(N.length).fill(null))[q]=nt)}),N.map((G,q)=>{var st;const et=[];for(const[at,Ot]of Object.entries(G.escaped.properties??{})){if(!((st=G.escaped.required)!=null&&st.includes(at)))continue;const Dt=z.get(at).filter((ie,ae)=>q!==ae).filter(ie=>ie!==null);(Pr.isConstant(Ot)?Dt.every(ie=>Pr.isConstant(ie)&&Ot.const!==ie.const):Dt.length===0)&&et.push(at)}if(et.length===0)return null;const tt=et.find(at=>Pr.isConstant(G.escaped.properties[at]))??et[0],nt=G.escaped.properties[tt];return{schema:G.schema,predicator:Pr.isConstant(nt)?at=>typeof at=="object"&&at!==null&&at[tt]===nt.const:at=>typeof at=="object"&&at!==null&&at[tt]!==void 0}}).filter(G=>G!==null)}})(WBt||(WBt={}));const KBt=o=>{var s;if(Pr.isReference(o.schema)){const p=o.schema.$ref.split("/").pop()??"";return o.visited.has(p)?{schema:o.schema,escaped:{}}:(o.visited.add(p),{...KBt({components:o.components,schema:((s=o.components.schemas)==null?void 0:s[p])??{},visited:o.visited}),schema:o.schema})}return{schema:o.schema,escaped:o.schema}};var GBt;(function(o){o.getName=(z,G=!1)=>Pr.isUnknown(z)?"unknown":Pr.isNull(z)?"null":Pr.isOneOf(z)?z.oneOf.map(q=>o.getName(q,!0)).join(" | "):Pr.isConstant(z)?JSON.stringify(z.const):Pr.isBoolean(z)?"boolean":Pr.isInteger(z)?L(s(z),G):Pr.isNumber(z)?L(p(z),G):Pr.isString(z)?L(y(z),G):Pr.isReference(z)?z.$ref.split("/").pop()??"unknown":Pr.isObject(z)?"__object":Pr.isArray(z)?L(C(z),G):Pr.isTuple(z)?N(z):"unknown";const s=z=>["number",...z.minimum!==void 0?[z.exclusiveMinimum?`tags.ExclusiveMinimum<${z.minimum}>`:`tags.Minimum<${z.minimum}>`]:[],...z.maximum!==void 0?[z.exclusiveMaximum?`tags.ExclusiveMaximum<${z.maximum}>`:`tags.Maximum<${z.maximum}>`]:[],...z.multipleOf!==void 0?[`tags.MultipleOf<${z.multipleOf}>`]:[]],p=z=>["number",...z.minimum!==void 0?[z.exclusiveMinimum?`tags.ExclusiveMinimum<${z.minimum}>`:`tags.Minimum<${z.minimum}>`]:[],...z.maximum!==void 0?[z.exclusiveMaximum?`tags.ExclusiveMaximum<${z.maximum}>`:`tags.Maximum<${z.maximum}>`]:[],...z.multipleOf!==void 0?[`tags.MultipleOf<${z.multipleOf}>`]:[]],y=z=>["string",...z.format!==void 0?[`tags.Format<${JSON.stringify(z.format)}>`]:[],...z.pattern!==void 0&&z.format===void 0?[`tags.Pattern<${JSON.stringify(z.pattern)}>`]:[],...z.contentMediaType!==void 0?[`tags.ContentMediaType<${JSON.stringify(z.contentMediaType)}>`]:[],...z.minLength!==void 0?[`tags.MinLength<${z.minLength}>`]:[],...z.maxLength!==void 0?[`tags.MaxLength<${z.maxLength}>`]:[]],C=z=>[`Array<${o.getName(z.items)}>`,...z.minItems!==void 0?[`tags.MinItems<${z.minItems}>`]:[],...z.maxItems!==void 0?[`tags.MaxItems<${z.maxItems}>`]:[],...z.uniqueItems!==void 0?["tags.UniqueItems"]:[]],N=z=>"["+[...z.prefixItems.map(G=>o.getName(G)),...z.additionalItems===!0?["...Array<unknown>"]:typeof z.additionalItems=="object"&&z.additionalItems!==null?[`...Array<${o.getName(z.additionalItems)}>`]:[]].join(", ")+"]",L=(z,G)=>{const q=z.join(" & ");return G?`(${q})`:q}})(GBt||(GBt={}));const ERn=o=>(BCe.lastIndex=0,BCe.test(o)),BCe=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm,TRn=o=>kRn.test(o),kRn=/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/,SRn=o=>CRn.test(o),CRn=/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(T|\s)([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](?:\.[0-9]{1,9})?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])$/i,ARn=o=>IRn.test(o),IRn=/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,ORn=o=>NRn.test(o),NRn=/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,PRn=o=>LRn.test(o),LRn=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,MRn=o=>RRn.test(o),RRn=/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i,DRn=o=>BRn.test(o),BRn=/^([a-z0-9\u00a1-\uffff0-9]+(-[a-z0-9\u00a1-\uffff0-9]+)*\.)+[a-z\u00a1-\uffff]{2,}$/i,FRn=o=>$Rn.test(o),$Rn=/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,jRn=o=>HRn.test(o),HRn=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,zRn=o=>URn.test(o),URn=/^[A-Za-z][\d+-.A-Za-z]*:[^\u0000-\u0020"<>\\^`{|}]*$/u,qRn=o=>WRn.test(o),WRn=/^[A-Za-z][\d+-.A-Za-z]*:[^\u0000-\u0020"<>\\^`{|}]*$/u,KRn=o=>GRn.test(o),GRn=/^(?:\/(?:[^~/]|~0|~1)*)*$/,YRn=o=>{try{return new RegExp(o),!0}catch{return!1}},VRn=o=>XRn.test(o),XRn=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,QRn=o=>JRn.test(o),JRn=/^([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](?:\.[0-9]{1,9})?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])$/i,ZRn=o=>tDn.test(o)&&eDn.test(o),tDn=/\/|:/,eDn=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,nDn=o=>rDn.test(o),rDn=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,iDn=o=>aDn.test(o),aDn=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,sDn=o=>oDn.test(o),oDn=/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,cDn=o=>uDn.test(o),uDn=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;var YBt;(function(o){o.validate=s=>typeof s.value!="string"?s.report(s):[s.schema.minLength!==void 0?s.value.length>=s.schema.minLength||s.report({...s,expected:`string & MinLength<${s.schema.minLength}>`}):!0,s.schema.maxLength!==void 0?s.value.length<=s.schema.maxLength||s.report({...s,expected:`string & MaxLength<${s.schema.maxLength}>`}):!0,s.schema.pattern!==void 0?new RegExp(s.schema.pattern).test(s.value)||s.report({...s,expected:`string & Pattern<${JSON.stringify(s.schema.pattern)}>`}):!0,s.schema.format&&FCe[s.schema.format]?FCe[s.schema.format](s.value)||s.report({...s,expected:`string & Format<${JSON.stringify(s.schema.format)}>`}):!0].every(p=>p)||s.report(s)})(YBt||(YBt={}));const FCe={byte:ERn,regex:YRn,uuid:cDn,email:ORn,hostname:PRn,"idn-email":MRn,"idn-hostname":DRn,iri:zRn,"iri-reference":qRn,ipv4:FRn,ipv6:jRn,uri:ZRn,"uri-reference":nDn,"uri-template":iDn,url:sDn,"date-time":SRn,date:TRn,time:QRn,duration:ARn,"json-pointer":KRn,"relative-json-pointer":VRn};var VBt;(function(o){o.validate=s=>{if(Array.isArray(s.value)){if(!s.schema.additionalItems)return s.value.length!==s.schema.prefixItems.length?s.report(s):s.value.map((y,C)=>O3.validate({...s,schema:s.schema.prefixItems[C],value:y,path:`${s.path}[${C}]`})).every(y=>y)}else return s.report(s);if(s.value.length<s.schema.prefixItems.length)return s.report(s);const p=typeof s.schema.additionalItems=="object"&&s.schema.additionalItems!==null?(y,C)=>O3.validate({...s,schema:s.schema.additionalItems,value:y,path:`${s.path}[${C}]`}):()=>!0;return s.value.length>=s.schema.prefixItems.length&&s.value.map((y,C)=>C<s.schema.prefixItems.length?O3.validate({...s,schema:s.schema.prefixItems[C],value:y,path:`${s.path}[${C}]`}):p(y,C)).every(y=>y)}})(VBt||(VBt={}));var O3;(function(o){o.validate=(s,p)=>{var y;if(p??(p=(()=>{const C=GBt.getName(s.schema);return s.required?C:`${C} | undefined`})()),Pr.isUnknown(s.schema))return!0;if(s.value===void 0)return s.required===!1||s.report({...s,expected:p});if(Pr.isNull(s.schema))return s.value===null||s.report({...s,expected:p});if(Pr.isReference(s.schema)){const C=(y=s.components.schemas)==null?void 0:y[s.schema.$ref.split("/").pop()??""];return C===void 0?!0:o.validate({...s,schema:C},p)}else{if(Pr.isOneOf(s.schema))return WBt.validate({...s,schema:s.schema,expected:p});if(Pr.isConstant(s.schema))return HBt.validate({...s,schema:s.schema,expected:p});if(Pr.isBoolean(s.schema))return jBt.validate({...s,schema:s.schema,expected:p});if(Pr.isInteger(s.schema))return zBt.validate({...s,schema:s.schema,expected:p});if(Pr.isNumber(s.schema))return UBt.validate({...s,schema:s.schema,expected:p});if(Pr.isString(s.schema))return YBt.validate({...s,schema:s.schema,expected:p});if(Pr.isArray(s.schema))return $Bt.validate({...s,schema:s.schema,expected:p});if(Pr.isTuple(s.schema))return VBt.validate({...s,schema:s.schema,expected:p});if(Pr.isObject(s.schema))return qBt.validate({...s,schema:s.schema,expected:p})}return!0}})(O3||(O3={}));var t$;(function(o){o.create=p=>y=>o.validate({...p,value:y}),o.validate=p=>{const y=[];return O3.validate({...p,path:"$input",exceptionable:!0,report:s(y)}),y.length===0?{success:!0,data:p.value}:{success:!1,data:p.value,errors:y}};const s=p=>{const y=C=>{if(p.length===0)return!0;const N=p[p.length-1].path;return C.length>N.length||N.substring(0,C.length)!==C};return C=>(C.exceptionable&&y(C.path)&&p.push({path:C.path,expected:C.expected,value:C.value}),!1)}})(t$||(t$={}));var t5;(function(o){o.numeric=C=>{if(C===void 0)return{};const N=C.split(`
|
|
55
58
|
`);return mP.emend({minimum:s({type:"number",name:"minimum",lines:N}),maximum:s({type:"number",name:"maximum",lines:N}),exclusiveMinimum:s({type:"number",name:"exclusiveMinimum",lines:N}),exclusiveMaximum:s({type:"number",name:"exclusiveMaximum",lines:N}),multipleOf:s({type:"number",name:"multipleOf",lines:N}),description:p(N,["minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf"])})},o.string=C=>{if(C===void 0)return{};const N=C.split(`
|
|
56
59
|
`);return{format:s({type:"string",name:"format",lines:N}),pattern:s({type:"string",name:"pattern",lines:N}),contentMediaType:s({type:"string",name:"contentMediaType",lines:N}),minLength:s({type:"number",name:"minLength",lines:N}),maxLength:s({type:"number",name:"maxLength",lines:N}),description:p(N,["format","pattern","contentMediaType","minLength","maxLength"])}},o.array=C=>{if(C===void 0)return{};const N=C.split(`
|
|
57
60
|
`);return{minItems:s({type:"number",name:"minItems",lines:N}),maxItems:s({type:"number",name:"maxItems",lines:N}),uniqueItems:s({type:"boolean",name:"uniqueItems",lines:N}),description:p(N,["minItems","maxItems","uniqueItems"])}};const s=C=>{if(C.type==="boolean")return C.lines.some(N=>N.startsWith(`@${C.name}`))?!0:void 0;for(const N of C.lines){if(N.startsWith(`@${C.name} `)===!1)continue;const L=N.replace(`@${C.name} `,"").trim();return C.type==="number"?isNaN(Number(L))?void 0:Number(L):L}},p=(C,N)=>{const L=y(C.map(z=>z.trim()).filter(z=>N.every(G=>z.startsWith(`@${G}`)===!1))).join(`
|
|
58
61
|
`);return L.length===0?void 0:L},y=C=>{let N=0,L=C.length-1;for(;N<C.length&&C[N].trim().length===0;++N);for(;L>=0&&C[L].trim().length===0;--L);return C.slice(N,L+1)}})(t5||(t5={}));var fC;(function(o){o.shiftArray=s=>{const p=[];return s.minItems!==void 0&&(p.push(`@minItems ${s.minItems}`),delete s.minItems),s.maxItems!==void 0&&(p.push(`@maxItems ${s.maxItems}`),delete s.maxItems),s.uniqueItems!==void 0&&(s.uniqueItems===!0&&p.push("@uniqueItems"),delete s.uniqueItems),s.description=UDt({description:s.description,tags:p}),s},o.shiftNumeric=s=>{Object.assign(mP.emend(s));const p=[];return s.minimum!==void 0&&(p.push(`@minimum ${s.minimum}`),delete s.minimum),s.maximum!==void 0&&(p.push(`@maximum ${s.maximum}`),delete s.maximum),s.exclusiveMinimum!==void 0&&(p.push(`@exclusiveMinimum ${s.exclusiveMinimum}`),delete s.exclusiveMinimum),s.exclusiveMaximum!==void 0&&(p.push(`@exclusiveMaximum ${s.exclusiveMaximum}`),delete s.exclusiveMaximum),s.multipleOf!==void 0&&(p.push(`@multipleOf ${s.multipleOf}`),delete s.multipleOf),s.description=UDt({description:s.description,tags:p}),s.default!==void 0&&(p.push(`@default ${s.default}`),delete s.default),s},o.shiftString=s=>{const p=[];return s.minLength!==void 0&&(p.push(`@minLength ${s.minLength}`),delete s.minLength),s.maxLength!==void 0&&(p.push(`@maxLength ${s.maxLength}`),delete s.maxLength),s.format!==void 0&&(p.push(`@format ${s.format}`),delete s.format),s.pattern!==void 0&&(p.push(`@pattern ${s.pattern}`),delete s.pattern),s.contentMediaType!==void 0&&(p.push(`@contentMediaType ${s.contentMediaType}`),delete s.contentMediaType),s.default!==void 0&&(p.push(`@default ${s.default}`),delete s.default),s.description=UDt({description:s.description,tags:p}),s}})(fC||(fC={}));const UDt=o=>{var s;return o.tags.length===0?o.description:[...(s=o.description)!=null&&s.length?[o.description,`
|
|
59
62
|
`]:[],...o.tags].join(`
|
|
60
|
-
`)};var qQ;(function(o){o.parameters=p=>{const y=Pr.unreference(p);return y.success===!1?y:Pr.isObject(y.value)===!1?s({...p,message:"LLM only accepts object type as parameters."}):y.value.additionalProperties?s({...p,message:"LLM does not allow additional properties on parameters."}):{success:!0,value:y.value}};const s=p=>({success:!1,error:{method:p.method,message:"failed to compose LLM schema.",reasons:[{schema:p.schema,message:p.message,accessor:p.accessor??"$input.schema"}]}})})(qQ||(qQ={}));var Qd;(function(o){o.IS_DEFS=!0,o.DEFAULT_CONFIG={reference:!0,constraint:!0},o.parameters=L=>{const z=qQ.parameters({...L,method:"LlmSchemaV3_1Composer.parameters"});if(z.success===!1)return z;const G={},q=o.schema({...L,$defs:G,schema:z.value});return q.success===!1?q:{success:!0,value:{...q.value,additionalProperties:!1,$defs:G,description:Pr.isReference(L.schema)?hC.cascade({prefix:"#/components/schemas/",components:L.components,schema:L.schema,escape:!0}):q.value.description}}},o.schema=L=>{const z=[],G={title:L.schema.title,description:L.schema.description,example:L.schema.example,examples:L.schema.examples,...Object.fromEntries(Object.entries(L.schema).filter(([tt,nt])=>tt.startsWith("x-")&&nt!==void 0))},q=[];if(Pr.visit({closure:(tt,nt)=>{var st;if(L.validate&&q.push(...L.validate(tt,nt)),Pr.isTuple(tt))q.push({schema:tt,accessor:nt,message:"LLM does not allow tuple type."});else if(Pr.isReference(tt)){const at=tt.$ref.split("#/components/schemas/")[1];((st=L.components.schemas)==null?void 0:st[at])===void 0&&q.push({schema:tt,accessor:nt,message:`unable to find reference type ${JSON.stringify(at)}.`})}},components:L.components,schema:L.schema,accessor:L.accessor,refAccessor:L.refAccessor}),q.length>0)return{success:!1,error:{method:"LlmSchemaV3_1Composer.schema",message:"Failed to compose LLM schema of v3.1",reasons:q}};const et=(tt,nt)=>{var st;if(Pr.isOneOf(tt))return tt.oneOf.forEach((at,Ot)=>et(at,`${nt}.oneOf[${Ot}]`)),0;if(Pr.isReference(tt)){const at=tt.$ref.split("#/components/schemas/")[1],Ot=(st=L.components.schemas)==null?void 0:st[at];if(Ot===void 0)return z.push(null);if(L.config.reference===!0||Pr.isRecursiveReference({components:L.components,schema:tt})){const Dt=()=>z.push({...tt,$ref:`#/$defs/${at}`});if(L.$defs[at]!==void 0)return Dt();L.$defs[at]={};const St=o.schema({config:L.config,components:L.components,$defs:L.$defs,schema:Ot,refAccessor:L.refAccessor,accessor:`${L.refAccessor??"$def"}[${JSON.stringify(at)}]`});return St.success===!1?z.push(null):(L.$defs[at]=St.value,Dt())}else{const Dt=z.length;return et(Ot,nt),Dt===z.length-1&&z[z.length-1]!==null?z[z.length-1]={...z[z.length-1],description:hC.cascade({prefix:"#/components/schemas/",components:L.components,schema:tt,escape:!0})}:G.description=hC.cascade({prefix:"#/components/schemas/",components:L.components,schema:tt,escape:!0}),z.length}}else if(Pr.isObject(tt)){const at=Object.entries(tt.properties??{}).reduce((Dt,[St,ie])=>{const ae=o.schema({config:L.config,components:L.components,$defs:L.$defs,schema:ie,refAccessor:L.refAccessor,accessor:`${nt}.properties[${JSON.stringify(St)}]`});return Dt[St]=ae.success?ae.value:null,ae.success===!1&&q.push(...ae.error.reasons),Dt},{});if(Object.values(at).some(Dt=>Dt===null))return z.push(null);const Ot=(()=>{if(typeof tt.additionalProperties=="object"&&tt.additionalProperties!==null){const Dt=o.schema({config:L.config,components:L.components,$defs:L.$defs,schema:tt.additionalProperties,refAccessor:L.refAccessor,accessor:`${nt}.additionalProperties`});return Dt.success===!1?(q.push(...Dt.error.reasons),null):Dt.value}return tt.additionalProperties})();return Ot===null?z.push(null):z.push({...tt,properties:at,additionalProperties:Ot,required:tt.required??[]})}else if(Pr.isArray(tt)){const at=o.schema({config:L.config,components:L.components,$defs:L.$defs,schema:tt.items,refAccessor:L.refAccessor,accessor:`${nt}.items`});return at.success===!1?(q.push(...at.error.reasons),z.push(null)):z.push((L.config.constraint?Ot=>Ot:Ot=>fC.shiftArray(Ot))({...tt,items:at.value}))}else return Pr.isString(tt)?z.push((L.config.constraint?at=>at:at=>fC.shiftString(at))({...tt})):Pr.isNumber(tt)||Pr.isInteger(tt)?z.push((L.config.constraint?at=>at:at=>fC.shiftNumeric(at))({...tt})):Pr.isTuple(tt)?z.push(null):z.push({...tt})};return et(L.schema,L.accessor??"$input.schema"),z.some(tt=>tt===null)?{success:!1,error:{method:"LlmSchemaV3_1Composer.schema",message:"Failed to compose LLM schema of v3.1",reasons:q}}:z.length===0?{success:!0,value:{...G,type:void 0}}:z.length===1?{success:!0,value:{...G,...z[0]}}:{success:!0,value:{...G,oneOf:z.filter(tt=>tt!==null),discriminator:Pr.isOneOf(L.schema)&&L.schema.discriminator!==void 0&&z.filter(tt=>tt!==null).every(tt=>xf.isReference(tt)||xf.isNull(tt))?{propertyName:L.schema.discriminator.propertyName,mapping:L.schema.discriminator.mapping!==void 0?Object.fromEntries(Object.entries(L.schema.discriminator.mapping).map(([tt,nt])=>[tt,`#/$defs/${nt.split("/").at(-1)}`])):void 0}:void 0}}},o.separateParameters=L=>{const z=L.convention??((tt,nt)=>`${tt}.${yP.capitalize(nt)}`),[G,q]=y({$defs:L.parameters.$defs,schema:L.parameters,predicate:L.predicate,convention:z});if(G===null||q===null)return{llm:G??{type:"object",properties:{},additionalProperties:!1,required:[],$defs:{}},human:q};const et={llm:{...G,$defs:Object.fromEntries(Object.entries(L.parameters.$defs).filter(([tt])=>tt.endsWith(".Llm"))),additionalProperties:!1},human:{...q,$defs:Object.fromEntries(Object.entries(L.parameters.$defs).filter(([tt])=>tt.endsWith(".Human"))),additionalProperties:!1}};for(const tt of Object.keys(L.parameters.$defs))tt.endsWith(".Llm")===!1&&tt.endsWith(".Human")===!1&&delete L.parameters.$defs[tt];if(Object.keys(et.llm.properties).length!==0){const tt={};et.validate=t$.create({components:tt,schema:o.invert({components:tt,schema:et.llm,$defs:et.llm.$defs}),required:!0})}return et};const s=L=>L.predicate(L.schema)===!0?[null,L.schema]:xf.isUnknown(L.schema)||xf.isOneOf(L.schema)?[L.schema,null]:xf.isObject(L.schema)?y({predicate:L.predicate,convention:L.convention,$defs:L.$defs,schema:L.schema}):xf.isArray(L.schema)?p({predicate:L.predicate,convention:L.convention,$defs:L.$defs,schema:L.schema}):xf.isReference(L.schema)?C({predicate:L.predicate,convention:L.convention,$defs:L.$defs,schema:L.schema}):[L.schema,null],p=L=>{const[z,G]=s({predicate:L.predicate,convention:L.convention,$defs:L.$defs,schema:L.schema.items});return[z!==null?{...L.schema,items:z}:null,G!==null?{...L.schema,items:G}:null]},y=L=>{if(Object.keys(L.schema.properties??{}).length===0&&!L.schema.additionalProperties)return[L.schema,null];const z={...L.schema,properties:{},additionalProperties:L.schema.additionalProperties},G={...L.schema,properties:{}};for(const[q,et]of Object.entries(L.schema.properties??{})){const[tt,nt]=s({predicate:L.predicate,convention:L.convention,$defs:L.$defs,schema:et});tt!==null&&(z.properties[q]=tt),nt!==null&&(G.properties[q]=nt)}if(typeof L.schema.additionalProperties=="object"&&L.schema.additionalProperties!==null){const[q,et]=s({predicate:L.predicate,convention:L.convention,$defs:L.$defs,schema:L.schema.additionalProperties});z.additionalProperties=q??!1,G.additionalProperties=et??!1}return[Object.keys(z.properties).length||z.additionalProperties?N(z):null,Object.keys(G.properties).length||G.additionalProperties?N(G):null]},C=L=>{var st,at,Ot,Dt,St;const z=L.schema.$ref.split("#/$defs/")[1],G=L.convention(z,"human"),q=L.convention(z,"llm");if((st=L.$defs)!=null&&st[G]||(at=L.$defs)!=null&&at[q])return[(Ot=L.$defs)!=null&&Ot[q]?{...L.schema,$ref:`#/$defs/${q}`}:null,(Dt=L.$defs)!=null&&Dt[G]?{...L.schema,$ref:`#/$defs/${G}`}:null];L.$defs[q]={},L.$defs[G]={};const et=(St=L.$defs)==null?void 0:St[z],[tt,nt]=s({predicate:L.predicate,convention:L.convention,$defs:L.$defs,schema:et});return tt===null||nt===null?(delete L.$defs[q],delete L.$defs[G],tt===null?[null,L.schema]:[L.schema,null]):[tt!==null?{...L.schema,$ref:`#/$defs/${q}`}:null,nt!==null?{...L.schema,$ref:`#/$defs/${G}`}:null]},N=L=>(L.required!==void 0&&(L.required=L.required.filter(z=>{var G;return((G=L.properties)==null?void 0:G[z])!==void 0})),L);o.invert=L=>{var q;var z;const G=et=>o.invert({components:L.components,$defs:L.$defs,schema:et});if(xf.isArray(L.schema))return{...L.schema,...t5.array(L.schema.description),items:G(L.schema.items)};if(xf.isObject(L.schema))return{...L.schema,properties:L.schema.properties?Object.fromEntries(Object.entries(L.schema.properties).map(([et,tt])=>[et,G(tt)])):void 0,additionalProperties:typeof L.schema.additionalProperties=="object"&&L.schema.additionalProperties!==null?G(L.schema.additionalProperties):L.schema.additionalProperties};if(xf.isReference(L.schema)){const et=L.schema.$ref.split("#/$defs/").at(-1)??"";return((q=L.components.schemas)==null?void 0:q[et])===void 0&&((z=L.components).schemas??(z.schemas={}),L.components.schemas[et]={},L.components.schemas[et]=G(L.$defs[et]??{})),{...L.schema,$ref:`#/components/schemas/${et}`}}else{if(xf.isOneOf(L.schema))return{...L.schema,oneOf:L.schema.oneOf.map(G),discriminator:L.schema.discriminator!==void 0?{propertyName:L.schema.discriminator.propertyName,mapping:L.schema.discriminator.mapping!==void 0?Object.fromEntries(Object.entries(L.schema.discriminator.mapping).map(([et,tt])=>[et,`#/components/schemas/${tt.split("/").at(-1)}`])):void 0}:void 0};if(xf.isInteger(L.schema)||xf.isNumber(L.schema))return{...L.schema,...t5.numeric(L.schema.description)};if(xf.isString(L.schema))return{...L.schema,...t5.string(L.schema.description)}}return L.schema}})(Qd||(Qd={}));var gC;(function(o){o.IS_DEFS=!0,o.DEFAULT_CONFIG={reference:!0,strict:!1},o.parameters=G=>{var q;(q=G.config).strict??(q.strict=!1);const et=Qd.parameters({...G,config:{reference:G.config.reference,constraint:!1},validate:G.config.strict===!0?s:void 0});if(et.success===!1)return et;for(const tt of Object.keys(et.value.$defs))et.value.$defs[tt]=p({config:G.config,schema:et.value.$defs[tt]});return{success:!0,value:p({config:G.config,schema:et.value})}},o.schema=G=>{var q;(q=G.config).strict??(q.strict=!1);const et=new Set(Object.keys(G.$defs)),tt=Qd.schema({...G,config:{reference:G.config.reference,constraint:!1},validate:G.config.strict===!0?s:void 0});if(tt.success===!1)return tt;for(const nt of Object.keys(G.$defs))et.has(nt)===!1&&(G.$defs[nt]=p({config:G.config,schema:G.$defs[nt]}));return{success:!0,value:p({config:G.config,schema:tt.value})}};const s=(G,q)=>{var tt;const et=[];if(Pr.isObject(G)){G.additionalProperties&&et.push({schema:G,accessor:`${q}.additionalProperties`,message:"ChatGPT does not allow additionalProperties in strict mode, the dynamic key typed object."});for(const nt of Object.keys(G.properties??{}))((tt=G.required)==null?void 0:tt.includes(nt))===!1&&et.push({schema:G,accessor:`${q}.properties.${nt}`,message:"ChatGPT does not allow optional properties in strict mode."})}return et},p=G=>{const q=[],et={title:G.schema.title,description:G.schema.description,example:G.schema.example,examples:G.schema.examples,...Object.fromEntries(Object.entries(o.schema).filter(([st,at])=>st.startsWith("x-")&&at!==void 0))},tt=st=>{xf.isOneOf(st)?st.oneOf.forEach(tt):xf.isArray(st)?q.push({...st,items:p({config:G.config,schema:st.items})}):xf.isObject(st)?q.push({...st,properties:Object.fromEntries(Object.entries(st.properties).map(([at,Ot])=>[at,p({config:G.config,schema:Ot})])),additionalProperties:G.config.strict===!0?!1:typeof st.additionalProperties=="object"&&st.additionalProperties!==null?p({config:G.config,schema:st.additionalProperties}):st.additionalProperties,description:hC.take(st)}):xf.isConstant(st)===!1&&q.push(st)},nt=st=>{const at=Ot=>{const Dt=q.find(St=>(St==null?void 0:St.type)===typeof Ot);Dt!==void 0?(Dt.enum??(Dt.enum=[]),Dt.enum.push(Ot)):q.push({type:typeof Ot,enum:[Ot]})};Pr.isConstant(st)?at(st.const):Pr.isOneOf(st)&&st.oneOf.forEach(Ot=>nt(Ot))};return tt(G.schema),nt(G.schema),q.length===0?{...et,type:void 0}:q.length===1?{...et,...q[0],description:O1.isReference(q[0])?void 0:q[0].description??et.description}:{...et,anyOf:q.map(st=>({...st,description:O1.isReference(st)?void 0:st.description})),"x-discriminator":xf.isOneOf(G.schema)&&G.schema.discriminator!==void 0&&G.schema.oneOf.length===q.length&&q.every(st=>O1.isReference(st)||O1.isNull(st))?G.schema.discriminator:void 0}};o.separateParameters=G=>{const q=G.convention??((st,at)=>`${st}.${yP.capitalize(at)}`),[et,tt]=N({predicate:G.predicate,convention:q,$defs:G.parameters.$defs,schema:G.parameters});if(et===null||tt===null)return{llm:et??{type:"object",properties:{},required:[],additionalProperties:!1,$defs:{}},human:tt};const nt={llm:{...et,$defs:Object.fromEntries(Object.entries(G.parameters.$defs).filter(([st])=>st.endsWith(".Llm"))),additionalProperties:!1},human:{...tt,$defs:Object.fromEntries(Object.entries(G.parameters.$defs).filter(([st])=>st.endsWith(".Human"))),additionalProperties:!1}};for(const st of Object.keys(G.parameters.$defs))st.endsWith(".Llm")===!1&&st.endsWith(".Human")===!1&&delete G.parameters.$defs[st];if(Object.keys(nt.llm.properties).length!==0){const st={};nt.validate=t$.create({components:st,schema:o.invert({components:st,schema:nt.llm,$defs:nt.llm.$defs}),required:!0})}return nt};const y=G=>G.predicate(G.schema)===!0?[null,G.schema]:O1.isUnknown(G.schema)||O1.isAnyOf(G.schema)?[G.schema,null]:O1.isObject(G.schema)?N({predicate:G.predicate,convention:G.convention,$defs:G.$defs,schema:G.schema}):O1.isArray(G.schema)?C({predicate:G.predicate,convention:G.convention,$defs:G.$defs,schema:G.schema}):O1.isReference(G.schema)?L({predicate:G.predicate,convention:G.convention,$defs:G.$defs,schema:G.schema}):[G.schema,null],C=G=>{const[q,et]=y({predicate:G.predicate,convention:G.convention,$defs:G.$defs,schema:G.schema.items});return[q!==null?{...G.schema,items:q}:null,et!==null?{...G.schema,items:et}:null]},N=G=>{if(Object.keys(G.schema.properties??{}).length===0&&!G.schema.additionalProperties)return[G.schema,null];const q={...G.schema,properties:{},additionalProperties:G.schema.additionalProperties},et={...G.schema,properties:{}};for(const[tt,nt]of Object.entries(G.schema.properties??{})){const[st,at]=y({predicate:G.predicate,convention:G.convention,$defs:G.$defs,schema:nt});st!==null&&(q.properties[tt]=st),at!==null&&(et.properties[tt]=at)}if(typeof G.schema.additionalProperties=="object"&&G.schema.additionalProperties!==null){const[tt,nt]=y({predicate:G.predicate,convention:G.convention,$defs:G.$defs,schema:G.schema.additionalProperties});q.additionalProperties=tt??!1,et.additionalProperties=nt??!1}return[Object.keys(q.properties).length||q.additionalProperties?z(q):null,Object.keys(et.properties).length||et.additionalProperties?z(et):null]},L=G=>{var Ot,Dt,St,ie,ae;const q=G.schema.$ref.split("#/$defs/")[1],et=G.convention(q,"human"),tt=G.convention(q,"llm");if((Ot=G.$defs)!=null&&Ot[et]||(Dt=G.$defs)!=null&&Dt[tt])return[(St=G.$defs)!=null&&St[tt]?{...G.schema,$ref:`#/$defs/${tt}`}:null,(ie=G.$defs)!=null&&ie[et]?{...G.schema,$ref:`#/$defs/${et}`}:null];G.$defs[tt]={},G.$defs[et]={};const nt=(ae=G.$defs)==null?void 0:ae[q],[st,at]=y({predicate:G.predicate,convention:G.convention,$defs:G.$defs,schema:nt});return st===null||at===null?(delete G.$defs[tt],delete G.$defs[et],st===null?[null,G.schema]:[G.schema,null]):[st!==null?{...G.schema,$ref:`#/$defs/${tt}`}:null,at!==null?{...G.schema,$ref:`#/$defs/${et}`}:null]},z=G=>(G.required=G.required.filter(q=>{var et;return((et=G.properties)==null?void 0:et[q])!==void 0}),G);o.invert=G=>{const q=[],et={title:G.schema.title,description:G.schema.description,...Object.fromEntries(Object.entries(G.schema).filter(([st,at])=>st.startsWith("x-")&&at!==void 0)),example:G.schema.example,examples:G.schema.examples},tt=st=>o.invert({components:G.components,$defs:G.$defs,schema:st}),nt=st=>{var Ot,Dt,St,ie;var at;if(O1.isArray(st))q.push({...st,...t5.array(st.description),items:tt(st.items)});else if(O1.isObject(st))q.push({...st,properties:Object.fromEntries(Object.entries(st.properties).map(([ae,Ne])=>[ae,tt(Ne)])),additionalProperties:typeof st.additionalProperties=="object"&&st.additionalProperties!==null?tt(st.additionalProperties):st.additionalProperties});else if(O1.isAnyOf(st))st.anyOf.forEach(nt);else if(O1.isReference(st)){const ae=st.$ref.split("#/$defs/")[1];((Ot=G.components.schemas)==null?void 0:Ot[ae])===void 0&&((at=G.components).schemas??(at.schemas={}),G.components.schemas[ae]={},G.components.schemas[ae]=tt(G.$defs[ae]??{})),q.push({...st,$ref:`#/components/schemas/${ae}`})}else O1.isBoolean(st)?(Dt=st.enum)!=null&&Dt.length?st.enum.forEach(ae=>q.push({const:ae})):q.push(st):O1.isInteger(st)||O1.isNumber(st)?(St=st.enum)!=null&&St.length?st.enum.forEach(ae=>q.push({const:ae})):q.push({...st,...t5.numeric(st.description),enum:void 0}):O1.isString(st)?(ie=st.enum)!=null&&ie.length?st.enum.forEach(ae=>q.push({const:ae})):q.push({...st,...t5.string(st.description),enum:void 0}):q.push({...st})};return nt(G.schema),{...et,...q.length===0?{type:void 0}:q.length===1?{...q[0]}:{oneOf:q.map(st=>({...st,nullable:void 0})),discriminator:O1.isAnyOf(G.schema)&&G.schema["x-discriminator"]!==void 0?{property:G.schema["x-discriminator"],mapping:G.schema["x-discriminator"].mapping!==void 0?Object.fromEntries(Object.entries(G.schema["x-discriminator"].mapping).map(([st,at])=>[st,`#/components/schemas/${at.split("/").at(-1)}`])):void 0}:void 0}}}})(gC||(gC={}));var bC;(function(o){o.IS_DEFS=!0,o.DEFAULT_CONFIG={reference:!0},o.parameters=s=>Qd.parameters({...s,config:{reference:s.config.reference,constraint:!0}}),o.schema=s=>Qd.schema({...s,config:{reference:s.config.reference,constraint:!0}}),o.separateParameters=s=>Qd.separateParameters(s),o.invert=s=>Qd.invert(s)})(bC||(bC={}));var mC;(function(o){o.IS_DEFS=!0,o.DEFAULT_CONFIG={reference:!0},o.parameters=s=>Qd.parameters({...s,config:{reference:s.config.reference,constraint:!0}}),o.schema=s=>Qd.schema({...s,config:{reference:s.config.reference,constraint:!0}}),o.separateParameters=s=>Qd.separateParameters(s),o.invert=s=>Qd.invert(s)})(mC||(mC={}));var e5;(function(o){o.IS_DEFS=!1,o.DEFAULT_CONFIG={recursive:3,constraint:!0},o.parameters=N=>{const L=qQ.parameters({...N,method:"LlmSchemaV3Composer.parameters"});if(L.success===!1)return L;const z=o.schema(N);return z.success===!1?z:{success:!0,value:{...z.value,additionalProperties:!1}}},o.schema=N=>{const L=[];if(Pr.visit({closure:(q,et)=>{var tt;if(N.validate&&L.push(...N.validate(q,et)),Pr.isTuple(q))L.push({accessor:et,schema:q,message:"LLM does not allow tuple type."});else if(Pr.isReference(q)){const nt=q.$ref.split("#/components/schemas/")[1];((tt=N.components.schemas)==null?void 0:tt[nt])===void 0&&L.push({schema:q,message:`${et}: unable to find reference type ${JSON.stringify(nt)}.`,accessor:et})}},components:N.components,schema:N.schema,accessor:N.accessor,refAccessor:N.refAccessor}),L.length>0)return{success:!1,error:{method:"LlmSchemaV3Composer.schema",message:"Failed to compose LLM schema of v3",reasons:L}};const z=Pr.escape({...N,recursive:N.config.recursive});if(z.success===!1)return{success:!1,error:{method:"LlmSchemaV3Composer.schema",message:"Failed to compose LLM schema of v3",reasons:z.error.reasons}};const G=vmt.downgradeSchema({original:{schemas:{}},downgraded:{}})(z.value);return Eb.visit({closure:q=>{Eb.isOneOf(q)&&q.discriminator!==void 0?delete q.discriminator:Eb.isObject(q)&&(q.properties??(q.properties={}),q.required??(q.required=[])),N.config.constraint===!1&&(Eb.isInteger(q)||Eb.isNumber(q)?fC.shiftNumeric(q):Eb.isString(q)?fC.shiftString(q):Eb.isArray(q)&&fC.shiftArray(q))},schema:G}),{success:!0,value:G}},o.separateParameters=N=>{const[L,z]=y({predicate:N.predicate,schema:N.parameters});return{llm:L??{type:"object",properties:{},additionalProperties:!1,required:[]},human:z,validate:L?t$.create({components:{},schema:o.invert({schema:L}),required:!0}):void 0}};const s=N=>N.predicate(N.schema)===!0?[null,N.schema]:Eb.isUnknown(N.schema)||Eb.isOneOf(N.schema)?[N.schema,null]:Eb.isObject(N.schema)?y({predicate:N.predicate,schema:N.schema}):Eb.isArray(N.schema)?p({predicate:N.predicate,schema:N.schema}):[N.schema,null],p=N=>{const[L,z]=s({predicate:N.predicate,schema:N.schema.items});return[L!==null?{...N.schema,items:L}:null,z!==null?{...N.schema,items:z}:null]},y=N=>{if(Object.keys(N.schema.properties??{}).length===0&&!N.schema.additionalProperties)return[N.schema,null];const L={...N.schema,properties:{},additionalProperties:N.schema.additionalProperties},z={...N.schema,properties:{},additionalProperties:N.schema.additionalProperties};for(const[G,q]of Object.entries(N.schema.properties??{})){const[et,tt]=s({predicate:N.predicate,schema:q});et!==null&&(L.properties[G]=et),tt!==null&&(z.properties[G]=tt)}if(typeof N.schema.additionalProperties=="object"&&N.schema.additionalProperties!==null){const[G,q]=s({predicate:N.predicate,schema:N.schema.additionalProperties});L.additionalProperties=G??!1,z.additionalProperties=q??!1}return[Object.keys(L.properties).length||L.additionalProperties?C(L):null,Object.keys(z.properties).length||z.additionalProperties?C(z):null]},C=N=>(N.required=N.required.filter(L=>N.properties[L]!==void 0),N);o.invert=N=>{const L=_mt.convertSchema({})(N.schema);return Pr.visit({closure:z=>{Pr.isArray(z)?Object.assign(z,{...z,...t5.array(z.description)}):Pr.isInteger(z)||Pr.isNumber(z)?Object.assign(z,{...z,...t5.numeric(z.description)}):Pr.isString(z)&&Object.assign(z,{...z,...t5.string(z.description)})},components:{},schema:L}),L}})(e5||(e5={}));var yC;(function(o){o.IS_DEFS=!1,o.DEFAULT_CONFIG={recursive:3},o.parameters=s=>{const p=qQ.parameters({...s,method:"GeminiSchemaComposer.parameters"});return p.success===!1?p:o.schema(s)},o.schema=s=>{const p=e5.schema({...s,config:{recursive:s.config.recursive,constraint:!1},validate:(y,C)=>{if(Pr.isObject(y)){if(y.additionalProperties)return[{schema:y,accessor:`${C}.additionalProperties`,message:"Gemini does not allow additionalProperties."}]}else if(Pr.isOneOf(y)&&uDn(s.components)(y))return[{schema:y,accessor:C,message:"Gemini does not allow union type."}];return[]}});return p.success===!1||Eb.visit({schema:p.value,closure:y=>{if(y.title!==void 0){if(y.description===void 0)y.description=y.title;else{const C=y.title.endsWith(".")?y.title.substring(0,y.title.length-1):y.title;y.description=y.description.startsWith(C)?y.description:`${C}.
|
|
63
|
+
`)};var qQ;(function(o){o.parameters=p=>{const y=Pr.unreference(p);return y.success===!1?y:Pr.isObject(y.value)===!1?s({...p,message:"LLM only accepts object type as parameters."}):y.value.additionalProperties?s({...p,message:"LLM does not allow additional properties on parameters."}):{success:!0,value:y.value}};const s=p=>({success:!1,error:{method:p.method,message:"failed to compose LLM schema.",reasons:[{schema:p.schema,message:p.message,accessor:p.accessor??"$input.schema"}]}})})(qQ||(qQ={}));var Qd;(function(o){o.IS_DEFS=!0,o.DEFAULT_CONFIG={reference:!0,constraint:!0},o.parameters=L=>{const z=qQ.parameters({...L,method:"LlmSchemaV3_1Composer.parameters"});if(z.success===!1)return z;const G={},q=o.schema({...L,$defs:G,schema:z.value});return q.success===!1?q:{success:!0,value:{...q.value,additionalProperties:!1,$defs:G,description:Pr.isReference(L.schema)?hC.cascade({prefix:"#/components/schemas/",components:L.components,schema:L.schema,escape:!0}):q.value.description}}},o.schema=L=>{const z=[],G={title:L.schema.title,description:L.schema.description,example:L.schema.example,examples:L.schema.examples,...Object.fromEntries(Object.entries(L.schema).filter(([tt,nt])=>tt.startsWith("x-")&&nt!==void 0))},q=[];if(Pr.visit({closure:(tt,nt)=>{var st;if(L.validate&&q.push(...L.validate(tt,nt)),Pr.isTuple(tt))q.push({schema:tt,accessor:nt,message:"LLM does not allow tuple type."});else if(Pr.isReference(tt)){const at=tt.$ref.split("#/components/schemas/")[1];((st=L.components.schemas)==null?void 0:st[at])===void 0&&q.push({schema:tt,accessor:nt,message:`unable to find reference type ${JSON.stringify(at)}.`})}},components:L.components,schema:L.schema,accessor:L.accessor,refAccessor:L.refAccessor}),q.length>0)return{success:!1,error:{method:"LlmSchemaV3_1Composer.schema",message:"Failed to compose LLM schema of v3.1",reasons:q}};const et=(tt,nt)=>{var st;if(Pr.isOneOf(tt))return tt.oneOf.forEach((at,Ot)=>et(at,`${nt}.oneOf[${Ot}]`)),0;if(Pr.isReference(tt)){const at=tt.$ref.split("#/components/schemas/")[1],Ot=(st=L.components.schemas)==null?void 0:st[at];if(Ot===void 0)return z.push(null);if(L.config.reference===!0||Pr.isRecursiveReference({components:L.components,schema:tt})){const Dt=()=>z.push({...tt,$ref:`#/$defs/${at}`});if(L.$defs[at]!==void 0)return Dt();L.$defs[at]={};const St=o.schema({config:L.config,components:L.components,$defs:L.$defs,schema:Ot,refAccessor:L.refAccessor,accessor:`${L.refAccessor??"$def"}[${JSON.stringify(at)}]`});return St.success===!1?z.push(null):(L.$defs[at]=St.value,Dt())}else{const Dt=z.length;return et(Ot,nt),Dt===z.length-1&&z[z.length-1]!==null?z[z.length-1]={...z[z.length-1],description:hC.cascade({prefix:"#/components/schemas/",components:L.components,schema:tt,escape:!0})}:G.description=hC.cascade({prefix:"#/components/schemas/",components:L.components,schema:tt,escape:!0}),z.length}}else if(Pr.isObject(tt)){const at=Object.entries(tt.properties??{}).reduce((Dt,[St,ie])=>{const ae=o.schema({config:L.config,components:L.components,$defs:L.$defs,schema:ie,refAccessor:L.refAccessor,accessor:`${nt}.properties[${JSON.stringify(St)}]`});return Dt[St]=ae.success?ae.value:null,ae.success===!1&&q.push(...ae.error.reasons),Dt},{});if(Object.values(at).some(Dt=>Dt===null))return z.push(null);const Ot=(()=>{if(typeof tt.additionalProperties=="object"&&tt.additionalProperties!==null){const Dt=o.schema({config:L.config,components:L.components,$defs:L.$defs,schema:tt.additionalProperties,refAccessor:L.refAccessor,accessor:`${nt}.additionalProperties`});return Dt.success===!1?(q.push(...Dt.error.reasons),null):Dt.value}return tt.additionalProperties})();return Ot===null?z.push(null):z.push({...tt,properties:at,additionalProperties:Ot,required:tt.required??[]})}else if(Pr.isArray(tt)){const at=o.schema({config:L.config,components:L.components,$defs:L.$defs,schema:tt.items,refAccessor:L.refAccessor,accessor:`${nt}.items`});return at.success===!1?(q.push(...at.error.reasons),z.push(null)):z.push((L.config.constraint?Ot=>Ot:Ot=>fC.shiftArray(Ot))({...tt,items:at.value}))}else return Pr.isString(tt)?z.push((L.config.constraint?at=>at:at=>fC.shiftString(at))({...tt})):Pr.isNumber(tt)||Pr.isInteger(tt)?z.push((L.config.constraint?at=>at:at=>fC.shiftNumeric(at))({...tt})):Pr.isTuple(tt)?z.push(null):z.push({...tt})};return et(L.schema,L.accessor??"$input.schema"),z.some(tt=>tt===null)?{success:!1,error:{method:"LlmSchemaV3_1Composer.schema",message:"Failed to compose LLM schema of v3.1",reasons:q}}:z.length===0?{success:!0,value:{...G,type:void 0}}:z.length===1?{success:!0,value:{...G,...z[0]}}:{success:!0,value:{...G,oneOf:z.filter(tt=>tt!==null),discriminator:Pr.isOneOf(L.schema)&&L.schema.discriminator!==void 0&&z.filter(tt=>tt!==null).every(tt=>xf.isReference(tt)||xf.isNull(tt))?{propertyName:L.schema.discriminator.propertyName,mapping:L.schema.discriminator.mapping!==void 0?Object.fromEntries(Object.entries(L.schema.discriminator.mapping).map(([tt,nt])=>[tt,`#/$defs/${nt.split("/").at(-1)}`])):void 0}:void 0}}},o.separateParameters=L=>{const z=L.convention??((tt,nt)=>`${tt}.${yP.capitalize(nt)}`),[G,q]=y({$defs:L.parameters.$defs,schema:L.parameters,predicate:L.predicate,convention:z});if(G===null||q===null)return{llm:G??{type:"object",properties:{},additionalProperties:!1,required:[],$defs:{}},human:q};const et={llm:{...G,$defs:Object.fromEntries(Object.entries(L.parameters.$defs).filter(([tt])=>tt.endsWith(".Llm"))),additionalProperties:!1},human:{...q,$defs:Object.fromEntries(Object.entries(L.parameters.$defs).filter(([tt])=>tt.endsWith(".Human"))),additionalProperties:!1}};for(const tt of Object.keys(L.parameters.$defs))tt.endsWith(".Llm")===!1&&tt.endsWith(".Human")===!1&&delete L.parameters.$defs[tt];if(Object.keys(et.llm.properties).length!==0){const tt={};et.validate=t$.create({components:tt,schema:o.invert({components:tt,schema:et.llm,$defs:et.llm.$defs}),required:!0})}return et};const s=L=>L.predicate(L.schema)===!0?[null,L.schema]:xf.isUnknown(L.schema)||xf.isOneOf(L.schema)?[L.schema,null]:xf.isObject(L.schema)?y({predicate:L.predicate,convention:L.convention,$defs:L.$defs,schema:L.schema}):xf.isArray(L.schema)?p({predicate:L.predicate,convention:L.convention,$defs:L.$defs,schema:L.schema}):xf.isReference(L.schema)?C({predicate:L.predicate,convention:L.convention,$defs:L.$defs,schema:L.schema}):[L.schema,null],p=L=>{const[z,G]=s({predicate:L.predicate,convention:L.convention,$defs:L.$defs,schema:L.schema.items});return[z!==null?{...L.schema,items:z}:null,G!==null?{...L.schema,items:G}:null]},y=L=>{if(Object.keys(L.schema.properties??{}).length===0&&!L.schema.additionalProperties)return[L.schema,null];const z={...L.schema,properties:{},additionalProperties:L.schema.additionalProperties},G={...L.schema,properties:{}};for(const[q,et]of Object.entries(L.schema.properties??{})){const[tt,nt]=s({predicate:L.predicate,convention:L.convention,$defs:L.$defs,schema:et});tt!==null&&(z.properties[q]=tt),nt!==null&&(G.properties[q]=nt)}if(typeof L.schema.additionalProperties=="object"&&L.schema.additionalProperties!==null){const[q,et]=s({predicate:L.predicate,convention:L.convention,$defs:L.$defs,schema:L.schema.additionalProperties});z.additionalProperties=q??!1,G.additionalProperties=et??!1}return[Object.keys(z.properties).length||z.additionalProperties?N(z):null,Object.keys(G.properties).length||G.additionalProperties?N(G):null]},C=L=>{var st,at,Ot,Dt,St;const z=L.schema.$ref.split("#/$defs/")[1],G=L.convention(z,"human"),q=L.convention(z,"llm");if((st=L.$defs)!=null&&st[G]||(at=L.$defs)!=null&&at[q])return[(Ot=L.$defs)!=null&&Ot[q]?{...L.schema,$ref:`#/$defs/${q}`}:null,(Dt=L.$defs)!=null&&Dt[G]?{...L.schema,$ref:`#/$defs/${G}`}:null];L.$defs[q]={},L.$defs[G]={};const et=(St=L.$defs)==null?void 0:St[z],[tt,nt]=s({predicate:L.predicate,convention:L.convention,$defs:L.$defs,schema:et});return tt===null||nt===null?(delete L.$defs[q],delete L.$defs[G],tt===null?[null,L.schema]:[L.schema,null]):[tt!==null?{...L.schema,$ref:`#/$defs/${q}`}:null,nt!==null?{...L.schema,$ref:`#/$defs/${G}`}:null]},N=L=>(L.required!==void 0&&(L.required=L.required.filter(z=>{var G;return((G=L.properties)==null?void 0:G[z])!==void 0})),L);o.invert=L=>{var q;var z;const G=et=>o.invert({components:L.components,$defs:L.$defs,schema:et});if(xf.isArray(L.schema))return{...L.schema,...t5.array(L.schema.description),items:G(L.schema.items)};if(xf.isObject(L.schema))return{...L.schema,properties:L.schema.properties?Object.fromEntries(Object.entries(L.schema.properties).map(([et,tt])=>[et,G(tt)])):void 0,additionalProperties:typeof L.schema.additionalProperties=="object"&&L.schema.additionalProperties!==null?G(L.schema.additionalProperties):L.schema.additionalProperties};if(xf.isReference(L.schema)){const et=L.schema.$ref.split("#/$defs/").at(-1)??"";return((q=L.components.schemas)==null?void 0:q[et])===void 0&&((z=L.components).schemas??(z.schemas={}),L.components.schemas[et]={},L.components.schemas[et]=G(L.$defs[et]??{})),{...L.schema,$ref:`#/components/schemas/${et}`}}else{if(xf.isOneOf(L.schema))return{...L.schema,oneOf:L.schema.oneOf.map(G),discriminator:L.schema.discriminator!==void 0?{propertyName:L.schema.discriminator.propertyName,mapping:L.schema.discriminator.mapping!==void 0?Object.fromEntries(Object.entries(L.schema.discriminator.mapping).map(([et,tt])=>[et,`#/components/schemas/${tt.split("/").at(-1)}`])):void 0}:void 0};if(xf.isInteger(L.schema)||xf.isNumber(L.schema))return{...L.schema,...t5.numeric(L.schema.description)};if(xf.isString(L.schema))return{...L.schema,...t5.string(L.schema.description)}}return L.schema}})(Qd||(Qd={}));var gC;(function(o){o.IS_DEFS=!0,o.DEFAULT_CONFIG={reference:!0,strict:!1},o.parameters=G=>{var q;(q=G.config).strict??(q.strict=!1);const et=Qd.parameters({...G,config:{reference:G.config.reference,constraint:!1},validate:G.config.strict===!0?s:void 0});if(et.success===!1)return et;for(const tt of Object.keys(et.value.$defs))et.value.$defs[tt]=p({config:G.config,schema:et.value.$defs[tt]});return{success:!0,value:p({config:G.config,schema:et.value})}},o.schema=G=>{var q;(q=G.config).strict??(q.strict=!1);const et=new Set(Object.keys(G.$defs)),tt=Qd.schema({...G,config:{reference:G.config.reference,constraint:!1},validate:G.config.strict===!0?s:void 0});if(tt.success===!1)return tt;for(const nt of Object.keys(G.$defs))et.has(nt)===!1&&(G.$defs[nt]=p({config:G.config,schema:G.$defs[nt]}));return{success:!0,value:p({config:G.config,schema:tt.value})}};const s=(G,q)=>{var tt;const et=[];if(Pr.isObject(G)){G.additionalProperties&&et.push({schema:G,accessor:`${q}.additionalProperties`,message:"ChatGPT does not allow additionalProperties in strict mode, the dynamic key typed object."});for(const nt of Object.keys(G.properties??{}))((tt=G.required)==null?void 0:tt.includes(nt))===!1&&et.push({schema:G,accessor:`${q}.properties.${nt}`,message:"ChatGPT does not allow optional properties in strict mode."})}return et},p=G=>{const q=[],et={title:G.schema.title,description:G.schema.description,example:G.schema.example,examples:G.schema.examples,...Object.fromEntries(Object.entries(o.schema).filter(([st,at])=>st.startsWith("x-")&&at!==void 0))},tt=st=>{xf.isOneOf(st)?st.oneOf.forEach(tt):xf.isArray(st)?q.push({...st,items:p({config:G.config,schema:st.items})}):xf.isObject(st)?q.push({...st,properties:Object.fromEntries(Object.entries(st.properties).map(([at,Ot])=>[at,p({config:G.config,schema:Ot})])),additionalProperties:G.config.strict===!0?!1:typeof st.additionalProperties=="object"&&st.additionalProperties!==null?p({config:G.config,schema:st.additionalProperties}):st.additionalProperties,description:hC.take(st)}):xf.isConstant(st)===!1&&q.push(st)},nt=st=>{const at=Ot=>{const Dt=q.find(St=>(St==null?void 0:St.type)===typeof Ot);Dt!==void 0?(Dt.enum??(Dt.enum=[]),Dt.enum.push(Ot)):q.push({type:typeof Ot,enum:[Ot]})};Pr.isConstant(st)?at(st.const):Pr.isOneOf(st)&&st.oneOf.forEach(Ot=>nt(Ot))};return tt(G.schema),nt(G.schema),q.length===0?{...et,type:void 0}:q.length===1?{...et,...q[0],description:O1.isReference(q[0])?void 0:q[0].description??et.description}:{...et,anyOf:q.map(st=>({...st,description:O1.isReference(st)?void 0:st.description})),"x-discriminator":xf.isOneOf(G.schema)&&G.schema.discriminator!==void 0&&G.schema.oneOf.length===q.length&&q.every(st=>O1.isReference(st)||O1.isNull(st))?G.schema.discriminator:void 0}};o.separateParameters=G=>{const q=G.convention??((st,at)=>`${st}.${yP.capitalize(at)}`),[et,tt]=N({predicate:G.predicate,convention:q,$defs:G.parameters.$defs,schema:G.parameters});if(et===null||tt===null)return{llm:et??{type:"object",properties:{},required:[],additionalProperties:!1,$defs:{}},human:tt};const nt={llm:{...et,$defs:Object.fromEntries(Object.entries(G.parameters.$defs).filter(([st])=>st.endsWith(".Llm"))),additionalProperties:!1},human:{...tt,$defs:Object.fromEntries(Object.entries(G.parameters.$defs).filter(([st])=>st.endsWith(".Human"))),additionalProperties:!1}};for(const st of Object.keys(G.parameters.$defs))st.endsWith(".Llm")===!1&&st.endsWith(".Human")===!1&&delete G.parameters.$defs[st];if(Object.keys(nt.llm.properties).length!==0){const st={};nt.validate=t$.create({components:st,schema:o.invert({components:st,schema:nt.llm,$defs:nt.llm.$defs}),required:!0})}return nt};const y=G=>G.predicate(G.schema)===!0?[null,G.schema]:O1.isUnknown(G.schema)||O1.isAnyOf(G.schema)?[G.schema,null]:O1.isObject(G.schema)?N({predicate:G.predicate,convention:G.convention,$defs:G.$defs,schema:G.schema}):O1.isArray(G.schema)?C({predicate:G.predicate,convention:G.convention,$defs:G.$defs,schema:G.schema}):O1.isReference(G.schema)?L({predicate:G.predicate,convention:G.convention,$defs:G.$defs,schema:G.schema}):[G.schema,null],C=G=>{const[q,et]=y({predicate:G.predicate,convention:G.convention,$defs:G.$defs,schema:G.schema.items});return[q!==null?{...G.schema,items:q}:null,et!==null?{...G.schema,items:et}:null]},N=G=>{if(Object.keys(G.schema.properties??{}).length===0&&!G.schema.additionalProperties)return[G.schema,null];const q={...G.schema,properties:{},additionalProperties:G.schema.additionalProperties},et={...G.schema,properties:{}};for(const[tt,nt]of Object.entries(G.schema.properties??{})){const[st,at]=y({predicate:G.predicate,convention:G.convention,$defs:G.$defs,schema:nt});st!==null&&(q.properties[tt]=st),at!==null&&(et.properties[tt]=at)}if(typeof G.schema.additionalProperties=="object"&&G.schema.additionalProperties!==null){const[tt,nt]=y({predicate:G.predicate,convention:G.convention,$defs:G.$defs,schema:G.schema.additionalProperties});q.additionalProperties=tt??!1,et.additionalProperties=nt??!1}return[Object.keys(q.properties).length||q.additionalProperties?z(q):null,Object.keys(et.properties).length||et.additionalProperties?z(et):null]},L=G=>{var Ot,Dt,St,ie,ae;const q=G.schema.$ref.split("#/$defs/")[1],et=G.convention(q,"human"),tt=G.convention(q,"llm");if((Ot=G.$defs)!=null&&Ot[et]||(Dt=G.$defs)!=null&&Dt[tt])return[(St=G.$defs)!=null&&St[tt]?{...G.schema,$ref:`#/$defs/${tt}`}:null,(ie=G.$defs)!=null&&ie[et]?{...G.schema,$ref:`#/$defs/${et}`}:null];G.$defs[tt]={},G.$defs[et]={};const nt=(ae=G.$defs)==null?void 0:ae[q],[st,at]=y({predicate:G.predicate,convention:G.convention,$defs:G.$defs,schema:nt});return st===null||at===null?(delete G.$defs[tt],delete G.$defs[et],st===null?[null,G.schema]:[G.schema,null]):[st!==null?{...G.schema,$ref:`#/$defs/${tt}`}:null,at!==null?{...G.schema,$ref:`#/$defs/${et}`}:null]},z=G=>(G.required=G.required.filter(q=>{var et;return((et=G.properties)==null?void 0:et[q])!==void 0}),G);o.invert=G=>{const q=[],et={title:G.schema.title,description:G.schema.description,...Object.fromEntries(Object.entries(G.schema).filter(([st,at])=>st.startsWith("x-")&&at!==void 0)),example:G.schema.example,examples:G.schema.examples},tt=st=>o.invert({components:G.components,$defs:G.$defs,schema:st}),nt=st=>{var Ot,Dt,St,ie;var at;if(O1.isArray(st))q.push({...st,...t5.array(st.description),items:tt(st.items)});else if(O1.isObject(st))q.push({...st,properties:Object.fromEntries(Object.entries(st.properties).map(([ae,Ne])=>[ae,tt(Ne)])),additionalProperties:typeof st.additionalProperties=="object"&&st.additionalProperties!==null?tt(st.additionalProperties):st.additionalProperties});else if(O1.isAnyOf(st))st.anyOf.forEach(nt);else if(O1.isReference(st)){const ae=st.$ref.split("#/$defs/")[1];((Ot=G.components.schemas)==null?void 0:Ot[ae])===void 0&&((at=G.components).schemas??(at.schemas={}),G.components.schemas[ae]={},G.components.schemas[ae]=tt(G.$defs[ae]??{})),q.push({...st,$ref:`#/components/schemas/${ae}`})}else O1.isBoolean(st)?(Dt=st.enum)!=null&&Dt.length?st.enum.forEach(ae=>q.push({const:ae})):q.push(st):O1.isInteger(st)||O1.isNumber(st)?(St=st.enum)!=null&&St.length?st.enum.forEach(ae=>q.push({const:ae})):q.push({...st,...t5.numeric(st.description),enum:void 0}):O1.isString(st)?(ie=st.enum)!=null&&ie.length?st.enum.forEach(ae=>q.push({const:ae})):q.push({...st,...t5.string(st.description),enum:void 0}):q.push({...st})};return nt(G.schema),{...et,...q.length===0?{type:void 0}:q.length===1?{...q[0]}:{oneOf:q.map(st=>({...st,nullable:void 0})),discriminator:O1.isAnyOf(G.schema)&&G.schema["x-discriminator"]!==void 0?{property:G.schema["x-discriminator"],mapping:G.schema["x-discriminator"].mapping!==void 0?Object.fromEntries(Object.entries(G.schema["x-discriminator"].mapping).map(([st,at])=>[st,`#/components/schemas/${at.split("/").at(-1)}`])):void 0}:void 0}}}})(gC||(gC={}));var bC;(function(o){o.IS_DEFS=!0,o.DEFAULT_CONFIG={reference:!0},o.parameters=s=>Qd.parameters({...s,config:{reference:s.config.reference,constraint:!0}}),o.schema=s=>Qd.schema({...s,config:{reference:s.config.reference,constraint:!0}}),o.separateParameters=s=>Qd.separateParameters(s),o.invert=s=>Qd.invert(s)})(bC||(bC={}));var mC;(function(o){o.IS_DEFS=!0,o.DEFAULT_CONFIG={reference:!0},o.parameters=s=>Qd.parameters({...s,config:{reference:s.config.reference,constraint:!0}}),o.schema=s=>Qd.schema({...s,config:{reference:s.config.reference,constraint:!0}}),o.separateParameters=s=>Qd.separateParameters(s),o.invert=s=>Qd.invert(s)})(mC||(mC={}));var e5;(function(o){o.IS_DEFS=!1,o.DEFAULT_CONFIG={recursive:3,constraint:!0},o.parameters=N=>{const L=qQ.parameters({...N,method:"LlmSchemaV3Composer.parameters"});if(L.success===!1)return L;const z=o.schema(N);return z.success===!1?z:{success:!0,value:{...z.value,additionalProperties:!1}}},o.schema=N=>{const L=[];if(Pr.visit({closure:(q,et)=>{var tt;if(N.validate&&L.push(...N.validate(q,et)),Pr.isTuple(q))L.push({accessor:et,schema:q,message:"LLM does not allow tuple type."});else if(Pr.isReference(q)){const nt=q.$ref.split("#/components/schemas/")[1];((tt=N.components.schemas)==null?void 0:tt[nt])===void 0&&L.push({schema:q,message:`${et}: unable to find reference type ${JSON.stringify(nt)}.`,accessor:et})}},components:N.components,schema:N.schema,accessor:N.accessor,refAccessor:N.refAccessor}),L.length>0)return{success:!1,error:{method:"LlmSchemaV3Composer.schema",message:"Failed to compose LLM schema of v3",reasons:L}};const z=Pr.escape({...N,recursive:N.config.recursive});if(z.success===!1)return{success:!1,error:{method:"LlmSchemaV3Composer.schema",message:"Failed to compose LLM schema of v3",reasons:z.error.reasons}};const G=vmt.downgradeSchema({original:{schemas:{}},downgraded:{}})(z.value);return Eb.visit({closure:q=>{Eb.isOneOf(q)&&q.discriminator!==void 0?delete q.discriminator:Eb.isObject(q)&&(q.properties??(q.properties={}),q.required??(q.required=[])),N.config.constraint===!1&&(Eb.isInteger(q)||Eb.isNumber(q)?fC.shiftNumeric(q):Eb.isString(q)?fC.shiftString(q):Eb.isArray(q)&&fC.shiftArray(q))},schema:G}),{success:!0,value:G}},o.separateParameters=N=>{const[L,z]=y({predicate:N.predicate,schema:N.parameters});return{llm:L??{type:"object",properties:{},additionalProperties:!1,required:[]},human:z,validate:L?t$.create({components:{},schema:o.invert({schema:L}),required:!0}):void 0}};const s=N=>N.predicate(N.schema)===!0?[null,N.schema]:Eb.isUnknown(N.schema)||Eb.isOneOf(N.schema)?[N.schema,null]:Eb.isObject(N.schema)?y({predicate:N.predicate,schema:N.schema}):Eb.isArray(N.schema)?p({predicate:N.predicate,schema:N.schema}):[N.schema,null],p=N=>{const[L,z]=s({predicate:N.predicate,schema:N.schema.items});return[L!==null?{...N.schema,items:L}:null,z!==null?{...N.schema,items:z}:null]},y=N=>{if(Object.keys(N.schema.properties??{}).length===0&&!N.schema.additionalProperties)return[N.schema,null];const L={...N.schema,properties:{},additionalProperties:N.schema.additionalProperties},z={...N.schema,properties:{},additionalProperties:N.schema.additionalProperties};for(const[G,q]of Object.entries(N.schema.properties??{})){const[et,tt]=s({predicate:N.predicate,schema:q});et!==null&&(L.properties[G]=et),tt!==null&&(z.properties[G]=tt)}if(typeof N.schema.additionalProperties=="object"&&N.schema.additionalProperties!==null){const[G,q]=s({predicate:N.predicate,schema:N.schema.additionalProperties});L.additionalProperties=G??!1,z.additionalProperties=q??!1}return[Object.keys(L.properties).length||L.additionalProperties?C(L):null,Object.keys(z.properties).length||z.additionalProperties?C(z):null]},C=N=>(N.required=N.required.filter(L=>N.properties[L]!==void 0),N);o.invert=N=>{const L=_mt.convertSchema({})(N.schema);return Pr.visit({closure:z=>{Pr.isArray(z)?Object.assign(z,{...z,...t5.array(z.description)}):Pr.isInteger(z)||Pr.isNumber(z)?Object.assign(z,{...z,...t5.numeric(z.description)}):Pr.isString(z)&&Object.assign(z,{...z,...t5.string(z.description)})},components:{},schema:L}),L}})(e5||(e5={}));var yC;(function(o){o.IS_DEFS=!1,o.DEFAULT_CONFIG={recursive:3},o.parameters=s=>{const p=qQ.parameters({...s,method:"GeminiSchemaComposer.parameters"});return p.success===!1?p:o.schema(s)},o.schema=s=>{const p=e5.schema({...s,config:{recursive:s.config.recursive,constraint:!1},validate:(y,C)=>{if(Pr.isObject(y)){if(y.additionalProperties)return[{schema:y,accessor:`${C}.additionalProperties`,message:"Gemini does not allow additionalProperties."}]}else if(Pr.isOneOf(y)&&lDn(s.components)(y))return[{schema:y,accessor:C,message:"Gemini does not allow union type."}];return[]}});return p.success===!1||Eb.visit({schema:p.value,closure:y=>{var C;y.title!==void 0&&(y.description=(C=y.description)!=null&&C.length?`${y.description}
|
|
61
64
|
|
|
62
|
-
${y.
|
|
65
|
+
@title ${y.title}`:`@title ${y.title}`,delete y.title),Eb.isObject(y)&&y.additionalProperties!==void 0&&delete y.additionalProperties}}),p},o.separateParameters=s=>e5.separateParameters(s),o.invert=s=>e5.invert(s)})(yC||(yC={}));const lDn=o=>s=>{const p=[],y=new Set,C=L=>{var z;if(Pr.isBoolean(L)||Pr.isInteger(L)||Pr.isNumber(L)||Pr.isString(L))p.push({...L});else if(Pr.isArray(L)||Pr.isTuple(L)||Pr.isObject(L))p.push(L);else if(Pr.isOneOf(L))L.oneOf.forEach(C);else if(Pr.isReference(L))if(y.has(L.$ref))p.push(L);else{y.add(L.$ref);const G=(z=o.schemas)==null?void 0:z[L.$ref.split("/").pop()];G===void 0?p.push(L):C(G)}},N=L=>{const z=G=>{const q=p.find(et=>et.type===typeof G);q!==void 0?(q.enum??(q.enum=[]),q.enum.push(G)):p.push({type:typeof G,enum:[G]})};if(Pr.isConstant(L))z(L.const);else if(Pr.isOneOf(L))for(const G of L.oneOf)Pr.isConstant(G)&&z(G.const)};return C(s),N(s),p.length>1};var wC;(function(o){o.IS_DEFS=!0,o.DEFAULT_CONFIG={reference:!0},o.parameters=s=>Qd.parameters({...s,config:{reference:s.config.reference,constraint:!0}}),o.schema=s=>Qd.schema({...s,config:{reference:s.config.reference,constraint:!0}}),o.separateParameters=s=>Qd.separateParameters(s),o.invert=s=>Qd.invert(s)})(wC||(wC={}));var zF;(function(o){o.parameters=s=>hDn[s],o.schema=s=>fDn[s],o.defaultConfig=s=>gDn[s],o.typeChecker=s=>bDn[s],o.separateParameters=s=>dDn[s],o.invert=s=>pDn[s],o.isDefs=s=>mDn[s]()})(zF||(zF={}));const hDn={chatgpt:gC.parameters,claude:bC.parameters,deepseek:mC.parameters,gemini:yC.parameters,llama:wC.parameters,"3.0":e5.parameters,3.1:Qd.parameters},fDn={chatgpt:gC.schema,claude:bC.schema,deepseek:mC.schema,gemini:yC.schema,llama:wC.schema,"3.0":e5.schema,3.1:Qd.schema},dDn={chatgpt:gC.separateParameters,claude:bC.separateParameters,deepseek:mC.separateParameters,gemini:yC.separateParameters,llama:wC.separateParameters,"3.0":e5.separateParameters,3.1:Qd.separateParameters},pDn={chatgpt:gC.invert,claude:bC.invert,deepseek:mC.invert,gemini:yC.invert,llama:wC.invert,"3.0":e5.invert,3.1:Qd.invert},gDn={chatgpt:gC.DEFAULT_CONFIG,claude:bC.DEFAULT_CONFIG,deepseek:mC.DEFAULT_CONFIG,gemini:yC.DEFAULT_CONFIG,llama:wC.DEFAULT_CONFIG,"3.0":e5.DEFAULT_CONFIG,3.1:Qd.DEFAULT_CONFIG},bDn={chatgpt:O1,claude:yRn,deepseek:wRn,gemini:FBt,llama:vRn,"3.0":Eb,3.1:xf},mDn={chatgpt:()=>gC.IS_DEFS,claude:()=>bC.IS_DEFS,deepseek:()=>mC.IS_DEFS,gemini:()=>yC.IS_DEFS,llama:()=>wC.IS_DEFS,"3.0":()=>e5.IS_DEFS,3.1:()=>Qd.IS_DEFS};var XBt;(function(o){o.application=p=>{var L;const y=p.migrate.errors.filter(z=>z.operation()["x-samchon-human"]!==!0).map(z=>({method:z.method,path:z.path,messages:z.messages,operation:()=>z.operation(),route:()=>{}})),C=p.migrate.routes.filter(z=>z.operation()["x-samchon-human"]!==!0).map((z,G)=>{var tt,nt;if(z.method==="head")return y.push({method:z.method,path:z.path,messages:["HEAD method is not supported in the LLM application."],operation:()=>z.operation(),route:()=>z}),null;if(((tt=z.body)==null?void 0:tt.type)==="multipart/form-data"||((nt=z.success)==null?void 0:nt.type)==="multipart/form-data")return y.push({method:z.method,path:z.path,messages:['The "multipart/form-data" content type is not supported in the LLM application.'],operation:()=>z.operation(),route:()=>z}),null;const q=[],et=s({model:p.model,config:p.options,components:p.migrate.document().components,route:z,errors:q});return et===null&&y.push({method:z.method,path:z.path,messages:q,operation:()=>z.operation(),route:()=>z}),et}).filter(z=>z!==null),N={model:p.model,options:p.options,functions:C,errors:y};return o.shorten(N,((L=p.options)==null?void 0:L.maxLength)??64),N};const s=p=>{const y=`$input.paths[${JSON.stringify(p.route.path)}][${JSON.stringify(p.route.method)}]`,C=p.route.operation(),N=(()=>{var at,Ot,Dt,St;if(!((at=C.summary)!=null&&at.length)||!((Ot=C.description)!=null&&Ot.length))return[C.summary||C.description,((Dt=C.summary)==null?void 0:Dt.length)??((St=C.description)==null?void 0:St.length)??0];const nt=C.summary.endsWith(".")?C.summary.slice(0,-1):C.summary,st=C.description.startsWith(nt)?C.description:nt+`.
|
|
63
66
|
|
|
64
|
-
`+C.description;return[st,st.length]})();N[1]>1024&&p.errors.push(`The description of the function is too long (must be equal or less than 1,024 characters, but ${N[1].toLocaleString()} length).`);const L=
|
|
67
|
+
`+C.description;return[st,st.length]})();N[1]>1024&&p.errors.push(`The description of the function is too long (must be equal or less than 1,024 characters, but ${N[1].toLocaleString()} length).`);const L=wDn(p.route.accessor.join("_")),z=/^[a-zA-Z0-9_-]+$/.test(L),G=/^[0-9]/.test(L[0]??"");z===!1&&p.errors.push("Elements of path (separated by '/') must be composed with alphabets, numbers, underscores, and hyphens");const q={type:"object",properties:Object.fromEntries([...p.route.parameters.map(nt=>[nt.key,{...nt.schema,title:nt.parameter().title??nt.schema.title,description:nt.parameter().description??nt.schema.description}]),...p.route.query?[[p.route.query.key,{...p.route.query.schema,title:p.route.query.title()??p.route.query.schema.title,description:p.route.query.description()??p.route.query.schema.description}]]:[],...p.route.body?[[p.route.body.key,{...p.route.body.schema,description:p.route.body.description()??p.route.body.schema.description}]]:[]])};q.required=Object.keys(q.properties??{});const et=zF.parameters(p.model)({config:p.config,components:p.components,schema:q,accessor:`${y}.parameters`}),tt=p.route.success?zF.schema(p.model)({config:p.config,components:p.components,schema:p.route.success.schema,accessor:`${y}.responses[${JSON.stringify(p.route.success.status)}][${JSON.stringify(p.route.success.type)}].schema`,$defs:et.success?et.value.$defs:{}}):void 0;return(tt==null?void 0:tt.success)===!1||et.success===!1||z===!1||G===!0||N[1]>1024?((tt==null?void 0:tt.success)===!1&&p.errors.push(...tt.error.reasons.map(nt=>`${nt.accessor}: ${nt.message}`)),et.success===!1&&p.errors.push(...et.error.reasons.map(nt=>{var at;return`${nt.accessor.replace('parameters.properties["body"]',`requestBody.content[${JSON.stringify(((at=p.route.body)==null?void 0:at.type)??"application/json")}].schema`)}: ${nt.message}`})),null):{method:p.route.method,path:p.route.path,name:L,parameters:et.value,separated:p.config.separate?zF.separateParameters(p.model)({predicate:p.config.separate,parameters:et.value}):void 0,output:tt==null?void 0:tt.value,description:N[0],deprecated:C.deprecated,tags:C.tags,validate:t$.create({components:p.components,schema:q,required:!0}),route:()=>p.route,operation:()=>p.route.operation()}};o.shorten=(p,y=64)=>{const C=new Set,N=[];for(const z of p.functions)C.add(z.name),z.name.length>y&&N.push(z);if(N.length===0)return;let L=0;for(const z of N){let G=!1,q=et=>{C.delete(z.name),C.add(et),z.name=et,G=!0};for(let et=1;et<z.route().accessor.length;++et){const tt=z.route().accessor.slice(et).join("_");if(!(tt.length>y-8)){if(C.has(tt)===!1)q(tt);else{const nt=`_${L}_${tt}`;if(C.has(nt)===!0)continue;q(nt),++L}break}}G===!1&&q(yDn())}}})(XBt||(XBt={}));const yDn=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,o=>{const s=Math.random()*16|0;return(o==="x"?s:s&3|8).toString(16)}),wDn=o=>{for(const s of vDn)o=o.split(s).join("_");return o},vDn=["$","%","."];var xmt;(function(o){o.execute=p=>ZF.execute(s("execute",p)),o.propagate=p=>ZF.propagate(s("propagate",p));const s=(p,y)=>{const C=y.function.route(),N=y.input;if((typeof N=="object"&&N!==null)===!1)throw new Error(`Error on HttpLlmFunctionFetcher.${p}(): keyworded arguments must be an object`);return{connection:y.connection,route:C,parameters:Object.fromEntries(C.parameters.map(z=>[z.key,N[z.key]])),query:N.query,body:N.body}}})(xmt||(xmt={}));var Emt;(function(o){o.parameters=p=>{if(p.function.separated===void 0)throw new Error("Error on OpenAiDataComposer.parameters(): the function parameters are not separated.");return o.value(p.llm,p.human)},o.value=(p,y)=>typeof p=="object"&&typeof y=="object"&&p!==null&&y!==null?s(p,y):Array.isArray(p)&&Array.isArray(y)?new Array(Math.max(p.length,y.length)).fill(0).map((C,N)=>o.value(p[N],y[N])):y??p;const s=(p,y)=>{const C={...p};for(const[N,L]of Object.entries(y))C[N]=o.value(p[N],L);return C}})(Emt||(Emt={}));var QBt;(function(o){o.application=s=>{var C,N;const p=BBt.application(s.document),y=zF.defaultConfig(s.model);return XBt.application({migrate:p,model:s.model,options:{...Object.fromEntries(Object.entries(y).map(([L,z])=>{var G;return[L,((G=s.options)==null?void 0:G[L])??z]})),separate:((C=s.options)==null?void 0:C.separate)??null,maxLength:((N=s.options)==null?void 0:N.maxLength)??64}})},o.execute=s=>xmt.execute(s),o.propagate=s=>xmt.propagate(s),o.mergeParameters=s=>Emt.parameters(s),o.mergeValue=(s,p)=>Emt.value(s,p)})(QBt||(QBt={}));var yk;(o=>{o.RETRY=3,o.ELITICISM=!0})(yk||(yk={}));const $Ce={};class $Ie{constructor(s){this.closure_=s,this.value_=$Ce}get(...s){return this.value_===$Ce&&(this.value_=this.closure_(...s)),this.value_}}const A6={CANCEL:`You are a helpful assistant for cancelling functions which are prepared to call.
|
|
65
68
|
|
|
66
69
|
Use the supplied tools to select some functions to cancel of \`getApiFunctions()\` returned.
|
|
67
70
|
|
|
@@ -1434,14 +1437,14 @@ You have been provided with \`IValidation.IError[][]\` containing **previous his
|
|
|
1434
1437
|
- Redesign the entire AST structure using proper architectural patterns
|
|
1435
1438
|
- Enhance with comprehensive business context and realistic data
|
|
1436
1439
|
|
|
1437
|
-
**Success means: the error path never appears in future correction cycles.**`};var
|
|
1438
|
-
`),life:C,previousValidationErrors:y})}async function
|
|
1440
|
+
**Success means: the error path never appears in future correction cycles.**`};var _Dn={};const xDn=new $Ie(()=>{var o;return TIe()?((o=_Dn.LANG)==null?void 0:o.split(".")[0])??"en-US":navigator.language}),EDn=new $Ie(()=>Intl.DateTimeFormat().resolvedOptions().timeZone);function TDn(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)??xDn.get(),p=(o==null?void 0:o.timezone)??EDn.get();return A6.COMMON.replace("${locale}",s).replace("${timezone}",p).replace("${datetime}",new Date().toISOString())}const o$={write:TDn};function kDn(o){return typeof o.initialize=="function"}var JBt;(o=>{function s(p){return new TextDecoder().decode(p)}o.toUtf8=s})(JBt||(JBt={}));function jIe(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 HIe(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:jIe(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:HIe(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:jIe,sumPromptTokenDetail:HIe};function ADn(o){const s=o instanceof Uint8Array?JBt.toUtf8(o):o;return JSON.parse(s)}function zIe(o,s){const p=o.choices;s.choices.forEach(C=>{const N=p[C.index];if(N!=null){p[C.index]=UIe(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");return o.reduce(zIe,{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})}function UIe(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]=qIe(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 qIe(o,s){return s.function!=null&&(o.function.arguments+=s.function.arguments??"",o.function.name+=s.function.name??""),o.id+=s.id??"",o}const I6={transformCompletionChunk:ADn,accumulate:zIe,merge:IDn,mergeChoice:UIe,mergeToolCalls:qIe};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=Xmt(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*WIe(o){yield o}async function*Xmt(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 vC={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 KIe(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=rRn({selection:Qmt({operation:y.operation,reason:s.reason})});o.dispatch(C)}async function MDn(o,s){var z,G,q,et,tt,nt;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$)},...((G=(z=o.config)==null?void 0:z.systemPrompt)==null?void 0:G.execute)===null?[]:[{role:"system",content:((tt=(et=(q=o.config)==null?void 0:q.systemPrompt)==null?void 0:et.execute)==null?void 0:tt.call(et,o.histories))??A6.EXECUTE}]],tools:s.map(st=>({type:"function",function:{name:st.name,description:st.function.description,parameters:"separated"in st.function&&st.function.separated!==void 0?st.function.separated.llm??{type:"object",properties:{},required:[],additionalProperties:!1,$defs:{}}:st.function.parameters}})),tool_choice:"auto"}),y=await vC.readAll(p),C=I6.merge(y),N=[],L=((nt=o.config)==null?void 0:nt.retry)??yk.RETRY;for(const st of C.choices){for(const at of st.message.tool_calls??[])if(at.type==="function"){const Ot=s.find(St=>St.name===at.function.name);if(Ot===void 0)continue;const Dt=await GIe(o,Ot,at,[],L);o.dispatch(Dt),N.push(Dt),kDn(o)&&KIe(o,{name:Dt.operation.name,reason:"completed"})}if(st.message.role==="assistant"&&st.message.content!=null&&st.message.content.length!==0){const at=st.message.content,Ot=GFt({get:()=>at,done:()=>!0,stream:WIe(at),join:async()=>Promise.resolve(at)});o.dispatch(Ot)}}return N}async function GIe(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=sRn({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 YIe(o,{giveUp:()=>ymt({operation:s.operation,arguments:s.arguments,value:{name:"ValidationError",message:`Invalid arguments. The validation failed after ${yk.RETRY} retries.`,errors:p.result.errors}}),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)))??[A6.VALIDATE,...y.length>1?["",A6.VALIDATE_REPEATED.replace("${{HISTORICAL_ERRORS}}",JSON.stringify(y.slice(0,-1).map(G=>G.result.errors)))]:[]].join(`
|
|
1441
|
+
`),life:C,previousValidationErrors:y})}async function DDn(o,s,p,y){var C,N,L;return YIe(o,{giveUp:()=>ymt({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))??A6.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 iRn({id:s.id,operation:o,arguments:p})}catch(p){return aRn({id:s.id,operation:o,arguments:s.function.arguments,errorMessage:p instanceof Error?p.message:String(p)})}}async function YIe(o,s){var L,z,G,q,et,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))??A6.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:{type:"function",function:{name:s.operation.name}}}),y=await vC.readAll(p),N=(tt=(et=I6.merge(y).choices[0])==null?void 0:et.message.tool_calls)==null?void 0:tt.find(nt=>nt.function.name===s.operation.name);return N===void 0?s.giveUp():GIe(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 ymt({operation:o.operation,arguments:o.arguments,value:p})}catch(p){return ymt({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 QBt.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 YFt={};Object.defineProperty(YFt,"__esModule",{value:!0});var c$=YFt._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)=>(p&&s(y.path)&&o.push(y),!1)};c$=YFt._validateReport=zDn;const Sbt={functions:[{name:"cancelFunctions",parameters:{description:` Properties of the function
|
|
1439
1442
|
|
|
1440
1443
|
------------------------------
|
|
1441
1444
|
|
|
1442
|
-
Current Type: {@link __IChatFunctionReference.IProps}`,type:"object",properties:{functions:{
|
|
1445
|
+
Current Type: {@link __IChatFunctionReference.IProps}`,type:"object",properties:{functions:{description:"List of target functions.",type:"array",items:{$ref:"#/$defs/___IChatFunctionReference"}}},required:["functions"],additionalProperties:!1,$defs:{___IChatFunctionReference:{type:"object",properties:{reason:{description:`The reason of the function selection.
|
|
1443
1446
|
|
|
1444
|
-
Just write the reason why you've determined to select this function.`,type:"string"},name:{
|
|
1447
|
+
Just write the reason why you've determined to select this function.`,type:"string"},name:{description:"Name of the target function to call.",type:"string"}},required:["reason","name"]}}},description:`Cancel a function from the candidate list to call.
|
|
1445
1448
|
|
|
1446
1449
|
If you A.I. agent has understood that the user wants to cancel
|
|
1447
1450
|
some candidate functions to call from the conversation, please cancel
|
|
@@ -1454,8 +1457,8 @@ agent selects multiple candidate functions because the A.I. agent can't specify
|
|
|
1454
1457
|
only one thing due to lack of specificity or homogeneity of candidate functions.
|
|
1455
1458
|
|
|
1456
1459
|
Additionally, if you A.I. agent wants to cancel same function multiply, you can
|
|
1457
|
-
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((et,tt)=>(typeof et=="object"&&et!==null||L(q,{path:G+".functions["+tt+"]",expected:"___IChatFunctionReference",value:et}))&&y(et,G+".functions["+tt+"]",q)||L(q,{path:G+".functions["+tt+"]",expected:"___IChatFunctionReference",value:et})).every(et=>et)||L(q,{path:G+".functions",expected:"Array<___IChatFunctionReference>",value:z.functions})].every(et=>et),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(et=>et),C=z=>typeof z=="object"&&z!==null&&o(z);let N,L;return z=>{if(C(z)===!1){N=[],L=c$(N),((q,et,tt=!0)=>(typeof q=="object"&&q!==null||L(!0,{path:et+"",expected:"__IChatFunctionReference.IProps",value:q}))&&p(q,et+"",!0)||L(!0,{path:et+"",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
|
|
1458
|
-
`)}]).flat()}class
|
|
1460
|
+
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((et,tt)=>(typeof et=="object"&&et!==null||L(q,{path:G+".functions["+tt+"]",expected:"___IChatFunctionReference",value:et}))&&y(et,G+".functions["+tt+"]",q)||L(q,{path:G+".functions["+tt+"]",expected:"___IChatFunctionReference",value:et})).every(et=>et)||L(q,{path:G+".functions",expected:"Array<___IChatFunctionReference>",value:z.functions})].every(et=>et),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(et=>et),C=z=>typeof z=="object"&&z!==null&&o(z);let N,L;return z=>{if(C(z)===!1){N=[],L=c$(N),((q,et,tt=!0)=>(typeof q=="object"&&q!==null||L(!0,{path:et+"",expected:"__IChatFunctionReference.IProps",value:q}))&&p(q,et+"",!0)||L(!0,{path:et+"",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 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==="cancel");(C.length!==0?C:p).forEach(o.dispatch)}}async function zbt(o,s,p,y){var z,G,q,et;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))??A6.CANCEL},...qDn(y??[])],tools:[{type:"function",function:{name:Sbt.functions[0].name,description:Sbt.functions[0].description,parameters:Sbt.functions[0].parameters}}],tool_choice:p===0?"auto":{type:"function",function:{name:Sbt.functions[0].name}}}),N=await vC.readAll(C),L=I6.merge(N);if(p++<(((et=o.config)==null?void 0:et.retry)??yk.RETRY)){const tt=[];for(const nt of L.choices)for(const st of nt.message.tool_calls??[]){if(st.function.name!=="cancelFunctions")continue;const at=JSON.parse(st.function.arguments),Ot=(()=>{const Dt=cn=>Array.isArray(cn.functions)&&cn.functions.every(er=>typeof er=="object"&&er!==null&&St(er)),St=cn=>typeof cn.reason=="string"&&typeof cn.name=="string",ie=(cn,er,Dn=!0)=>[(Array.isArray(cn.functions)||de(Dn,{path:er+".functions",expected:"Array<___IChatFunctionReference>",value:cn.functions}))&&cn.functions.map((jn,or)=>(typeof jn=="object"&&jn!==null||de(Dn,{path:er+".functions["+or+"]",expected:"___IChatFunctionReference",value:jn}))&&ae(jn,er+".functions["+or+"]",Dn)||de(Dn,{path:er+".functions["+or+"]",expected:"___IChatFunctionReference",value:jn})).every(jn=>jn)||de(Dn,{path:er+".functions",expected:"Array<___IChatFunctionReference>",value:cn.functions})].every(jn=>jn),ae=(cn,er,Dn=!0)=>[typeof cn.reason=="string"||de(Dn,{path:er+".reason",expected:"string",value:cn.reason}),typeof cn.name=="string"||de(Dn,{path:er+".name",expected:"string",value:cn.name})].every(jn=>jn),Ne=cn=>typeof cn=="object"&&cn!==null&&Dt(cn);let pn,de;return cn=>{if(Ne(cn)===!1){pn=[],de=c$(pn),((Dn,jn,or=!0)=>(typeof Dn=="object"&&Dn!==null||de(!0,{path:jn+"",expected:"__IChatFunctionReference.IProps",value:Dn}))&&ie(Dn,jn+"",!0)||de(!0,{path:jn+"",expected:"__IChatFunctionReference.IProps",value:Dn}))(cn,"$input",!0);const er=pn.length===0;return er?{success:er,data:cn}:{success:er,errors:pn,data:cn}}return{success:!0,data:cn}}})()(at);Ot.success===!1&&tt.push({id:st.id,name:st.function.name,validation:Ot})}if(tt.length>0)return zbt(o,s,p,tt)}for(const tt of L.choices)if(tt.message.tool_calls!=null)for(const nt of tt.message.tool_calls){if(nt.type!=="function")continue;if(nt.function.name!=="cancelFunctions")continue;const st=(()=>{const at=St=>Array.isArray(St.functions)&&St.functions.every(ie=>typeof ie=="object"&&ie!==null&&Ot(ie)),Ot=St=>typeof St.reason=="string"&&typeof St.name=="string",Dt=St=>typeof St=="object"&&St!==null&&at(St);return St=>(St=JSON.parse(St),Dt(St)?St:null)})()(nt.function.arguments);if(st!==null)for(const at of st.functions)KIe(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(`
|
|
1461
|
+
`)}]).flat()}class WDn 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 WDn("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)})}}class VIe{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 GDn(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))??A6.DESCRIBE}]}),y=[];await vC.reduce(p,async(z,G)=>{const q=await z,et=tt=>{for(const nt of tt){if(nt.finish_reason!=null){y[nt.index].mpsc.close();continue}if(nt.delta.content==null)continue;if(y[nt.index]!=null){y[nt.index].content+=nt.delta.content,y[nt.index].mpsc.produce(nt.delta.content);continue}const st=new VIe;y[nt.index]={content:nt.delta.content,mpsc:st},st.produce(nt.delta.content);const at=cRn({executes:s,stream:Xmt(st.consumer.getReader()),done:()=>st.done(),get:()=>{var Ot;return((Ot=y[nt.index])==null?void 0:Ot.content)??""},join:async()=>(await st.waitClosed(),y[nt.index].content)});o.dispatch(at)}};return q.object==="chat.completion.chunk"?(et([q,G].flatMap(tt=>tt.choices)),I6.merge([q,G])):(et(G.choices),I6.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.
|
|
1459
1462
|
|
|
1460
1463
|
\`IHttpLlmFunction\` is a data structure representing a function converted from
|
|
1461
1464
|
the {@link OpenApi.IOperation OpenAPI operation}, used for the LLM (Large
|
|
@@ -1527,7 +1530,7 @@ Additionally, the properties' rule is:
|
|
|
1527
1530
|
> Collection of separated parameters.
|
|
1528
1531
|
>
|
|
1529
1532
|
> Filled only when {@link IHttpLlmApplication.IOptions.separate} is
|
|
1530
|
-
> configured.`,type:"object",properties:{method:{
|
|
1533
|
+
> configured.`,type:"object",properties:{method:{description:"HTTP method of the endpoint.",type:"string",enum:["get","post","patch","put","delete"]},path:{description:"Path of the endpoint.",type:"string"},name:{description:"Representative name of the function.\n\nThe `name` is a repsentative name identifying the function in the\n{@link IHttpLlmApplication}. The `name` value is just composed by joining\nthe {@link IHttpMigrateRoute.accessor} by underscore `_` character.\n\nHere is the composition rule of the {@link IHttpMigrateRoute.accessor}:\n\n> The `accessor` is composed with the following rules. At first, namespaces\n> are composed by static directory names in the {@link path}. Parametric\n> symbols represented by `:param` or `{param}` cannot be a part of the\n> namespace.\n\n> Instead, they would be a part of the function name. The function name is\n> composed with the {@link method HTTP method} and parametric symbols like\n> `getByParam` or `postByParam`. If there are multiple path parameters, they\n> would be concatenated by `And` like `getByParam1AndParam2`.\n\n> For refefence, if the {@link operation}'s {@link method} is `delete`, the\n> function name would be replaced to `erase` instead of `delete`. It is the\n> reason why the `delete` is a reserved keyword in many programming\n> languages.\n\n> - Example 1\n\n> - Path: `POST /shopping/sellers/sales`\n> - Accessor: `shopping.sellers.sales.post`\n> - Example 2\n\n> - Endpoint: `GET\n> /shoppings/sellers/sales/:saleId/reviews/:reviewId/comments/:id\n> - Accessor:\n> `shoppings.sellers.sales.reviews.getBySaleIdAndReviewIdAndCommentId`\n\n\n@maxLength 64",type:"string"},parameters:{$ref:"#/$defs/IChatGptSchema.IParameters"},separated:{$ref:"#/$defs/IHttpLlmFunction.ISeparatedchatgpt"},output:{description:"Expected return type.\n\nIf the target operation returns nothing (`void`), the `output` would be\n`undefined`.",anyOf:[{$ref:"#/$defs/IChatGptSchema.IObject"},{$ref:"#/$defs/IChatGptSchema.IString"},{$ref:"#/$defs/IChatGptSchema.INumber"},{$ref:"#/$defs/IChatGptSchema.IInteger"},{$ref:"#/$defs/IChatGptSchema.IBoolean"},{$ref:"#/$defs/IChatGptSchema.IArray"},{$ref:"#/$defs/IChatGptSchema.IReference"},{$ref:"#/$defs/IChatGptSchema.IAnyOf"},{$ref:"#/$defs/IChatGptSchema.IUnknown"},{$ref:"#/$defs/IChatGptSchema.INull"}]},description:{description:`Description of the function.
|
|
1531
1534
|
|
|
1532
1535
|
\`IHttpLlmFunction.description\` is composed by below rule:
|
|
1533
1536
|
|
|
@@ -1548,7 +1551,7 @@ determines which function to call by the description.
|
|
|
1548
1551
|
|
|
1549
1552
|
Also, when the LLM conversates with the user, the \`description\` is used to
|
|
1550
1553
|
explain the function to the user. Therefore, the \`description\` property has
|
|
1551
|
-
the highest priority, and you have to consider it.`,type:"string"},deprecated:{
|
|
1554
|
+
the highest priority, and you have to consider it.`,type:"string"},deprecated:{description:"Whether the function is deprecated or not.\n\nIf the `deprecated` is `true`, the function is not recommended to use.\n\nLLM (Large Language Model) may not use the deprecated function.",type:"boolean"},tags:{description:`Category tags for the function.
|
|
1552
1555
|
|
|
1553
1556
|
Same with {@link OpenApi.IOperation.tags} indicating the category of the
|
|
1554
1557
|
function.`,type:"array",items:{type:"string"}}},required:["method","path","name","parameters"]},"IChatGptSchema.IParameters":{description:`Type of the function parameters.
|
|
@@ -1572,12 +1575,12 @@ It also can be utilized for the structured output metadata.
|
|
|
1572
1575
|
|
|
1573
1576
|
### Description of {@link examples} property:
|
|
1574
1577
|
|
|
1575
|
-
> List of example values as key-value pairs.`,type:"object",properties:{$defs:{
|
|
1578
|
+
> List of example values as key-value pairs.`,type:"object",properties:{$defs:{$ref:"#/$defs/RecordstringIChatGptSchema"},additionalProperties:{description:`Additional properties' info.
|
|
1576
1579
|
|
|
1577
1580
|
The \`additionalProperties\` means the type schema info of the additional
|
|
1578
1581
|
properties that are not listed in the {@link properties}.
|
|
1579
1582
|
|
|
1580
|
-
By the way, it is not allowed in the parameters level.`,type:"boolean",enum:[!1]},properties:{
|
|
1583
|
+
By the way, it is not allowed in the parameters level.`,type:"boolean",enum:[!1]},properties:{$ref:"#/$defs/RecordstringIChatGptSchema"},required:{description:`List of key values of the required properties.
|
|
1581
1584
|
|
|
1582
1585
|
The \`required\` means a list of the key values of the required
|
|
1583
1586
|
{@link properties}. If some property key is not listed in the \`required\`
|
|
@@ -1608,7 +1611,7 @@ so that they are listed in the \`required\` list.
|
|
|
1608
1611
|
},
|
|
1609
1612
|
"required": ["id", "email"]
|
|
1610
1613
|
}
|
|
1611
|
-
\`\`\``,type:"array",items:{type:"string"}},type:{
|
|
1614
|
+
\`\`\``,type:"array",items:{type:"string"}},type:{description:"Discriminator value of the type.",type:"string",enum:["object"]},title:{description:"Title of the schema.",type:"string"},description:{description:"Detailed description of the schema.",type:"string"},deprecated:{description:"Whether the type is deprecated or not.",type:"boolean"},example:{description:"Example value."},examples:{$ref:"#/$defs/Recordstringany"}},required:["$defs","additionalProperties","properties","required","type"]},RecordstringIChatGptSchema:{description:"Construct a type with a set of properties K of type T",type:"object",properties:{},required:[],additionalProperties:{$ref:"#/$defs/IChatGptSchema"}},IChatGptSchema:{description:`Type schema info of the ChatGPT.
|
|
1612
1615
|
|
|
1613
1616
|
\`IChatGptSchema\` is a type schema info of the ChatGPT function calling.
|
|
1614
1617
|
|
|
@@ -1698,7 +1701,7 @@ capsulization to the {@link IChatGptSchema.IAnyOf} type. Therefore, the
|
|
|
1698
1701
|
|
|
1699
1702
|
### Description of {@link examples} property:
|
|
1700
1703
|
|
|
1701
|
-
> List of example values as key-value pairs.`,type:"object",properties:{properties:{
|
|
1704
|
+
> List of example values as key-value pairs.`,type:"object",properties:{properties:{$ref:"#/$defs/RecordstringIChatGptSchema"},additionalProperties:{description:"Additional properties' info.\n\nThe `additionalProperties` means the type schema info of the additional\nproperties that are not listed in the {@link properties}.\n\nBy the way, if you've configured {@link IChatGptSchema.IConfig.strict} as\n`true`, ChatGPT function calling does not support such dynamic key typed\nproperties, so the `additionalProperties` becomes always `false`.",anyOf:[{type:"boolean"},{$ref:"#/$defs/IChatGptSchema.IObject"},{$ref:"#/$defs/IChatGptSchema.IString"},{$ref:"#/$defs/IChatGptSchema.INumber"},{$ref:"#/$defs/IChatGptSchema.IInteger"},{$ref:"#/$defs/IChatGptSchema.IBoolean"},{$ref:"#/$defs/IChatGptSchema.IArray"},{$ref:"#/$defs/IChatGptSchema.IReference"},{$ref:"#/$defs/IChatGptSchema.IAnyOf"},{$ref:"#/$defs/IChatGptSchema.IUnknown"},{$ref:"#/$defs/IChatGptSchema.INull"}]},required:{description:`List of key values of the required properties.
|
|
1702
1705
|
|
|
1703
1706
|
The \`required\` means a list of the key values of the required
|
|
1704
1707
|
{@link properties}. If some property key is not listed in the \`required\`
|
|
@@ -1729,23 +1732,23 @@ so that they are listed in the \`required\` list.
|
|
|
1729
1732
|
},
|
|
1730
1733
|
"required": ["id", "email"]
|
|
1731
1734
|
}
|
|
1732
|
-
\`\`\``,type:"array",items:{type:"string"}},type:{
|
|
1735
|
+
\`\`\``,type:"array",items:{type:"string"}},type:{description:"Discriminator value of the type.",type:"string",enum:["object"]},title:{description:"Title of the schema.",type:"string"},description:{description:"Detailed description of the schema.",type:"string"},deprecated:{description:"Whether the type is deprecated or not.",type:"boolean"},example:{description:"Example value."},examples:{$ref:"#/$defs/Recordstringany"}},required:["properties","required","type"]},"IChatGptSchema.IString":{description:`String type info.
|
|
1733
1736
|
|
|
1734
1737
|
### Description of {@link examples} property:
|
|
1735
1738
|
|
|
1736
|
-
> List of example values as key-value pairs.`,type:"object",properties:{enum:{
|
|
1739
|
+
> List of example values as key-value pairs.`,type:"object",properties:{enum:{description:"Enumeration values.",type:"array",items:{type:"string"}},type:{description:"Discriminator value of the type.",type:"string",enum:["string"]},title:{description:"Title of the schema.",type:"string"},description:{description:"Detailed description of the schema.",type:"string"},deprecated:{description:"Whether the type is deprecated or not.",type:"boolean"},example:{description:"Example value."},examples:{$ref:"#/$defs/Recordstringany"}},required:["type"]},Recordstringany:{description:"Construct a type with a set of properties K of type T",type:"object",properties:{},required:[],additionalProperties:{}},"IChatGptSchema.INumber":{description:`Number (double) type info.
|
|
1737
1740
|
|
|
1738
1741
|
### Description of {@link examples} property:
|
|
1739
1742
|
|
|
1740
|
-
> List of example values as key-value pairs.`,type:"object",properties:{enum:{
|
|
1743
|
+
> List of example values as key-value pairs.`,type:"object",properties:{enum:{description:"Enumeration values.",type:"array",items:{type:"number"}},type:{description:"Discriminator value of the type.",type:"string",enum:["number"]},title:{description:"Title of the schema.",type:"string"},description:{description:"Detailed description of the schema.",type:"string"},deprecated:{description:"Whether the type is deprecated or not.",type:"boolean"},example:{description:"Example value."},examples:{$ref:"#/$defs/Recordstringany"}},required:["type"]},"IChatGptSchema.IInteger":{description:`Integer type info.
|
|
1741
1744
|
|
|
1742
1745
|
### Description of {@link examples} property:
|
|
1743
1746
|
|
|
1744
|
-
> List of example values as key-value pairs.`,type:"object",properties:{enum:{
|
|
1747
|
+
> List of example values as key-value pairs.`,type:"object",properties:{enum:{description:"Enumeration values.",type:"array",items:{type:"number"}},type:{description:"Discriminator value of the type.",type:"string",enum:["integer"]},title:{description:"Title of the schema.",type:"string"},description:{description:"Detailed description of the schema.",type:"string"},deprecated:{description:"Whether the type is deprecated or not.",type:"boolean"},example:{description:"Example value."},examples:{$ref:"#/$defs/Recordstringany"}},required:["type"]},"IChatGptSchema.IBoolean":{description:`Boolean type info.
|
|
1745
1748
|
|
|
1746
1749
|
### Description of {@link examples} property:
|
|
1747
1750
|
|
|
1748
|
-
> List of example values as key-value pairs.`,type:"object",properties:{enum:{
|
|
1751
|
+
> List of example values as key-value pairs.`,type:"object",properties:{enum:{description:"Enumeration values.",type:"array",items:{type:"boolean"}},type:{description:"Discriminator value of the type.",type:"string",enum:["boolean"]},title:{description:"Title of the schema.",type:"string"},description:{description:"Detailed description of the schema.",type:"string"},deprecated:{description:"Whether the type is deprecated or not.",type:"boolean"},example:{description:"Example value."},examples:{$ref:"#/$defs/Recordstringany"}},required:["type"]},"IChatGptSchema.IArray":{description:`Array type info.
|
|
1749
1752
|
|
|
1750
1753
|
### Description of {@link items} property:
|
|
1751
1754
|
|
|
@@ -1756,11 +1759,11 @@ so that they are listed in the \`required\` list.
|
|
|
1756
1759
|
|
|
1757
1760
|
### Description of {@link examples} property:
|
|
1758
1761
|
|
|
1759
|
-
> List of example values as key-value pairs.`,type:"object",properties:{items:{
|
|
1762
|
+
> List of example values as key-value pairs.`,type:"object",properties:{items:{$ref:"#/$defs/IChatGptSchema"},type:{description:"Discriminator value of the type.",type:"string",enum:["array"]},title:{description:"Title of the schema.",type:"string"},description:{description:"Detailed description of the schema.",type:"string"},deprecated:{description:"Whether the type is deprecated or not.",type:"boolean"},example:{description:"Example value."},examples:{$ref:"#/$defs/Recordstringany"}},required:["items","type"]},"IChatGptSchema.IReference":{description:`Reference type directing named schema.
|
|
1760
1763
|
|
|
1761
1764
|
### Description of {@link examples} property:
|
|
1762
1765
|
|
|
1763
|
-
> List of example values as key-value pairs.`,type:"object",properties:{$ref:{
|
|
1766
|
+
> List of example values as key-value pairs.`,type:"object",properties:{$ref:{description:"Reference to the named schema.\n\nThe `ref` is a reference to the named schema. Format of the `$ref` is\nfollowing the JSON Pointer specification. In the OpenAPI, the `$ref`\nstarts with `#/$defs/` which means the type is stored in the\n{@link IChatGptSchema.IParameters.$defs} object.\n\n- `#/$defs/SomeObject`\n- `#/$defs/AnotherObject`",type:"string"},title:{description:"Title of the schema.",type:"string"},description:{description:"Detailed description of the schema.",type:"string"},deprecated:{description:"Whether the type is deprecated or not.",type:"boolean"},example:{description:"Example value."},examples:{$ref:"#/$defs/Recordstringany"}},required:["$ref"]},"IChatGptSchema.IAnyOf":{description:`Union type.
|
|
1764
1767
|
|
|
1765
1768
|
\`IAnyOf\` represents an union type of the TypeScript (\`A | B | C\`).
|
|
1766
1769
|
|
|
@@ -1774,35 +1777,35 @@ to \`oneOf\` type.
|
|
|
1774
1777
|
|
|
1775
1778
|
### Description of {@link examples} property:
|
|
1776
1779
|
|
|
1777
|
-
> List of example values as key-value pairs.`,type:"object",properties:{anyOf:{
|
|
1780
|
+
> List of example values as key-value pairs.`,type:"object",properties:{anyOf:{description:"List of the union types.",type:"array",items:{anyOf:[{$ref:"#/$defs/IChatGptSchema.IObject"},{$ref:"#/$defs/IChatGptSchema.IString"},{$ref:"#/$defs/IChatGptSchema.INumber"},{$ref:"#/$defs/IChatGptSchema.IInteger"},{$ref:"#/$defs/IChatGptSchema.IBoolean"},{$ref:"#/$defs/IChatGptSchema.IArray"},{$ref:"#/$defs/IChatGptSchema.IReference"},{$ref:"#/$defs/IChatGptSchema.IUnknown"},{$ref:"#/$defs/IChatGptSchema.INull"}]}},"x-discriminator":{$ref:"#/$defs/IChatGptSchema.IAnyOf.IDiscriminator"},title:{description:"Title of the schema.",type:"string"},description:{description:"Detailed description of the schema.",type:"string"},deprecated:{description:"Whether the type is deprecated or not.",type:"boolean"},example:{description:"Example value."},examples:{$ref:"#/$defs/Recordstringany"}},required:["anyOf"]},"IChatGptSchema.IUnknown":{description:`Unknown, the \`any\` type.
|
|
1778
1781
|
|
|
1779
1782
|
### Description of {@link examples} property:
|
|
1780
1783
|
|
|
1781
|
-
> List of example values as key-value pairs.`,type:"object",properties:{title:{
|
|
1784
|
+
> List of example values as key-value pairs.`,type:"object",properties:{title:{description:"Title of the schema.",type:"string"},description:{description:"Detailed description of the schema.",type:"string"},deprecated:{description:"Whether the type is deprecated or not.",type:"boolean"},example:{description:"Example value."},examples:{$ref:"#/$defs/Recordstringany"}},required:[]},"IChatGptSchema.INull":{description:`Null type.
|
|
1782
1785
|
|
|
1783
1786
|
### Description of {@link examples} property:
|
|
1784
1787
|
|
|
1785
|
-
> List of example values as key-value pairs.`,type:"object",properties:{type:{
|
|
1788
|
+
> List of example values as key-value pairs.`,type:"object",properties:{type:{description:"Discriminator value of the type.",type:"string",enum:["null"]},title:{description:"Title of the schema.",type:"string"},description:{description:"Detailed description of the schema.",type:"string"},deprecated:{description:"Whether the type is deprecated or not.",type:"boolean"},example:{description:"Example value."},examples:{$ref:"#/$defs/Recordstringany"}},required:["type"]},"IChatGptSchema.IAnyOf.IDiscriminator":{description:"Discriminator info of the union type.\n\n### Description of {@link mapping} property:\n\n> Mapping of the discriminator value to the schema name.\n> \n> This property is valid only for {@link IReference} typed\n> {@link IAnyOf.oneof} elements. Therefore, `key` of `mapping` is the\n> discriminator value, and `value` of `mapping` is the schema name like\n> `#/components/schemas/SomeObject`.",type:"object",properties:{propertyName:{description:"Property name for the discriminator.",type:"string"},mapping:{$ref:"#/$defs/Recordstringstring"}},required:["propertyName"]},Recordstringstring:{description:"Construct a type with a set of properties K of type T",type:"object",properties:{},required:[],additionalProperties:{type:"string"}},"IHttpLlmFunction.ISeparatedchatgpt":{description:`Collection of separated parameters.
|
|
1786
1789
|
|
|
1787
1790
|
### Description of {@link llm} property:
|
|
1788
1791
|
|
|
1789
1792
|
> Parameters that would be composed by the LLM.
|
|
1790
1793
|
>
|
|
1791
1794
|
> Even though no property exists in the LLM side, the \`llm\` property would
|
|
1792
|
-
> have at least empty object type.`,type:"object",properties:{llm:{
|
|
1795
|
+
> have at least empty object type.`,type:"object",properties:{llm:{$ref:"#/$defs/IChatGptSchema.IParameters"},human:{description:"Parameters that would be composed by the human.",anyOf:[{type:"null"},{$ref:"#/$defs/IChatGptSchema.IParameters"}]}},required:["llm","human"]}}},output:{type:"array",items:{$ref:"#/$defs/IHttpLlmFunctionchatgpt"}},description:`Get list of API functions.
|
|
1793
1796
|
|
|
1794
1797
|
If user seems like to request some function calling except this one,
|
|
1795
1798
|
call this \`getApiFunctions()\` to get the list of candidate API functions
|
|
1796
1799
|
provided from this application.
|
|
1797
1800
|
|
|
1798
1801
|
Also, user just wants to list up every remote API functions that can be
|
|
1799
|
-
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=c$(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
|
|
1802
|
+
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=c$(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 YDn(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))??A6.INITIALIZE}],tools:[{type:"function",function:{name:Cbt.name,description:Cbt.description,parameters:Cbt.parameters}}],tool_choice:"auto"}),p=[],y=await vC.reduce(s,async(z,G)=>{const q=await z,et=tt=>{var nt;for(const st of tt){if(st.finish_reason!=null){(nt=p[st.index])==null||nt.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 VIe;p[st.index]={content:st.delta.content,mpsc:at},at.produce(st.delta.content);const Ot=GFt({stream:Xmt(at.consumer.getReader()),done:()=>at.done(),get:()=>p[st.index].content,join:async()=>(await at.waitClosed(),p[st.index].content)});o.dispatch(Ot)}};return q.object==="chat.completion.chunk"?(et([q,G].flatMap(tt=>tt.choices)),I6.merge([q,G])):(et(G.choices),I6.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 VDn(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=nRn({selection:y});o.dispatch(C)}const Abt={functions:[{name:"selectFunctions",parameters:{description:` Properties of the function
|
|
1800
1803
|
|
|
1801
1804
|
------------------------------
|
|
1802
1805
|
|
|
1803
|
-
Current Type: {@link __IChatFunctionReference.IProps}`,type:"object",properties:{functions:{
|
|
1806
|
+
Current Type: {@link __IChatFunctionReference.IProps}`,type:"object",properties:{functions:{description:"List of target functions.",type:"array",items:{$ref:"#/$defs/___IChatFunctionReference"}}},required:["functions"],additionalProperties:!1,$defs:{___IChatFunctionReference:{type:"object",properties:{reason:{description:`The reason of the function selection.
|
|
1804
1807
|
|
|
1805
|
-
Just write the reason why you've determined to select this function.`,type:"string"},name:{
|
|
1808
|
+
Just write the reason why you've determined to select this function.`,type:"string"},name:{description:"Name of the target function to call.",type:"string"}},required:["reason","name"]}}},description:`Select proper API functions to call.
|
|
1806
1809
|
|
|
1807
1810
|
If you A.I. agent has found some proper API functions to call
|
|
1808
1811
|
from the conversation with user, please select the API functions
|
|
@@ -1816,19 +1819,19 @@ them all into the \`functions\` property.
|
|
|
1816
1819
|
Also, if you A.I. agent can't specify a specific function to call due to lack
|
|
1817
1820
|
of specificity or homogeneity of candidate functions, just assign all of them
|
|
1818
1821
|
by in the\` functions\` property\` too. Instead, when you A.I. agent can specify
|
|
1819
|
-
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((et,tt)=>(typeof et=="object"&&et!==null||L(q,{path:G+".functions["+tt+"]",expected:"___IChatFunctionReference",value:et}))&&y(et,G+".functions["+tt+"]",q)||L(q,{path:G+".functions["+tt+"]",expected:"___IChatFunctionReference",value:et})).every(et=>et)||L(q,{path:G+".functions",expected:"Array<___IChatFunctionReference>",value:z.functions})].every(et=>et),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(et=>et),C=z=>typeof z=="object"&&z!==null&&o(z);let N,L;return z=>{if(C(z)===!1){N=[],L=c$(N),((q,et,tt=!0)=>(typeof q=="object"&&q!==null||L(!0,{path:et+"",expected:"__IChatFunctionReference.IProps",value:q}))&&p(q,et+"",!0)||L(!0,{path:et+"",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
|
|
1820
|
-
`)}]).flat()}function QDn(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:GDn)(s),s.ready()===!1)return}if(s.stack.length!==0&&await((o==null?void 0:o.cancel)??zDn)(s),await((o==null?void 0:o.select)??VDn)(s),s.stack.length!==0)for(;;){const p=await((o==null?void 0:o.call)??LDn)(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:KDn)(s,p),p.length===0||s.stack.length===0)break}}}function JDn(o){return o.history.type==="userMessage"?eBn({history:o.history}):o.history.type==="assistantMessage"?ZDn({history:o.history}):o.history.type==="systemMessage"?tBn({history:o.history}):o.history.type==="select"?nBn({operations:o.operations,history:o.history}):o.history.type==="cancel"?rBn({operations:o.operations,history:o.history}):o.history.type==="execute"?XIe({operations:o.operations,history:o.history}):iBn({operations:o.operations,history:o.history})}function ZDn(o){return XMn(o.history)}function tBn(o){return QMn(o.history)}function eBn(o){return DIe(o.history)}function nBn(o){return BIe({id:o.history.id,created_at:o.history.created_at,selection:Qmt({operation:VFt({operations:o.operations,input:o.history.selection.operation}),reason:o.history.selection.reason})})}function rBn(o){return ZMn({id:o.history.id,created_at:o.history.created_at,selection:Qmt({operation:VFt({operations:o.operations,input:o.history.selection.operation}),reason:o.history.selection.reason})})}function XIe(o){return FIe({id:o.history.id,created_at:o.history.created_at,operation:VFt({operations:o.operations,input:o.history.operation}),arguments:o.history.arguments,value:o.history.value})}function iBn(o){return JMn({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 VFt(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 QIe{constructor(s){var p,y;this.props=s,this.operations_=VMn.compose({controllers:s.controllers,config:s.config}),this.stack_=[],this.listeners_=new Map,this.histories_=(s.histories??[]).map(C=>JDn({operations:this.operations_.group,history:C})),this.executor_=typeof((p=s.config)==null?void 0:p.executor)=="function"?s.config.executor:QDn(((y=s.config)==null?void 0:y.executor)??null),this.semaphore_=s.vendor.semaphore!=null?typeof s.vendor.semaphore=="object"?s.vendor.semaphore:new SBt(s.vendor.semaphore):null,this.token_usage_=this.props.tokenUsage!==void 0?this.props.tokenUsage instanceof dP?this.props.tokenUsage:new dP(this.props.tokenUsage):dP.zero(),this.ready_=!1}clone(){var s;return new QIe({...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=sRn({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=cRn({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)??(Ot=>{throw Ot.error}),z=await(async()=>{let Ot=0;for(;;)try{return await this.props.vendor.api.chat.completions.create(N.body,N.options)}catch(Dt){const St=L({count:Ot,error:Dt});await new Promise(ie=>setTimeout(ie,St)),Ot++}})(),[G,q]=vC.transform(z.toReadableStream(),Ot=>I6.transformCompletionChunk(Ot)).tee(),[et,tt]=q.tee();(async()=>{const Ot=et.getReader();for(;;){const Dt=await Ot.read();if(Dt.done)break;Dt.value.usage!=null&&MIe.aggregate({kind:y,completionUsage:Dt.value.usage,usage:s.usage})}})().catch(()=>{});const[nt,st]=G.tee();return s.dispatch({id:wk(),type:"response",source:y,stream:Xmt(nt.getReader()),body:N.body,options:N.options,join:async()=>{const Ot=await vC.readAll(st);return I6.merge(Ot)},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(tRn())}}}on(s,p){return RIe(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 JIe=function(){const{crypto:o}=globalThis;if(o!=null&&o.randomUUID)return JIe=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 ZBt(o){return typeof o=="object"&&o!==null&&("name"in o&&o.name==="AbortError"||"message"in o&&String(o.message).includes("FetchRequestCanceledException"))}const tFt=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:tFt(p)});const N=p==null?void 0:p.error;return s===400?new ZIe(s,N,y,C):s===401?new tOe(s,N,y,C):s===403?new eOe(s,N,y,C):s===404?new nOe(s,N,y,C):s===409?new rOe(s,N,y,C):s===422?new iOe(s,N,y,C):s===429?new aOe(s,N,y,C):s>=500?new sOe(s,N,y,C):new Lg(s,N,y,C)}}class I3 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 XFt extends Jmt{constructor({message:s}={}){super({message:s??"Request timed out."})}}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 Lg{}class oOe extends Ho{constructor(){super("Could not parse response content as the length limit was reached")}}class cOe extends Ho{constructor(){super("Could not parse response content as the request was rejected by the content filter")}}const aBn=/^[a-z][a-z0-9+.-]*:/i,sBn=o=>aBn.test(o);function oBn(o){return typeof o!="object"?{}:o??{}}function cBn(o){if(!o)return!0;for(const s in o)return!1;return!0}function uBn(o,s){return Object.prototype.hasOwnProperty.call(o,s)}function qDt(o){return o!=null&&typeof o=="object"&&!Array.isArray(o)}const lBn=(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},hBn=o=>{try{return JSON.parse(o)}catch{return}},ZQ=o=>new Promise(s=>setTimeout(s,o)),Tmt={off:0,error:200,warn:300,info:400,debug:500},jCe=(o,s,p)=>{if(o){if(uBn(Tmt,o))return o;Tb(p).warn(`${s} was set to ${JSON.stringify(o)}, expected one of ${JSON.stringify(Object.keys(Tmt))}`)}};function yQ(){}function Ibt(o,s,p){return!s||Tmt[o]>Tmt[p]?yQ:s[o].bind(s)}const fBn={error:yQ,warn:yQ,info:yQ,debug:yQ};let HCe=new WeakMap;function Tb(o){const s=o.logger,p=o.logLevel??"off";if(!s)return fBn;const y=HCe.get(s);if(y&&y[0]===p)return y[1];const C={error:Ibt("error",s,p),warn:Ibt("warn",s,p),info:Ibt("info",s,p),debug:Ibt("debug",s,p)};return HCe.set(s,[p,C]),C}const sP=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",dBn=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function pBn(){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 gBn=()=>{var p;const o=pBn();if(o==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":BF,"X-Stainless-OS":UCe(Deno.build.os),"X-Stainless-Arch":zCe(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":UCe(globalThis.process.platform??"unknown"),"X-Stainless-Arch":zCe(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};const s=bBn();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 bBn(){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 zCe=o=>o==="x32"?"x32":o==="x86_64"||o==="x64"?"x64":o==="arm"?"arm":o==="aarch64"||o==="arm64"?"arm64":o?`other:${o}`:"unknown",UCe=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 qCe;const mBn=()=>qCe??(qCe=gBn());function yBn(){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 uOe(...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 lOe(o){let s=Symbol.asyncIterator in o?o[Symbol.asyncIterator]():o[Symbol.iterator]();return uOe({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 hOe(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 wBn(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 vBn=({headers:o,body:s})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(s)}),eFt="RFC3986",nFt={RFC1738:o=>String(o).replace(/%20/g,"+"),RFC3986:o=>String(o)},_Bn="RFC1738",xBn=Array.isArray,y6=(()=>{const o=[];for(let s=0;s<256;++s)o.push("%"+((s<16?"0":"")+s.toString(16)).toUpperCase());return o})(),WDt=1024,EBn=(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+=WDt){const G=N.length>=WDt?N.slice(z,z+WDt):N,q=[];for(let et=0;et<G.length;++et){let tt=G.charCodeAt(et);if(tt===45||tt===46||tt===95||tt===126||tt>=48&&tt<=57||tt>=65&&tt<=90||tt>=97&&tt<=122||C===_Bn&&(tt===40||tt===41)){q[q.length]=G.charAt(et);continue}if(tt<128){q[q.length]=y6[tt];continue}if(tt<2048){q[q.length]=y6[192|tt>>6]+y6[128|tt&63];continue}if(tt<55296||tt>=57344){q[q.length]=y6[224|tt>>12]+y6[128|tt>>6&63]+y6[128|tt&63];continue}et+=1,tt=65536+((tt&1023)<<10|G.charCodeAt(et)&1023),q[q.length]=y6[240|tt>>18]+y6[128|tt>>12&63]+y6[128|tt>>6&63]+y6[128|tt&63]}L+=q.join("")}return L};function TBn(o){return!o||typeof o!="object"?!1:!!(o.constructor&&o.constructor.isBuffer&&o.constructor.isBuffer(o))}function WCe(o,s){if(xBn(o)){const p=[];for(let y=0;y<o.length;y+=1)p.push(s(o[y]));return p}return s(o)}const kBn=Object.prototype.hasOwnProperty,fOe={brackets(o){return String(o)+"[]"},comma:"comma",indices(o,s){return String(o)+"["+s+"]"},repeat(o){return String(o)}},_6=Array.isArray,SBn=Array.prototype.push,dOe=function(o,s){SBn.apply(o,_6(s)?s:[s])},CBn=Date.prototype.toISOString,np={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:EBn,encodeValuesOnly:!1,format:eFt,formatter:nFt[eFt],indices:!1,serializeDate(o){return CBn.call(o)},skipNulls:!1,strictNullHandling:!1};function ABn(o){return typeof o=="string"||typeof o=="number"||typeof o=="boolean"||typeof o=="symbol"||typeof o=="bigint"}const KDt={};function pOe(o,s,p,y,C,N,L,z,G,q,et,tt,nt,st,at,Ot,Dt,St){let ie=o,ae=St,Ne=0,pn=!1;for(;(ae=ae.get(KDt))!==void 0&&!pn;){const jn=ae.get(o);if(Ne+=1,typeof jn<"u"){if(jn===Ne)throw new RangeError("Cyclic object value");pn=!0}typeof ae.get(KDt)>"u"&&(Ne=0)}if(typeof q=="function"?ie=q(s,ie):ie instanceof Date?ie=nt==null?void 0:nt(ie):p==="comma"&&_6(ie)&&(ie=WCe(ie,function(jn){return jn instanceof Date?nt==null?void 0:nt(jn):jn})),ie===null){if(N)return G&&!Ot?G(s,np.encoder,Dt,"key",st):s;ie=""}if(ABn(ie)||TBn(ie)){if(G){const jn=Ot?s:G(s,np.encoder,Dt,"key",st);return[(at==null?void 0:at(jn))+"="+(at==null?void 0:at(G(ie,np.encoder,Dt,"value",st)))]}return[(at==null?void 0:at(s))+"="+(at==null?void 0:at(String(ie)))]}const de=[];if(typeof ie>"u")return de;let cn;if(p==="comma"&&_6(ie))Ot&&G&&(ie=WCe(ie,G)),cn=[{value:ie.length>0?ie.join(",")||null:void 0}];else if(_6(q))cn=q;else{const jn=Object.keys(ie);cn=et?jn.sort(et):jn}const er=z?String(s).replace(/\./g,"%2E"):String(s),Dn=y&&_6(ie)&&ie.length===1?er+"[]":er;if(C&&_6(ie)&&ie.length===0)return Dn+"[]";for(let jn=0;jn<cn.length;++jn){const or=cn[jn],gr=typeof or=="object"&&typeof or.value<"u"?or.value:ie[or];if(L&&gr===null)continue;const fi=tt&&z?or.replace(/\./g,"%2E"):or,pi=_6(ie)?typeof p=="function"?p(Dn,fi):Dn:Dn+(tt?"."+fi:"["+fi+"]");St.set(o,Ne);const Or=new WeakMap;Or.set(KDt,St),dOe(de,pOe(gr,pi,p,y,C,N,L,z,p==="comma"&&Ot&&_6(ie)?null:G,q,et,tt,nt,st,at,Ot,Dt,Or))}return de}function IBn(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=eFt;if(typeof o.format<"u"){if(!kBn.call(nFt,o.format))throw new TypeError("Unknown format option provided.");p=o.format}const y=nFt[p];let C=np.filter;(typeof o.filter=="function"||_6(o.filter))&&(C=o.filter);let N;if(o.arrayFormat&&o.arrayFormat in fOe?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 OBn(o,s={}){let p=o;const y=IBn(s);let C,N;typeof y.filter=="function"?(N=y.filter,p=N("",p)):_6(y.filter)&&(N=y.filter,C=N);const L=[];if(typeof p!="object"||p===null)return"";const z=fOe[y.arrayFormat],G=z==="comma"&&y.commaRoundTrip;C||(C=Object.keys(p)),y.sort&&C.sort(y.sort);const q=new WeakMap;for(let nt=0;nt<C.length;++nt){const st=C[nt];y.skipNulls&&p[st]===null||dOe(L,pOe(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 et=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&"),et.length>0?tt+et:""}function NBn(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 KCe;function QFt(o){let s;return(KCe??(s=new globalThis.TextEncoder,KCe=s.encode.bind(s)))(o)}let GCe;function YCe(o){let s;return(GCe??(s=new globalThis.TextDecoder,GCe=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"?QFt(s):s;tc(this,_w,NBn([wr(this,_w,"f"),p]));const y=[];let C;for(;(C=PBn(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(YCe(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=YCe(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(`
|
|
1822
|
+
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((et,tt)=>(typeof et=="object"&&et!==null||L(q,{path:G+".functions["+tt+"]",expected:"___IChatFunctionReference",value:et}))&&y(et,G+".functions["+tt+"]",q)||L(q,{path:G+".functions["+tt+"]",expected:"___IChatFunctionReference",value:et})).every(et=>et)||L(q,{path:G+".functions",expected:"Array<___IChatFunctionReference>",value:z.functions})].every(et=>et),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(et=>et),C=z=>typeof z=="object"&&z!==null&&o(z);let N,L;return z=>{if(C(z)===!1){N=[],L=c$(N),((q,et,tt=!0)=>(typeof q=="object"&&q!==null||L(!0,{path:et+"",expected:"__IChatFunctionReference.IProps",value:q}))&&p(q,et+"",!0)||L(!0,{path:et+"",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 XDn(o){var y;if(o.operations.divided===void 0)return Ubt(o,o.operations.array,0);const s=o.operations.divided.map(()=>[]),p=[];if(await Promise.all(o.operations.divided.map(async(C,N)=>Ubt({...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 Ubt(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 Ubt(o,s,p,y){var z,G,q,et;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(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.select)==null?void 0:q.call(G,o.histories))??A6.SELECT},...QDn(y??[])],tools:[{type:"function",function:{name:Abt.functions[0].name,description:Abt.functions[0].description,parameters:Abt.functions[0].parameters}}],tool_choice:p===0?"auto":{type:"function",function:{name:Abt.functions[0].name}}}),N=await vC.readAll(C),L=I6.merge(N);if(p++<(((et=o.config)==null?void 0:et.retry)??yk.RETRY)){const tt=[];for(const nt of L.choices)for(const st of nt.message.tool_calls??[]){if(st.function.name!=="selectFunctions")continue;const at=JSON.parse(st.function.arguments),Ot=(()=>{const Dt=cn=>Array.isArray(cn.functions)&&cn.functions.every(er=>typeof er=="object"&&er!==null&&St(er)),St=cn=>typeof cn.reason=="string"&&typeof cn.name=="string",ie=(cn,er,Dn=!0)=>[(Array.isArray(cn.functions)||de(Dn,{path:er+".functions",expected:"Array<___IChatFunctionReference>",value:cn.functions}))&&cn.functions.map((jn,or)=>(typeof jn=="object"&&jn!==null||de(Dn,{path:er+".functions["+or+"]",expected:"___IChatFunctionReference",value:jn}))&&ae(jn,er+".functions["+or+"]",Dn)||de(Dn,{path:er+".functions["+or+"]",expected:"___IChatFunctionReference",value:jn})).every(jn=>jn)||de(Dn,{path:er+".functions",expected:"Array<___IChatFunctionReference>",value:cn.functions})].every(jn=>jn),ae=(cn,er,Dn=!0)=>[typeof cn.reason=="string"||de(Dn,{path:er+".reason",expected:"string",value:cn.reason}),typeof cn.name=="string"||de(Dn,{path:er+".name",expected:"string",value:cn.name})].every(jn=>jn),Ne=cn=>typeof cn=="object"&&cn!==null&&Dt(cn);let pn,de;return cn=>{if(Ne(cn)===!1){pn=[],de=c$(pn),((Dn,jn,or=!0)=>(typeof Dn=="object"&&Dn!==null||de(!0,{path:jn+"",expected:"__IChatFunctionReference.IProps",value:Dn}))&&ie(Dn,jn+"",!0)||de(!0,{path:jn+"",expected:"__IChatFunctionReference.IProps",value:Dn}))(cn,"$input",!0);const er=pn.length===0;return er?{success:er,data:cn}:{success:er,errors:pn,data:cn}}return{success:!0,data:cn}}})()(at);Ot.success===!1&&tt.push({id:st.id,name:st.function.name,validation:Ot})}if(tt.length>0)return Ubt(o,s,p,tt)}for(const tt of L.choices){if(tt.message.tool_calls!=null)for(const nt of tt.message.tool_calls){if(nt.type!=="function")continue;if(nt.function.name!=="selectFunctions")continue;const st=(()=>{const at=St=>Array.isArray(St.functions)&&St.functions.every(ie=>typeof ie=="object"&&ie!==null&&Ot(ie)),Ot=St=>typeof St.reason=="string"&&typeof St.name=="string",Dt=St=>typeof St=="object"&&St!==null&&at(St);return St=>(St=JSON.parse(St),Dt(St)?St:null)})()(nt.function.arguments);if(st!==null)for(const at of st.functions)VDn(o,at)}if(tt.message.role==="assistant"&&tt.message.content!=null&&tt.message.content.length!==0){const nt=GFt({stream:WIe(tt.message.content),join:async()=>Promise.resolve(tt.message.content),done:()=>!0,get:()=>tt.message.content});o.dispatch(nt)}}}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(`
|
|
1823
|
+
`)}]).flat()}function JDn(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:YDn)(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)??XDn)(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:GDn)(s,p),p.length===0||s.stack.length===0)break}}}function ZDn(o){return o.history.type==="userMessage"?nBn({history:o.history}):o.history.type==="assistantMessage"?tBn({history:o.history}):o.history.type==="systemMessage"?eBn({history:o.history}):o.history.type==="select"?rBn({operations:o.operations,history:o.history}):o.history.type==="cancel"?iBn({operations:o.operations,history:o.history}):o.history.type==="execute"?XIe({operations:o.operations,history:o.history}):aBn({operations:o.operations,history:o.history})}function tBn(o){return QMn(o.history)}function eBn(o){return JMn(o.history)}function nBn(o){return DIe(o.history)}function rBn(o){return BIe({id:o.history.id,created_at:o.history.created_at,selection:Qmt({operation:VFt({operations:o.operations,input:o.history.selection.operation}),reason:o.history.selection.reason})})}function iBn(o){return tRn({id:o.history.id,created_at:o.history.created_at,selection:Qmt({operation:VFt({operations:o.operations,input:o.history.selection.operation}),reason:o.history.selection.reason})})}function XIe(o){return FIe({id:o.history.id,created_at:o.history.created_at,operation:VFt({operations:o.operations,input:o.history.operation}),arguments:o.history.arguments,value:o.history.value})}function aBn(o){return ZMn({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 VFt(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 QIe{constructor(s){var p,y;this.props=s,this.operations_=VMn.compose({controllers:s.controllers,config:s.config}),this.stack_=[],this.listeners_=new Map,this.histories_=(s.histories??[]).map(C=>ZDn({operations:this.operations_.group,history:C})),this.executor_=typeof((p=s.config)==null?void 0:p.executor)=="function"?s.config.executor:JDn(((y=s.config)==null?void 0:y.executor)??null),this.semaphore_=s.vendor.semaphore!=null?typeof s.vendor.semaphore=="object"?s.vendor.semaphore:new SBt(s.vendor.semaphore):null,this.token_usage_=this.props.tokenUsage!==void 0?this.props.tokenUsage instanceof dP?this.props.tokenUsage:new dP(this.props.tokenUsage):dP.zero(),this.ready_=!1}clone(){var s;return new QIe({...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=oRn({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=uRn({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)??(Ot=>{throw Ot.error}),z=await(async()=>{let Ot=0;for(;;)try{return await this.props.vendor.api.chat.completions.create(N.body,N.options)}catch(Dt){const St=L({count:Ot,error:Dt});await new Promise(ie=>setTimeout(ie,St)),Ot++}})(),[G,q]=vC.transform(z.toReadableStream(),Ot=>I6.transformCompletionChunk(Ot)).tee(),[et,tt]=q.tee();(async()=>{const Ot=et.getReader();for(;;){const Dt=await Ot.read();if(Dt.done)break;Dt.value.usage!=null&&MIe.aggregate({kind:y,completionUsage:Dt.value.usage,usage:s.usage})}})().catch(()=>{});const[nt,st]=G.tee();return s.dispatch({id:wk(),type:"response",source:y,stream:Xmt(nt.getReader()),body:N.body,options:N.options,join:async()=>{const Ot=await vC.readAll(st);return I6.merge(Ot)},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(eRn())}}}on(s,p){return RIe(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 JIe=function(){const{crypto:o}=globalThis;if(o!=null&&o.randomUUID)return JIe=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 ZBt(o){return typeof o=="object"&&o!==null&&("name"in o&&o.name==="AbortError"||"message"in o&&String(o.message).includes("FetchRequestCanceledException"))}const tFt=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:tFt(p)});const N=p==null?void 0:p.error;return s===400?new ZIe(s,N,y,C):s===401?new tOe(s,N,y,C):s===403?new eOe(s,N,y,C):s===404?new nOe(s,N,y,C):s===409?new rOe(s,N,y,C):s===422?new iOe(s,N,y,C):s===429?new aOe(s,N,y,C):s>=500?new sOe(s,N,y,C):new Lg(s,N,y,C)}}class I3 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 XFt extends Jmt{constructor({message:s}={}){super({message:s??"Request timed out."})}}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 Lg{}class oOe extends Ho{constructor(){super("Could not parse response content as the length limit was reached")}}class cOe extends Ho{constructor(){super("Could not parse response content as the request was rejected by the content filter")}}const sBn=/^[a-z][a-z0-9+.-]*:/i,oBn=o=>sBn.test(o);function cBn(o){return typeof o!="object"?{}:o??{}}function uBn(o){if(!o)return!0;for(const s in o)return!1;return!0}function lBn(o,s){return Object.prototype.hasOwnProperty.call(o,s)}function qDt(o){return o!=null&&typeof o=="object"&&!Array.isArray(o)}const hBn=(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},fBn=o=>{try{return JSON.parse(o)}catch{return}},ZQ=o=>new Promise(s=>setTimeout(s,o)),Tmt={off:0,error:200,warn:300,info:400,debug:500},jCe=(o,s,p)=>{if(o){if(lBn(Tmt,o))return o;Tb(p).warn(`${s} was set to ${JSON.stringify(o)}, expected one of ${JSON.stringify(Object.keys(Tmt))}`)}};function yQ(){}function Ibt(o,s,p){return!s||Tmt[o]>Tmt[p]?yQ:s[o].bind(s)}const dBn={error:yQ,warn:yQ,info:yQ,debug:yQ};let HCe=new WeakMap;function Tb(o){const s=o.logger,p=o.logLevel??"off";if(!s)return dBn;const y=HCe.get(s);if(y&&y[0]===p)return y[1];const C={error:Ibt("error",s,p),warn:Ibt("warn",s,p),info:Ibt("info",s,p),debug:Ibt("debug",s,p)};return HCe.set(s,[p,C]),C}const sP=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",pBn=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function gBn(){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 bBn=()=>{var p;const o=gBn();if(o==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":BF,"X-Stainless-OS":UCe(Deno.build.os),"X-Stainless-Arch":zCe(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":UCe(globalThis.process.platform??"unknown"),"X-Stainless-Arch":zCe(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};const s=mBn();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 mBn(){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 zCe=o=>o==="x32"?"x32":o==="x86_64"||o==="x64"?"x64":o==="arm"?"arm":o==="aarch64"||o==="arm64"?"arm64":o?`other:${o}`:"unknown",UCe=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 qCe;const yBn=()=>qCe??(qCe=bBn());function wBn(){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 uOe(...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 lOe(o){let s=Symbol.asyncIterator in o?o[Symbol.asyncIterator]():o[Symbol.iterator]();return uOe({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 hOe(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 vBn(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 _Bn=({headers:o,body:s})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(s)}),eFt="RFC3986",nFt={RFC1738:o=>String(o).replace(/%20/g,"+"),RFC3986:o=>String(o)},xBn="RFC1738",EBn=Array.isArray,y6=(()=>{const o=[];for(let s=0;s<256;++s)o.push("%"+((s<16?"0":"")+s.toString(16)).toUpperCase());return o})(),WDt=1024,TBn=(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+=WDt){const G=N.length>=WDt?N.slice(z,z+WDt):N,q=[];for(let et=0;et<G.length;++et){let tt=G.charCodeAt(et);if(tt===45||tt===46||tt===95||tt===126||tt>=48&&tt<=57||tt>=65&&tt<=90||tt>=97&&tt<=122||C===xBn&&(tt===40||tt===41)){q[q.length]=G.charAt(et);continue}if(tt<128){q[q.length]=y6[tt];continue}if(tt<2048){q[q.length]=y6[192|tt>>6]+y6[128|tt&63];continue}if(tt<55296||tt>=57344){q[q.length]=y6[224|tt>>12]+y6[128|tt>>6&63]+y6[128|tt&63];continue}et+=1,tt=65536+((tt&1023)<<10|G.charCodeAt(et)&1023),q[q.length]=y6[240|tt>>18]+y6[128|tt>>12&63]+y6[128|tt>>6&63]+y6[128|tt&63]}L+=q.join("")}return L};function kBn(o){return!o||typeof o!="object"?!1:!!(o.constructor&&o.constructor.isBuffer&&o.constructor.isBuffer(o))}function WCe(o,s){if(EBn(o)){const p=[];for(let y=0;y<o.length;y+=1)p.push(s(o[y]));return p}return s(o)}const SBn=Object.prototype.hasOwnProperty,fOe={brackets(o){return String(o)+"[]"},comma:"comma",indices(o,s){return String(o)+"["+s+"]"},repeat(o){return String(o)}},_6=Array.isArray,CBn=Array.prototype.push,dOe=function(o,s){CBn.apply(o,_6(s)?s:[s])},ABn=Date.prototype.toISOString,np={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:TBn,encodeValuesOnly:!1,format:eFt,formatter:nFt[eFt],indices:!1,serializeDate(o){return ABn.call(o)},skipNulls:!1,strictNullHandling:!1};function IBn(o){return typeof o=="string"||typeof o=="number"||typeof o=="boolean"||typeof o=="symbol"||typeof o=="bigint"}const KDt={};function pOe(o,s,p,y,C,N,L,z,G,q,et,tt,nt,st,at,Ot,Dt,St){let ie=o,ae=St,Ne=0,pn=!1;for(;(ae=ae.get(KDt))!==void 0&&!pn;){const jn=ae.get(o);if(Ne+=1,typeof jn<"u"){if(jn===Ne)throw new RangeError("Cyclic object value");pn=!0}typeof ae.get(KDt)>"u"&&(Ne=0)}if(typeof q=="function"?ie=q(s,ie):ie instanceof Date?ie=nt==null?void 0:nt(ie):p==="comma"&&_6(ie)&&(ie=WCe(ie,function(jn){return jn instanceof Date?nt==null?void 0:nt(jn):jn})),ie===null){if(N)return G&&!Ot?G(s,np.encoder,Dt,"key",st):s;ie=""}if(IBn(ie)||kBn(ie)){if(G){const jn=Ot?s:G(s,np.encoder,Dt,"key",st);return[(at==null?void 0:at(jn))+"="+(at==null?void 0:at(G(ie,np.encoder,Dt,"value",st)))]}return[(at==null?void 0:at(s))+"="+(at==null?void 0:at(String(ie)))]}const de=[];if(typeof ie>"u")return de;let cn;if(p==="comma"&&_6(ie))Ot&&G&&(ie=WCe(ie,G)),cn=[{value:ie.length>0?ie.join(",")||null:void 0}];else if(_6(q))cn=q;else{const jn=Object.keys(ie);cn=et?jn.sort(et):jn}const er=z?String(s).replace(/\./g,"%2E"):String(s),Dn=y&&_6(ie)&&ie.length===1?er+"[]":er;if(C&&_6(ie)&&ie.length===0)return Dn+"[]";for(let jn=0;jn<cn.length;++jn){const or=cn[jn],gr=typeof or=="object"&&typeof or.value<"u"?or.value:ie[or];if(L&&gr===null)continue;const fi=tt&&z?or.replace(/\./g,"%2E"):or,pi=_6(ie)?typeof p=="function"?p(Dn,fi):Dn:Dn+(tt?"."+fi:"["+fi+"]");St.set(o,Ne);const Or=new WeakMap;Or.set(KDt,St),dOe(de,pOe(gr,pi,p,y,C,N,L,z,p==="comma"&&Ot&&_6(ie)?null:G,q,et,tt,nt,st,at,Ot,Dt,Or))}return de}function OBn(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=eFt;if(typeof o.format<"u"){if(!SBn.call(nFt,o.format))throw new TypeError("Unknown format option provided.");p=o.format}const y=nFt[p];let C=np.filter;(typeof o.filter=="function"||_6(o.filter))&&(C=o.filter);let N;if(o.arrayFormat&&o.arrayFormat in fOe?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 NBn(o,s={}){let p=o;const y=OBn(s);let C,N;typeof y.filter=="function"?(N=y.filter,p=N("",p)):_6(y.filter)&&(N=y.filter,C=N);const L=[];if(typeof p!="object"||p===null)return"";const z=fOe[y.arrayFormat],G=z==="comma"&&y.commaRoundTrip;C||(C=Object.keys(p)),y.sort&&C.sort(y.sort);const q=new WeakMap;for(let nt=0;nt<C.length;++nt){const st=C[nt];y.skipNulls&&p[st]===null||dOe(L,pOe(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 et=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&"),et.length>0?tt+et:""}function PBn(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 KCe;function QFt(o){let s;return(KCe??(s=new globalThis.TextEncoder,KCe=s.encode.bind(s)))(o)}let GCe;function YCe(o){let s;return(GCe??(s=new globalThis.TextDecoder,GCe=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"?QFt(s):s;tc(this,_w,PBn([wr(this,_w,"f"),p]));const y=[];let C;for(;(C=LBn(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(YCe(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=YCe(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(`
|
|
1821
1824
|
`):[]}}_w=new WeakMap,xw=new WeakMap;Zmt.NEWLINE_CHARS=new Set([`
|
|
1822
|
-
`,"\r"]);Zmt.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function
|
|
1823
|
-
`);y.enqueue(L)}catch(C){y.error(C)}},async cancel(){var y;await((y=p.return)==null?void 0:y.call(p))}})}}async function*
|
|
1824
|
-
`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],N}if(this.chunks.push(s),s.startsWith(":"))return null;let[p,y,C]=
|
|
1825
|
+
`,"\r"]);Zmt.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function LBn(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 MBn(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 S6{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 RBn(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(ZBt(L))return;throw L}finally{N||p.abort()}}return new S6(C,p)}static fromReadableStream(s,p){let y=!1;async function*C(){const L=new Zmt,z=hOe(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(ZBt(z))return;throw z}finally{L||p.abort()}}return new S6(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 S6(()=>C(s),this.controller),new S6(()=>C(p),this.controller)]}toReadableStream(){const s=this;let p;return uOe({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=QFt(JSON.stringify(C)+`
|
|
1826
|
+
`);y.enqueue(L)}catch(C){y.error(C)}},async cancel(){var y;await((y=p.return)==null?void 0:y.call(p))}})}}async function*RBn(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 BBn,y=new Zmt,C=hOe(o.body);for await(const N of DBn(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*DBn(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"?QFt(p):p;let C=new Uint8Array(s.length+y.length);C.set(s),C.set(y,s.length),s=C;let N;for(;(N=MBn(s))!==-1;)yield s.slice(0,N),s=s.slice(N)}s.length>0&&(yield s)}class BBn{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(`
|
|
1827
|
+
`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],N}if(this.chunks.push(s),s.startsWith(":"))return null;let[p,y,C]=FBn(s,":");return C.startsWith(" ")&&(C=C.substring(1)),p==="event"?this.event=C:p==="data"&&this.data.push(C),null}}function FBn(o,s){const p=o.indexOf(s);return p!==-1?[o.substring(0,p),s,o.substring(p+s.length)]:[o,"",""]}async function gOe(o,s){const{response:p,requestLogID:y,retryOfRequestLogID:C,startTime:N}=s,L=await(async()=>{var tt;if(s.options.stream)return Tb(o).debug("response",p.status,p.url,p.headers,p.body),s.options.__streamClass?s.options.__streamClass.fromSSEResponse(p,s.controller):S6.fromSSEResponse(p,s.controller);if(p.status===204)return null;if(s.options.__binaryResponse)return p;const z=p.headers.get("content-type"),G=(tt=z==null?void 0:z.split(";")[0])==null?void 0:tt.trim();if((G==null?void 0:G.includes("application/json"))||(G==null?void 0:G.endsWith("+json"))){const nt=await p.json();return bOe(nt,p)}return await p.text()})();return Tb(o).debug(`[${y}] response parsed`,sP({retryOfRequestLogID:C,url:p.url,status:p.status,body:L,durationMs:Date.now()-N})),L}function bOe(o,s){return!o||typeof o!="object"||Array.isArray(o)?o:Object.defineProperty(o,"_request_id",{value:s.headers.get("x-request-id"),enumerable:!1})}var wQ;class t2t extends Promise{constructor(s,p,y=gOe){super(C=>{C(null)}),this.responsePromise=p,this.parseResponse=y,wQ.set(this,void 0),tc(this,wQ,s)}_thenUnwrap(s){return new t2t(wr(this,wQ,"f"),this.responsePromise,async(p,y)=>bOe(s(await this.parseResponse(p,y),y),y.response))}asResponse(){return this.responsePromise.then(s=>s.response)}async withResponse(){const[s,p]=await Promise.all([this.parse(),this.asResponse()]);return{data:s,response:p,request_id:p.headers.get("x-request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(s=>this.parseResponse(wr(this,wQ,"f"),s))),this.parsedPromise}then(s,p){return this.parse().then(s,p)}catch(s){return this.parse().catch(s)}finally(s){return this.parse().finally(s)}}wQ=new WeakMap;var Obt;class mOe{constructor(s,p,y,C){Obt.set(this,void 0),tc(this,Obt,s),this.options=C,this.response=p,this.body=y}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){const s=this.nextPageRequestOptions();if(!s)throw new Ho("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await wr(this,Obt,"f").requestAPIList(this.constructor,s)}async*iterPages(){let s=this;for(yield s;s.hasNextPage();)s=await s.getNextPage(),yield s}async*[(Obt=new WeakMap,Symbol.asyncIterator)](){for await(const s of this.iterPages())for(const p of s.getPaginatedItems())yield p}}class $Bn extends t2t{constructor(s,p,y){super(s,p,async(C,N)=>new y(C,N.response,await gOe(C,N),N.options))}async*[Symbol.asyncIterator](){const s=await this;for await(const p of s)yield p}}class e2t extends mOe{constructor(s,p,y,C){super(s,p,y,C),this.data=y.data||[],this.object=y.object}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){return null}}class f0 extends mOe{constructor(s,p,y,C){super(s,p,y,C),this.data=y.data||[],this.has_more=y.has_more||!1}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){var y;const s=this.getPaginatedItems(),p=(y=s[s.length-1])==null?void 0:y.id;return p?{...this.options,query:{...cBn(this.options.query),after:p}}:null}}const yOe=()=>{var o;if(typeof File>"u"){const{process:s}=globalThis,p=typeof((o=s==null?void 0:s.versions)==null?void 0:o.node)=="string"&&parseInt(s.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(p?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function IQ(o,s,p){return yOe(),new File(o,s??"unknown_file",p)}function qbt(o){return(typeof o=="object"&&o!==null&&("name"in o&&o.name&&String(o.name)||"url"in o&&o.url&&String(o.url)||"filename"in o&&o.filename&&String(o.filename)||"path"in o&&o.path&&String(o.path))||"").split(/[\\/]/).pop()||void 0}const wOe=o=>o!=null&&typeof o=="object"&&typeof o[Symbol.asyncIterator]=="function",wP=async(o,s)=>({...o,body:await HBn(o.body,s)}),VCe=new WeakMap;function jBn(o){const s=typeof o=="function"?o:o.fetch,p=VCe.get(s);if(p)return p;const y=(async()=>{try{const C="Response"in s?s.Response:(await s("data:,")).constructor,N=new FormData;return N.toString()!==await new C(N).text()}catch{return!0}})();return VCe.set(s,y),y}const HBn=async(o,s)=>{if(!await jBn(s))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");const p=new FormData;return await Promise.all(Object.entries(o||{}).map(([y,C])=>rFt(p,y,C))),p},zBn=o=>o instanceof Blob&&"name"in o,rFt=async(o,s,p)=>{if(p!==void 0){if(p==null)throw new TypeError(`Received null for "${s}"; to pass null in FormData, you must use the string 'null'`);if(typeof p=="string"||typeof p=="number"||typeof p=="boolean")o.append(s,String(p));else if(p instanceof Response)o.append(s,IQ([await p.blob()],qbt(p)));else if(wOe(p))o.append(s,IQ([await new Response(lOe(p)).blob()],qbt(p)));else if(zBn(p))o.append(s,p,qbt(p));else if(Array.isArray(p))await Promise.all(p.map(y=>rFt(o,s+"[]",y)));else if(typeof p=="object")await Promise.all(Object.entries(p).map(([y,C])=>rFt(o,`${s}[${y}]`,C)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${p} instead`)}},vOe=o=>o!=null&&typeof o=="object"&&typeof o.size=="number"&&typeof o.type=="string"&&typeof o.text=="function"&&typeof o.slice=="function"&&typeof o.arrayBuffer=="function",UBn=o=>o!=null&&typeof o=="object"&&typeof o.name=="string"&&typeof o.lastModified=="number"&&vOe(o),qBn=o=>o!=null&&typeof o=="object"&&typeof o.url=="string"&&typeof o.blob=="function";async function WBn(o,s,p){if(yOe(),o=await o,UBn(o))return o instanceof File?o:IQ([await o.arrayBuffer()],o.name);if(qBn(o)){const C=await o.blob();return s||(s=new URL(o.url).pathname.split(/[\\/]/).pop()),IQ(await iFt(C),s,p)}const y=await iFt(o);if(s||(s=qbt(o)),!(p!=null&&p.type)){const C=y.find(N=>typeof N=="object"&&"type"in N&&N.type);typeof C=="string"&&(p={...p,type:C})}return IQ(y,s,p)}async function iFt(o){var p;let s=[];if(typeof o=="string"||ArrayBuffer.isView(o)||o instanceof ArrayBuffer)s.push(o);else if(vOe(o))s.push(o instanceof Blob?o:await o.arrayBuffer());else if(wOe(o))for await(const y of o)s.push(...await iFt(y));else{const y=(p=o==null?void 0:o.constructor)==null?void 0:p.name;throw new Error(`Unexpected data type: ${typeof o}${y?`; constructor: ${y}`:""}${KBn(o)}`)}return s}function KBn(o){return typeof o!="object"||o===null?"":`; props: [${Object.getOwnPropertyNames(o).map(p=>`"${p}"`).join(", ")}]`}class oc{constructor(s){this._client=s}}function _Oe(o){return o.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}const GBn=(o=_Oe)=>function(p,...y){if(p.length===1)return p[0];let C=!1;const N=p.reduce((et,tt,nt)=>(/[?#]/.test(tt)&&(C=!0),et+tt+(nt===y.length?"":(C?encodeURIComponent:o)(String(y[nt])))),""),L=N.split(/[?#]/,1)[0],z=[],G=new RegExp("(?<=^|\\/)(?:\\.|%2e){1,2}(?=\\/|$)","gi");let q;for(;(q=G.exec(L))!==null;)z.push({start:q.index,length:q[0].length});if(z.length>0){let et=0;const tt=z.reduce((nt,st)=>{const at=" ".repeat(st.start-et),Ot="^".repeat(st.length);return et=st.start+st.length,nt+at+Ot},"");throw new Ho(`Path parameters result in path with invalid segments:
|
|
1825
1828
|
${N}
|
|
1826
|
-
${tt}`)}return N},Ma=KBn(_Oe);let xOe=class extends oc{list(s,p={},y){return this._client.getAPIList(Ma`/chat/completions/${s}/messages`,f0,{query:p,...y})}};function GBn(o){return typeof o.parse=="function"}const kmt=o=>(o==null?void 0:o.role)==="assistant",EOe=o=>(o==null?void 0:o.role)==="tool";var aFt,Wbt,Kbt,vQ,_Q,Gbt,xQ,pk,EQ,Smt,Cmt,FF,TOe;class JFt{constructor(){aFt.add(this),this.controller=new AbortController,Wbt.set(this,void 0),Kbt.set(this,()=>{}),vQ.set(this,()=>{}),_Q.set(this,void 0),Gbt.set(this,()=>{}),xQ.set(this,()=>{}),pk.set(this,{}),EQ.set(this,!1),Smt.set(this,!1),Cmt.set(this,!1),FF.set(this,!1),tc(this,Wbt,new Promise((s,p)=>{tc(this,Kbt,s,"f"),tc(this,vQ,p,"f")})),tc(this,_Q,new Promise((s,p)=>{tc(this,Gbt,s,"f"),tc(this,xQ,p,"f")})),wr(this,Wbt,"f").catch(()=>{}),wr(this,_Q,"f").catch(()=>{})}_run(s){setTimeout(()=>{s().then(()=>{this._emitFinal(),this._emit("end")},wr(this,aFt,"m",TOe).bind(this))},0)}_connected(){this.ended||(wr(this,Kbt,"f").call(this),this._emit("connect"))}get ended(){return wr(this,EQ,"f")}get errored(){return wr(this,Smt,"f")}get aborted(){return wr(this,Cmt,"f")}abort(){this.controller.abort()}on(s,p){return(wr(this,pk,"f")[s]||(wr(this,pk,"f")[s]=[])).push({listener:p}),this}off(s,p){const y=wr(this,pk,"f")[s];if(!y)return this;const C=y.findIndex(N=>N.listener===p);return C>=0&&y.splice(C,1),this}once(s,p){return(wr(this,pk,"f")[s]||(wr(this,pk,"f")[s]=[])).push({listener:p,once:!0}),this}emitted(s){return new Promise((p,y)=>{tc(this,FF,!0),s!=="error"&&this.once("error",y),this.once(s,p)})}async done(){tc(this,FF,!0),await wr(this,_Q,"f")}_emit(s,...p){if(wr(this,EQ,"f"))return;s==="end"&&(tc(this,EQ,!0),wr(this,Gbt,"f").call(this));const y=wr(this,pk,"f")[s];if(y&&(wr(this,pk,"f")[s]=y.filter(C=>!C.once),y.forEach(({listener:C})=>C(...p))),s==="abort"){const C=p[0];!wr(this,FF,"f")&&!(y!=null&&y.length)&&Promise.reject(C),wr(this,vQ,"f").call(this,C),wr(this,xQ,"f").call(this,C),this._emit("end");return}if(s==="error"){const C=p[0];!wr(this,FF,"f")&&!(y!=null&&y.length)&&Promise.reject(C),wr(this,vQ,"f").call(this,C),wr(this,xQ,"f").call(this,C),this._emit("end")}}_emitFinal(){}}Wbt=new WeakMap,Kbt=new WeakMap,vQ=new WeakMap,_Q=new WeakMap,Gbt=new WeakMap,xQ=new WeakMap,pk=new WeakMap,EQ=new WeakMap,Smt=new WeakMap,Cmt=new WeakMap,FF=new WeakMap,aFt=new WeakSet,TOe=function(s){if(tc(this,Smt,!0),s instanceof Error&&s.name==="AbortError"&&(s=new I3),s instanceof I3)return tc(this,Cmt,!0),this._emit("abort",s);if(s instanceof Ho)return this._emit("error",s);if(s instanceof Error){const p=new Ho(s.message);return p.cause=s,this._emit("error",p)}return this._emit("error",new Ho(String(s)))};function ZFt(o){return(o==null?void 0:o.$brand)==="auto-parseable-response-format"}function tJ(o){return(o==null?void 0:o.$brand)==="auto-parseable-tool"}function YBn(o,s){return!s||!kOe(s)?{...o,choices:o.choices.map(p=>({...p,message:{...p.message,parsed:null,...p.message.tool_calls?{tool_calls:p.message.tool_calls}:void 0}}))}:t$t(o,s)}function t$t(o,s){const p=o.choices.map(y=>{var C;if(y.finish_reason==="length")throw new oOe;if(y.finish_reason==="content_filter")throw new cOe;return{...y,message:{...y.message,...y.message.tool_calls?{tool_calls:((C=y.message.tool_calls)==null?void 0:C.map(N=>XBn(s,N)))??void 0}:void 0,parsed:y.message.content&&!y.message.refusal?VBn(s,y.message.content):null}}});return{...o,choices:p}}function VBn(o,s){var p,y;return((p=o.response_format)==null?void 0:p.type)!=="json_schema"?null:((y=o.response_format)==null?void 0:y.type)==="json_schema"?"$parseRaw"in o.response_format?o.response_format.$parseRaw(s):JSON.parse(s):null}function XBn(o,s){var y;const p=(y=o.tools)==null?void 0:y.find(C=>{var N;return((N=C.function)==null?void 0:N.name)===s.function.name});return{...s,function:{...s.function,parsed_arguments:tJ(p)?p.$parseRaw(s.function.arguments):p!=null&&p.function.strict?JSON.parse(s.function.arguments):null}}}function QBn(o,s){var y;if(!o)return!1;const p=(y=o.tools)==null?void 0:y.find(C=>{var N;return((N=C.function)==null?void 0:N.name)===s.function.name});return tJ(p)||(p==null?void 0:p.function.strict)||!1}function kOe(o){var s;return ZFt(o.response_format)?!0:((s=o.tools)==null?void 0:s.some(p=>tJ(p)||p.type==="function"&&p.function.strict===!0))??!1}function JBn(o){for(const s of o??[]){if(s.type!=="function")throw new Ho(`Currently only \`function\` tool types support auto-parsing; Received \`${s.type}\``);if(s.function.strict!==!0)throw new Ho(`The \`${s.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`)}}var Cm,sFt,Amt,oFt,cFt,uFt,SOe,COe;const ZBn=10;class AOe extends JFt{constructor(){super(...arguments),Cm.add(this),this._chatCompletions=[],this.messages=[]}_addChatCompletion(s){var y;this._chatCompletions.push(s),this._emit("chatCompletion",s);const p=(y=s.choices[0])==null?void 0:y.message;return p&&this._addMessage(p),s}_addMessage(s,p=!0){if("content"in s||(s.content=null),this.messages.push(s),p){if(this._emit("message",s),EOe(s)&&s.content)this._emit("functionToolCallResult",s.content);else if(kmt(s)&&s.tool_calls)for(const y of s.tool_calls)y.type==="function"&&this._emit("functionToolCall",y.function)}}async finalChatCompletion(){await this.done();const s=this._chatCompletions[this._chatCompletions.length-1];if(!s)throw new Ho("stream ended without producing a ChatCompletion");return s}async finalContent(){return await this.done(),wr(this,Cm,"m",sFt).call(this)}async finalMessage(){return await this.done(),wr(this,Cm,"m",Amt).call(this)}async finalFunctionToolCall(){return await this.done(),wr(this,Cm,"m",oFt).call(this)}async finalFunctionToolCallResult(){return await this.done(),wr(this,Cm,"m",cFt).call(this)}async totalUsage(){return await this.done(),wr(this,Cm,"m",uFt).call(this)}allChatCompletions(){return[...this._chatCompletions]}_emitFinal(){const s=this._chatCompletions[this._chatCompletions.length-1];s&&this._emit("finalChatCompletion",s);const p=wr(this,Cm,"m",Amt).call(this);p&&this._emit("finalMessage",p);const y=wr(this,Cm,"m",sFt).call(this);y&&this._emit("finalContent",y);const C=wr(this,Cm,"m",oFt).call(this);C&&this._emit("finalFunctionToolCall",C);const N=wr(this,Cm,"m",cFt).call(this);N!=null&&this._emit("finalFunctionToolCallResult",N),this._chatCompletions.some(L=>L.usage)&&this._emit("totalUsage",wr(this,Cm,"m",uFt).call(this))}async _createChatCompletion(s,p,y){const C=y==null?void 0:y.signal;C&&(C.aborted&&this.controller.abort(),C.addEventListener("abort",()=>this.controller.abort())),wr(this,Cm,"m",SOe).call(this,p);const N=await s.chat.completions.create({...p,stream:!1},{...y,signal:this.controller.signal});return this._connected(),this._addChatCompletion(t$t(N,p))}async _runChatCompletion(s,p,y){for(const C of p.messages)this._addMessage(C,!1);return await this._createChatCompletion(s,p,y)}async _runTools(s,p,y){var st,at,Ot;const C="tool",{tool_choice:N="auto",stream:L,...z}=p,G=typeof N!="string"&&((st=N==null?void 0:N.function)==null?void 0:st.name),{maxChatCompletions:q=ZBn}=y||{},et=p.tools.map(Dt=>{if(tJ(Dt)){if(!Dt.$callback)throw new Ho("Tool given to `.runTools()` that does not have an associated function");return{type:"function",function:{function:Dt.$callback,name:Dt.function.name,description:Dt.function.description||"",parameters:Dt.function.parameters,parse:Dt.$parseRaw,strict:!0}}}return Dt}),tt={};for(const Dt of et)Dt.type==="function"&&(tt[Dt.function.name||Dt.function.function.name]=Dt.function);const nt="tools"in p?et.map(Dt=>Dt.type==="function"?{type:"function",function:{name:Dt.function.name||Dt.function.function.name,parameters:Dt.function.parameters,description:Dt.function.description,strict:Dt.function.strict}}:Dt):void 0;for(const Dt of p.messages)this._addMessage(Dt,!1);for(let Dt=0;Dt<q;++Dt){const ie=(at=(await this._createChatCompletion(s,{...z,tool_choice:N,tools:nt,messages:[...this.messages]},y)).choices[0])==null?void 0:at.message;if(!ie)throw new Ho("missing message in ChatCompletion response");if(!((Ot=ie.tool_calls)!=null&&Ot.length))return;for(const ae of ie.tool_calls){if(ae.type!=="function")continue;const Ne=ae.id,{name:pn,arguments:de}=ae.function,cn=tt[pn];if(cn){if(G&&G!==pn){const or=`Invalid tool_call: ${JSON.stringify(pn)}. ${JSON.stringify(G)} requested. Please try again`;this._addMessage({role:C,tool_call_id:Ne,content:or});continue}}else{const or=`Invalid tool_call: ${JSON.stringify(pn)}. Available options are: ${Object.keys(tt).map(gr=>JSON.stringify(gr)).join(", ")}. Please try again`;this._addMessage({role:C,tool_call_id:Ne,content:or});continue}let er;try{er=GBn(cn)?await cn.parse(de):de}catch(or){const gr=or instanceof Error?or.message:String(or);this._addMessage({role:C,tool_call_id:Ne,content:gr});continue}const Dn=await cn.function(er,this),jn=wr(this,Cm,"m",COe).call(this,Dn);if(this._addMessage({role:C,tool_call_id:Ne,content:jn}),G)return}}}}Cm=new WeakSet,sFt=function(){return wr(this,Cm,"m",Amt).call(this).content??null},Amt=function(){let s=this.messages.length;for(;s-- >0;){const p=this.messages[s];if(kmt(p))return{...p,content:p.content??null,refusal:p.refusal??null}}throw new Ho("stream ended without producing a ChatCompletionMessage with role=assistant")},oFt=function(){var s,p;for(let y=this.messages.length-1;y>=0;y--){const C=this.messages[y];if(kmt(C)&&((s=C==null?void 0:C.tool_calls)!=null&&s.length))return(p=C.tool_calls.at(-1))==null?void 0:p.function}},cFt=function(){for(let s=this.messages.length-1;s>=0;s--){const p=this.messages[s];if(EOe(p)&&p.content!=null&&typeof p.content=="string"&&this.messages.some(y=>{var C;return y.role==="assistant"&&((C=y.tool_calls)==null?void 0:C.some(N=>N.type==="function"&&N.id===p.tool_call_id))}))return p.content}},uFt=function(){const s={completion_tokens:0,prompt_tokens:0,total_tokens:0};for(const{usage:p}of this._chatCompletions)p&&(s.completion_tokens+=p.completion_tokens,s.prompt_tokens+=p.prompt_tokens,s.total_tokens+=p.total_tokens);return s},SOe=function(s){if(s.n!=null&&s.n>1)throw new Ho("ChatCompletion convenience helpers only support n=1 at this time. To use n>1, please use chat.completions.create() directly.")},COe=function(s){return typeof s=="string"?s:s===void 0?"undefined":JSON.stringify(s)};class e$t extends AOe{static runTools(s,p,y){const C=new e$t,N={...y,headers:{...y==null?void 0:y.headers,"X-Stainless-Helper-Method":"runTools"}};return C._run(()=>C._runTools(s,p,N)),C}_addMessage(s,p=!0){super._addMessage(s,p),kmt(s)&&s.content&&this._emit("content",s.content)}}const IOe=1,OOe=2,NOe=4,POe=8,LOe=16,MOe=32,ROe=64,DOe=128,BOe=256,FOe=DOe|BOe,$Oe=LOe|MOe|FOe|ROe,jOe=IOe|OOe|$Oe,HOe=NOe|POe,tFn=jOe|HOe,Wp={STR:IOe,NUM:OOe,ARR:NOe,OBJ:POe,NULL:LOe,BOOL:MOe,NAN:ROe,INFINITY:DOe,MINUS_INFINITY:BOe,INF:FOe,SPECIAL:$Oe,ATOM:jOe,COLLECTION:HOe,ALL:tFn};class eFn extends Error{}class nFn extends Error{}function rFn(o,s=Wp.ALL){if(typeof o!="string")throw new TypeError(`expecting str, got ${typeof o}`);if(!o.trim())throw new Error(`${o} is empty`);return iFn(o.trim(),s)}const iFn=(o,s)=>{const p=o.length;let y=0;const C=nt=>{throw new eFn(`${nt} at position ${y}`)},N=nt=>{throw new nFn(`${nt} at position ${y}`)},L=()=>(tt(),y>=p&&C("Unexpected end of input"),o[y]==='"'?z():o[y]==="{"?G():o[y]==="["?q():o.substring(y,y+4)==="null"||Wp.NULL&s&&p-y<4&&"null".startsWith(o.substring(y))?(y+=4,null):o.substring(y,y+4)==="true"||Wp.BOOL&s&&p-y<4&&"true".startsWith(o.substring(y))?(y+=4,!0):o.substring(y,y+5)==="false"||Wp.BOOL&s&&p-y<5&&"false".startsWith(o.substring(y))?(y+=5,!1):o.substring(y,y+8)==="Infinity"||Wp.INFINITY&s&&p-y<8&&"Infinity".startsWith(o.substring(y))?(y+=8,1/0):o.substring(y,y+9)==="-Infinity"||Wp.MINUS_INFINITY&s&&1<p-y&&p-y<9&&"-Infinity".startsWith(o.substring(y))?(y+=9,-1/0):o.substring(y,y+3)==="NaN"||Wp.NAN&s&&p-y<3&&"NaN".startsWith(o.substring(y))?(y+=3,NaN):et()),z=()=>{const nt=y;let st=!1;for(y++;y<p&&(o[y]!=='"'||st&&o[y-1]==="\\");)st=o[y]==="\\"?!st:!1,y++;if(o.charAt(y)=='"')try{return JSON.parse(o.substring(nt,++y-Number(st)))}catch(at){N(String(at))}else if(Wp.STR&s)try{return JSON.parse(o.substring(nt,y-Number(st))+'"')}catch{return JSON.parse(o.substring(nt,o.lastIndexOf("\\"))+'"')}C("Unterminated string literal")},G=()=>{y++,tt();const nt={};try{for(;o[y]!=="}";){if(tt(),y>=p&&Wp.OBJ&s)return nt;const st=z();tt(),y++;try{const at=L();Object.defineProperty(nt,st,{value:at,writable:!0,enumerable:!0,configurable:!0})}catch(at){if(Wp.OBJ&s)return nt;throw at}tt(),o[y]===","&&y++}}catch{if(Wp.OBJ&s)return nt;C("Expected '}' at end of object")}return y++,nt},q=()=>{y++;const nt=[];try{for(;o[y]!=="]";)nt.push(L()),tt(),o[y]===","&&y++}catch{if(Wp.ARR&s)return nt;C("Expected ']' at end of array")}return y++,nt},et=()=>{if(y===0){o==="-"&&Wp.NUM&s&&C("Not sure what '-' is");try{return JSON.parse(o)}catch(st){if(Wp.NUM&s)try{return o[o.length-1]==="."?JSON.parse(o.substring(0,o.lastIndexOf("."))):JSON.parse(o.substring(0,o.lastIndexOf("e")))}catch{}N(String(st))}}const nt=y;for(o[y]==="-"&&y++;o[y]&&!",]}".includes(o[y]);)y++;y==p&&!(Wp.NUM&s)&&C("Unterminated number literal");try{return JSON.parse(o.substring(nt,y))}catch{o.substring(nt,y)==="-"&&Wp.NUM&s&&C("Not sure what '-' is");try{return JSON.parse(o.substring(nt,o.lastIndexOf("e")))}catch(at){N(String(at))}}},tt=()=>{for(;y<p&&`
|
|
1827
|
-
\r `.includes(o[y]);)y++};return L()},XCe=o=>
|
|
1829
|
+
${tt}`)}return N},Ma=GBn(_Oe);let xOe=class extends oc{list(s,p={},y){return this._client.getAPIList(Ma`/chat/completions/${s}/messages`,f0,{query:p,...y})}};function YBn(o){return typeof o.parse=="function"}const kmt=o=>(o==null?void 0:o.role)==="assistant",EOe=o=>(o==null?void 0:o.role)==="tool";var aFt,Wbt,Kbt,vQ,_Q,Gbt,xQ,pk,EQ,Smt,Cmt,FF,TOe;class JFt{constructor(){aFt.add(this),this.controller=new AbortController,Wbt.set(this,void 0),Kbt.set(this,()=>{}),vQ.set(this,()=>{}),_Q.set(this,void 0),Gbt.set(this,()=>{}),xQ.set(this,()=>{}),pk.set(this,{}),EQ.set(this,!1),Smt.set(this,!1),Cmt.set(this,!1),FF.set(this,!1),tc(this,Wbt,new Promise((s,p)=>{tc(this,Kbt,s,"f"),tc(this,vQ,p,"f")})),tc(this,_Q,new Promise((s,p)=>{tc(this,Gbt,s,"f"),tc(this,xQ,p,"f")})),wr(this,Wbt,"f").catch(()=>{}),wr(this,_Q,"f").catch(()=>{})}_run(s){setTimeout(()=>{s().then(()=>{this._emitFinal(),this._emit("end")},wr(this,aFt,"m",TOe).bind(this))},0)}_connected(){this.ended||(wr(this,Kbt,"f").call(this),this._emit("connect"))}get ended(){return wr(this,EQ,"f")}get errored(){return wr(this,Smt,"f")}get aborted(){return wr(this,Cmt,"f")}abort(){this.controller.abort()}on(s,p){return(wr(this,pk,"f")[s]||(wr(this,pk,"f")[s]=[])).push({listener:p}),this}off(s,p){const y=wr(this,pk,"f")[s];if(!y)return this;const C=y.findIndex(N=>N.listener===p);return C>=0&&y.splice(C,1),this}once(s,p){return(wr(this,pk,"f")[s]||(wr(this,pk,"f")[s]=[])).push({listener:p,once:!0}),this}emitted(s){return new Promise((p,y)=>{tc(this,FF,!0),s!=="error"&&this.once("error",y),this.once(s,p)})}async done(){tc(this,FF,!0),await wr(this,_Q,"f")}_emit(s,...p){if(wr(this,EQ,"f"))return;s==="end"&&(tc(this,EQ,!0),wr(this,Gbt,"f").call(this));const y=wr(this,pk,"f")[s];if(y&&(wr(this,pk,"f")[s]=y.filter(C=>!C.once),y.forEach(({listener:C})=>C(...p))),s==="abort"){const C=p[0];!wr(this,FF,"f")&&!(y!=null&&y.length)&&Promise.reject(C),wr(this,vQ,"f").call(this,C),wr(this,xQ,"f").call(this,C),this._emit("end");return}if(s==="error"){const C=p[0];!wr(this,FF,"f")&&!(y!=null&&y.length)&&Promise.reject(C),wr(this,vQ,"f").call(this,C),wr(this,xQ,"f").call(this,C),this._emit("end")}}_emitFinal(){}}Wbt=new WeakMap,Kbt=new WeakMap,vQ=new WeakMap,_Q=new WeakMap,Gbt=new WeakMap,xQ=new WeakMap,pk=new WeakMap,EQ=new WeakMap,Smt=new WeakMap,Cmt=new WeakMap,FF=new WeakMap,aFt=new WeakSet,TOe=function(s){if(tc(this,Smt,!0),s instanceof Error&&s.name==="AbortError"&&(s=new I3),s instanceof I3)return tc(this,Cmt,!0),this._emit("abort",s);if(s instanceof Ho)return this._emit("error",s);if(s instanceof Error){const p=new Ho(s.message);return p.cause=s,this._emit("error",p)}return this._emit("error",new Ho(String(s)))};function ZFt(o){return(o==null?void 0:o.$brand)==="auto-parseable-response-format"}function tJ(o){return(o==null?void 0:o.$brand)==="auto-parseable-tool"}function VBn(o,s){return!s||!kOe(s)?{...o,choices:o.choices.map(p=>({...p,message:{...p.message,parsed:null,...p.message.tool_calls?{tool_calls:p.message.tool_calls}:void 0}}))}:t$t(o,s)}function t$t(o,s){const p=o.choices.map(y=>{var C;if(y.finish_reason==="length")throw new oOe;if(y.finish_reason==="content_filter")throw new cOe;return{...y,message:{...y.message,...y.message.tool_calls?{tool_calls:((C=y.message.tool_calls)==null?void 0:C.map(N=>QBn(s,N)))??void 0}:void 0,parsed:y.message.content&&!y.message.refusal?XBn(s,y.message.content):null}}});return{...o,choices:p}}function XBn(o,s){var p,y;return((p=o.response_format)==null?void 0:p.type)!=="json_schema"?null:((y=o.response_format)==null?void 0:y.type)==="json_schema"?"$parseRaw"in o.response_format?o.response_format.$parseRaw(s):JSON.parse(s):null}function QBn(o,s){var y;const p=(y=o.tools)==null?void 0:y.find(C=>{var N;return((N=C.function)==null?void 0:N.name)===s.function.name});return{...s,function:{...s.function,parsed_arguments:tJ(p)?p.$parseRaw(s.function.arguments):p!=null&&p.function.strict?JSON.parse(s.function.arguments):null}}}function JBn(o,s){var y;if(!o)return!1;const p=(y=o.tools)==null?void 0:y.find(C=>{var N;return((N=C.function)==null?void 0:N.name)===s.function.name});return tJ(p)||(p==null?void 0:p.function.strict)||!1}function kOe(o){var s;return ZFt(o.response_format)?!0:((s=o.tools)==null?void 0:s.some(p=>tJ(p)||p.type==="function"&&p.function.strict===!0))??!1}function ZBn(o){for(const s of o??[]){if(s.type!=="function")throw new Ho(`Currently only \`function\` tool types support auto-parsing; Received \`${s.type}\``);if(s.function.strict!==!0)throw new Ho(`The \`${s.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`)}}var Cm,sFt,Amt,oFt,cFt,uFt,SOe,COe;const tFn=10;class AOe extends JFt{constructor(){super(...arguments),Cm.add(this),this._chatCompletions=[],this.messages=[]}_addChatCompletion(s){var y;this._chatCompletions.push(s),this._emit("chatCompletion",s);const p=(y=s.choices[0])==null?void 0:y.message;return p&&this._addMessage(p),s}_addMessage(s,p=!0){if("content"in s||(s.content=null),this.messages.push(s),p){if(this._emit("message",s),EOe(s)&&s.content)this._emit("functionToolCallResult",s.content);else if(kmt(s)&&s.tool_calls)for(const y of s.tool_calls)y.type==="function"&&this._emit("functionToolCall",y.function)}}async finalChatCompletion(){await this.done();const s=this._chatCompletions[this._chatCompletions.length-1];if(!s)throw new Ho("stream ended without producing a ChatCompletion");return s}async finalContent(){return await this.done(),wr(this,Cm,"m",sFt).call(this)}async finalMessage(){return await this.done(),wr(this,Cm,"m",Amt).call(this)}async finalFunctionToolCall(){return await this.done(),wr(this,Cm,"m",oFt).call(this)}async finalFunctionToolCallResult(){return await this.done(),wr(this,Cm,"m",cFt).call(this)}async totalUsage(){return await this.done(),wr(this,Cm,"m",uFt).call(this)}allChatCompletions(){return[...this._chatCompletions]}_emitFinal(){const s=this._chatCompletions[this._chatCompletions.length-1];s&&this._emit("finalChatCompletion",s);const p=wr(this,Cm,"m",Amt).call(this);p&&this._emit("finalMessage",p);const y=wr(this,Cm,"m",sFt).call(this);y&&this._emit("finalContent",y);const C=wr(this,Cm,"m",oFt).call(this);C&&this._emit("finalFunctionToolCall",C);const N=wr(this,Cm,"m",cFt).call(this);N!=null&&this._emit("finalFunctionToolCallResult",N),this._chatCompletions.some(L=>L.usage)&&this._emit("totalUsage",wr(this,Cm,"m",uFt).call(this))}async _createChatCompletion(s,p,y){const C=y==null?void 0:y.signal;C&&(C.aborted&&this.controller.abort(),C.addEventListener("abort",()=>this.controller.abort())),wr(this,Cm,"m",SOe).call(this,p);const N=await s.chat.completions.create({...p,stream:!1},{...y,signal:this.controller.signal});return this._connected(),this._addChatCompletion(t$t(N,p))}async _runChatCompletion(s,p,y){for(const C of p.messages)this._addMessage(C,!1);return await this._createChatCompletion(s,p,y)}async _runTools(s,p,y){var st,at,Ot;const C="tool",{tool_choice:N="auto",stream:L,...z}=p,G=typeof N!="string"&&((st=N==null?void 0:N.function)==null?void 0:st.name),{maxChatCompletions:q=tFn}=y||{},et=p.tools.map(Dt=>{if(tJ(Dt)){if(!Dt.$callback)throw new Ho("Tool given to `.runTools()` that does not have an associated function");return{type:"function",function:{function:Dt.$callback,name:Dt.function.name,description:Dt.function.description||"",parameters:Dt.function.parameters,parse:Dt.$parseRaw,strict:!0}}}return Dt}),tt={};for(const Dt of et)Dt.type==="function"&&(tt[Dt.function.name||Dt.function.function.name]=Dt.function);const nt="tools"in p?et.map(Dt=>Dt.type==="function"?{type:"function",function:{name:Dt.function.name||Dt.function.function.name,parameters:Dt.function.parameters,description:Dt.function.description,strict:Dt.function.strict}}:Dt):void 0;for(const Dt of p.messages)this._addMessage(Dt,!1);for(let Dt=0;Dt<q;++Dt){const ie=(at=(await this._createChatCompletion(s,{...z,tool_choice:N,tools:nt,messages:[...this.messages]},y)).choices[0])==null?void 0:at.message;if(!ie)throw new Ho("missing message in ChatCompletion response");if(!((Ot=ie.tool_calls)!=null&&Ot.length))return;for(const ae of ie.tool_calls){if(ae.type!=="function")continue;const Ne=ae.id,{name:pn,arguments:de}=ae.function,cn=tt[pn];if(cn){if(G&&G!==pn){const or=`Invalid tool_call: ${JSON.stringify(pn)}. ${JSON.stringify(G)} requested. Please try again`;this._addMessage({role:C,tool_call_id:Ne,content:or});continue}}else{const or=`Invalid tool_call: ${JSON.stringify(pn)}. Available options are: ${Object.keys(tt).map(gr=>JSON.stringify(gr)).join(", ")}. Please try again`;this._addMessage({role:C,tool_call_id:Ne,content:or});continue}let er;try{er=YBn(cn)?await cn.parse(de):de}catch(or){const gr=or instanceof Error?or.message:String(or);this._addMessage({role:C,tool_call_id:Ne,content:gr});continue}const Dn=await cn.function(er,this),jn=wr(this,Cm,"m",COe).call(this,Dn);if(this._addMessage({role:C,tool_call_id:Ne,content:jn}),G)return}}}}Cm=new WeakSet,sFt=function(){return wr(this,Cm,"m",Amt).call(this).content??null},Amt=function(){let s=this.messages.length;for(;s-- >0;){const p=this.messages[s];if(kmt(p))return{...p,content:p.content??null,refusal:p.refusal??null}}throw new Ho("stream ended without producing a ChatCompletionMessage with role=assistant")},oFt=function(){var s,p;for(let y=this.messages.length-1;y>=0;y--){const C=this.messages[y];if(kmt(C)&&((s=C==null?void 0:C.tool_calls)!=null&&s.length))return(p=C.tool_calls.at(-1))==null?void 0:p.function}},cFt=function(){for(let s=this.messages.length-1;s>=0;s--){const p=this.messages[s];if(EOe(p)&&p.content!=null&&typeof p.content=="string"&&this.messages.some(y=>{var C;return y.role==="assistant"&&((C=y.tool_calls)==null?void 0:C.some(N=>N.type==="function"&&N.id===p.tool_call_id))}))return p.content}},uFt=function(){const s={completion_tokens:0,prompt_tokens:0,total_tokens:0};for(const{usage:p}of this._chatCompletions)p&&(s.completion_tokens+=p.completion_tokens,s.prompt_tokens+=p.prompt_tokens,s.total_tokens+=p.total_tokens);return s},SOe=function(s){if(s.n!=null&&s.n>1)throw new Ho("ChatCompletion convenience helpers only support n=1 at this time. To use n>1, please use chat.completions.create() directly.")},COe=function(s){return typeof s=="string"?s:s===void 0?"undefined":JSON.stringify(s)};class e$t extends AOe{static runTools(s,p,y){const C=new e$t,N={...y,headers:{...y==null?void 0:y.headers,"X-Stainless-Helper-Method":"runTools"}};return C._run(()=>C._runTools(s,p,N)),C}_addMessage(s,p=!0){super._addMessage(s,p),kmt(s)&&s.content&&this._emit("content",s.content)}}const IOe=1,OOe=2,NOe=4,POe=8,LOe=16,MOe=32,ROe=64,DOe=128,BOe=256,FOe=DOe|BOe,$Oe=LOe|MOe|FOe|ROe,jOe=IOe|OOe|$Oe,HOe=NOe|POe,eFn=jOe|HOe,Wp={STR:IOe,NUM:OOe,ARR:NOe,OBJ:POe,NULL:LOe,BOOL:MOe,NAN:ROe,INFINITY:DOe,MINUS_INFINITY:BOe,INF:FOe,SPECIAL:$Oe,ATOM:jOe,COLLECTION:HOe,ALL:eFn};class nFn extends Error{}class rFn extends Error{}function iFn(o,s=Wp.ALL){if(typeof o!="string")throw new TypeError(`expecting str, got ${typeof o}`);if(!o.trim())throw new Error(`${o} is empty`);return aFn(o.trim(),s)}const aFn=(o,s)=>{const p=o.length;let y=0;const C=nt=>{throw new nFn(`${nt} at position ${y}`)},N=nt=>{throw new rFn(`${nt} at position ${y}`)},L=()=>(tt(),y>=p&&C("Unexpected end of input"),o[y]==='"'?z():o[y]==="{"?G():o[y]==="["?q():o.substring(y,y+4)==="null"||Wp.NULL&s&&p-y<4&&"null".startsWith(o.substring(y))?(y+=4,null):o.substring(y,y+4)==="true"||Wp.BOOL&s&&p-y<4&&"true".startsWith(o.substring(y))?(y+=4,!0):o.substring(y,y+5)==="false"||Wp.BOOL&s&&p-y<5&&"false".startsWith(o.substring(y))?(y+=5,!1):o.substring(y,y+8)==="Infinity"||Wp.INFINITY&s&&p-y<8&&"Infinity".startsWith(o.substring(y))?(y+=8,1/0):o.substring(y,y+9)==="-Infinity"||Wp.MINUS_INFINITY&s&&1<p-y&&p-y<9&&"-Infinity".startsWith(o.substring(y))?(y+=9,-1/0):o.substring(y,y+3)==="NaN"||Wp.NAN&s&&p-y<3&&"NaN".startsWith(o.substring(y))?(y+=3,NaN):et()),z=()=>{const nt=y;let st=!1;for(y++;y<p&&(o[y]!=='"'||st&&o[y-1]==="\\");)st=o[y]==="\\"?!st:!1,y++;if(o.charAt(y)=='"')try{return JSON.parse(o.substring(nt,++y-Number(st)))}catch(at){N(String(at))}else if(Wp.STR&s)try{return JSON.parse(o.substring(nt,y-Number(st))+'"')}catch{return JSON.parse(o.substring(nt,o.lastIndexOf("\\"))+'"')}C("Unterminated string literal")},G=()=>{y++,tt();const nt={};try{for(;o[y]!=="}";){if(tt(),y>=p&&Wp.OBJ&s)return nt;const st=z();tt(),y++;try{const at=L();Object.defineProperty(nt,st,{value:at,writable:!0,enumerable:!0,configurable:!0})}catch(at){if(Wp.OBJ&s)return nt;throw at}tt(),o[y]===","&&y++}}catch{if(Wp.OBJ&s)return nt;C("Expected '}' at end of object")}return y++,nt},q=()=>{y++;const nt=[];try{for(;o[y]!=="]";)nt.push(L()),tt(),o[y]===","&&y++}catch{if(Wp.ARR&s)return nt;C("Expected ']' at end of array")}return y++,nt},et=()=>{if(y===0){o==="-"&&Wp.NUM&s&&C("Not sure what '-' is");try{return JSON.parse(o)}catch(st){if(Wp.NUM&s)try{return o[o.length-1]==="."?JSON.parse(o.substring(0,o.lastIndexOf("."))):JSON.parse(o.substring(0,o.lastIndexOf("e")))}catch{}N(String(st))}}const nt=y;for(o[y]==="-"&&y++;o[y]&&!",]}".includes(o[y]);)y++;y==p&&!(Wp.NUM&s)&&C("Unterminated number literal");try{return JSON.parse(o.substring(nt,y))}catch{o.substring(nt,y)==="-"&&Wp.NUM&s&&C("Not sure what '-' is");try{return JSON.parse(o.substring(nt,o.lastIndexOf("e")))}catch(at){N(String(at))}}},tt=()=>{for(;y<p&&`
|
|
1830
|
+
\r `.includes(o[y]);)y++};return L()},XCe=o=>iFn(o,Wp.ALL^Wp.NUM);var ep,dk,NF,nC,GDt,Nbt,YDt,VDt,XDt,Pbt,QDt,QCe;class WQ extends AOe{constructor(s){super(),ep.add(this),dk.set(this,void 0),NF.set(this,void 0),nC.set(this,void 0),tc(this,dk,s),tc(this,NF,[])}get currentChatCompletionSnapshot(){return wr(this,nC,"f")}static fromReadableStream(s){const p=new WQ(null);return p._run(()=>p._fromReadableStream(s)),p}static createChatCompletion(s,p,y){const C=new WQ(p);return C._run(()=>C._runChatCompletion(s,{...p,stream:!0},{...y,headers:{...y==null?void 0:y.headers,"X-Stainless-Helper-Method":"stream"}})),C}async _createChatCompletion(s,p,y){var L;super._createChatCompletion;const C=y==null?void 0:y.signal;C&&(C.aborted&&this.controller.abort(),C.addEventListener("abort",()=>this.controller.abort())),wr(this,ep,"m",GDt).call(this);const N=await s.chat.completions.create({...p,stream:!0},{...y,signal:this.controller.signal});this._connected();for await(const z of N)wr(this,ep,"m",YDt).call(this,z);if((L=N.controller.signal)!=null&&L.aborted)throw new I3;return this._addChatCompletion(wr(this,ep,"m",Pbt).call(this))}async _fromReadableStream(s,p){var L;const y=p==null?void 0:p.signal;y&&(y.aborted&&this.controller.abort(),y.addEventListener("abort",()=>this.controller.abort())),wr(this,ep,"m",GDt).call(this),this._connected();const C=S6.fromReadableStream(s,this.controller);let N;for await(const z of C)N&&N!==z.id&&this._addChatCompletion(wr(this,ep,"m",Pbt).call(this)),wr(this,ep,"m",YDt).call(this,z),N=z.id;if((L=C.controller.signal)!=null&&L.aborted)throw new I3;return this._addChatCompletion(wr(this,ep,"m",Pbt).call(this))}[(dk=new WeakMap,NF=new WeakMap,nC=new WeakMap,ep=new WeakSet,GDt=function(){this.ended||tc(this,nC,void 0)},Nbt=function(p){let y=wr(this,NF,"f")[p.index];return y||(y={content_done:!1,refusal_done:!1,logprobs_content_done:!1,logprobs_refusal_done:!1,done_tool_calls:new Set,current_tool_call_index:null},wr(this,NF,"f")[p.index]=y,y)},YDt=function(p){var C,N,L,z,G,q,et,tt,nt,st,at,Ot,Dt,St,ie;if(this.ended)return;const y=wr(this,ep,"m",QCe).call(this,p);this._emit("chunk",p,y);for(const ae of p.choices){const Ne=y.choices[ae.index];ae.delta.content!=null&&((C=Ne.message)==null?void 0:C.role)==="assistant"&&((N=Ne.message)!=null&&N.content)&&(this._emit("content",ae.delta.content,Ne.message.content),this._emit("content.delta",{delta:ae.delta.content,snapshot:Ne.message.content,parsed:Ne.message.parsed})),ae.delta.refusal!=null&&((L=Ne.message)==null?void 0:L.role)==="assistant"&&((z=Ne.message)!=null&&z.refusal)&&this._emit("refusal.delta",{delta:ae.delta.refusal,snapshot:Ne.message.refusal}),((G=ae.logprobs)==null?void 0:G.content)!=null&&((q=Ne.message)==null?void 0:q.role)==="assistant"&&this._emit("logprobs.content.delta",{content:(et=ae.logprobs)==null?void 0:et.content,snapshot:((tt=Ne.logprobs)==null?void 0:tt.content)??[]}),((nt=ae.logprobs)==null?void 0:nt.refusal)!=null&&((st=Ne.message)==null?void 0:st.role)==="assistant"&&this._emit("logprobs.refusal.delta",{refusal:(at=ae.logprobs)==null?void 0:at.refusal,snapshot:((Ot=Ne.logprobs)==null?void 0:Ot.refusal)??[]});const pn=wr(this,ep,"m",Nbt).call(this,Ne);Ne.finish_reason&&(wr(this,ep,"m",XDt).call(this,Ne),pn.current_tool_call_index!=null&&wr(this,ep,"m",VDt).call(this,Ne,pn.current_tool_call_index));for(const de of ae.delta.tool_calls??[])pn.current_tool_call_index!==de.index&&(wr(this,ep,"m",XDt).call(this,Ne),pn.current_tool_call_index!=null&&wr(this,ep,"m",VDt).call(this,Ne,pn.current_tool_call_index)),pn.current_tool_call_index=de.index;for(const de of ae.delta.tool_calls??[]){const cn=(Dt=Ne.message.tool_calls)==null?void 0:Dt[de.index];cn!=null&&cn.type&&((cn==null?void 0:cn.type)==="function"?this._emit("tool_calls.function.arguments.delta",{name:(St=cn.function)==null?void 0:St.name,index:de.index,arguments:cn.function.arguments,parsed_arguments:cn.function.parsed_arguments,arguments_delta:((ie=de.function)==null?void 0:ie.arguments)??""}):(cn==null||cn.type,void 0))}}},VDt=function(p,y){var L,z,G;if(wr(this,ep,"m",Nbt).call(this,p).done_tool_calls.has(y))return;const N=(L=p.message.tool_calls)==null?void 0:L[y];if(!N)throw new Error("no tool call snapshot");if(!N.type)throw new Error("tool call snapshot missing `type`");if(N.type==="function"){const q=(G=(z=wr(this,dk,"f"))==null?void 0:z.tools)==null?void 0:G.find(et=>et.type==="function"&&et.function.name===N.function.name);this._emit("tool_calls.function.arguments.done",{name:N.function.name,index:y,arguments:N.function.arguments,parsed_arguments:tJ(q)?q.$parseRaw(N.function.arguments):q!=null&&q.function.strict?JSON.parse(N.function.arguments):null})}else N.type},XDt=function(p){var C,N;const y=wr(this,ep,"m",Nbt).call(this,p);if(p.message.content&&!y.content_done){y.content_done=!0;const L=wr(this,ep,"m",QDt).call(this);this._emit("content.done",{content:p.message.content,parsed:L?L.$parseRaw(p.message.content):null})}p.message.refusal&&!y.refusal_done&&(y.refusal_done=!0,this._emit("refusal.done",{refusal:p.message.refusal})),(C=p.logprobs)!=null&&C.content&&!y.logprobs_content_done&&(y.logprobs_content_done=!0,this._emit("logprobs.content.done",{content:p.logprobs.content})),(N=p.logprobs)!=null&&N.refusal&&!y.logprobs_refusal_done&&(y.logprobs_refusal_done=!0,this._emit("logprobs.refusal.done",{refusal:p.logprobs.refusal}))},Pbt=function(){if(this.ended)throw new Ho("stream has ended, this shouldn't happen");const p=wr(this,nC,"f");if(!p)throw new Ho("request ended without sending any chunks");return tc(this,nC,void 0),tc(this,NF,[]),sFn(p,wr(this,dk,"f"))},QDt=function(){var y;const p=(y=wr(this,dk,"f"))==null?void 0:y.response_format;return ZFt(p)?p:null},QCe=function(p){var y,C,N,L;let z=wr(this,nC,"f");const{choices:G,...q}=p;z?Object.assign(z,q):z=tc(this,nC,{...q,choices:[]});for(const{delta:et,finish_reason:tt,index:nt,logprobs:st=null,...at}of p.choices){let Ot=z.choices[nt];if(Ot||(Ot=z.choices[nt]={finish_reason:tt,index:nt,message:{},logprobs:st,...at}),st)if(!Ot.logprobs)Ot.logprobs=Object.assign({},st);else{const{content:de,refusal:cn,...er}=st;Object.assign(Ot.logprobs,er),de&&((y=Ot.logprobs).content??(y.content=[]),Ot.logprobs.content.push(...de)),cn&&((C=Ot.logprobs).refusal??(C.refusal=[]),Ot.logprobs.refusal.push(...cn))}if(tt&&(Ot.finish_reason=tt,wr(this,dk,"f")&&kOe(wr(this,dk,"f")))){if(tt==="length")throw new oOe;if(tt==="content_filter")throw new cOe}if(Object.assign(Ot,at),!et)continue;const{content:Dt,refusal:St,function_call:ie,role:ae,tool_calls:Ne,...pn}=et;if(Object.assign(Ot.message,pn),St&&(Ot.message.refusal=(Ot.message.refusal||"")+St),ae&&(Ot.message.role=ae),ie&&(Ot.message.function_call?(ie.name&&(Ot.message.function_call.name=ie.name),ie.arguments&&((N=Ot.message.function_call).arguments??(N.arguments=""),Ot.message.function_call.arguments+=ie.arguments)):Ot.message.function_call=ie),Dt&&(Ot.message.content=(Ot.message.content||"")+Dt,!Ot.message.refusal&&wr(this,ep,"m",QDt).call(this)&&(Ot.message.parsed=XCe(Ot.message.content))),Ne){Ot.message.tool_calls||(Ot.message.tool_calls=[]);for(const{index:de,id:cn,type:er,function:Dn,...jn}of Ne){const or=(L=Ot.message.tool_calls)[de]??(L[de]={});Object.assign(or,jn),cn&&(or.id=cn),er&&(or.type=er),Dn&&(or.function??(or.function={name:Dn.name??"",arguments:""})),Dn!=null&&Dn.name&&(or.function.name=Dn.name),Dn!=null&&Dn.arguments&&(or.function.arguments+=Dn.arguments,JBn(wr(this,dk,"f"),or)&&(or.function.parsed_arguments=XCe(or.function.arguments)))}}}return z},Symbol.asyncIterator)](){const s=[],p=[];let y=!1;return this.on("chunk",C=>{const N=p.shift();N?N.resolve(C):s.push(C)}),this.on("end",()=>{y=!0;for(const C of p)C.resolve(void 0);p.length=0}),this.on("abort",C=>{y=!0;for(const N of p)N.reject(C);p.length=0}),this.on("error",C=>{y=!0;for(const N of p)N.reject(C);p.length=0}),{next:async()=>s.length?{value:s.shift(),done:!1}:y?{value:void 0,done:!0}:new Promise((N,L)=>p.push({resolve:N,reject:L})).then(N=>N?{value:N,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new S6(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}function sFn(o,s){const{id:p,choices:y,created:C,model:N,system_fingerprint:L,...z}=o,G={...z,id:p,choices:y.map(({message:q,finish_reason:et,index:tt,logprobs:nt,...st})=>{if(!et)throw new Ho(`missing finish_reason for choice ${tt}`);const{content:at=null,function_call:Ot,tool_calls:Dt,...St}=q,ie=q.role;if(!ie)throw new Ho(`missing role for choice ${tt}`);if(Ot){const{arguments:ae,name:Ne}=Ot;if(ae==null)throw new Ho(`missing function_call.arguments for choice ${tt}`);if(!Ne)throw new Ho(`missing function_call.name for choice ${tt}`);return{...st,message:{content:at,function_call:{arguments:ae,name:Ne},role:ie,refusal:q.refusal??null},finish_reason:et,index:tt,logprobs:nt}}return Dt?{...st,index:tt,finish_reason:et,logprobs:nt,message:{...St,role:ie,content:at,refusal:q.refusal??null,tool_calls:Dt.map((ae,Ne)=>{const{function:pn,type:de,id:cn,...er}=ae,{arguments:Dn,name:jn,...or}=pn||{};if(cn==null)throw new Ho(`missing choices[${tt}].tool_calls[${Ne}].id
|
|
1828
1831
|
${Lbt(o)}`);if(de==null)throw new Ho(`missing choices[${tt}].tool_calls[${Ne}].type
|
|
1829
1832
|
${Lbt(o)}`);if(jn==null)throw new Ho(`missing choices[${tt}].tool_calls[${Ne}].function.name
|
|
1830
1833
|
${Lbt(o)}`);if(Dn==null)throw new Ho(`missing choices[${tt}].tool_calls[${Ne}].function.arguments
|
|
1831
|
-
${Lbt(o)}`);return{...er,id:cn,type:de,function:{...or,name:jn,arguments:Dn}}})}}:{...st,message:{...St,content:at,role:ie,refusal:q.refusal??null},finish_reason:et,index:tt,logprobs:nt}}),created:C,model:N,object:"chat.completion",...L?{system_fingerprint:L}:{}};return YBn(G,s)}function Lbt(o){return JSON.stringify(o)}class Imt extends WQ{static fromReadableStream(s){const p=new Imt(null);return p._run(()=>p._fromReadableStream(s)),p}static runTools(s,p,y){const C=new Imt(p),N={...y,headers:{...y==null?void 0:y.headers,"X-Stainless-Helper-Method":"runTools"}};return C._run(()=>C._runTools(s,p,N)),C}}let n$t=class extends oc{constructor(){super(...arguments),this.messages=new xOe(this._client)}create(s,p){return this._client.post("/chat/completions",{body:s,...p,stream:s.stream??!1})}retrieve(s,p){return this._client.get(Ma`/chat/completions/${s}`,p)}update(s,p,y){return this._client.post(Ma`/chat/completions/${s}`,{body:p,...y})}list(s={},p){return this._client.getAPIList("/chat/completions",f0,{query:s,...p})}delete(s,p){return this._client.delete(Ma`/chat/completions/${s}`,p)}parse(s,p){return JBn(s.tools),this._client.chat.completions.create(s,{...p,headers:{...p==null?void 0:p.headers,"X-Stainless-Helper-Method":"chat.completions.parse"}})._thenUnwrap(y=>t$t(y,s))}runTools(s,p){return s.stream?Imt.runTools(this._client,s,p):e$t.runTools(this._client,s,p)}stream(s,p){return WQ.createChatCompletion(this._client,s,p)}};n$t.Messages=xOe;class r$t extends oc{constructor(){super(...arguments),this.completions=new n$t(this._client)}}r$t.Completions=n$t;const zOe=Symbol("brand.privateNullableHeaders"),JCe=Array.isArray;function*sFn(o){if(!o)return;if(zOe in o){const{values:y,nulls:C}=o;yield*y.entries();for(const N of C)yield[N,null];return}let s=!1,p;o instanceof Headers?p=o.entries():JCe(o)?p=o:(s=!0,p=Object.entries(o??{}));for(let y of p){const C=y[0];if(typeof C!="string")throw new TypeError("expected header name to be a string");const N=JCe(y[1])?y[1]:[y[1]];let L=!1;for(const z of N)z!==void 0&&(s&&!L&&(L=!0,yield[C,null]),yield[C,z])}}const co=o=>{const s=new Headers,p=new Set;for(const y of o){const C=new Set;for(const[N,L]of sFn(y)){const z=N.toLowerCase();C.has(z)||(s.delete(N),C.add(z)),L===null?(s.delete(N),p.add(z)):(s.append(N,L),p.delete(z))}}return{[zOe]:!0,values:s,nulls:p}};class UOe extends oc{create(s,p){return this._client.post("/audio/speech",{body:s,...p,headers:co([{Accept:"application/octet-stream"},p==null?void 0:p.headers]),__binaryResponse:!0})}}class qOe extends oc{create(s,p){return this._client.post("/audio/transcriptions",wP({body:s,...p,stream:s.stream??!1,__metadata:{model:s.model}},this._client))}}class WOe extends oc{create(s,p){return this._client.post("/audio/translations",wP({body:s,...p,__metadata:{model:s.model}},this._client))}}class eJ extends oc{constructor(){super(...arguments),this.transcriptions=new qOe(this._client),this.translations=new WOe(this._client),this.speech=new UOe(this._client)}}eJ.Transcriptions=qOe;eJ.Translations=WOe;eJ.Speech=UOe;class KOe extends oc{create(s,p){return this._client.post("/batches",{body:s,...p})}retrieve(s,p){return this._client.get(Ma`/batches/${s}`,p)}list(s={},p){return this._client.getAPIList("/batches",f0,{query:s,...p})}cancel(s,p){return this._client.post(Ma`/batches/${s}/cancel`,p)}}class GOe extends oc{create(s,p){return this._client.post("/assistants",{body:s,...p,headers:co([{"OpenAI-Beta":"assistants=v2"},p==null?void 0:p.headers])})}retrieve(s,p){return this._client.get(Ma`/assistants/${s}`,{...p,headers:co([{"OpenAI-Beta":"assistants=v2"},p==null?void 0:p.headers])})}update(s,p,y){return this._client.post(Ma`/assistants/${s}`,{body:p,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}list(s={},p){return this._client.getAPIList("/assistants",f0,{query:s,...p,headers:co([{"OpenAI-Beta":"assistants=v2"},p==null?void 0:p.headers])})}delete(s,p){return this._client.delete(Ma`/assistants/${s}`,{...p,headers:co([{"OpenAI-Beta":"assistants=v2"},p==null?void 0:p.headers])})}}class YOe extends oc{create(s,p){return this._client.post("/realtime/sessions",{body:s,...p,headers:co([{"OpenAI-Beta":"assistants=v2"},p==null?void 0:p.headers])})}}class VOe extends oc{create(s,p){return this._client.post("/realtime/transcription_sessions",{body:s,...p,headers:co([{"OpenAI-Beta":"assistants=v2"},p==null?void 0:p.headers])})}}class n2t extends oc{constructor(){super(...arguments),this.sessions=new YOe(this._client),this.transcriptionSessions=new VOe(this._client)}}n2t.Sessions=YOe;n2t.TranscriptionSessions=VOe;class XOe extends oc{create(s,p,y){return this._client.post(Ma`/threads/${s}/messages`,{body:p,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}retrieve(s,p,y){const{thread_id:C}=p;return this._client.get(Ma`/threads/${C}/messages/${s}`,{...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}update(s,p,y){const{thread_id:C,...N}=p;return this._client.post(Ma`/threads/${C}/messages/${s}`,{body:N,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}list(s,p={},y){return this._client.getAPIList(Ma`/threads/${s}/messages`,f0,{query:p,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}delete(s,p,y){const{thread_id:C}=p;return this._client.delete(Ma`/threads/${C}/messages/${s}`,{...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}}class QOe extends oc{retrieve(s,p,y){const{thread_id:C,run_id:N,...L}=p;return this._client.get(Ma`/threads/${C}/runs/${N}/steps/${s}`,{query:L,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}list(s,p,y){const{thread_id:C,...N}=p;return this._client.getAPIList(Ma`/threads/${C}/runs/${s}/steps`,f0,{query:N,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}}const oFn=o=>{if(typeof Buffer<"u"){const s=Buffer.from(o,"base64");return Array.from(new Float32Array(s.buffer,s.byteOffset,s.length/Float32Array.BYTES_PER_ELEMENT))}else{const s=atob(o),p=s.length,y=new Uint8Array(p);for(let C=0;C<p;C++)y[C]=s.charCodeAt(C);return Array.from(new Float32Array(y.buffer))}};var JDt={};const hQ=o=>{var s,p,y,C;if(typeof globalThis.process<"u")return((s=JDt==null?void 0:JDt[o])==null?void 0:s.trim())??void 0;if(typeof globalThis.Deno<"u")return(C=(y=(p=globalThis.Deno.env)==null?void 0:p.get)==null?void 0:y.call(p,o))==null?void 0:C.trim()};var Pg,lP,lFt,x6,Ybt,Q_,hP,jF,oP,Omt,kw,Vbt,Xbt,OQ,TQ,kQ,ZCe,t9e,e9e,n9e,r9e,i9e,a9e;class NQ extends JFt{constructor(){super(...arguments),Pg.add(this),lFt.set(this,[]),x6.set(this,{}),Ybt.set(this,{}),Q_.set(this,void 0),hP.set(this,void 0),jF.set(this,void 0),oP.set(this,void 0),Omt.set(this,void 0),kw.set(this,void 0),Vbt.set(this,void 0),Xbt.set(this,void 0),OQ.set(this,void 0)}[(lFt=new WeakMap,x6=new WeakMap,Ybt=new WeakMap,Q_=new WeakMap,hP=new WeakMap,jF=new WeakMap,oP=new WeakMap,Omt=new WeakMap,kw=new WeakMap,Vbt=new WeakMap,Xbt=new WeakMap,OQ=new WeakMap,Pg=new WeakSet,Symbol.asyncIterator)](){const s=[],p=[];let y=!1;return this.on("event",C=>{const N=p.shift();N?N.resolve(C):s.push(C)}),this.on("end",()=>{y=!0;for(const C of p)C.resolve(void 0);p.length=0}),this.on("abort",C=>{y=!0;for(const N of p)N.reject(C);p.length=0}),this.on("error",C=>{y=!0;for(const N of p)N.reject(C);p.length=0}),{next:async()=>s.length?{value:s.shift(),done:!1}:y?{value:void 0,done:!0}:new Promise((N,L)=>p.push({resolve:N,reject:L})).then(N=>N?{value:N,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}static fromReadableStream(s){const p=new lP;return p._run(()=>p._fromReadableStream(s)),p}async _fromReadableStream(s,p){var N;const y=p==null?void 0:p.signal;y&&(y.aborted&&this.controller.abort(),y.addEventListener("abort",()=>this.controller.abort())),this._connected();const C=S6.fromReadableStream(s,this.controller);for await(const L of C)wr(this,Pg,"m",TQ).call(this,L);if((N=C.controller.signal)!=null&&N.aborted)throw new I3;return this._addRun(wr(this,Pg,"m",kQ).call(this))}toReadableStream(){return new S6(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}static createToolAssistantStream(s,p,y,C){const N=new lP;return N._run(()=>N._runToolAssistantStream(s,p,y,{...C,headers:{...C==null?void 0:C.headers,"X-Stainless-Helper-Method":"stream"}})),N}async _createToolAssistantStream(s,p,y,C){var G;const N=C==null?void 0:C.signal;N&&(N.aborted&&this.controller.abort(),N.addEventListener("abort",()=>this.controller.abort()));const L={...y,stream:!0},z=await s.submitToolOutputs(p,L,{...C,signal:this.controller.signal});this._connected();for await(const q of z)wr(this,Pg,"m",TQ).call(this,q);if((G=z.controller.signal)!=null&&G.aborted)throw new I3;return this._addRun(wr(this,Pg,"m",kQ).call(this))}static createThreadAssistantStream(s,p,y){const C=new lP;return C._run(()=>C._threadAssistantStream(s,p,{...y,headers:{...y==null?void 0:y.headers,"X-Stainless-Helper-Method":"stream"}})),C}static createAssistantStream(s,p,y,C){const N=new lP;return N._run(()=>N._runAssistantStream(s,p,y,{...C,headers:{...C==null?void 0:C.headers,"X-Stainless-Helper-Method":"stream"}})),N}currentEvent(){return wr(this,Vbt,"f")}currentRun(){return wr(this,Xbt,"f")}currentMessageSnapshot(){return wr(this,Q_,"f")}currentRunStepSnapshot(){return wr(this,OQ,"f")}async finalRunSteps(){return await this.done(),Object.values(wr(this,x6,"f"))}async finalMessages(){return await this.done(),Object.values(wr(this,Ybt,"f"))}async finalRun(){if(await this.done(),!wr(this,hP,"f"))throw Error("Final run was not received.");return wr(this,hP,"f")}async _createThreadAssistantStream(s,p,y){var z;const C=y==null?void 0:y.signal;C&&(C.aborted&&this.controller.abort(),C.addEventListener("abort",()=>this.controller.abort()));const N={...p,stream:!0},L=await s.createAndRun(N,{...y,signal:this.controller.signal});this._connected();for await(const G of L)wr(this,Pg,"m",TQ).call(this,G);if((z=L.controller.signal)!=null&&z.aborted)throw new I3;return this._addRun(wr(this,Pg,"m",kQ).call(this))}async _createAssistantStream(s,p,y,C){var G;const N=C==null?void 0:C.signal;N&&(N.aborted&&this.controller.abort(),N.addEventListener("abort",()=>this.controller.abort()));const L={...y,stream:!0},z=await s.create(p,L,{...C,signal:this.controller.signal});this._connected();for await(const q of z)wr(this,Pg,"m",TQ).call(this,q);if((G=z.controller.signal)!=null&&G.aborted)throw new I3;return this._addRun(wr(this,Pg,"m",kQ).call(this))}static accumulateDelta(s,p){for(const[y,C]of Object.entries(p)){if(!s.hasOwnProperty(y)){s[y]=C;continue}let N=s[y];if(N==null){s[y]=C;continue}if(y==="index"||y==="type"){s[y]=C;continue}if(typeof N=="string"&&typeof C=="string")N+=C;else if(typeof N=="number"&&typeof C=="number")N+=C;else if(qDt(N)&&qDt(C))N=this.accumulateDelta(N,C);else if(Array.isArray(N)&&Array.isArray(C)){if(N.every(L=>typeof L=="string"||typeof L=="number")){N.push(...C);continue}for(const L of C){if(!qDt(L))throw new Error(`Expected array delta entry to be an object but got: ${L}`);const z=L.index;if(z==null)throw console.error(L),new Error("Expected array delta entry to have an `index` property");if(typeof z!="number")throw new Error(`Expected array delta entry \`index\` property to be a number but got ${z}`);const G=N[z];G==null?N.push(L):N[z]=this.accumulateDelta(G,L)}continue}else throw Error(`Unhandled record type: ${y}, deltaValue: ${C}, accValue: ${N}`);s[y]=N}return s}_addRun(s){return s}async _threadAssistantStream(s,p,y){return await this._createThreadAssistantStream(p,s,y)}async _runAssistantStream(s,p,y,C){return await this._createAssistantStream(p,s,y,C)}async _runToolAssistantStream(s,p,y,C){return await this._createToolAssistantStream(p,s,y,C)}}lP=NQ,TQ=function(s){if(!this.ended)switch(tc(this,Vbt,s),wr(this,Pg,"m",e9e).call(this,s),s.event){case"thread.created":break;case"thread.run.created":case"thread.run.queued":case"thread.run.in_progress":case"thread.run.requires_action":case"thread.run.completed":case"thread.run.incomplete":case"thread.run.failed":case"thread.run.cancelling":case"thread.run.cancelled":case"thread.run.expired":wr(this,Pg,"m",a9e).call(this,s);break;case"thread.run.step.created":case"thread.run.step.in_progress":case"thread.run.step.delta":case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":wr(this,Pg,"m",t9e).call(this,s);break;case"thread.message.created":case"thread.message.in_progress":case"thread.message.delta":case"thread.message.completed":case"thread.message.incomplete":wr(this,Pg,"m",ZCe).call(this,s);break;case"error":throw new Error("Encountered an error event in event processing - errors should be processed earlier")}},kQ=function(){if(this.ended)throw new Ho("stream has ended, this shouldn't happen");if(!wr(this,hP,"f"))throw Error("Final run has not been received");return wr(this,hP,"f")},ZCe=function(s){const[p,y]=wr(this,Pg,"m",r9e).call(this,s,wr(this,Q_,"f"));tc(this,Q_,p),wr(this,Ybt,"f")[p.id]=p;for(const C of y){const N=p.content[C.index];(N==null?void 0:N.type)=="text"&&this._emit("textCreated",N.text)}switch(s.event){case"thread.message.created":this._emit("messageCreated",s.data);break;case"thread.message.in_progress":break;case"thread.message.delta":if(this._emit("messageDelta",s.data.delta,p),s.data.delta.content)for(const C of s.data.delta.content){if(C.type=="text"&&C.text){let N=C.text,L=p.content[C.index];if(L&&L.type=="text")this._emit("textDelta",N,L.text);else throw Error("The snapshot associated with this text delta is not text or missing")}if(C.index!=wr(this,jF,"f")){if(wr(this,oP,"f"))switch(wr(this,oP,"f").type){case"text":this._emit("textDone",wr(this,oP,"f").text,wr(this,Q_,"f"));break;case"image_file":this._emit("imageFileDone",wr(this,oP,"f").image_file,wr(this,Q_,"f"));break}tc(this,jF,C.index)}tc(this,oP,p.content[C.index])}break;case"thread.message.completed":case"thread.message.incomplete":if(wr(this,jF,"f")!==void 0){const C=s.data.content[wr(this,jF,"f")];if(C)switch(C.type){case"image_file":this._emit("imageFileDone",C.image_file,wr(this,Q_,"f"));break;case"text":this._emit("textDone",C.text,wr(this,Q_,"f"));break}}wr(this,Q_,"f")&&this._emit("messageDone",s.data),tc(this,Q_,void 0)}},t9e=function(s){const p=wr(this,Pg,"m",n9e).call(this,s);switch(tc(this,OQ,p),s.event){case"thread.run.step.created":this._emit("runStepCreated",s.data);break;case"thread.run.step.delta":const y=s.data.delta;if(y.step_details&&y.step_details.type=="tool_calls"&&y.step_details.tool_calls&&p.step_details.type=="tool_calls")for(const N of y.step_details.tool_calls)N.index==wr(this,Omt,"f")?this._emit("toolCallDelta",N,p.step_details.tool_calls[N.index]):(wr(this,kw,"f")&&this._emit("toolCallDone",wr(this,kw,"f")),tc(this,Omt,N.index),tc(this,kw,p.step_details.tool_calls[N.index]),wr(this,kw,"f")&&this._emit("toolCallCreated",wr(this,kw,"f")));this._emit("runStepDelta",s.data.delta,p);break;case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":tc(this,OQ,void 0),s.data.step_details.type=="tool_calls"&&wr(this,kw,"f")&&(this._emit("toolCallDone",wr(this,kw,"f")),tc(this,kw,void 0)),this._emit("runStepDone",s.data,p);break}},e9e=function(s){wr(this,lFt,"f").push(s),this._emit("event",s)},n9e=function(s){switch(s.event){case"thread.run.step.created":return wr(this,x6,"f")[s.data.id]=s.data,s.data;case"thread.run.step.delta":let p=wr(this,x6,"f")[s.data.id];if(!p)throw Error("Received a RunStepDelta before creation of a snapshot");let y=s.data;if(y.delta){const C=lP.accumulateDelta(p,y.delta);wr(this,x6,"f")[s.data.id]=C}return wr(this,x6,"f")[s.data.id];case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":case"thread.run.step.in_progress":wr(this,x6,"f")[s.data.id]=s.data;break}if(wr(this,x6,"f")[s.data.id])return wr(this,x6,"f")[s.data.id];throw new Error("No snapshot available")},r9e=function(s,p){let y=[];switch(s.event){case"thread.message.created":return[s.data,y];case"thread.message.delta":if(!p)throw Error("Received a delta with no existing snapshot (there should be one from message creation)");let C=s.data;if(C.delta.content)for(const N of C.delta.content)if(N.index in p.content){let L=p.content[N.index];p.content[N.index]=wr(this,Pg,"m",i9e).call(this,N,L)}else p.content[N.index]=N,y.push(N);return[p,y];case"thread.message.in_progress":case"thread.message.completed":case"thread.message.incomplete":if(p)return[p,y];throw Error("Received thread message event with no existing snapshot")}throw Error("Tried to accumulate a non-message event")},i9e=function(s,p){return lP.accumulateDelta(p,s)},a9e=function(s){switch(tc(this,Xbt,s.data),s.event){case"thread.run.created":break;case"thread.run.queued":break;case"thread.run.in_progress":break;case"thread.run.requires_action":case"thread.run.cancelled":case"thread.run.failed":case"thread.run.completed":case"thread.run.expired":case"thread.run.incomplete":tc(this,hP,s.data),wr(this,kw,"f")&&(this._emit("toolCallDone",wr(this,kw,"f")),tc(this,kw,void 0));break}};let i$t=class extends oc{constructor(){super(...arguments),this.steps=new QOe(this._client)}create(s,p,y){const{include:C,...N}=p;return this._client.post(Ma`/threads/${s}/runs`,{query:{include:C},body:N,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers]),stream:p.stream??!1})}retrieve(s,p,y){const{thread_id:C}=p;return this._client.get(Ma`/threads/${C}/runs/${s}`,{...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}update(s,p,y){const{thread_id:C,...N}=p;return this._client.post(Ma`/threads/${C}/runs/${s}`,{body:N,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}list(s,p={},y){return this._client.getAPIList(Ma`/threads/${s}/runs`,f0,{query:p,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}cancel(s,p,y){const{thread_id:C}=p;return this._client.post(Ma`/threads/${C}/runs/${s}/cancel`,{...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}async createAndPoll(s,p,y){const C=await this.create(s,p,y);return await this.poll(C.id,{thread_id:s},y)}createAndStream(s,p,y){return NQ.createAssistantStream(s,this._client.beta.threads.runs,p,y)}async poll(s,p,y){var N;const C=co([y==null?void 0:y.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":((N=y==null?void 0:y.pollIntervalMs)==null?void 0:N.toString())??void 0}]);for(;;){const{data:L,response:z}=await this.retrieve(s,p,{...y,headers:{...y==null?void 0:y.headers,...C}}).withResponse();switch(L.status){case"queued":case"in_progress":case"cancelling":let G=5e3;if(y!=null&&y.pollIntervalMs)G=y.pollIntervalMs;else{const q=z.headers.get("openai-poll-after-ms");if(q){const et=parseInt(q);isNaN(et)||(G=et)}}await ZQ(G);break;case"requires_action":case"incomplete":case"cancelled":case"completed":case"failed":case"expired":return L}}}stream(s,p,y){return NQ.createAssistantStream(s,this._client.beta.threads.runs,p,y)}submitToolOutputs(s,p,y){const{thread_id:C,...N}=p;return this._client.post(Ma`/threads/${C}/runs/${s}/submit_tool_outputs`,{body:N,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers]),stream:p.stream??!1})}async submitToolOutputsAndPoll(s,p,y){const C=await this.submitToolOutputs(s,p,y);return await this.poll(C.id,p,y)}submitToolOutputsStream(s,p,y){return NQ.createToolAssistantStream(s,this._client.beta.threads.runs,p,y)}};i$t.Steps=QOe;class r2t extends oc{constructor(){super(...arguments),this.runs=new i$t(this._client),this.messages=new XOe(this._client)}create(s={},p){return this._client.post("/threads",{body:s,...p,headers:co([{"OpenAI-Beta":"assistants=v2"},p==null?void 0:p.headers])})}retrieve(s,p){return this._client.get(Ma`/threads/${s}`,{...p,headers:co([{"OpenAI-Beta":"assistants=v2"},p==null?void 0:p.headers])})}update(s,p,y){return this._client.post(Ma`/threads/${s}`,{body:p,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}delete(s,p){return this._client.delete(Ma`/threads/${s}`,{...p,headers:co([{"OpenAI-Beta":"assistants=v2"},p==null?void 0:p.headers])})}createAndRun(s,p){return this._client.post("/threads/runs",{body:s,...p,headers:co([{"OpenAI-Beta":"assistants=v2"},p==null?void 0:p.headers]),stream:s.stream??!1})}async createAndRunPoll(s,p){const y=await this.createAndRun(s,p);return await this.runs.poll(y.id,{thread_id:y.thread_id},p)}createAndRunStream(s,p){return NQ.createThreadAssistantStream(s,this._client.beta.threads,p)}}r2t.Runs=i$t;r2t.Messages=XOe;class nJ extends oc{constructor(){super(...arguments),this.realtime=new n2t(this._client),this.assistants=new GOe(this._client),this.threads=new r2t(this._client)}}nJ.Realtime=n2t;nJ.Assistants=GOe;nJ.Threads=r2t;class JOe extends oc{create(s,p){return this._client.post("/completions",{body:s,...p,stream:s.stream??!1})}}class ZOe extends oc{retrieve(s,p,y){const{container_id:C}=p;return this._client.get(Ma`/containers/${C}/files/${s}/content`,{...y,headers:co([{Accept:"application/binary"},y==null?void 0:y.headers]),__binaryResponse:!0})}}let a$t=class extends oc{constructor(){super(...arguments),this.content=new ZOe(this._client)}create(s,p,y){return this._client.post(Ma`/containers/${s}/files`,wP({body:p,...y},this._client))}retrieve(s,p,y){const{container_id:C}=p;return this._client.get(Ma`/containers/${C}/files/${s}`,y)}list(s,p={},y){return this._client.getAPIList(Ma`/containers/${s}/files`,f0,{query:p,...y})}delete(s,p,y){const{container_id:C}=p;return this._client.delete(Ma`/containers/${C}/files/${s}`,{...y,headers:co([{Accept:"*/*"},y==null?void 0:y.headers])})}};a$t.Content=ZOe;class s$t extends oc{constructor(){super(...arguments),this.files=new a$t(this._client)}create(s,p){return this._client.post("/containers",{body:s,...p})}retrieve(s,p){return this._client.get(Ma`/containers/${s}`,p)}list(s={},p){return this._client.getAPIList("/containers",f0,{query:s,...p})}delete(s,p){return this._client.delete(Ma`/containers/${s}`,{...p,headers:co([{Accept:"*/*"},p==null?void 0:p.headers])})}}s$t.Files=a$t;class tNe extends oc{create(s,p){const y=!!s.encoding_format;let C=y?s.encoding_format:"base64";y&&Tb(this._client).debug("embeddings/user defined encoding_format:",s.encoding_format);const N=this._client.post("/embeddings",{body:{...s,encoding_format:C},...p});return y?N:(Tb(this._client).debug("embeddings/decoding base64 embeddings from base64"),N._thenUnwrap(L=>(L&&L.data&&L.data.forEach(z=>{const G=z.embedding;z.embedding=oFn(G)}),L)))}}class eNe extends oc{retrieve(s,p,y){const{eval_id:C,run_id:N}=p;return this._client.get(Ma`/evals/${C}/runs/${N}/output_items/${s}`,y)}list(s,p,y){const{eval_id:C,...N}=p;return this._client.getAPIList(Ma`/evals/${C}/runs/${s}/output_items`,f0,{query:N,...y})}}class o$t extends oc{constructor(){super(...arguments),this.outputItems=new eNe(this._client)}create(s,p,y){return this._client.post(Ma`/evals/${s}/runs`,{body:p,...y})}retrieve(s,p,y){const{eval_id:C}=p;return this._client.get(Ma`/evals/${C}/runs/${s}`,y)}list(s,p={},y){return this._client.getAPIList(Ma`/evals/${s}/runs`,f0,{query:p,...y})}delete(s,p,y){const{eval_id:C}=p;return this._client.delete(Ma`/evals/${C}/runs/${s}`,y)}cancel(s,p,y){const{eval_id:C}=p;return this._client.post(Ma`/evals/${C}/runs/${s}`,y)}}o$t.OutputItems=eNe;class c$t extends oc{constructor(){super(...arguments),this.runs=new o$t(this._client)}create(s,p){return this._client.post("/evals",{body:s,...p})}retrieve(s,p){return this._client.get(Ma`/evals/${s}`,p)}update(s,p,y){return this._client.post(Ma`/evals/${s}`,{body:p,...y})}list(s={},p){return this._client.getAPIList("/evals",f0,{query:s,...p})}delete(s,p){return this._client.delete(Ma`/evals/${s}`,p)}}c$t.Runs=o$t;let nNe=class extends oc{create(s,p){return this._client.post("/files",wP({body:s,...p},this._client))}retrieve(s,p){return this._client.get(Ma`/files/${s}`,p)}list(s={},p){return this._client.getAPIList("/files",f0,{query:s,...p})}delete(s,p){return this._client.delete(Ma`/files/${s}`,p)}content(s,p){return this._client.get(Ma`/files/${s}/content`,{...p,headers:co([{Accept:"application/binary"},p==null?void 0:p.headers]),__binaryResponse:!0})}async waitForProcessing(s,{pollInterval:p=5e3,maxWait:y=30*60*1e3}={}){const C=new Set(["processed","error","deleted"]),N=Date.now();let L=await this.retrieve(s);for(;!L.status||!C.has(L.status);)if(await ZQ(p),L=await this.retrieve(s),Date.now()-N>y)throw new XFt({message:`Giving up on waiting for file ${s} to finish processing after ${y} milliseconds.`});return L}};class rNe extends oc{}let iNe=class extends oc{run(s,p){return this._client.post("/fine_tuning/alpha/graders/run",{body:s,...p})}validate(s,p){return this._client.post("/fine_tuning/alpha/graders/validate",{body:s,...p})}};class u$t extends oc{constructor(){super(...arguments),this.graders=new iNe(this._client)}}u$t.Graders=iNe;class aNe extends oc{create(s,p,y){return this._client.getAPIList(Ma`/fine_tuning/checkpoints/${s}/permissions`,e2t,{body:p,method:"post",...y})}retrieve(s,p={},y){return this._client.get(Ma`/fine_tuning/checkpoints/${s}/permissions`,{query:p,...y})}delete(s,p,y){const{fine_tuned_model_checkpoint:C}=p;return this._client.delete(Ma`/fine_tuning/checkpoints/${C}/permissions/${s}`,y)}}let l$t=class extends oc{constructor(){super(...arguments),this.permissions=new aNe(this._client)}};l$t.Permissions=aNe;class sNe extends oc{list(s,p={},y){return this._client.getAPIList(Ma`/fine_tuning/jobs/${s}/checkpoints`,f0,{query:p,...y})}}class h$t extends oc{constructor(){super(...arguments),this.checkpoints=new sNe(this._client)}create(s,p){return this._client.post("/fine_tuning/jobs",{body:s,...p})}retrieve(s,p){return this._client.get(Ma`/fine_tuning/jobs/${s}`,p)}list(s={},p){return this._client.getAPIList("/fine_tuning/jobs",f0,{query:s,...p})}cancel(s,p){return this._client.post(Ma`/fine_tuning/jobs/${s}/cancel`,p)}listEvents(s,p={},y){return this._client.getAPIList(Ma`/fine_tuning/jobs/${s}/events`,f0,{query:p,...y})}pause(s,p){return this._client.post(Ma`/fine_tuning/jobs/${s}/pause`,p)}resume(s,p){return this._client.post(Ma`/fine_tuning/jobs/${s}/resume`,p)}}h$t.Checkpoints=sNe;class u$ extends oc{constructor(){super(...arguments),this.methods=new rNe(this._client),this.jobs=new h$t(this._client),this.checkpoints=new l$t(this._client),this.alpha=new u$t(this._client)}}u$.Methods=rNe;u$.Jobs=h$t;u$.Checkpoints=l$t;u$.Alpha=u$t;class oNe extends oc{}class f$t extends oc{constructor(){super(...arguments),this.graderModels=new oNe(this._client)}}f$t.GraderModels=oNe;class cNe extends oc{createVariation(s,p){return this._client.post("/images/variations",wP({body:s,...p},this._client))}edit(s,p){return this._client.post("/images/edits",wP({body:s,...p},this._client))}generate(s,p){return this._client.post("/images/generations",{body:s,...p})}}class uNe extends oc{retrieve(s,p){return this._client.get(Ma`/models/${s}`,p)}list(s){return this._client.getAPIList("/models",e2t,s)}delete(s,p){return this._client.delete(Ma`/models/${s}`,p)}}class lNe extends oc{create(s,p){return this._client.post("/moderations",{body:s,...p})}}function cFn(o,s){return!s||!lFn(s)?{...o,output_parsed:null,output:o.output.map(p=>p.type==="function_call"?{...p,parsed_arguments:null}:p.type==="message"?{...p,content:p.content.map(y=>({...y,parsed:null}))}:p)}:hNe(o,s)}function hNe(o,s){const p=o.output.map(C=>{if(C.type==="function_call")return{...C,parsed_arguments:dFn(s,C)};if(C.type==="message"){const N=C.content.map(L=>L.type==="output_text"?{...L,parsed:uFn(s,L.text)}:L);return{...C,content:N}}return C}),y=Object.assign({},o,{output:p});return Object.getOwnPropertyDescriptor(o,"output_text")||fNe(y),Object.defineProperty(y,"output_parsed",{enumerable:!0,get(){for(const C of y.output)if(C.type==="message"){for(const N of C.content)if(N.type==="output_text"&&N.parsed!==null)return N.parsed}return null}}),y}function uFn(o,s){var p,y,C,N;return((y=(p=o.text)==null?void 0:p.format)==null?void 0:y.type)!=="json_schema"?null:"$parseRaw"in((C=o.text)==null?void 0:C.format)?((N=o.text)==null?void 0:N.format).$parseRaw(s):JSON.parse(s)}function lFn(o){var s;return!!ZFt((s=o.text)==null?void 0:s.format)}function hFn(o){return(o==null?void 0:o.$brand)==="auto-parseable-tool"}function fFn(o,s){return o.find(p=>p.type==="function"&&p.name===s)}function dFn(o,s){const p=fFn(o.tools??[],s.name);return{...s,...s,parsed_arguments:hFn(p)?p.$parseRaw(s.arguments):p!=null&&p.strict?JSON.parse(s.arguments):null}}function fNe(o){const s=[];for(const p of o.output)if(p.type==="message")for(const y of p.content)y.type==="output_text"&&s.push(y.text);o.output_text=s.join("")}var PF,Mbt,rC,Rbt,s9e,o9e,c9e,u9e;class d$t extends JFt{constructor(s){super(),PF.add(this),Mbt.set(this,void 0),rC.set(this,void 0),Rbt.set(this,void 0),tc(this,Mbt,s)}static createResponse(s,p,y){const C=new d$t(p);return C._run(()=>C._createOrRetrieveResponse(s,p,{...y,headers:{...y==null?void 0:y.headers,"X-Stainless-Helper-Method":"stream"}})),C}async _createOrRetrieveResponse(s,p,y){var z;const C=y==null?void 0:y.signal;C&&(C.aborted&&this.controller.abort(),C.addEventListener("abort",()=>this.controller.abort())),wr(this,PF,"m",s9e).call(this);let N,L=null;"response_id"in p?(N=await s.responses.retrieve(p.response_id,{stream:!0},{...y,signal:this.controller.signal,stream:!0}),L=p.starting_after??null):N=await s.responses.create({...p,stream:!0},{...y,signal:this.controller.signal}),this._connected();for await(const G of N)wr(this,PF,"m",o9e).call(this,G,L);if((z=N.controller.signal)!=null&&z.aborted)throw new I3;return wr(this,PF,"m",c9e).call(this)}[(Mbt=new WeakMap,rC=new WeakMap,Rbt=new WeakMap,PF=new WeakSet,s9e=function(){this.ended||tc(this,rC,void 0)},o9e=function(p,y){if(this.ended)return;const C=(L,z)=>{(y==null||z.sequence_number>y)&&this._emit(L,z)},N=wr(this,PF,"m",u9e).call(this,p);switch(C("event",p),p.type){case"response.output_text.delta":{const L=N.output[p.output_index];if(!L)throw new Ho(`missing output at index ${p.output_index}`);if(L.type==="message"){const z=L.content[p.content_index];if(!z)throw new Ho(`missing content at index ${p.content_index}`);if(z.type!=="output_text")throw new Ho(`expected content to be 'output_text', got ${z.type}`);C("response.output_text.delta",{...p,snapshot:z.text})}break}case"response.function_call_arguments.delta":{const L=N.output[p.output_index];if(!L)throw new Ho(`missing output at index ${p.output_index}`);L.type==="function_call"&&C("response.function_call_arguments.delta",{...p,snapshot:L.arguments});break}default:C(p.type,p);break}},c9e=function(){if(this.ended)throw new Ho("stream has ended, this shouldn't happen");const p=wr(this,rC,"f");if(!p)throw new Ho("request ended without sending any events");tc(this,rC,void 0);const y=pFn(p,wr(this,Mbt,"f"));return tc(this,Rbt,y),y},u9e=function(p){let y=wr(this,rC,"f");if(!y){if(p.type!=="response.created")throw new Ho(`When snapshot hasn't been set yet, expected 'response.created' event, got ${p.type}`);return y=tc(this,rC,p.response),y}switch(p.type){case"response.output_item.added":{y.output.push(p.item);break}case"response.content_part.added":{const C=y.output[p.output_index];if(!C)throw new Ho(`missing output at index ${p.output_index}`);C.type==="message"&&C.content.push(p.part);break}case"response.output_text.delta":{const C=y.output[p.output_index];if(!C)throw new Ho(`missing output at index ${p.output_index}`);if(C.type==="message"){const N=C.content[p.content_index];if(!N)throw new Ho(`missing content at index ${p.content_index}`);if(N.type!=="output_text")throw new Ho(`expected content to be 'output_text', got ${N.type}`);N.text+=p.delta}break}case"response.function_call_arguments.delta":{const C=y.output[p.output_index];if(!C)throw new Ho(`missing output at index ${p.output_index}`);C.type==="function_call"&&(C.arguments+=p.delta);break}case"response.completed":{tc(this,rC,p.response);break}}return y},Symbol.asyncIterator)](){const s=[],p=[];let y=!1;return this.on("event",C=>{const N=p.shift();N?N.resolve(C):s.push(C)}),this.on("end",()=>{y=!0;for(const C of p)C.resolve(void 0);p.length=0}),this.on("abort",C=>{y=!0;for(const N of p)N.reject(C);p.length=0}),this.on("error",C=>{y=!0;for(const N of p)N.reject(C);p.length=0}),{next:async()=>s.length?{value:s.shift(),done:!1}:y?{value:void 0,done:!0}:new Promise((N,L)=>p.push({resolve:N,reject:L})).then(N=>N?{value:N,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}async finalResponse(){await this.done();const s=wr(this,Rbt,"f");if(!s)throw new Ho("stream ended without producing a ChatCompletion");return s}}function pFn(o,s){return cFn(o,s)}class dNe extends oc{list(s,p={},y){return this._client.getAPIList(Ma`/responses/${s}/input_items`,f0,{query:p,...y})}}class p$t extends oc{constructor(){super(...arguments),this.inputItems=new dNe(this._client)}create(s,p){return this._client.post("/responses",{body:s,...p,stream:s.stream??!1})._thenUnwrap(y=>("object"in y&&y.object==="response"&&fNe(y),y))}retrieve(s,p={},y){return this._client.get(Ma`/responses/${s}`,{query:p,...y,stream:(p==null?void 0:p.stream)??!1})}delete(s,p){return this._client.delete(Ma`/responses/${s}`,{...p,headers:co([{Accept:"*/*"},p==null?void 0:p.headers])})}parse(s,p){return this._client.responses.create(s,p)._thenUnwrap(y=>hNe(y,s))}stream(s,p){return d$t.createResponse(this._client,s,p)}cancel(s,p){return this._client.post(Ma`/responses/${s}/cancel`,p)}}p$t.InputItems=dNe;class pNe extends oc{create(s,p,y){return this._client.post(Ma`/uploads/${s}/parts`,wP({body:p,...y},this._client))}}class g$t extends oc{constructor(){super(...arguments),this.parts=new pNe(this._client)}create(s,p){return this._client.post("/uploads",{body:s,...p})}cancel(s,p){return this._client.post(Ma`/uploads/${s}/cancel`,p)}complete(s,p,y){return this._client.post(Ma`/uploads/${s}/complete`,{body:p,...y})}}g$t.Parts=pNe;const gFn=async o=>{const s=await Promise.allSettled(o),p=s.filter(C=>C.status==="rejected");if(p.length){for(const C of p)console.error(C.reason);throw new Error(`${p.length} promise(s) failed - see the above errors`)}const y=[];for(const C of s)C.status==="fulfilled"&&y.push(C.value);return y};class gNe extends oc{create(s,p,y){return this._client.post(Ma`/vector_stores/${s}/file_batches`,{body:p,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}retrieve(s,p,y){const{vector_store_id:C}=p;return this._client.get(Ma`/vector_stores/${C}/file_batches/${s}`,{...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}cancel(s,p,y){const{vector_store_id:C}=p;return this._client.post(Ma`/vector_stores/${C}/file_batches/${s}/cancel`,{...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}async createAndPoll(s,p,y){const C=await this.create(s,p);return await this.poll(s,C.id,y)}listFiles(s,p,y){const{vector_store_id:C,...N}=p;return this._client.getAPIList(Ma`/vector_stores/${C}/file_batches/${s}/files`,f0,{query:N,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}async poll(s,p,y){var N;const C=co([y==null?void 0:y.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":((N=y==null?void 0:y.pollIntervalMs)==null?void 0:N.toString())??void 0}]);for(;;){const{data:L,response:z}=await this.retrieve(p,{vector_store_id:s},{...y,headers:C}).withResponse();switch(L.status){case"in_progress":let G=5e3;if(y!=null&&y.pollIntervalMs)G=y.pollIntervalMs;else{const q=z.headers.get("openai-poll-after-ms");if(q){const et=parseInt(q);isNaN(et)||(G=et)}}await ZQ(G);break;case"failed":case"cancelled":case"completed":return L}}}async uploadAndPoll(s,{files:p,fileIds:y=[]},C){if(p==null||p.length==0)throw new Error("No `files` provided to process. If you've already uploaded files you should use `.createAndPoll()` instead");const N=(C==null?void 0:C.maxConcurrency)??5,L=Math.min(N,p.length),z=this._client,G=p.values(),q=[...y];async function et(nt){for(let st of nt){const at=await z.files.create({file:st,purpose:"assistants"},C);q.push(at.id)}}const tt=Array(L).fill(G).map(et);return await gFn(tt),await this.createAndPoll(s,{file_ids:q})}}class bNe extends oc{create(s,p,y){return this._client.post(Ma`/vector_stores/${s}/files`,{body:p,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}retrieve(s,p,y){const{vector_store_id:C}=p;return this._client.get(Ma`/vector_stores/${C}/files/${s}`,{...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}update(s,p,y){const{vector_store_id:C,...N}=p;return this._client.post(Ma`/vector_stores/${C}/files/${s}`,{body:N,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}list(s,p={},y){return this._client.getAPIList(Ma`/vector_stores/${s}/files`,f0,{query:p,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}delete(s,p,y){const{vector_store_id:C}=p;return this._client.delete(Ma`/vector_stores/${C}/files/${s}`,{...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}async createAndPoll(s,p,y){const C=await this.create(s,p,y);return await this.poll(s,C.id,y)}async poll(s,p,y){var N;const C=co([y==null?void 0:y.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":((N=y==null?void 0:y.pollIntervalMs)==null?void 0:N.toString())??void 0}]);for(;;){const L=await this.retrieve(p,{vector_store_id:s},{...y,headers:C}).withResponse(),z=L.data;switch(z.status){case"in_progress":let G=5e3;if(y!=null&&y.pollIntervalMs)G=y.pollIntervalMs;else{const q=L.response.headers.get("openai-poll-after-ms");if(q){const et=parseInt(q);isNaN(et)||(G=et)}}await ZQ(G);break;case"failed":case"completed":return z}}}async upload(s,p,y){const C=await this._client.files.create({file:p,purpose:"assistants"},y);return this.create(s,{file_id:C.id},y)}async uploadAndPoll(s,p,y){const C=await this.upload(s,p,y);return await this.poll(s,C.id,y)}content(s,p,y){const{vector_store_id:C}=p;return this._client.getAPIList(Ma`/vector_stores/${C}/files/${s}/content`,e2t,{...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}}class i2t extends oc{constructor(){super(...arguments),this.files=new bNe(this._client),this.fileBatches=new gNe(this._client)}create(s,p){return this._client.post("/vector_stores",{body:s,...p,headers:co([{"OpenAI-Beta":"assistants=v2"},p==null?void 0:p.headers])})}retrieve(s,p){return this._client.get(Ma`/vector_stores/${s}`,{...p,headers:co([{"OpenAI-Beta":"assistants=v2"},p==null?void 0:p.headers])})}update(s,p,y){return this._client.post(Ma`/vector_stores/${s}`,{body:p,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}list(s={},p){return this._client.getAPIList("/vector_stores",f0,{query:s,...p,headers:co([{"OpenAI-Beta":"assistants=v2"},p==null?void 0:p.headers])})}delete(s,p){return this._client.delete(Ma`/vector_stores/${s}`,{...p,headers:co([{"OpenAI-Beta":"assistants=v2"},p==null?void 0:p.headers])})}search(s,p,y){return this._client.getAPIList(Ma`/vector_stores/${s}/search`,e2t,{body:p,method:"post",...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}}i2t.Files=bNe;i2t.FileBatches=gNe;var b$t,Qbt;class dl{constructor({baseURL:s=hQ("OPENAI_BASE_URL"),apiKey:p=hQ("OPENAI_API_KEY"),organization:y=hQ("OPENAI_ORG_ID")??null,project:C=hQ("OPENAI_PROJECT_ID")??null,...N}={}){if(Qbt.set(this,void 0),this.completions=new JOe(this),this.chat=new r$t(this),this.embeddings=new tNe(this),this.files=new nNe(this),this.images=new cNe(this),this.audio=new eJ(this),this.moderations=new lNe(this),this.models=new uNe(this),this.fineTuning=new u$(this),this.graders=new f$t(this),this.vectorStores=new i2t(this),this.beta=new nJ(this),this.batches=new KOe(this),this.uploads=new g$t(this),this.responses=new p$t(this),this.evals=new c$t(this),this.containers=new s$t(this),p===void 0)throw new Ho("The OPENAI_API_KEY environment variable is missing or empty; either provide it, or instantiate the OpenAI client with an apiKey option, like new OpenAI({ apiKey: 'My API Key' }).");const L={apiKey:p,organization:y,project:C,...N,baseURL:s||"https://api.openai.com/v1"};if(!L.dangerouslyAllowBrowser&&dBn())throw new Ho(`It looks like you're running in a browser-like environment.
|
|
1834
|
+
${Lbt(o)}`);return{...er,id:cn,type:de,function:{...or,name:jn,arguments:Dn}}})}}:{...st,message:{...St,content:at,role:ie,refusal:q.refusal??null},finish_reason:et,index:tt,logprobs:nt}}),created:C,model:N,object:"chat.completion",...L?{system_fingerprint:L}:{}};return VBn(G,s)}function Lbt(o){return JSON.stringify(o)}class Imt extends WQ{static fromReadableStream(s){const p=new Imt(null);return p._run(()=>p._fromReadableStream(s)),p}static runTools(s,p,y){const C=new Imt(p),N={...y,headers:{...y==null?void 0:y.headers,"X-Stainless-Helper-Method":"runTools"}};return C._run(()=>C._runTools(s,p,N)),C}}let n$t=class extends oc{constructor(){super(...arguments),this.messages=new xOe(this._client)}create(s,p){return this._client.post("/chat/completions",{body:s,...p,stream:s.stream??!1})}retrieve(s,p){return this._client.get(Ma`/chat/completions/${s}`,p)}update(s,p,y){return this._client.post(Ma`/chat/completions/${s}`,{body:p,...y})}list(s={},p){return this._client.getAPIList("/chat/completions",f0,{query:s,...p})}delete(s,p){return this._client.delete(Ma`/chat/completions/${s}`,p)}parse(s,p){return ZBn(s.tools),this._client.chat.completions.create(s,{...p,headers:{...p==null?void 0:p.headers,"X-Stainless-Helper-Method":"chat.completions.parse"}})._thenUnwrap(y=>t$t(y,s))}runTools(s,p){return s.stream?Imt.runTools(this._client,s,p):e$t.runTools(this._client,s,p)}stream(s,p){return WQ.createChatCompletion(this._client,s,p)}};n$t.Messages=xOe;class r$t extends oc{constructor(){super(...arguments),this.completions=new n$t(this._client)}}r$t.Completions=n$t;const zOe=Symbol("brand.privateNullableHeaders"),JCe=Array.isArray;function*oFn(o){if(!o)return;if(zOe in o){const{values:y,nulls:C}=o;yield*y.entries();for(const N of C)yield[N,null];return}let s=!1,p;o instanceof Headers?p=o.entries():JCe(o)?p=o:(s=!0,p=Object.entries(o??{}));for(let y of p){const C=y[0];if(typeof C!="string")throw new TypeError("expected header name to be a string");const N=JCe(y[1])?y[1]:[y[1]];let L=!1;for(const z of N)z!==void 0&&(s&&!L&&(L=!0,yield[C,null]),yield[C,z])}}const co=o=>{const s=new Headers,p=new Set;for(const y of o){const C=new Set;for(const[N,L]of oFn(y)){const z=N.toLowerCase();C.has(z)||(s.delete(N),C.add(z)),L===null?(s.delete(N),p.add(z)):(s.append(N,L),p.delete(z))}}return{[zOe]:!0,values:s,nulls:p}};class UOe extends oc{create(s,p){return this._client.post("/audio/speech",{body:s,...p,headers:co([{Accept:"application/octet-stream"},p==null?void 0:p.headers]),__binaryResponse:!0})}}class qOe extends oc{create(s,p){return this._client.post("/audio/transcriptions",wP({body:s,...p,stream:s.stream??!1,__metadata:{model:s.model}},this._client))}}class WOe extends oc{create(s,p){return this._client.post("/audio/translations",wP({body:s,...p,__metadata:{model:s.model}},this._client))}}class eJ extends oc{constructor(){super(...arguments),this.transcriptions=new qOe(this._client),this.translations=new WOe(this._client),this.speech=new UOe(this._client)}}eJ.Transcriptions=qOe;eJ.Translations=WOe;eJ.Speech=UOe;class KOe extends oc{create(s,p){return this._client.post("/batches",{body:s,...p})}retrieve(s,p){return this._client.get(Ma`/batches/${s}`,p)}list(s={},p){return this._client.getAPIList("/batches",f0,{query:s,...p})}cancel(s,p){return this._client.post(Ma`/batches/${s}/cancel`,p)}}class GOe extends oc{create(s,p){return this._client.post("/assistants",{body:s,...p,headers:co([{"OpenAI-Beta":"assistants=v2"},p==null?void 0:p.headers])})}retrieve(s,p){return this._client.get(Ma`/assistants/${s}`,{...p,headers:co([{"OpenAI-Beta":"assistants=v2"},p==null?void 0:p.headers])})}update(s,p,y){return this._client.post(Ma`/assistants/${s}`,{body:p,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}list(s={},p){return this._client.getAPIList("/assistants",f0,{query:s,...p,headers:co([{"OpenAI-Beta":"assistants=v2"},p==null?void 0:p.headers])})}delete(s,p){return this._client.delete(Ma`/assistants/${s}`,{...p,headers:co([{"OpenAI-Beta":"assistants=v2"},p==null?void 0:p.headers])})}}class YOe extends oc{create(s,p){return this._client.post("/realtime/sessions",{body:s,...p,headers:co([{"OpenAI-Beta":"assistants=v2"},p==null?void 0:p.headers])})}}class VOe extends oc{create(s,p){return this._client.post("/realtime/transcription_sessions",{body:s,...p,headers:co([{"OpenAI-Beta":"assistants=v2"},p==null?void 0:p.headers])})}}class n2t extends oc{constructor(){super(...arguments),this.sessions=new YOe(this._client),this.transcriptionSessions=new VOe(this._client)}}n2t.Sessions=YOe;n2t.TranscriptionSessions=VOe;class XOe extends oc{create(s,p,y){return this._client.post(Ma`/threads/${s}/messages`,{body:p,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}retrieve(s,p,y){const{thread_id:C}=p;return this._client.get(Ma`/threads/${C}/messages/${s}`,{...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}update(s,p,y){const{thread_id:C,...N}=p;return this._client.post(Ma`/threads/${C}/messages/${s}`,{body:N,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}list(s,p={},y){return this._client.getAPIList(Ma`/threads/${s}/messages`,f0,{query:p,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}delete(s,p,y){const{thread_id:C}=p;return this._client.delete(Ma`/threads/${C}/messages/${s}`,{...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}}class QOe extends oc{retrieve(s,p,y){const{thread_id:C,run_id:N,...L}=p;return this._client.get(Ma`/threads/${C}/runs/${N}/steps/${s}`,{query:L,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}list(s,p,y){const{thread_id:C,...N}=p;return this._client.getAPIList(Ma`/threads/${C}/runs/${s}/steps`,f0,{query:N,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}}const cFn=o=>{if(typeof Buffer<"u"){const s=Buffer.from(o,"base64");return Array.from(new Float32Array(s.buffer,s.byteOffset,s.length/Float32Array.BYTES_PER_ELEMENT))}else{const s=atob(o),p=s.length,y=new Uint8Array(p);for(let C=0;C<p;C++)y[C]=s.charCodeAt(C);return Array.from(new Float32Array(y.buffer))}};var JDt={};const hQ=o=>{var s,p,y,C;if(typeof globalThis.process<"u")return((s=JDt==null?void 0:JDt[o])==null?void 0:s.trim())??void 0;if(typeof globalThis.Deno<"u")return(C=(y=(p=globalThis.Deno.env)==null?void 0:p.get)==null?void 0:y.call(p,o))==null?void 0:C.trim()};var Pg,lP,lFt,x6,Ybt,Q_,hP,jF,oP,Omt,kw,Vbt,Xbt,OQ,TQ,kQ,ZCe,t9e,e9e,n9e,r9e,i9e,a9e;class NQ extends JFt{constructor(){super(...arguments),Pg.add(this),lFt.set(this,[]),x6.set(this,{}),Ybt.set(this,{}),Q_.set(this,void 0),hP.set(this,void 0),jF.set(this,void 0),oP.set(this,void 0),Omt.set(this,void 0),kw.set(this,void 0),Vbt.set(this,void 0),Xbt.set(this,void 0),OQ.set(this,void 0)}[(lFt=new WeakMap,x6=new WeakMap,Ybt=new WeakMap,Q_=new WeakMap,hP=new WeakMap,jF=new WeakMap,oP=new WeakMap,Omt=new WeakMap,kw=new WeakMap,Vbt=new WeakMap,Xbt=new WeakMap,OQ=new WeakMap,Pg=new WeakSet,Symbol.asyncIterator)](){const s=[],p=[];let y=!1;return this.on("event",C=>{const N=p.shift();N?N.resolve(C):s.push(C)}),this.on("end",()=>{y=!0;for(const C of p)C.resolve(void 0);p.length=0}),this.on("abort",C=>{y=!0;for(const N of p)N.reject(C);p.length=0}),this.on("error",C=>{y=!0;for(const N of p)N.reject(C);p.length=0}),{next:async()=>s.length?{value:s.shift(),done:!1}:y?{value:void 0,done:!0}:new Promise((N,L)=>p.push({resolve:N,reject:L})).then(N=>N?{value:N,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}static fromReadableStream(s){const p=new lP;return p._run(()=>p._fromReadableStream(s)),p}async _fromReadableStream(s,p){var N;const y=p==null?void 0:p.signal;y&&(y.aborted&&this.controller.abort(),y.addEventListener("abort",()=>this.controller.abort())),this._connected();const C=S6.fromReadableStream(s,this.controller);for await(const L of C)wr(this,Pg,"m",TQ).call(this,L);if((N=C.controller.signal)!=null&&N.aborted)throw new I3;return this._addRun(wr(this,Pg,"m",kQ).call(this))}toReadableStream(){return new S6(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}static createToolAssistantStream(s,p,y,C){const N=new lP;return N._run(()=>N._runToolAssistantStream(s,p,y,{...C,headers:{...C==null?void 0:C.headers,"X-Stainless-Helper-Method":"stream"}})),N}async _createToolAssistantStream(s,p,y,C){var G;const N=C==null?void 0:C.signal;N&&(N.aborted&&this.controller.abort(),N.addEventListener("abort",()=>this.controller.abort()));const L={...y,stream:!0},z=await s.submitToolOutputs(p,L,{...C,signal:this.controller.signal});this._connected();for await(const q of z)wr(this,Pg,"m",TQ).call(this,q);if((G=z.controller.signal)!=null&&G.aborted)throw new I3;return this._addRun(wr(this,Pg,"m",kQ).call(this))}static createThreadAssistantStream(s,p,y){const C=new lP;return C._run(()=>C._threadAssistantStream(s,p,{...y,headers:{...y==null?void 0:y.headers,"X-Stainless-Helper-Method":"stream"}})),C}static createAssistantStream(s,p,y,C){const N=new lP;return N._run(()=>N._runAssistantStream(s,p,y,{...C,headers:{...C==null?void 0:C.headers,"X-Stainless-Helper-Method":"stream"}})),N}currentEvent(){return wr(this,Vbt,"f")}currentRun(){return wr(this,Xbt,"f")}currentMessageSnapshot(){return wr(this,Q_,"f")}currentRunStepSnapshot(){return wr(this,OQ,"f")}async finalRunSteps(){return await this.done(),Object.values(wr(this,x6,"f"))}async finalMessages(){return await this.done(),Object.values(wr(this,Ybt,"f"))}async finalRun(){if(await this.done(),!wr(this,hP,"f"))throw Error("Final run was not received.");return wr(this,hP,"f")}async _createThreadAssistantStream(s,p,y){var z;const C=y==null?void 0:y.signal;C&&(C.aborted&&this.controller.abort(),C.addEventListener("abort",()=>this.controller.abort()));const N={...p,stream:!0},L=await s.createAndRun(N,{...y,signal:this.controller.signal});this._connected();for await(const G of L)wr(this,Pg,"m",TQ).call(this,G);if((z=L.controller.signal)!=null&&z.aborted)throw new I3;return this._addRun(wr(this,Pg,"m",kQ).call(this))}async _createAssistantStream(s,p,y,C){var G;const N=C==null?void 0:C.signal;N&&(N.aborted&&this.controller.abort(),N.addEventListener("abort",()=>this.controller.abort()));const L={...y,stream:!0},z=await s.create(p,L,{...C,signal:this.controller.signal});this._connected();for await(const q of z)wr(this,Pg,"m",TQ).call(this,q);if((G=z.controller.signal)!=null&&G.aborted)throw new I3;return this._addRun(wr(this,Pg,"m",kQ).call(this))}static accumulateDelta(s,p){for(const[y,C]of Object.entries(p)){if(!s.hasOwnProperty(y)){s[y]=C;continue}let N=s[y];if(N==null){s[y]=C;continue}if(y==="index"||y==="type"){s[y]=C;continue}if(typeof N=="string"&&typeof C=="string")N+=C;else if(typeof N=="number"&&typeof C=="number")N+=C;else if(qDt(N)&&qDt(C))N=this.accumulateDelta(N,C);else if(Array.isArray(N)&&Array.isArray(C)){if(N.every(L=>typeof L=="string"||typeof L=="number")){N.push(...C);continue}for(const L of C){if(!qDt(L))throw new Error(`Expected array delta entry to be an object but got: ${L}`);const z=L.index;if(z==null)throw console.error(L),new Error("Expected array delta entry to have an `index` property");if(typeof z!="number")throw new Error(`Expected array delta entry \`index\` property to be a number but got ${z}`);const G=N[z];G==null?N.push(L):N[z]=this.accumulateDelta(G,L)}continue}else throw Error(`Unhandled record type: ${y}, deltaValue: ${C}, accValue: ${N}`);s[y]=N}return s}_addRun(s){return s}async _threadAssistantStream(s,p,y){return await this._createThreadAssistantStream(p,s,y)}async _runAssistantStream(s,p,y,C){return await this._createAssistantStream(p,s,y,C)}async _runToolAssistantStream(s,p,y,C){return await this._createToolAssistantStream(p,s,y,C)}}lP=NQ,TQ=function(s){if(!this.ended)switch(tc(this,Vbt,s),wr(this,Pg,"m",e9e).call(this,s),s.event){case"thread.created":break;case"thread.run.created":case"thread.run.queued":case"thread.run.in_progress":case"thread.run.requires_action":case"thread.run.completed":case"thread.run.incomplete":case"thread.run.failed":case"thread.run.cancelling":case"thread.run.cancelled":case"thread.run.expired":wr(this,Pg,"m",a9e).call(this,s);break;case"thread.run.step.created":case"thread.run.step.in_progress":case"thread.run.step.delta":case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":wr(this,Pg,"m",t9e).call(this,s);break;case"thread.message.created":case"thread.message.in_progress":case"thread.message.delta":case"thread.message.completed":case"thread.message.incomplete":wr(this,Pg,"m",ZCe).call(this,s);break;case"error":throw new Error("Encountered an error event in event processing - errors should be processed earlier")}},kQ=function(){if(this.ended)throw new Ho("stream has ended, this shouldn't happen");if(!wr(this,hP,"f"))throw Error("Final run has not been received");return wr(this,hP,"f")},ZCe=function(s){const[p,y]=wr(this,Pg,"m",r9e).call(this,s,wr(this,Q_,"f"));tc(this,Q_,p),wr(this,Ybt,"f")[p.id]=p;for(const C of y){const N=p.content[C.index];(N==null?void 0:N.type)=="text"&&this._emit("textCreated",N.text)}switch(s.event){case"thread.message.created":this._emit("messageCreated",s.data);break;case"thread.message.in_progress":break;case"thread.message.delta":if(this._emit("messageDelta",s.data.delta,p),s.data.delta.content)for(const C of s.data.delta.content){if(C.type=="text"&&C.text){let N=C.text,L=p.content[C.index];if(L&&L.type=="text")this._emit("textDelta",N,L.text);else throw Error("The snapshot associated with this text delta is not text or missing")}if(C.index!=wr(this,jF,"f")){if(wr(this,oP,"f"))switch(wr(this,oP,"f").type){case"text":this._emit("textDone",wr(this,oP,"f").text,wr(this,Q_,"f"));break;case"image_file":this._emit("imageFileDone",wr(this,oP,"f").image_file,wr(this,Q_,"f"));break}tc(this,jF,C.index)}tc(this,oP,p.content[C.index])}break;case"thread.message.completed":case"thread.message.incomplete":if(wr(this,jF,"f")!==void 0){const C=s.data.content[wr(this,jF,"f")];if(C)switch(C.type){case"image_file":this._emit("imageFileDone",C.image_file,wr(this,Q_,"f"));break;case"text":this._emit("textDone",C.text,wr(this,Q_,"f"));break}}wr(this,Q_,"f")&&this._emit("messageDone",s.data),tc(this,Q_,void 0)}},t9e=function(s){const p=wr(this,Pg,"m",n9e).call(this,s);switch(tc(this,OQ,p),s.event){case"thread.run.step.created":this._emit("runStepCreated",s.data);break;case"thread.run.step.delta":const y=s.data.delta;if(y.step_details&&y.step_details.type=="tool_calls"&&y.step_details.tool_calls&&p.step_details.type=="tool_calls")for(const N of y.step_details.tool_calls)N.index==wr(this,Omt,"f")?this._emit("toolCallDelta",N,p.step_details.tool_calls[N.index]):(wr(this,kw,"f")&&this._emit("toolCallDone",wr(this,kw,"f")),tc(this,Omt,N.index),tc(this,kw,p.step_details.tool_calls[N.index]),wr(this,kw,"f")&&this._emit("toolCallCreated",wr(this,kw,"f")));this._emit("runStepDelta",s.data.delta,p);break;case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":tc(this,OQ,void 0),s.data.step_details.type=="tool_calls"&&wr(this,kw,"f")&&(this._emit("toolCallDone",wr(this,kw,"f")),tc(this,kw,void 0)),this._emit("runStepDone",s.data,p);break}},e9e=function(s){wr(this,lFt,"f").push(s),this._emit("event",s)},n9e=function(s){switch(s.event){case"thread.run.step.created":return wr(this,x6,"f")[s.data.id]=s.data,s.data;case"thread.run.step.delta":let p=wr(this,x6,"f")[s.data.id];if(!p)throw Error("Received a RunStepDelta before creation of a snapshot");let y=s.data;if(y.delta){const C=lP.accumulateDelta(p,y.delta);wr(this,x6,"f")[s.data.id]=C}return wr(this,x6,"f")[s.data.id];case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":case"thread.run.step.in_progress":wr(this,x6,"f")[s.data.id]=s.data;break}if(wr(this,x6,"f")[s.data.id])return wr(this,x6,"f")[s.data.id];throw new Error("No snapshot available")},r9e=function(s,p){let y=[];switch(s.event){case"thread.message.created":return[s.data,y];case"thread.message.delta":if(!p)throw Error("Received a delta with no existing snapshot (there should be one from message creation)");let C=s.data;if(C.delta.content)for(const N of C.delta.content)if(N.index in p.content){let L=p.content[N.index];p.content[N.index]=wr(this,Pg,"m",i9e).call(this,N,L)}else p.content[N.index]=N,y.push(N);return[p,y];case"thread.message.in_progress":case"thread.message.completed":case"thread.message.incomplete":if(p)return[p,y];throw Error("Received thread message event with no existing snapshot")}throw Error("Tried to accumulate a non-message event")},i9e=function(s,p){return lP.accumulateDelta(p,s)},a9e=function(s){switch(tc(this,Xbt,s.data),s.event){case"thread.run.created":break;case"thread.run.queued":break;case"thread.run.in_progress":break;case"thread.run.requires_action":case"thread.run.cancelled":case"thread.run.failed":case"thread.run.completed":case"thread.run.expired":case"thread.run.incomplete":tc(this,hP,s.data),wr(this,kw,"f")&&(this._emit("toolCallDone",wr(this,kw,"f")),tc(this,kw,void 0));break}};let i$t=class extends oc{constructor(){super(...arguments),this.steps=new QOe(this._client)}create(s,p,y){const{include:C,...N}=p;return this._client.post(Ma`/threads/${s}/runs`,{query:{include:C},body:N,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers]),stream:p.stream??!1})}retrieve(s,p,y){const{thread_id:C}=p;return this._client.get(Ma`/threads/${C}/runs/${s}`,{...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}update(s,p,y){const{thread_id:C,...N}=p;return this._client.post(Ma`/threads/${C}/runs/${s}`,{body:N,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}list(s,p={},y){return this._client.getAPIList(Ma`/threads/${s}/runs`,f0,{query:p,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}cancel(s,p,y){const{thread_id:C}=p;return this._client.post(Ma`/threads/${C}/runs/${s}/cancel`,{...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}async createAndPoll(s,p,y){const C=await this.create(s,p,y);return await this.poll(C.id,{thread_id:s},y)}createAndStream(s,p,y){return NQ.createAssistantStream(s,this._client.beta.threads.runs,p,y)}async poll(s,p,y){var N;const C=co([y==null?void 0:y.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":((N=y==null?void 0:y.pollIntervalMs)==null?void 0:N.toString())??void 0}]);for(;;){const{data:L,response:z}=await this.retrieve(s,p,{...y,headers:{...y==null?void 0:y.headers,...C}}).withResponse();switch(L.status){case"queued":case"in_progress":case"cancelling":let G=5e3;if(y!=null&&y.pollIntervalMs)G=y.pollIntervalMs;else{const q=z.headers.get("openai-poll-after-ms");if(q){const et=parseInt(q);isNaN(et)||(G=et)}}await ZQ(G);break;case"requires_action":case"incomplete":case"cancelled":case"completed":case"failed":case"expired":return L}}}stream(s,p,y){return NQ.createAssistantStream(s,this._client.beta.threads.runs,p,y)}submitToolOutputs(s,p,y){const{thread_id:C,...N}=p;return this._client.post(Ma`/threads/${C}/runs/${s}/submit_tool_outputs`,{body:N,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers]),stream:p.stream??!1})}async submitToolOutputsAndPoll(s,p,y){const C=await this.submitToolOutputs(s,p,y);return await this.poll(C.id,p,y)}submitToolOutputsStream(s,p,y){return NQ.createToolAssistantStream(s,this._client.beta.threads.runs,p,y)}};i$t.Steps=QOe;class r2t extends oc{constructor(){super(...arguments),this.runs=new i$t(this._client),this.messages=new XOe(this._client)}create(s={},p){return this._client.post("/threads",{body:s,...p,headers:co([{"OpenAI-Beta":"assistants=v2"},p==null?void 0:p.headers])})}retrieve(s,p){return this._client.get(Ma`/threads/${s}`,{...p,headers:co([{"OpenAI-Beta":"assistants=v2"},p==null?void 0:p.headers])})}update(s,p,y){return this._client.post(Ma`/threads/${s}`,{body:p,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}delete(s,p){return this._client.delete(Ma`/threads/${s}`,{...p,headers:co([{"OpenAI-Beta":"assistants=v2"},p==null?void 0:p.headers])})}createAndRun(s,p){return this._client.post("/threads/runs",{body:s,...p,headers:co([{"OpenAI-Beta":"assistants=v2"},p==null?void 0:p.headers]),stream:s.stream??!1})}async createAndRunPoll(s,p){const y=await this.createAndRun(s,p);return await this.runs.poll(y.id,{thread_id:y.thread_id},p)}createAndRunStream(s,p){return NQ.createThreadAssistantStream(s,this._client.beta.threads,p)}}r2t.Runs=i$t;r2t.Messages=XOe;class nJ extends oc{constructor(){super(...arguments),this.realtime=new n2t(this._client),this.assistants=new GOe(this._client),this.threads=new r2t(this._client)}}nJ.Realtime=n2t;nJ.Assistants=GOe;nJ.Threads=r2t;class JOe extends oc{create(s,p){return this._client.post("/completions",{body:s,...p,stream:s.stream??!1})}}class ZOe extends oc{retrieve(s,p,y){const{container_id:C}=p;return this._client.get(Ma`/containers/${C}/files/${s}/content`,{...y,headers:co([{Accept:"application/binary"},y==null?void 0:y.headers]),__binaryResponse:!0})}}let a$t=class extends oc{constructor(){super(...arguments),this.content=new ZOe(this._client)}create(s,p,y){return this._client.post(Ma`/containers/${s}/files`,wP({body:p,...y},this._client))}retrieve(s,p,y){const{container_id:C}=p;return this._client.get(Ma`/containers/${C}/files/${s}`,y)}list(s,p={},y){return this._client.getAPIList(Ma`/containers/${s}/files`,f0,{query:p,...y})}delete(s,p,y){const{container_id:C}=p;return this._client.delete(Ma`/containers/${C}/files/${s}`,{...y,headers:co([{Accept:"*/*"},y==null?void 0:y.headers])})}};a$t.Content=ZOe;class s$t extends oc{constructor(){super(...arguments),this.files=new a$t(this._client)}create(s,p){return this._client.post("/containers",{body:s,...p})}retrieve(s,p){return this._client.get(Ma`/containers/${s}`,p)}list(s={},p){return this._client.getAPIList("/containers",f0,{query:s,...p})}delete(s,p){return this._client.delete(Ma`/containers/${s}`,{...p,headers:co([{Accept:"*/*"},p==null?void 0:p.headers])})}}s$t.Files=a$t;class tNe extends oc{create(s,p){const y=!!s.encoding_format;let C=y?s.encoding_format:"base64";y&&Tb(this._client).debug("embeddings/user defined encoding_format:",s.encoding_format);const N=this._client.post("/embeddings",{body:{...s,encoding_format:C},...p});return y?N:(Tb(this._client).debug("embeddings/decoding base64 embeddings from base64"),N._thenUnwrap(L=>(L&&L.data&&L.data.forEach(z=>{const G=z.embedding;z.embedding=cFn(G)}),L)))}}class eNe extends oc{retrieve(s,p,y){const{eval_id:C,run_id:N}=p;return this._client.get(Ma`/evals/${C}/runs/${N}/output_items/${s}`,y)}list(s,p,y){const{eval_id:C,...N}=p;return this._client.getAPIList(Ma`/evals/${C}/runs/${s}/output_items`,f0,{query:N,...y})}}class o$t extends oc{constructor(){super(...arguments),this.outputItems=new eNe(this._client)}create(s,p,y){return this._client.post(Ma`/evals/${s}/runs`,{body:p,...y})}retrieve(s,p,y){const{eval_id:C}=p;return this._client.get(Ma`/evals/${C}/runs/${s}`,y)}list(s,p={},y){return this._client.getAPIList(Ma`/evals/${s}/runs`,f0,{query:p,...y})}delete(s,p,y){const{eval_id:C}=p;return this._client.delete(Ma`/evals/${C}/runs/${s}`,y)}cancel(s,p,y){const{eval_id:C}=p;return this._client.post(Ma`/evals/${C}/runs/${s}`,y)}}o$t.OutputItems=eNe;class c$t extends oc{constructor(){super(...arguments),this.runs=new o$t(this._client)}create(s,p){return this._client.post("/evals",{body:s,...p})}retrieve(s,p){return this._client.get(Ma`/evals/${s}`,p)}update(s,p,y){return this._client.post(Ma`/evals/${s}`,{body:p,...y})}list(s={},p){return this._client.getAPIList("/evals",f0,{query:s,...p})}delete(s,p){return this._client.delete(Ma`/evals/${s}`,p)}}c$t.Runs=o$t;let nNe=class extends oc{create(s,p){return this._client.post("/files",wP({body:s,...p},this._client))}retrieve(s,p){return this._client.get(Ma`/files/${s}`,p)}list(s={},p){return this._client.getAPIList("/files",f0,{query:s,...p})}delete(s,p){return this._client.delete(Ma`/files/${s}`,p)}content(s,p){return this._client.get(Ma`/files/${s}/content`,{...p,headers:co([{Accept:"application/binary"},p==null?void 0:p.headers]),__binaryResponse:!0})}async waitForProcessing(s,{pollInterval:p=5e3,maxWait:y=30*60*1e3}={}){const C=new Set(["processed","error","deleted"]),N=Date.now();let L=await this.retrieve(s);for(;!L.status||!C.has(L.status);)if(await ZQ(p),L=await this.retrieve(s),Date.now()-N>y)throw new XFt({message:`Giving up on waiting for file ${s} to finish processing after ${y} milliseconds.`});return L}};class rNe extends oc{}let iNe=class extends oc{run(s,p){return this._client.post("/fine_tuning/alpha/graders/run",{body:s,...p})}validate(s,p){return this._client.post("/fine_tuning/alpha/graders/validate",{body:s,...p})}};class u$t extends oc{constructor(){super(...arguments),this.graders=new iNe(this._client)}}u$t.Graders=iNe;class aNe extends oc{create(s,p,y){return this._client.getAPIList(Ma`/fine_tuning/checkpoints/${s}/permissions`,e2t,{body:p,method:"post",...y})}retrieve(s,p={},y){return this._client.get(Ma`/fine_tuning/checkpoints/${s}/permissions`,{query:p,...y})}delete(s,p,y){const{fine_tuned_model_checkpoint:C}=p;return this._client.delete(Ma`/fine_tuning/checkpoints/${C}/permissions/${s}`,y)}}let l$t=class extends oc{constructor(){super(...arguments),this.permissions=new aNe(this._client)}};l$t.Permissions=aNe;class sNe extends oc{list(s,p={},y){return this._client.getAPIList(Ma`/fine_tuning/jobs/${s}/checkpoints`,f0,{query:p,...y})}}class h$t extends oc{constructor(){super(...arguments),this.checkpoints=new sNe(this._client)}create(s,p){return this._client.post("/fine_tuning/jobs",{body:s,...p})}retrieve(s,p){return this._client.get(Ma`/fine_tuning/jobs/${s}`,p)}list(s={},p){return this._client.getAPIList("/fine_tuning/jobs",f0,{query:s,...p})}cancel(s,p){return this._client.post(Ma`/fine_tuning/jobs/${s}/cancel`,p)}listEvents(s,p={},y){return this._client.getAPIList(Ma`/fine_tuning/jobs/${s}/events`,f0,{query:p,...y})}pause(s,p){return this._client.post(Ma`/fine_tuning/jobs/${s}/pause`,p)}resume(s,p){return this._client.post(Ma`/fine_tuning/jobs/${s}/resume`,p)}}h$t.Checkpoints=sNe;class u$ extends oc{constructor(){super(...arguments),this.methods=new rNe(this._client),this.jobs=new h$t(this._client),this.checkpoints=new l$t(this._client),this.alpha=new u$t(this._client)}}u$.Methods=rNe;u$.Jobs=h$t;u$.Checkpoints=l$t;u$.Alpha=u$t;class oNe extends oc{}class f$t extends oc{constructor(){super(...arguments),this.graderModels=new oNe(this._client)}}f$t.GraderModels=oNe;class cNe extends oc{createVariation(s,p){return this._client.post("/images/variations",wP({body:s,...p},this._client))}edit(s,p){return this._client.post("/images/edits",wP({body:s,...p},this._client))}generate(s,p){return this._client.post("/images/generations",{body:s,...p})}}class uNe extends oc{retrieve(s,p){return this._client.get(Ma`/models/${s}`,p)}list(s){return this._client.getAPIList("/models",e2t,s)}delete(s,p){return this._client.delete(Ma`/models/${s}`,p)}}class lNe extends oc{create(s,p){return this._client.post("/moderations",{body:s,...p})}}function uFn(o,s){return!s||!hFn(s)?{...o,output_parsed:null,output:o.output.map(p=>p.type==="function_call"?{...p,parsed_arguments:null}:p.type==="message"?{...p,content:p.content.map(y=>({...y,parsed:null}))}:p)}:hNe(o,s)}function hNe(o,s){const p=o.output.map(C=>{if(C.type==="function_call")return{...C,parsed_arguments:pFn(s,C)};if(C.type==="message"){const N=C.content.map(L=>L.type==="output_text"?{...L,parsed:lFn(s,L.text)}:L);return{...C,content:N}}return C}),y=Object.assign({},o,{output:p});return Object.getOwnPropertyDescriptor(o,"output_text")||fNe(y),Object.defineProperty(y,"output_parsed",{enumerable:!0,get(){for(const C of y.output)if(C.type==="message"){for(const N of C.content)if(N.type==="output_text"&&N.parsed!==null)return N.parsed}return null}}),y}function lFn(o,s){var p,y,C,N;return((y=(p=o.text)==null?void 0:p.format)==null?void 0:y.type)!=="json_schema"?null:"$parseRaw"in((C=o.text)==null?void 0:C.format)?((N=o.text)==null?void 0:N.format).$parseRaw(s):JSON.parse(s)}function hFn(o){var s;return!!ZFt((s=o.text)==null?void 0:s.format)}function fFn(o){return(o==null?void 0:o.$brand)==="auto-parseable-tool"}function dFn(o,s){return o.find(p=>p.type==="function"&&p.name===s)}function pFn(o,s){const p=dFn(o.tools??[],s.name);return{...s,...s,parsed_arguments:fFn(p)?p.$parseRaw(s.arguments):p!=null&&p.strict?JSON.parse(s.arguments):null}}function fNe(o){const s=[];for(const p of o.output)if(p.type==="message")for(const y of p.content)y.type==="output_text"&&s.push(y.text);o.output_text=s.join("")}var PF,Mbt,rC,Rbt,s9e,o9e,c9e,u9e;class d$t extends JFt{constructor(s){super(),PF.add(this),Mbt.set(this,void 0),rC.set(this,void 0),Rbt.set(this,void 0),tc(this,Mbt,s)}static createResponse(s,p,y){const C=new d$t(p);return C._run(()=>C._createOrRetrieveResponse(s,p,{...y,headers:{...y==null?void 0:y.headers,"X-Stainless-Helper-Method":"stream"}})),C}async _createOrRetrieveResponse(s,p,y){var z;const C=y==null?void 0:y.signal;C&&(C.aborted&&this.controller.abort(),C.addEventListener("abort",()=>this.controller.abort())),wr(this,PF,"m",s9e).call(this);let N,L=null;"response_id"in p?(N=await s.responses.retrieve(p.response_id,{stream:!0},{...y,signal:this.controller.signal,stream:!0}),L=p.starting_after??null):N=await s.responses.create({...p,stream:!0},{...y,signal:this.controller.signal}),this._connected();for await(const G of N)wr(this,PF,"m",o9e).call(this,G,L);if((z=N.controller.signal)!=null&&z.aborted)throw new I3;return wr(this,PF,"m",c9e).call(this)}[(Mbt=new WeakMap,rC=new WeakMap,Rbt=new WeakMap,PF=new WeakSet,s9e=function(){this.ended||tc(this,rC,void 0)},o9e=function(p,y){if(this.ended)return;const C=(L,z)=>{(y==null||z.sequence_number>y)&&this._emit(L,z)},N=wr(this,PF,"m",u9e).call(this,p);switch(C("event",p),p.type){case"response.output_text.delta":{const L=N.output[p.output_index];if(!L)throw new Ho(`missing output at index ${p.output_index}`);if(L.type==="message"){const z=L.content[p.content_index];if(!z)throw new Ho(`missing content at index ${p.content_index}`);if(z.type!=="output_text")throw new Ho(`expected content to be 'output_text', got ${z.type}`);C("response.output_text.delta",{...p,snapshot:z.text})}break}case"response.function_call_arguments.delta":{const L=N.output[p.output_index];if(!L)throw new Ho(`missing output at index ${p.output_index}`);L.type==="function_call"&&C("response.function_call_arguments.delta",{...p,snapshot:L.arguments});break}default:C(p.type,p);break}},c9e=function(){if(this.ended)throw new Ho("stream has ended, this shouldn't happen");const p=wr(this,rC,"f");if(!p)throw new Ho("request ended without sending any events");tc(this,rC,void 0);const y=gFn(p,wr(this,Mbt,"f"));return tc(this,Rbt,y),y},u9e=function(p){let y=wr(this,rC,"f");if(!y){if(p.type!=="response.created")throw new Ho(`When snapshot hasn't been set yet, expected 'response.created' event, got ${p.type}`);return y=tc(this,rC,p.response),y}switch(p.type){case"response.output_item.added":{y.output.push(p.item);break}case"response.content_part.added":{const C=y.output[p.output_index];if(!C)throw new Ho(`missing output at index ${p.output_index}`);C.type==="message"&&C.content.push(p.part);break}case"response.output_text.delta":{const C=y.output[p.output_index];if(!C)throw new Ho(`missing output at index ${p.output_index}`);if(C.type==="message"){const N=C.content[p.content_index];if(!N)throw new Ho(`missing content at index ${p.content_index}`);if(N.type!=="output_text")throw new Ho(`expected content to be 'output_text', got ${N.type}`);N.text+=p.delta}break}case"response.function_call_arguments.delta":{const C=y.output[p.output_index];if(!C)throw new Ho(`missing output at index ${p.output_index}`);C.type==="function_call"&&(C.arguments+=p.delta);break}case"response.completed":{tc(this,rC,p.response);break}}return y},Symbol.asyncIterator)](){const s=[],p=[];let y=!1;return this.on("event",C=>{const N=p.shift();N?N.resolve(C):s.push(C)}),this.on("end",()=>{y=!0;for(const C of p)C.resolve(void 0);p.length=0}),this.on("abort",C=>{y=!0;for(const N of p)N.reject(C);p.length=0}),this.on("error",C=>{y=!0;for(const N of p)N.reject(C);p.length=0}),{next:async()=>s.length?{value:s.shift(),done:!1}:y?{value:void 0,done:!0}:new Promise((N,L)=>p.push({resolve:N,reject:L})).then(N=>N?{value:N,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}async finalResponse(){await this.done();const s=wr(this,Rbt,"f");if(!s)throw new Ho("stream ended without producing a ChatCompletion");return s}}function gFn(o,s){return uFn(o,s)}class dNe extends oc{list(s,p={},y){return this._client.getAPIList(Ma`/responses/${s}/input_items`,f0,{query:p,...y})}}class p$t extends oc{constructor(){super(...arguments),this.inputItems=new dNe(this._client)}create(s,p){return this._client.post("/responses",{body:s,...p,stream:s.stream??!1})._thenUnwrap(y=>("object"in y&&y.object==="response"&&fNe(y),y))}retrieve(s,p={},y){return this._client.get(Ma`/responses/${s}`,{query:p,...y,stream:(p==null?void 0:p.stream)??!1})}delete(s,p){return this._client.delete(Ma`/responses/${s}`,{...p,headers:co([{Accept:"*/*"},p==null?void 0:p.headers])})}parse(s,p){return this._client.responses.create(s,p)._thenUnwrap(y=>hNe(y,s))}stream(s,p){return d$t.createResponse(this._client,s,p)}cancel(s,p){return this._client.post(Ma`/responses/${s}/cancel`,p)}}p$t.InputItems=dNe;class pNe extends oc{create(s,p,y){return this._client.post(Ma`/uploads/${s}/parts`,wP({body:p,...y},this._client))}}class g$t extends oc{constructor(){super(...arguments),this.parts=new pNe(this._client)}create(s,p){return this._client.post("/uploads",{body:s,...p})}cancel(s,p){return this._client.post(Ma`/uploads/${s}/cancel`,p)}complete(s,p,y){return this._client.post(Ma`/uploads/${s}/complete`,{body:p,...y})}}g$t.Parts=pNe;const bFn=async o=>{const s=await Promise.allSettled(o),p=s.filter(C=>C.status==="rejected");if(p.length){for(const C of p)console.error(C.reason);throw new Error(`${p.length} promise(s) failed - see the above errors`)}const y=[];for(const C of s)C.status==="fulfilled"&&y.push(C.value);return y};class gNe extends oc{create(s,p,y){return this._client.post(Ma`/vector_stores/${s}/file_batches`,{body:p,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}retrieve(s,p,y){const{vector_store_id:C}=p;return this._client.get(Ma`/vector_stores/${C}/file_batches/${s}`,{...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}cancel(s,p,y){const{vector_store_id:C}=p;return this._client.post(Ma`/vector_stores/${C}/file_batches/${s}/cancel`,{...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}async createAndPoll(s,p,y){const C=await this.create(s,p);return await this.poll(s,C.id,y)}listFiles(s,p,y){const{vector_store_id:C,...N}=p;return this._client.getAPIList(Ma`/vector_stores/${C}/file_batches/${s}/files`,f0,{query:N,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}async poll(s,p,y){var N;const C=co([y==null?void 0:y.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":((N=y==null?void 0:y.pollIntervalMs)==null?void 0:N.toString())??void 0}]);for(;;){const{data:L,response:z}=await this.retrieve(p,{vector_store_id:s},{...y,headers:C}).withResponse();switch(L.status){case"in_progress":let G=5e3;if(y!=null&&y.pollIntervalMs)G=y.pollIntervalMs;else{const q=z.headers.get("openai-poll-after-ms");if(q){const et=parseInt(q);isNaN(et)||(G=et)}}await ZQ(G);break;case"failed":case"cancelled":case"completed":return L}}}async uploadAndPoll(s,{files:p,fileIds:y=[]},C){if(p==null||p.length==0)throw new Error("No `files` provided to process. If you've already uploaded files you should use `.createAndPoll()` instead");const N=(C==null?void 0:C.maxConcurrency)??5,L=Math.min(N,p.length),z=this._client,G=p.values(),q=[...y];async function et(nt){for(let st of nt){const at=await z.files.create({file:st,purpose:"assistants"},C);q.push(at.id)}}const tt=Array(L).fill(G).map(et);return await bFn(tt),await this.createAndPoll(s,{file_ids:q})}}class bNe extends oc{create(s,p,y){return this._client.post(Ma`/vector_stores/${s}/files`,{body:p,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}retrieve(s,p,y){const{vector_store_id:C}=p;return this._client.get(Ma`/vector_stores/${C}/files/${s}`,{...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}update(s,p,y){const{vector_store_id:C,...N}=p;return this._client.post(Ma`/vector_stores/${C}/files/${s}`,{body:N,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}list(s,p={},y){return this._client.getAPIList(Ma`/vector_stores/${s}/files`,f0,{query:p,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}delete(s,p,y){const{vector_store_id:C}=p;return this._client.delete(Ma`/vector_stores/${C}/files/${s}`,{...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}async createAndPoll(s,p,y){const C=await this.create(s,p,y);return await this.poll(s,C.id,y)}async poll(s,p,y){var N;const C=co([y==null?void 0:y.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":((N=y==null?void 0:y.pollIntervalMs)==null?void 0:N.toString())??void 0}]);for(;;){const L=await this.retrieve(p,{vector_store_id:s},{...y,headers:C}).withResponse(),z=L.data;switch(z.status){case"in_progress":let G=5e3;if(y!=null&&y.pollIntervalMs)G=y.pollIntervalMs;else{const q=L.response.headers.get("openai-poll-after-ms");if(q){const et=parseInt(q);isNaN(et)||(G=et)}}await ZQ(G);break;case"failed":case"completed":return z}}}async upload(s,p,y){const C=await this._client.files.create({file:p,purpose:"assistants"},y);return this.create(s,{file_id:C.id},y)}async uploadAndPoll(s,p,y){const C=await this.upload(s,p,y);return await this.poll(s,C.id,y)}content(s,p,y){const{vector_store_id:C}=p;return this._client.getAPIList(Ma`/vector_stores/${C}/files/${s}/content`,e2t,{...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}}class i2t extends oc{constructor(){super(...arguments),this.files=new bNe(this._client),this.fileBatches=new gNe(this._client)}create(s,p){return this._client.post("/vector_stores",{body:s,...p,headers:co([{"OpenAI-Beta":"assistants=v2"},p==null?void 0:p.headers])})}retrieve(s,p){return this._client.get(Ma`/vector_stores/${s}`,{...p,headers:co([{"OpenAI-Beta":"assistants=v2"},p==null?void 0:p.headers])})}update(s,p,y){return this._client.post(Ma`/vector_stores/${s}`,{body:p,...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}list(s={},p){return this._client.getAPIList("/vector_stores",f0,{query:s,...p,headers:co([{"OpenAI-Beta":"assistants=v2"},p==null?void 0:p.headers])})}delete(s,p){return this._client.delete(Ma`/vector_stores/${s}`,{...p,headers:co([{"OpenAI-Beta":"assistants=v2"},p==null?void 0:p.headers])})}search(s,p,y){return this._client.getAPIList(Ma`/vector_stores/${s}/search`,e2t,{body:p,method:"post",...y,headers:co([{"OpenAI-Beta":"assistants=v2"},y==null?void 0:y.headers])})}}i2t.Files=bNe;i2t.FileBatches=gNe;var b$t,Qbt;class dl{constructor({baseURL:s=hQ("OPENAI_BASE_URL"),apiKey:p=hQ("OPENAI_API_KEY"),organization:y=hQ("OPENAI_ORG_ID")??null,project:C=hQ("OPENAI_PROJECT_ID")??null,...N}={}){if(Qbt.set(this,void 0),this.completions=new JOe(this),this.chat=new r$t(this),this.embeddings=new tNe(this),this.files=new nNe(this),this.images=new cNe(this),this.audio=new eJ(this),this.moderations=new lNe(this),this.models=new uNe(this),this.fineTuning=new u$(this),this.graders=new f$t(this),this.vectorStores=new i2t(this),this.beta=new nJ(this),this.batches=new KOe(this),this.uploads=new g$t(this),this.responses=new p$t(this),this.evals=new c$t(this),this.containers=new s$t(this),p===void 0)throw new Ho("The OPENAI_API_KEY environment variable is missing or empty; either provide it, or instantiate the OpenAI client with an apiKey option, like new OpenAI({ apiKey: 'My API Key' }).");const L={apiKey:p,organization:y,project:C,...N,baseURL:s||"https://api.openai.com/v1"};if(!L.dangerouslyAllowBrowser&&pBn())throw new Ho(`It looks like you're running in a browser-like environment.
|
|
1832
1835
|
|
|
1833
1836
|
This is disabled by default, as it risks exposing your secret API credentials to attackers.
|
|
1834
1837
|
If you understand the risks and have appropriate mitigations in place,
|
|
@@ -1837,22 +1840,22 @@ you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g.,
|
|
|
1837
1840
|
new OpenAI({ apiKey, dangerouslyAllowBrowser: true });
|
|
1838
1841
|
|
|
1839
1842
|
https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety
|
|
1840
|
-
`);this.baseURL=L.baseURL,this.timeout=L.timeout??b$t.DEFAULT_TIMEOUT,this.logger=L.logger??console;const z="warn";this.logLevel=z,this.logLevel=jCe(L.logLevel,"ClientOptions.logLevel",this)??jCe(hQ("OPENAI_LOG"),"process.env['OPENAI_LOG']",this)??z,this.fetchOptions=L.fetchOptions,this.maxRetries=L.maxRetries??2,this.fetch=L.fetch??yBn(),tc(this,Qbt,vBn),this._options=L,this.apiKey=p,this.organization=y,this.project=C}withOptions(s){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetchOptions:this.fetchOptions,apiKey:this.apiKey,organization:this.organization,project:this.project,...s})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:s,nulls:p}){}authHeaders(s){return co([{Authorization:`Bearer ${this.apiKey}`}])}stringifyQuery(s){return OBn(s,{arrayFormat:"brackets"})}getUserAgent(){return`${this.constructor.name}/JS ${BF}`}defaultIdempotencyKey(){return`stainless-node-retry-${JIe()}`}makeStatusError(s,p,y,C){return Lg.generate(s,p,y,C)}buildURL(s,p){const y=sBn(s)?new URL(s):new URL(this.baseURL+(this.baseURL.endsWith("/")&&s.startsWith("/")?s.slice(1):s)),C=this.defaultQuery();return cBn(C)||(p={...C,...p}),typeof p=="object"&&p&&!Array.isArray(p)&&(y.search=this.stringifyQuery(p)),y.toString()}async prepareOptions(s){}async prepareRequest(s,{url:p,options:y}){}get(s,p){return this.methodRequest("get",s,p)}post(s,p){return this.methodRequest("post",s,p)}patch(s,p){return this.methodRequest("patch",s,p)}put(s,p){return this.methodRequest("put",s,p)}delete(s,p){return this.methodRequest("delete",s,p)}methodRequest(s,p,y){return this.request(Promise.resolve(y).then(C=>({method:s,path:p,...C})))}request(s,p=null){return new t2t(this,this.makeRequest(s,p,void 0))}async makeRequest(s,p,y){var St,ie;const C=await s,N=C.maxRetries??this.maxRetries;p==null&&(p=N),await this.prepareOptions(C);const{req:L,url:z,timeout:G}=this.buildRequest(C,{retryCount:N-p});await this.prepareRequest(L,{url:z,options:C});const q="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),et=y===void 0?"":`, retryOf: ${y}`,tt=Date.now();if(Tb(this).debug(`[${q}] sending request`,sP({retryOfRequestLogID:y,method:C.method,url:z,options:C,headers:L.headers})),(St=C.signal)!=null&&St.aborted)throw new I3;const nt=new AbortController,st=await this.fetchWithTimeout(z,L,G,nt).catch(tFt),at=Date.now();if(st instanceof Error){const ae=`retrying, ${p} attempts remaining`;if((ie=C.signal)!=null&&ie.aborted)throw new I3;const Ne=ZBt(st)||/timed? ?out/i.test(String(st)+("cause"in st?String(st.cause):""));if(p)return Tb(this).info(`[${q}] connection ${Ne?"timed out":"failed"} - ${ae}`),Tb(this).debug(`[${q}] connection ${Ne?"timed out":"failed"} (${ae})`,sP({retryOfRequestLogID:y,url:z,durationMs:at-tt,message:st.message})),this.retryRequest(C,p,y??q);throw Tb(this).info(`[${q}] connection ${Ne?"timed out":"failed"} - error; no more retries left`),Tb(this).debug(`[${q}] connection ${Ne?"timed out":"failed"} (error; no more retries left)`,sP({retryOfRequestLogID:y,url:z,durationMs:at-tt,message:st.message})),Ne?new XFt:new Jmt({cause:st})}const Ot=[...st.headers.entries()].filter(([ae])=>ae==="x-request-id").map(([ae,Ne])=>", "+ae+": "+JSON.stringify(Ne)).join(""),Dt=`[${q}${et}${Ot}] ${L.method} ${z} ${st.ok?"succeeded":"failed"} with status ${st.status} in ${at-tt}ms`;if(!st.ok){const ae=this.shouldRetry(st);if(p&&ae){const Dn=`retrying, ${p} attempts remaining`;return await wBn(st.body),Tb(this).info(`${Dt} - ${Dn}`),Tb(this).debug(`[${q}] response error (${Dn})`,sP({retryOfRequestLogID:y,url:st.url,status:st.status,headers:st.headers,durationMs:at-tt})),this.retryRequest(C,p,y??q,st.headers)}const Ne=ae?"error; no more retries left":"error; not retryable";Tb(this).info(`${Dt} - ${Ne}`);const pn=await st.text().catch(Dn=>tFt(Dn).message),de=hBn(pn),cn=de?void 0:pn;throw Tb(this).debug(`[${q}] response error (${Ne})`,sP({retryOfRequestLogID:y,url:st.url,status:st.status,headers:st.headers,message:cn,durationMs:Date.now()-tt})),this.makeStatusError(st.status,de,cn,st.headers)}return Tb(this).info(Dt),Tb(this).debug(`[${q}] response start`,sP({retryOfRequestLogID:y,url:st.url,status:st.status,headers:st.headers,durationMs:at-tt})),{response:st,options:C,controller:nt,requestLogID:q,retryOfRequestLogID:y,startTime:tt}}getAPIList(s,p,y){return this.requestAPIList(p,{method:"get",path:s,...y})}requestAPIList(s,p){const y=this.makeRequest(p,null,void 0);return new FBn(this,y,s)}async fetchWithTimeout(s,p,y,C){const{signal:N,method:L,...z}=p||{};N&&N.addEventListener("abort",()=>C.abort());const G=setTimeout(()=>C.abort(),y),q=globalThis.ReadableStream&&z.body instanceof globalThis.ReadableStream||typeof z.body=="object"&&z.body!==null&&Symbol.asyncIterator in z.body,et={signal:C.signal,...q?{duplex:"half"}:{},method:"GET",...z};L&&(et.method=L.toUpperCase());try{return await this.fetch.call(void 0,s,et)}finally{clearTimeout(G)}}shouldRetry(s){const p=s.headers.get("x-should-retry");return p==="true"?!0:p==="false"?!1:s.status===408||s.status===409||s.status===429||s.status>=500}async retryRequest(s,p,y,C){let N;const L=C==null?void 0:C.get("retry-after-ms");if(L){const G=parseFloat(L);Number.isNaN(G)||(N=G)}const z=C==null?void 0:C.get("retry-after");if(z&&!N){const G=parseFloat(z);Number.isNaN(G)?N=Date.parse(z)-Date.now():N=G*1e3}if(!(N&&0<=N&&N<60*1e3)){const G=s.maxRetries??this.maxRetries;N=this.calculateDefaultRetryTimeoutMillis(p,G)}return await ZQ(N),this.makeRequest(s,p-1,y)}calculateDefaultRetryTimeoutMillis(s,p){const N=p-s,L=Math.min(.5*Math.pow(2,N),8),z=1-Math.random()*.25;return L*z*1e3}buildRequest(s,{retryCount:p=0}={}){const y={...s},{method:C,path:N,query:L}=y,z=this.buildURL(N,L);"timeout"in y&&lBn("timeout",y.timeout),y.timeout=y.timeout??this.timeout;const{bodyHeaders:G,body:q}=this.buildBody({options:y}),et=this.buildHeaders({options:s,method:C,bodyHeaders:G,retryCount:p});return{req:{method:C,headers:et,...y.signal&&{signal:y.signal},...globalThis.ReadableStream&&q instanceof globalThis.ReadableStream&&{duplex:"half"},...q&&{body:q},...this.fetchOptions??{},...y.fetchOptions??{}},url:z,timeout:y.timeout}}buildHeaders({options:s,method:p,bodyHeaders:y,retryCount:C}){let N={};this.idempotencyHeader&&p!=="get"&&(s.idempotencyKey||(s.idempotencyKey=this.defaultIdempotencyKey()),N[this.idempotencyHeader]=s.idempotencyKey);const L=co([N,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(C),...s.timeout?{"X-Stainless-Timeout":String(Math.trunc(s.timeout/1e3))}:{},...mBn(),"OpenAI-Organization":this.organization,"OpenAI-Project":this.project},this.authHeaders(s),this._options.defaultHeaders,y,s.headers]);return this.validateHeaders(L),L.values}buildBody({options:{body:s,headers:p}}){if(!s)return{bodyHeaders:void 0,body:void 0};const y=co([p]);return ArrayBuffer.isView(s)||s instanceof ArrayBuffer||s instanceof DataView||typeof s=="string"&&y.values.has("content-type")||s instanceof Blob||s instanceof FormData||s instanceof URLSearchParams||globalThis.ReadableStream&&s instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:s}:typeof s=="object"&&(Symbol.asyncIterator in s||Symbol.iterator in s&&"next"in s&&typeof s.next=="function")?{bodyHeaders:void 0,body:lOe(s)}:wr(this,Qbt,"f").call(this,{body:s,headers:y})}}b$t=dl,Qbt=new WeakMap;dl.OpenAI=b$t;dl.DEFAULT_TIMEOUT=6e5;dl.OpenAIError=Ho;dl.APIError=Lg;dl.APIConnectionError=Jmt;dl.APIConnectionTimeoutError=XFt;dl.APIUserAbortError=I3;dl.NotFoundError=nOe;dl.ConflictError=rOe;dl.RateLimitError=aOe;dl.BadRequestError=ZIe;dl.AuthenticationError=tOe;dl.InternalServerError=sOe;dl.PermissionDeniedError=eOe;dl.UnprocessableEntityError=iOe;dl.toFile=qBn;dl.Completions=JOe;dl.Chat=r$t;dl.Embeddings=tNe;dl.Files=nNe;dl.Images=cNe;dl.Audio=eJ;dl.Moderations=lNe;dl.Models=uNe;dl.FineTuning=u$;dl.Graders=f$t;dl.VectorStores=i2t;dl.Beta=nJ;dl.Batches=KOe;dl.Uploads=g$t;dl.Responses=p$t;dl.Evals=c$t;dl.Containers=s$t;const l9e=a5(le.jsx("path",{d:"M3 4V1h2v3h3v2H5v3H3V6H0V4zm3 6V7h3V4h7l1.83 2H21c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H5c-1.1 0-2-.9-2-2V10zm7 9c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5m-3.2-5c0 1.77 1.43 3.2 3.2 3.2s3.2-1.43 3.2-3.2-1.43-3.2-3.2-3.2-3.2 1.43-3.2 3.2"}),"AddAPhoto"),bFn=a5([le.jsx("path",{d:"M19.5 3.5 18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2v14H3v3c0 1.66 1.34 3 3 3h12c1.66 0 3-1.34 3-3V2zM19 19c0 .55-.45 1-1 1s-1-.45-1-1v-3H8V5h11z"},"0"),le.jsx("path",{d:"M9 7h6v2H9zm7 0h2v2h-2zm-7 3h6v2H9zm7 0h2v2h-2z"},"1")],"ReceiptLong"),mFn=a5(le.jsx("path",{d:"M2.01 21 23 12 2.01 3 2 10l15 2-15 2z"}),"Send");function yFn(o,s){if(o.match(/^[a-z]+:\/\//i))return o;if(o.match(/^\/\//))return window.location.protocol+o;if(o.match(/^[a-z]+:/i))return o;const p=document.implementation.createHTMLDocument(),y=p.createElement("base"),C=p.createElement("a");return p.head.appendChild(y),p.body.appendChild(C),s&&(y.href=s),C.href=o,C.href}const wFn=(()=>{let o=0;const s=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(o+=1,`u${s()}${o}`)})();function dC(o){const s=[];for(let p=0,y=o.length;p<y;p++)s.push(o[p]);return s}let LF=null;function mNe(o={}){return LF||(o.includeStyleProperties?(LF=o.includeStyleProperties,LF):(LF=dC(window.getComputedStyle(document.documentElement)),LF))}function Nmt(o,s){const y=(o.ownerDocument.defaultView||window).getComputedStyle(o).getPropertyValue(s);return y?parseFloat(y.replace("px","")):0}function vFn(o){const s=Nmt(o,"border-left-width"),p=Nmt(o,"border-right-width");return o.clientWidth+s+p}function _Fn(o){const s=Nmt(o,"border-top-width"),p=Nmt(o,"border-bottom-width");return o.clientHeight+s+p}function yNe(o,s={}){const p=s.width||vFn(o),y=s.height||_Fn(o);return{width:p,height:y}}function xFn(){let o,s;try{s=process}catch{}const p=s&&s.env?s.env.devicePixelRatio:null;return p&&(o=parseInt(p,10),Number.isNaN(o)&&(o=1)),o||window.devicePixelRatio||1}const vw=16384;function EFn(o){(o.width>vw||o.height>vw)&&(o.width>vw&&o.height>vw?o.width>o.height?(o.height*=vw/o.width,o.width=vw):(o.width*=vw/o.height,o.height=vw):o.width>vw?(o.height*=vw/o.width,o.width=vw):(o.width*=vw/o.height,o.height=vw))}function Pmt(o){return new Promise((s,p)=>{const y=new Image;y.onload=()=>{y.decode().then(()=>{requestAnimationFrame(()=>s(y))})},y.onerror=p,y.crossOrigin="anonymous",y.decoding="async",y.src=o})}async function TFn(o){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(o)).then(encodeURIComponent).then(s=>`data:image/svg+xml;charset=utf-8,${s}`)}async function kFn(o,s,p){const y="http://www.w3.org/2000/svg",C=document.createElementNS(y,"svg"),N=document.createElementNS(y,"foreignObject");return C.setAttribute("width",`${s}`),C.setAttribute("height",`${p}`),C.setAttribute("viewBox",`0 0 ${s} ${p}`),N.setAttribute("width","100%"),N.setAttribute("height","100%"),N.setAttribute("x","0"),N.setAttribute("y","0"),N.setAttribute("externalResourcesRequired","true"),C.appendChild(N),N.appendChild(o),TFn(C)}const Z2=(o,s)=>{if(o instanceof s)return!0;const p=Object.getPrototypeOf(o);return p===null?!1:p.constructor.name===s.name||Z2(p,s)};function SFn(o){const s=o.getPropertyValue("content");return`${o.cssText} content: '${s.replace(/'|"/g,"")}';`}function CFn(o,s){return mNe(s).map(p=>{const y=o.getPropertyValue(p),C=o.getPropertyPriority(p);return`${p}: ${y}${C?" !important":""};`}).join(" ")}function AFn(o,s,p,y){const C=`.${o}:${s}`,N=p.cssText?SFn(p):CFn(p,y);return document.createTextNode(`${C}{${N}}`)}function h9e(o,s,p,y){const C=window.getComputedStyle(o,p),N=C.getPropertyValue("content");if(N===""||N==="none")return;const L=wFn();try{s.className=`${s.className} ${L}`}catch{return}const z=document.createElement("style");z.appendChild(AFn(L,p,C,y)),s.appendChild(z)}function IFn(o,s,p){h9e(o,s,":before",p),h9e(o,s,":after",p)}const f9e="application/font-woff",d9e="image/jpeg",OFn={woff:f9e,woff2:f9e,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:d9e,jpeg:d9e,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function NFn(o){const s=/\.([^./]*?)$/g.exec(o);return s?s[1]:""}function m$t(o){const s=NFn(o).toLowerCase();return OFn[s]||""}function PFn(o){return o.split(/,/)[1]}function hFt(o){return o.search(/^(data:)/)!==-1}function LFn(o,s){return`data:${s};base64,${o}`}async function wNe(o,s,p){const y=await fetch(o,s);if(y.status===404)throw new Error(`Resource "${y.url}" not found`);const C=await y.blob();return new Promise((N,L)=>{const z=new FileReader;z.onerror=L,z.onloadend=()=>{try{N(p({res:y,result:z.result}))}catch(G){L(G)}},z.readAsDataURL(C)})}const ZDt={};function MFn(o,s,p){let y=o.replace(/\?.*/,"");return p&&(y=o),/ttf|otf|eot|woff2?/i.test(y)&&(y=y.replace(/.*\//,"")),s?`[${s}]${y}`:y}async function y$t(o,s,p){const y=MFn(o,s,p.includeQueryParams);if(ZDt[y]!=null)return ZDt[y];p.cacheBust&&(o+=(/\?/.test(o)?"&":"?")+new Date().getTime());let C;try{const N=await wNe(o,p.fetchRequestInit,({res:L,result:z})=>(s||(s=L.headers.get("Content-Type")||""),PFn(z)));C=LFn(N,s)}catch(N){C=p.imagePlaceholder||"";let L=`Failed to fetch resource: ${o}`;N&&(L=typeof N=="string"?N:N.message),L&&console.warn(L)}return ZDt[y]=C,C}async function RFn(o){const s=o.toDataURL();return s==="data:,"?o.cloneNode(!1):Pmt(s)}async function DFn(o,s){if(o.currentSrc){const N=document.createElement("canvas"),L=N.getContext("2d");N.width=o.clientWidth,N.height=o.clientHeight,L==null||L.drawImage(o,0,0,N.width,N.height);const z=N.toDataURL();return Pmt(z)}const p=o.poster,y=m$t(p),C=await y$t(p,y,s);return Pmt(C)}async function BFn(o,s){var p;try{if(!((p=o==null?void 0:o.contentDocument)===null||p===void 0)&&p.body)return await a2t(o.contentDocument.body,s,!0)}catch{}return o.cloneNode(!1)}async function FFn(o,s){return Z2(o,HTMLCanvasElement)?RFn(o):Z2(o,HTMLVideoElement)?DFn(o,s):Z2(o,HTMLIFrameElement)?BFn(o,s):o.cloneNode(vNe(o))}const $Fn=o=>o.tagName!=null&&o.tagName.toUpperCase()==="SLOT",vNe=o=>o.tagName!=null&&o.tagName.toUpperCase()==="SVG";async function jFn(o,s,p){var y,C;if(vNe(s))return s;let N=[];return $Fn(o)&&o.assignedNodes?N=dC(o.assignedNodes()):Z2(o,HTMLIFrameElement)&&(!((y=o.contentDocument)===null||y===void 0)&&y.body)?N=dC(o.contentDocument.body.childNodes):N=dC(((C=o.shadowRoot)!==null&&C!==void 0?C:o).childNodes),N.length===0||Z2(o,HTMLVideoElement)||await N.reduce((L,z)=>L.then(()=>a2t(z,p)).then(G=>{G&&s.appendChild(G)}),Promise.resolve()),s}function HFn(o,s,p){const y=s.style;if(!y)return;const C=window.getComputedStyle(o);C.cssText?(y.cssText=C.cssText,y.transformOrigin=C.transformOrigin):mNe(p).forEach(N=>{let L=C.getPropertyValue(N);N==="font-size"&&L.endsWith("px")&&(L=`${Math.floor(parseFloat(L.substring(0,L.length-2)))-.1}px`),Z2(o,HTMLIFrameElement)&&N==="display"&&L==="inline"&&(L="block"),N==="d"&&s.getAttribute("d")&&(L=`path(${s.getAttribute("d")})`),y.setProperty(N,L,C.getPropertyPriority(N))})}function zFn(o,s){Z2(o,HTMLTextAreaElement)&&(s.innerHTML=o.value),Z2(o,HTMLInputElement)&&s.setAttribute("value",o.value)}function UFn(o,s){if(Z2(o,HTMLSelectElement)){const p=s,y=Array.from(p.children).find(C=>o.value===C.getAttribute("value"));y&&y.setAttribute("selected","")}}function qFn(o,s,p){return Z2(s,Element)&&(HFn(o,s,p),IFn(o,s,p),zFn(o,s),UFn(o,s)),s}async function WFn(o,s){const p=o.querySelectorAll?o.querySelectorAll("use"):[];if(p.length===0)return o;const y={};for(let N=0;N<p.length;N++){const z=p[N].getAttribute("xlink:href");if(z){const G=o.querySelector(z),q=document.querySelector(z);!G&&q&&!y[z]&&(y[z]=await a2t(q,s,!0))}}const C=Object.values(y);if(C.length){const N="http://www.w3.org/1999/xhtml",L=document.createElementNS(N,"svg");L.setAttribute("xmlns",N),L.style.position="absolute",L.style.width="0",L.style.height="0",L.style.overflow="hidden",L.style.display="none";const z=document.createElementNS(N,"defs");L.appendChild(z);for(let G=0;G<C.length;G++)z.appendChild(C[G]);o.appendChild(L)}return o}async function a2t(o,s,p){return!p&&s.filter&&!s.filter(o)?null:Promise.resolve(o).then(y=>FFn(y,s)).then(y=>jFn(o,y,s)).then(y=>qFn(o,y,s)).then(y=>WFn(y,s))}const _Ne=/url\((['"]?)([^'"]+?)\1\)/g,KFn=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,GFn=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function YFn(o){const s=o.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${s})(['"]?\\))`,"g")}function VFn(o){const s=[];return o.replace(_Ne,(p,y,C)=>(s.push(C),p)),s.filter(p=>!hFt(p))}async function XFn(o,s,p,y,C){try{const N=p?yFn(s,p):s,L=m$t(s);let z;return C||(z=await y$t(N,L,y)),o.replace(YFn(s),`$1${z}$3`)}catch{}return o}function QFn(o,{preferredFontFormat:s}){return s?o.replace(GFn,p=>{for(;;){const[y,,C]=KFn.exec(p)||[];if(!C)return"";if(C===s)return`src: ${y};`}}):o}function xNe(o){return o.search(_Ne)!==-1}async function ENe(o,s,p){if(!xNe(o))return o;const y=QFn(o,p);return VFn(y).reduce((N,L)=>N.then(z=>XFn(z,L,s,p)),Promise.resolve(y))}async function MF(o,s,p){var y;const C=(y=s.style)===null||y===void 0?void 0:y.getPropertyValue(o);if(C){const N=await ENe(C,null,p);return s.style.setProperty(o,N,s.style.getPropertyPriority(o)),!0}return!1}async function JFn(o,s){await MF("background",o,s)||await MF("background-image",o,s),await MF("mask",o,s)||await MF("-webkit-mask",o,s)||await MF("mask-image",o,s)||await MF("-webkit-mask-image",o,s)}async function ZFn(o,s){const p=Z2(o,HTMLImageElement);if(!(p&&!hFt(o.src))&&!(Z2(o,SVGImageElement)&&!hFt(o.href.baseVal)))return;const y=p?o.src:o.href.baseVal,C=await y$t(y,m$t(y),s);await new Promise((N,L)=>{o.onload=N,o.onerror=s.onImageErrorHandler?(...G)=>{try{N(s.onImageErrorHandler(...G))}catch(q){L(q)}}:L;const z=o;z.decode&&(z.decode=N),z.loading==="lazy"&&(z.loading="eager"),p?(o.srcset="",o.src=C):o.href.baseVal=C})}async function t$n(o,s){const y=dC(o.childNodes).map(C=>TNe(C,s));await Promise.all(y).then(()=>o)}async function TNe(o,s){Z2(o,Element)&&(await JFn(o,s),await ZFn(o,s),await t$n(o,s))}function e$n(o,s){const{style:p}=o;s.backgroundColor&&(p.backgroundColor=s.backgroundColor),s.width&&(p.width=`${s.width}px`),s.height&&(p.height=`${s.height}px`);const y=s.style;return y!=null&&Object.keys(y).forEach(C=>{p[C]=y[C]}),o}const p9e={};async function g9e(o){let s=p9e[o];if(s!=null)return s;const y=await(await fetch(o)).text();return s={url:o,cssText:y},p9e[o]=s,s}async function b9e(o,s){let p=o.cssText;const y=/url\(["']?([^"')]+)["']?\)/g,N=(p.match(/url\([^)]+\)/g)||[]).map(async L=>{let z=L.replace(y,"$1");return z.startsWith("https://")||(z=new URL(z,o.url).href),wNe(z,s.fetchRequestInit,({result:G})=>(p=p.replace(L,`url(${G})`),[L,G]))});return Promise.all(N).then(()=>p)}function m9e(o){if(o==null)return[];const s=[],p=/(\/\*[\s\S]*?\*\/)/gi;let y=o.replace(p,"");const C=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const G=C.exec(y);if(G===null)break;s.push(G[0])}y=y.replace(C,"");const N=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,L="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",z=new RegExp(L,"gi");for(;;){let G=N.exec(y);if(G===null){if(G=z.exec(y),G===null)break;N.lastIndex=z.lastIndex}else z.lastIndex=N.lastIndex;s.push(G[0])}return s}async function n$n(o,s){const p=[],y=[];return o.forEach(C=>{if("cssRules"in C)try{dC(C.cssRules||[]).forEach((N,L)=>{if(N.type===CSSRule.IMPORT_RULE){let z=L+1;const G=N.href,q=g9e(G).then(et=>b9e(et,s)).then(et=>m9e(et).forEach(tt=>{try{C.insertRule(tt,tt.startsWith("@import")?z+=1:C.cssRules.length)}catch(nt){console.error("Error inserting rule from remote css",{rule:tt,error:nt})}})).catch(et=>{console.error("Error loading remote css",et.toString())});y.push(q)}})}catch(N){const L=o.find(z=>z.href==null)||document.styleSheets[0];C.href!=null&&y.push(g9e(C.href).then(z=>b9e(z,s)).then(z=>m9e(z).forEach(G=>{L.insertRule(G,L.cssRules.length)})).catch(z=>{console.error("Error loading remote stylesheet",z)})),console.error("Error inlining remote css file",N)}}),Promise.all(y).then(()=>(o.forEach(C=>{if("cssRules"in C)try{dC(C.cssRules||[]).forEach(N=>{p.push(N)})}catch(N){console.error(`Error while reading CSS rules from ${C.href}`,N)}}),p))}function r$n(o){return o.filter(s=>s.type===CSSRule.FONT_FACE_RULE).filter(s=>xNe(s.style.getPropertyValue("src")))}async function i$n(o,s){if(o.ownerDocument==null)throw new Error("Provided element is not within a Document");const p=dC(o.ownerDocument.styleSheets),y=await n$n(p,s);return r$n(y)}function kNe(o){return o.trim().replace(/["']/g,"")}function a$n(o){const s=new Set;function p(y){(y.style.fontFamily||getComputedStyle(y).fontFamily).split(",").forEach(N=>{s.add(kNe(N))}),Array.from(y.children).forEach(N=>{N instanceof HTMLElement&&p(N)})}return p(o),s}async function s$n(o,s){const p=await i$n(o,s),y=a$n(o);return(await Promise.all(p.filter(N=>y.has(kNe(N.style.fontFamily))).map(N=>{const L=N.parentStyleSheet?N.parentStyleSheet.href:null;return ENe(N.cssText,L,s)}))).join(`
|
|
1841
|
-
`)}async function o$n(o,s){const p=s.fontEmbedCSS!=null?s.fontEmbedCSS:s.skipFonts?null:await s$n(o,s);if(p){const y=document.createElement("style"),C=document.createTextNode(p);y.appendChild(C),o.firstChild?o.insertBefore(y,o.firstChild):o.appendChild(y)}}async function c$n(o,s={}){const{width:p,height:y}=yNe(o,s),C=await a2t(o,s,!0);return await o$n(C,s),await TNe(C,s),e$n(C,s),await kFn(C,p,y)}async function u$n(o,s={}){const{width:p,height:y}=yNe(o,s),C=await c$n(o,s),N=await Pmt(C),L=document.createElement("canvas"),z=L.getContext("2d"),G=s.pixelRatio||xFn(),q=s.canvasWidth||p,et=s.canvasHeight||y;return L.width=q*G,L.height=et*G,s.skipAutoScale||EFn(L),L.style.width=`${q}`,L.style.height=`${et}`,s.backgroundColor&&(z.fillStyle=s.backgroundColor,z.fillRect(0,0,L.width,L.height)),z.drawImage(N,0,0,L.width,L.height),L}async function l$n(o,s={}){return(await u$n(o,s)).toDataURL()}const SNe=a5(le.jsx("path",{d:"M20 9V7c0-1.1-.9-2-2-2h-3c0-1.66-1.34-3-3-3S9 3.34 9 5H6c-1.1 0-2 .9-2 2v2c-1.66 0-3 1.34-3 3s1.34 3 3 3v4c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4c1.66 0 3-1.34 3-3s-1.34-3-3-3M7.5 11.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5S9.83 13 9 13s-1.5-.67-1.5-1.5M16 17H8v-2h8zm-1-4c-.83 0-1.5-.67-1.5-1.5S14.17 10 15 10s1.5.67 1.5 1.5S15.83 13 15 13"}),"SmartToy");function y9e(o){const s=[],p=String(o||"");let y=p.indexOf(","),C=0,N=!1;for(;!N;){y===-1&&(y=p.length,N=!0);const L=p.slice(C,y).trim();(L||!N)&&s.push(L),C=y+1,y=p.indexOf(",",C)}return s}function w$t(o,s){const p=s||{};return(o[o.length-1]===""?[...o,""]:o).join((p.padRight?" ":"")+","+(p.padLeft===!1?"":" ")).trim()}const h$n=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,f$n=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,d$n={};function w9e(o,s){return(d$n.jsx?f$n:h$n).test(o)}const p$n=/[ \t\n\f\r]/g;function s2t(o){return typeof o=="object"?o.type==="text"?v9e(o.value):!1:v9e(o)}function v9e(o){return o.replace(p$n,"")===""}let rJ=class{constructor(s,p,y){this.normal=p,this.property=s,y&&(this.space=y)}};rJ.prototype.normal={};rJ.prototype.property={};rJ.prototype.space=void 0;function CNe(o,s){const p={},y={};for(const C of o)Object.assign(p,C.property),Object.assign(y,C.normal);return new rJ(p,y,s)}function KQ(o){return o.toLowerCase()}let ry=class{constructor(s,p){this.attribute=p,this.property=s}};ry.prototype.attribute="";ry.prototype.booleanish=!1;ry.prototype.boolean=!1;ry.prototype.commaOrSpaceSeparated=!1;ry.prototype.commaSeparated=!1;ry.prototype.defined=!1;ry.prototype.mustUseProperty=!1;ry.prototype.number=!1;ry.prototype.overloadedBoolean=!1;ry.prototype.property="";ry.prototype.spaceSeparated=!1;ry.prototype.space=void 0;let g$n=0;const $c=_P(),c0=_P(),ANe=_P(),ua=_P(),af=_P(),UF=_P(),Ew=_P();function _P(){return 2**++g$n}const fFt=Object.freeze(Object.defineProperty({__proto__:null,boolean:$c,booleanish:c0,commaOrSpaceSeparated:Ew,commaSeparated:UF,number:ua,overloadedBoolean:ANe,spaceSeparated:af},Symbol.toStringTag,{value:"Module"})),tBt=Object.keys(fFt);let v$t=class extends ry{constructor(s,p,y,C){let N=-1;if(super(s,p),_9e(this,"space",C),typeof y=="number")for(;++N<tBt.length;){const L=tBt[N];_9e(this,tBt[N],(y&fFt[L])===fFt[L])}}};v$t.prototype.defined=!0;function _9e(o,s,p){p&&(o[s]=p)}function l$(o){const s={},p={};for(const[y,C]of Object.entries(o.properties)){const N=new v$t(y,o.transform(o.attributes||{},y),C,o.space);o.mustUseProperty&&o.mustUseProperty.includes(y)&&(N.mustUseProperty=!0),s[y]=N,p[KQ(y)]=y,p[KQ(N.attribute)]=y}return new rJ(s,p,o.space)}const INe=l$({properties:{ariaActiveDescendant:null,ariaAtomic:c0,ariaAutoComplete:null,ariaBusy:c0,ariaChecked:c0,ariaColCount:ua,ariaColIndex:ua,ariaColSpan:ua,ariaControls:af,ariaCurrent:null,ariaDescribedBy:af,ariaDetails:null,ariaDisabled:c0,ariaDropEffect:af,ariaErrorMessage:null,ariaExpanded:c0,ariaFlowTo:af,ariaGrabbed:c0,ariaHasPopup:null,ariaHidden:c0,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:af,ariaLevel:ua,ariaLive:null,ariaModal:c0,ariaMultiLine:c0,ariaMultiSelectable:c0,ariaOrientation:null,ariaOwns:af,ariaPlaceholder:null,ariaPosInSet:ua,ariaPressed:c0,ariaReadOnly:c0,ariaRelevant:null,ariaRequired:c0,ariaRoleDescription:af,ariaRowCount:ua,ariaRowIndex:ua,ariaRowSpan:ua,ariaSelected:c0,ariaSetSize:ua,ariaSort:null,ariaValueMax:ua,ariaValueMin:ua,ariaValueNow:ua,ariaValueText:null,role:null},transform(o,s){return s==="role"?s:"aria-"+s.slice(4).toLowerCase()}});function ONe(o,s){return s in o?o[s]:s}function NNe(o,s){return ONe(o,s.toLowerCase())}const b$n=l$({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:UF,acceptCharset:af,accessKey:af,action:null,allow:null,allowFullScreen:$c,allowPaymentRequest:$c,allowUserMedia:$c,alt:null,as:null,async:$c,autoCapitalize:null,autoComplete:af,autoFocus:$c,autoPlay:$c,blocking:af,capture:null,charSet:null,checked:$c,cite:null,className:af,cols:ua,colSpan:null,content:null,contentEditable:c0,controls:$c,controlsList:af,coords:ua|UF,crossOrigin:null,data:null,dateTime:null,decoding:null,default:$c,defer:$c,dir:null,dirName:null,disabled:$c,download:ANe,draggable:c0,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:$c,formTarget:null,headers:af,height:ua,hidden:$c,high:ua,href:null,hrefLang:null,htmlFor:af,httpEquiv:af,id:null,imageSizes:null,imageSrcSet:null,inert:$c,inputMode:null,integrity:null,is:null,isMap:$c,itemId:null,itemProp:af,itemRef:af,itemScope:$c,itemType:af,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:$c,low:ua,manifest:null,max:null,maxLength:ua,media:null,method:null,min:null,minLength:ua,multiple:$c,muted:$c,name:null,nonce:null,noModule:$c,noValidate:$c,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:$c,optimum:ua,pattern:null,ping:af,placeholder:null,playsInline:$c,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:$c,referrerPolicy:null,rel:af,required:$c,reversed:$c,rows:ua,rowSpan:ua,sandbox:af,scope:null,scoped:$c,seamless:$c,selected:$c,shadowRootClonable:$c,shadowRootDelegatesFocus:$c,shadowRootMode:null,shape:null,size:ua,sizes:null,slot:null,span:ua,spellCheck:c0,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ua,step:null,style:null,tabIndex:ua,target:null,title:null,translate:null,type:null,typeMustMatch:$c,useMap:null,value:c0,width:ua,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:af,axis:null,background:null,bgColor:null,border:ua,borderColor:null,bottomMargin:ua,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:$c,declare:$c,event:null,face:null,frame:null,frameBorder:null,hSpace:ua,leftMargin:ua,link:null,longDesc:null,lowSrc:null,marginHeight:ua,marginWidth:ua,noResize:$c,noHref:$c,noShade:$c,noWrap:$c,object:null,profile:null,prompt:null,rev:null,rightMargin:ua,rules:null,scheme:null,scrolling:c0,standby:null,summary:null,text:null,topMargin:ua,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ua,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:$c,disableRemotePlayback:$c,prefix:null,property:null,results:ua,security:null,unselectable:null},space:"html",transform:NNe}),m$n=l$({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ew,accentHeight:ua,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ua,amplitude:ua,arabicForm:null,ascent:ua,attributeName:null,attributeType:null,azimuth:ua,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ua,by:null,calcMode:null,capHeight:ua,className:af,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ua,diffuseConstant:ua,direction:null,display:null,dur:null,divisor:ua,dominantBaseline:null,download:$c,dx:null,dy:null,edgeMode:null,editable:null,elevation:ua,enableBackground:null,end:null,event:null,exponent:ua,externalResourcesRequired:null,fill:null,fillOpacity:ua,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:UF,g2:UF,glyphName:UF,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ua,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ua,horizOriginX:ua,horizOriginY:ua,id:null,ideographic:ua,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ua,k:ua,k1:ua,k2:ua,k3:ua,k4:ua,kernelMatrix:Ew,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ua,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ua,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ua,overlineThickness:ua,paintOrder:null,panose1:null,path:null,pathLength:ua,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:af,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ua,pointsAtY:ua,pointsAtZ:ua,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ew,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ew,rev:Ew,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ew,requiredFeatures:Ew,requiredFonts:Ew,requiredFormats:Ew,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ua,specularExponent:ua,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ua,strikethroughThickness:ua,string:null,stroke:null,strokeDashArray:Ew,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ua,strokeOpacity:ua,strokeWidth:null,style:null,surfaceScale:ua,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ew,tabIndex:ua,tableValues:null,target:null,targetX:ua,targetY:ua,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ew,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ua,underlineThickness:ua,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ua,values:null,vAlphabetic:ua,vMathematical:ua,vectorEffect:null,vHanging:ua,vIdeographic:ua,version:null,vertAdvY:ua,vertOriginX:ua,vertOriginY:ua,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ua,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:ONe}),PNe=l$({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(o,s){return"xlink:"+s.slice(5).toLowerCase()}}),LNe=l$({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:NNe}),MNe=l$({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(o,s){return"xml:"+s.slice(3).toLowerCase()}}),y$n={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},w$n=/[A-Z]/g,x9e=/-[a-z]/g,v$n=/^data[-\w.:]+$/i;function o2t(o,s){const p=KQ(s);let y=s,C=ry;if(p in o.normal)return o.property[o.normal[p]];if(p.length>4&&p.slice(0,4)==="data"&&v$n.test(s)){if(s.charAt(4)==="-"){const N=s.slice(5).replace(x9e,x$n);y="data"+N.charAt(0).toUpperCase()+N.slice(1)}else{const N=s.slice(4);if(!x9e.test(N)){let L=N.replace(w$n,_$n);L.charAt(0)!=="-"&&(L="-"+L),s="data"+L}}C=v$t}return new C(y,s)}function _$n(o){return"-"+o.toLowerCase()}function x$n(o){return o.charAt(1).toUpperCase()}const iJ=CNe([INe,b$n,PNe,LNe,MNe],"html"),xC=CNe([INe,m$n,PNe,LNe,MNe],"svg");function E9e(o){const s=String(o||"").trim();return s?s.split(/[ \t\n\r\f]+/g):[]}function _$t(o){return o.join(" ").trim()}var x$t={},T9e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,E$n=/\n/g,T$n=/^\s*/,k$n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,S$n=/^:\s*/,C$n=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,A$n=/^[;\s]*/,I$n=/^\s+|\s+$/g,O$n=`
|
|
1842
|
-
`,k9e="/",S9e="*",cP="",N$n="comment",P$n="declaration",L$n=function(o,s){if(typeof o!="string")throw new TypeError("First argument must be a string");if(!o)return[];s=s||{};var p=1,y=1;function C(at){var Ot=at.match(E$n);Ot&&(p+=Ot.length);var Dt=at.lastIndexOf(O$n);y=~Dt?at.length-Dt:y+at.length}function N(){var at={line:p,column:y};return function(Ot){return Ot.position=new L(at),q(),Ot}}function L(at){this.start=at,this.end={line:p,column:y},this.source=s.source}L.prototype.content=o;function z(at){var Ot=new Error(s.source+":"+p+":"+y+": "+at);if(Ot.reason=at,Ot.filename=s.source,Ot.line=p,Ot.column=y,Ot.source=o,!s.silent)throw Ot}function G(at){var Ot=at.exec(o);if(Ot){var Dt=Ot[0];return C(Dt),o=o.slice(Dt.length),Ot}}function q(){G(T$n)}function et(at){var Ot;for(at=at||[];Ot=tt();)Ot!==!1&&at.push(Ot);return at}function tt(){var at=N();if(!(k9e!=o.charAt(0)||S9e!=o.charAt(1))){for(var Ot=2;cP!=o.charAt(Ot)&&(S9e!=o.charAt(Ot)||k9e!=o.charAt(Ot+1));)++Ot;if(Ot+=2,cP===o.charAt(Ot-1))return z("End of comment missing");var Dt=o.slice(2,Ot-2);return y+=2,C(Dt),o=o.slice(Ot),y+=2,at({type:N$n,comment:Dt})}}function nt(){var at=N(),Ot=G(k$n);if(Ot){if(tt(),!G(S$n))return z("property missing ':'");var Dt=G(C$n),St=at({type:P$n,property:C9e(Ot[0].replace(T9e,cP)),value:Dt?C9e(Dt[0].replace(T9e,cP)):cP});return G(A$n),St}}function st(){var at=[];et(at);for(var Ot;Ot=nt();)Ot!==!1&&(at.push(Ot),et(at));return at}return q(),st()};function C9e(o){return o?o.replace(I$n,cP):cP}var M$n=Cw&&Cw.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(x$t,"__esModule",{value:!0});x$t.default=D$n;var R$n=M$n(L$n);function D$n(o,s){var p=null;if(!o||typeof o!="string")return p;var y=(0,R$n.default)(o),C=typeof s=="function";return y.forEach(function(N){if(N.type==="declaration"){var L=N.property,z=N.value;C?s(L,z,N):z&&(p=p||{},p[L]=z)}}),p}var c2t={};Object.defineProperty(c2t,"__esModule",{value:!0});c2t.camelCase=void 0;var B$n=/^--[a-zA-Z0-9_-]+$/,F$n=/-([a-z])/g,$$n=/^[^-]+$/,j$n=/^-(webkit|moz|ms|o|khtml)-/,H$n=/^-(ms)-/,z$n=function(o){return!o||$$n.test(o)||B$n.test(o)},U$n=function(o,s){return s.toUpperCase()},A9e=function(o,s){return"".concat(s,"-")},q$n=function(o,s){return s===void 0&&(s={}),z$n(o)?o:(o=o.toLowerCase(),s.reactCompat?o=o.replace(H$n,A9e):o=o.replace(j$n,A9e),o.replace(F$n,U$n))};c2t.camelCase=q$n;var W$n=Cw&&Cw.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},K$n=W$n(x$t),G$n=c2t;function dFt(o,s){var p={};return!o||typeof o!="string"||(0,K$n.default)(o,function(y,C){y&&C&&(p[(0,G$n.camelCase)(y,s)]=C)}),p}dFt.default=dFt;var Y$n=dFt;const V$n=KAe(Y$n),u2t=RNe("end"),P6=RNe("start");function RNe(o){return s;function s(p){const y=p&&p.position&&p.position[o]||{};if(typeof y.line=="number"&&y.line>0&&typeof y.column=="number"&&y.column>0)return{line:y.line,column:y.column,offset:typeof y.offset=="number"&&y.offset>-1?y.offset:void 0}}}function X$n(o){const s=P6(o),p=u2t(o);if(s&&p)return{start:s,end:p}}function PQ(o){return!o||typeof o!="object"?"":"position"in o||"type"in o?I9e(o.position):"start"in o||"end"in o?I9e(o):"line"in o||"column"in o?pFt(o):""}function pFt(o){return O9e(o&&o.line)+":"+O9e(o&&o.column)}function I9e(o){return pFt(o&&o.start)+"-"+pFt(o&&o.end)}function O9e(o){return o&&typeof o=="number"?o:1}class kb extends Error{constructor(s,p,y){super(),typeof p=="string"&&(y=p,p=void 0);let C="",N={},L=!1;if(p&&("line"in p&&"column"in p?N={place:p}:"start"in p&&"end"in p?N={place:p}:"type"in p?N={ancestors:[p],place:p.position}:N={...p}),typeof s=="string"?C=s:!N.cause&&s&&(L=!0,C=s.message,N.cause=s),!N.ruleId&&!N.source&&typeof y=="string"){const G=y.indexOf(":");G===-1?N.ruleId=y:(N.source=y.slice(0,G),N.ruleId=y.slice(G+1))}if(!N.place&&N.ancestors&&N.ancestors){const G=N.ancestors[N.ancestors.length-1];G&&(N.place=G.position)}const z=N.place&&"start"in N.place?N.place.start:N.place;this.ancestors=N.ancestors||void 0,this.cause=N.cause||void 0,this.column=z?z.column:void 0,this.fatal=void 0,this.file,this.message=C,this.line=z?z.line:void 0,this.name=PQ(N.place)||"1:1",this.place=N.place||void 0,this.reason=this.message,this.ruleId=N.ruleId||void 0,this.source=N.source||void 0,this.stack=L&&N.cause&&typeof N.cause.stack=="string"?N.cause.stack:"",this.actual,this.expected,this.note,this.url}}kb.prototype.file="";kb.prototype.name="";kb.prototype.reason="";kb.prototype.message="";kb.prototype.stack="";kb.prototype.column=void 0;kb.prototype.line=void 0;kb.prototype.ancestors=void 0;kb.prototype.cause=void 0;kb.prototype.fatal=void 0;kb.prototype.place=void 0;kb.prototype.ruleId=void 0;kb.prototype.source=void 0;const E$t={}.hasOwnProperty,Q$n=new Map,J$n=/[A-Z]/g,Z$n=new Set(["table","tbody","thead","tfoot","tr"]),tjn=new Set(["td","th"]),DNe="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ejn(o,s){if(!s||s.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const p=s.filePath||void 0;let y;if(s.development){if(typeof s.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");y=ujn(p,s.jsxDEV)}else{if(typeof s.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof s.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");y=cjn(p,s.jsx,s.jsxs)}const C={Fragment:s.Fragment,ancestors:[],components:s.components||{},create:y,elementAttributeNameCase:s.elementAttributeNameCase||"react",evaluater:s.createEvaluater?s.createEvaluater():void 0,filePath:p,ignoreInvalidStyle:s.ignoreInvalidStyle||!1,passKeys:s.passKeys!==!1,passNode:s.passNode||!1,schema:s.space==="svg"?xC:iJ,stylePropertyNameCase:s.stylePropertyNameCase||"dom",tableCellAlignToStyle:s.tableCellAlignToStyle!==!1},N=BNe(C,o,void 0);return N&&typeof N!="string"?N:C.create(o,C.Fragment,{children:N||void 0},void 0)}function BNe(o,s,p){if(s.type==="element")return njn(o,s,p);if(s.type==="mdxFlowExpression"||s.type==="mdxTextExpression")return rjn(o,s);if(s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement")return ajn(o,s,p);if(s.type==="mdxjsEsm")return ijn(o,s);if(s.type==="root")return sjn(o,s,p);if(s.type==="text")return ojn(o,s)}function njn(o,s,p){const y=o.schema;let C=y;s.tagName.toLowerCase()==="svg"&&y.space==="html"&&(C=xC,o.schema=C),o.ancestors.push(s);const N=$Ne(o,s.tagName,!1),L=ljn(o,s);let z=k$t(o,s);return Z$n.has(s.tagName)&&(z=z.filter(function(G){return typeof G=="string"?!s2t(G):!0})),FNe(o,L,N,s),T$t(L,z),o.ancestors.pop(),o.schema=y,o.create(s,N,L,p)}function rjn(o,s){if(s.data&&s.data.estree&&o.evaluater){const y=s.data.estree.body[0];return y.type,o.evaluater.evaluateExpression(y.expression)}GQ(o,s.position)}function ijn(o,s){if(s.data&&s.data.estree&&o.evaluater)return o.evaluater.evaluateProgram(s.data.estree);GQ(o,s.position)}function ajn(o,s,p){const y=o.schema;let C=y;s.name==="svg"&&y.space==="html"&&(C=xC,o.schema=C),o.ancestors.push(s);const N=s.name===null?o.Fragment:$Ne(o,s.name,!0),L=hjn(o,s),z=k$t(o,s);return FNe(o,L,N,s),T$t(L,z),o.ancestors.pop(),o.schema=y,o.create(s,N,L,p)}function sjn(o,s,p){const y={};return T$t(y,k$t(o,s)),o.create(s,o.Fragment,y,p)}function ojn(o,s){return s.value}function FNe(o,s,p,y){typeof p!="string"&&p!==o.Fragment&&o.passNode&&(s.node=y)}function T$t(o,s){if(s.length>0){const p=s.length>1?s:s[0];p&&(o.children=p)}}function cjn(o,s,p){return y;function y(C,N,L,z){const q=Array.isArray(L.children)?p:s;return z?q(N,L,z):q(N,L)}}function ujn(o,s){return p;function p(y,C,N,L){const z=Array.isArray(N.children),G=P6(y);return s(C,N,L,z,{columnNumber:G?G.column-1:void 0,fileName:o,lineNumber:G?G.line:void 0},void 0)}}function ljn(o,s){const p={};let y,C;for(C in s.properties)if(C!=="children"&&E$t.call(s.properties,C)){const N=fjn(o,C,s.properties[C]);if(N){const[L,z]=N;o.tableCellAlignToStyle&&L==="align"&&typeof z=="string"&&tjn.has(s.tagName)?y=z:p[L]=z}}if(y){const N=p.style||(p.style={});N[o.stylePropertyNameCase==="css"?"text-align":"textAlign"]=y}return p}function hjn(o,s){const p={};for(const y of s.attributes)if(y.type==="mdxJsxExpressionAttribute")if(y.data&&y.data.estree&&o.evaluater){const N=y.data.estree.body[0];N.type;const L=N.expression;L.type;const z=L.properties[0];z.type,Object.assign(p,o.evaluater.evaluateExpression(z.argument))}else GQ(o,s.position);else{const C=y.name;let N;if(y.value&&typeof y.value=="object")if(y.value.data&&y.value.data.estree&&o.evaluater){const z=y.value.data.estree.body[0];z.type,N=o.evaluater.evaluateExpression(z.expression)}else GQ(o,s.position);else N=y.value===null?!0:y.value;p[C]=N}return p}function k$t(o,s){const p=[];let y=-1;const C=o.passKeys?new Map:Q$n;for(;++y<s.children.length;){const N=s.children[y];let L;if(o.passKeys){const G=N.type==="element"?N.tagName:N.type==="mdxJsxFlowElement"||N.type==="mdxJsxTextElement"?N.name:void 0;if(G){const q=C.get(G)||0;L=G+"-"+q,C.set(G,q+1)}}const z=BNe(o,N,L);z!==void 0&&p.push(z)}return p}function fjn(o,s,p){const y=o2t(o.schema,s);if(!(p==null||typeof p=="number"&&Number.isNaN(p))){if(Array.isArray(p)&&(p=y.commaSeparated?w$t(p):_$t(p)),y.property==="style"){let C=typeof p=="object"?p:djn(o,String(p));return o.stylePropertyNameCase==="css"&&(C=pjn(C)),["style",C]}return[o.elementAttributeNameCase==="react"&&y.space?y$n[y.property]||y.property:y.attribute,p]}}function djn(o,s){try{return V$n(s,{reactCompat:!0})}catch(p){if(o.ignoreInvalidStyle)return{};const y=p,C=new kb("Cannot parse `style` attribute",{ancestors:o.ancestors,cause:y,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw C.file=o.filePath||void 0,C.url=DNe+"#cannot-parse-style-attribute",C}}function $Ne(o,s,p){let y;if(!p)y={type:"Literal",value:s};else if(s.includes(".")){const C=s.split(".");let N=-1,L;for(;++N<C.length;){const z=w9e(C[N])?{type:"Identifier",name:C[N]}:{type:"Literal",value:C[N]};L=L?{type:"MemberExpression",object:L,property:z,computed:!!(N&&z.type==="Literal"),optional:!1}:z}y=L}else y=w9e(s)&&!/^[a-z]/.test(s)?{type:"Identifier",name:s}:{type:"Literal",value:s};if(y.type==="Literal"){const C=y.value;return E$t.call(o.components,C)?o.components[C]:C}if(o.evaluater)return o.evaluater.evaluateExpression(y);GQ(o)}function GQ(o,s){const p=new kb("Cannot handle MDX estrees without `createEvaluater`",{ancestors:o.ancestors,place:s,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw p.file=o.filePath||void 0,p.url=DNe+"#cannot-handle-mdx-estrees-without-createevaluater",p}function pjn(o){const s={};let p;for(p in o)E$t.call(o,p)&&(s[gjn(p)]=o[p]);return s}function gjn(o){let s=o.replace(J$n,bjn);return s.slice(0,3)==="ms-"&&(s="-"+s),s}function bjn(o){return"-"+o.toLowerCase()}const eBt={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},mjn={};function yjn(o,s){const p=mjn,y=typeof p.includeImageAlt=="boolean"?p.includeImageAlt:!0,C=typeof p.includeHtml=="boolean"?p.includeHtml:!0;return jNe(o,y,C)}function jNe(o,s,p){if(wjn(o)){if("value"in o)return o.type==="html"&&!p?"":o.value;if(s&&"alt"in o&&o.alt)return o.alt;if("children"in o)return N9e(o.children,s,p)}return Array.isArray(o)?N9e(o,s,p):""}function N9e(o,s,p){const y=[];let C=-1;for(;++C<o.length;)y[C]=jNe(o[C],s,p);return y.join("")}function wjn(o){return!!(o&&typeof o=="object")}const P9e=document.createElement("i");function S$t(o){const s="&"+o+";";P9e.innerHTML=s;const p=P9e.textContent;return p.charCodeAt(p.length-1)===59&&o!=="semi"||p===s?!1:p}function O6(o,s,p,y){const C=o.length;let N=0,L;if(s<0?s=-s>C?0:C+s:s=s>C?C:s,p=p>0?p:0,y.length<1e4)L=Array.from(y),L.unshift(s,p),o.splice(...L);else for(p&&o.splice(s,p);N<y.length;)L=y.slice(N,N+1e4),L.unshift(s,0),o.splice(...L),N+=1e4,s+=1e4}function S3(o,s){return o.length>0?(O6(o,o.length,0,s),o):s}const L9e={}.hasOwnProperty;function vjn(o){const s={};let p=-1;for(;++p<o.length;)_jn(s,o[p]);return s}function _jn(o,s){let p;for(p in s){const C=(L9e.call(o,p)?o[p]:void 0)||(o[p]={}),N=s[p];let L;if(N)for(L in N){L9e.call(C,L)||(C[L]=[]);const z=N[L];xjn(C[L],Array.isArray(z)?z:z?[z]:[])}}}function xjn(o,s){let p=-1;const y=[];for(;++p<s.length;)(s[p].add==="after"?o:y).push(s[p]);O6(o,0,0,y)}function HNe(o,s){const p=Number.parseInt(o,s);return p<9||p===11||p>13&&p<32||p>126&&p<160||p>55295&&p<57344||p>64975&&p<65008||(p&65535)===65535||(p&65535)===65534||p>1114111?"�":String.fromCodePoint(p)}function qF(o){return o.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const T6=EC(/[A-Za-z]/),Aw=EC(/[\dA-Za-z]/),Ejn=EC(/[#-'*+\--9=?A-Z^-~]/);function gFt(o){return o!==null&&(o<32||o===127)}const bFt=EC(/\d/),Tjn=EC(/[\dA-Fa-f]/),kjn=EC(/[!-/:-@[-`{-~]/);function ec(o){return o!==null&&o<-2}function ty(o){return o!==null&&(o<0||o===32)}function zl(o){return o===-2||o===-1||o===32}const Sjn=EC(new RegExp("\\p{P}|\\p{S}","u")),Cjn=EC(/\s/);function EC(o){return s;function s(p){return p!==null&&p>-1&&o.test(String.fromCharCode(p))}}function h$(o){const s=[];let p=-1,y=0,C=0;for(;++p<o.length;){const N=o.charCodeAt(p);let L="";if(N===37&&Aw(o.charCodeAt(p+1))&&Aw(o.charCodeAt(p+2)))C=2;else if(N<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(N))||(L=String.fromCharCode(N));else if(N>55295&&N<57344){const z=o.charCodeAt(p+1);N<56320&&z>56319&&z<57344?(L=String.fromCharCode(N,z),C=1):L="�"}else L=String.fromCharCode(N);L&&(s.push(o.slice(y,p),encodeURIComponent(L)),y=p+C+1,L=""),C&&(p+=C,C=0)}return s.join("")+o.slice(y)}function of(o,s,p,y){const C=y?y-1:Number.POSITIVE_INFINITY;let N=0;return L;function L(G){return zl(G)?(o.enter(p),z(G)):s(G)}function z(G){return zl(G)&&N++<C?(o.consume(G),z):(o.exit(p),s(G))}}const Ajn={tokenize:Ijn};function Ijn(o){const s=o.attempt(this.parser.constructs.contentInitial,y,C);let p;return s;function y(z){if(z===null){o.consume(z);return}return o.enter("lineEnding"),o.consume(z),o.exit("lineEnding"),of(o,s,"linePrefix")}function C(z){return o.enter("paragraph"),N(z)}function N(z){const G=o.enter("chunkText",{contentType:"text",previous:p});return p&&(p.next=G),p=G,L(z)}function L(z){if(z===null){o.exit("chunkText"),o.exit("paragraph"),o.consume(z);return}return ec(z)?(o.consume(z),o.exit("chunkText"),N):(o.consume(z),L)}}const Ojn={tokenize:Njn},M9e={tokenize:Pjn};function Njn(o){const s=this,p=[];let y=0,C,N,L;return z;function z(ae){if(y<p.length){const Ne=p[y];return s.containerState=Ne[1],o.attempt(Ne[0].continuation,G,q)(ae)}return q(ae)}function G(ae){if(y++,s.containerState._closeFlow){s.containerState._closeFlow=void 0,C&&ie();const Ne=s.events.length;let pn=Ne,de;for(;pn--;)if(s.events[pn][0]==="exit"&&s.events[pn][1].type==="chunkFlow"){de=s.events[pn][1].end;break}St(y);let cn=Ne;for(;cn<s.events.length;)s.events[cn][1].end={...de},cn++;return O6(s.events,pn+1,0,s.events.slice(Ne)),s.events.length=cn,q(ae)}return z(ae)}function q(ae){if(y===p.length){if(!C)return nt(ae);if(C.currentConstruct&&C.currentConstruct.concrete)return at(ae);s.interrupt=!!(C.currentConstruct&&!C._gfmTableDynamicInterruptHack)}return s.containerState={},o.check(M9e,et,tt)(ae)}function et(ae){return C&&ie(),St(y),nt(ae)}function tt(ae){return s.parser.lazy[s.now().line]=y!==p.length,L=s.now().offset,at(ae)}function nt(ae){return s.containerState={},o.attempt(M9e,st,at)(ae)}function st(ae){return y++,p.push([s.currentConstruct,s.containerState]),nt(ae)}function at(ae){if(ae===null){C&&ie(),St(0),o.consume(ae);return}return C=C||s.parser.flow(s.now()),o.enter("chunkFlow",{_tokenizer:C,contentType:"flow",previous:N}),Ot(ae)}function Ot(ae){if(ae===null){Dt(o.exit("chunkFlow"),!0),St(0),o.consume(ae);return}return ec(ae)?(o.consume(ae),Dt(o.exit("chunkFlow")),y=0,s.interrupt=void 0,z):(o.consume(ae),Ot)}function Dt(ae,Ne){const pn=s.sliceStream(ae);if(Ne&&pn.push(null),ae.previous=N,N&&(N.next=ae),N=ae,C.defineSkip(ae.start),C.write(pn),s.parser.lazy[ae.start.line]){let de=C.events.length;for(;de--;)if(C.events[de][1].start.offset<L&&(!C.events[de][1].end||C.events[de][1].end.offset>L))return;const cn=s.events.length;let er=cn,Dn,jn;for(;er--;)if(s.events[er][0]==="exit"&&s.events[er][1].type==="chunkFlow"){if(Dn){jn=s.events[er][1].end;break}Dn=!0}for(St(y),de=cn;de<s.events.length;)s.events[de][1].end={...jn},de++;O6(s.events,er+1,0,s.events.slice(cn)),s.events.length=de}}function St(ae){let Ne=p.length;for(;Ne-- >ae;){const pn=p[Ne];s.containerState=pn[1],pn[0].exit.call(s,o)}p.length=ae}function ie(){C.write([null]),N=void 0,C=void 0,s.containerState._closeFlow=void 0}}function Pjn(o,s,p){return of(o,o.attempt(this.parser.constructs.document,s,p),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function R9e(o){if(o===null||ty(o)||Cjn(o))return 1;if(Sjn(o))return 2}function C$t(o,s,p){const y=[];let C=-1;for(;++C<o.length;){const N=o[C].resolveAll;N&&!y.includes(N)&&(s=N(s,p),y.push(N))}return s}const mFt={name:"attention",resolveAll:Ljn,tokenize:Mjn};function Ljn(o,s){let p=-1,y,C,N,L,z,G,q,et;for(;++p<o.length;)if(o[p][0]==="enter"&&o[p][1].type==="attentionSequence"&&o[p][1]._close){for(y=p;y--;)if(o[y][0]==="exit"&&o[y][1].type==="attentionSequence"&&o[y][1]._open&&s.sliceSerialize(o[y][1]).charCodeAt(0)===s.sliceSerialize(o[p][1]).charCodeAt(0)){if((o[y][1]._close||o[p][1]._open)&&(o[p][1].end.offset-o[p][1].start.offset)%3&&!((o[y][1].end.offset-o[y][1].start.offset+o[p][1].end.offset-o[p][1].start.offset)%3))continue;G=o[y][1].end.offset-o[y][1].start.offset>1&&o[p][1].end.offset-o[p][1].start.offset>1?2:1;const tt={...o[y][1].end},nt={...o[p][1].start};D9e(tt,-G),D9e(nt,G),L={type:G>1?"strongSequence":"emphasisSequence",start:tt,end:{...o[y][1].end}},z={type:G>1?"strongSequence":"emphasisSequence",start:{...o[p][1].start},end:nt},N={type:G>1?"strongText":"emphasisText",start:{...o[y][1].end},end:{...o[p][1].start}},C={type:G>1?"strong":"emphasis",start:{...L.start},end:{...z.end}},o[y][1].end={...L.start},o[p][1].start={...z.end},q=[],o[y][1].end.offset-o[y][1].start.offset&&(q=S3(q,[["enter",o[y][1],s],["exit",o[y][1],s]])),q=S3(q,[["enter",C,s],["enter",L,s],["exit",L,s],["enter",N,s]]),q=S3(q,C$t(s.parser.constructs.insideSpan.null,o.slice(y+1,p),s)),q=S3(q,[["exit",N,s],["enter",z,s],["exit",z,s],["exit",C,s]]),o[p][1].end.offset-o[p][1].start.offset?(et=2,q=S3(q,[["enter",o[p][1],s],["exit",o[p][1],s]])):et=0,O6(o,y-1,p-y+3,q),p=y+q.length-et-2;break}}for(p=-1;++p<o.length;)o[p][1].type==="attentionSequence"&&(o[p][1].type="data");return o}function Mjn(o,s){const p=this.parser.constructs.attentionMarkers.null,y=this.previous,C=R9e(y);let N;return L;function L(G){return N=G,o.enter("attentionSequence"),z(G)}function z(G){if(G===N)return o.consume(G),z;const q=o.exit("attentionSequence"),et=R9e(G),tt=!et||et===2&&C||p.includes(G),nt=!C||C===2&&et||p.includes(y);return q._open=!!(N===42?tt:tt&&(C||!nt)),q._close=!!(N===42?nt:nt&&(et||!tt)),s(G)}}function D9e(o,s){o.column+=s,o.offset+=s,o._bufferIndex+=s}const Rjn={name:"autolink",tokenize:Djn};function Djn(o,s,p){let y=0;return C;function C(st){return o.enter("autolink"),o.enter("autolinkMarker"),o.consume(st),o.exit("autolinkMarker"),o.enter("autolinkProtocol"),N}function N(st){return T6(st)?(o.consume(st),L):st===64?p(st):q(st)}function L(st){return st===43||st===45||st===46||Aw(st)?(y=1,z(st)):q(st)}function z(st){return st===58?(o.consume(st),y=0,G):(st===43||st===45||st===46||Aw(st))&&y++<32?(o.consume(st),z):(y=0,q(st))}function G(st){return st===62?(o.exit("autolinkProtocol"),o.enter("autolinkMarker"),o.consume(st),o.exit("autolinkMarker"),o.exit("autolink"),s):st===null||st===32||st===60||gFt(st)?p(st):(o.consume(st),G)}function q(st){return st===64?(o.consume(st),et):Ejn(st)?(o.consume(st),q):p(st)}function et(st){return Aw(st)?tt(st):p(st)}function tt(st){return st===46?(o.consume(st),y=0,et):st===62?(o.exit("autolinkProtocol").type="autolinkEmail",o.enter("autolinkMarker"),o.consume(st),o.exit("autolinkMarker"),o.exit("autolink"),s):nt(st)}function nt(st){if((st===45||Aw(st))&&y++<63){const at=st===45?nt:tt;return o.consume(st),at}return p(st)}}const l2t={partial:!0,tokenize:Bjn};function Bjn(o,s,p){return y;function y(N){return zl(N)?of(o,C,"linePrefix")(N):C(N)}function C(N){return N===null||ec(N)?s(N):p(N)}}const zNe={continuation:{tokenize:$jn},exit:jjn,name:"blockQuote",tokenize:Fjn};function Fjn(o,s,p){const y=this;return C;function C(L){if(L===62){const z=y.containerState;return z.open||(o.enter("blockQuote",{_container:!0}),z.open=!0),o.enter("blockQuotePrefix"),o.enter("blockQuoteMarker"),o.consume(L),o.exit("blockQuoteMarker"),N}return p(L)}function N(L){return zl(L)?(o.enter("blockQuotePrefixWhitespace"),o.consume(L),o.exit("blockQuotePrefixWhitespace"),o.exit("blockQuotePrefix"),s):(o.exit("blockQuotePrefix"),s(L))}}function $jn(o,s,p){const y=this;return C;function C(L){return zl(L)?of(o,N,"linePrefix",y.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):N(L)}function N(L){return o.attempt(zNe,s,p)(L)}}function jjn(o){o.exit("blockQuote")}const UNe={name:"characterEscape",tokenize:Hjn};function Hjn(o,s,p){return y;function y(N){return o.enter("characterEscape"),o.enter("escapeMarker"),o.consume(N),o.exit("escapeMarker"),C}function C(N){return kjn(N)?(o.enter("characterEscapeValue"),o.consume(N),o.exit("characterEscapeValue"),o.exit("characterEscape"),s):p(N)}}const qNe={name:"characterReference",tokenize:zjn};function zjn(o,s,p){const y=this;let C=0,N,L;return z;function z(tt){return o.enter("characterReference"),o.enter("characterReferenceMarker"),o.consume(tt),o.exit("characterReferenceMarker"),G}function G(tt){return tt===35?(o.enter("characterReferenceMarkerNumeric"),o.consume(tt),o.exit("characterReferenceMarkerNumeric"),q):(o.enter("characterReferenceValue"),N=31,L=Aw,et(tt))}function q(tt){return tt===88||tt===120?(o.enter("characterReferenceMarkerHexadecimal"),o.consume(tt),o.exit("characterReferenceMarkerHexadecimal"),o.enter("characterReferenceValue"),N=6,L=Tjn,et):(o.enter("characterReferenceValue"),N=7,L=bFt,et(tt))}function et(tt){if(tt===59&&C){const nt=o.exit("characterReferenceValue");return L===Aw&&!S$t(y.sliceSerialize(nt))?p(tt):(o.enter("characterReferenceMarker"),o.consume(tt),o.exit("characterReferenceMarker"),o.exit("characterReference"),s)}return L(tt)&&C++<N?(o.consume(tt),et):p(tt)}}const B9e={partial:!0,tokenize:qjn},F9e={concrete:!0,name:"codeFenced",tokenize:Ujn};function Ujn(o,s,p){const y=this,C={partial:!0,tokenize:pn};let N=0,L=0,z;return G;function G(de){return q(de)}function q(de){const cn=y.events[y.events.length-1];return N=cn&&cn[1].type==="linePrefix"?cn[2].sliceSerialize(cn[1],!0).length:0,z=de,o.enter("codeFenced"),o.enter("codeFencedFence"),o.enter("codeFencedFenceSequence"),et(de)}function et(de){return de===z?(L++,o.consume(de),et):L<3?p(de):(o.exit("codeFencedFenceSequence"),zl(de)?of(o,tt,"whitespace")(de):tt(de))}function tt(de){return de===null||ec(de)?(o.exit("codeFencedFence"),y.interrupt?s(de):o.check(B9e,Ot,Ne)(de)):(o.enter("codeFencedFenceInfo"),o.enter("chunkString",{contentType:"string"}),nt(de))}function nt(de){return de===null||ec(de)?(o.exit("chunkString"),o.exit("codeFencedFenceInfo"),tt(de)):zl(de)?(o.exit("chunkString"),o.exit("codeFencedFenceInfo"),of(o,st,"whitespace")(de)):de===96&&de===z?p(de):(o.consume(de),nt)}function st(de){return de===null||ec(de)?tt(de):(o.enter("codeFencedFenceMeta"),o.enter("chunkString",{contentType:"string"}),at(de))}function at(de){return de===null||ec(de)?(o.exit("chunkString"),o.exit("codeFencedFenceMeta"),tt(de)):de===96&&de===z?p(de):(o.consume(de),at)}function Ot(de){return o.attempt(C,Ne,Dt)(de)}function Dt(de){return o.enter("lineEnding"),o.consume(de),o.exit("lineEnding"),St}function St(de){return N>0&&zl(de)?of(o,ie,"linePrefix",N+1)(de):ie(de)}function ie(de){return de===null||ec(de)?o.check(B9e,Ot,Ne)(de):(o.enter("codeFlowValue"),ae(de))}function ae(de){return de===null||ec(de)?(o.exit("codeFlowValue"),ie(de)):(o.consume(de),ae)}function Ne(de){return o.exit("codeFenced"),s(de)}function pn(de,cn,er){let Dn=0;return jn;function jn(Or){return de.enter("lineEnding"),de.consume(Or),de.exit("lineEnding"),or}function or(Or){return de.enter("codeFencedFence"),zl(Or)?of(de,gr,"linePrefix",y.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Or):gr(Or)}function gr(Or){return Or===z?(de.enter("codeFencedFenceSequence"),fi(Or)):er(Or)}function fi(Or){return Or===z?(Dn++,de.consume(Or),fi):Dn>=L?(de.exit("codeFencedFenceSequence"),zl(Or)?of(de,pi,"whitespace")(Or):pi(Or)):er(Or)}function pi(Or){return Or===null||ec(Or)?(de.exit("codeFencedFence"),cn(Or)):er(Or)}}}function qjn(o,s,p){const y=this;return C;function C(L){return L===null?p(L):(o.enter("lineEnding"),o.consume(L),o.exit("lineEnding"),N)}function N(L){return y.parser.lazy[y.now().line]?p(L):s(L)}}const nBt={name:"codeIndented",tokenize:Kjn},Wjn={partial:!0,tokenize:Gjn};function Kjn(o,s,p){const y=this;return C;function C(q){return o.enter("codeIndented"),of(o,N,"linePrefix",5)(q)}function N(q){const et=y.events[y.events.length-1];return et&&et[1].type==="linePrefix"&&et[2].sliceSerialize(et[1],!0).length>=4?L(q):p(q)}function L(q){return q===null?G(q):ec(q)?o.attempt(Wjn,L,G)(q):(o.enter("codeFlowValue"),z(q))}function z(q){return q===null||ec(q)?(o.exit("codeFlowValue"),L(q)):(o.consume(q),z)}function G(q){return o.exit("codeIndented"),s(q)}}function Gjn(o,s,p){const y=this;return C;function C(L){return y.parser.lazy[y.now().line]?p(L):ec(L)?(o.enter("lineEnding"),o.consume(L),o.exit("lineEnding"),C):of(o,N,"linePrefix",5)(L)}function N(L){const z=y.events[y.events.length-1];return z&&z[1].type==="linePrefix"&&z[2].sliceSerialize(z[1],!0).length>=4?s(L):ec(L)?C(L):p(L)}}const Yjn={name:"codeText",previous:Xjn,resolve:Vjn,tokenize:Qjn};function Vjn(o){let s=o.length-4,p=3,y,C;if((o[p][1].type==="lineEnding"||o[p][1].type==="space")&&(o[s][1].type==="lineEnding"||o[s][1].type==="space")){for(y=p;++y<s;)if(o[y][1].type==="codeTextData"){o[p][1].type="codeTextPadding",o[s][1].type="codeTextPadding",p+=2,s-=2;break}}for(y=p-1,s++;++y<=s;)C===void 0?y!==s&&o[y][1].type!=="lineEnding"&&(C=y):(y===s||o[y][1].type==="lineEnding")&&(o[C][1].type="codeTextData",y!==C+2&&(o[C][1].end=o[y-1][1].end,o.splice(C+2,y-C-2),s-=y-C-2,y=C+2),C=void 0);return o}function Xjn(o){return o!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Qjn(o,s,p){let y=0,C,N;return L;function L(tt){return o.enter("codeText"),o.enter("codeTextSequence"),z(tt)}function z(tt){return tt===96?(o.consume(tt),y++,z):(o.exit("codeTextSequence"),G(tt))}function G(tt){return tt===null?p(tt):tt===32?(o.enter("space"),o.consume(tt),o.exit("space"),G):tt===96?(N=o.enter("codeTextSequence"),C=0,et(tt)):ec(tt)?(o.enter("lineEnding"),o.consume(tt),o.exit("lineEnding"),G):(o.enter("codeTextData"),q(tt))}function q(tt){return tt===null||tt===32||tt===96||ec(tt)?(o.exit("codeTextData"),G(tt)):(o.consume(tt),q)}function et(tt){return tt===96?(o.consume(tt),C++,et):C===y?(o.exit("codeTextSequence"),o.exit("codeText"),s(tt)):(N.type="codeTextData",q(tt))}}class Jjn{constructor(s){this.left=s?[...s]:[],this.right=[]}get(s){if(s<0||s>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+s+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return s<this.left.length?this.left[s]:this.right[this.right.length-s+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(s,p){const y=p??Number.POSITIVE_INFINITY;return y<this.left.length?this.left.slice(s,y):s>this.left.length?this.right.slice(this.right.length-y+this.left.length,this.right.length-s+this.left.length).reverse():this.left.slice(s).concat(this.right.slice(this.right.length-y+this.left.length).reverse())}splice(s,p,y){const C=p||0;this.setCursor(Math.trunc(s));const N=this.right.splice(this.right.length-C,Number.POSITIVE_INFINITY);return y&&fQ(this.left,y),N.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(s){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(s)}pushMany(s){this.setCursor(Number.POSITIVE_INFINITY),fQ(this.left,s)}unshift(s){this.setCursor(0),this.right.push(s)}unshiftMany(s){this.setCursor(0),fQ(this.right,s.reverse())}setCursor(s){if(!(s===this.left.length||s>this.left.length&&this.right.length===0||s<0&&this.left.length===0))if(s<this.left.length){const p=this.left.splice(s,Number.POSITIVE_INFINITY);fQ(this.right,p.reverse())}else{const p=this.right.splice(this.left.length+this.right.length-s,Number.POSITIVE_INFINITY);fQ(this.left,p.reverse())}}}function fQ(o,s){let p=0;if(s.length<1e4)o.push(...s);else for(;p<s.length;)o.push(...s.slice(p,p+1e4)),p+=1e4}function WNe(o){const s={};let p=-1,y,C,N,L,z,G,q;const et=new Jjn(o);for(;++p<et.length;){for(;p in s;)p=s[p];if(y=et.get(p),p&&y[1].type==="chunkFlow"&&et.get(p-1)[1].type==="listItemPrefix"&&(G=y[1]._tokenizer.events,N=0,N<G.length&&G[N][1].type==="lineEndingBlank"&&(N+=2),N<G.length&&G[N][1].type==="content"))for(;++N<G.length&&G[N][1].type!=="content";)G[N][1].type==="chunkText"&&(G[N][1]._isInFirstContentOfListItem=!0,N++);if(y[0]==="enter")y[1].contentType&&(Object.assign(s,Zjn(et,p)),p=s[p],q=!0);else if(y[1]._container){for(N=p,C=void 0;N--;)if(L=et.get(N),L[1].type==="lineEnding"||L[1].type==="lineEndingBlank")L[0]==="enter"&&(C&&(et.get(C)[1].type="lineEndingBlank"),L[1].type="lineEnding",C=N);else if(!(L[1].type==="linePrefix"||L[1].type==="listItemIndent"))break;C&&(y[1].end={...et.get(C)[1].start},z=et.slice(C,p),z.unshift(y),et.splice(C,p-C+1,z))}}return O6(o,0,Number.POSITIVE_INFINITY,et.slice(0)),!q}function Zjn(o,s){const p=o.get(s)[1],y=o.get(s)[2];let C=s-1;const N=[];let L=p._tokenizer;L||(L=y.parser[p.contentType](p.start),p._contentTypeTextTrailing&&(L._contentTypeTextTrailing=!0));const z=L.events,G=[],q={};let et,tt,nt=-1,st=p,at=0,Ot=0;const Dt=[Ot];for(;st;){for(;o.get(++C)[1]!==st;);N.push(C),st._tokenizer||(et=y.sliceStream(st),st.next||et.push(null),tt&&L.defineSkip(st.start),st._isInFirstContentOfListItem&&(L._gfmTasklistFirstContentOfListItem=!0),L.write(et),st._isInFirstContentOfListItem&&(L._gfmTasklistFirstContentOfListItem=void 0)),tt=st,st=st.next}for(st=p;++nt<z.length;)z[nt][0]==="exit"&&z[nt-1][0]==="enter"&&z[nt][1].type===z[nt-1][1].type&&z[nt][1].start.line!==z[nt][1].end.line&&(Ot=nt+1,Dt.push(Ot),st._tokenizer=void 0,st.previous=void 0,st=st.next);for(L.events=[],st?(st._tokenizer=void 0,st.previous=void 0):Dt.pop(),nt=Dt.length;nt--;){const St=z.slice(Dt[nt],Dt[nt+1]),ie=N.pop();G.push([ie,ie+St.length-1]),o.splice(ie,2,St)}for(G.reverse(),nt=-1;++nt<G.length;)q[at+G[nt][0]]=at+G[nt][1],at+=G[nt][1]-G[nt][0]-1;return q}const tHn={resolve:nHn,tokenize:rHn},eHn={partial:!0,tokenize:iHn};function nHn(o){return WNe(o),o}function rHn(o,s){let p;return y;function y(z){return o.enter("content"),p=o.enter("chunkContent",{contentType:"content"}),C(z)}function C(z){return z===null?N(z):ec(z)?o.check(eHn,L,N)(z):(o.consume(z),C)}function N(z){return o.exit("chunkContent"),o.exit("content"),s(z)}function L(z){return o.consume(z),o.exit("chunkContent"),p.next=o.enter("chunkContent",{contentType:"content",previous:p}),p=p.next,C}}function iHn(o,s,p){const y=this;return C;function C(L){return o.exit("chunkContent"),o.enter("lineEnding"),o.consume(L),o.exit("lineEnding"),of(o,N,"linePrefix")}function N(L){if(L===null||ec(L))return p(L);const z=y.events[y.events.length-1];return!y.parser.constructs.disable.null.includes("codeIndented")&&z&&z[1].type==="linePrefix"&&z[2].sliceSerialize(z[1],!0).length>=4?s(L):o.interrupt(y.parser.constructs.flow,p,s)(L)}}function KNe(o,s,p,y,C,N,L,z,G){const q=G||Number.POSITIVE_INFINITY;let et=0;return tt;function tt(St){return St===60?(o.enter(y),o.enter(C),o.enter(N),o.consume(St),o.exit(N),nt):St===null||St===32||St===41||gFt(St)?p(St):(o.enter(y),o.enter(L),o.enter(z),o.enter("chunkString",{contentType:"string"}),Ot(St))}function nt(St){return St===62?(o.enter(N),o.consume(St),o.exit(N),o.exit(C),o.exit(y),s):(o.enter(z),o.enter("chunkString",{contentType:"string"}),st(St))}function st(St){return St===62?(o.exit("chunkString"),o.exit(z),nt(St)):St===null||St===60||ec(St)?p(St):(o.consume(St),St===92?at:st)}function at(St){return St===60||St===62||St===92?(o.consume(St),st):st(St)}function Ot(St){return!et&&(St===null||St===41||ty(St))?(o.exit("chunkString"),o.exit(z),o.exit(L),o.exit(y),s(St)):et<q&&St===40?(o.consume(St),et++,Ot):St===41?(o.consume(St),et--,Ot):St===null||St===32||St===40||gFt(St)?p(St):(o.consume(St),St===92?Dt:Ot)}function Dt(St){return St===40||St===41||St===92?(o.consume(St),Ot):Ot(St)}}function GNe(o,s,p,y,C,N){const L=this;let z=0,G;return q;function q(st){return o.enter(y),o.enter(C),o.consume(st),o.exit(C),o.enter(N),et}function et(st){return z>999||st===null||st===91||st===93&&!G||st===94&&!z&&"_hiddenFootnoteSupport"in L.parser.constructs?p(st):st===93?(o.exit(N),o.enter(C),o.consume(st),o.exit(C),o.exit(y),s):ec(st)?(o.enter("lineEnding"),o.consume(st),o.exit("lineEnding"),et):(o.enter("chunkString",{contentType:"string"}),tt(st))}function tt(st){return st===null||st===91||st===93||ec(st)||z++>999?(o.exit("chunkString"),et(st)):(o.consume(st),G||(G=!zl(st)),st===92?nt:tt)}function nt(st){return st===91||st===92||st===93?(o.consume(st),z++,tt):tt(st)}}function YNe(o,s,p,y,C,N){let L;return z;function z(nt){return nt===34||nt===39||nt===40?(o.enter(y),o.enter(C),o.consume(nt),o.exit(C),L=nt===40?41:nt,G):p(nt)}function G(nt){return nt===L?(o.enter(C),o.consume(nt),o.exit(C),o.exit(y),s):(o.enter(N),q(nt))}function q(nt){return nt===L?(o.exit(N),G(L)):nt===null?p(nt):ec(nt)?(o.enter("lineEnding"),o.consume(nt),o.exit("lineEnding"),of(o,q,"linePrefix")):(o.enter("chunkString",{contentType:"string"}),et(nt))}function et(nt){return nt===L||nt===null||ec(nt)?(o.exit("chunkString"),q(nt)):(o.consume(nt),nt===92?tt:et)}function tt(nt){return nt===L||nt===92?(o.consume(nt),et):et(nt)}}function LQ(o,s){let p;return y;function y(C){return ec(C)?(o.enter("lineEnding"),o.consume(C),o.exit("lineEnding"),p=!0,y):zl(C)?of(o,y,p?"linePrefix":"lineSuffix")(C):s(C)}}const aHn={name:"definition",tokenize:oHn},sHn={partial:!0,tokenize:cHn};function oHn(o,s,p){const y=this;let C;return N;function N(st){return o.enter("definition"),L(st)}function L(st){return GNe.call(y,o,z,p,"definitionLabel","definitionLabelMarker","definitionLabelString")(st)}function z(st){return C=qF(y.sliceSerialize(y.events[y.events.length-1][1]).slice(1,-1)),st===58?(o.enter("definitionMarker"),o.consume(st),o.exit("definitionMarker"),G):p(st)}function G(st){return ty(st)?LQ(o,q)(st):q(st)}function q(st){return KNe(o,et,p,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(st)}function et(st){return o.attempt(sHn,tt,tt)(st)}function tt(st){return zl(st)?of(o,nt,"whitespace")(st):nt(st)}function nt(st){return st===null||ec(st)?(o.exit("definition"),y.parser.defined.push(C),s(st)):p(st)}}function cHn(o,s,p){return y;function y(z){return ty(z)?LQ(o,C)(z):p(z)}function C(z){return YNe(o,N,p,"definitionTitle","definitionTitleMarker","definitionTitleString")(z)}function N(z){return zl(z)?of(o,L,"whitespace")(z):L(z)}function L(z){return z===null||ec(z)?s(z):p(z)}}const uHn={name:"hardBreakEscape",tokenize:lHn};function lHn(o,s,p){return y;function y(N){return o.enter("hardBreakEscape"),o.consume(N),C}function C(N){return ec(N)?(o.exit("hardBreakEscape"),s(N)):p(N)}}const hHn={name:"headingAtx",resolve:fHn,tokenize:dHn};function fHn(o,s){let p=o.length-2,y=3,C,N;return o[y][1].type==="whitespace"&&(y+=2),p-2>y&&o[p][1].type==="whitespace"&&(p-=2),o[p][1].type==="atxHeadingSequence"&&(y===p-1||p-4>y&&o[p-2][1].type==="whitespace")&&(p-=y+1===p?2:4),p>y&&(C={type:"atxHeadingText",start:o[y][1].start,end:o[p][1].end},N={type:"chunkText",start:o[y][1].start,end:o[p][1].end,contentType:"text"},O6(o,y,p-y+1,[["enter",C,s],["enter",N,s],["exit",N,s],["exit",C,s]])),o}function dHn(o,s,p){let y=0;return C;function C(et){return o.enter("atxHeading"),N(et)}function N(et){return o.enter("atxHeadingSequence"),L(et)}function L(et){return et===35&&y++<6?(o.consume(et),L):et===null||ty(et)?(o.exit("atxHeadingSequence"),z(et)):p(et)}function z(et){return et===35?(o.enter("atxHeadingSequence"),G(et)):et===null||ec(et)?(o.exit("atxHeading"),s(et)):zl(et)?of(o,z,"whitespace")(et):(o.enter("atxHeadingText"),q(et))}function G(et){return et===35?(o.consume(et),G):(o.exit("atxHeadingSequence"),z(et))}function q(et){return et===null||et===35||ty(et)?(o.exit("atxHeadingText"),z(et)):(o.consume(et),q)}}const pHn=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],$9e=["pre","script","style","textarea"],gHn={concrete:!0,name:"htmlFlow",resolveTo:yHn,tokenize:wHn},bHn={partial:!0,tokenize:_Hn},mHn={partial:!0,tokenize:vHn};function yHn(o){let s=o.length;for(;s--&&!(o[s][0]==="enter"&&o[s][1].type==="htmlFlow"););return s>1&&o[s-2][1].type==="linePrefix"&&(o[s][1].start=o[s-2][1].start,o[s+1][1].start=o[s-2][1].start,o.splice(s-2,2)),o}function wHn(o,s,p){const y=this;let C,N,L,z,G;return q;function q(Ke){return et(Ke)}function et(Ke){return o.enter("htmlFlow"),o.enter("htmlFlowData"),o.consume(Ke),tt}function tt(Ke){return Ke===33?(o.consume(Ke),nt):Ke===47?(o.consume(Ke),N=!0,Ot):Ke===63?(o.consume(Ke),C=3,y.interrupt?s:ze):T6(Ke)?(o.consume(Ke),L=String.fromCharCode(Ke),Dt):p(Ke)}function nt(Ke){return Ke===45?(o.consume(Ke),C=2,st):Ke===91?(o.consume(Ke),C=5,z=0,at):T6(Ke)?(o.consume(Ke),C=4,y.interrupt?s:ze):p(Ke)}function st(Ke){return Ke===45?(o.consume(Ke),y.interrupt?s:ze):p(Ke)}function at(Ke){const xo="CDATA[";return Ke===xo.charCodeAt(z++)?(o.consume(Ke),z===xo.length?y.interrupt?s:gr:at):p(Ke)}function Ot(Ke){return T6(Ke)?(o.consume(Ke),L=String.fromCharCode(Ke),Dt):p(Ke)}function Dt(Ke){if(Ke===null||Ke===47||Ke===62||ty(Ke)){const xo=Ke===47,Ss=L.toLowerCase();return!xo&&!N&&$9e.includes(Ss)?(C=1,y.interrupt?s(Ke):gr(Ke)):pHn.includes(L.toLowerCase())?(C=6,xo?(o.consume(Ke),St):y.interrupt?s(Ke):gr(Ke)):(C=7,y.interrupt&&!y.parser.lazy[y.now().line]?p(Ke):N?ie(Ke):ae(Ke))}return Ke===45||Aw(Ke)?(o.consume(Ke),L+=String.fromCharCode(Ke),Dt):p(Ke)}function St(Ke){return Ke===62?(o.consume(Ke),y.interrupt?s:gr):p(Ke)}function ie(Ke){return zl(Ke)?(o.consume(Ke),ie):jn(Ke)}function ae(Ke){return Ke===47?(o.consume(Ke),jn):Ke===58||Ke===95||T6(Ke)?(o.consume(Ke),Ne):zl(Ke)?(o.consume(Ke),ae):jn(Ke)}function Ne(Ke){return Ke===45||Ke===46||Ke===58||Ke===95||Aw(Ke)?(o.consume(Ke),Ne):pn(Ke)}function pn(Ke){return Ke===61?(o.consume(Ke),de):zl(Ke)?(o.consume(Ke),pn):ae(Ke)}function de(Ke){return Ke===null||Ke===60||Ke===61||Ke===62||Ke===96?p(Ke):Ke===34||Ke===39?(o.consume(Ke),G=Ke,cn):zl(Ke)?(o.consume(Ke),de):er(Ke)}function cn(Ke){return Ke===G?(o.consume(Ke),G=null,Dn):Ke===null||ec(Ke)?p(Ke):(o.consume(Ke),cn)}function er(Ke){return Ke===null||Ke===34||Ke===39||Ke===47||Ke===60||Ke===61||Ke===62||Ke===96||ty(Ke)?pn(Ke):(o.consume(Ke),er)}function Dn(Ke){return Ke===47||Ke===62||zl(Ke)?ae(Ke):p(Ke)}function jn(Ke){return Ke===62?(o.consume(Ke),or):p(Ke)}function or(Ke){return Ke===null||ec(Ke)?gr(Ke):zl(Ke)?(o.consume(Ke),or):p(Ke)}function gr(Ke){return Ke===45&&C===2?(o.consume(Ke),di):Ke===60&&C===1?(o.consume(Ke),Ea):Ke===62&&C===4?(o.consume(Ke),Ba):Ke===63&&C===3?(o.consume(Ke),ze):Ke===93&&C===5?(o.consume(Ke),li):ec(Ke)&&(C===6||C===7)?(o.exit("htmlFlowData"),o.check(bHn,Ts,fi)(Ke)):Ke===null||ec(Ke)?(o.exit("htmlFlowData"),fi(Ke)):(o.consume(Ke),gr)}function fi(Ke){return o.check(mHn,pi,Ts)(Ke)}function pi(Ke){return o.enter("lineEnding"),o.consume(Ke),o.exit("lineEnding"),Or}function Or(Ke){return Ke===null||ec(Ke)?fi(Ke):(o.enter("htmlFlowData"),gr(Ke))}function di(Ke){return Ke===45?(o.consume(Ke),ze):gr(Ke)}function Ea(Ke){return Ke===47?(o.consume(Ke),L="",Qi):gr(Ke)}function Qi(Ke){if(Ke===62){const xo=L.toLowerCase();return $9e.includes(xo)?(o.consume(Ke),Ba):gr(Ke)}return T6(Ke)&&L.length<8?(o.consume(Ke),L+=String.fromCharCode(Ke),Qi):gr(Ke)}function li(Ke){return Ke===93?(o.consume(Ke),ze):gr(Ke)}function ze(Ke){return Ke===62?(o.consume(Ke),Ba):Ke===45&&C===2?(o.consume(Ke),ze):gr(Ke)}function Ba(Ke){return Ke===null||ec(Ke)?(o.exit("htmlFlowData"),Ts(Ke)):(o.consume(Ke),Ba)}function Ts(Ke){return o.exit("htmlFlow"),s(Ke)}}function vHn(o,s,p){const y=this;return C;function C(L){return ec(L)?(o.enter("lineEnding"),o.consume(L),o.exit("lineEnding"),N):p(L)}function N(L){return y.parser.lazy[y.now().line]?p(L):s(L)}}function _Hn(o,s,p){return y;function y(C){return o.enter("lineEnding"),o.consume(C),o.exit("lineEnding"),o.attempt(l2t,s,p)}}const xHn={name:"htmlText",tokenize:EHn};function EHn(o,s,p){const y=this;let C,N,L;return z;function z(ze){return o.enter("htmlText"),o.enter("htmlTextData"),o.consume(ze),G}function G(ze){return ze===33?(o.consume(ze),q):ze===47?(o.consume(ze),pn):ze===63?(o.consume(ze),ae):T6(ze)?(o.consume(ze),er):p(ze)}function q(ze){return ze===45?(o.consume(ze),et):ze===91?(o.consume(ze),N=0,at):T6(ze)?(o.consume(ze),ie):p(ze)}function et(ze){return ze===45?(o.consume(ze),st):p(ze)}function tt(ze){return ze===null?p(ze):ze===45?(o.consume(ze),nt):ec(ze)?(L=tt,Ea(ze)):(o.consume(ze),tt)}function nt(ze){return ze===45?(o.consume(ze),st):tt(ze)}function st(ze){return ze===62?di(ze):ze===45?nt(ze):tt(ze)}function at(ze){const Ba="CDATA[";return ze===Ba.charCodeAt(N++)?(o.consume(ze),N===Ba.length?Ot:at):p(ze)}function Ot(ze){return ze===null?p(ze):ze===93?(o.consume(ze),Dt):ec(ze)?(L=Ot,Ea(ze)):(o.consume(ze),Ot)}function Dt(ze){return ze===93?(o.consume(ze),St):Ot(ze)}function St(ze){return ze===62?di(ze):ze===93?(o.consume(ze),St):Ot(ze)}function ie(ze){return ze===null||ze===62?di(ze):ec(ze)?(L=ie,Ea(ze)):(o.consume(ze),ie)}function ae(ze){return ze===null?p(ze):ze===63?(o.consume(ze),Ne):ec(ze)?(L=ae,Ea(ze)):(o.consume(ze),ae)}function Ne(ze){return ze===62?di(ze):ae(ze)}function pn(ze){return T6(ze)?(o.consume(ze),de):p(ze)}function de(ze){return ze===45||Aw(ze)?(o.consume(ze),de):cn(ze)}function cn(ze){return ec(ze)?(L=cn,Ea(ze)):zl(ze)?(o.consume(ze),cn):di(ze)}function er(ze){return ze===45||Aw(ze)?(o.consume(ze),er):ze===47||ze===62||ty(ze)?Dn(ze):p(ze)}function Dn(ze){return ze===47?(o.consume(ze),di):ze===58||ze===95||T6(ze)?(o.consume(ze),jn):ec(ze)?(L=Dn,Ea(ze)):zl(ze)?(o.consume(ze),Dn):di(ze)}function jn(ze){return ze===45||ze===46||ze===58||ze===95||Aw(ze)?(o.consume(ze),jn):or(ze)}function or(ze){return ze===61?(o.consume(ze),gr):ec(ze)?(L=or,Ea(ze)):zl(ze)?(o.consume(ze),or):Dn(ze)}function gr(ze){return ze===null||ze===60||ze===61||ze===62||ze===96?p(ze):ze===34||ze===39?(o.consume(ze),C=ze,fi):ec(ze)?(L=gr,Ea(ze)):zl(ze)?(o.consume(ze),gr):(o.consume(ze),pi)}function fi(ze){return ze===C?(o.consume(ze),C=void 0,Or):ze===null?p(ze):ec(ze)?(L=fi,Ea(ze)):(o.consume(ze),fi)}function pi(ze){return ze===null||ze===34||ze===39||ze===60||ze===61||ze===96?p(ze):ze===47||ze===62||ty(ze)?Dn(ze):(o.consume(ze),pi)}function Or(ze){return ze===47||ze===62||ty(ze)?Dn(ze):p(ze)}function di(ze){return ze===62?(o.consume(ze),o.exit("htmlTextData"),o.exit("htmlText"),s):p(ze)}function Ea(ze){return o.exit("htmlTextData"),o.enter("lineEnding"),o.consume(ze),o.exit("lineEnding"),Qi}function Qi(ze){return zl(ze)?of(o,li,"linePrefix",y.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ze):li(ze)}function li(ze){return o.enter("htmlTextData"),L(ze)}}const A$t={name:"labelEnd",resolveAll:CHn,resolveTo:AHn,tokenize:IHn},THn={tokenize:OHn},kHn={tokenize:NHn},SHn={tokenize:PHn};function CHn(o){let s=-1;const p=[];for(;++s<o.length;){const y=o[s][1];if(p.push(o[s]),y.type==="labelImage"||y.type==="labelLink"||y.type==="labelEnd"){const C=y.type==="labelImage"?4:2;y.type="data",s+=C}}return o.length!==p.length&&O6(o,0,o.length,p),o}function AHn(o,s){let p=o.length,y=0,C,N,L,z;for(;p--;)if(C=o[p][1],N){if(C.type==="link"||C.type==="labelLink"&&C._inactive)break;o[p][0]==="enter"&&C.type==="labelLink"&&(C._inactive=!0)}else if(L){if(o[p][0]==="enter"&&(C.type==="labelImage"||C.type==="labelLink")&&!C._balanced&&(N=p,C.type!=="labelLink")){y=2;break}}else C.type==="labelEnd"&&(L=p);const G={type:o[N][1].type==="labelLink"?"link":"image",start:{...o[N][1].start},end:{...o[o.length-1][1].end}},q={type:"label",start:{...o[N][1].start},end:{...o[L][1].end}},et={type:"labelText",start:{...o[N+y+2][1].end},end:{...o[L-2][1].start}};return z=[["enter",G,s],["enter",q,s]],z=S3(z,o.slice(N+1,N+y+3)),z=S3(z,[["enter",et,s]]),z=S3(z,C$t(s.parser.constructs.insideSpan.null,o.slice(N+y+4,L-3),s)),z=S3(z,[["exit",et,s],o[L-2],o[L-1],["exit",q,s]]),z=S3(z,o.slice(L+1)),z=S3(z,[["exit",G,s]]),O6(o,N,o.length,z),o}function IHn(o,s,p){const y=this;let C=y.events.length,N,L;for(;C--;)if((y.events[C][1].type==="labelImage"||y.events[C][1].type==="labelLink")&&!y.events[C][1]._balanced){N=y.events[C][1];break}return z;function z(nt){return N?N._inactive?tt(nt):(L=y.parser.defined.includes(qF(y.sliceSerialize({start:N.end,end:y.now()}))),o.enter("labelEnd"),o.enter("labelMarker"),o.consume(nt),o.exit("labelMarker"),o.exit("labelEnd"),G):p(nt)}function G(nt){return nt===40?o.attempt(THn,et,L?et:tt)(nt):nt===91?o.attempt(kHn,et,L?q:tt)(nt):L?et(nt):tt(nt)}function q(nt){return o.attempt(SHn,et,tt)(nt)}function et(nt){return s(nt)}function tt(nt){return N._balanced=!0,p(nt)}}function OHn(o,s,p){return y;function y(tt){return o.enter("resource"),o.enter("resourceMarker"),o.consume(tt),o.exit("resourceMarker"),C}function C(tt){return ty(tt)?LQ(o,N)(tt):N(tt)}function N(tt){return tt===41?et(tt):KNe(o,L,z,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(tt)}function L(tt){return ty(tt)?LQ(o,G)(tt):et(tt)}function z(tt){return p(tt)}function G(tt){return tt===34||tt===39||tt===40?YNe(o,q,p,"resourceTitle","resourceTitleMarker","resourceTitleString")(tt):et(tt)}function q(tt){return ty(tt)?LQ(o,et)(tt):et(tt)}function et(tt){return tt===41?(o.enter("resourceMarker"),o.consume(tt),o.exit("resourceMarker"),o.exit("resource"),s):p(tt)}}function NHn(o,s,p){const y=this;return C;function C(z){return GNe.call(y,o,N,L,"reference","referenceMarker","referenceString")(z)}function N(z){return y.parser.defined.includes(qF(y.sliceSerialize(y.events[y.events.length-1][1]).slice(1,-1)))?s(z):p(z)}function L(z){return p(z)}}function PHn(o,s,p){return y;function y(N){return o.enter("reference"),o.enter("referenceMarker"),o.consume(N),o.exit("referenceMarker"),C}function C(N){return N===93?(o.enter("referenceMarker"),o.consume(N),o.exit("referenceMarker"),o.exit("reference"),s):p(N)}}const LHn={name:"labelStartImage",resolveAll:A$t.resolveAll,tokenize:MHn};function MHn(o,s,p){const y=this;return C;function C(z){return o.enter("labelImage"),o.enter("labelImageMarker"),o.consume(z),o.exit("labelImageMarker"),N}function N(z){return z===91?(o.enter("labelMarker"),o.consume(z),o.exit("labelMarker"),o.exit("labelImage"),L):p(z)}function L(z){return z===94&&"_hiddenFootnoteSupport"in y.parser.constructs?p(z):s(z)}}const RHn={name:"labelStartLink",resolveAll:A$t.resolveAll,tokenize:DHn};function DHn(o,s,p){const y=this;return C;function C(L){return o.enter("labelLink"),o.enter("labelMarker"),o.consume(L),o.exit("labelMarker"),o.exit("labelLink"),N}function N(L){return L===94&&"_hiddenFootnoteSupport"in y.parser.constructs?p(L):s(L)}}const rBt={name:"lineEnding",tokenize:BHn};function BHn(o,s){return p;function p(y){return o.enter("lineEnding"),o.consume(y),o.exit("lineEnding"),of(o,s,"linePrefix")}}const Jbt={name:"thematicBreak",tokenize:FHn};function FHn(o,s,p){let y=0,C;return N;function N(q){return o.enter("thematicBreak"),L(q)}function L(q){return C=q,z(q)}function z(q){return q===C?(o.enter("thematicBreakSequence"),G(q)):y>=3&&(q===null||ec(q))?(o.exit("thematicBreak"),s(q)):p(q)}function G(q){return q===C?(o.consume(q),y++,G):(o.exit("thematicBreakSequence"),zl(q)?of(o,z,"whitespace")(q):z(q))}}const Q2={continuation:{tokenize:zHn},exit:qHn,name:"list",tokenize:HHn},$Hn={partial:!0,tokenize:WHn},jHn={partial:!0,tokenize:UHn};function HHn(o,s,p){const y=this,C=y.events[y.events.length-1];let N=C&&C[1].type==="linePrefix"?C[2].sliceSerialize(C[1],!0).length:0,L=0;return z;function z(st){const at=y.containerState.type||(st===42||st===43||st===45?"listUnordered":"listOrdered");if(at==="listUnordered"?!y.containerState.marker||st===y.containerState.marker:bFt(st)){if(y.containerState.type||(y.containerState.type=at,o.enter(at,{_container:!0})),at==="listUnordered")return o.enter("listItemPrefix"),st===42||st===45?o.check(Jbt,p,q)(st):q(st);if(!y.interrupt||st===49)return o.enter("listItemPrefix"),o.enter("listItemValue"),G(st)}return p(st)}function G(st){return bFt(st)&&++L<10?(o.consume(st),G):(!y.interrupt||L<2)&&(y.containerState.marker?st===y.containerState.marker:st===41||st===46)?(o.exit("listItemValue"),q(st)):p(st)}function q(st){return o.enter("listItemMarker"),o.consume(st),o.exit("listItemMarker"),y.containerState.marker=y.containerState.marker||st,o.check(l2t,y.interrupt?p:et,o.attempt($Hn,nt,tt))}function et(st){return y.containerState.initialBlankLine=!0,N++,nt(st)}function tt(st){return zl(st)?(o.enter("listItemPrefixWhitespace"),o.consume(st),o.exit("listItemPrefixWhitespace"),nt):p(st)}function nt(st){return y.containerState.size=N+y.sliceSerialize(o.exit("listItemPrefix"),!0).length,s(st)}}function zHn(o,s,p){const y=this;return y.containerState._closeFlow=void 0,o.check(l2t,C,N);function C(z){return y.containerState.furtherBlankLines=y.containerState.furtherBlankLines||y.containerState.initialBlankLine,of(o,s,"listItemIndent",y.containerState.size+1)(z)}function N(z){return y.containerState.furtherBlankLines||!zl(z)?(y.containerState.furtherBlankLines=void 0,y.containerState.initialBlankLine=void 0,L(z)):(y.containerState.furtherBlankLines=void 0,y.containerState.initialBlankLine=void 0,o.attempt(jHn,s,L)(z))}function L(z){return y.containerState._closeFlow=!0,y.interrupt=void 0,of(o,o.attempt(Q2,s,p),"linePrefix",y.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z)}}function UHn(o,s,p){const y=this;return of(o,C,"listItemIndent",y.containerState.size+1);function C(N){const L=y.events[y.events.length-1];return L&&L[1].type==="listItemIndent"&&L[2].sliceSerialize(L[1],!0).length===y.containerState.size?s(N):p(N)}}function qHn(o){o.exit(this.containerState.type)}function WHn(o,s,p){const y=this;return of(o,C,"listItemPrefixWhitespace",y.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function C(N){const L=y.events[y.events.length-1];return!zl(N)&&L&&L[1].type==="listItemPrefixWhitespace"?s(N):p(N)}}const j9e={name:"setextUnderline",resolveTo:KHn,tokenize:GHn};function KHn(o,s){let p=o.length,y,C,N;for(;p--;)if(o[p][0]==="enter"){if(o[p][1].type==="content"){y=p;break}o[p][1].type==="paragraph"&&(C=p)}else o[p][1].type==="content"&&o.splice(p,1),!N&&o[p][1].type==="definition"&&(N=p);const L={type:"setextHeading",start:{...o[y][1].start},end:{...o[o.length-1][1].end}};return o[C][1].type="setextHeadingText",N?(o.splice(C,0,["enter",L,s]),o.splice(N+1,0,["exit",o[y][1],s]),o[y][1].end={...o[N][1].end}):o[y][1]=L,o.push(["exit",L,s]),o}function GHn(o,s,p){const y=this;let C;return N;function N(q){let et=y.events.length,tt;for(;et--;)if(y.events[et][1].type!=="lineEnding"&&y.events[et][1].type!=="linePrefix"&&y.events[et][1].type!=="content"){tt=y.events[et][1].type==="paragraph";break}return!y.parser.lazy[y.now().line]&&(y.interrupt||tt)?(o.enter("setextHeadingLine"),C=q,L(q)):p(q)}function L(q){return o.enter("setextHeadingLineSequence"),z(q)}function z(q){return q===C?(o.consume(q),z):(o.exit("setextHeadingLineSequence"),zl(q)?of(o,G,"lineSuffix")(q):G(q))}function G(q){return q===null||ec(q)?(o.exit("setextHeadingLine"),s(q)):p(q)}}const YHn={tokenize:VHn};function VHn(o){const s=this,p=o.attempt(l2t,y,o.attempt(this.parser.constructs.flowInitial,C,of(o,o.attempt(this.parser.constructs.flow,C,o.attempt(tHn,C)),"linePrefix")));return p;function y(N){if(N===null){o.consume(N);return}return o.enter("lineEndingBlank"),o.consume(N),o.exit("lineEndingBlank"),s.currentConstruct=void 0,p}function C(N){if(N===null){o.consume(N);return}return o.enter("lineEnding"),o.consume(N),o.exit("lineEnding"),s.currentConstruct=void 0,p}}const XHn={resolveAll:XNe()},QHn=VNe("string"),JHn=VNe("text");function VNe(o){return{resolveAll:XNe(o==="text"?ZHn:void 0),tokenize:s};function s(p){const y=this,C=this.parser.constructs[o],N=p.attempt(C,L,z);return L;function L(et){return q(et)?N(et):z(et)}function z(et){if(et===null){p.consume(et);return}return p.enter("data"),p.consume(et),G}function G(et){return q(et)?(p.exit("data"),N(et)):(p.consume(et),G)}function q(et){if(et===null)return!0;const tt=C[et];let nt=-1;if(tt)for(;++nt<tt.length;){const st=tt[nt];if(!st.previous||st.previous.call(y,y.previous))return!0}return!1}}}function XNe(o){return s;function s(p,y){let C=-1,N;for(;++C<=p.length;)N===void 0?p[C]&&p[C][1].type==="data"&&(N=C,C++):(!p[C]||p[C][1].type!=="data")&&(C!==N+2&&(p[N][1].end=p[C-1][1].end,p.splice(N+2,C-N-2),C=N+2),N=void 0);return o?o(p,y):p}}function ZHn(o,s){let p=0;for(;++p<=o.length;)if((p===o.length||o[p][1].type==="lineEnding")&&o[p-1][1].type==="data"){const y=o[p-1][1],C=s.sliceStream(y);let N=C.length,L=-1,z=0,G;for(;N--;){const q=C[N];if(typeof q=="string"){for(L=q.length;q.charCodeAt(L-1)===32;)z++,L--;if(L)break;L=-1}else if(q===-2)G=!0,z++;else if(q!==-1){N++;break}}if(s._contentTypeTextTrailing&&p===o.length&&(z=0),z){const q={type:p===o.length||G||z<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:N?L:y.start._bufferIndex+L,_index:y.start._index+N,line:y.end.line,column:y.end.column-z,offset:y.end.offset-z},end:{...y.end}};y.end={...q.start},y.start.offset===y.end.offset?Object.assign(y,q):(o.splice(p,0,["enter",q,s],["exit",q,s]),p+=2)}p++}return o}const tzn={42:Q2,43:Q2,45:Q2,48:Q2,49:Q2,50:Q2,51:Q2,52:Q2,53:Q2,54:Q2,55:Q2,56:Q2,57:Q2,62:zNe},ezn={91:aHn},nzn={[-2]:nBt,[-1]:nBt,32:nBt},rzn={35:hHn,42:Jbt,45:[j9e,Jbt],60:gHn,61:j9e,95:Jbt,96:F9e,126:F9e},izn={38:qNe,92:UNe},azn={[-5]:rBt,[-4]:rBt,[-3]:rBt,33:LHn,38:qNe,42:mFt,60:[Rjn,xHn],91:RHn,92:[uHn,UNe],93:A$t,95:mFt,96:Yjn},szn={null:[mFt,XHn]},ozn={null:[42,95]},czn={null:[]},uzn=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:ozn,contentInitial:ezn,disable:czn,document:tzn,flow:rzn,flowInitial:nzn,insideSpan:szn,string:izn,text:azn},Symbol.toStringTag,{value:"Module"}));function lzn(o,s,p){let y={_bufferIndex:-1,_index:0,line:p&&p.line||1,column:p&&p.column||1,offset:p&&p.offset||0};const C={},N=[];let L=[],z=[];const G={attempt:cn(pn),check:cn(de),consume:ie,enter:ae,exit:Ne,interrupt:cn(de,{interrupt:!0})},q={code:null,containerState:{},defineSkip:Ot,events:[],now:at,parser:o,previous:null,sliceSerialize:nt,sliceStream:st,write:tt};let et=s.tokenize.call(q,G);return s.resolveAll&&N.push(s),q;function tt(or){return L=S3(L,or),Dt(),L[L.length-1]!==null?[]:(er(s,0),q.events=C$t(N,q.events,q),q.events)}function nt(or,gr){return fzn(st(or),gr)}function st(or){return hzn(L,or)}function at(){const{_bufferIndex:or,_index:gr,line:fi,column:pi,offset:Or}=y;return{_bufferIndex:or,_index:gr,line:fi,column:pi,offset:Or}}function Ot(or){C[or.line]=or.column,jn()}function Dt(){let or;for(;y._index<L.length;){const gr=L[y._index];if(typeof gr=="string")for(or=y._index,y._bufferIndex<0&&(y._bufferIndex=0);y._index===or&&y._bufferIndex<gr.length;)St(gr.charCodeAt(y._bufferIndex));else St(gr)}}function St(or){et=et(or)}function ie(or){ec(or)?(y.line++,y.column=1,y.offset+=or===-3?2:1,jn()):or!==-1&&(y.column++,y.offset++),y._bufferIndex<0?y._index++:(y._bufferIndex++,y._bufferIndex===L[y._index].length&&(y._bufferIndex=-1,y._index++)),q.previous=or}function ae(or,gr){const fi=gr||{};return fi.type=or,fi.start=at(),q.events.push(["enter",fi,q]),z.push(fi),fi}function Ne(or){const gr=z.pop();return gr.end=at(),q.events.push(["exit",gr,q]),gr}function pn(or,gr){er(or,gr.from)}function de(or,gr){gr.restore()}function cn(or,gr){return fi;function fi(pi,Or,di){let Ea,Qi,li,ze;return Array.isArray(pi)?Ts(pi):"tokenize"in pi?Ts([pi]):Ba(pi);function Ba(Pa){return zo;function zo($u){const gu=$u!==null&&Pa[$u],Ds=$u!==null&&Pa.null,pc=[...Array.isArray(gu)?gu:gu?[gu]:[],...Array.isArray(Ds)?Ds:Ds?[Ds]:[]];return Ts(pc)($u)}}function Ts(Pa){return Ea=Pa,Qi=0,Pa.length===0?di:Ke(Pa[Qi])}function Ke(Pa){return zo;function zo($u){return ze=Dn(),li=Pa,Pa.partial||(q.currentConstruct=Pa),Pa.name&&q.parser.constructs.disable.null.includes(Pa.name)?Ss():Pa.tokenize.call(gr?Object.assign(Object.create(q),gr):q,G,xo,Ss)($u)}}function xo(Pa){return or(li,ze),Or}function Ss(Pa){return ze.restore(),++Qi<Ea.length?Ke(Ea[Qi]):di}}}function er(or,gr){or.resolveAll&&!N.includes(or)&&N.push(or),or.resolve&&O6(q.events,gr,q.events.length-gr,or.resolve(q.events.slice(gr),q)),or.resolveTo&&(q.events=or.resolveTo(q.events,q))}function Dn(){const or=at(),gr=q.previous,fi=q.currentConstruct,pi=q.events.length,Or=Array.from(z);return{from:pi,restore:di};function di(){y=or,q.previous=gr,q.currentConstruct=fi,q.events.length=pi,z=Or,jn()}}function jn(){y.line in C&&y.column<2&&(y.column=C[y.line],y.offset+=C[y.line]-1)}}function hzn(o,s){const p=s.start._index,y=s.start._bufferIndex,C=s.end._index,N=s.end._bufferIndex;let L;if(p===C)L=[o[p].slice(y,N)];else{if(L=o.slice(p,C),y>-1){const z=L[0];typeof z=="string"?L[0]=z.slice(y):L.shift()}N>0&&L.push(o[C].slice(0,N))}return L}function fzn(o,s){let p=-1;const y=[];let C;for(;++p<o.length;){const N=o[p];let L;if(typeof N=="string")L=N;else switch(N){case-5:{L="\r";break}case-4:{L=`
|
|
1843
|
+
`);this.baseURL=L.baseURL,this.timeout=L.timeout??b$t.DEFAULT_TIMEOUT,this.logger=L.logger??console;const z="warn";this.logLevel=z,this.logLevel=jCe(L.logLevel,"ClientOptions.logLevel",this)??jCe(hQ("OPENAI_LOG"),"process.env['OPENAI_LOG']",this)??z,this.fetchOptions=L.fetchOptions,this.maxRetries=L.maxRetries??2,this.fetch=L.fetch??wBn(),tc(this,Qbt,_Bn),this._options=L,this.apiKey=p,this.organization=y,this.project=C}withOptions(s){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetchOptions:this.fetchOptions,apiKey:this.apiKey,organization:this.organization,project:this.project,...s})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:s,nulls:p}){}authHeaders(s){return co([{Authorization:`Bearer ${this.apiKey}`}])}stringifyQuery(s){return NBn(s,{arrayFormat:"brackets"})}getUserAgent(){return`${this.constructor.name}/JS ${BF}`}defaultIdempotencyKey(){return`stainless-node-retry-${JIe()}`}makeStatusError(s,p,y,C){return Lg.generate(s,p,y,C)}buildURL(s,p){const y=oBn(s)?new URL(s):new URL(this.baseURL+(this.baseURL.endsWith("/")&&s.startsWith("/")?s.slice(1):s)),C=this.defaultQuery();return uBn(C)||(p={...C,...p}),typeof p=="object"&&p&&!Array.isArray(p)&&(y.search=this.stringifyQuery(p)),y.toString()}async prepareOptions(s){}async prepareRequest(s,{url:p,options:y}){}get(s,p){return this.methodRequest("get",s,p)}post(s,p){return this.methodRequest("post",s,p)}patch(s,p){return this.methodRequest("patch",s,p)}put(s,p){return this.methodRequest("put",s,p)}delete(s,p){return this.methodRequest("delete",s,p)}methodRequest(s,p,y){return this.request(Promise.resolve(y).then(C=>({method:s,path:p,...C})))}request(s,p=null){return new t2t(this,this.makeRequest(s,p,void 0))}async makeRequest(s,p,y){var St,ie;const C=await s,N=C.maxRetries??this.maxRetries;p==null&&(p=N),await this.prepareOptions(C);const{req:L,url:z,timeout:G}=this.buildRequest(C,{retryCount:N-p});await this.prepareRequest(L,{url:z,options:C});const q="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),et=y===void 0?"":`, retryOf: ${y}`,tt=Date.now();if(Tb(this).debug(`[${q}] sending request`,sP({retryOfRequestLogID:y,method:C.method,url:z,options:C,headers:L.headers})),(St=C.signal)!=null&&St.aborted)throw new I3;const nt=new AbortController,st=await this.fetchWithTimeout(z,L,G,nt).catch(tFt),at=Date.now();if(st instanceof Error){const ae=`retrying, ${p} attempts remaining`;if((ie=C.signal)!=null&&ie.aborted)throw new I3;const Ne=ZBt(st)||/timed? ?out/i.test(String(st)+("cause"in st?String(st.cause):""));if(p)return Tb(this).info(`[${q}] connection ${Ne?"timed out":"failed"} - ${ae}`),Tb(this).debug(`[${q}] connection ${Ne?"timed out":"failed"} (${ae})`,sP({retryOfRequestLogID:y,url:z,durationMs:at-tt,message:st.message})),this.retryRequest(C,p,y??q);throw Tb(this).info(`[${q}] connection ${Ne?"timed out":"failed"} - error; no more retries left`),Tb(this).debug(`[${q}] connection ${Ne?"timed out":"failed"} (error; no more retries left)`,sP({retryOfRequestLogID:y,url:z,durationMs:at-tt,message:st.message})),Ne?new XFt:new Jmt({cause:st})}const Ot=[...st.headers.entries()].filter(([ae])=>ae==="x-request-id").map(([ae,Ne])=>", "+ae+": "+JSON.stringify(Ne)).join(""),Dt=`[${q}${et}${Ot}] ${L.method} ${z} ${st.ok?"succeeded":"failed"} with status ${st.status} in ${at-tt}ms`;if(!st.ok){const ae=this.shouldRetry(st);if(p&&ae){const Dn=`retrying, ${p} attempts remaining`;return await vBn(st.body),Tb(this).info(`${Dt} - ${Dn}`),Tb(this).debug(`[${q}] response error (${Dn})`,sP({retryOfRequestLogID:y,url:st.url,status:st.status,headers:st.headers,durationMs:at-tt})),this.retryRequest(C,p,y??q,st.headers)}const Ne=ae?"error; no more retries left":"error; not retryable";Tb(this).info(`${Dt} - ${Ne}`);const pn=await st.text().catch(Dn=>tFt(Dn).message),de=fBn(pn),cn=de?void 0:pn;throw Tb(this).debug(`[${q}] response error (${Ne})`,sP({retryOfRequestLogID:y,url:st.url,status:st.status,headers:st.headers,message:cn,durationMs:Date.now()-tt})),this.makeStatusError(st.status,de,cn,st.headers)}return Tb(this).info(Dt),Tb(this).debug(`[${q}] response start`,sP({retryOfRequestLogID:y,url:st.url,status:st.status,headers:st.headers,durationMs:at-tt})),{response:st,options:C,controller:nt,requestLogID:q,retryOfRequestLogID:y,startTime:tt}}getAPIList(s,p,y){return this.requestAPIList(p,{method:"get",path:s,...y})}requestAPIList(s,p){const y=this.makeRequest(p,null,void 0);return new $Bn(this,y,s)}async fetchWithTimeout(s,p,y,C){const{signal:N,method:L,...z}=p||{};N&&N.addEventListener("abort",()=>C.abort());const G=setTimeout(()=>C.abort(),y),q=globalThis.ReadableStream&&z.body instanceof globalThis.ReadableStream||typeof z.body=="object"&&z.body!==null&&Symbol.asyncIterator in z.body,et={signal:C.signal,...q?{duplex:"half"}:{},method:"GET",...z};L&&(et.method=L.toUpperCase());try{return await this.fetch.call(void 0,s,et)}finally{clearTimeout(G)}}shouldRetry(s){const p=s.headers.get("x-should-retry");return p==="true"?!0:p==="false"?!1:s.status===408||s.status===409||s.status===429||s.status>=500}async retryRequest(s,p,y,C){let N;const L=C==null?void 0:C.get("retry-after-ms");if(L){const G=parseFloat(L);Number.isNaN(G)||(N=G)}const z=C==null?void 0:C.get("retry-after");if(z&&!N){const G=parseFloat(z);Number.isNaN(G)?N=Date.parse(z)-Date.now():N=G*1e3}if(!(N&&0<=N&&N<60*1e3)){const G=s.maxRetries??this.maxRetries;N=this.calculateDefaultRetryTimeoutMillis(p,G)}return await ZQ(N),this.makeRequest(s,p-1,y)}calculateDefaultRetryTimeoutMillis(s,p){const N=p-s,L=Math.min(.5*Math.pow(2,N),8),z=1-Math.random()*.25;return L*z*1e3}buildRequest(s,{retryCount:p=0}={}){const y={...s},{method:C,path:N,query:L}=y,z=this.buildURL(N,L);"timeout"in y&&hBn("timeout",y.timeout),y.timeout=y.timeout??this.timeout;const{bodyHeaders:G,body:q}=this.buildBody({options:y}),et=this.buildHeaders({options:s,method:C,bodyHeaders:G,retryCount:p});return{req:{method:C,headers:et,...y.signal&&{signal:y.signal},...globalThis.ReadableStream&&q instanceof globalThis.ReadableStream&&{duplex:"half"},...q&&{body:q},...this.fetchOptions??{},...y.fetchOptions??{}},url:z,timeout:y.timeout}}buildHeaders({options:s,method:p,bodyHeaders:y,retryCount:C}){let N={};this.idempotencyHeader&&p!=="get"&&(s.idempotencyKey||(s.idempotencyKey=this.defaultIdempotencyKey()),N[this.idempotencyHeader]=s.idempotencyKey);const L=co([N,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(C),...s.timeout?{"X-Stainless-Timeout":String(Math.trunc(s.timeout/1e3))}:{},...yBn(),"OpenAI-Organization":this.organization,"OpenAI-Project":this.project},this.authHeaders(s),this._options.defaultHeaders,y,s.headers]);return this.validateHeaders(L),L.values}buildBody({options:{body:s,headers:p}}){if(!s)return{bodyHeaders:void 0,body:void 0};const y=co([p]);return ArrayBuffer.isView(s)||s instanceof ArrayBuffer||s instanceof DataView||typeof s=="string"&&y.values.has("content-type")||s instanceof Blob||s instanceof FormData||s instanceof URLSearchParams||globalThis.ReadableStream&&s instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:s}:typeof s=="object"&&(Symbol.asyncIterator in s||Symbol.iterator in s&&"next"in s&&typeof s.next=="function")?{bodyHeaders:void 0,body:lOe(s)}:wr(this,Qbt,"f").call(this,{body:s,headers:y})}}b$t=dl,Qbt=new WeakMap;dl.OpenAI=b$t;dl.DEFAULT_TIMEOUT=6e5;dl.OpenAIError=Ho;dl.APIError=Lg;dl.APIConnectionError=Jmt;dl.APIConnectionTimeoutError=XFt;dl.APIUserAbortError=I3;dl.NotFoundError=nOe;dl.ConflictError=rOe;dl.RateLimitError=aOe;dl.BadRequestError=ZIe;dl.AuthenticationError=tOe;dl.InternalServerError=sOe;dl.PermissionDeniedError=eOe;dl.UnprocessableEntityError=iOe;dl.toFile=WBn;dl.Completions=JOe;dl.Chat=r$t;dl.Embeddings=tNe;dl.Files=nNe;dl.Images=cNe;dl.Audio=eJ;dl.Moderations=lNe;dl.Models=uNe;dl.FineTuning=u$;dl.Graders=f$t;dl.VectorStores=i2t;dl.Beta=nJ;dl.Batches=KOe;dl.Uploads=g$t;dl.Responses=p$t;dl.Evals=c$t;dl.Containers=s$t;const l9e=a5(le.jsx("path",{d:"M3 4V1h2v3h3v2H5v3H3V6H0V4zm3 6V7h3V4h7l1.83 2H21c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H5c-1.1 0-2-.9-2-2V10zm7 9c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5m-3.2-5c0 1.77 1.43 3.2 3.2 3.2s3.2-1.43 3.2-3.2-1.43-3.2-3.2-3.2-3.2 1.43-3.2 3.2"}),"AddAPhoto"),mFn=a5([le.jsx("path",{d:"M19.5 3.5 18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2v14H3v3c0 1.66 1.34 3 3 3h12c1.66 0 3-1.34 3-3V2zM19 19c0 .55-.45 1-1 1s-1-.45-1-1v-3H8V5h11z"},"0"),le.jsx("path",{d:"M9 7h6v2H9zm7 0h2v2h-2zm-7 3h6v2H9zm7 0h2v2h-2z"},"1")],"ReceiptLong"),yFn=a5(le.jsx("path",{d:"M2.01 21 23 12 2.01 3 2 10l15 2-15 2z"}),"Send");function wFn(o,s){if(o.match(/^[a-z]+:\/\//i))return o;if(o.match(/^\/\//))return window.location.protocol+o;if(o.match(/^[a-z]+:/i))return o;const p=document.implementation.createHTMLDocument(),y=p.createElement("base"),C=p.createElement("a");return p.head.appendChild(y),p.body.appendChild(C),s&&(y.href=s),C.href=o,C.href}const vFn=(()=>{let o=0;const s=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(o+=1,`u${s()}${o}`)})();function dC(o){const s=[];for(let p=0,y=o.length;p<y;p++)s.push(o[p]);return s}let LF=null;function mNe(o={}){return LF||(o.includeStyleProperties?(LF=o.includeStyleProperties,LF):(LF=dC(window.getComputedStyle(document.documentElement)),LF))}function Nmt(o,s){const y=(o.ownerDocument.defaultView||window).getComputedStyle(o).getPropertyValue(s);return y?parseFloat(y.replace("px","")):0}function _Fn(o){const s=Nmt(o,"border-left-width"),p=Nmt(o,"border-right-width");return o.clientWidth+s+p}function xFn(o){const s=Nmt(o,"border-top-width"),p=Nmt(o,"border-bottom-width");return o.clientHeight+s+p}function yNe(o,s={}){const p=s.width||_Fn(o),y=s.height||xFn(o);return{width:p,height:y}}function EFn(){let o,s;try{s=process}catch{}const p=s&&s.env?s.env.devicePixelRatio:null;return p&&(o=parseInt(p,10),Number.isNaN(o)&&(o=1)),o||window.devicePixelRatio||1}const vw=16384;function TFn(o){(o.width>vw||o.height>vw)&&(o.width>vw&&o.height>vw?o.width>o.height?(o.height*=vw/o.width,o.width=vw):(o.width*=vw/o.height,o.height=vw):o.width>vw?(o.height*=vw/o.width,o.width=vw):(o.width*=vw/o.height,o.height=vw))}function Pmt(o){return new Promise((s,p)=>{const y=new Image;y.onload=()=>{y.decode().then(()=>{requestAnimationFrame(()=>s(y))})},y.onerror=p,y.crossOrigin="anonymous",y.decoding="async",y.src=o})}async function kFn(o){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(o)).then(encodeURIComponent).then(s=>`data:image/svg+xml;charset=utf-8,${s}`)}async function SFn(o,s,p){const y="http://www.w3.org/2000/svg",C=document.createElementNS(y,"svg"),N=document.createElementNS(y,"foreignObject");return C.setAttribute("width",`${s}`),C.setAttribute("height",`${p}`),C.setAttribute("viewBox",`0 0 ${s} ${p}`),N.setAttribute("width","100%"),N.setAttribute("height","100%"),N.setAttribute("x","0"),N.setAttribute("y","0"),N.setAttribute("externalResourcesRequired","true"),C.appendChild(N),N.appendChild(o),kFn(C)}const Z2=(o,s)=>{if(o instanceof s)return!0;const p=Object.getPrototypeOf(o);return p===null?!1:p.constructor.name===s.name||Z2(p,s)};function CFn(o){const s=o.getPropertyValue("content");return`${o.cssText} content: '${s.replace(/'|"/g,"")}';`}function AFn(o,s){return mNe(s).map(p=>{const y=o.getPropertyValue(p),C=o.getPropertyPriority(p);return`${p}: ${y}${C?" !important":""};`}).join(" ")}function IFn(o,s,p,y){const C=`.${o}:${s}`,N=p.cssText?CFn(p):AFn(p,y);return document.createTextNode(`${C}{${N}}`)}function h9e(o,s,p,y){const C=window.getComputedStyle(o,p),N=C.getPropertyValue("content");if(N===""||N==="none")return;const L=vFn();try{s.className=`${s.className} ${L}`}catch{return}const z=document.createElement("style");z.appendChild(IFn(L,p,C,y)),s.appendChild(z)}function OFn(o,s,p){h9e(o,s,":before",p),h9e(o,s,":after",p)}const f9e="application/font-woff",d9e="image/jpeg",NFn={woff:f9e,woff2:f9e,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:d9e,jpeg:d9e,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function PFn(o){const s=/\.([^./]*?)$/g.exec(o);return s?s[1]:""}function m$t(o){const s=PFn(o).toLowerCase();return NFn[s]||""}function LFn(o){return o.split(/,/)[1]}function hFt(o){return o.search(/^(data:)/)!==-1}function MFn(o,s){return`data:${s};base64,${o}`}async function wNe(o,s,p){const y=await fetch(o,s);if(y.status===404)throw new Error(`Resource "${y.url}" not found`);const C=await y.blob();return new Promise((N,L)=>{const z=new FileReader;z.onerror=L,z.onloadend=()=>{try{N(p({res:y,result:z.result}))}catch(G){L(G)}},z.readAsDataURL(C)})}const ZDt={};function RFn(o,s,p){let y=o.replace(/\?.*/,"");return p&&(y=o),/ttf|otf|eot|woff2?/i.test(y)&&(y=y.replace(/.*\//,"")),s?`[${s}]${y}`:y}async function y$t(o,s,p){const y=RFn(o,s,p.includeQueryParams);if(ZDt[y]!=null)return ZDt[y];p.cacheBust&&(o+=(/\?/.test(o)?"&":"?")+new Date().getTime());let C;try{const N=await wNe(o,p.fetchRequestInit,({res:L,result:z})=>(s||(s=L.headers.get("Content-Type")||""),LFn(z)));C=MFn(N,s)}catch(N){C=p.imagePlaceholder||"";let L=`Failed to fetch resource: ${o}`;N&&(L=typeof N=="string"?N:N.message),L&&console.warn(L)}return ZDt[y]=C,C}async function DFn(o){const s=o.toDataURL();return s==="data:,"?o.cloneNode(!1):Pmt(s)}async function BFn(o,s){if(o.currentSrc){const N=document.createElement("canvas"),L=N.getContext("2d");N.width=o.clientWidth,N.height=o.clientHeight,L==null||L.drawImage(o,0,0,N.width,N.height);const z=N.toDataURL();return Pmt(z)}const p=o.poster,y=m$t(p),C=await y$t(p,y,s);return Pmt(C)}async function FFn(o,s){var p;try{if(!((p=o==null?void 0:o.contentDocument)===null||p===void 0)&&p.body)return await a2t(o.contentDocument.body,s,!0)}catch{}return o.cloneNode(!1)}async function $Fn(o,s){return Z2(o,HTMLCanvasElement)?DFn(o):Z2(o,HTMLVideoElement)?BFn(o,s):Z2(o,HTMLIFrameElement)?FFn(o,s):o.cloneNode(vNe(o))}const jFn=o=>o.tagName!=null&&o.tagName.toUpperCase()==="SLOT",vNe=o=>o.tagName!=null&&o.tagName.toUpperCase()==="SVG";async function HFn(o,s,p){var y,C;if(vNe(s))return s;let N=[];return jFn(o)&&o.assignedNodes?N=dC(o.assignedNodes()):Z2(o,HTMLIFrameElement)&&(!((y=o.contentDocument)===null||y===void 0)&&y.body)?N=dC(o.contentDocument.body.childNodes):N=dC(((C=o.shadowRoot)!==null&&C!==void 0?C:o).childNodes),N.length===0||Z2(o,HTMLVideoElement)||await N.reduce((L,z)=>L.then(()=>a2t(z,p)).then(G=>{G&&s.appendChild(G)}),Promise.resolve()),s}function zFn(o,s,p){const y=s.style;if(!y)return;const C=window.getComputedStyle(o);C.cssText?(y.cssText=C.cssText,y.transformOrigin=C.transformOrigin):mNe(p).forEach(N=>{let L=C.getPropertyValue(N);N==="font-size"&&L.endsWith("px")&&(L=`${Math.floor(parseFloat(L.substring(0,L.length-2)))-.1}px`),Z2(o,HTMLIFrameElement)&&N==="display"&&L==="inline"&&(L="block"),N==="d"&&s.getAttribute("d")&&(L=`path(${s.getAttribute("d")})`),y.setProperty(N,L,C.getPropertyPriority(N))})}function UFn(o,s){Z2(o,HTMLTextAreaElement)&&(s.innerHTML=o.value),Z2(o,HTMLInputElement)&&s.setAttribute("value",o.value)}function qFn(o,s){if(Z2(o,HTMLSelectElement)){const p=s,y=Array.from(p.children).find(C=>o.value===C.getAttribute("value"));y&&y.setAttribute("selected","")}}function WFn(o,s,p){return Z2(s,Element)&&(zFn(o,s,p),OFn(o,s,p),UFn(o,s),qFn(o,s)),s}async function KFn(o,s){const p=o.querySelectorAll?o.querySelectorAll("use"):[];if(p.length===0)return o;const y={};for(let N=0;N<p.length;N++){const z=p[N].getAttribute("xlink:href");if(z){const G=o.querySelector(z),q=document.querySelector(z);!G&&q&&!y[z]&&(y[z]=await a2t(q,s,!0))}}const C=Object.values(y);if(C.length){const N="http://www.w3.org/1999/xhtml",L=document.createElementNS(N,"svg");L.setAttribute("xmlns",N),L.style.position="absolute",L.style.width="0",L.style.height="0",L.style.overflow="hidden",L.style.display="none";const z=document.createElementNS(N,"defs");L.appendChild(z);for(let G=0;G<C.length;G++)z.appendChild(C[G]);o.appendChild(L)}return o}async function a2t(o,s,p){return!p&&s.filter&&!s.filter(o)?null:Promise.resolve(o).then(y=>$Fn(y,s)).then(y=>HFn(o,y,s)).then(y=>WFn(o,y,s)).then(y=>KFn(y,s))}const _Ne=/url\((['"]?)([^'"]+?)\1\)/g,GFn=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,YFn=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function VFn(o){const s=o.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${s})(['"]?\\))`,"g")}function XFn(o){const s=[];return o.replace(_Ne,(p,y,C)=>(s.push(C),p)),s.filter(p=>!hFt(p))}async function QFn(o,s,p,y,C){try{const N=p?wFn(s,p):s,L=m$t(s);let z;return C||(z=await y$t(N,L,y)),o.replace(VFn(s),`$1${z}$3`)}catch{}return o}function JFn(o,{preferredFontFormat:s}){return s?o.replace(YFn,p=>{for(;;){const[y,,C]=GFn.exec(p)||[];if(!C)return"";if(C===s)return`src: ${y};`}}):o}function xNe(o){return o.search(_Ne)!==-1}async function ENe(o,s,p){if(!xNe(o))return o;const y=JFn(o,p);return XFn(y).reduce((N,L)=>N.then(z=>QFn(z,L,s,p)),Promise.resolve(y))}async function MF(o,s,p){var y;const C=(y=s.style)===null||y===void 0?void 0:y.getPropertyValue(o);if(C){const N=await ENe(C,null,p);return s.style.setProperty(o,N,s.style.getPropertyPriority(o)),!0}return!1}async function ZFn(o,s){await MF("background",o,s)||await MF("background-image",o,s),await MF("mask",o,s)||await MF("-webkit-mask",o,s)||await MF("mask-image",o,s)||await MF("-webkit-mask-image",o,s)}async function t$n(o,s){const p=Z2(o,HTMLImageElement);if(!(p&&!hFt(o.src))&&!(Z2(o,SVGImageElement)&&!hFt(o.href.baseVal)))return;const y=p?o.src:o.href.baseVal,C=await y$t(y,m$t(y),s);await new Promise((N,L)=>{o.onload=N,o.onerror=s.onImageErrorHandler?(...G)=>{try{N(s.onImageErrorHandler(...G))}catch(q){L(q)}}:L;const z=o;z.decode&&(z.decode=N),z.loading==="lazy"&&(z.loading="eager"),p?(o.srcset="",o.src=C):o.href.baseVal=C})}async function e$n(o,s){const y=dC(o.childNodes).map(C=>TNe(C,s));await Promise.all(y).then(()=>o)}async function TNe(o,s){Z2(o,Element)&&(await ZFn(o,s),await t$n(o,s),await e$n(o,s))}function n$n(o,s){const{style:p}=o;s.backgroundColor&&(p.backgroundColor=s.backgroundColor),s.width&&(p.width=`${s.width}px`),s.height&&(p.height=`${s.height}px`);const y=s.style;return y!=null&&Object.keys(y).forEach(C=>{p[C]=y[C]}),o}const p9e={};async function g9e(o){let s=p9e[o];if(s!=null)return s;const y=await(await fetch(o)).text();return s={url:o,cssText:y},p9e[o]=s,s}async function b9e(o,s){let p=o.cssText;const y=/url\(["']?([^"')]+)["']?\)/g,N=(p.match(/url\([^)]+\)/g)||[]).map(async L=>{let z=L.replace(y,"$1");return z.startsWith("https://")||(z=new URL(z,o.url).href),wNe(z,s.fetchRequestInit,({result:G})=>(p=p.replace(L,`url(${G})`),[L,G]))});return Promise.all(N).then(()=>p)}function m9e(o){if(o==null)return[];const s=[],p=/(\/\*[\s\S]*?\*\/)/gi;let y=o.replace(p,"");const C=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const G=C.exec(y);if(G===null)break;s.push(G[0])}y=y.replace(C,"");const N=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,L="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",z=new RegExp(L,"gi");for(;;){let G=N.exec(y);if(G===null){if(G=z.exec(y),G===null)break;N.lastIndex=z.lastIndex}else z.lastIndex=N.lastIndex;s.push(G[0])}return s}async function r$n(o,s){const p=[],y=[];return o.forEach(C=>{if("cssRules"in C)try{dC(C.cssRules||[]).forEach((N,L)=>{if(N.type===CSSRule.IMPORT_RULE){let z=L+1;const G=N.href,q=g9e(G).then(et=>b9e(et,s)).then(et=>m9e(et).forEach(tt=>{try{C.insertRule(tt,tt.startsWith("@import")?z+=1:C.cssRules.length)}catch(nt){console.error("Error inserting rule from remote css",{rule:tt,error:nt})}})).catch(et=>{console.error("Error loading remote css",et.toString())});y.push(q)}})}catch(N){const L=o.find(z=>z.href==null)||document.styleSheets[0];C.href!=null&&y.push(g9e(C.href).then(z=>b9e(z,s)).then(z=>m9e(z).forEach(G=>{L.insertRule(G,L.cssRules.length)})).catch(z=>{console.error("Error loading remote stylesheet",z)})),console.error("Error inlining remote css file",N)}}),Promise.all(y).then(()=>(o.forEach(C=>{if("cssRules"in C)try{dC(C.cssRules||[]).forEach(N=>{p.push(N)})}catch(N){console.error(`Error while reading CSS rules from ${C.href}`,N)}}),p))}function i$n(o){return o.filter(s=>s.type===CSSRule.FONT_FACE_RULE).filter(s=>xNe(s.style.getPropertyValue("src")))}async function a$n(o,s){if(o.ownerDocument==null)throw new Error("Provided element is not within a Document");const p=dC(o.ownerDocument.styleSheets),y=await r$n(p,s);return i$n(y)}function kNe(o){return o.trim().replace(/["']/g,"")}function s$n(o){const s=new Set;function p(y){(y.style.fontFamily||getComputedStyle(y).fontFamily).split(",").forEach(N=>{s.add(kNe(N))}),Array.from(y.children).forEach(N=>{N instanceof HTMLElement&&p(N)})}return p(o),s}async function o$n(o,s){const p=await a$n(o,s),y=s$n(o);return(await Promise.all(p.filter(N=>y.has(kNe(N.style.fontFamily))).map(N=>{const L=N.parentStyleSheet?N.parentStyleSheet.href:null;return ENe(N.cssText,L,s)}))).join(`
|
|
1844
|
+
`)}async function c$n(o,s){const p=s.fontEmbedCSS!=null?s.fontEmbedCSS:s.skipFonts?null:await o$n(o,s);if(p){const y=document.createElement("style"),C=document.createTextNode(p);y.appendChild(C),o.firstChild?o.insertBefore(y,o.firstChild):o.appendChild(y)}}async function u$n(o,s={}){const{width:p,height:y}=yNe(o,s),C=await a2t(o,s,!0);return await c$n(C,s),await TNe(C,s),n$n(C,s),await SFn(C,p,y)}async function l$n(o,s={}){const{width:p,height:y}=yNe(o,s),C=await u$n(o,s),N=await Pmt(C),L=document.createElement("canvas"),z=L.getContext("2d"),G=s.pixelRatio||EFn(),q=s.canvasWidth||p,et=s.canvasHeight||y;return L.width=q*G,L.height=et*G,s.skipAutoScale||TFn(L),L.style.width=`${q}`,L.style.height=`${et}`,s.backgroundColor&&(z.fillStyle=s.backgroundColor,z.fillRect(0,0,L.width,L.height)),z.drawImage(N,0,0,L.width,L.height),L}async function h$n(o,s={}){return(await l$n(o,s)).toDataURL()}const SNe=a5(le.jsx("path",{d:"M20 9V7c0-1.1-.9-2-2-2h-3c0-1.66-1.34-3-3-3S9 3.34 9 5H6c-1.1 0-2 .9-2 2v2c-1.66 0-3 1.34-3 3s1.34 3 3 3v4c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4c1.66 0 3-1.34 3-3s-1.34-3-3-3M7.5 11.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5S9.83 13 9 13s-1.5-.67-1.5-1.5M16 17H8v-2h8zm-1-4c-.83 0-1.5-.67-1.5-1.5S14.17 10 15 10s1.5.67 1.5 1.5S15.83 13 15 13"}),"SmartToy");function y9e(o){const s=[],p=String(o||"");let y=p.indexOf(","),C=0,N=!1;for(;!N;){y===-1&&(y=p.length,N=!0);const L=p.slice(C,y).trim();(L||!N)&&s.push(L),C=y+1,y=p.indexOf(",",C)}return s}function w$t(o,s){const p=s||{};return(o[o.length-1]===""?[...o,""]:o).join((p.padRight?" ":"")+","+(p.padLeft===!1?"":" ")).trim()}const f$n=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,d$n=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,p$n={};function w9e(o,s){return(p$n.jsx?d$n:f$n).test(o)}const g$n=/[ \t\n\f\r]/g;function s2t(o){return typeof o=="object"?o.type==="text"?v9e(o.value):!1:v9e(o)}function v9e(o){return o.replace(g$n,"")===""}let rJ=class{constructor(s,p,y){this.normal=p,this.property=s,y&&(this.space=y)}};rJ.prototype.normal={};rJ.prototype.property={};rJ.prototype.space=void 0;function CNe(o,s){const p={},y={};for(const C of o)Object.assign(p,C.property),Object.assign(y,C.normal);return new rJ(p,y,s)}function KQ(o){return o.toLowerCase()}let ry=class{constructor(s,p){this.attribute=p,this.property=s}};ry.prototype.attribute="";ry.prototype.booleanish=!1;ry.prototype.boolean=!1;ry.prototype.commaOrSpaceSeparated=!1;ry.prototype.commaSeparated=!1;ry.prototype.defined=!1;ry.prototype.mustUseProperty=!1;ry.prototype.number=!1;ry.prototype.overloadedBoolean=!1;ry.prototype.property="";ry.prototype.spaceSeparated=!1;ry.prototype.space=void 0;let b$n=0;const $c=_P(),c0=_P(),ANe=_P(),ua=_P(),af=_P(),UF=_P(),Ew=_P();function _P(){return 2**++b$n}const fFt=Object.freeze(Object.defineProperty({__proto__:null,boolean:$c,booleanish:c0,commaOrSpaceSeparated:Ew,commaSeparated:UF,number:ua,overloadedBoolean:ANe,spaceSeparated:af},Symbol.toStringTag,{value:"Module"})),tBt=Object.keys(fFt);let v$t=class extends ry{constructor(s,p,y,C){let N=-1;if(super(s,p),_9e(this,"space",C),typeof y=="number")for(;++N<tBt.length;){const L=tBt[N];_9e(this,tBt[N],(y&fFt[L])===fFt[L])}}};v$t.prototype.defined=!0;function _9e(o,s,p){p&&(o[s]=p)}function l$(o){const s={},p={};for(const[y,C]of Object.entries(o.properties)){const N=new v$t(y,o.transform(o.attributes||{},y),C,o.space);o.mustUseProperty&&o.mustUseProperty.includes(y)&&(N.mustUseProperty=!0),s[y]=N,p[KQ(y)]=y,p[KQ(N.attribute)]=y}return new rJ(s,p,o.space)}const INe=l$({properties:{ariaActiveDescendant:null,ariaAtomic:c0,ariaAutoComplete:null,ariaBusy:c0,ariaChecked:c0,ariaColCount:ua,ariaColIndex:ua,ariaColSpan:ua,ariaControls:af,ariaCurrent:null,ariaDescribedBy:af,ariaDetails:null,ariaDisabled:c0,ariaDropEffect:af,ariaErrorMessage:null,ariaExpanded:c0,ariaFlowTo:af,ariaGrabbed:c0,ariaHasPopup:null,ariaHidden:c0,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:af,ariaLevel:ua,ariaLive:null,ariaModal:c0,ariaMultiLine:c0,ariaMultiSelectable:c0,ariaOrientation:null,ariaOwns:af,ariaPlaceholder:null,ariaPosInSet:ua,ariaPressed:c0,ariaReadOnly:c0,ariaRelevant:null,ariaRequired:c0,ariaRoleDescription:af,ariaRowCount:ua,ariaRowIndex:ua,ariaRowSpan:ua,ariaSelected:c0,ariaSetSize:ua,ariaSort:null,ariaValueMax:ua,ariaValueMin:ua,ariaValueNow:ua,ariaValueText:null,role:null},transform(o,s){return s==="role"?s:"aria-"+s.slice(4).toLowerCase()}});function ONe(o,s){return s in o?o[s]:s}function NNe(o,s){return ONe(o,s.toLowerCase())}const m$n=l$({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:UF,acceptCharset:af,accessKey:af,action:null,allow:null,allowFullScreen:$c,allowPaymentRequest:$c,allowUserMedia:$c,alt:null,as:null,async:$c,autoCapitalize:null,autoComplete:af,autoFocus:$c,autoPlay:$c,blocking:af,capture:null,charSet:null,checked:$c,cite:null,className:af,cols:ua,colSpan:null,content:null,contentEditable:c0,controls:$c,controlsList:af,coords:ua|UF,crossOrigin:null,data:null,dateTime:null,decoding:null,default:$c,defer:$c,dir:null,dirName:null,disabled:$c,download:ANe,draggable:c0,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:$c,formTarget:null,headers:af,height:ua,hidden:$c,high:ua,href:null,hrefLang:null,htmlFor:af,httpEquiv:af,id:null,imageSizes:null,imageSrcSet:null,inert:$c,inputMode:null,integrity:null,is:null,isMap:$c,itemId:null,itemProp:af,itemRef:af,itemScope:$c,itemType:af,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:$c,low:ua,manifest:null,max:null,maxLength:ua,media:null,method:null,min:null,minLength:ua,multiple:$c,muted:$c,name:null,nonce:null,noModule:$c,noValidate:$c,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:$c,optimum:ua,pattern:null,ping:af,placeholder:null,playsInline:$c,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:$c,referrerPolicy:null,rel:af,required:$c,reversed:$c,rows:ua,rowSpan:ua,sandbox:af,scope:null,scoped:$c,seamless:$c,selected:$c,shadowRootClonable:$c,shadowRootDelegatesFocus:$c,shadowRootMode:null,shape:null,size:ua,sizes:null,slot:null,span:ua,spellCheck:c0,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ua,step:null,style:null,tabIndex:ua,target:null,title:null,translate:null,type:null,typeMustMatch:$c,useMap:null,value:c0,width:ua,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:af,axis:null,background:null,bgColor:null,border:ua,borderColor:null,bottomMargin:ua,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:$c,declare:$c,event:null,face:null,frame:null,frameBorder:null,hSpace:ua,leftMargin:ua,link:null,longDesc:null,lowSrc:null,marginHeight:ua,marginWidth:ua,noResize:$c,noHref:$c,noShade:$c,noWrap:$c,object:null,profile:null,prompt:null,rev:null,rightMargin:ua,rules:null,scheme:null,scrolling:c0,standby:null,summary:null,text:null,topMargin:ua,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ua,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:$c,disableRemotePlayback:$c,prefix:null,property:null,results:ua,security:null,unselectable:null},space:"html",transform:NNe}),y$n=l$({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ew,accentHeight:ua,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ua,amplitude:ua,arabicForm:null,ascent:ua,attributeName:null,attributeType:null,azimuth:ua,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ua,by:null,calcMode:null,capHeight:ua,className:af,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ua,diffuseConstant:ua,direction:null,display:null,dur:null,divisor:ua,dominantBaseline:null,download:$c,dx:null,dy:null,edgeMode:null,editable:null,elevation:ua,enableBackground:null,end:null,event:null,exponent:ua,externalResourcesRequired:null,fill:null,fillOpacity:ua,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:UF,g2:UF,glyphName:UF,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ua,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ua,horizOriginX:ua,horizOriginY:ua,id:null,ideographic:ua,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ua,k:ua,k1:ua,k2:ua,k3:ua,k4:ua,kernelMatrix:Ew,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ua,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ua,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ua,overlineThickness:ua,paintOrder:null,panose1:null,path:null,pathLength:ua,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:af,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ua,pointsAtY:ua,pointsAtZ:ua,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ew,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ew,rev:Ew,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ew,requiredFeatures:Ew,requiredFonts:Ew,requiredFormats:Ew,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ua,specularExponent:ua,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ua,strikethroughThickness:ua,string:null,stroke:null,strokeDashArray:Ew,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ua,strokeOpacity:ua,strokeWidth:null,style:null,surfaceScale:ua,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ew,tabIndex:ua,tableValues:null,target:null,targetX:ua,targetY:ua,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ew,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ua,underlineThickness:ua,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ua,values:null,vAlphabetic:ua,vMathematical:ua,vectorEffect:null,vHanging:ua,vIdeographic:ua,version:null,vertAdvY:ua,vertOriginX:ua,vertOriginY:ua,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ua,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:ONe}),PNe=l$({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(o,s){return"xlink:"+s.slice(5).toLowerCase()}}),LNe=l$({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:NNe}),MNe=l$({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(o,s){return"xml:"+s.slice(3).toLowerCase()}}),w$n={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},v$n=/[A-Z]/g,x9e=/-[a-z]/g,_$n=/^data[-\w.:]+$/i;function o2t(o,s){const p=KQ(s);let y=s,C=ry;if(p in o.normal)return o.property[o.normal[p]];if(p.length>4&&p.slice(0,4)==="data"&&_$n.test(s)){if(s.charAt(4)==="-"){const N=s.slice(5).replace(x9e,E$n);y="data"+N.charAt(0).toUpperCase()+N.slice(1)}else{const N=s.slice(4);if(!x9e.test(N)){let L=N.replace(v$n,x$n);L.charAt(0)!=="-"&&(L="-"+L),s="data"+L}}C=v$t}return new C(y,s)}function x$n(o){return"-"+o.toLowerCase()}function E$n(o){return o.charAt(1).toUpperCase()}const iJ=CNe([INe,m$n,PNe,LNe,MNe],"html"),xC=CNe([INe,y$n,PNe,LNe,MNe],"svg");function E9e(o){const s=String(o||"").trim();return s?s.split(/[ \t\n\r\f]+/g):[]}function _$t(o){return o.join(" ").trim()}var x$t={},T9e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,T$n=/\n/g,k$n=/^\s*/,S$n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,C$n=/^:\s*/,A$n=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,I$n=/^[;\s]*/,O$n=/^\s+|\s+$/g,N$n=`
|
|
1845
|
+
`,k9e="/",S9e="*",cP="",P$n="comment",L$n="declaration",M$n=function(o,s){if(typeof o!="string")throw new TypeError("First argument must be a string");if(!o)return[];s=s||{};var p=1,y=1;function C(at){var Ot=at.match(T$n);Ot&&(p+=Ot.length);var Dt=at.lastIndexOf(N$n);y=~Dt?at.length-Dt:y+at.length}function N(){var at={line:p,column:y};return function(Ot){return Ot.position=new L(at),q(),Ot}}function L(at){this.start=at,this.end={line:p,column:y},this.source=s.source}L.prototype.content=o;function z(at){var Ot=new Error(s.source+":"+p+":"+y+": "+at);if(Ot.reason=at,Ot.filename=s.source,Ot.line=p,Ot.column=y,Ot.source=o,!s.silent)throw Ot}function G(at){var Ot=at.exec(o);if(Ot){var Dt=Ot[0];return C(Dt),o=o.slice(Dt.length),Ot}}function q(){G(k$n)}function et(at){var Ot;for(at=at||[];Ot=tt();)Ot!==!1&&at.push(Ot);return at}function tt(){var at=N();if(!(k9e!=o.charAt(0)||S9e!=o.charAt(1))){for(var Ot=2;cP!=o.charAt(Ot)&&(S9e!=o.charAt(Ot)||k9e!=o.charAt(Ot+1));)++Ot;if(Ot+=2,cP===o.charAt(Ot-1))return z("End of comment missing");var Dt=o.slice(2,Ot-2);return y+=2,C(Dt),o=o.slice(Ot),y+=2,at({type:P$n,comment:Dt})}}function nt(){var at=N(),Ot=G(S$n);if(Ot){if(tt(),!G(C$n))return z("property missing ':'");var Dt=G(A$n),St=at({type:L$n,property:C9e(Ot[0].replace(T9e,cP)),value:Dt?C9e(Dt[0].replace(T9e,cP)):cP});return G(I$n),St}}function st(){var at=[];et(at);for(var Ot;Ot=nt();)Ot!==!1&&(at.push(Ot),et(at));return at}return q(),st()};function C9e(o){return o?o.replace(O$n,cP):cP}var R$n=Cw&&Cw.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(x$t,"__esModule",{value:!0});x$t.default=B$n;var D$n=R$n(M$n);function B$n(o,s){var p=null;if(!o||typeof o!="string")return p;var y=(0,D$n.default)(o),C=typeof s=="function";return y.forEach(function(N){if(N.type==="declaration"){var L=N.property,z=N.value;C?s(L,z,N):z&&(p=p||{},p[L]=z)}}),p}var c2t={};Object.defineProperty(c2t,"__esModule",{value:!0});c2t.camelCase=void 0;var F$n=/^--[a-zA-Z0-9_-]+$/,$$n=/-([a-z])/g,j$n=/^[^-]+$/,H$n=/^-(webkit|moz|ms|o|khtml)-/,z$n=/^-(ms)-/,U$n=function(o){return!o||j$n.test(o)||F$n.test(o)},q$n=function(o,s){return s.toUpperCase()},A9e=function(o,s){return"".concat(s,"-")},W$n=function(o,s){return s===void 0&&(s={}),U$n(o)?o:(o=o.toLowerCase(),s.reactCompat?o=o.replace(z$n,A9e):o=o.replace(H$n,A9e),o.replace($$n,q$n))};c2t.camelCase=W$n;var K$n=Cw&&Cw.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},G$n=K$n(x$t),Y$n=c2t;function dFt(o,s){var p={};return!o||typeof o!="string"||(0,G$n.default)(o,function(y,C){y&&C&&(p[(0,Y$n.camelCase)(y,s)]=C)}),p}dFt.default=dFt;var V$n=dFt;const X$n=KAe(V$n),u2t=RNe("end"),P6=RNe("start");function RNe(o){return s;function s(p){const y=p&&p.position&&p.position[o]||{};if(typeof y.line=="number"&&y.line>0&&typeof y.column=="number"&&y.column>0)return{line:y.line,column:y.column,offset:typeof y.offset=="number"&&y.offset>-1?y.offset:void 0}}}function Q$n(o){const s=P6(o),p=u2t(o);if(s&&p)return{start:s,end:p}}function PQ(o){return!o||typeof o!="object"?"":"position"in o||"type"in o?I9e(o.position):"start"in o||"end"in o?I9e(o):"line"in o||"column"in o?pFt(o):""}function pFt(o){return O9e(o&&o.line)+":"+O9e(o&&o.column)}function I9e(o){return pFt(o&&o.start)+"-"+pFt(o&&o.end)}function O9e(o){return o&&typeof o=="number"?o:1}class kb extends Error{constructor(s,p,y){super(),typeof p=="string"&&(y=p,p=void 0);let C="",N={},L=!1;if(p&&("line"in p&&"column"in p?N={place:p}:"start"in p&&"end"in p?N={place:p}:"type"in p?N={ancestors:[p],place:p.position}:N={...p}),typeof s=="string"?C=s:!N.cause&&s&&(L=!0,C=s.message,N.cause=s),!N.ruleId&&!N.source&&typeof y=="string"){const G=y.indexOf(":");G===-1?N.ruleId=y:(N.source=y.slice(0,G),N.ruleId=y.slice(G+1))}if(!N.place&&N.ancestors&&N.ancestors){const G=N.ancestors[N.ancestors.length-1];G&&(N.place=G.position)}const z=N.place&&"start"in N.place?N.place.start:N.place;this.ancestors=N.ancestors||void 0,this.cause=N.cause||void 0,this.column=z?z.column:void 0,this.fatal=void 0,this.file,this.message=C,this.line=z?z.line:void 0,this.name=PQ(N.place)||"1:1",this.place=N.place||void 0,this.reason=this.message,this.ruleId=N.ruleId||void 0,this.source=N.source||void 0,this.stack=L&&N.cause&&typeof N.cause.stack=="string"?N.cause.stack:"",this.actual,this.expected,this.note,this.url}}kb.prototype.file="";kb.prototype.name="";kb.prototype.reason="";kb.prototype.message="";kb.prototype.stack="";kb.prototype.column=void 0;kb.prototype.line=void 0;kb.prototype.ancestors=void 0;kb.prototype.cause=void 0;kb.prototype.fatal=void 0;kb.prototype.place=void 0;kb.prototype.ruleId=void 0;kb.prototype.source=void 0;const E$t={}.hasOwnProperty,J$n=new Map,Z$n=/[A-Z]/g,tjn=new Set(["table","tbody","thead","tfoot","tr"]),ejn=new Set(["td","th"]),DNe="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function njn(o,s){if(!s||s.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const p=s.filePath||void 0;let y;if(s.development){if(typeof s.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");y=ljn(p,s.jsxDEV)}else{if(typeof s.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof s.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");y=ujn(p,s.jsx,s.jsxs)}const C={Fragment:s.Fragment,ancestors:[],components:s.components||{},create:y,elementAttributeNameCase:s.elementAttributeNameCase||"react",evaluater:s.createEvaluater?s.createEvaluater():void 0,filePath:p,ignoreInvalidStyle:s.ignoreInvalidStyle||!1,passKeys:s.passKeys!==!1,passNode:s.passNode||!1,schema:s.space==="svg"?xC:iJ,stylePropertyNameCase:s.stylePropertyNameCase||"dom",tableCellAlignToStyle:s.tableCellAlignToStyle!==!1},N=BNe(C,o,void 0);return N&&typeof N!="string"?N:C.create(o,C.Fragment,{children:N||void 0},void 0)}function BNe(o,s,p){if(s.type==="element")return rjn(o,s,p);if(s.type==="mdxFlowExpression"||s.type==="mdxTextExpression")return ijn(o,s);if(s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement")return sjn(o,s,p);if(s.type==="mdxjsEsm")return ajn(o,s);if(s.type==="root")return ojn(o,s,p);if(s.type==="text")return cjn(o,s)}function rjn(o,s,p){const y=o.schema;let C=y;s.tagName.toLowerCase()==="svg"&&y.space==="html"&&(C=xC,o.schema=C),o.ancestors.push(s);const N=$Ne(o,s.tagName,!1),L=hjn(o,s);let z=k$t(o,s);return tjn.has(s.tagName)&&(z=z.filter(function(G){return typeof G=="string"?!s2t(G):!0})),FNe(o,L,N,s),T$t(L,z),o.ancestors.pop(),o.schema=y,o.create(s,N,L,p)}function ijn(o,s){if(s.data&&s.data.estree&&o.evaluater){const y=s.data.estree.body[0];return y.type,o.evaluater.evaluateExpression(y.expression)}GQ(o,s.position)}function ajn(o,s){if(s.data&&s.data.estree&&o.evaluater)return o.evaluater.evaluateProgram(s.data.estree);GQ(o,s.position)}function sjn(o,s,p){const y=o.schema;let C=y;s.name==="svg"&&y.space==="html"&&(C=xC,o.schema=C),o.ancestors.push(s);const N=s.name===null?o.Fragment:$Ne(o,s.name,!0),L=fjn(o,s),z=k$t(o,s);return FNe(o,L,N,s),T$t(L,z),o.ancestors.pop(),o.schema=y,o.create(s,N,L,p)}function ojn(o,s,p){const y={};return T$t(y,k$t(o,s)),o.create(s,o.Fragment,y,p)}function cjn(o,s){return s.value}function FNe(o,s,p,y){typeof p!="string"&&p!==o.Fragment&&o.passNode&&(s.node=y)}function T$t(o,s){if(s.length>0){const p=s.length>1?s:s[0];p&&(o.children=p)}}function ujn(o,s,p){return y;function y(C,N,L,z){const q=Array.isArray(L.children)?p:s;return z?q(N,L,z):q(N,L)}}function ljn(o,s){return p;function p(y,C,N,L){const z=Array.isArray(N.children),G=P6(y);return s(C,N,L,z,{columnNumber:G?G.column-1:void 0,fileName:o,lineNumber:G?G.line:void 0},void 0)}}function hjn(o,s){const p={};let y,C;for(C in s.properties)if(C!=="children"&&E$t.call(s.properties,C)){const N=djn(o,C,s.properties[C]);if(N){const[L,z]=N;o.tableCellAlignToStyle&&L==="align"&&typeof z=="string"&&ejn.has(s.tagName)?y=z:p[L]=z}}if(y){const N=p.style||(p.style={});N[o.stylePropertyNameCase==="css"?"text-align":"textAlign"]=y}return p}function fjn(o,s){const p={};for(const y of s.attributes)if(y.type==="mdxJsxExpressionAttribute")if(y.data&&y.data.estree&&o.evaluater){const N=y.data.estree.body[0];N.type;const L=N.expression;L.type;const z=L.properties[0];z.type,Object.assign(p,o.evaluater.evaluateExpression(z.argument))}else GQ(o,s.position);else{const C=y.name;let N;if(y.value&&typeof y.value=="object")if(y.value.data&&y.value.data.estree&&o.evaluater){const z=y.value.data.estree.body[0];z.type,N=o.evaluater.evaluateExpression(z.expression)}else GQ(o,s.position);else N=y.value===null?!0:y.value;p[C]=N}return p}function k$t(o,s){const p=[];let y=-1;const C=o.passKeys?new Map:J$n;for(;++y<s.children.length;){const N=s.children[y];let L;if(o.passKeys){const G=N.type==="element"?N.tagName:N.type==="mdxJsxFlowElement"||N.type==="mdxJsxTextElement"?N.name:void 0;if(G){const q=C.get(G)||0;L=G+"-"+q,C.set(G,q+1)}}const z=BNe(o,N,L);z!==void 0&&p.push(z)}return p}function djn(o,s,p){const y=o2t(o.schema,s);if(!(p==null||typeof p=="number"&&Number.isNaN(p))){if(Array.isArray(p)&&(p=y.commaSeparated?w$t(p):_$t(p)),y.property==="style"){let C=typeof p=="object"?p:pjn(o,String(p));return o.stylePropertyNameCase==="css"&&(C=gjn(C)),["style",C]}return[o.elementAttributeNameCase==="react"&&y.space?w$n[y.property]||y.property:y.attribute,p]}}function pjn(o,s){try{return X$n(s,{reactCompat:!0})}catch(p){if(o.ignoreInvalidStyle)return{};const y=p,C=new kb("Cannot parse `style` attribute",{ancestors:o.ancestors,cause:y,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw C.file=o.filePath||void 0,C.url=DNe+"#cannot-parse-style-attribute",C}}function $Ne(o,s,p){let y;if(!p)y={type:"Literal",value:s};else if(s.includes(".")){const C=s.split(".");let N=-1,L;for(;++N<C.length;){const z=w9e(C[N])?{type:"Identifier",name:C[N]}:{type:"Literal",value:C[N]};L=L?{type:"MemberExpression",object:L,property:z,computed:!!(N&&z.type==="Literal"),optional:!1}:z}y=L}else y=w9e(s)&&!/^[a-z]/.test(s)?{type:"Identifier",name:s}:{type:"Literal",value:s};if(y.type==="Literal"){const C=y.value;return E$t.call(o.components,C)?o.components[C]:C}if(o.evaluater)return o.evaluater.evaluateExpression(y);GQ(o)}function GQ(o,s){const p=new kb("Cannot handle MDX estrees without `createEvaluater`",{ancestors:o.ancestors,place:s,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw p.file=o.filePath||void 0,p.url=DNe+"#cannot-handle-mdx-estrees-without-createevaluater",p}function gjn(o){const s={};let p;for(p in o)E$t.call(o,p)&&(s[bjn(p)]=o[p]);return s}function bjn(o){let s=o.replace(Z$n,mjn);return s.slice(0,3)==="ms-"&&(s="-"+s),s}function mjn(o){return"-"+o.toLowerCase()}const eBt={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},yjn={};function wjn(o,s){const p=yjn,y=typeof p.includeImageAlt=="boolean"?p.includeImageAlt:!0,C=typeof p.includeHtml=="boolean"?p.includeHtml:!0;return jNe(o,y,C)}function jNe(o,s,p){if(vjn(o)){if("value"in o)return o.type==="html"&&!p?"":o.value;if(s&&"alt"in o&&o.alt)return o.alt;if("children"in o)return N9e(o.children,s,p)}return Array.isArray(o)?N9e(o,s,p):""}function N9e(o,s,p){const y=[];let C=-1;for(;++C<o.length;)y[C]=jNe(o[C],s,p);return y.join("")}function vjn(o){return!!(o&&typeof o=="object")}const P9e=document.createElement("i");function S$t(o){const s="&"+o+";";P9e.innerHTML=s;const p=P9e.textContent;return p.charCodeAt(p.length-1)===59&&o!=="semi"||p===s?!1:p}function O6(o,s,p,y){const C=o.length;let N=0,L;if(s<0?s=-s>C?0:C+s:s=s>C?C:s,p=p>0?p:0,y.length<1e4)L=Array.from(y),L.unshift(s,p),o.splice(...L);else for(p&&o.splice(s,p);N<y.length;)L=y.slice(N,N+1e4),L.unshift(s,0),o.splice(...L),N+=1e4,s+=1e4}function S3(o,s){return o.length>0?(O6(o,o.length,0,s),o):s}const L9e={}.hasOwnProperty;function _jn(o){const s={};let p=-1;for(;++p<o.length;)xjn(s,o[p]);return s}function xjn(o,s){let p;for(p in s){const C=(L9e.call(o,p)?o[p]:void 0)||(o[p]={}),N=s[p];let L;if(N)for(L in N){L9e.call(C,L)||(C[L]=[]);const z=N[L];Ejn(C[L],Array.isArray(z)?z:z?[z]:[])}}}function Ejn(o,s){let p=-1;const y=[];for(;++p<s.length;)(s[p].add==="after"?o:y).push(s[p]);O6(o,0,0,y)}function HNe(o,s){const p=Number.parseInt(o,s);return p<9||p===11||p>13&&p<32||p>126&&p<160||p>55295&&p<57344||p>64975&&p<65008||(p&65535)===65535||(p&65535)===65534||p>1114111?"�":String.fromCodePoint(p)}function qF(o){return o.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const T6=EC(/[A-Za-z]/),Aw=EC(/[\dA-Za-z]/),Tjn=EC(/[#-'*+\--9=?A-Z^-~]/);function gFt(o){return o!==null&&(o<32||o===127)}const bFt=EC(/\d/),kjn=EC(/[\dA-Fa-f]/),Sjn=EC(/[!-/:-@[-`{-~]/);function ec(o){return o!==null&&o<-2}function ty(o){return o!==null&&(o<0||o===32)}function zl(o){return o===-2||o===-1||o===32}const Cjn=EC(new RegExp("\\p{P}|\\p{S}","u")),Ajn=EC(/\s/);function EC(o){return s;function s(p){return p!==null&&p>-1&&o.test(String.fromCharCode(p))}}function h$(o){const s=[];let p=-1,y=0,C=0;for(;++p<o.length;){const N=o.charCodeAt(p);let L="";if(N===37&&Aw(o.charCodeAt(p+1))&&Aw(o.charCodeAt(p+2)))C=2;else if(N<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(N))||(L=String.fromCharCode(N));else if(N>55295&&N<57344){const z=o.charCodeAt(p+1);N<56320&&z>56319&&z<57344?(L=String.fromCharCode(N,z),C=1):L="�"}else L=String.fromCharCode(N);L&&(s.push(o.slice(y,p),encodeURIComponent(L)),y=p+C+1,L=""),C&&(p+=C,C=0)}return s.join("")+o.slice(y)}function of(o,s,p,y){const C=y?y-1:Number.POSITIVE_INFINITY;let N=0;return L;function L(G){return zl(G)?(o.enter(p),z(G)):s(G)}function z(G){return zl(G)&&N++<C?(o.consume(G),z):(o.exit(p),s(G))}}const Ijn={tokenize:Ojn};function Ojn(o){const s=o.attempt(this.parser.constructs.contentInitial,y,C);let p;return s;function y(z){if(z===null){o.consume(z);return}return o.enter("lineEnding"),o.consume(z),o.exit("lineEnding"),of(o,s,"linePrefix")}function C(z){return o.enter("paragraph"),N(z)}function N(z){const G=o.enter("chunkText",{contentType:"text",previous:p});return p&&(p.next=G),p=G,L(z)}function L(z){if(z===null){o.exit("chunkText"),o.exit("paragraph"),o.consume(z);return}return ec(z)?(o.consume(z),o.exit("chunkText"),N):(o.consume(z),L)}}const Njn={tokenize:Pjn},M9e={tokenize:Ljn};function Pjn(o){const s=this,p=[];let y=0,C,N,L;return z;function z(ae){if(y<p.length){const Ne=p[y];return s.containerState=Ne[1],o.attempt(Ne[0].continuation,G,q)(ae)}return q(ae)}function G(ae){if(y++,s.containerState._closeFlow){s.containerState._closeFlow=void 0,C&&ie();const Ne=s.events.length;let pn=Ne,de;for(;pn--;)if(s.events[pn][0]==="exit"&&s.events[pn][1].type==="chunkFlow"){de=s.events[pn][1].end;break}St(y);let cn=Ne;for(;cn<s.events.length;)s.events[cn][1].end={...de},cn++;return O6(s.events,pn+1,0,s.events.slice(Ne)),s.events.length=cn,q(ae)}return z(ae)}function q(ae){if(y===p.length){if(!C)return nt(ae);if(C.currentConstruct&&C.currentConstruct.concrete)return at(ae);s.interrupt=!!(C.currentConstruct&&!C._gfmTableDynamicInterruptHack)}return s.containerState={},o.check(M9e,et,tt)(ae)}function et(ae){return C&&ie(),St(y),nt(ae)}function tt(ae){return s.parser.lazy[s.now().line]=y!==p.length,L=s.now().offset,at(ae)}function nt(ae){return s.containerState={},o.attempt(M9e,st,at)(ae)}function st(ae){return y++,p.push([s.currentConstruct,s.containerState]),nt(ae)}function at(ae){if(ae===null){C&&ie(),St(0),o.consume(ae);return}return C=C||s.parser.flow(s.now()),o.enter("chunkFlow",{_tokenizer:C,contentType:"flow",previous:N}),Ot(ae)}function Ot(ae){if(ae===null){Dt(o.exit("chunkFlow"),!0),St(0),o.consume(ae);return}return ec(ae)?(o.consume(ae),Dt(o.exit("chunkFlow")),y=0,s.interrupt=void 0,z):(o.consume(ae),Ot)}function Dt(ae,Ne){const pn=s.sliceStream(ae);if(Ne&&pn.push(null),ae.previous=N,N&&(N.next=ae),N=ae,C.defineSkip(ae.start),C.write(pn),s.parser.lazy[ae.start.line]){let de=C.events.length;for(;de--;)if(C.events[de][1].start.offset<L&&(!C.events[de][1].end||C.events[de][1].end.offset>L))return;const cn=s.events.length;let er=cn,Dn,jn;for(;er--;)if(s.events[er][0]==="exit"&&s.events[er][1].type==="chunkFlow"){if(Dn){jn=s.events[er][1].end;break}Dn=!0}for(St(y),de=cn;de<s.events.length;)s.events[de][1].end={...jn},de++;O6(s.events,er+1,0,s.events.slice(cn)),s.events.length=de}}function St(ae){let Ne=p.length;for(;Ne-- >ae;){const pn=p[Ne];s.containerState=pn[1],pn[0].exit.call(s,o)}p.length=ae}function ie(){C.write([null]),N=void 0,C=void 0,s.containerState._closeFlow=void 0}}function Ljn(o,s,p){return of(o,o.attempt(this.parser.constructs.document,s,p),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function R9e(o){if(o===null||ty(o)||Ajn(o))return 1;if(Cjn(o))return 2}function C$t(o,s,p){const y=[];let C=-1;for(;++C<o.length;){const N=o[C].resolveAll;N&&!y.includes(N)&&(s=N(s,p),y.push(N))}return s}const mFt={name:"attention",resolveAll:Mjn,tokenize:Rjn};function Mjn(o,s){let p=-1,y,C,N,L,z,G,q,et;for(;++p<o.length;)if(o[p][0]==="enter"&&o[p][1].type==="attentionSequence"&&o[p][1]._close){for(y=p;y--;)if(o[y][0]==="exit"&&o[y][1].type==="attentionSequence"&&o[y][1]._open&&s.sliceSerialize(o[y][1]).charCodeAt(0)===s.sliceSerialize(o[p][1]).charCodeAt(0)){if((o[y][1]._close||o[p][1]._open)&&(o[p][1].end.offset-o[p][1].start.offset)%3&&!((o[y][1].end.offset-o[y][1].start.offset+o[p][1].end.offset-o[p][1].start.offset)%3))continue;G=o[y][1].end.offset-o[y][1].start.offset>1&&o[p][1].end.offset-o[p][1].start.offset>1?2:1;const tt={...o[y][1].end},nt={...o[p][1].start};D9e(tt,-G),D9e(nt,G),L={type:G>1?"strongSequence":"emphasisSequence",start:tt,end:{...o[y][1].end}},z={type:G>1?"strongSequence":"emphasisSequence",start:{...o[p][1].start},end:nt},N={type:G>1?"strongText":"emphasisText",start:{...o[y][1].end},end:{...o[p][1].start}},C={type:G>1?"strong":"emphasis",start:{...L.start},end:{...z.end}},o[y][1].end={...L.start},o[p][1].start={...z.end},q=[],o[y][1].end.offset-o[y][1].start.offset&&(q=S3(q,[["enter",o[y][1],s],["exit",o[y][1],s]])),q=S3(q,[["enter",C,s],["enter",L,s],["exit",L,s],["enter",N,s]]),q=S3(q,C$t(s.parser.constructs.insideSpan.null,o.slice(y+1,p),s)),q=S3(q,[["exit",N,s],["enter",z,s],["exit",z,s],["exit",C,s]]),o[p][1].end.offset-o[p][1].start.offset?(et=2,q=S3(q,[["enter",o[p][1],s],["exit",o[p][1],s]])):et=0,O6(o,y-1,p-y+3,q),p=y+q.length-et-2;break}}for(p=-1;++p<o.length;)o[p][1].type==="attentionSequence"&&(o[p][1].type="data");return o}function Rjn(o,s){const p=this.parser.constructs.attentionMarkers.null,y=this.previous,C=R9e(y);let N;return L;function L(G){return N=G,o.enter("attentionSequence"),z(G)}function z(G){if(G===N)return o.consume(G),z;const q=o.exit("attentionSequence"),et=R9e(G),tt=!et||et===2&&C||p.includes(G),nt=!C||C===2&&et||p.includes(y);return q._open=!!(N===42?tt:tt&&(C||!nt)),q._close=!!(N===42?nt:nt&&(et||!tt)),s(G)}}function D9e(o,s){o.column+=s,o.offset+=s,o._bufferIndex+=s}const Djn={name:"autolink",tokenize:Bjn};function Bjn(o,s,p){let y=0;return C;function C(st){return o.enter("autolink"),o.enter("autolinkMarker"),o.consume(st),o.exit("autolinkMarker"),o.enter("autolinkProtocol"),N}function N(st){return T6(st)?(o.consume(st),L):st===64?p(st):q(st)}function L(st){return st===43||st===45||st===46||Aw(st)?(y=1,z(st)):q(st)}function z(st){return st===58?(o.consume(st),y=0,G):(st===43||st===45||st===46||Aw(st))&&y++<32?(o.consume(st),z):(y=0,q(st))}function G(st){return st===62?(o.exit("autolinkProtocol"),o.enter("autolinkMarker"),o.consume(st),o.exit("autolinkMarker"),o.exit("autolink"),s):st===null||st===32||st===60||gFt(st)?p(st):(o.consume(st),G)}function q(st){return st===64?(o.consume(st),et):Tjn(st)?(o.consume(st),q):p(st)}function et(st){return Aw(st)?tt(st):p(st)}function tt(st){return st===46?(o.consume(st),y=0,et):st===62?(o.exit("autolinkProtocol").type="autolinkEmail",o.enter("autolinkMarker"),o.consume(st),o.exit("autolinkMarker"),o.exit("autolink"),s):nt(st)}function nt(st){if((st===45||Aw(st))&&y++<63){const at=st===45?nt:tt;return o.consume(st),at}return p(st)}}const l2t={partial:!0,tokenize:Fjn};function Fjn(o,s,p){return y;function y(N){return zl(N)?of(o,C,"linePrefix")(N):C(N)}function C(N){return N===null||ec(N)?s(N):p(N)}}const zNe={continuation:{tokenize:jjn},exit:Hjn,name:"blockQuote",tokenize:$jn};function $jn(o,s,p){const y=this;return C;function C(L){if(L===62){const z=y.containerState;return z.open||(o.enter("blockQuote",{_container:!0}),z.open=!0),o.enter("blockQuotePrefix"),o.enter("blockQuoteMarker"),o.consume(L),o.exit("blockQuoteMarker"),N}return p(L)}function N(L){return zl(L)?(o.enter("blockQuotePrefixWhitespace"),o.consume(L),o.exit("blockQuotePrefixWhitespace"),o.exit("blockQuotePrefix"),s):(o.exit("blockQuotePrefix"),s(L))}}function jjn(o,s,p){const y=this;return C;function C(L){return zl(L)?of(o,N,"linePrefix",y.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):N(L)}function N(L){return o.attempt(zNe,s,p)(L)}}function Hjn(o){o.exit("blockQuote")}const UNe={name:"characterEscape",tokenize:zjn};function zjn(o,s,p){return y;function y(N){return o.enter("characterEscape"),o.enter("escapeMarker"),o.consume(N),o.exit("escapeMarker"),C}function C(N){return Sjn(N)?(o.enter("characterEscapeValue"),o.consume(N),o.exit("characterEscapeValue"),o.exit("characterEscape"),s):p(N)}}const qNe={name:"characterReference",tokenize:Ujn};function Ujn(o,s,p){const y=this;let C=0,N,L;return z;function z(tt){return o.enter("characterReference"),o.enter("characterReferenceMarker"),o.consume(tt),o.exit("characterReferenceMarker"),G}function G(tt){return tt===35?(o.enter("characterReferenceMarkerNumeric"),o.consume(tt),o.exit("characterReferenceMarkerNumeric"),q):(o.enter("characterReferenceValue"),N=31,L=Aw,et(tt))}function q(tt){return tt===88||tt===120?(o.enter("characterReferenceMarkerHexadecimal"),o.consume(tt),o.exit("characterReferenceMarkerHexadecimal"),o.enter("characterReferenceValue"),N=6,L=kjn,et):(o.enter("characterReferenceValue"),N=7,L=bFt,et(tt))}function et(tt){if(tt===59&&C){const nt=o.exit("characterReferenceValue");return L===Aw&&!S$t(y.sliceSerialize(nt))?p(tt):(o.enter("characterReferenceMarker"),o.consume(tt),o.exit("characterReferenceMarker"),o.exit("characterReference"),s)}return L(tt)&&C++<N?(o.consume(tt),et):p(tt)}}const B9e={partial:!0,tokenize:Wjn},F9e={concrete:!0,name:"codeFenced",tokenize:qjn};function qjn(o,s,p){const y=this,C={partial:!0,tokenize:pn};let N=0,L=0,z;return G;function G(de){return q(de)}function q(de){const cn=y.events[y.events.length-1];return N=cn&&cn[1].type==="linePrefix"?cn[2].sliceSerialize(cn[1],!0).length:0,z=de,o.enter("codeFenced"),o.enter("codeFencedFence"),o.enter("codeFencedFenceSequence"),et(de)}function et(de){return de===z?(L++,o.consume(de),et):L<3?p(de):(o.exit("codeFencedFenceSequence"),zl(de)?of(o,tt,"whitespace")(de):tt(de))}function tt(de){return de===null||ec(de)?(o.exit("codeFencedFence"),y.interrupt?s(de):o.check(B9e,Ot,Ne)(de)):(o.enter("codeFencedFenceInfo"),o.enter("chunkString",{contentType:"string"}),nt(de))}function nt(de){return de===null||ec(de)?(o.exit("chunkString"),o.exit("codeFencedFenceInfo"),tt(de)):zl(de)?(o.exit("chunkString"),o.exit("codeFencedFenceInfo"),of(o,st,"whitespace")(de)):de===96&&de===z?p(de):(o.consume(de),nt)}function st(de){return de===null||ec(de)?tt(de):(o.enter("codeFencedFenceMeta"),o.enter("chunkString",{contentType:"string"}),at(de))}function at(de){return de===null||ec(de)?(o.exit("chunkString"),o.exit("codeFencedFenceMeta"),tt(de)):de===96&&de===z?p(de):(o.consume(de),at)}function Ot(de){return o.attempt(C,Ne,Dt)(de)}function Dt(de){return o.enter("lineEnding"),o.consume(de),o.exit("lineEnding"),St}function St(de){return N>0&&zl(de)?of(o,ie,"linePrefix",N+1)(de):ie(de)}function ie(de){return de===null||ec(de)?o.check(B9e,Ot,Ne)(de):(o.enter("codeFlowValue"),ae(de))}function ae(de){return de===null||ec(de)?(o.exit("codeFlowValue"),ie(de)):(o.consume(de),ae)}function Ne(de){return o.exit("codeFenced"),s(de)}function pn(de,cn,er){let Dn=0;return jn;function jn(Or){return de.enter("lineEnding"),de.consume(Or),de.exit("lineEnding"),or}function or(Or){return de.enter("codeFencedFence"),zl(Or)?of(de,gr,"linePrefix",y.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Or):gr(Or)}function gr(Or){return Or===z?(de.enter("codeFencedFenceSequence"),fi(Or)):er(Or)}function fi(Or){return Or===z?(Dn++,de.consume(Or),fi):Dn>=L?(de.exit("codeFencedFenceSequence"),zl(Or)?of(de,pi,"whitespace")(Or):pi(Or)):er(Or)}function pi(Or){return Or===null||ec(Or)?(de.exit("codeFencedFence"),cn(Or)):er(Or)}}}function Wjn(o,s,p){const y=this;return C;function C(L){return L===null?p(L):(o.enter("lineEnding"),o.consume(L),o.exit("lineEnding"),N)}function N(L){return y.parser.lazy[y.now().line]?p(L):s(L)}}const nBt={name:"codeIndented",tokenize:Gjn},Kjn={partial:!0,tokenize:Yjn};function Gjn(o,s,p){const y=this;return C;function C(q){return o.enter("codeIndented"),of(o,N,"linePrefix",5)(q)}function N(q){const et=y.events[y.events.length-1];return et&&et[1].type==="linePrefix"&&et[2].sliceSerialize(et[1],!0).length>=4?L(q):p(q)}function L(q){return q===null?G(q):ec(q)?o.attempt(Kjn,L,G)(q):(o.enter("codeFlowValue"),z(q))}function z(q){return q===null||ec(q)?(o.exit("codeFlowValue"),L(q)):(o.consume(q),z)}function G(q){return o.exit("codeIndented"),s(q)}}function Yjn(o,s,p){const y=this;return C;function C(L){return y.parser.lazy[y.now().line]?p(L):ec(L)?(o.enter("lineEnding"),o.consume(L),o.exit("lineEnding"),C):of(o,N,"linePrefix",5)(L)}function N(L){const z=y.events[y.events.length-1];return z&&z[1].type==="linePrefix"&&z[2].sliceSerialize(z[1],!0).length>=4?s(L):ec(L)?C(L):p(L)}}const Vjn={name:"codeText",previous:Qjn,resolve:Xjn,tokenize:Jjn};function Xjn(o){let s=o.length-4,p=3,y,C;if((o[p][1].type==="lineEnding"||o[p][1].type==="space")&&(o[s][1].type==="lineEnding"||o[s][1].type==="space")){for(y=p;++y<s;)if(o[y][1].type==="codeTextData"){o[p][1].type="codeTextPadding",o[s][1].type="codeTextPadding",p+=2,s-=2;break}}for(y=p-1,s++;++y<=s;)C===void 0?y!==s&&o[y][1].type!=="lineEnding"&&(C=y):(y===s||o[y][1].type==="lineEnding")&&(o[C][1].type="codeTextData",y!==C+2&&(o[C][1].end=o[y-1][1].end,o.splice(C+2,y-C-2),s-=y-C-2,y=C+2),C=void 0);return o}function Qjn(o){return o!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Jjn(o,s,p){let y=0,C,N;return L;function L(tt){return o.enter("codeText"),o.enter("codeTextSequence"),z(tt)}function z(tt){return tt===96?(o.consume(tt),y++,z):(o.exit("codeTextSequence"),G(tt))}function G(tt){return tt===null?p(tt):tt===32?(o.enter("space"),o.consume(tt),o.exit("space"),G):tt===96?(N=o.enter("codeTextSequence"),C=0,et(tt)):ec(tt)?(o.enter("lineEnding"),o.consume(tt),o.exit("lineEnding"),G):(o.enter("codeTextData"),q(tt))}function q(tt){return tt===null||tt===32||tt===96||ec(tt)?(o.exit("codeTextData"),G(tt)):(o.consume(tt),q)}function et(tt){return tt===96?(o.consume(tt),C++,et):C===y?(o.exit("codeTextSequence"),o.exit("codeText"),s(tt)):(N.type="codeTextData",q(tt))}}class Zjn{constructor(s){this.left=s?[...s]:[],this.right=[]}get(s){if(s<0||s>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+s+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return s<this.left.length?this.left[s]:this.right[this.right.length-s+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(s,p){const y=p??Number.POSITIVE_INFINITY;return y<this.left.length?this.left.slice(s,y):s>this.left.length?this.right.slice(this.right.length-y+this.left.length,this.right.length-s+this.left.length).reverse():this.left.slice(s).concat(this.right.slice(this.right.length-y+this.left.length).reverse())}splice(s,p,y){const C=p||0;this.setCursor(Math.trunc(s));const N=this.right.splice(this.right.length-C,Number.POSITIVE_INFINITY);return y&&fQ(this.left,y),N.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(s){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(s)}pushMany(s){this.setCursor(Number.POSITIVE_INFINITY),fQ(this.left,s)}unshift(s){this.setCursor(0),this.right.push(s)}unshiftMany(s){this.setCursor(0),fQ(this.right,s.reverse())}setCursor(s){if(!(s===this.left.length||s>this.left.length&&this.right.length===0||s<0&&this.left.length===0))if(s<this.left.length){const p=this.left.splice(s,Number.POSITIVE_INFINITY);fQ(this.right,p.reverse())}else{const p=this.right.splice(this.left.length+this.right.length-s,Number.POSITIVE_INFINITY);fQ(this.left,p.reverse())}}}function fQ(o,s){let p=0;if(s.length<1e4)o.push(...s);else for(;p<s.length;)o.push(...s.slice(p,p+1e4)),p+=1e4}function WNe(o){const s={};let p=-1,y,C,N,L,z,G,q;const et=new Zjn(o);for(;++p<et.length;){for(;p in s;)p=s[p];if(y=et.get(p),p&&y[1].type==="chunkFlow"&&et.get(p-1)[1].type==="listItemPrefix"&&(G=y[1]._tokenizer.events,N=0,N<G.length&&G[N][1].type==="lineEndingBlank"&&(N+=2),N<G.length&&G[N][1].type==="content"))for(;++N<G.length&&G[N][1].type!=="content";)G[N][1].type==="chunkText"&&(G[N][1]._isInFirstContentOfListItem=!0,N++);if(y[0]==="enter")y[1].contentType&&(Object.assign(s,tHn(et,p)),p=s[p],q=!0);else if(y[1]._container){for(N=p,C=void 0;N--;)if(L=et.get(N),L[1].type==="lineEnding"||L[1].type==="lineEndingBlank")L[0]==="enter"&&(C&&(et.get(C)[1].type="lineEndingBlank"),L[1].type="lineEnding",C=N);else if(!(L[1].type==="linePrefix"||L[1].type==="listItemIndent"))break;C&&(y[1].end={...et.get(C)[1].start},z=et.slice(C,p),z.unshift(y),et.splice(C,p-C+1,z))}}return O6(o,0,Number.POSITIVE_INFINITY,et.slice(0)),!q}function tHn(o,s){const p=o.get(s)[1],y=o.get(s)[2];let C=s-1;const N=[];let L=p._tokenizer;L||(L=y.parser[p.contentType](p.start),p._contentTypeTextTrailing&&(L._contentTypeTextTrailing=!0));const z=L.events,G=[],q={};let et,tt,nt=-1,st=p,at=0,Ot=0;const Dt=[Ot];for(;st;){for(;o.get(++C)[1]!==st;);N.push(C),st._tokenizer||(et=y.sliceStream(st),st.next||et.push(null),tt&&L.defineSkip(st.start),st._isInFirstContentOfListItem&&(L._gfmTasklistFirstContentOfListItem=!0),L.write(et),st._isInFirstContentOfListItem&&(L._gfmTasklistFirstContentOfListItem=void 0)),tt=st,st=st.next}for(st=p;++nt<z.length;)z[nt][0]==="exit"&&z[nt-1][0]==="enter"&&z[nt][1].type===z[nt-1][1].type&&z[nt][1].start.line!==z[nt][1].end.line&&(Ot=nt+1,Dt.push(Ot),st._tokenizer=void 0,st.previous=void 0,st=st.next);for(L.events=[],st?(st._tokenizer=void 0,st.previous=void 0):Dt.pop(),nt=Dt.length;nt--;){const St=z.slice(Dt[nt],Dt[nt+1]),ie=N.pop();G.push([ie,ie+St.length-1]),o.splice(ie,2,St)}for(G.reverse(),nt=-1;++nt<G.length;)q[at+G[nt][0]]=at+G[nt][1],at+=G[nt][1]-G[nt][0]-1;return q}const eHn={resolve:rHn,tokenize:iHn},nHn={partial:!0,tokenize:aHn};function rHn(o){return WNe(o),o}function iHn(o,s){let p;return y;function y(z){return o.enter("content"),p=o.enter("chunkContent",{contentType:"content"}),C(z)}function C(z){return z===null?N(z):ec(z)?o.check(nHn,L,N)(z):(o.consume(z),C)}function N(z){return o.exit("chunkContent"),o.exit("content"),s(z)}function L(z){return o.consume(z),o.exit("chunkContent"),p.next=o.enter("chunkContent",{contentType:"content",previous:p}),p=p.next,C}}function aHn(o,s,p){const y=this;return C;function C(L){return o.exit("chunkContent"),o.enter("lineEnding"),o.consume(L),o.exit("lineEnding"),of(o,N,"linePrefix")}function N(L){if(L===null||ec(L))return p(L);const z=y.events[y.events.length-1];return!y.parser.constructs.disable.null.includes("codeIndented")&&z&&z[1].type==="linePrefix"&&z[2].sliceSerialize(z[1],!0).length>=4?s(L):o.interrupt(y.parser.constructs.flow,p,s)(L)}}function KNe(o,s,p,y,C,N,L,z,G){const q=G||Number.POSITIVE_INFINITY;let et=0;return tt;function tt(St){return St===60?(o.enter(y),o.enter(C),o.enter(N),o.consume(St),o.exit(N),nt):St===null||St===32||St===41||gFt(St)?p(St):(o.enter(y),o.enter(L),o.enter(z),o.enter("chunkString",{contentType:"string"}),Ot(St))}function nt(St){return St===62?(o.enter(N),o.consume(St),o.exit(N),o.exit(C),o.exit(y),s):(o.enter(z),o.enter("chunkString",{contentType:"string"}),st(St))}function st(St){return St===62?(o.exit("chunkString"),o.exit(z),nt(St)):St===null||St===60||ec(St)?p(St):(o.consume(St),St===92?at:st)}function at(St){return St===60||St===62||St===92?(o.consume(St),st):st(St)}function Ot(St){return!et&&(St===null||St===41||ty(St))?(o.exit("chunkString"),o.exit(z),o.exit(L),o.exit(y),s(St)):et<q&&St===40?(o.consume(St),et++,Ot):St===41?(o.consume(St),et--,Ot):St===null||St===32||St===40||gFt(St)?p(St):(o.consume(St),St===92?Dt:Ot)}function Dt(St){return St===40||St===41||St===92?(o.consume(St),Ot):Ot(St)}}function GNe(o,s,p,y,C,N){const L=this;let z=0,G;return q;function q(st){return o.enter(y),o.enter(C),o.consume(st),o.exit(C),o.enter(N),et}function et(st){return z>999||st===null||st===91||st===93&&!G||st===94&&!z&&"_hiddenFootnoteSupport"in L.parser.constructs?p(st):st===93?(o.exit(N),o.enter(C),o.consume(st),o.exit(C),o.exit(y),s):ec(st)?(o.enter("lineEnding"),o.consume(st),o.exit("lineEnding"),et):(o.enter("chunkString",{contentType:"string"}),tt(st))}function tt(st){return st===null||st===91||st===93||ec(st)||z++>999?(o.exit("chunkString"),et(st)):(o.consume(st),G||(G=!zl(st)),st===92?nt:tt)}function nt(st){return st===91||st===92||st===93?(o.consume(st),z++,tt):tt(st)}}function YNe(o,s,p,y,C,N){let L;return z;function z(nt){return nt===34||nt===39||nt===40?(o.enter(y),o.enter(C),o.consume(nt),o.exit(C),L=nt===40?41:nt,G):p(nt)}function G(nt){return nt===L?(o.enter(C),o.consume(nt),o.exit(C),o.exit(y),s):(o.enter(N),q(nt))}function q(nt){return nt===L?(o.exit(N),G(L)):nt===null?p(nt):ec(nt)?(o.enter("lineEnding"),o.consume(nt),o.exit("lineEnding"),of(o,q,"linePrefix")):(o.enter("chunkString",{contentType:"string"}),et(nt))}function et(nt){return nt===L||nt===null||ec(nt)?(o.exit("chunkString"),q(nt)):(o.consume(nt),nt===92?tt:et)}function tt(nt){return nt===L||nt===92?(o.consume(nt),et):et(nt)}}function LQ(o,s){let p;return y;function y(C){return ec(C)?(o.enter("lineEnding"),o.consume(C),o.exit("lineEnding"),p=!0,y):zl(C)?of(o,y,p?"linePrefix":"lineSuffix")(C):s(C)}}const sHn={name:"definition",tokenize:cHn},oHn={partial:!0,tokenize:uHn};function cHn(o,s,p){const y=this;let C;return N;function N(st){return o.enter("definition"),L(st)}function L(st){return GNe.call(y,o,z,p,"definitionLabel","definitionLabelMarker","definitionLabelString")(st)}function z(st){return C=qF(y.sliceSerialize(y.events[y.events.length-1][1]).slice(1,-1)),st===58?(o.enter("definitionMarker"),o.consume(st),o.exit("definitionMarker"),G):p(st)}function G(st){return ty(st)?LQ(o,q)(st):q(st)}function q(st){return KNe(o,et,p,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(st)}function et(st){return o.attempt(oHn,tt,tt)(st)}function tt(st){return zl(st)?of(o,nt,"whitespace")(st):nt(st)}function nt(st){return st===null||ec(st)?(o.exit("definition"),y.parser.defined.push(C),s(st)):p(st)}}function uHn(o,s,p){return y;function y(z){return ty(z)?LQ(o,C)(z):p(z)}function C(z){return YNe(o,N,p,"definitionTitle","definitionTitleMarker","definitionTitleString")(z)}function N(z){return zl(z)?of(o,L,"whitespace")(z):L(z)}function L(z){return z===null||ec(z)?s(z):p(z)}}const lHn={name:"hardBreakEscape",tokenize:hHn};function hHn(o,s,p){return y;function y(N){return o.enter("hardBreakEscape"),o.consume(N),C}function C(N){return ec(N)?(o.exit("hardBreakEscape"),s(N)):p(N)}}const fHn={name:"headingAtx",resolve:dHn,tokenize:pHn};function dHn(o,s){let p=o.length-2,y=3,C,N;return o[y][1].type==="whitespace"&&(y+=2),p-2>y&&o[p][1].type==="whitespace"&&(p-=2),o[p][1].type==="atxHeadingSequence"&&(y===p-1||p-4>y&&o[p-2][1].type==="whitespace")&&(p-=y+1===p?2:4),p>y&&(C={type:"atxHeadingText",start:o[y][1].start,end:o[p][1].end},N={type:"chunkText",start:o[y][1].start,end:o[p][1].end,contentType:"text"},O6(o,y,p-y+1,[["enter",C,s],["enter",N,s],["exit",N,s],["exit",C,s]])),o}function pHn(o,s,p){let y=0;return C;function C(et){return o.enter("atxHeading"),N(et)}function N(et){return o.enter("atxHeadingSequence"),L(et)}function L(et){return et===35&&y++<6?(o.consume(et),L):et===null||ty(et)?(o.exit("atxHeadingSequence"),z(et)):p(et)}function z(et){return et===35?(o.enter("atxHeadingSequence"),G(et)):et===null||ec(et)?(o.exit("atxHeading"),s(et)):zl(et)?of(o,z,"whitespace")(et):(o.enter("atxHeadingText"),q(et))}function G(et){return et===35?(o.consume(et),G):(o.exit("atxHeadingSequence"),z(et))}function q(et){return et===null||et===35||ty(et)?(o.exit("atxHeadingText"),z(et)):(o.consume(et),q)}}const gHn=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],$9e=["pre","script","style","textarea"],bHn={concrete:!0,name:"htmlFlow",resolveTo:wHn,tokenize:vHn},mHn={partial:!0,tokenize:xHn},yHn={partial:!0,tokenize:_Hn};function wHn(o){let s=o.length;for(;s--&&!(o[s][0]==="enter"&&o[s][1].type==="htmlFlow"););return s>1&&o[s-2][1].type==="linePrefix"&&(o[s][1].start=o[s-2][1].start,o[s+1][1].start=o[s-2][1].start,o.splice(s-2,2)),o}function vHn(o,s,p){const y=this;let C,N,L,z,G;return q;function q(Ke){return et(Ke)}function et(Ke){return o.enter("htmlFlow"),o.enter("htmlFlowData"),o.consume(Ke),tt}function tt(Ke){return Ke===33?(o.consume(Ke),nt):Ke===47?(o.consume(Ke),N=!0,Ot):Ke===63?(o.consume(Ke),C=3,y.interrupt?s:ze):T6(Ke)?(o.consume(Ke),L=String.fromCharCode(Ke),Dt):p(Ke)}function nt(Ke){return Ke===45?(o.consume(Ke),C=2,st):Ke===91?(o.consume(Ke),C=5,z=0,at):T6(Ke)?(o.consume(Ke),C=4,y.interrupt?s:ze):p(Ke)}function st(Ke){return Ke===45?(o.consume(Ke),y.interrupt?s:ze):p(Ke)}function at(Ke){const xo="CDATA[";return Ke===xo.charCodeAt(z++)?(o.consume(Ke),z===xo.length?y.interrupt?s:gr:at):p(Ke)}function Ot(Ke){return T6(Ke)?(o.consume(Ke),L=String.fromCharCode(Ke),Dt):p(Ke)}function Dt(Ke){if(Ke===null||Ke===47||Ke===62||ty(Ke)){const xo=Ke===47,Ss=L.toLowerCase();return!xo&&!N&&$9e.includes(Ss)?(C=1,y.interrupt?s(Ke):gr(Ke)):gHn.includes(L.toLowerCase())?(C=6,xo?(o.consume(Ke),St):y.interrupt?s(Ke):gr(Ke)):(C=7,y.interrupt&&!y.parser.lazy[y.now().line]?p(Ke):N?ie(Ke):ae(Ke))}return Ke===45||Aw(Ke)?(o.consume(Ke),L+=String.fromCharCode(Ke),Dt):p(Ke)}function St(Ke){return Ke===62?(o.consume(Ke),y.interrupt?s:gr):p(Ke)}function ie(Ke){return zl(Ke)?(o.consume(Ke),ie):jn(Ke)}function ae(Ke){return Ke===47?(o.consume(Ke),jn):Ke===58||Ke===95||T6(Ke)?(o.consume(Ke),Ne):zl(Ke)?(o.consume(Ke),ae):jn(Ke)}function Ne(Ke){return Ke===45||Ke===46||Ke===58||Ke===95||Aw(Ke)?(o.consume(Ke),Ne):pn(Ke)}function pn(Ke){return Ke===61?(o.consume(Ke),de):zl(Ke)?(o.consume(Ke),pn):ae(Ke)}function de(Ke){return Ke===null||Ke===60||Ke===61||Ke===62||Ke===96?p(Ke):Ke===34||Ke===39?(o.consume(Ke),G=Ke,cn):zl(Ke)?(o.consume(Ke),de):er(Ke)}function cn(Ke){return Ke===G?(o.consume(Ke),G=null,Dn):Ke===null||ec(Ke)?p(Ke):(o.consume(Ke),cn)}function er(Ke){return Ke===null||Ke===34||Ke===39||Ke===47||Ke===60||Ke===61||Ke===62||Ke===96||ty(Ke)?pn(Ke):(o.consume(Ke),er)}function Dn(Ke){return Ke===47||Ke===62||zl(Ke)?ae(Ke):p(Ke)}function jn(Ke){return Ke===62?(o.consume(Ke),or):p(Ke)}function or(Ke){return Ke===null||ec(Ke)?gr(Ke):zl(Ke)?(o.consume(Ke),or):p(Ke)}function gr(Ke){return Ke===45&&C===2?(o.consume(Ke),di):Ke===60&&C===1?(o.consume(Ke),Ea):Ke===62&&C===4?(o.consume(Ke),Ba):Ke===63&&C===3?(o.consume(Ke),ze):Ke===93&&C===5?(o.consume(Ke),li):ec(Ke)&&(C===6||C===7)?(o.exit("htmlFlowData"),o.check(mHn,Ts,fi)(Ke)):Ke===null||ec(Ke)?(o.exit("htmlFlowData"),fi(Ke)):(o.consume(Ke),gr)}function fi(Ke){return o.check(yHn,pi,Ts)(Ke)}function pi(Ke){return o.enter("lineEnding"),o.consume(Ke),o.exit("lineEnding"),Or}function Or(Ke){return Ke===null||ec(Ke)?fi(Ke):(o.enter("htmlFlowData"),gr(Ke))}function di(Ke){return Ke===45?(o.consume(Ke),ze):gr(Ke)}function Ea(Ke){return Ke===47?(o.consume(Ke),L="",Qi):gr(Ke)}function Qi(Ke){if(Ke===62){const xo=L.toLowerCase();return $9e.includes(xo)?(o.consume(Ke),Ba):gr(Ke)}return T6(Ke)&&L.length<8?(o.consume(Ke),L+=String.fromCharCode(Ke),Qi):gr(Ke)}function li(Ke){return Ke===93?(o.consume(Ke),ze):gr(Ke)}function ze(Ke){return Ke===62?(o.consume(Ke),Ba):Ke===45&&C===2?(o.consume(Ke),ze):gr(Ke)}function Ba(Ke){return Ke===null||ec(Ke)?(o.exit("htmlFlowData"),Ts(Ke)):(o.consume(Ke),Ba)}function Ts(Ke){return o.exit("htmlFlow"),s(Ke)}}function _Hn(o,s,p){const y=this;return C;function C(L){return ec(L)?(o.enter("lineEnding"),o.consume(L),o.exit("lineEnding"),N):p(L)}function N(L){return y.parser.lazy[y.now().line]?p(L):s(L)}}function xHn(o,s,p){return y;function y(C){return o.enter("lineEnding"),o.consume(C),o.exit("lineEnding"),o.attempt(l2t,s,p)}}const EHn={name:"htmlText",tokenize:THn};function THn(o,s,p){const y=this;let C,N,L;return z;function z(ze){return o.enter("htmlText"),o.enter("htmlTextData"),o.consume(ze),G}function G(ze){return ze===33?(o.consume(ze),q):ze===47?(o.consume(ze),pn):ze===63?(o.consume(ze),ae):T6(ze)?(o.consume(ze),er):p(ze)}function q(ze){return ze===45?(o.consume(ze),et):ze===91?(o.consume(ze),N=0,at):T6(ze)?(o.consume(ze),ie):p(ze)}function et(ze){return ze===45?(o.consume(ze),st):p(ze)}function tt(ze){return ze===null?p(ze):ze===45?(o.consume(ze),nt):ec(ze)?(L=tt,Ea(ze)):(o.consume(ze),tt)}function nt(ze){return ze===45?(o.consume(ze),st):tt(ze)}function st(ze){return ze===62?di(ze):ze===45?nt(ze):tt(ze)}function at(ze){const Ba="CDATA[";return ze===Ba.charCodeAt(N++)?(o.consume(ze),N===Ba.length?Ot:at):p(ze)}function Ot(ze){return ze===null?p(ze):ze===93?(o.consume(ze),Dt):ec(ze)?(L=Ot,Ea(ze)):(o.consume(ze),Ot)}function Dt(ze){return ze===93?(o.consume(ze),St):Ot(ze)}function St(ze){return ze===62?di(ze):ze===93?(o.consume(ze),St):Ot(ze)}function ie(ze){return ze===null||ze===62?di(ze):ec(ze)?(L=ie,Ea(ze)):(o.consume(ze),ie)}function ae(ze){return ze===null?p(ze):ze===63?(o.consume(ze),Ne):ec(ze)?(L=ae,Ea(ze)):(o.consume(ze),ae)}function Ne(ze){return ze===62?di(ze):ae(ze)}function pn(ze){return T6(ze)?(o.consume(ze),de):p(ze)}function de(ze){return ze===45||Aw(ze)?(o.consume(ze),de):cn(ze)}function cn(ze){return ec(ze)?(L=cn,Ea(ze)):zl(ze)?(o.consume(ze),cn):di(ze)}function er(ze){return ze===45||Aw(ze)?(o.consume(ze),er):ze===47||ze===62||ty(ze)?Dn(ze):p(ze)}function Dn(ze){return ze===47?(o.consume(ze),di):ze===58||ze===95||T6(ze)?(o.consume(ze),jn):ec(ze)?(L=Dn,Ea(ze)):zl(ze)?(o.consume(ze),Dn):di(ze)}function jn(ze){return ze===45||ze===46||ze===58||ze===95||Aw(ze)?(o.consume(ze),jn):or(ze)}function or(ze){return ze===61?(o.consume(ze),gr):ec(ze)?(L=or,Ea(ze)):zl(ze)?(o.consume(ze),or):Dn(ze)}function gr(ze){return ze===null||ze===60||ze===61||ze===62||ze===96?p(ze):ze===34||ze===39?(o.consume(ze),C=ze,fi):ec(ze)?(L=gr,Ea(ze)):zl(ze)?(o.consume(ze),gr):(o.consume(ze),pi)}function fi(ze){return ze===C?(o.consume(ze),C=void 0,Or):ze===null?p(ze):ec(ze)?(L=fi,Ea(ze)):(o.consume(ze),fi)}function pi(ze){return ze===null||ze===34||ze===39||ze===60||ze===61||ze===96?p(ze):ze===47||ze===62||ty(ze)?Dn(ze):(o.consume(ze),pi)}function Or(ze){return ze===47||ze===62||ty(ze)?Dn(ze):p(ze)}function di(ze){return ze===62?(o.consume(ze),o.exit("htmlTextData"),o.exit("htmlText"),s):p(ze)}function Ea(ze){return o.exit("htmlTextData"),o.enter("lineEnding"),o.consume(ze),o.exit("lineEnding"),Qi}function Qi(ze){return zl(ze)?of(o,li,"linePrefix",y.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ze):li(ze)}function li(ze){return o.enter("htmlTextData"),L(ze)}}const A$t={name:"labelEnd",resolveAll:AHn,resolveTo:IHn,tokenize:OHn},kHn={tokenize:NHn},SHn={tokenize:PHn},CHn={tokenize:LHn};function AHn(o){let s=-1;const p=[];for(;++s<o.length;){const y=o[s][1];if(p.push(o[s]),y.type==="labelImage"||y.type==="labelLink"||y.type==="labelEnd"){const C=y.type==="labelImage"?4:2;y.type="data",s+=C}}return o.length!==p.length&&O6(o,0,o.length,p),o}function IHn(o,s){let p=o.length,y=0,C,N,L,z;for(;p--;)if(C=o[p][1],N){if(C.type==="link"||C.type==="labelLink"&&C._inactive)break;o[p][0]==="enter"&&C.type==="labelLink"&&(C._inactive=!0)}else if(L){if(o[p][0]==="enter"&&(C.type==="labelImage"||C.type==="labelLink")&&!C._balanced&&(N=p,C.type!=="labelLink")){y=2;break}}else C.type==="labelEnd"&&(L=p);const G={type:o[N][1].type==="labelLink"?"link":"image",start:{...o[N][1].start},end:{...o[o.length-1][1].end}},q={type:"label",start:{...o[N][1].start},end:{...o[L][1].end}},et={type:"labelText",start:{...o[N+y+2][1].end},end:{...o[L-2][1].start}};return z=[["enter",G,s],["enter",q,s]],z=S3(z,o.slice(N+1,N+y+3)),z=S3(z,[["enter",et,s]]),z=S3(z,C$t(s.parser.constructs.insideSpan.null,o.slice(N+y+4,L-3),s)),z=S3(z,[["exit",et,s],o[L-2],o[L-1],["exit",q,s]]),z=S3(z,o.slice(L+1)),z=S3(z,[["exit",G,s]]),O6(o,N,o.length,z),o}function OHn(o,s,p){const y=this;let C=y.events.length,N,L;for(;C--;)if((y.events[C][1].type==="labelImage"||y.events[C][1].type==="labelLink")&&!y.events[C][1]._balanced){N=y.events[C][1];break}return z;function z(nt){return N?N._inactive?tt(nt):(L=y.parser.defined.includes(qF(y.sliceSerialize({start:N.end,end:y.now()}))),o.enter("labelEnd"),o.enter("labelMarker"),o.consume(nt),o.exit("labelMarker"),o.exit("labelEnd"),G):p(nt)}function G(nt){return nt===40?o.attempt(kHn,et,L?et:tt)(nt):nt===91?o.attempt(SHn,et,L?q:tt)(nt):L?et(nt):tt(nt)}function q(nt){return o.attempt(CHn,et,tt)(nt)}function et(nt){return s(nt)}function tt(nt){return N._balanced=!0,p(nt)}}function NHn(o,s,p){return y;function y(tt){return o.enter("resource"),o.enter("resourceMarker"),o.consume(tt),o.exit("resourceMarker"),C}function C(tt){return ty(tt)?LQ(o,N)(tt):N(tt)}function N(tt){return tt===41?et(tt):KNe(o,L,z,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(tt)}function L(tt){return ty(tt)?LQ(o,G)(tt):et(tt)}function z(tt){return p(tt)}function G(tt){return tt===34||tt===39||tt===40?YNe(o,q,p,"resourceTitle","resourceTitleMarker","resourceTitleString")(tt):et(tt)}function q(tt){return ty(tt)?LQ(o,et)(tt):et(tt)}function et(tt){return tt===41?(o.enter("resourceMarker"),o.consume(tt),o.exit("resourceMarker"),o.exit("resource"),s):p(tt)}}function PHn(o,s,p){const y=this;return C;function C(z){return GNe.call(y,o,N,L,"reference","referenceMarker","referenceString")(z)}function N(z){return y.parser.defined.includes(qF(y.sliceSerialize(y.events[y.events.length-1][1]).slice(1,-1)))?s(z):p(z)}function L(z){return p(z)}}function LHn(o,s,p){return y;function y(N){return o.enter("reference"),o.enter("referenceMarker"),o.consume(N),o.exit("referenceMarker"),C}function C(N){return N===93?(o.enter("referenceMarker"),o.consume(N),o.exit("referenceMarker"),o.exit("reference"),s):p(N)}}const MHn={name:"labelStartImage",resolveAll:A$t.resolveAll,tokenize:RHn};function RHn(o,s,p){const y=this;return C;function C(z){return o.enter("labelImage"),o.enter("labelImageMarker"),o.consume(z),o.exit("labelImageMarker"),N}function N(z){return z===91?(o.enter("labelMarker"),o.consume(z),o.exit("labelMarker"),o.exit("labelImage"),L):p(z)}function L(z){return z===94&&"_hiddenFootnoteSupport"in y.parser.constructs?p(z):s(z)}}const DHn={name:"labelStartLink",resolveAll:A$t.resolveAll,tokenize:BHn};function BHn(o,s,p){const y=this;return C;function C(L){return o.enter("labelLink"),o.enter("labelMarker"),o.consume(L),o.exit("labelMarker"),o.exit("labelLink"),N}function N(L){return L===94&&"_hiddenFootnoteSupport"in y.parser.constructs?p(L):s(L)}}const rBt={name:"lineEnding",tokenize:FHn};function FHn(o,s){return p;function p(y){return o.enter("lineEnding"),o.consume(y),o.exit("lineEnding"),of(o,s,"linePrefix")}}const Jbt={name:"thematicBreak",tokenize:$Hn};function $Hn(o,s,p){let y=0,C;return N;function N(q){return o.enter("thematicBreak"),L(q)}function L(q){return C=q,z(q)}function z(q){return q===C?(o.enter("thematicBreakSequence"),G(q)):y>=3&&(q===null||ec(q))?(o.exit("thematicBreak"),s(q)):p(q)}function G(q){return q===C?(o.consume(q),y++,G):(o.exit("thematicBreakSequence"),zl(q)?of(o,z,"whitespace")(q):z(q))}}const Q2={continuation:{tokenize:UHn},exit:WHn,name:"list",tokenize:zHn},jHn={partial:!0,tokenize:KHn},HHn={partial:!0,tokenize:qHn};function zHn(o,s,p){const y=this,C=y.events[y.events.length-1];let N=C&&C[1].type==="linePrefix"?C[2].sliceSerialize(C[1],!0).length:0,L=0;return z;function z(st){const at=y.containerState.type||(st===42||st===43||st===45?"listUnordered":"listOrdered");if(at==="listUnordered"?!y.containerState.marker||st===y.containerState.marker:bFt(st)){if(y.containerState.type||(y.containerState.type=at,o.enter(at,{_container:!0})),at==="listUnordered")return o.enter("listItemPrefix"),st===42||st===45?o.check(Jbt,p,q)(st):q(st);if(!y.interrupt||st===49)return o.enter("listItemPrefix"),o.enter("listItemValue"),G(st)}return p(st)}function G(st){return bFt(st)&&++L<10?(o.consume(st),G):(!y.interrupt||L<2)&&(y.containerState.marker?st===y.containerState.marker:st===41||st===46)?(o.exit("listItemValue"),q(st)):p(st)}function q(st){return o.enter("listItemMarker"),o.consume(st),o.exit("listItemMarker"),y.containerState.marker=y.containerState.marker||st,o.check(l2t,y.interrupt?p:et,o.attempt(jHn,nt,tt))}function et(st){return y.containerState.initialBlankLine=!0,N++,nt(st)}function tt(st){return zl(st)?(o.enter("listItemPrefixWhitespace"),o.consume(st),o.exit("listItemPrefixWhitespace"),nt):p(st)}function nt(st){return y.containerState.size=N+y.sliceSerialize(o.exit("listItemPrefix"),!0).length,s(st)}}function UHn(o,s,p){const y=this;return y.containerState._closeFlow=void 0,o.check(l2t,C,N);function C(z){return y.containerState.furtherBlankLines=y.containerState.furtherBlankLines||y.containerState.initialBlankLine,of(o,s,"listItemIndent",y.containerState.size+1)(z)}function N(z){return y.containerState.furtherBlankLines||!zl(z)?(y.containerState.furtherBlankLines=void 0,y.containerState.initialBlankLine=void 0,L(z)):(y.containerState.furtherBlankLines=void 0,y.containerState.initialBlankLine=void 0,o.attempt(HHn,s,L)(z))}function L(z){return y.containerState._closeFlow=!0,y.interrupt=void 0,of(o,o.attempt(Q2,s,p),"linePrefix",y.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z)}}function qHn(o,s,p){const y=this;return of(o,C,"listItemIndent",y.containerState.size+1);function C(N){const L=y.events[y.events.length-1];return L&&L[1].type==="listItemIndent"&&L[2].sliceSerialize(L[1],!0).length===y.containerState.size?s(N):p(N)}}function WHn(o){o.exit(this.containerState.type)}function KHn(o,s,p){const y=this;return of(o,C,"listItemPrefixWhitespace",y.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function C(N){const L=y.events[y.events.length-1];return!zl(N)&&L&&L[1].type==="listItemPrefixWhitespace"?s(N):p(N)}}const j9e={name:"setextUnderline",resolveTo:GHn,tokenize:YHn};function GHn(o,s){let p=o.length,y,C,N;for(;p--;)if(o[p][0]==="enter"){if(o[p][1].type==="content"){y=p;break}o[p][1].type==="paragraph"&&(C=p)}else o[p][1].type==="content"&&o.splice(p,1),!N&&o[p][1].type==="definition"&&(N=p);const L={type:"setextHeading",start:{...o[y][1].start},end:{...o[o.length-1][1].end}};return o[C][1].type="setextHeadingText",N?(o.splice(C,0,["enter",L,s]),o.splice(N+1,0,["exit",o[y][1],s]),o[y][1].end={...o[N][1].end}):o[y][1]=L,o.push(["exit",L,s]),o}function YHn(o,s,p){const y=this;let C;return N;function N(q){let et=y.events.length,tt;for(;et--;)if(y.events[et][1].type!=="lineEnding"&&y.events[et][1].type!=="linePrefix"&&y.events[et][1].type!=="content"){tt=y.events[et][1].type==="paragraph";break}return!y.parser.lazy[y.now().line]&&(y.interrupt||tt)?(o.enter("setextHeadingLine"),C=q,L(q)):p(q)}function L(q){return o.enter("setextHeadingLineSequence"),z(q)}function z(q){return q===C?(o.consume(q),z):(o.exit("setextHeadingLineSequence"),zl(q)?of(o,G,"lineSuffix")(q):G(q))}function G(q){return q===null||ec(q)?(o.exit("setextHeadingLine"),s(q)):p(q)}}const VHn={tokenize:XHn};function XHn(o){const s=this,p=o.attempt(l2t,y,o.attempt(this.parser.constructs.flowInitial,C,of(o,o.attempt(this.parser.constructs.flow,C,o.attempt(eHn,C)),"linePrefix")));return p;function y(N){if(N===null){o.consume(N);return}return o.enter("lineEndingBlank"),o.consume(N),o.exit("lineEndingBlank"),s.currentConstruct=void 0,p}function C(N){if(N===null){o.consume(N);return}return o.enter("lineEnding"),o.consume(N),o.exit("lineEnding"),s.currentConstruct=void 0,p}}const QHn={resolveAll:XNe()},JHn=VNe("string"),ZHn=VNe("text");function VNe(o){return{resolveAll:XNe(o==="text"?tzn:void 0),tokenize:s};function s(p){const y=this,C=this.parser.constructs[o],N=p.attempt(C,L,z);return L;function L(et){return q(et)?N(et):z(et)}function z(et){if(et===null){p.consume(et);return}return p.enter("data"),p.consume(et),G}function G(et){return q(et)?(p.exit("data"),N(et)):(p.consume(et),G)}function q(et){if(et===null)return!0;const tt=C[et];let nt=-1;if(tt)for(;++nt<tt.length;){const st=tt[nt];if(!st.previous||st.previous.call(y,y.previous))return!0}return!1}}}function XNe(o){return s;function s(p,y){let C=-1,N;for(;++C<=p.length;)N===void 0?p[C]&&p[C][1].type==="data"&&(N=C,C++):(!p[C]||p[C][1].type!=="data")&&(C!==N+2&&(p[N][1].end=p[C-1][1].end,p.splice(N+2,C-N-2),C=N+2),N=void 0);return o?o(p,y):p}}function tzn(o,s){let p=0;for(;++p<=o.length;)if((p===o.length||o[p][1].type==="lineEnding")&&o[p-1][1].type==="data"){const y=o[p-1][1],C=s.sliceStream(y);let N=C.length,L=-1,z=0,G;for(;N--;){const q=C[N];if(typeof q=="string"){for(L=q.length;q.charCodeAt(L-1)===32;)z++,L--;if(L)break;L=-1}else if(q===-2)G=!0,z++;else if(q!==-1){N++;break}}if(s._contentTypeTextTrailing&&p===o.length&&(z=0),z){const q={type:p===o.length||G||z<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:N?L:y.start._bufferIndex+L,_index:y.start._index+N,line:y.end.line,column:y.end.column-z,offset:y.end.offset-z},end:{...y.end}};y.end={...q.start},y.start.offset===y.end.offset?Object.assign(y,q):(o.splice(p,0,["enter",q,s],["exit",q,s]),p+=2)}p++}return o}const ezn={42:Q2,43:Q2,45:Q2,48:Q2,49:Q2,50:Q2,51:Q2,52:Q2,53:Q2,54:Q2,55:Q2,56:Q2,57:Q2,62:zNe},nzn={91:sHn},rzn={[-2]:nBt,[-1]:nBt,32:nBt},izn={35:fHn,42:Jbt,45:[j9e,Jbt],60:bHn,61:j9e,95:Jbt,96:F9e,126:F9e},azn={38:qNe,92:UNe},szn={[-5]:rBt,[-4]:rBt,[-3]:rBt,33:MHn,38:qNe,42:mFt,60:[Djn,EHn],91:DHn,92:[lHn,UNe],93:A$t,95:mFt,96:Vjn},ozn={null:[mFt,QHn]},czn={null:[42,95]},uzn={null:[]},lzn=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:czn,contentInitial:nzn,disable:uzn,document:ezn,flow:izn,flowInitial:rzn,insideSpan:ozn,string:azn,text:szn},Symbol.toStringTag,{value:"Module"}));function hzn(o,s,p){let y={_bufferIndex:-1,_index:0,line:p&&p.line||1,column:p&&p.column||1,offset:p&&p.offset||0};const C={},N=[];let L=[],z=[];const G={attempt:cn(pn),check:cn(de),consume:ie,enter:ae,exit:Ne,interrupt:cn(de,{interrupt:!0})},q={code:null,containerState:{},defineSkip:Ot,events:[],now:at,parser:o,previous:null,sliceSerialize:nt,sliceStream:st,write:tt};let et=s.tokenize.call(q,G);return s.resolveAll&&N.push(s),q;function tt(or){return L=S3(L,or),Dt(),L[L.length-1]!==null?[]:(er(s,0),q.events=C$t(N,q.events,q),q.events)}function nt(or,gr){return dzn(st(or),gr)}function st(or){return fzn(L,or)}function at(){const{_bufferIndex:or,_index:gr,line:fi,column:pi,offset:Or}=y;return{_bufferIndex:or,_index:gr,line:fi,column:pi,offset:Or}}function Ot(or){C[or.line]=or.column,jn()}function Dt(){let or;for(;y._index<L.length;){const gr=L[y._index];if(typeof gr=="string")for(or=y._index,y._bufferIndex<0&&(y._bufferIndex=0);y._index===or&&y._bufferIndex<gr.length;)St(gr.charCodeAt(y._bufferIndex));else St(gr)}}function St(or){et=et(or)}function ie(or){ec(or)?(y.line++,y.column=1,y.offset+=or===-3?2:1,jn()):or!==-1&&(y.column++,y.offset++),y._bufferIndex<0?y._index++:(y._bufferIndex++,y._bufferIndex===L[y._index].length&&(y._bufferIndex=-1,y._index++)),q.previous=or}function ae(or,gr){const fi=gr||{};return fi.type=or,fi.start=at(),q.events.push(["enter",fi,q]),z.push(fi),fi}function Ne(or){const gr=z.pop();return gr.end=at(),q.events.push(["exit",gr,q]),gr}function pn(or,gr){er(or,gr.from)}function de(or,gr){gr.restore()}function cn(or,gr){return fi;function fi(pi,Or,di){let Ea,Qi,li,ze;return Array.isArray(pi)?Ts(pi):"tokenize"in pi?Ts([pi]):Ba(pi);function Ba(Pa){return zo;function zo($u){const gu=$u!==null&&Pa[$u],Ds=$u!==null&&Pa.null,pc=[...Array.isArray(gu)?gu:gu?[gu]:[],...Array.isArray(Ds)?Ds:Ds?[Ds]:[]];return Ts(pc)($u)}}function Ts(Pa){return Ea=Pa,Qi=0,Pa.length===0?di:Ke(Pa[Qi])}function Ke(Pa){return zo;function zo($u){return ze=Dn(),li=Pa,Pa.partial||(q.currentConstruct=Pa),Pa.name&&q.parser.constructs.disable.null.includes(Pa.name)?Ss():Pa.tokenize.call(gr?Object.assign(Object.create(q),gr):q,G,xo,Ss)($u)}}function xo(Pa){return or(li,ze),Or}function Ss(Pa){return ze.restore(),++Qi<Ea.length?Ke(Ea[Qi]):di}}}function er(or,gr){or.resolveAll&&!N.includes(or)&&N.push(or),or.resolve&&O6(q.events,gr,q.events.length-gr,or.resolve(q.events.slice(gr),q)),or.resolveTo&&(q.events=or.resolveTo(q.events,q))}function Dn(){const or=at(),gr=q.previous,fi=q.currentConstruct,pi=q.events.length,Or=Array.from(z);return{from:pi,restore:di};function di(){y=or,q.previous=gr,q.currentConstruct=fi,q.events.length=pi,z=Or,jn()}}function jn(){y.line in C&&y.column<2&&(y.column=C[y.line],y.offset+=C[y.line]-1)}}function fzn(o,s){const p=s.start._index,y=s.start._bufferIndex,C=s.end._index,N=s.end._bufferIndex;let L;if(p===C)L=[o[p].slice(y,N)];else{if(L=o.slice(p,C),y>-1){const z=L[0];typeof z=="string"?L[0]=z.slice(y):L.shift()}N>0&&L.push(o[C].slice(0,N))}return L}function dzn(o,s){let p=-1;const y=[];let C;for(;++p<o.length;){const N=o[p];let L;if(typeof N=="string")L=N;else switch(N){case-5:{L="\r";break}case-4:{L=`
|
|
1843
1846
|
`;break}case-3:{L=`\r
|
|
1844
|
-
`;break}case-2:{L=s?" ":" ";break}case-1:{if(!s&&C)continue;L=" ";break}default:L=String.fromCharCode(N)}C=N===-2,y.push(L)}return y.join("")}function dzn(o){const y={constructs:vjn([uzn,...(o||{}).extensions||[]]),content:C(Ajn),defined:[],document:C(Ojn),flow:C(YHn),lazy:{},string:C(QHn),text:C(JHn)};return y;function C(N){return L;function L(z){return lzn(y,N,z)}}}function pzn(o){for(;!WNe(o););return o}const H9e=/[\0\t\n\r]/g;function gzn(){let o=1,s="",p=!0,y;return C;function C(N,L,z){const G=[];let q,et,tt,nt,st;for(N=s+(typeof N=="string"?N.toString():new TextDecoder(L||void 0).decode(N)),tt=0,s="",p&&(N.charCodeAt(0)===65279&&tt++,p=void 0);tt<N.length;){if(H9e.lastIndex=tt,q=H9e.exec(N),nt=q&&q.index!==void 0?q.index:N.length,st=N.charCodeAt(nt),!q){s=N.slice(tt);break}if(st===10&&tt===nt&&y)G.push(-3),y=void 0;else switch(y&&(G.push(-5),y=void 0),tt<nt&&(G.push(N.slice(tt,nt)),o+=nt-tt),st){case 0:{G.push(65533),o++;break}case 9:{for(et=Math.ceil(o/4)*4,G.push(-2);o++<et;)G.push(-1);break}case 10:{G.push(-4),o=1;break}default:y=!0,o=1}tt=nt+1}return z&&(y&&G.push(-5),s&&G.push(s),G.push(null)),G}}const bzn=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function mzn(o){return o.replace(bzn,yzn)}function yzn(o,s,p){if(s)return s;if(p.charCodeAt(0)===35){const C=p.charCodeAt(1),N=C===120||C===88;return HNe(p.slice(N?2:1),N?16:10)}return S$t(p)||o}const QNe={}.hasOwnProperty;function wzn(o,s,p){return typeof s!="string"&&(p=s,s=void 0),vzn(p)(pzn(dzn(p).document().write(gzn()(o,s,!0))))}function vzn(o){const s={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:N(iy),autolinkProtocol:Dn,autolinkEmail:Dn,atxHeading:N(Rh),blockQuote:N(Ds),characterEscape:Dn,characterReference:Dn,codeFenced:N(pc),codeFencedFenceInfo:L,codeFencedFenceMeta:L,codeIndented:N(pc,L),codeText:N(bu,L),codeTextData:Dn,data:Dn,codeFlowValue:Dn,definition:N(P1),definitionDestinationString:L,definitionLabelString:L,definitionTitleString:L,emphasis:N(il),hardBreakEscape:N(Mg),hardBreakTrailing:N(Mg),htmlFlow:N(Rg,L),htmlFlowData:Dn,htmlText:N(Rg,L),htmlTextData:Dn,image:N(Dg),label:L,link:N(iy),listItem:N(wd),listItemValue:nt,listOrdered:N(Yp,tt),listUnordered:N(Yp),paragraph:N(Vp),reference:Ke,referenceString:L,resourceDestinationString:L,resourceTitleString:L,setextHeading:N(Rh),strong:N(Iw),thematicBreak:N(R3)},exit:{atxHeading:G(),atxHeadingSequence:pn,autolink:G(),autolinkEmail:gu,autolinkProtocol:$u,blockQuote:G(),characterEscapeValue:jn,characterReferenceMarkerHexadecimal:Ss,characterReferenceMarkerNumeric:Ss,characterReferenceValue:Pa,characterReference:zo,codeFenced:G(Dt),codeFencedFence:Ot,codeFencedFenceInfo:st,codeFencedFenceMeta:at,codeFlowValue:jn,codeIndented:G(St),codeText:G(Or),codeTextData:jn,data:jn,definition:G(),definitionDestinationString:Ne,definitionLabelString:ie,definitionTitleString:ae,emphasis:G(),hardBreakEscape:G(gr),hardBreakTrailing:G(gr),htmlFlow:G(fi),htmlFlowData:jn,htmlText:G(pi),htmlTextData:jn,image:G(Ea),label:li,labelText:Qi,lineEnding:or,link:G(di),listItem:G(),listOrdered:G(),listUnordered:G(),paragraph:G(),referenceString:xo,resourceDestinationString:ze,resourceTitleString:Ba,resource:Ts,setextHeading:G(er),setextHeadingLineSequence:cn,setextHeadingText:de,strong:G(),thematicBreak:G()}};JNe(s,(o||{}).mdastExtensions||[]);const p={};return y;function y(Hr){let da={type:"root",children:[]};const Ws={stack:[da],tokenStack:[],config:s,enter:z,exit:q,buffer:L,resume:et,data:p},gc=[];let Cu=-1;for(;++Cu<Hr.length;)if(Hr[Cu][1].type==="listOrdered"||Hr[Cu][1].type==="listUnordered")if(Hr[Cu][0]==="enter")gc.push(Cu);else{const su=gc.pop();Cu=C(Hr,su,Cu)}for(Cu=-1;++Cu<Hr.length;){const su=s[Hr[Cu][0]];QNe.call(su,Hr[Cu][1].type)&&su[Hr[Cu][1].type].call(Object.assign({sliceSerialize:Hr[Cu][2].sliceSerialize},Ws),Hr[Cu][1])}if(Ws.tokenStack.length>0){const su=Ws.tokenStack[Ws.tokenStack.length-1];(su[1]||z9e).call(Ws,void 0,su[0])}for(da.position={start:iC(Hr.length>0?Hr[0][1].start:{line:1,column:1,offset:0}),end:iC(Hr.length>0?Hr[Hr.length-2][1].end:{line:1,column:1,offset:0})},Cu=-1;++Cu<s.transforms.length;)da=s.transforms[Cu](da)||da;return da}function C(Hr,da,Ws){let gc=da-1,Cu=-1,su=!1,Bg,d0,o5,Ns;for(;++gc<=Ws;){const zc=Hr[gc];switch(zc[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{zc[0]==="enter"?Cu++:Cu--,Ns=void 0;break}case"lineEndingBlank":{zc[0]==="enter"&&(Bg&&!Ns&&!Cu&&!o5&&(o5=gc),Ns=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ns=void 0}if(!Cu&&zc[0]==="enter"&&zc[1].type==="listItemPrefix"||Cu===-1&&zc[0]==="exit"&&(zc[1].type==="listUnordered"||zc[1].type==="listOrdered")){if(Bg){let Dh=gc;for(d0=void 0;Dh--;){const ap=Hr[Dh];if(ap[1].type==="lineEnding"||ap[1].type==="lineEndingBlank"){if(ap[0]==="exit")continue;d0&&(Hr[d0][1].type="lineEndingBlank",su=!0),ap[1].type="lineEnding",d0=Dh}else if(!(ap[1].type==="linePrefix"||ap[1].type==="blockQuotePrefix"||ap[1].type==="blockQuotePrefixWhitespace"||ap[1].type==="blockQuoteMarker"||ap[1].type==="listItemIndent"))break}o5&&(!d0||o5<d0)&&(Bg._spread=!0),Bg.end=Object.assign({},d0?Hr[d0][1].start:zc[1].end),Hr.splice(d0||gc,0,["exit",Bg,zc[2]]),gc++,Ws++}if(zc[1].type==="listItemPrefix"){const Dh={type:"listItem",_spread:!1,start:Object.assign({},zc[1].start),end:void 0};Bg=Dh,Hr.splice(gc,0,["enter",Dh,zc[2]]),gc++,Ws++,o5=void 0,Ns=!0}}}return Hr[da][1]._spread=su,Ws}function N(Hr,da){return Ws;function Ws(gc){z.call(this,Hr(gc),gc),da&&da.call(this,gc)}}function L(){this.stack.push({type:"fragment",children:[]})}function z(Hr,da,Ws){this.stack[this.stack.length-1].children.push(Hr),this.stack.push(Hr),this.tokenStack.push([da,Ws||void 0]),Hr.position={start:iC(da.start),end:void 0}}function G(Hr){return da;function da(Ws){Hr&&Hr.call(this,Ws),q.call(this,Ws)}}function q(Hr,da){const Ws=this.stack.pop(),gc=this.tokenStack.pop();if(gc)gc[0].type!==Hr.type&&(da?da.call(this,Hr,gc[0]):(gc[1]||z9e).call(this,Hr,gc[0]));else throw new Error("Cannot close `"+Hr.type+"` ("+PQ({start:Hr.start,end:Hr.end})+"): it’s not open");Ws.position.end=iC(Hr.end)}function et(){return yjn(this.stack.pop())}function tt(){this.data.expectingFirstListItemValue=!0}function nt(Hr){if(this.data.expectingFirstListItemValue){const da=this.stack[this.stack.length-2];da.start=Number.parseInt(this.sliceSerialize(Hr),10),this.data.expectingFirstListItemValue=void 0}}function st(){const Hr=this.resume(),da=this.stack[this.stack.length-1];da.lang=Hr}function at(){const Hr=this.resume(),da=this.stack[this.stack.length-1];da.meta=Hr}function Ot(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function Dt(){const Hr=this.resume(),da=this.stack[this.stack.length-1];da.value=Hr.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function St(){const Hr=this.resume(),da=this.stack[this.stack.length-1];da.value=Hr.replace(/(\r?\n|\r)$/g,"")}function ie(Hr){const da=this.resume(),Ws=this.stack[this.stack.length-1];Ws.label=da,Ws.identifier=qF(this.sliceSerialize(Hr)).toLowerCase()}function ae(){const Hr=this.resume(),da=this.stack[this.stack.length-1];da.title=Hr}function Ne(){const Hr=this.resume(),da=this.stack[this.stack.length-1];da.url=Hr}function pn(Hr){const da=this.stack[this.stack.length-1];if(!da.depth){const Ws=this.sliceSerialize(Hr).length;da.depth=Ws}}function de(){this.data.setextHeadingSlurpLineEnding=!0}function cn(Hr){const da=this.stack[this.stack.length-1];da.depth=this.sliceSerialize(Hr).codePointAt(0)===61?1:2}function er(){this.data.setextHeadingSlurpLineEnding=void 0}function Dn(Hr){const Ws=this.stack[this.stack.length-1].children;let gc=Ws[Ws.length-1];(!gc||gc.type!=="text")&&(gc=Jd(),gc.position={start:iC(Hr.start),end:void 0},Ws.push(gc)),this.stack.push(gc)}function jn(Hr){const da=this.stack.pop();da.value+=this.sliceSerialize(Hr),da.position.end=iC(Hr.end)}function or(Hr){const da=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ws=da.children[da.children.length-1];Ws.position.end=iC(Hr.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&s.canContainEols.includes(da.type)&&(Dn.call(this,Hr),jn.call(this,Hr))}function gr(){this.data.atHardBreak=!0}function fi(){const Hr=this.resume(),da=this.stack[this.stack.length-1];da.value=Hr}function pi(){const Hr=this.resume(),da=this.stack[this.stack.length-1];da.value=Hr}function Or(){const Hr=this.resume(),da=this.stack[this.stack.length-1];da.value=Hr}function di(){const Hr=this.stack[this.stack.length-1];if(this.data.inReference){const da=this.data.referenceType||"shortcut";Hr.type+="Reference",Hr.referenceType=da,delete Hr.url,delete Hr.title}else delete Hr.identifier,delete Hr.label;this.data.referenceType=void 0}function Ea(){const Hr=this.stack[this.stack.length-1];if(this.data.inReference){const da=this.data.referenceType||"shortcut";Hr.type+="Reference",Hr.referenceType=da,delete Hr.url,delete Hr.title}else delete Hr.identifier,delete Hr.label;this.data.referenceType=void 0}function Qi(Hr){const da=this.sliceSerialize(Hr),Ws=this.stack[this.stack.length-2];Ws.label=mzn(da),Ws.identifier=qF(da).toLowerCase()}function li(){const Hr=this.stack[this.stack.length-1],da=this.resume(),Ws=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ws.type==="link"){const gc=Hr.children;Ws.children=gc}else Ws.alt=da}function ze(){const Hr=this.resume(),da=this.stack[this.stack.length-1];da.url=Hr}function Ba(){const Hr=this.resume(),da=this.stack[this.stack.length-1];da.title=Hr}function Ts(){this.data.inReference=void 0}function Ke(){this.data.referenceType="collapsed"}function xo(Hr){const da=this.resume(),Ws=this.stack[this.stack.length-1];Ws.label=da,Ws.identifier=qF(this.sliceSerialize(Hr)).toLowerCase(),this.data.referenceType="full"}function Ss(Hr){this.data.characterReferenceType=Hr.type}function Pa(Hr){const da=this.sliceSerialize(Hr),Ws=this.data.characterReferenceType;let gc;Ws?(gc=HNe(da,Ws==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):gc=S$t(da);const Cu=this.stack[this.stack.length-1];Cu.value+=gc}function zo(Hr){const da=this.stack.pop();da.position.end=iC(Hr.end)}function $u(Hr){jn.call(this,Hr);const da=this.stack[this.stack.length-1];da.url=this.sliceSerialize(Hr)}function gu(Hr){jn.call(this,Hr);const da=this.stack[this.stack.length-1];da.url="mailto:"+this.sliceSerialize(Hr)}function Ds(){return{type:"blockquote",children:[]}}function pc(){return{type:"code",lang:null,meta:null,value:""}}function bu(){return{type:"inlineCode",value:""}}function P1(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function il(){return{type:"emphasis",children:[]}}function Rh(){return{type:"heading",depth:0,children:[]}}function Mg(){return{type:"break"}}function Rg(){return{type:"html",value:""}}function Dg(){return{type:"image",title:null,url:"",alt:null}}function iy(){return{type:"link",title:null,url:"",children:[]}}function Yp(Hr){return{type:"list",ordered:Hr.type==="listOrdered",start:null,spread:Hr._spread,children:[]}}function wd(Hr){return{type:"listItem",spread:Hr._spread,checked:null,children:[]}}function Vp(){return{type:"paragraph",children:[]}}function Iw(){return{type:"strong",children:[]}}function Jd(){return{type:"text",value:""}}function R3(){return{type:"thematicBreak"}}}function iC(o){return{line:o.line,column:o.column,offset:o.offset}}function JNe(o,s){let p=-1;for(;++p<s.length;){const y=s[p];Array.isArray(y)?JNe(o,y):_zn(o,y)}}function _zn(o,s){let p;for(p in s)if(QNe.call(s,p))switch(p){case"canContainEols":{const y=s[p];y&&o[p].push(...y);break}case"transforms":{const y=s[p];y&&o[p].push(...y);break}case"enter":case"exit":{const y=s[p];y&&Object.assign(o[p],y);break}}}function z9e(o,s){throw o?new Error("Cannot close `"+o.type+"` ("+PQ({start:o.start,end:o.end})+"): a different token (`"+s.type+"`, "+PQ({start:s.start,end:s.end})+") is open"):new Error("Cannot close document, a token (`"+s.type+"`, "+PQ({start:s.start,end:s.end})+") is still open")}function xzn(o){const s=this;s.parser=p;function p(y){return wzn(y,{...s.data("settings"),...o,extensions:s.data("micromarkExtensions")||[],mdastExtensions:s.data("fromMarkdownExtensions")||[]})}}function Ezn(o,s){const p={type:"element",tagName:"blockquote",properties:{},children:o.wrap(o.all(s),!0)};return o.patch(s,p),o.applyData(s,p)}function Tzn(o,s){const p={type:"element",tagName:"br",properties:{},children:[]};return o.patch(s,p),[o.applyData(s,p),{type:"text",value:`
|
|
1845
|
-
`}]}function
|
|
1846
|
-
`:"",y={};s.lang&&(y.className=["language-"+s.lang]);let C={type:"element",tagName:"code",properties:y,children:[{type:"text",value:p}]};return s.meta&&(C.data={meta:s.meta}),o.patch(s,C),C=o.applyData(s,C),C={type:"element",tagName:"pre",properties:{},children:[C]},o.patch(s,C),C}function
|
|
1847
|
+
`;break}case-2:{L=s?" ":" ";break}case-1:{if(!s&&C)continue;L=" ";break}default:L=String.fromCharCode(N)}C=N===-2,y.push(L)}return y.join("")}function pzn(o){const y={constructs:_jn([lzn,...(o||{}).extensions||[]]),content:C(Ijn),defined:[],document:C(Njn),flow:C(VHn),lazy:{},string:C(JHn),text:C(ZHn)};return y;function C(N){return L;function L(z){return hzn(y,N,z)}}}function gzn(o){for(;!WNe(o););return o}const H9e=/[\0\t\n\r]/g;function bzn(){let o=1,s="",p=!0,y;return C;function C(N,L,z){const G=[];let q,et,tt,nt,st;for(N=s+(typeof N=="string"?N.toString():new TextDecoder(L||void 0).decode(N)),tt=0,s="",p&&(N.charCodeAt(0)===65279&&tt++,p=void 0);tt<N.length;){if(H9e.lastIndex=tt,q=H9e.exec(N),nt=q&&q.index!==void 0?q.index:N.length,st=N.charCodeAt(nt),!q){s=N.slice(tt);break}if(st===10&&tt===nt&&y)G.push(-3),y=void 0;else switch(y&&(G.push(-5),y=void 0),tt<nt&&(G.push(N.slice(tt,nt)),o+=nt-tt),st){case 0:{G.push(65533),o++;break}case 9:{for(et=Math.ceil(o/4)*4,G.push(-2);o++<et;)G.push(-1);break}case 10:{G.push(-4),o=1;break}default:y=!0,o=1}tt=nt+1}return z&&(y&&G.push(-5),s&&G.push(s),G.push(null)),G}}const mzn=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function yzn(o){return o.replace(mzn,wzn)}function wzn(o,s,p){if(s)return s;if(p.charCodeAt(0)===35){const C=p.charCodeAt(1),N=C===120||C===88;return HNe(p.slice(N?2:1),N?16:10)}return S$t(p)||o}const QNe={}.hasOwnProperty;function vzn(o,s,p){return typeof s!="string"&&(p=s,s=void 0),_zn(p)(gzn(pzn(p).document().write(bzn()(o,s,!0))))}function _zn(o){const s={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:N(iy),autolinkProtocol:Dn,autolinkEmail:Dn,atxHeading:N(Rh),blockQuote:N(Ds),characterEscape:Dn,characterReference:Dn,codeFenced:N(pc),codeFencedFenceInfo:L,codeFencedFenceMeta:L,codeIndented:N(pc,L),codeText:N(bu,L),codeTextData:Dn,data:Dn,codeFlowValue:Dn,definition:N(P1),definitionDestinationString:L,definitionLabelString:L,definitionTitleString:L,emphasis:N(il),hardBreakEscape:N(Mg),hardBreakTrailing:N(Mg),htmlFlow:N(Rg,L),htmlFlowData:Dn,htmlText:N(Rg,L),htmlTextData:Dn,image:N(Dg),label:L,link:N(iy),listItem:N(wd),listItemValue:nt,listOrdered:N(Yp,tt),listUnordered:N(Yp),paragraph:N(Vp),reference:Ke,referenceString:L,resourceDestinationString:L,resourceTitleString:L,setextHeading:N(Rh),strong:N(Iw),thematicBreak:N(R3)},exit:{atxHeading:G(),atxHeadingSequence:pn,autolink:G(),autolinkEmail:gu,autolinkProtocol:$u,blockQuote:G(),characterEscapeValue:jn,characterReferenceMarkerHexadecimal:Ss,characterReferenceMarkerNumeric:Ss,characterReferenceValue:Pa,characterReference:zo,codeFenced:G(Dt),codeFencedFence:Ot,codeFencedFenceInfo:st,codeFencedFenceMeta:at,codeFlowValue:jn,codeIndented:G(St),codeText:G(Or),codeTextData:jn,data:jn,definition:G(),definitionDestinationString:Ne,definitionLabelString:ie,definitionTitleString:ae,emphasis:G(),hardBreakEscape:G(gr),hardBreakTrailing:G(gr),htmlFlow:G(fi),htmlFlowData:jn,htmlText:G(pi),htmlTextData:jn,image:G(Ea),label:li,labelText:Qi,lineEnding:or,link:G(di),listItem:G(),listOrdered:G(),listUnordered:G(),paragraph:G(),referenceString:xo,resourceDestinationString:ze,resourceTitleString:Ba,resource:Ts,setextHeading:G(er),setextHeadingLineSequence:cn,setextHeadingText:de,strong:G(),thematicBreak:G()}};JNe(s,(o||{}).mdastExtensions||[]);const p={};return y;function y(Hr){let da={type:"root",children:[]};const Ws={stack:[da],tokenStack:[],config:s,enter:z,exit:q,buffer:L,resume:et,data:p},gc=[];let Cu=-1;for(;++Cu<Hr.length;)if(Hr[Cu][1].type==="listOrdered"||Hr[Cu][1].type==="listUnordered")if(Hr[Cu][0]==="enter")gc.push(Cu);else{const su=gc.pop();Cu=C(Hr,su,Cu)}for(Cu=-1;++Cu<Hr.length;){const su=s[Hr[Cu][0]];QNe.call(su,Hr[Cu][1].type)&&su[Hr[Cu][1].type].call(Object.assign({sliceSerialize:Hr[Cu][2].sliceSerialize},Ws),Hr[Cu][1])}if(Ws.tokenStack.length>0){const su=Ws.tokenStack[Ws.tokenStack.length-1];(su[1]||z9e).call(Ws,void 0,su[0])}for(da.position={start:iC(Hr.length>0?Hr[0][1].start:{line:1,column:1,offset:0}),end:iC(Hr.length>0?Hr[Hr.length-2][1].end:{line:1,column:1,offset:0})},Cu=-1;++Cu<s.transforms.length;)da=s.transforms[Cu](da)||da;return da}function C(Hr,da,Ws){let gc=da-1,Cu=-1,su=!1,Bg,d0,o5,Ns;for(;++gc<=Ws;){const zc=Hr[gc];switch(zc[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{zc[0]==="enter"?Cu++:Cu--,Ns=void 0;break}case"lineEndingBlank":{zc[0]==="enter"&&(Bg&&!Ns&&!Cu&&!o5&&(o5=gc),Ns=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ns=void 0}if(!Cu&&zc[0]==="enter"&&zc[1].type==="listItemPrefix"||Cu===-1&&zc[0]==="exit"&&(zc[1].type==="listUnordered"||zc[1].type==="listOrdered")){if(Bg){let Dh=gc;for(d0=void 0;Dh--;){const ap=Hr[Dh];if(ap[1].type==="lineEnding"||ap[1].type==="lineEndingBlank"){if(ap[0]==="exit")continue;d0&&(Hr[d0][1].type="lineEndingBlank",su=!0),ap[1].type="lineEnding",d0=Dh}else if(!(ap[1].type==="linePrefix"||ap[1].type==="blockQuotePrefix"||ap[1].type==="blockQuotePrefixWhitespace"||ap[1].type==="blockQuoteMarker"||ap[1].type==="listItemIndent"))break}o5&&(!d0||o5<d0)&&(Bg._spread=!0),Bg.end=Object.assign({},d0?Hr[d0][1].start:zc[1].end),Hr.splice(d0||gc,0,["exit",Bg,zc[2]]),gc++,Ws++}if(zc[1].type==="listItemPrefix"){const Dh={type:"listItem",_spread:!1,start:Object.assign({},zc[1].start),end:void 0};Bg=Dh,Hr.splice(gc,0,["enter",Dh,zc[2]]),gc++,Ws++,o5=void 0,Ns=!0}}}return Hr[da][1]._spread=su,Ws}function N(Hr,da){return Ws;function Ws(gc){z.call(this,Hr(gc),gc),da&&da.call(this,gc)}}function L(){this.stack.push({type:"fragment",children:[]})}function z(Hr,da,Ws){this.stack[this.stack.length-1].children.push(Hr),this.stack.push(Hr),this.tokenStack.push([da,Ws||void 0]),Hr.position={start:iC(da.start),end:void 0}}function G(Hr){return da;function da(Ws){Hr&&Hr.call(this,Ws),q.call(this,Ws)}}function q(Hr,da){const Ws=this.stack.pop(),gc=this.tokenStack.pop();if(gc)gc[0].type!==Hr.type&&(da?da.call(this,Hr,gc[0]):(gc[1]||z9e).call(this,Hr,gc[0]));else throw new Error("Cannot close `"+Hr.type+"` ("+PQ({start:Hr.start,end:Hr.end})+"): it’s not open");Ws.position.end=iC(Hr.end)}function et(){return wjn(this.stack.pop())}function tt(){this.data.expectingFirstListItemValue=!0}function nt(Hr){if(this.data.expectingFirstListItemValue){const da=this.stack[this.stack.length-2];da.start=Number.parseInt(this.sliceSerialize(Hr),10),this.data.expectingFirstListItemValue=void 0}}function st(){const Hr=this.resume(),da=this.stack[this.stack.length-1];da.lang=Hr}function at(){const Hr=this.resume(),da=this.stack[this.stack.length-1];da.meta=Hr}function Ot(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function Dt(){const Hr=this.resume(),da=this.stack[this.stack.length-1];da.value=Hr.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function St(){const Hr=this.resume(),da=this.stack[this.stack.length-1];da.value=Hr.replace(/(\r?\n|\r)$/g,"")}function ie(Hr){const da=this.resume(),Ws=this.stack[this.stack.length-1];Ws.label=da,Ws.identifier=qF(this.sliceSerialize(Hr)).toLowerCase()}function ae(){const Hr=this.resume(),da=this.stack[this.stack.length-1];da.title=Hr}function Ne(){const Hr=this.resume(),da=this.stack[this.stack.length-1];da.url=Hr}function pn(Hr){const da=this.stack[this.stack.length-1];if(!da.depth){const Ws=this.sliceSerialize(Hr).length;da.depth=Ws}}function de(){this.data.setextHeadingSlurpLineEnding=!0}function cn(Hr){const da=this.stack[this.stack.length-1];da.depth=this.sliceSerialize(Hr).codePointAt(0)===61?1:2}function er(){this.data.setextHeadingSlurpLineEnding=void 0}function Dn(Hr){const Ws=this.stack[this.stack.length-1].children;let gc=Ws[Ws.length-1];(!gc||gc.type!=="text")&&(gc=Jd(),gc.position={start:iC(Hr.start),end:void 0},Ws.push(gc)),this.stack.push(gc)}function jn(Hr){const da=this.stack.pop();da.value+=this.sliceSerialize(Hr),da.position.end=iC(Hr.end)}function or(Hr){const da=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ws=da.children[da.children.length-1];Ws.position.end=iC(Hr.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&s.canContainEols.includes(da.type)&&(Dn.call(this,Hr),jn.call(this,Hr))}function gr(){this.data.atHardBreak=!0}function fi(){const Hr=this.resume(),da=this.stack[this.stack.length-1];da.value=Hr}function pi(){const Hr=this.resume(),da=this.stack[this.stack.length-1];da.value=Hr}function Or(){const Hr=this.resume(),da=this.stack[this.stack.length-1];da.value=Hr}function di(){const Hr=this.stack[this.stack.length-1];if(this.data.inReference){const da=this.data.referenceType||"shortcut";Hr.type+="Reference",Hr.referenceType=da,delete Hr.url,delete Hr.title}else delete Hr.identifier,delete Hr.label;this.data.referenceType=void 0}function Ea(){const Hr=this.stack[this.stack.length-1];if(this.data.inReference){const da=this.data.referenceType||"shortcut";Hr.type+="Reference",Hr.referenceType=da,delete Hr.url,delete Hr.title}else delete Hr.identifier,delete Hr.label;this.data.referenceType=void 0}function Qi(Hr){const da=this.sliceSerialize(Hr),Ws=this.stack[this.stack.length-2];Ws.label=yzn(da),Ws.identifier=qF(da).toLowerCase()}function li(){const Hr=this.stack[this.stack.length-1],da=this.resume(),Ws=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ws.type==="link"){const gc=Hr.children;Ws.children=gc}else Ws.alt=da}function ze(){const Hr=this.resume(),da=this.stack[this.stack.length-1];da.url=Hr}function Ba(){const Hr=this.resume(),da=this.stack[this.stack.length-1];da.title=Hr}function Ts(){this.data.inReference=void 0}function Ke(){this.data.referenceType="collapsed"}function xo(Hr){const da=this.resume(),Ws=this.stack[this.stack.length-1];Ws.label=da,Ws.identifier=qF(this.sliceSerialize(Hr)).toLowerCase(),this.data.referenceType="full"}function Ss(Hr){this.data.characterReferenceType=Hr.type}function Pa(Hr){const da=this.sliceSerialize(Hr),Ws=this.data.characterReferenceType;let gc;Ws?(gc=HNe(da,Ws==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):gc=S$t(da);const Cu=this.stack[this.stack.length-1];Cu.value+=gc}function zo(Hr){const da=this.stack.pop();da.position.end=iC(Hr.end)}function $u(Hr){jn.call(this,Hr);const da=this.stack[this.stack.length-1];da.url=this.sliceSerialize(Hr)}function gu(Hr){jn.call(this,Hr);const da=this.stack[this.stack.length-1];da.url="mailto:"+this.sliceSerialize(Hr)}function Ds(){return{type:"blockquote",children:[]}}function pc(){return{type:"code",lang:null,meta:null,value:""}}function bu(){return{type:"inlineCode",value:""}}function P1(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function il(){return{type:"emphasis",children:[]}}function Rh(){return{type:"heading",depth:0,children:[]}}function Mg(){return{type:"break"}}function Rg(){return{type:"html",value:""}}function Dg(){return{type:"image",title:null,url:"",alt:null}}function iy(){return{type:"link",title:null,url:"",children:[]}}function Yp(Hr){return{type:"list",ordered:Hr.type==="listOrdered",start:null,spread:Hr._spread,children:[]}}function wd(Hr){return{type:"listItem",spread:Hr._spread,checked:null,children:[]}}function Vp(){return{type:"paragraph",children:[]}}function Iw(){return{type:"strong",children:[]}}function Jd(){return{type:"text",value:""}}function R3(){return{type:"thematicBreak"}}}function iC(o){return{line:o.line,column:o.column,offset:o.offset}}function JNe(o,s){let p=-1;for(;++p<s.length;){const y=s[p];Array.isArray(y)?JNe(o,y):xzn(o,y)}}function xzn(o,s){let p;for(p in s)if(QNe.call(s,p))switch(p){case"canContainEols":{const y=s[p];y&&o[p].push(...y);break}case"transforms":{const y=s[p];y&&o[p].push(...y);break}case"enter":case"exit":{const y=s[p];y&&Object.assign(o[p],y);break}}}function z9e(o,s){throw o?new Error("Cannot close `"+o.type+"` ("+PQ({start:o.start,end:o.end})+"): a different token (`"+s.type+"`, "+PQ({start:s.start,end:s.end})+") is open"):new Error("Cannot close document, a token (`"+s.type+"`, "+PQ({start:s.start,end:s.end})+") is still open")}function Ezn(o){const s=this;s.parser=p;function p(y){return vzn(y,{...s.data("settings"),...o,extensions:s.data("micromarkExtensions")||[],mdastExtensions:s.data("fromMarkdownExtensions")||[]})}}function Tzn(o,s){const p={type:"element",tagName:"blockquote",properties:{},children:o.wrap(o.all(s),!0)};return o.patch(s,p),o.applyData(s,p)}function kzn(o,s){const p={type:"element",tagName:"br",properties:{},children:[]};return o.patch(s,p),[o.applyData(s,p),{type:"text",value:`
|
|
1848
|
+
`}]}function Szn(o,s){const p=s.value?s.value+`
|
|
1849
|
+
`:"",y={};s.lang&&(y.className=["language-"+s.lang]);let C={type:"element",tagName:"code",properties:y,children:[{type:"text",value:p}]};return s.meta&&(C.data={meta:s.meta}),o.patch(s,C),C=o.applyData(s,C),C={type:"element",tagName:"pre",properties:{},children:[C]},o.patch(s,C),C}function Czn(o,s){const p={type:"element",tagName:"del",properties:{},children:o.all(s)};return o.patch(s,p),o.applyData(s,p)}function Azn(o,s){const p={type:"element",tagName:"em",properties:{},children:o.all(s)};return o.patch(s,p),o.applyData(s,p)}function Izn(o,s){const p=typeof o.options.clobberPrefix=="string"?o.options.clobberPrefix:"user-content-",y=String(s.identifier).toUpperCase(),C=h$(y.toLowerCase()),N=o.footnoteOrder.indexOf(y);let L,z=o.footnoteCounts.get(y);z===void 0?(z=0,o.footnoteOrder.push(y),L=o.footnoteOrder.length):L=N+1,z+=1,o.footnoteCounts.set(y,z);const G={type:"element",tagName:"a",properties:{href:"#"+p+"fn-"+C,id:p+"fnref-"+C+(z>1?"-"+z:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(L)}]};o.patch(s,G);const q={type:"element",tagName:"sup",properties:{},children:[G]};return o.patch(s,q),o.applyData(s,q)}function Ozn(o,s){const p={type:"element",tagName:"h"+s.depth,properties:{},children:o.all(s)};return o.patch(s,p),o.applyData(s,p)}function Nzn(o,s){if(o.options.allowDangerousHtml){const p={type:"raw",value:s.value};return o.patch(s,p),o.applyData(s,p)}}function ZNe(o,s){const p=s.referenceType;let y="]";if(p==="collapsed"?y+="[]":p==="full"&&(y+="["+(s.label||s.identifier)+"]"),s.type==="imageReference")return[{type:"text",value:"!["+s.alt+y}];const C=o.all(s),N=C[0];N&&N.type==="text"?N.value="["+N.value:C.unshift({type:"text",value:"["});const L=C[C.length-1];return L&&L.type==="text"?L.value+=y:C.push({type:"text",value:y}),C}function Pzn(o,s){const p=String(s.identifier).toUpperCase(),y=o.definitionById.get(p);if(!y)return ZNe(o,s);const C={src:h$(y.url||""),alt:s.alt};y.title!==null&&y.title!==void 0&&(C.title=y.title);const N={type:"element",tagName:"img",properties:C,children:[]};return o.patch(s,N),o.applyData(s,N)}function Lzn(o,s){const p={src:h$(s.url)};s.alt!==null&&s.alt!==void 0&&(p.alt=s.alt),s.title!==null&&s.title!==void 0&&(p.title=s.title);const y={type:"element",tagName:"img",properties:p,children:[]};return o.patch(s,y),o.applyData(s,y)}function Mzn(o,s){const p={type:"text",value:s.value.replace(/\r?\n|\r/g," ")};o.patch(s,p);const y={type:"element",tagName:"code",properties:{},children:[p]};return o.patch(s,y),o.applyData(s,y)}function Rzn(o,s){const p=String(s.identifier).toUpperCase(),y=o.definitionById.get(p);if(!y)return ZNe(o,s);const C={href:h$(y.url||"")};y.title!==null&&y.title!==void 0&&(C.title=y.title);const N={type:"element",tagName:"a",properties:C,children:o.all(s)};return o.patch(s,N),o.applyData(s,N)}function Dzn(o,s){const p={href:h$(s.url)};s.title!==null&&s.title!==void 0&&(p.title=s.title);const y={type:"element",tagName:"a",properties:p,children:o.all(s)};return o.patch(s,y),o.applyData(s,y)}function Bzn(o,s,p){const y=o.all(s),C=p?Fzn(p):tPe(s),N={},L=[];if(typeof s.checked=="boolean"){const et=y[0];let tt;et&&et.type==="element"&&et.tagName==="p"?tt=et:(tt={type:"element",tagName:"p",properties:{},children:[]},y.unshift(tt)),tt.children.length>0&&tt.children.unshift({type:"text",value:" "}),tt.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:s.checked,disabled:!0},children:[]}),N.className=["task-list-item"]}let z=-1;for(;++z<y.length;){const et=y[z];(C||z!==0||et.type!=="element"||et.tagName!=="p")&&L.push({type:"text",value:`
|
|
1847
1850
|
`}),et.type==="element"&&et.tagName==="p"&&!C?L.push(...et.children):L.push(et)}const G=y[y.length-1];G&&(C||G.type!=="element"||G.tagName!=="p")&&L.push({type:"text",value:`
|
|
1848
|
-
`});const q={type:"element",tagName:"li",properties:N,children:L};return o.patch(s,q),o.applyData(s,q)}function
|
|
1851
|
+
`});const q={type:"element",tagName:"li",properties:N,children:L};return o.patch(s,q),o.applyData(s,q)}function Fzn(o){let s=!1;if(o.type==="list"){s=o.spread||!1;const p=o.children;let y=-1;for(;!s&&++y<p.length;)s=tPe(p[y])}return s}function tPe(o){const s=o.spread;return s??o.children.length>1}function $zn(o,s){const p={},y=o.all(s);let C=-1;for(typeof s.start=="number"&&s.start!==1&&(p.start=s.start);++C<y.length;){const L=y[C];if(L.type==="element"&&L.tagName==="li"&&L.properties&&Array.isArray(L.properties.className)&&L.properties.className.includes("task-list-item")){p.className=["contains-task-list"];break}}const N={type:"element",tagName:s.ordered?"ol":"ul",properties:p,children:o.wrap(y,!0)};return o.patch(s,N),o.applyData(s,N)}function jzn(o,s){const p={type:"element",tagName:"p",properties:{},children:o.all(s)};return o.patch(s,p),o.applyData(s,p)}function Hzn(o,s){const p={type:"root",children:o.wrap(o.all(s))};return o.patch(s,p),o.applyData(s,p)}function zzn(o,s){const p={type:"element",tagName:"strong",properties:{},children:o.all(s)};return o.patch(s,p),o.applyData(s,p)}function Uzn(o,s){const p=o.all(s),y=p.shift(),C=[];if(y){const L={type:"element",tagName:"thead",properties:{},children:o.wrap([y],!0)};o.patch(s.children[0],L),C.push(L)}if(p.length>0){const L={type:"element",tagName:"tbody",properties:{},children:o.wrap(p,!0)},z=P6(s.children[1]),G=u2t(s.children[s.children.length-1]);z&&G&&(L.position={start:z,end:G}),C.push(L)}const N={type:"element",tagName:"table",properties:{},children:o.wrap(C,!0)};return o.patch(s,N),o.applyData(s,N)}function qzn(o,s,p){const y=p?p.children:void 0,N=(y?y.indexOf(s):1)===0?"th":"td",L=p&&p.type==="table"?p.align:void 0,z=L?L.length:s.children.length;let G=-1;const q=[];for(;++G<z;){const tt=s.children[G],nt={},st=L?L[G]:void 0;st&&(nt.align=st);let at={type:"element",tagName:N,properties:nt,children:[]};tt&&(at.children=o.all(tt),o.patch(tt,at),at=o.applyData(tt,at)),q.push(at)}const et={type:"element",tagName:"tr",properties:{},children:o.wrap(q,!0)};return o.patch(s,et),o.applyData(s,et)}function Wzn(o,s){const p={type:"element",tagName:"td",properties:{},children:o.all(s)};return o.patch(s,p),o.applyData(s,p)}const U9e=9,q9e=32;function Kzn(o){const s=String(o),p=/\r?\n|\r/g;let y=p.exec(s),C=0;const N=[];for(;y;)N.push(W9e(s.slice(C,y.index),C>0,!0),y[0]),C=y.index+y[0].length,y=p.exec(s);return N.push(W9e(s.slice(C),C>0,!1)),N.join("")}function W9e(o,s,p){let y=0,C=o.length;if(s){let N=o.codePointAt(y);for(;N===U9e||N===q9e;)y++,N=o.codePointAt(y)}if(p){let N=o.codePointAt(C-1);for(;N===U9e||N===q9e;)C--,N=o.codePointAt(C-1)}return C>y?o.slice(y,C):""}function Gzn(o,s){const p={type:"text",value:Kzn(String(s.value))};return o.patch(s,p),o.applyData(s,p)}function Yzn(o,s){const p={type:"element",tagName:"hr",properties:{},children:[]};return o.patch(s,p),o.applyData(s,p)}const Vzn={blockquote:Tzn,break:kzn,code:Szn,delete:Czn,emphasis:Azn,footnoteReference:Izn,heading:Ozn,html:Nzn,imageReference:Pzn,image:Lzn,inlineCode:Mzn,linkReference:Rzn,link:Dzn,listItem:Bzn,list:$zn,paragraph:jzn,root:Hzn,strong:zzn,table:Uzn,tableCell:Wzn,tableRow:qzn,text:Gzn,thematicBreak:Yzn,toml:Dbt,yaml:Dbt,definition:Dbt,footnoteDefinition:Dbt};function Dbt(){}const ePe=-1,h2t=0,MQ=1,Lmt=2,I$t=3,O$t=4,N$t=5,P$t=6,nPe=7,rPe=8,K9e=typeof self=="object"?self:globalThis,Xzn=(o,s)=>{const p=(C,N)=>(o.set(N,C),C),y=C=>{if(o.has(C))return o.get(C);const[N,L]=s[C];switch(N){case h2t:case ePe:return p(L,C);case MQ:{const z=p([],C);for(const G of L)z.push(y(G));return z}case Lmt:{const z=p({},C);for(const[G,q]of L)z[y(G)]=y(q);return z}case I$t:return p(new Date(L),C);case O$t:{const{source:z,flags:G}=L;return p(new RegExp(z,G),C)}case N$t:{const z=p(new Map,C);for(const[G,q]of L)z.set(y(G),y(q));return z}case P$t:{const z=p(new Set,C);for(const G of L)z.add(y(G));return z}case nPe:{const{name:z,message:G}=L;return p(new K9e[z](G),C)}case rPe:return p(BigInt(L),C);case"BigInt":return p(Object(BigInt(L)),C);case"ArrayBuffer":return p(new Uint8Array(L).buffer,L);case"DataView":{const{buffer:z}=new Uint8Array(L);return p(new DataView(z),L)}}return p(new K9e[N](L),C)};return y},G9e=o=>Xzn(new Map,o)(0),RF="",{toString:Qzn}={},{keys:Jzn}=Object,dQ=o=>{const s=typeof o;if(s!=="object"||!o)return[h2t,s];const p=Qzn.call(o).slice(8,-1);switch(p){case"Array":return[MQ,RF];case"Object":return[Lmt,RF];case"Date":return[I$t,RF];case"RegExp":return[O$t,RF];case"Map":return[N$t,RF];case"Set":return[P$t,RF];case"DataView":return[MQ,p]}return p.includes("Array")?[MQ,p]:p.includes("Error")?[nPe,p]:[Lmt,p]},Bbt=([o,s])=>o===h2t&&(s==="function"||s==="symbol"),Zzn=(o,s,p,y)=>{const C=(L,z)=>{const G=y.push(L)-1;return p.set(z,G),G},N=L=>{if(p.has(L))return p.get(L);let[z,G]=dQ(L);switch(z){case h2t:{let et=L;switch(G){case"bigint":z=rPe,et=L.toString();break;case"function":case"symbol":if(o)throw new TypeError("unable to serialize "+G);et=null;break;case"undefined":return C([ePe],L)}return C([z,et],L)}case MQ:{if(G){let nt=L;return G==="DataView"?nt=new Uint8Array(L.buffer):G==="ArrayBuffer"&&(nt=new Uint8Array(L)),C([G,[...nt]],L)}const et=[],tt=C([z,et],L);for(const nt of L)et.push(N(nt));return tt}case Lmt:{if(G)switch(G){case"BigInt":return C([G,L.toString()],L);case"Boolean":case"Number":case"String":return C([G,L.valueOf()],L)}if(s&&"toJSON"in L)return N(L.toJSON());const et=[],tt=C([z,et],L);for(const nt of Jzn(L))(o||!Bbt(dQ(L[nt])))&&et.push([N(nt),N(L[nt])]);return tt}case I$t:return C([z,L.toISOString()],L);case O$t:{const{source:et,flags:tt}=L;return C([z,{source:et,flags:tt}],L)}case N$t:{const et=[],tt=C([z,et],L);for(const[nt,st]of L)(o||!(Bbt(dQ(nt))||Bbt(dQ(st))))&&et.push([N(nt),N(st)]);return tt}case P$t:{const et=[],tt=C([z,et],L);for(const nt of L)(o||!Bbt(dQ(nt)))&&et.push(N(nt));return tt}}const{message:q}=L;return C([z,{name:G,message:q}],L)};return N},Y9e=(o,{json:s,lossy:p}={})=>{const y=[];return Zzn(!(s||p),!!s,new Map,y)(o),y},e$=typeof structuredClone=="function"?(o,s)=>s&&("json"in s||"lossy"in s)?G9e(Y9e(o,s)):structuredClone(o):(o,s)=>G9e(Y9e(o,s));function tUn(o,s){const p=[{type:"text",value:"↩"}];return s>1&&p.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(s)}]}),p}function eUn(o,s){return"Back to reference "+(o+1)+(s>1?"-"+s:"")}function nUn(o){const s=typeof o.options.clobberPrefix=="string"?o.options.clobberPrefix:"user-content-",p=o.options.footnoteBackContent||tUn,y=o.options.footnoteBackLabel||eUn,C=o.options.footnoteLabel||"Footnotes",N=o.options.footnoteLabelTagName||"h2",L=o.options.footnoteLabelProperties||{className:["sr-only"]},z=[];let G=-1;for(;++G<o.footnoteOrder.length;){const q=o.footnoteById.get(o.footnoteOrder[G]);if(!q)continue;const et=o.all(q),tt=String(q.identifier).toUpperCase(),nt=h$(tt.toLowerCase());let st=0;const at=[],Ot=o.footnoteCounts.get(tt);for(;Ot!==void 0&&++st<=Ot;){at.length>0&&at.push({type:"text",value:" "});let ie=typeof p=="string"?p:p(G,st);typeof ie=="string"&&(ie={type:"text",value:ie}),at.push({type:"element",tagName:"a",properties:{href:"#"+s+"fnref-"+nt+(st>1?"-"+st:""),dataFootnoteBackref:"",ariaLabel:typeof y=="string"?y:y(G,st),className:["data-footnote-backref"]},children:Array.isArray(ie)?ie:[ie]})}const Dt=et[et.length-1];if(Dt&&Dt.type==="element"&&Dt.tagName==="p"){const ie=Dt.children[Dt.children.length-1];ie&&ie.type==="text"?ie.value+=" ":Dt.children.push({type:"text",value:" "}),Dt.children.push(...at)}else et.push(...at);const St={type:"element",tagName:"li",properties:{id:s+"fn-"+nt},children:o.wrap(et,!0)};o.patch(q,St),z.push(St)}if(z.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:N,properties:{...e$(L),id:"footnote-label"},children:[{type:"text",value:C}]},{type:"text",value:`
|
|
1849
1852
|
`},{type:"element",tagName:"ol",properties:{},children:o.wrap(z,!0)},{type:"text",value:`
|
|
1850
|
-
`}]}}const iPe=function(o){if(o==null)return
|
|
1853
|
+
`}]}}const iPe=function(o){if(o==null)return sUn;if(typeof o=="function")return f2t(o);if(typeof o=="object")return Array.isArray(o)?rUn(o):iUn(o);if(typeof o=="string")return aUn(o);throw new Error("Expected function, string, or object as test")};function rUn(o){const s=[];let p=-1;for(;++p<o.length;)s[p]=iPe(o[p]);return f2t(y);function y(...C){let N=-1;for(;++N<s.length;)if(s[N].apply(this,C))return!0;return!1}}function iUn(o){const s=o;return f2t(p);function p(y){const C=y;let N;for(N in o)if(C[N]!==s[N])return!1;return!0}}function aUn(o){return f2t(s);function s(p){return p&&p.type===o}}function f2t(o){return s;function s(p,y,C){return!!(oUn(p)&&o.call(this,p,typeof y=="number"?y:void 0,C||void 0))}}function sUn(){return!0}function oUn(o){return o!==null&&typeof o=="object"&&"type"in o}const aPe=[],cUn=!0,V9e=!1,uUn="skip";function lUn(o,s,p,y){let C;typeof s=="function"&&typeof p!="function"?(y=p,p=s):C=s;const N=iPe(C),L=y?-1:1;z(o,void 0,[])();function z(G,q,et){const tt=G&&typeof G=="object"?G:{};if(typeof tt.type=="string"){const st=typeof tt.tagName=="string"?tt.tagName:typeof tt.name=="string"?tt.name:void 0;Object.defineProperty(nt,"name",{value:"node ("+(G.type+(st?"<"+st+">":""))+")"})}return nt;function nt(){let st=aPe,at,Ot,Dt;if((!s||N(G,q,et[et.length-1]||void 0))&&(st=hUn(p(G,et)),st[0]===V9e))return st;if("children"in G&&G.children){const St=G;if(St.children&&st[0]!==uUn)for(Ot=(y?St.children.length:-1)+L,Dt=et.concat(St);Ot>-1&&Ot<St.children.length;){const ie=St.children[Ot];if(at=z(ie,Ot,Dt)(),at[0]===V9e)return at;Ot=typeof at[1]=="number"?at[1]:Ot+L}}return st}}}function hUn(o){return Array.isArray(o)?o:typeof o=="number"?[cUn,o]:o==null?aPe:[o]}function L$t(o,s,p,y){let C,N,L;typeof s=="function"&&typeof p!="function"?(N=void 0,L=s,C=p):(N=s,L=p,C=y),lUn(o,N,z,C);function z(G,q){const et=q[q.length-1],tt=et?et.children.indexOf(G):void 0;return L(G,tt,et)}}const yFt={}.hasOwnProperty,fUn={};function dUn(o,s){const p=s||fUn,y=new Map,C=new Map,N=new Map,L={...Vzn,...p.handlers},z={all:q,applyData:gUn,definitionById:y,footnoteById:C,footnoteCounts:N,footnoteOrder:[],handlers:L,one:G,options:p,patch:pUn,wrap:mUn};return L$t(o,function(et){if(et.type==="definition"||et.type==="footnoteDefinition"){const tt=et.type==="definition"?y:C,nt=String(et.identifier).toUpperCase();tt.has(nt)||tt.set(nt,et)}}),z;function G(et,tt){const nt=et.type,st=z.handlers[nt];if(yFt.call(z.handlers,nt)&&st)return st(z,et,tt);if(z.options.passThrough&&z.options.passThrough.includes(nt)){if("children"in et){const{children:Ot,...Dt}=et,St=e$(Dt);return St.children=z.all(et),St}return e$(et)}return(z.options.unknownHandler||bUn)(z,et,tt)}function q(et){const tt=[];if("children"in et){const nt=et.children;let st=-1;for(;++st<nt.length;){const at=z.one(nt[st],et);if(at){if(st&&nt[st-1].type==="break"&&(!Array.isArray(at)&&at.type==="text"&&(at.value=X9e(at.value)),!Array.isArray(at)&&at.type==="element")){const Ot=at.children[0];Ot&&Ot.type==="text"&&(Ot.value=X9e(Ot.value))}Array.isArray(at)?tt.push(...at):tt.push(at)}}}return tt}}function pUn(o,s){o.position&&(s.position=Q$n(o))}function gUn(o,s){let p=s;if(o&&o.data){const y=o.data.hName,C=o.data.hChildren,N=o.data.hProperties;if(typeof y=="string")if(p.type==="element")p.tagName=y;else{const L="children"in p?p.children:[p];p={type:"element",tagName:y,properties:{},children:L}}p.type==="element"&&N&&Object.assign(p.properties,e$(N)),"children"in p&&p.children&&C!==null&&C!==void 0&&(p.children=C)}return p}function bUn(o,s){const p=s.data||{},y="value"in s&&!(yFt.call(p,"hProperties")||yFt.call(p,"hChildren"))?{type:"text",value:s.value}:{type:"element",tagName:"div",properties:{},children:o.all(s)};return o.patch(s,y),o.applyData(s,y)}function mUn(o,s){const p=[];let y=-1;for(s&&p.push({type:"text",value:`
|
|
1851
1854
|
`});++y<o.length;)y&&p.push({type:"text",value:`
|
|
1852
1855
|
`}),p.push(o[y]);return s&&o.length>0&&p.push({type:"text",value:`
|
|
1853
|
-
`}),p}function X9e(o){let s=0,p=o.charCodeAt(s);for(;p===9||p===32;)s++,p=o.charCodeAt(s);return o.slice(s)}function Q9e(o,s){const p=
|
|
1854
|
-
`},C),N}function mUn(o,s){return o&&"run"in o?async function(p,y){const C=Q9e(p,{file:y,...s});await o.run(C,y)}:function(p,y){return Q9e(p,{file:y,...o||s})}}function J9e(o){if(o)throw o}var Zbt=Object.prototype.hasOwnProperty,sPe=Object.prototype.toString,Z9e=Object.defineProperty,tAe=Object.getOwnPropertyDescriptor,eAe=function(s){return typeof Array.isArray=="function"?Array.isArray(s):sPe.call(s)==="[object Array]"},nAe=function(s){if(!s||sPe.call(s)!=="[object Object]")return!1;var p=Zbt.call(s,"constructor"),y=s.constructor&&s.constructor.prototype&&Zbt.call(s.constructor.prototype,"isPrototypeOf");if(s.constructor&&!p&&!y)return!1;var C;for(C in s);return typeof C>"u"||Zbt.call(s,C)},rAe=function(s,p){Z9e&&p.name==="__proto__"?Z9e(s,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):s[p.name]=p.newValue},iAe=function(s,p){if(p==="__proto__")if(Zbt.call(s,p)){if(tAe)return tAe(s,p).value}else return;return s[p]},yUn=function o(){var s,p,y,C,N,L,z=arguments[0],G=1,q=arguments.length,et=!1;for(typeof z=="boolean"&&(et=z,z=arguments[1]||{},G=2),(z==null||typeof z!="object"&&typeof z!="function")&&(z={});G<q;++G)if(s=arguments[G],s!=null)for(p in s)y=iAe(z,p),C=iAe(s,p),z!==C&&(et&&C&&(nAe(C)||(N=eAe(C)))?(N?(N=!1,L=y&&eAe(y)?y:[]):L=y&&nAe(y)?y:{},rAe(z,{name:p,newValue:o(et,L,C)})):typeof C<"u"&&rAe(z,{name:p,newValue:C}));return z};const iBt=KAe(yUn);function wFt(o){if(typeof o!="object"||o===null)return!1;const s=Object.getPrototypeOf(o);return(s===null||s===Object.prototype||Object.getPrototypeOf(s)===null)&&!(Symbol.toStringTag in o)&&!(Symbol.iterator in o)}function wUn(){const o=[],s={run:p,use:y};return s;function p(...C){let N=-1;const L=C.pop();if(typeof L!="function")throw new TypeError("Expected function as last argument, not "+L);z(null,...C);function z(G,...q){const et=o[++N];let tt=-1;if(G){L(G);return}for(;++tt<C.length;)(q[tt]===null||q[tt]===void 0)&&(q[tt]=C[tt]);C=q,et?vUn(et,z)(...q):L(null,...q)}}function y(C){if(typeof C!="function")throw new TypeError("Expected `middelware` to be a function, not "+C);return o.push(C),s}}function vUn(o,s){let p;return y;function y(...L){const z=o.length>L.length;let G;z&&L.push(C);try{G=o.apply(this,L)}catch(q){const et=q;if(z&&p)throw et;return C(et)}z||(G&&G.then&&typeof G.then=="function"?G.then(N,C):G instanceof Error?C(G):N(G))}function C(L,...z){p||(p=!0,s(L,...z))}function N(L){C(null,L)}}const w6={basename:_Un,dirname:xUn,extname:EUn,join:TUn,sep:"/"};function _Un(o,s){if(s!==void 0&&typeof s!="string")throw new TypeError('"ext" argument must be a string');aJ(o);let p=0,y=-1,C=o.length,N;if(s===void 0||s.length===0||s.length>o.length){for(;C--;)if(o.codePointAt(C)===47){if(N){p=C+1;break}}else y<0&&(N=!0,y=C+1);return y<0?"":o.slice(p,y)}if(s===o)return"";let L=-1,z=s.length-1;for(;C--;)if(o.codePointAt(C)===47){if(N){p=C+1;break}}else L<0&&(N=!0,L=C+1),z>-1&&(o.codePointAt(C)===s.codePointAt(z--)?z<0&&(y=C):(z=-1,y=L));return p===y?y=L:y<0&&(y=o.length),o.slice(p,y)}function xUn(o){if(aJ(o),o.length===0)return".";let s=-1,p=o.length,y;for(;--p;)if(o.codePointAt(p)===47){if(y){s=p;break}}else y||(y=!0);return s<0?o.codePointAt(0)===47?"/":".":s===1&&o.codePointAt(0)===47?"//":o.slice(0,s)}function EUn(o){aJ(o);let s=o.length,p=-1,y=0,C=-1,N=0,L;for(;s--;){const z=o.codePointAt(s);if(z===47){if(L){y=s+1;break}continue}p<0&&(L=!0,p=s+1),z===46?C<0?C=s:N!==1&&(N=1):C>-1&&(N=-1)}return C<0||p<0||N===0||N===1&&C===p-1&&C===y+1?"":o.slice(C,p)}function TUn(...o){let s=-1,p;for(;++s<o.length;)aJ(o[s]),o[s]&&(p=p===void 0?o[s]:p+"/"+o[s]);return p===void 0?".":kUn(p)}function kUn(o){aJ(o);const s=o.codePointAt(0)===47;let p=SUn(o,!s);return p.length===0&&!s&&(p="."),p.length>0&&o.codePointAt(o.length-1)===47&&(p+="/"),s?"/"+p:p}function SUn(o,s){let p="",y=0,C=-1,N=0,L=-1,z,G;for(;++L<=o.length;){if(L<o.length)z=o.codePointAt(L);else{if(z===47)break;z=47}if(z===47){if(!(C===L-1||N===1))if(C!==L-1&&N===2){if(p.length<2||y!==2||p.codePointAt(p.length-1)!==46||p.codePointAt(p.length-2)!==46){if(p.length>2){if(G=p.lastIndexOf("/"),G!==p.length-1){G<0?(p="",y=0):(p=p.slice(0,G),y=p.length-1-p.lastIndexOf("/")),C=L,N=0;continue}}else if(p.length>0){p="",y=0,C=L,N=0;continue}}s&&(p=p.length>0?p+"/..":"..",y=2)}else p.length>0?p+="/"+o.slice(C+1,L):p=o.slice(C+1,L),y=L-C-1;C=L,N=0}else z===46&&N>-1?N++:N=-1}return p}function aJ(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}const CUn={cwd:AUn};function AUn(){return"/"}function vFt(o){return!!(o!==null&&typeof o=="object"&&"href"in o&&o.href&&"protocol"in o&&o.protocol&&o.auth===void 0)}function IUn(o){if(typeof o=="string")o=new URL(o);else if(!vFt(o)){const s=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+o+"`");throw s.code="ERR_INVALID_ARG_TYPE",s}if(o.protocol!=="file:"){const s=new TypeError("The URL must be of scheme file");throw s.code="ERR_INVALID_URL_SCHEME",s}return OUn(o)}function OUn(o){if(o.hostname!==""){const y=new TypeError('File URL host must be "localhost" or empty on darwin');throw y.code="ERR_INVALID_FILE_URL_HOST",y}const s=o.pathname;let p=-1;for(;++p<s.length;)if(s.codePointAt(p)===37&&s.codePointAt(p+1)===50){const y=s.codePointAt(p+2);if(y===70||y===102){const C=new TypeError("File URL path must not include encoded / characters");throw C.code="ERR_INVALID_FILE_URL_PATH",C}}return decodeURIComponent(s)}const aBt=["history","path","basename","stem","extname","dirname"];class oPe{constructor(s){let p;s?vFt(s)?p={path:s}:typeof s=="string"||NUn(s)?p={value:s}:p=s:p={},this.cwd="cwd"in p?"":CUn.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let y=-1;for(;++y<aBt.length;){const N=aBt[y];N in p&&p[N]!==void 0&&p[N]!==null&&(this[N]=N==="history"?[...p[N]]:p[N])}let C;for(C in p)aBt.includes(C)||(this[C]=p[C])}get basename(){return typeof this.path=="string"?w6.basename(this.path):void 0}set basename(s){oBt(s,"basename"),sBt(s,"basename"),this.path=w6.join(this.dirname||"",s)}get dirname(){return typeof this.path=="string"?w6.dirname(this.path):void 0}set dirname(s){aAe(this.basename,"dirname"),this.path=w6.join(s||"",this.basename)}get extname(){return typeof this.path=="string"?w6.extname(this.path):void 0}set extname(s){if(sBt(s,"extname"),aAe(this.dirname,"extname"),s){if(s.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(s.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=w6.join(this.dirname,this.stem+(s||""))}get path(){return this.history[this.history.length-1]}set path(s){vFt(s)&&(s=IUn(s)),oBt(s,"path"),this.path!==s&&this.history.push(s)}get stem(){return typeof this.path=="string"?w6.basename(this.path,this.extname):void 0}set stem(s){oBt(s,"stem"),sBt(s,"stem"),this.path=w6.join(this.dirname||"",s+(this.extname||""))}fail(s,p,y){const C=this.message(s,p,y);throw C.fatal=!0,C}info(s,p,y){const C=this.message(s,p,y);return C.fatal=void 0,C}message(s,p,y){const C=new kb(s,p,y);return this.path&&(C.name=this.path+":"+C.name,C.file=this.path),C.fatal=!1,this.messages.push(C),C}toString(s){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(s||void 0).decode(this.value)}}function sBt(o,s){if(o&&o.includes(w6.sep))throw new Error("`"+s+"` cannot be a path: did not expect `"+w6.sep+"`")}function oBt(o,s){if(!o)throw new Error("`"+s+"` cannot be empty")}function aAe(o,s){if(!o)throw new Error("Setting `"+s+"` requires `path` to be set too")}function NUn(o){return!!(o&&typeof o=="object"&&"byteLength"in o&&"byteOffset"in o)}const PUn=function(o){const y=this.constructor.prototype,C=y[o],N=function(){return C.apply(N,arguments)};return Object.setPrototypeOf(N,y),N},LUn={}.hasOwnProperty;class M$t extends PUn{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=wUn()}copy(){const s=new M$t;let p=-1;for(;++p<this.attachers.length;){const y=this.attachers[p];s.use(...y)}return s.data(iBt(!0,{},this.namespace)),s}data(s,p){return typeof s=="string"?arguments.length===2?(lBt("data",this.frozen),this.namespace[s]=p,this):LUn.call(this.namespace,s)&&this.namespace[s]||void 0:s?(lBt("data",this.frozen),this.namespace=s,this):this.namespace}freeze(){if(this.frozen)return this;const s=this;for(;++this.freezeIndex<this.attachers.length;){const[p,...y]=this.attachers[this.freezeIndex];if(y[0]===!1)continue;y[0]===!0&&(y[0]=void 0);const C=p.call(s,...y);typeof C=="function"&&this.transformers.use(C)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(s){this.freeze();const p=Fbt(s),y=this.parser||this.Parser;return cBt("parse",y),y(String(p),p)}process(s,p){const y=this;return this.freeze(),cBt("process",this.parser||this.Parser),uBt("process",this.compiler||this.Compiler),p?C(void 0,p):new Promise(C);function C(N,L){const z=Fbt(s),G=y.parse(z);y.run(G,z,function(et,tt,nt){if(et||!tt||!nt)return q(et);const st=tt,at=y.stringify(st,nt);DUn(at)?nt.value=at:nt.result=at,q(et,nt)});function q(et,tt){et||!tt?L(et):N?N(tt):p(void 0,tt)}}}processSync(s){let p=!1,y;return this.freeze(),cBt("processSync",this.parser||this.Parser),uBt("processSync",this.compiler||this.Compiler),this.process(s,C),oAe("processSync","process",p),y;function C(N,L){p=!0,J9e(N),y=L}}run(s,p,y){sAe(s),this.freeze();const C=this.transformers;return!y&&typeof p=="function"&&(y=p,p=void 0),y?N(void 0,y):new Promise(N);function N(L,z){const G=Fbt(p);C.run(s,G,q);function q(et,tt,nt){const st=tt||s;et?z(et):L?L(st):y(void 0,st,nt)}}}runSync(s,p){let y=!1,C;return this.run(s,p,N),oAe("runSync","run",y),C;function N(L,z){J9e(L),C=z,y=!0}}stringify(s,p){this.freeze();const y=Fbt(p),C=this.compiler||this.Compiler;return uBt("stringify",C),sAe(s),C(s,y)}use(s,...p){const y=this.attachers,C=this.namespace;if(lBt("use",this.frozen),s!=null)if(typeof s=="function")G(s,p);else if(typeof s=="object")Array.isArray(s)?z(s):L(s);else throw new TypeError("Expected usable value, not `"+s+"`");return this;function N(q){if(typeof q=="function")G(q,[]);else if(typeof q=="object")if(Array.isArray(q)){const[et,...tt]=q;G(et,tt)}else L(q);else throw new TypeError("Expected usable value, not `"+q+"`")}function L(q){if(!("plugins"in q)&&!("settings"in q))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");z(q.plugins),q.settings&&(C.settings=iBt(!0,C.settings,q.settings))}function z(q){let et=-1;if(q!=null)if(Array.isArray(q))for(;++et<q.length;){const tt=q[et];N(tt)}else throw new TypeError("Expected a list of plugins, not `"+q+"`")}function G(q,et){let tt=-1,nt=-1;for(;++tt<y.length;)if(y[tt][0]===q){nt=tt;break}if(nt===-1)y.push([q,...et]);else if(et.length>0){let[st,...at]=et;const Ot=y[nt][1];wFt(Ot)&&wFt(st)&&(st=iBt(!0,Ot,st)),y[nt]=[q,st,...at]}}}}const MUn=new M$t().freeze();function cBt(o,s){if(typeof s!="function")throw new TypeError("Cannot `"+o+"` without `parser`")}function uBt(o,s){if(typeof s!="function")throw new TypeError("Cannot `"+o+"` without `compiler`")}function lBt(o,s){if(s)throw new Error("Cannot call `"+o+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function sAe(o){if(!wFt(o)||typeof o.type!="string")throw new TypeError("Expected node, got `"+o+"`")}function oAe(o,s,p){if(!p)throw new Error("`"+o+"` finished async. Use `"+s+"` instead")}function Fbt(o){return RUn(o)?o:new oPe(o)}function RUn(o){return!!(o&&typeof o=="object"&&"message"in o&&"messages"in o)}function DUn(o){return typeof o=="string"||BUn(o)}function BUn(o){return!!(o&&typeof o=="object"&&"byteLength"in o&&"byteOffset"in o)}const FUn="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",cAe=[],uAe={allowDangerousHtml:!0},$Un=/^(https?|ircs?|mailto|xmpp)$/i,jUn=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function HUn(o){const s=zUn(o),p=UUn(o);return qUn(s.runSync(s.parse(p),p),o)}function zUn(o){const s=o.rehypePlugins||cAe,p=o.remarkPlugins||cAe,y=o.remarkRehypeOptions?{...o.remarkRehypeOptions,...uAe}:uAe;return MUn().use(xzn).use(p).use(mUn,y).use(s)}function UUn(o){const s=o.children||"",p=new oPe;return typeof s=="string"&&(p.value=s),p}function qUn(o,s){const p=s.allowedElements,y=s.allowElement,C=s.components,N=s.disallowedElements,L=s.skipHtml,z=s.unwrapDisallowed,G=s.urlTransform||WUn;for(const et of jUn)Object.hasOwn(s,et.from)&&(""+et.from+(et.to?"use `"+et.to+"` instead":"remove it")+FUn+et.id,void 0);return s.className&&(o={type:"element",tagName:"div",properties:{className:s.className},children:o.type==="root"?o.children:[o]}),L$t(o,q),ejn(o,{Fragment:le.Fragment,components:C,ignoreInvalidStyle:!0,jsx:le.jsx,jsxs:le.jsxs,passKeys:!0,passNode:!0});function q(et,tt,nt){if(et.type==="raw"&&nt&&typeof tt=="number")return L?nt.children.splice(tt,1):nt.children[tt]={type:"text",value:et.value},tt;if(et.type==="element"){let st;for(st in eBt)if(Object.hasOwn(eBt,st)&&Object.hasOwn(et.properties,st)){const at=et.properties[st],Ot=eBt[st];(Ot===null||Ot.includes(et.tagName))&&(et.properties[st]=G(String(at||""),st,et))}}if(et.type==="element"){let st=p?!p.includes(et.tagName):N?N.includes(et.tagName):!1;if(!st&&y&&typeof tt=="number"&&(st=!y(et,tt,nt)),st&&nt&&typeof tt=="number")return z&&et.children?nt.children.splice(tt,1,...et.children):nt.children.splice(tt,1),tt}}}function WUn(o){const s=o.indexOf(":"),p=o.indexOf("?"),y=o.indexOf("#"),C=o.indexOf("/");return s===-1||C!==-1&&s>C||p!==-1&&s>p||y!==-1&&s>y||$Un.test(o.slice(0,s))?o:""}const lAe=/[#.]/g;function KUn(o,s){const p=o||"",y={};let C=0,N,L;for(;C<p.length;){lAe.lastIndex=C;const z=lAe.exec(p),G=p.slice(C,z?z.index:p.length);G&&(N?N==="#"?y.id=G:Array.isArray(y.className)?y.className.push(G):y.className=[G]:L=G,C+=G.length),z&&(N=z[0],C++)}return{type:"element",tagName:L||s||"div",properties:y,children:[]}}function cPe(o,s,p){const y=p?XUn(p):void 0;function C(N,L,...z){let G;if(N==null){G={type:"root",children:[]};const q=L;z.unshift(q)}else{G=KUn(N,s);const q=G.tagName.toLowerCase(),et=y?y.get(q):void 0;if(G.tagName=et||q,GUn(L))z.unshift(L);else for(const[tt,nt]of Object.entries(L))YUn(o,G.properties,tt,nt)}for(const q of z)_Ft(G.children,q);return G.type==="element"&&G.tagName==="template"&&(G.content={type:"root",children:G.children},G.children=[]),G}return C}function GUn(o){if(o===null||typeof o!="object"||Array.isArray(o))return!0;if(typeof o.type!="string")return!1;const s=o,p=Object.keys(o);for(const y of p){const C=s[y];if(C&&typeof C=="object"){if(!Array.isArray(C))return!0;const N=C;for(const L of N)if(typeof L!="number"&&typeof L!="string")return!0}}return!!("children"in o&&Array.isArray(o.children))}function YUn(o,s,p,y){const C=o2t(o,p);let N;if(y!=null){if(typeof y=="number"){if(Number.isNaN(y))return;N=y}else typeof y=="boolean"?N=y:typeof y=="string"?C.spaceSeparated?N=E9e(y):C.commaSeparated?N=y9e(y):C.commaOrSpaceSeparated?N=E9e(y9e(y).join(" ")):N=hAe(C,C.property,y):Array.isArray(y)?N=[...y]:N=C.property==="style"?VUn(y):String(y);if(Array.isArray(N)){const L=[];for(const z of N)L.push(hAe(C,C.property,z));N=L}C.property==="className"&&Array.isArray(s.className)&&(N=s.className.concat(N)),s[C.property]=N}}function _Ft(o,s){if(s!=null)if(typeof s=="number"||typeof s=="string")o.push({type:"text",value:String(s)});else if(Array.isArray(s))for(const p of s)_Ft(o,p);else if(typeof s=="object"&&"type"in s)s.type==="root"?_Ft(o,s.children):o.push(s);else throw new Error("Expected node, nodes, or string, got `"+s+"`")}function hAe(o,s,p){if(typeof p=="string"){if(o.number&&p&&!Number.isNaN(Number(p)))return Number(p);if((o.boolean||o.overloadedBoolean)&&(p===""||KQ(p)===KQ(s)))return!0}return p}function VUn(o){const s=[];for(const[p,y]of Object.entries(o))s.push([p,y].join(": "));return s.join("; ")}function XUn(o){const s=new Map;for(const p of o)s.set(p.toLowerCase(),p);return s}const QUn=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],JUn=cPe(iJ,"div"),ZUn=cPe(xC,"g",QUn);function tqn(o){const s=String(o),p=[];return{toOffset:C,toPoint:y};function y(N){if(typeof N=="number"&&N>-1&&N<=s.length){let L=0;for(;;){let z=p[L];if(z===void 0){const G=fAe(s,p[L-1]);z=G===-1?s.length+1:G+1,p[L]=z}if(z>N)return{line:L+1,column:N-(L>0?p[L-1]:0)+1,offset:N};L++}}}function C(N){if(N&&typeof N.line=="number"&&typeof N.column=="number"&&!Number.isNaN(N.line)&&!Number.isNaN(N.column)){for(;p.length<N.line;){const z=p[p.length-1],G=fAe(s,z),q=G===-1?s.length+1:G+1;if(z===q)break;p.push(q)}const L=(N.line>1?p[N.line-2]:0)+N.column-1;if(L<p[N.line-1])return L}}}function fAe(o,s){const p=o.indexOf("\r",s),y=o.indexOf(`
|
|
1855
|
-
`,s);return y===-1?p:p===-1||p+1===y?y:p<y?p:y}const fP={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},uPe={}.hasOwnProperty,eqn=Object.prototype;function nqn(o,s){const p=s||{};return R$t({file:p.file||void 0,location:!1,schema:p.space==="svg"?xC:iJ,verbose:p.verbose||!1},o)}function R$t(o,s){let p;switch(s.nodeName){case"#comment":{const y=s;return p={type:"comment",value:y.data},tmt(o,y,p),p}case"#document":case"#document-fragment":{const y=s,C="mode"in y?y.mode==="quirks"||y.mode==="limited-quirks":!1;if(p={type:"root",children:lPe(o,s.childNodes),data:{quirksMode:C}},o.file&&o.location){const N=String(o.file),L=tqn(N),z=L.toPoint(0),G=L.toPoint(N.length);p.position={start:z,end:G}}return p}case"#documentType":{const y=s;return p={type:"doctype"},tmt(o,y,p),p}case"#text":{const y=s;return p={type:"text",value:y.value},tmt(o,y,p),p}default:return p=rqn(o,s),p}}function lPe(o,s){let p=-1;const y=[];for(;++p<s.length;){const C=R$t(o,s[p]);y.push(C)}return y}function rqn(o,s){const p=o.schema;o.schema=s.namespaceURI===fP.svg?xC:iJ;let y=-1;const C={};for(;++y<s.attrs.length;){const z=s.attrs[y],G=(z.prefix?z.prefix+":":"")+z.name;uPe.call(eqn,G)||(C[G]=z.value)}const L=(o.schema.space==="svg"?ZUn:JUn)(s.tagName,C,lPe(o,s.childNodes));if(tmt(o,s,L),L.tagName==="template"){const z=s,G=z.sourceCodeLocation,q=G&&G.startTag&&HF(G.startTag),et=G&&G.endTag&&HF(G.endTag),tt=R$t(o,z.content);q&&et&&o.file&&(tt.position={start:q.end,end:et.start}),L.content=tt}return o.schema=p,L}function tmt(o,s,p){if("sourceCodeLocation"in s&&s.sourceCodeLocation&&o.file){const y=iqn(o,p,s.sourceCodeLocation);y&&(o.location=!0,p.position=y)}}function iqn(o,s,p){const y=HF(p);if(s.type==="element"){const C=s.children[s.children.length-1];if(y&&!p.endTag&&C&&C.position&&C.position.end&&(y.end=Object.assign({},C.position.end)),o.verbose){const N={};let L;if(p.attrs)for(L in p.attrs)uPe.call(p.attrs,L)&&(N[o2t(o.schema,L).property]=HF(p.attrs[L]));p.startTag;const z=HF(p.startTag),G=p.endTag?HF(p.endTag):void 0,q={opening:z};G&&(q.closing=G),q.properties=N,s.data={position:q}}}return y}function HF(o){const s=dAe({line:o.startLine,column:o.startCol,offset:o.startOffset}),p=dAe({line:o.endLine,column:o.endCol,offset:o.endOffset});return s||p?{start:s,end:p}:void 0}function dAe(o){return o.line&&o.column?o:void 0}class sJ{constructor(s,p,y){this.property=s,this.normal=p,y&&(this.space=y)}}sJ.prototype.property={};sJ.prototype.normal={};sJ.prototype.space=null;function hPe(o,s){const p={},y={};let C=-1;for(;++C<o.length;)Object.assign(p,o[C].property),Object.assign(y,o[C].normal);return new sJ(p,y,s)}function xFt(o){return o.toLowerCase()}class M3{constructor(s,p){this.property=s,this.attribute=p}}M3.prototype.space=null;M3.prototype.boolean=!1;M3.prototype.booleanish=!1;M3.prototype.overloadedBoolean=!1;M3.prototype.number=!1;M3.prototype.commaSeparated=!1;M3.prototype.spaceSeparated=!1;M3.prototype.commaOrSpaceSeparated=!1;M3.prototype.mustUseProperty=!1;M3.prototype.defined=!1;let aqn=0;const jc=xP(),u0=xP(),fPe=xP(),la=xP(),sf=xP(),WF=xP(),Tw=xP();function xP(){return 2**++aqn}const EFt=Object.freeze(Object.defineProperty({__proto__:null,boolean:jc,booleanish:u0,commaOrSpaceSeparated:Tw,commaSeparated:WF,number:la,overloadedBoolean:fPe,spaceSeparated:sf},Symbol.toStringTag,{value:"Module"})),hBt=Object.keys(EFt);class D$t extends M3{constructor(s,p,y,C){let N=-1;if(super(s,p),pAe(this,"space",C),typeof y=="number")for(;++N<hBt.length;){const L=hBt[N];pAe(this,hBt[N],(y&EFt[L])===EFt[L])}}}D$t.prototype.defined=!0;function pAe(o,s,p){p&&(o[s]=p)}const sqn={}.hasOwnProperty;function f$(o){const s={},p={};let y;for(y in o.properties)if(sqn.call(o.properties,y)){const C=o.properties[y],N=new D$t(y,o.transform(o.attributes||{},y),C,o.space);o.mustUseProperty&&o.mustUseProperty.includes(y)&&(N.mustUseProperty=!0),s[y]=N,p[xFt(y)]=y,p[xFt(N.attribute)]=y}return new sJ(s,p,o.space)}const dPe=f$({space:"xlink",transform(o,s){return"xlink:"+s.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),pPe=f$({space:"xml",transform(o,s){return"xml:"+s.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function gPe(o,s){return s in o?o[s]:s}function bPe(o,s){return gPe(o,s.toLowerCase())}const mPe=f$({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:bPe,properties:{xmlns:null,xmlnsXLink:null}}),yPe=f$({transform(o,s){return s==="role"?s:"aria-"+s.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:u0,ariaAutoComplete:null,ariaBusy:u0,ariaChecked:u0,ariaColCount:la,ariaColIndex:la,ariaColSpan:la,ariaControls:sf,ariaCurrent:null,ariaDescribedBy:sf,ariaDetails:null,ariaDisabled:u0,ariaDropEffect:sf,ariaErrorMessage:null,ariaExpanded:u0,ariaFlowTo:sf,ariaGrabbed:u0,ariaHasPopup:null,ariaHidden:u0,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:sf,ariaLevel:la,ariaLive:null,ariaModal:u0,ariaMultiLine:u0,ariaMultiSelectable:u0,ariaOrientation:null,ariaOwns:sf,ariaPlaceholder:null,ariaPosInSet:la,ariaPressed:u0,ariaReadOnly:u0,ariaRelevant:null,ariaRequired:u0,ariaRoleDescription:sf,ariaRowCount:la,ariaRowIndex:la,ariaRowSpan:la,ariaSelected:u0,ariaSetSize:la,ariaSort:null,ariaValueMax:la,ariaValueMin:la,ariaValueNow:la,ariaValueText:null,role:null}}),oqn=f$({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:bPe,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:WF,acceptCharset:sf,accessKey:sf,action:null,allow:null,allowFullScreen:jc,allowPaymentRequest:jc,allowUserMedia:jc,alt:null,as:null,async:jc,autoCapitalize:null,autoComplete:sf,autoFocus:jc,autoPlay:jc,blocking:sf,capture:null,charSet:null,checked:jc,cite:null,className:sf,cols:la,colSpan:null,content:null,contentEditable:u0,controls:jc,controlsList:sf,coords:la|WF,crossOrigin:null,data:null,dateTime:null,decoding:null,default:jc,defer:jc,dir:null,dirName:null,disabled:jc,download:fPe,draggable:u0,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:jc,formTarget:null,headers:sf,height:la,hidden:jc,high:la,href:null,hrefLang:null,htmlFor:sf,httpEquiv:sf,id:null,imageSizes:null,imageSrcSet:null,inert:jc,inputMode:null,integrity:null,is:null,isMap:jc,itemId:null,itemProp:sf,itemRef:sf,itemScope:jc,itemType:sf,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:jc,low:la,manifest:null,max:null,maxLength:la,media:null,method:null,min:null,minLength:la,multiple:jc,muted:jc,name:null,nonce:null,noModule:jc,noValidate:jc,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:jc,optimum:la,pattern:null,ping:sf,placeholder:null,playsInline:jc,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:jc,referrerPolicy:null,rel:sf,required:jc,reversed:jc,rows:la,rowSpan:la,sandbox:sf,scope:null,scoped:jc,seamless:jc,selected:jc,shadowRootClonable:jc,shadowRootDelegatesFocus:jc,shadowRootMode:null,shape:null,size:la,sizes:null,slot:null,span:la,spellCheck:u0,src:null,srcDoc:null,srcLang:null,srcSet:null,start:la,step:null,style:null,tabIndex:la,target:null,title:null,translate:null,type:null,typeMustMatch:jc,useMap:null,value:u0,width:la,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:sf,axis:null,background:null,bgColor:null,border:la,borderColor:null,bottomMargin:la,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:jc,declare:jc,event:null,face:null,frame:null,frameBorder:null,hSpace:la,leftMargin:la,link:null,longDesc:null,lowSrc:null,marginHeight:la,marginWidth:la,noResize:jc,noHref:jc,noShade:jc,noWrap:jc,object:null,profile:null,prompt:null,rev:null,rightMargin:la,rules:null,scheme:null,scrolling:u0,standby:null,summary:null,text:null,topMargin:la,valueType:null,version:null,vAlign:null,vLink:null,vSpace:la,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:jc,disableRemotePlayback:jc,prefix:null,property:null,results:la,security:null,unselectable:null}}),cqn=f$({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:gPe,properties:{about:Tw,accentHeight:la,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:la,amplitude:la,arabicForm:null,ascent:la,attributeName:null,attributeType:null,azimuth:la,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:la,by:null,calcMode:null,capHeight:la,className:sf,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:la,diffuseConstant:la,direction:null,display:null,dur:null,divisor:la,dominantBaseline:null,download:jc,dx:null,dy:null,edgeMode:null,editable:null,elevation:la,enableBackground:null,end:null,event:null,exponent:la,externalResourcesRequired:null,fill:null,fillOpacity:la,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:WF,g2:WF,glyphName:WF,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:la,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:la,horizOriginX:la,horizOriginY:la,id:null,ideographic:la,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:la,k:la,k1:la,k2:la,k3:la,k4:la,kernelMatrix:Tw,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:la,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:la,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:la,overlineThickness:la,paintOrder:null,panose1:null,path:null,pathLength:la,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:sf,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:la,pointsAtY:la,pointsAtZ:la,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Tw,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Tw,rev:Tw,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Tw,requiredFeatures:Tw,requiredFonts:Tw,requiredFormats:Tw,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:la,specularExponent:la,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:la,strikethroughThickness:la,string:null,stroke:null,strokeDashArray:Tw,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:la,strokeOpacity:la,strokeWidth:null,style:null,surfaceScale:la,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Tw,tabIndex:la,tableValues:null,target:null,targetX:la,targetY:la,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Tw,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:la,underlineThickness:la,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:la,values:null,vAlphabetic:la,vMathematical:la,vectorEffect:null,vHanging:la,vIdeographic:la,version:null,vertAdvY:la,vertOriginX:la,vertOriginY:la,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:la,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),uqn=/^data[-\w.:]+$/i,gAe=/-[a-z]/g,lqn=/[A-Z]/g;function hqn(o,s){const p=xFt(s);let y=s,C=M3;if(p in o.normal)return o.property[o.normal[p]];if(p.length>4&&p.slice(0,4)==="data"&&uqn.test(s)){if(s.charAt(4)==="-"){const N=s.slice(5).replace(gAe,dqn);y="data"+N.charAt(0).toUpperCase()+N.slice(1)}else{const N=s.slice(4);if(!gAe.test(N)){let L=N.replace(lqn,fqn);L.charAt(0)!=="-"&&(L="-"+L),s="data"+L}}C=D$t}return new C(y,s)}function fqn(o){return"-"+o.toLowerCase()}function dqn(o){return o.charAt(1).toUpperCase()}const pqn=hPe([pPe,dPe,mPe,yPe,oqn],"html"),wPe=hPe([pPe,dPe,mPe,yPe,cqn],"svg"),bAe={}.hasOwnProperty;function B$t(o,s){const p=s||{};function y(C,...N){let L=y.invalid;const z=y.handlers;if(C&&bAe.call(C,o)){const G=String(C[o]);L=bAe.call(z,G)?z[G]:y.unknown}if(L)return L.call(this,C,...N)}return y.handlers=p.handlers||{},y.invalid=p.invalid,y.unknown=p.unknown,y}const gqn={},bqn={}.hasOwnProperty,vPe=B$t("type",{handlers:{root:yqn,element:Eqn,text:_qn,comment:xqn,doctype:vqn}});function mqn(o,s){const y=(s||gqn).space;return vPe(o,y==="svg"?wPe:pqn)}function yqn(o,s){const p={nodeName:"#document",mode:(o.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return p.childNodes=F$t(o.children,p,s),d$(o,p),p}function wqn(o,s){const p={nodeName:"#document-fragment",childNodes:[]};return p.childNodes=F$t(o.children,p,s),d$(o,p),p}function vqn(o){const s={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return d$(o,s),s}function _qn(o){const s={nodeName:"#text",value:o.value,parentNode:null};return d$(o,s),s}function xqn(o){const s={nodeName:"#comment",data:o.value,parentNode:null};return d$(o,s),s}function Eqn(o,s){const p=s;let y=p;o.type==="element"&&o.tagName.toLowerCase()==="svg"&&p.space==="html"&&(y=wPe);const C=[];let N;if(o.properties){for(N in o.properties)if(N!=="children"&&bqn.call(o.properties,N)){const G=Tqn(y,N,o.properties[N]);G&&C.push(G)}}const L=y.space,z={nodeName:o.tagName,tagName:o.tagName,attrs:C,namespaceURI:fP[L],childNodes:[],parentNode:null};return z.childNodes=F$t(o.children,z,y),d$(o,z),o.tagName==="template"&&o.content&&(z.content=wqn(o.content,y)),z}function Tqn(o,s,p){const y=hqn(o,s);if(p===!1||p===null||p===void 0||typeof p=="number"&&Number.isNaN(p)||!p&&y.boolean)return;Array.isArray(p)&&(p=y.commaSeparated?w$t(p):_$t(p));const C={name:y.attribute,value:p===!0?"":String(p)};if(y.space&&y.space!=="html"&&y.space!=="svg"){const N=C.name.indexOf(":");N<0?C.prefix="":(C.name=C.name.slice(N+1),C.prefix=y.attribute.slice(0,N)),C.namespace=fP[y.space]}return C}function F$t(o,s,p){let y=-1;const C=[];if(o)for(;++y<o.length;){const N=vPe(o[y],p);N.parentNode=s,C.push(N)}return C}function d$(o,s){const p=o.position;p&&p.start&&p.end&&(p.start.offset,p.end.offset,s.sourceCodeLocation={startLine:p.start.line,startCol:p.start.column,startOffset:p.start.offset,endLine:p.end.line,endCol:p.end.column,endOffset:p.end.offset})}const _Pe=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],kqn=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Vf="�";var ve;(function(o){o[o.EOF=-1]="EOF",o[o.NULL=0]="NULL",o[o.TABULATION=9]="TABULATION",o[o.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",o[o.LINE_FEED=10]="LINE_FEED",o[o.FORM_FEED=12]="FORM_FEED",o[o.SPACE=32]="SPACE",o[o.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",o[o.QUOTATION_MARK=34]="QUOTATION_MARK",o[o.AMPERSAND=38]="AMPERSAND",o[o.APOSTROPHE=39]="APOSTROPHE",o[o.HYPHEN_MINUS=45]="HYPHEN_MINUS",o[o.SOLIDUS=47]="SOLIDUS",o[o.DIGIT_0=48]="DIGIT_0",o[o.DIGIT_9=57]="DIGIT_9",o[o.SEMICOLON=59]="SEMICOLON",o[o.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",o[o.EQUALS_SIGN=61]="EQUALS_SIGN",o[o.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",o[o.QUESTION_MARK=63]="QUESTION_MARK",o[o.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",o[o.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",o[o.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",o[o.GRAVE_ACCENT=96]="GRAVE_ACCENT",o[o.LATIN_SMALL_A=97]="LATIN_SMALL_A",o[o.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(ve||(ve={}));const X2={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function xPe(o){return o>=55296&&o<=57343}function Sqn(o){return o>=56320&&o<=57343}function Cqn(o,s){return(o-55296)*1024+9216+s}function EPe(o){return o!==32&&o!==10&&o!==13&&o!==9&&o!==12&&o>=1&&o<=31||o>=127&&o<=159}function TPe(o){return o>=64976&&o<=65007||kqn.has(o)}var Rr;(function(o){o.controlCharacterInInputStream="control-character-in-input-stream",o.noncharacterInInputStream="noncharacter-in-input-stream",o.surrogateInInputStream="surrogate-in-input-stream",o.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",o.endTagWithAttributes="end-tag-with-attributes",o.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",o.unexpectedSolidusInTag="unexpected-solidus-in-tag",o.unexpectedNullCharacter="unexpected-null-character",o.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",o.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",o.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",o.missingEndTagName="missing-end-tag-name",o.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",o.unknownNamedCharacterReference="unknown-named-character-reference",o.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",o.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",o.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",o.eofBeforeTagName="eof-before-tag-name",o.eofInTag="eof-in-tag",o.missingAttributeValue="missing-attribute-value",o.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",o.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",o.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",o.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",o.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",o.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",o.missingDoctypePublicIdentifier="missing-doctype-public-identifier",o.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",o.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",o.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",o.cdataInHtmlContent="cdata-in-html-content",o.incorrectlyOpenedComment="incorrectly-opened-comment",o.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",o.eofInDoctype="eof-in-doctype",o.nestedComment="nested-comment",o.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",o.eofInComment="eof-in-comment",o.incorrectlyClosedComment="incorrectly-closed-comment",o.eofInCdata="eof-in-cdata",o.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",o.nullCharacterReference="null-character-reference",o.surrogateCharacterReference="surrogate-character-reference",o.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",o.controlCharacterReference="control-character-reference",o.noncharacterCharacterReference="noncharacter-character-reference",o.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",o.missingDoctypeName="missing-doctype-name",o.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",o.duplicateAttribute="duplicate-attribute",o.nonConformingDoctype="non-conforming-doctype",o.missingDoctype="missing-doctype",o.misplacedDoctype="misplaced-doctype",o.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",o.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",o.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",o.openElementsLeftAfterEof="open-elements-left-after-eof",o.abandonedHeadElementChild="abandoned-head-element-child",o.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",o.nestedNoscriptInHead="nested-noscript-in-head",o.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(Rr||(Rr={}));const Aqn=65536;class Iqn{constructor(s){this.handler=s,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=Aqn,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(s,p){const{line:y,col:C,offset:N}=this,L=C+p,z=N+p;return{code:s,startLine:y,endLine:y,startCol:L,endCol:L,startOffset:z,endOffset:z}}_err(s){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(s,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(s){if(this.pos!==this.html.length-1){const p=this.html.charCodeAt(this.pos+1);if(Sqn(p))return this.pos++,this._addGap(),Cqn(s,p)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,ve.EOF;return this._err(Rr.surrogateInInputStream),s}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(s,p){this.html.length>0?this.html+=s:this.html=s,this.endOfChunkHit=!1,this.lastChunkWritten=p}insertHtmlAtCurrentPos(s){this.html=this.html.substring(0,this.pos+1)+s+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(s,p){if(this.pos+s.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(p)return this.html.startsWith(s,this.pos);for(let y=0;y<s.length;y++)if((this.html.charCodeAt(this.pos+y)|32)!==s.charCodeAt(y))return!1;return!0}peek(s){const p=this.pos+s;if(p>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,ve.EOF;const y=this.html.charCodeAt(p);return y===ve.CARRIAGE_RETURN?ve.LINE_FEED:y}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,ve.EOF;let s=this.html.charCodeAt(this.pos);return s===ve.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,ve.LINE_FEED):s===ve.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,xPe(s)&&(s=this._processSurrogate(s)),this.handler.onParseError===null||s>31&&s<127||s===ve.LINE_FEED||s===ve.CARRIAGE_RETURN||s>159&&s<64976||this._checkForProblematicCharacters(s),s)}_checkForProblematicCharacters(s){EPe(s)?this._err(Rr.controlCharacterInInputStream):TPe(s)&&this._err(Rr.noncharacterInInputStream)}retreat(s){for(this.pos-=s;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var ku;(function(o){o[o.CHARACTER=0]="CHARACTER",o[o.NULL_CHARACTER=1]="NULL_CHARACTER",o[o.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",o[o.START_TAG=3]="START_TAG",o[o.END_TAG=4]="END_TAG",o[o.COMMENT=5]="COMMENT",o[o.DOCTYPE=6]="DOCTYPE",o[o.EOF=7]="EOF",o[o.HIBERNATION=8]="HIBERNATION"})(ku||(ku={}));function kPe(o,s){for(let p=o.attrs.length-1;p>=0;p--)if(o.attrs[p].name===s)return o.attrs[p].value;return null}const SPe=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(o=>o.charCodeAt(0))),Oqn=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(o=>o.charCodeAt(0)));var fBt;const Nqn=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),Pqn=(fBt=String.fromCodePoint)!==null&&fBt!==void 0?fBt:function(o){let s="";return o>65535&&(o-=65536,s+=String.fromCharCode(o>>>10&1023|55296),o=56320|o&1023),s+=String.fromCharCode(o),s};function Lqn(o){var s;return o>=55296&&o<=57343||o>1114111?65533:(s=Nqn.get(o))!==null&&s!==void 0?s:o}var Gp;(function(o){o[o.NUM=35]="NUM",o[o.SEMI=59]="SEMI",o[o.EQUALS=61]="EQUALS",o[o.ZERO=48]="ZERO",o[o.NINE=57]="NINE",o[o.LOWER_A=97]="LOWER_A",o[o.LOWER_F=102]="LOWER_F",o[o.LOWER_X=120]="LOWER_X",o[o.LOWER_Z=122]="LOWER_Z",o[o.UPPER_A=65]="UPPER_A",o[o.UPPER_F=70]="UPPER_F",o[o.UPPER_Z=90]="UPPER_Z"})(Gp||(Gp={}));const Mqn=32;var cC;(function(o){o[o.VALUE_LENGTH=49152]="VALUE_LENGTH",o[o.BRANCH_LENGTH=16256]="BRANCH_LENGTH",o[o.JUMP_TABLE=127]="JUMP_TABLE"})(cC||(cC={}));function TFt(o){return o>=Gp.ZERO&&o<=Gp.NINE}function Rqn(o){return o>=Gp.UPPER_A&&o<=Gp.UPPER_F||o>=Gp.LOWER_A&&o<=Gp.LOWER_F}function Dqn(o){return o>=Gp.UPPER_A&&o<=Gp.UPPER_Z||o>=Gp.LOWER_A&&o<=Gp.LOWER_Z||TFt(o)}function Bqn(o){return o===Gp.EQUALS||Dqn(o)}var Up;(function(o){o[o.EntityStart=0]="EntityStart",o[o.NumericStart=1]="NumericStart",o[o.NumericDecimal=2]="NumericDecimal",o[o.NumericHex=3]="NumericHex",o[o.NamedEntity=4]="NamedEntity"})(Up||(Up={}));var gk;(function(o){o[o.Legacy=0]="Legacy",o[o.Strict=1]="Strict",o[o.Attribute=2]="Attribute"})(gk||(gk={}));class CPe{constructor(s,p,y){this.decodeTree=s,this.emitCodePoint=p,this.errors=y,this.state=Up.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=gk.Strict}startEntity(s){this.decodeMode=s,this.state=Up.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(s,p){switch(this.state){case Up.EntityStart:return s.charCodeAt(p)===Gp.NUM?(this.state=Up.NumericStart,this.consumed+=1,this.stateNumericStart(s,p+1)):(this.state=Up.NamedEntity,this.stateNamedEntity(s,p));case Up.NumericStart:return this.stateNumericStart(s,p);case Up.NumericDecimal:return this.stateNumericDecimal(s,p);case Up.NumericHex:return this.stateNumericHex(s,p);case Up.NamedEntity:return this.stateNamedEntity(s,p)}}stateNumericStart(s,p){return p>=s.length?-1:(s.charCodeAt(p)|Mqn)===Gp.LOWER_X?(this.state=Up.NumericHex,this.consumed+=1,this.stateNumericHex(s,p+1)):(this.state=Up.NumericDecimal,this.stateNumericDecimal(s,p))}addToNumericResult(s,p,y,C){if(p!==y){const N=y-p;this.result=this.result*Math.pow(C,N)+parseInt(s.substr(p,N),C),this.consumed+=N}}stateNumericHex(s,p){const y=p;for(;p<s.length;){const C=s.charCodeAt(p);if(TFt(C)||Rqn(C))p+=1;else return this.addToNumericResult(s,y,p,16),this.emitNumericEntity(C,3)}return this.addToNumericResult(s,y,p,16),-1}stateNumericDecimal(s,p){const y=p;for(;p<s.length;){const C=s.charCodeAt(p);if(TFt(C))p+=1;else return this.addToNumericResult(s,y,p,10),this.emitNumericEntity(C,2)}return this.addToNumericResult(s,y,p,10),-1}emitNumericEntity(s,p){var y;if(this.consumed<=p)return(y=this.errors)===null||y===void 0||y.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(s===Gp.SEMI)this.consumed+=1;else if(this.decodeMode===gk.Strict)return 0;return this.emitCodePoint(Lqn(this.result),this.consumed),this.errors&&(s!==Gp.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(s,p){const{decodeTree:y}=this;let C=y[this.treeIndex],N=(C&cC.VALUE_LENGTH)>>14;for(;p<s.length;p++,this.excess++){const L=s.charCodeAt(p);if(this.treeIndex=Fqn(y,C,this.treeIndex+Math.max(1,N),L),this.treeIndex<0)return this.result===0||this.decodeMode===gk.Attribute&&(N===0||Bqn(L))?0:this.emitNotTerminatedNamedEntity();if(C=y[this.treeIndex],N=(C&cC.VALUE_LENGTH)>>14,N!==0){if(L===Gp.SEMI)return this.emitNamedEntityData(this.treeIndex,N,this.consumed+this.excess);this.decodeMode!==gk.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var s;const{result:p,decodeTree:y}=this,C=(y[p]&cC.VALUE_LENGTH)>>14;return this.emitNamedEntityData(p,C,this.consumed),(s=this.errors)===null||s===void 0||s.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(s,p,y){const{decodeTree:C}=this;return this.emitCodePoint(p===1?C[s]&~cC.VALUE_LENGTH:C[s+1],y),p===3&&this.emitCodePoint(C[s+2],y),y}end(){var s;switch(this.state){case Up.NamedEntity:return this.result!==0&&(this.decodeMode!==gk.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Up.NumericDecimal:return this.emitNumericEntity(0,2);case Up.NumericHex:return this.emitNumericEntity(0,3);case Up.NumericStart:return(s=this.errors)===null||s===void 0||s.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Up.EntityStart:return 0}}}function APe(o){let s="";const p=new CPe(o,y=>s+=Pqn(y));return function(C,N){let L=0,z=0;for(;(z=C.indexOf("&",z))>=0;){s+=C.slice(L,z),p.startEntity(N);const q=p.write(C,z+1);if(q<0){L=z+p.end();break}L=z+q,z=q===0?L+1:L}const G=s+C.slice(L);return s="",G}}function Fqn(o,s,p,y){const C=(s&cC.BRANCH_LENGTH)>>7,N=s&cC.JUMP_TABLE;if(C===0)return N!==0&&y===N?p:-1;if(N){const G=y-N;return G<0||G>=C?-1:o[p+G]-1}let L=p,z=L+C-1;for(;L<=z;){const G=L+z>>>1,q=o[G];if(q<y)L=G+1;else if(q>y)z=G-1;else return o[G+C]}return-1}APe(SPe);APe(Oqn);var Di;(function(o){o.HTML="http://www.w3.org/1999/xhtml",o.MATHML="http://www.w3.org/1998/Math/MathML",o.SVG="http://www.w3.org/2000/svg",o.XLINK="http://www.w3.org/1999/xlink",o.XML="http://www.w3.org/XML/1998/namespace",o.XMLNS="http://www.w3.org/2000/xmlns/"})(Di||(Di={}));var pP;(function(o){o.TYPE="type",o.ACTION="action",o.ENCODING="encoding",o.PROMPT="prompt",o.NAME="name",o.COLOR="color",o.FACE="face",o.SIZE="size"})(pP||(pP={}));var C3;(function(o){o.NO_QUIRKS="no-quirks",o.QUIRKS="quirks",o.LIMITED_QUIRKS="limited-quirks"})(C3||(C3={}));var tr;(function(o){o.A="a",o.ADDRESS="address",o.ANNOTATION_XML="annotation-xml",o.APPLET="applet",o.AREA="area",o.ARTICLE="article",o.ASIDE="aside",o.B="b",o.BASE="base",o.BASEFONT="basefont",o.BGSOUND="bgsound",o.BIG="big",o.BLOCKQUOTE="blockquote",o.BODY="body",o.BR="br",o.BUTTON="button",o.CAPTION="caption",o.CENTER="center",o.CODE="code",o.COL="col",o.COLGROUP="colgroup",o.DD="dd",o.DESC="desc",o.DETAILS="details",o.DIALOG="dialog",o.DIR="dir",o.DIV="div",o.DL="dl",o.DT="dt",o.EM="em",o.EMBED="embed",o.FIELDSET="fieldset",o.FIGCAPTION="figcaption",o.FIGURE="figure",o.FONT="font",o.FOOTER="footer",o.FOREIGN_OBJECT="foreignObject",o.FORM="form",o.FRAME="frame",o.FRAMESET="frameset",o.H1="h1",o.H2="h2",o.H3="h3",o.H4="h4",o.H5="h5",o.H6="h6",o.HEAD="head",o.HEADER="header",o.HGROUP="hgroup",o.HR="hr",o.HTML="html",o.I="i",o.IMG="img",o.IMAGE="image",o.INPUT="input",o.IFRAME="iframe",o.KEYGEN="keygen",o.LABEL="label",o.LI="li",o.LINK="link",o.LISTING="listing",o.MAIN="main",o.MALIGNMARK="malignmark",o.MARQUEE="marquee",o.MATH="math",o.MENU="menu",o.META="meta",o.MGLYPH="mglyph",o.MI="mi",o.MO="mo",o.MN="mn",o.MS="ms",o.MTEXT="mtext",o.NAV="nav",o.NOBR="nobr",o.NOFRAMES="noframes",o.NOEMBED="noembed",o.NOSCRIPT="noscript",o.OBJECT="object",o.OL="ol",o.OPTGROUP="optgroup",o.OPTION="option",o.P="p",o.PARAM="param",o.PLAINTEXT="plaintext",o.PRE="pre",o.RB="rb",o.RP="rp",o.RT="rt",o.RTC="rtc",o.RUBY="ruby",o.S="s",o.SCRIPT="script",o.SEARCH="search",o.SECTION="section",o.SELECT="select",o.SOURCE="source",o.SMALL="small",o.SPAN="span",o.STRIKE="strike",o.STRONG="strong",o.STYLE="style",o.SUB="sub",o.SUMMARY="summary",o.SUP="sup",o.TABLE="table",o.TBODY="tbody",o.TEMPLATE="template",o.TEXTAREA="textarea",o.TFOOT="tfoot",o.TD="td",o.TH="th",o.THEAD="thead",o.TITLE="title",o.TR="tr",o.TRACK="track",o.TT="tt",o.U="u",o.UL="ul",o.SVG="svg",o.VAR="var",o.WBR="wbr",o.XMP="xmp"})(tr||(tr={}));var dt;(function(o){o[o.UNKNOWN=0]="UNKNOWN",o[o.A=1]="A",o[o.ADDRESS=2]="ADDRESS",o[o.ANNOTATION_XML=3]="ANNOTATION_XML",o[o.APPLET=4]="APPLET",o[o.AREA=5]="AREA",o[o.ARTICLE=6]="ARTICLE",o[o.ASIDE=7]="ASIDE",o[o.B=8]="B",o[o.BASE=9]="BASE",o[o.BASEFONT=10]="BASEFONT",o[o.BGSOUND=11]="BGSOUND",o[o.BIG=12]="BIG",o[o.BLOCKQUOTE=13]="BLOCKQUOTE",o[o.BODY=14]="BODY",o[o.BR=15]="BR",o[o.BUTTON=16]="BUTTON",o[o.CAPTION=17]="CAPTION",o[o.CENTER=18]="CENTER",o[o.CODE=19]="CODE",o[o.COL=20]="COL",o[o.COLGROUP=21]="COLGROUP",o[o.DD=22]="DD",o[o.DESC=23]="DESC",o[o.DETAILS=24]="DETAILS",o[o.DIALOG=25]="DIALOG",o[o.DIR=26]="DIR",o[o.DIV=27]="DIV",o[o.DL=28]="DL",o[o.DT=29]="DT",o[o.EM=30]="EM",o[o.EMBED=31]="EMBED",o[o.FIELDSET=32]="FIELDSET",o[o.FIGCAPTION=33]="FIGCAPTION",o[o.FIGURE=34]="FIGURE",o[o.FONT=35]="FONT",o[o.FOOTER=36]="FOOTER",o[o.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",o[o.FORM=38]="FORM",o[o.FRAME=39]="FRAME",o[o.FRAMESET=40]="FRAMESET",o[o.H1=41]="H1",o[o.H2=42]="H2",o[o.H3=43]="H3",o[o.H4=44]="H4",o[o.H5=45]="H5",o[o.H6=46]="H6",o[o.HEAD=47]="HEAD",o[o.HEADER=48]="HEADER",o[o.HGROUP=49]="HGROUP",o[o.HR=50]="HR",o[o.HTML=51]="HTML",o[o.I=52]="I",o[o.IMG=53]="IMG",o[o.IMAGE=54]="IMAGE",o[o.INPUT=55]="INPUT",o[o.IFRAME=56]="IFRAME",o[o.KEYGEN=57]="KEYGEN",o[o.LABEL=58]="LABEL",o[o.LI=59]="LI",o[o.LINK=60]="LINK",o[o.LISTING=61]="LISTING",o[o.MAIN=62]="MAIN",o[o.MALIGNMARK=63]="MALIGNMARK",o[o.MARQUEE=64]="MARQUEE",o[o.MATH=65]="MATH",o[o.MENU=66]="MENU",o[o.META=67]="META",o[o.MGLYPH=68]="MGLYPH",o[o.MI=69]="MI",o[o.MO=70]="MO",o[o.MN=71]="MN",o[o.MS=72]="MS",o[o.MTEXT=73]="MTEXT",o[o.NAV=74]="NAV",o[o.NOBR=75]="NOBR",o[o.NOFRAMES=76]="NOFRAMES",o[o.NOEMBED=77]="NOEMBED",o[o.NOSCRIPT=78]="NOSCRIPT",o[o.OBJECT=79]="OBJECT",o[o.OL=80]="OL",o[o.OPTGROUP=81]="OPTGROUP",o[o.OPTION=82]="OPTION",o[o.P=83]="P",o[o.PARAM=84]="PARAM",o[o.PLAINTEXT=85]="PLAINTEXT",o[o.PRE=86]="PRE",o[o.RB=87]="RB",o[o.RP=88]="RP",o[o.RT=89]="RT",o[o.RTC=90]="RTC",o[o.RUBY=91]="RUBY",o[o.S=92]="S",o[o.SCRIPT=93]="SCRIPT",o[o.SEARCH=94]="SEARCH",o[o.SECTION=95]="SECTION",o[o.SELECT=96]="SELECT",o[o.SOURCE=97]="SOURCE",o[o.SMALL=98]="SMALL",o[o.SPAN=99]="SPAN",o[o.STRIKE=100]="STRIKE",o[o.STRONG=101]="STRONG",o[o.STYLE=102]="STYLE",o[o.SUB=103]="SUB",o[o.SUMMARY=104]="SUMMARY",o[o.SUP=105]="SUP",o[o.TABLE=106]="TABLE",o[o.TBODY=107]="TBODY",o[o.TEMPLATE=108]="TEMPLATE",o[o.TEXTAREA=109]="TEXTAREA",o[o.TFOOT=110]="TFOOT",o[o.TD=111]="TD",o[o.TH=112]="TH",o[o.THEAD=113]="THEAD",o[o.TITLE=114]="TITLE",o[o.TR=115]="TR",o[o.TRACK=116]="TRACK",o[o.TT=117]="TT",o[o.U=118]="U",o[o.UL=119]="UL",o[o.SVG=120]="SVG",o[o.VAR=121]="VAR",o[o.WBR=122]="WBR",o[o.XMP=123]="XMP"})(dt||(dt={}));const $qn=new Map([[tr.A,dt.A],[tr.ADDRESS,dt.ADDRESS],[tr.ANNOTATION_XML,dt.ANNOTATION_XML],[tr.APPLET,dt.APPLET],[tr.AREA,dt.AREA],[tr.ARTICLE,dt.ARTICLE],[tr.ASIDE,dt.ASIDE],[tr.B,dt.B],[tr.BASE,dt.BASE],[tr.BASEFONT,dt.BASEFONT],[tr.BGSOUND,dt.BGSOUND],[tr.BIG,dt.BIG],[tr.BLOCKQUOTE,dt.BLOCKQUOTE],[tr.BODY,dt.BODY],[tr.BR,dt.BR],[tr.BUTTON,dt.BUTTON],[tr.CAPTION,dt.CAPTION],[tr.CENTER,dt.CENTER],[tr.CODE,dt.CODE],[tr.COL,dt.COL],[tr.COLGROUP,dt.COLGROUP],[tr.DD,dt.DD],[tr.DESC,dt.DESC],[tr.DETAILS,dt.DETAILS],[tr.DIALOG,dt.DIALOG],[tr.DIR,dt.DIR],[tr.DIV,dt.DIV],[tr.DL,dt.DL],[tr.DT,dt.DT],[tr.EM,dt.EM],[tr.EMBED,dt.EMBED],[tr.FIELDSET,dt.FIELDSET],[tr.FIGCAPTION,dt.FIGCAPTION],[tr.FIGURE,dt.FIGURE],[tr.FONT,dt.FONT],[tr.FOOTER,dt.FOOTER],[tr.FOREIGN_OBJECT,dt.FOREIGN_OBJECT],[tr.FORM,dt.FORM],[tr.FRAME,dt.FRAME],[tr.FRAMESET,dt.FRAMESET],[tr.H1,dt.H1],[tr.H2,dt.H2],[tr.H3,dt.H3],[tr.H4,dt.H4],[tr.H5,dt.H5],[tr.H6,dt.H6],[tr.HEAD,dt.HEAD],[tr.HEADER,dt.HEADER],[tr.HGROUP,dt.HGROUP],[tr.HR,dt.HR],[tr.HTML,dt.HTML],[tr.I,dt.I],[tr.IMG,dt.IMG],[tr.IMAGE,dt.IMAGE],[tr.INPUT,dt.INPUT],[tr.IFRAME,dt.IFRAME],[tr.KEYGEN,dt.KEYGEN],[tr.LABEL,dt.LABEL],[tr.LI,dt.LI],[tr.LINK,dt.LINK],[tr.LISTING,dt.LISTING],[tr.MAIN,dt.MAIN],[tr.MALIGNMARK,dt.MALIGNMARK],[tr.MARQUEE,dt.MARQUEE],[tr.MATH,dt.MATH],[tr.MENU,dt.MENU],[tr.META,dt.META],[tr.MGLYPH,dt.MGLYPH],[tr.MI,dt.MI],[tr.MO,dt.MO],[tr.MN,dt.MN],[tr.MS,dt.MS],[tr.MTEXT,dt.MTEXT],[tr.NAV,dt.NAV],[tr.NOBR,dt.NOBR],[tr.NOFRAMES,dt.NOFRAMES],[tr.NOEMBED,dt.NOEMBED],[tr.NOSCRIPT,dt.NOSCRIPT],[tr.OBJECT,dt.OBJECT],[tr.OL,dt.OL],[tr.OPTGROUP,dt.OPTGROUP],[tr.OPTION,dt.OPTION],[tr.P,dt.P],[tr.PARAM,dt.PARAM],[tr.PLAINTEXT,dt.PLAINTEXT],[tr.PRE,dt.PRE],[tr.RB,dt.RB],[tr.RP,dt.RP],[tr.RT,dt.RT],[tr.RTC,dt.RTC],[tr.RUBY,dt.RUBY],[tr.S,dt.S],[tr.SCRIPT,dt.SCRIPT],[tr.SEARCH,dt.SEARCH],[tr.SECTION,dt.SECTION],[tr.SELECT,dt.SELECT],[tr.SOURCE,dt.SOURCE],[tr.SMALL,dt.SMALL],[tr.SPAN,dt.SPAN],[tr.STRIKE,dt.STRIKE],[tr.STRONG,dt.STRONG],[tr.STYLE,dt.STYLE],[tr.SUB,dt.SUB],[tr.SUMMARY,dt.SUMMARY],[tr.SUP,dt.SUP],[tr.TABLE,dt.TABLE],[tr.TBODY,dt.TBODY],[tr.TEMPLATE,dt.TEMPLATE],[tr.TEXTAREA,dt.TEXTAREA],[tr.TFOOT,dt.TFOOT],[tr.TD,dt.TD],[tr.TH,dt.TH],[tr.THEAD,dt.THEAD],[tr.TITLE,dt.TITLE],[tr.TR,dt.TR],[tr.TRACK,dt.TRACK],[tr.TT,dt.TT],[tr.U,dt.U],[tr.UL,dt.UL],[tr.SVG,dt.SVG],[tr.VAR,dt.VAR],[tr.WBR,dt.WBR],[tr.XMP,dt.XMP]]);function p$(o){var s;return(s=$qn.get(o))!==null&&s!==void 0?s:dt.UNKNOWN}const Xi=dt,jqn={[Di.HTML]:new Set([Xi.ADDRESS,Xi.APPLET,Xi.AREA,Xi.ARTICLE,Xi.ASIDE,Xi.BASE,Xi.BASEFONT,Xi.BGSOUND,Xi.BLOCKQUOTE,Xi.BODY,Xi.BR,Xi.BUTTON,Xi.CAPTION,Xi.CENTER,Xi.COL,Xi.COLGROUP,Xi.DD,Xi.DETAILS,Xi.DIR,Xi.DIV,Xi.DL,Xi.DT,Xi.EMBED,Xi.FIELDSET,Xi.FIGCAPTION,Xi.FIGURE,Xi.FOOTER,Xi.FORM,Xi.FRAME,Xi.FRAMESET,Xi.H1,Xi.H2,Xi.H3,Xi.H4,Xi.H5,Xi.H6,Xi.HEAD,Xi.HEADER,Xi.HGROUP,Xi.HR,Xi.HTML,Xi.IFRAME,Xi.IMG,Xi.INPUT,Xi.LI,Xi.LINK,Xi.LISTING,Xi.MAIN,Xi.MARQUEE,Xi.MENU,Xi.META,Xi.NAV,Xi.NOEMBED,Xi.NOFRAMES,Xi.NOSCRIPT,Xi.OBJECT,Xi.OL,Xi.P,Xi.PARAM,Xi.PLAINTEXT,Xi.PRE,Xi.SCRIPT,Xi.SECTION,Xi.SELECT,Xi.SOURCE,Xi.STYLE,Xi.SUMMARY,Xi.TABLE,Xi.TBODY,Xi.TD,Xi.TEMPLATE,Xi.TEXTAREA,Xi.TFOOT,Xi.TH,Xi.THEAD,Xi.TITLE,Xi.TR,Xi.TRACK,Xi.UL,Xi.WBR,Xi.XMP]),[Di.MATHML]:new Set([Xi.MI,Xi.MO,Xi.MN,Xi.MS,Xi.MTEXT,Xi.ANNOTATION_XML]),[Di.SVG]:new Set([Xi.TITLE,Xi.FOREIGN_OBJECT,Xi.DESC]),[Di.XLINK]:new Set,[Di.XML]:new Set,[Di.XMLNS]:new Set},kFt=new Set([Xi.H1,Xi.H2,Xi.H3,Xi.H4,Xi.H5,Xi.H6]);tr.STYLE,tr.SCRIPT,tr.XMP,tr.IFRAME,tr.NOEMBED,tr.NOFRAMES,tr.PLAINTEXT;var $e;(function(o){o[o.DATA=0]="DATA",o[o.RCDATA=1]="RCDATA",o[o.RAWTEXT=2]="RAWTEXT",o[o.SCRIPT_DATA=3]="SCRIPT_DATA",o[o.PLAINTEXT=4]="PLAINTEXT",o[o.TAG_OPEN=5]="TAG_OPEN",o[o.END_TAG_OPEN=6]="END_TAG_OPEN",o[o.TAG_NAME=7]="TAG_NAME",o[o.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",o[o.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",o[o.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",o[o.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",o[o.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",o[o.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",o[o.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",o[o.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",o[o.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",o[o.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",o[o.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",o[o.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",o[o.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",o[o.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",o[o.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",o[o.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",o[o.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",o[o.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",o[o.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",o[o.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",o[o.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",o[o.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",o[o.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",o[o.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",o[o.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",o[o.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",o[o.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",o[o.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",o[o.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",o[o.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",o[o.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",o[o.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",o[o.BOGUS_COMMENT=40]="BOGUS_COMMENT",o[o.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",o[o.COMMENT_START=42]="COMMENT_START",o[o.COMMENT_START_DASH=43]="COMMENT_START_DASH",o[o.COMMENT=44]="COMMENT",o[o.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",o[o.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",o[o.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",o[o.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",o[o.COMMENT_END_DASH=49]="COMMENT_END_DASH",o[o.COMMENT_END=50]="COMMENT_END",o[o.COMMENT_END_BANG=51]="COMMENT_END_BANG",o[o.DOCTYPE=52]="DOCTYPE",o[o.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",o[o.DOCTYPE_NAME=54]="DOCTYPE_NAME",o[o.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",o[o.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",o[o.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",o[o.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",o[o.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",o[o.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",o[o.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",o[o.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",o[o.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",o[o.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",o[o.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",o[o.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",o[o.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",o[o.CDATA_SECTION=68]="CDATA_SECTION",o[o.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",o[o.CDATA_SECTION_END=70]="CDATA_SECTION_END",o[o.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",o[o.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})($e||($e={}));const N1={DATA:$e.DATA,RCDATA:$e.RCDATA,RAWTEXT:$e.RAWTEXT,SCRIPT_DATA:$e.SCRIPT_DATA,PLAINTEXT:$e.PLAINTEXT,CDATA_SECTION:$e.CDATA_SECTION};function Hqn(o){return o>=ve.DIGIT_0&&o<=ve.DIGIT_9}function SQ(o){return o>=ve.LATIN_CAPITAL_A&&o<=ve.LATIN_CAPITAL_Z}function zqn(o){return o>=ve.LATIN_SMALL_A&&o<=ve.LATIN_SMALL_Z}function aC(o){return zqn(o)||SQ(o)}function mAe(o){return aC(o)||Hqn(o)}function $bt(o){return o+32}function IPe(o){return o===ve.SPACE||o===ve.LINE_FEED||o===ve.TABULATION||o===ve.FORM_FEED}function yAe(o){return IPe(o)||o===ve.SOLIDUS||o===ve.GREATER_THAN_SIGN}function Uqn(o){return o===ve.NULL?Rr.nullCharacterReference:o>1114111?Rr.characterReferenceOutsideUnicodeRange:xPe(o)?Rr.surrogateCharacterReference:TPe(o)?Rr.noncharacterCharacterReference:EPe(o)||o===ve.CARRIAGE_RETURN?Rr.controlCharacterReference:null}class qqn{constructor(s,p){this.options=s,this.handler=p,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=$e.DATA,this.returnState=$e.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new Iqn(p),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new CPe(SPe,(y,C)=>{this.preprocessor.pos=this.entityStartPos+C-1,this._flushCodePointConsumedAsCharacterReference(y)},p.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(Rr.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:y=>{this._err(Rr.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+y)},validateNumericCharacterReference:y=>{const C=Uqn(y);C&&this._err(C,1)}}:void 0)}_err(s,p=0){var y,C;(C=(y=this.handler).onParseError)===null||C===void 0||C.call(y,this.preprocessor.getError(s,p))}getCurrentLocation(s){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-s,startOffset:this.preprocessor.offset-s,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const s=this._consume();this._ensureHibernation()||this._callState(s)}this.inLoop=!1}}pause(){this.paused=!0}resume(s){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||s==null||s())}write(s,p,y){this.active=!0,this.preprocessor.write(s,p),this._runParsingLoop(),this.paused||y==null||y()}insertHtmlAtCurrentPos(s){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(s),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(s){this.consumedAfterSnapshot+=s;for(let p=0;p<s;p++)this.preprocessor.advance()}_consumeSequenceIfMatch(s,p){return this.preprocessor.startsWith(s,p)?(this._advanceBy(s.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:ku.START_TAG,tagName:"",tagID:dt.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:ku.END_TAG,tagName:"",tagID:dt.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(s){this.currentToken={type:ku.COMMENT,data:"",location:this.getCurrentLocation(s)}}_createDoctypeToken(s){this.currentToken={type:ku.DOCTYPE,name:s,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(s,p){this.currentCharacterToken={type:s,chars:p,location:this.currentLocation}}_createAttr(s){this.currentAttr={name:s,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var s,p;const y=this.currentToken;if(kPe(y,this.currentAttr.name)===null){if(y.attrs.push(this.currentAttr),y.location&&this.currentLocation){const C=(s=(p=y.location).attrs)!==null&&s!==void 0?s:p.attrs=Object.create(null);C[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(Rr.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(s){this._emitCurrentCharacterToken(s.location),this.currentToken=null,s.location&&(s.location.endLine=this.preprocessor.line,s.location.endCol=this.preprocessor.col+1,s.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const s=this.currentToken;this.prepareToken(s),s.tagID=p$(s.tagName),s.type===ku.START_TAG?(this.lastStartTagName=s.tagName,this.handler.onStartTag(s)):(s.attrs.length>0&&this._err(Rr.endTagWithAttributes),s.selfClosing&&this._err(Rr.endTagWithTrailingSolidus),this.handler.onEndTag(s)),this.preprocessor.dropParsedChunk()}emitCurrentComment(s){this.prepareToken(s),this.handler.onComment(s),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(s){this.prepareToken(s),this.handler.onDoctype(s),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(s){if(this.currentCharacterToken){switch(s&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=s.startLine,this.currentCharacterToken.location.endCol=s.startCol,this.currentCharacterToken.location.endOffset=s.startOffset),this.currentCharacterToken.type){case ku.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case ku.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case ku.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const s=this.getCurrentLocation(0);s&&(s.endLine=s.startLine,s.endCol=s.startCol,s.endOffset=s.startOffset),this._emitCurrentCharacterToken(s),this.handler.onEof({type:ku.EOF,location:s}),this.active=!1}_appendCharToCurrentCharacterToken(s,p){if(this.currentCharacterToken)if(this.currentCharacterToken.type===s){this.currentCharacterToken.chars+=p;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(s,p)}_emitCodePoint(s){const p=IPe(s)?ku.WHITESPACE_CHARACTER:s===ve.NULL?ku.NULL_CHARACTER:ku.CHARACTER;this._appendCharToCurrentCharacterToken(p,String.fromCodePoint(s))}_emitChars(s){this._appendCharToCurrentCharacterToken(ku.CHARACTER,s)}_startCharacterReference(){this.returnState=this.state,this.state=$e.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?gk.Attribute:gk.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===$e.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===$e.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===$e.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(s){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(s):this._emitCodePoint(s)}_callState(s){switch(this.state){case $e.DATA:{this._stateData(s);break}case $e.RCDATA:{this._stateRcdata(s);break}case $e.RAWTEXT:{this._stateRawtext(s);break}case $e.SCRIPT_DATA:{this._stateScriptData(s);break}case $e.PLAINTEXT:{this._statePlaintext(s);break}case $e.TAG_OPEN:{this._stateTagOpen(s);break}case $e.END_TAG_OPEN:{this._stateEndTagOpen(s);break}case $e.TAG_NAME:{this._stateTagName(s);break}case $e.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(s);break}case $e.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(s);break}case $e.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(s);break}case $e.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(s);break}case $e.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(s);break}case $e.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(s);break}case $e.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(s);break}case $e.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(s);break}case $e.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(s);break}case $e.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(s);break}case $e.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(s);break}case $e.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(s);break}case $e.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(s);break}case $e.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(s);break}case $e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(s);break}case $e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(s);break}case $e.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(s);break}case $e.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(s);break}case $e.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(s);break}case $e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(s);break}case $e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(s);break}case $e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(s);break}case $e.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(s);break}case $e.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(s);break}case $e.ATTRIBUTE_NAME:{this._stateAttributeName(s);break}case $e.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(s);break}case $e.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(s);break}case $e.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(s);break}case $e.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(s);break}case $e.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(s);break}case $e.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(s);break}case $e.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(s);break}case $e.BOGUS_COMMENT:{this._stateBogusComment(s);break}case $e.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(s);break}case $e.COMMENT_START:{this._stateCommentStart(s);break}case $e.COMMENT_START_DASH:{this._stateCommentStartDash(s);break}case $e.COMMENT:{this._stateComment(s);break}case $e.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(s);break}case $e.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(s);break}case $e.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(s);break}case $e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(s);break}case $e.COMMENT_END_DASH:{this._stateCommentEndDash(s);break}case $e.COMMENT_END:{this._stateCommentEnd(s);break}case $e.COMMENT_END_BANG:{this._stateCommentEndBang(s);break}case $e.DOCTYPE:{this._stateDoctype(s);break}case $e.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(s);break}case $e.DOCTYPE_NAME:{this._stateDoctypeName(s);break}case $e.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(s);break}case $e.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(s);break}case $e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(s);break}case $e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(s);break}case $e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(s);break}case $e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(s);break}case $e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(s);break}case $e.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(s);break}case $e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(s);break}case $e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(s);break}case $e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(s);break}case $e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(s);break}case $e.BOGUS_DOCTYPE:{this._stateBogusDoctype(s);break}case $e.CDATA_SECTION:{this._stateCdataSection(s);break}case $e.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(s);break}case $e.CDATA_SECTION_END:{this._stateCdataSectionEnd(s);break}case $e.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case $e.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(s);break}default:throw new Error("Unknown state")}}_stateData(s){switch(s){case ve.LESS_THAN_SIGN:{this.state=$e.TAG_OPEN;break}case ve.AMPERSAND:{this._startCharacterReference();break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),this._emitCodePoint(s);break}case ve.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(s)}}_stateRcdata(s){switch(s){case ve.AMPERSAND:{this._startCharacterReference();break}case ve.LESS_THAN_SIGN:{this.state=$e.RCDATA_LESS_THAN_SIGN;break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),this._emitChars(Vf);break}case ve.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(s)}}_stateRawtext(s){switch(s){case ve.LESS_THAN_SIGN:{this.state=$e.RAWTEXT_LESS_THAN_SIGN;break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),this._emitChars(Vf);break}case ve.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(s)}}_stateScriptData(s){switch(s){case ve.LESS_THAN_SIGN:{this.state=$e.SCRIPT_DATA_LESS_THAN_SIGN;break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),this._emitChars(Vf);break}case ve.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(s)}}_statePlaintext(s){switch(s){case ve.NULL:{this._err(Rr.unexpectedNullCharacter),this._emitChars(Vf);break}case ve.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(s)}}_stateTagOpen(s){if(aC(s))this._createStartTagToken(),this.state=$e.TAG_NAME,this._stateTagName(s);else switch(s){case ve.EXCLAMATION_MARK:{this.state=$e.MARKUP_DECLARATION_OPEN;break}case ve.SOLIDUS:{this.state=$e.END_TAG_OPEN;break}case ve.QUESTION_MARK:{this._err(Rr.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=$e.BOGUS_COMMENT,this._stateBogusComment(s);break}case ve.EOF:{this._err(Rr.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(Rr.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=$e.DATA,this._stateData(s)}}_stateEndTagOpen(s){if(aC(s))this._createEndTagToken(),this.state=$e.TAG_NAME,this._stateTagName(s);else switch(s){case ve.GREATER_THAN_SIGN:{this._err(Rr.missingEndTagName),this.state=$e.DATA;break}case ve.EOF:{this._err(Rr.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(Rr.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=$e.BOGUS_COMMENT,this._stateBogusComment(s)}}_stateTagName(s){const p=this.currentToken;switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:{this.state=$e.BEFORE_ATTRIBUTE_NAME;break}case ve.SOLIDUS:{this.state=$e.SELF_CLOSING_START_TAG;break}case ve.GREATER_THAN_SIGN:{this.state=$e.DATA,this.emitCurrentTagToken();break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),p.tagName+=Vf;break}case ve.EOF:{this._err(Rr.eofInTag),this._emitEOFToken();break}default:p.tagName+=String.fromCodePoint(SQ(s)?$bt(s):s)}}_stateRcdataLessThanSign(s){s===ve.SOLIDUS?this.state=$e.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=$e.RCDATA,this._stateRcdata(s))}_stateRcdataEndTagOpen(s){aC(s)?(this.state=$e.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(s)):(this._emitChars("</"),this.state=$e.RCDATA,this._stateRcdata(s))}handleSpecialEndTag(s){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const p=this.currentToken;switch(p.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=$e.BEFORE_ATTRIBUTE_NAME,!1;case ve.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=$e.SELF_CLOSING_START_TAG,!1;case ve.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=$e.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(s){this.handleSpecialEndTag(s)&&(this._emitChars("</"),this.state=$e.RCDATA,this._stateRcdata(s))}_stateRawtextLessThanSign(s){s===ve.SOLIDUS?this.state=$e.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=$e.RAWTEXT,this._stateRawtext(s))}_stateRawtextEndTagOpen(s){aC(s)?(this.state=$e.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(s)):(this._emitChars("</"),this.state=$e.RAWTEXT,this._stateRawtext(s))}_stateRawtextEndTagName(s){this.handleSpecialEndTag(s)&&(this._emitChars("</"),this.state=$e.RAWTEXT,this._stateRawtext(s))}_stateScriptDataLessThanSign(s){switch(s){case ve.SOLIDUS:{this.state=$e.SCRIPT_DATA_END_TAG_OPEN;break}case ve.EXCLAMATION_MARK:{this.state=$e.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=$e.SCRIPT_DATA,this._stateScriptData(s)}}_stateScriptDataEndTagOpen(s){aC(s)?(this.state=$e.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(s)):(this._emitChars("</"),this.state=$e.SCRIPT_DATA,this._stateScriptData(s))}_stateScriptDataEndTagName(s){this.handleSpecialEndTag(s)&&(this._emitChars("</"),this.state=$e.SCRIPT_DATA,this._stateScriptData(s))}_stateScriptDataEscapeStart(s){s===ve.HYPHEN_MINUS?(this.state=$e.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=$e.SCRIPT_DATA,this._stateScriptData(s))}_stateScriptDataEscapeStartDash(s){s===ve.HYPHEN_MINUS?(this.state=$e.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=$e.SCRIPT_DATA,this._stateScriptData(s))}_stateScriptDataEscaped(s){switch(s){case ve.HYPHEN_MINUS:{this.state=$e.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case ve.LESS_THAN_SIGN:{this.state=$e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),this._emitChars(Vf);break}case ve.EOF:{this._err(Rr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(s)}}_stateScriptDataEscapedDash(s){switch(s){case ve.HYPHEN_MINUS:{this.state=$e.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case ve.LESS_THAN_SIGN:{this.state=$e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),this.state=$e.SCRIPT_DATA_ESCAPED,this._emitChars(Vf);break}case ve.EOF:{this._err(Rr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=$e.SCRIPT_DATA_ESCAPED,this._emitCodePoint(s)}}_stateScriptDataEscapedDashDash(s){switch(s){case ve.HYPHEN_MINUS:{this._emitChars("-");break}case ve.LESS_THAN_SIGN:{this.state=$e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case ve.GREATER_THAN_SIGN:{this.state=$e.SCRIPT_DATA,this._emitChars(">");break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),this.state=$e.SCRIPT_DATA_ESCAPED,this._emitChars(Vf);break}case ve.EOF:{this._err(Rr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=$e.SCRIPT_DATA_ESCAPED,this._emitCodePoint(s)}}_stateScriptDataEscapedLessThanSign(s){s===ve.SOLIDUS?this.state=$e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:aC(s)?(this._emitChars("<"),this.state=$e.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(s)):(this._emitChars("<"),this.state=$e.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(s))}_stateScriptDataEscapedEndTagOpen(s){aC(s)?(this.state=$e.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(s)):(this._emitChars("</"),this.state=$e.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(s))}_stateScriptDataEscapedEndTagName(s){this.handleSpecialEndTag(s)&&(this._emitChars("</"),this.state=$e.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(s))}_stateScriptDataDoubleEscapeStart(s){if(this.preprocessor.startsWith(X2.SCRIPT,!1)&&yAe(this.preprocessor.peek(X2.SCRIPT.length))){this._emitCodePoint(s);for(let p=0;p<X2.SCRIPT.length;p++)this._emitCodePoint(this._consume());this.state=$e.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=$e.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(s))}_stateScriptDataDoubleEscaped(s){switch(s){case ve.HYPHEN_MINUS:{this.state=$e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case ve.LESS_THAN_SIGN:{this.state=$e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),this._emitChars(Vf);break}case ve.EOF:{this._err(Rr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(s)}}_stateScriptDataDoubleEscapedDash(s){switch(s){case ve.HYPHEN_MINUS:{this.state=$e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case ve.LESS_THAN_SIGN:{this.state=$e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),this.state=$e.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Vf);break}case ve.EOF:{this._err(Rr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=$e.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(s)}}_stateScriptDataDoubleEscapedDashDash(s){switch(s){case ve.HYPHEN_MINUS:{this._emitChars("-");break}case ve.LESS_THAN_SIGN:{this.state=$e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case ve.GREATER_THAN_SIGN:{this.state=$e.SCRIPT_DATA,this._emitChars(">");break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),this.state=$e.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Vf);break}case ve.EOF:{this._err(Rr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=$e.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(s)}}_stateScriptDataDoubleEscapedLessThanSign(s){s===ve.SOLIDUS?(this.state=$e.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=$e.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(s))}_stateScriptDataDoubleEscapeEnd(s){if(this.preprocessor.startsWith(X2.SCRIPT,!1)&&yAe(this.preprocessor.peek(X2.SCRIPT.length))){this._emitCodePoint(s);for(let p=0;p<X2.SCRIPT.length;p++)this._emitCodePoint(this._consume());this.state=$e.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=$e.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(s))}_stateBeforeAttributeName(s){switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:break;case ve.SOLIDUS:case ve.GREATER_THAN_SIGN:case ve.EOF:{this.state=$e.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(s);break}case ve.EQUALS_SIGN:{this._err(Rr.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=$e.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=$e.ATTRIBUTE_NAME,this._stateAttributeName(s)}}_stateAttributeName(s){switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:case ve.SOLIDUS:case ve.GREATER_THAN_SIGN:case ve.EOF:{this._leaveAttrName(),this.state=$e.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(s);break}case ve.EQUALS_SIGN:{this._leaveAttrName(),this.state=$e.BEFORE_ATTRIBUTE_VALUE;break}case ve.QUOTATION_MARK:case ve.APOSTROPHE:case ve.LESS_THAN_SIGN:{this._err(Rr.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(s);break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),this.currentAttr.name+=Vf;break}default:this.currentAttr.name+=String.fromCodePoint(SQ(s)?$bt(s):s)}}_stateAfterAttributeName(s){switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:break;case ve.SOLIDUS:{this.state=$e.SELF_CLOSING_START_TAG;break}case ve.EQUALS_SIGN:{this.state=$e.BEFORE_ATTRIBUTE_VALUE;break}case ve.GREATER_THAN_SIGN:{this.state=$e.DATA,this.emitCurrentTagToken();break}case ve.EOF:{this._err(Rr.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=$e.ATTRIBUTE_NAME,this._stateAttributeName(s)}}_stateBeforeAttributeValue(s){switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:break;case ve.QUOTATION_MARK:{this.state=$e.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case ve.APOSTROPHE:{this.state=$e.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case ve.GREATER_THAN_SIGN:{this._err(Rr.missingAttributeValue),this.state=$e.DATA,this.emitCurrentTagToken();break}default:this.state=$e.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(s)}}_stateAttributeValueDoubleQuoted(s){switch(s){case ve.QUOTATION_MARK:{this.state=$e.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case ve.AMPERSAND:{this._startCharacterReference();break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),this.currentAttr.value+=Vf;break}case ve.EOF:{this._err(Rr.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(s)}}_stateAttributeValueSingleQuoted(s){switch(s){case ve.APOSTROPHE:{this.state=$e.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case ve.AMPERSAND:{this._startCharacterReference();break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),this.currentAttr.value+=Vf;break}case ve.EOF:{this._err(Rr.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(s)}}_stateAttributeValueUnquoted(s){switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:{this._leaveAttrValue(),this.state=$e.BEFORE_ATTRIBUTE_NAME;break}case ve.AMPERSAND:{this._startCharacterReference();break}case ve.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=$e.DATA,this.emitCurrentTagToken();break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),this.currentAttr.value+=Vf;break}case ve.QUOTATION_MARK:case ve.APOSTROPHE:case ve.LESS_THAN_SIGN:case ve.EQUALS_SIGN:case ve.GRAVE_ACCENT:{this._err(Rr.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(s);break}case ve.EOF:{this._err(Rr.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(s)}}_stateAfterAttributeValueQuoted(s){switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:{this._leaveAttrValue(),this.state=$e.BEFORE_ATTRIBUTE_NAME;break}case ve.SOLIDUS:{this._leaveAttrValue(),this.state=$e.SELF_CLOSING_START_TAG;break}case ve.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=$e.DATA,this.emitCurrentTagToken();break}case ve.EOF:{this._err(Rr.eofInTag),this._emitEOFToken();break}default:this._err(Rr.missingWhitespaceBetweenAttributes),this.state=$e.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(s)}}_stateSelfClosingStartTag(s){switch(s){case ve.GREATER_THAN_SIGN:{const p=this.currentToken;p.selfClosing=!0,this.state=$e.DATA,this.emitCurrentTagToken();break}case ve.EOF:{this._err(Rr.eofInTag),this._emitEOFToken();break}default:this._err(Rr.unexpectedSolidusInTag),this.state=$e.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(s)}}_stateBogusComment(s){const p=this.currentToken;switch(s){case ve.GREATER_THAN_SIGN:{this.state=$e.DATA,this.emitCurrentComment(p);break}case ve.EOF:{this.emitCurrentComment(p),this._emitEOFToken();break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),p.data+=Vf;break}default:p.data+=String.fromCodePoint(s)}}_stateMarkupDeclarationOpen(s){this._consumeSequenceIfMatch(X2.DASH_DASH,!0)?(this._createCommentToken(X2.DASH_DASH.length+1),this.state=$e.COMMENT_START):this._consumeSequenceIfMatch(X2.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(X2.DOCTYPE.length+1),this.state=$e.DOCTYPE):this._consumeSequenceIfMatch(X2.CDATA_START,!0)?this.inForeignNode?this.state=$e.CDATA_SECTION:(this._err(Rr.cdataInHtmlContent),this._createCommentToken(X2.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=$e.BOGUS_COMMENT):this._ensureHibernation()||(this._err(Rr.incorrectlyOpenedComment),this._createCommentToken(2),this.state=$e.BOGUS_COMMENT,this._stateBogusComment(s))}_stateCommentStart(s){switch(s){case ve.HYPHEN_MINUS:{this.state=$e.COMMENT_START_DASH;break}case ve.GREATER_THAN_SIGN:{this._err(Rr.abruptClosingOfEmptyComment),this.state=$e.DATA;const p=this.currentToken;this.emitCurrentComment(p);break}default:this.state=$e.COMMENT,this._stateComment(s)}}_stateCommentStartDash(s){const p=this.currentToken;switch(s){case ve.HYPHEN_MINUS:{this.state=$e.COMMENT_END;break}case ve.GREATER_THAN_SIGN:{this._err(Rr.abruptClosingOfEmptyComment),this.state=$e.DATA,this.emitCurrentComment(p);break}case ve.EOF:{this._err(Rr.eofInComment),this.emitCurrentComment(p),this._emitEOFToken();break}default:p.data+="-",this.state=$e.COMMENT,this._stateComment(s)}}_stateComment(s){const p=this.currentToken;switch(s){case ve.HYPHEN_MINUS:{this.state=$e.COMMENT_END_DASH;break}case ve.LESS_THAN_SIGN:{p.data+="<",this.state=$e.COMMENT_LESS_THAN_SIGN;break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),p.data+=Vf;break}case ve.EOF:{this._err(Rr.eofInComment),this.emitCurrentComment(p),this._emitEOFToken();break}default:p.data+=String.fromCodePoint(s)}}_stateCommentLessThanSign(s){const p=this.currentToken;switch(s){case ve.EXCLAMATION_MARK:{p.data+="!",this.state=$e.COMMENT_LESS_THAN_SIGN_BANG;break}case ve.LESS_THAN_SIGN:{p.data+="<";break}default:this.state=$e.COMMENT,this._stateComment(s)}}_stateCommentLessThanSignBang(s){s===ve.HYPHEN_MINUS?this.state=$e.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=$e.COMMENT,this._stateComment(s))}_stateCommentLessThanSignBangDash(s){s===ve.HYPHEN_MINUS?this.state=$e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=$e.COMMENT_END_DASH,this._stateCommentEndDash(s))}_stateCommentLessThanSignBangDashDash(s){s!==ve.GREATER_THAN_SIGN&&s!==ve.EOF&&this._err(Rr.nestedComment),this.state=$e.COMMENT_END,this._stateCommentEnd(s)}_stateCommentEndDash(s){const p=this.currentToken;switch(s){case ve.HYPHEN_MINUS:{this.state=$e.COMMENT_END;break}case ve.EOF:{this._err(Rr.eofInComment),this.emitCurrentComment(p),this._emitEOFToken();break}default:p.data+="-",this.state=$e.COMMENT,this._stateComment(s)}}_stateCommentEnd(s){const p=this.currentToken;switch(s){case ve.GREATER_THAN_SIGN:{this.state=$e.DATA,this.emitCurrentComment(p);break}case ve.EXCLAMATION_MARK:{this.state=$e.COMMENT_END_BANG;break}case ve.HYPHEN_MINUS:{p.data+="-";break}case ve.EOF:{this._err(Rr.eofInComment),this.emitCurrentComment(p),this._emitEOFToken();break}default:p.data+="--",this.state=$e.COMMENT,this._stateComment(s)}}_stateCommentEndBang(s){const p=this.currentToken;switch(s){case ve.HYPHEN_MINUS:{p.data+="--!",this.state=$e.COMMENT_END_DASH;break}case ve.GREATER_THAN_SIGN:{this._err(Rr.incorrectlyClosedComment),this.state=$e.DATA,this.emitCurrentComment(p);break}case ve.EOF:{this._err(Rr.eofInComment),this.emitCurrentComment(p),this._emitEOFToken();break}default:p.data+="--!",this.state=$e.COMMENT,this._stateComment(s)}}_stateDoctype(s){switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:{this.state=$e.BEFORE_DOCTYPE_NAME;break}case ve.GREATER_THAN_SIGN:{this.state=$e.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(s);break}case ve.EOF:{this._err(Rr.eofInDoctype),this._createDoctypeToken(null);const p=this.currentToken;p.forceQuirks=!0,this.emitCurrentDoctype(p),this._emitEOFToken();break}default:this._err(Rr.missingWhitespaceBeforeDoctypeName),this.state=$e.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(s)}}_stateBeforeDoctypeName(s){if(SQ(s))this._createDoctypeToken(String.fromCharCode($bt(s))),this.state=$e.DOCTYPE_NAME;else switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:break;case ve.NULL:{this._err(Rr.unexpectedNullCharacter),this._createDoctypeToken(Vf),this.state=$e.DOCTYPE_NAME;break}case ve.GREATER_THAN_SIGN:{this._err(Rr.missingDoctypeName),this._createDoctypeToken(null);const p=this.currentToken;p.forceQuirks=!0,this.emitCurrentDoctype(p),this.state=$e.DATA;break}case ve.EOF:{this._err(Rr.eofInDoctype),this._createDoctypeToken(null);const p=this.currentToken;p.forceQuirks=!0,this.emitCurrentDoctype(p),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(s)),this.state=$e.DOCTYPE_NAME}}_stateDoctypeName(s){const p=this.currentToken;switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:{this.state=$e.AFTER_DOCTYPE_NAME;break}case ve.GREATER_THAN_SIGN:{this.state=$e.DATA,this.emitCurrentDoctype(p);break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),p.name+=Vf;break}case ve.EOF:{this._err(Rr.eofInDoctype),p.forceQuirks=!0,this.emitCurrentDoctype(p),this._emitEOFToken();break}default:p.name+=String.fromCodePoint(SQ(s)?$bt(s):s)}}_stateAfterDoctypeName(s){const p=this.currentToken;switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:break;case ve.GREATER_THAN_SIGN:{this.state=$e.DATA,this.emitCurrentDoctype(p);break}case ve.EOF:{this._err(Rr.eofInDoctype),p.forceQuirks=!0,this.emitCurrentDoctype(p),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(X2.PUBLIC,!1)?this.state=$e.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(X2.SYSTEM,!1)?this.state=$e.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(Rr.invalidCharacterSequenceAfterDoctypeName),p.forceQuirks=!0,this.state=$e.BOGUS_DOCTYPE,this._stateBogusDoctype(s))}}_stateAfterDoctypePublicKeyword(s){const p=this.currentToken;switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:{this.state=$e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case ve.QUOTATION_MARK:{this._err(Rr.missingWhitespaceAfterDoctypePublicKeyword),p.publicId="",this.state=$e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case ve.APOSTROPHE:{this._err(Rr.missingWhitespaceAfterDoctypePublicKeyword),p.publicId="",this.state=$e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case ve.GREATER_THAN_SIGN:{this._err(Rr.missingDoctypePublicIdentifier),p.forceQuirks=!0,this.state=$e.DATA,this.emitCurrentDoctype(p);break}case ve.EOF:{this._err(Rr.eofInDoctype),p.forceQuirks=!0,this.emitCurrentDoctype(p),this._emitEOFToken();break}default:this._err(Rr.missingQuoteBeforeDoctypePublicIdentifier),p.forceQuirks=!0,this.state=$e.BOGUS_DOCTYPE,this._stateBogusDoctype(s)}}_stateBeforeDoctypePublicIdentifier(s){const p=this.currentToken;switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:break;case ve.QUOTATION_MARK:{p.publicId="",this.state=$e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case ve.APOSTROPHE:{p.publicId="",this.state=$e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case ve.GREATER_THAN_SIGN:{this._err(Rr.missingDoctypePublicIdentifier),p.forceQuirks=!0,this.state=$e.DATA,this.emitCurrentDoctype(p);break}case ve.EOF:{this._err(Rr.eofInDoctype),p.forceQuirks=!0,this.emitCurrentDoctype(p),this._emitEOFToken();break}default:this._err(Rr.missingQuoteBeforeDoctypePublicIdentifier),p.forceQuirks=!0,this.state=$e.BOGUS_DOCTYPE,this._stateBogusDoctype(s)}}_stateDoctypePublicIdentifierDoubleQuoted(s){const p=this.currentToken;switch(s){case ve.QUOTATION_MARK:{this.state=$e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),p.publicId+=Vf;break}case ve.GREATER_THAN_SIGN:{this._err(Rr.abruptDoctypePublicIdentifier),p.forceQuirks=!0,this.emitCurrentDoctype(p),this.state=$e.DATA;break}case ve.EOF:{this._err(Rr.eofInDoctype),p.forceQuirks=!0,this.emitCurrentDoctype(p),this._emitEOFToken();break}default:p.publicId+=String.fromCodePoint(s)}}_stateDoctypePublicIdentifierSingleQuoted(s){const p=this.currentToken;switch(s){case ve.APOSTROPHE:{this.state=$e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),p.publicId+=Vf;break}case ve.GREATER_THAN_SIGN:{this._err(Rr.abruptDoctypePublicIdentifier),p.forceQuirks=!0,this.emitCurrentDoctype(p),this.state=$e.DATA;break}case ve.EOF:{this._err(Rr.eofInDoctype),p.forceQuirks=!0,this.emitCurrentDoctype(p),this._emitEOFToken();break}default:p.publicId+=String.fromCodePoint(s)}}_stateAfterDoctypePublicIdentifier(s){const p=this.currentToken;switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:{this.state=$e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case ve.GREATER_THAN_SIGN:{this.state=$e.DATA,this.emitCurrentDoctype(p);break}case ve.QUOTATION_MARK:{this._err(Rr.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),p.systemId="",this.state=$e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case ve.APOSTROPHE:{this._err(Rr.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),p.systemId="",this.state=$e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case ve.EOF:{this._err(Rr.eofInDoctype),p.forceQuirks=!0,this.emitCurrentDoctype(p),this._emitEOFToken();break}default:this._err(Rr.missingQuoteBeforeDoctypeSystemIdentifier),p.forceQuirks=!0,this.state=$e.BOGUS_DOCTYPE,this._stateBogusDoctype(s)}}_stateBetweenDoctypePublicAndSystemIdentifiers(s){const p=this.currentToken;switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:break;case ve.GREATER_THAN_SIGN:{this.emitCurrentDoctype(p),this.state=$e.DATA;break}case ve.QUOTATION_MARK:{p.systemId="",this.state=$e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case ve.APOSTROPHE:{p.systemId="",this.state=$e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case ve.EOF:{this._err(Rr.eofInDoctype),p.forceQuirks=!0,this.emitCurrentDoctype(p),this._emitEOFToken();break}default:this._err(Rr.missingQuoteBeforeDoctypeSystemIdentifier),p.forceQuirks=!0,this.state=$e.BOGUS_DOCTYPE,this._stateBogusDoctype(s)}}_stateAfterDoctypeSystemKeyword(s){const p=this.currentToken;switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:{this.state=$e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case ve.QUOTATION_MARK:{this._err(Rr.missingWhitespaceAfterDoctypeSystemKeyword),p.systemId="",this.state=$e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case ve.APOSTROPHE:{this._err(Rr.missingWhitespaceAfterDoctypeSystemKeyword),p.systemId="",this.state=$e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case ve.GREATER_THAN_SIGN:{this._err(Rr.missingDoctypeSystemIdentifier),p.forceQuirks=!0,this.state=$e.DATA,this.emitCurrentDoctype(p);break}case ve.EOF:{this._err(Rr.eofInDoctype),p.forceQuirks=!0,this.emitCurrentDoctype(p),this._emitEOFToken();break}default:this._err(Rr.missingQuoteBeforeDoctypeSystemIdentifier),p.forceQuirks=!0,this.state=$e.BOGUS_DOCTYPE,this._stateBogusDoctype(s)}}_stateBeforeDoctypeSystemIdentifier(s){const p=this.currentToken;switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:break;case ve.QUOTATION_MARK:{p.systemId="",this.state=$e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case ve.APOSTROPHE:{p.systemId="",this.state=$e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case ve.GREATER_THAN_SIGN:{this._err(Rr.missingDoctypeSystemIdentifier),p.forceQuirks=!0,this.state=$e.DATA,this.emitCurrentDoctype(p);break}case ve.EOF:{this._err(Rr.eofInDoctype),p.forceQuirks=!0,this.emitCurrentDoctype(p),this._emitEOFToken();break}default:this._err(Rr.missingQuoteBeforeDoctypeSystemIdentifier),p.forceQuirks=!0,this.state=$e.BOGUS_DOCTYPE,this._stateBogusDoctype(s)}}_stateDoctypeSystemIdentifierDoubleQuoted(s){const p=this.currentToken;switch(s){case ve.QUOTATION_MARK:{this.state=$e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),p.systemId+=Vf;break}case ve.GREATER_THAN_SIGN:{this._err(Rr.abruptDoctypeSystemIdentifier),p.forceQuirks=!0,this.emitCurrentDoctype(p),this.state=$e.DATA;break}case ve.EOF:{this._err(Rr.eofInDoctype),p.forceQuirks=!0,this.emitCurrentDoctype(p),this._emitEOFToken();break}default:p.systemId+=String.fromCodePoint(s)}}_stateDoctypeSystemIdentifierSingleQuoted(s){const p=this.currentToken;switch(s){case ve.APOSTROPHE:{this.state=$e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),p.systemId+=Vf;break}case ve.GREATER_THAN_SIGN:{this._err(Rr.abruptDoctypeSystemIdentifier),p.forceQuirks=!0,this.emitCurrentDoctype(p),this.state=$e.DATA;break}case ve.EOF:{this._err(Rr.eofInDoctype),p.forceQuirks=!0,this.emitCurrentDoctype(p),this._emitEOFToken();break}default:p.systemId+=String.fromCodePoint(s)}}_stateAfterDoctypeSystemIdentifier(s){const p=this.currentToken;switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:break;case ve.GREATER_THAN_SIGN:{this.emitCurrentDoctype(p),this.state=$e.DATA;break}case ve.EOF:{this._err(Rr.eofInDoctype),p.forceQuirks=!0,this.emitCurrentDoctype(p),this._emitEOFToken();break}default:this._err(Rr.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=$e.BOGUS_DOCTYPE,this._stateBogusDoctype(s)}}_stateBogusDoctype(s){const p=this.currentToken;switch(s){case ve.GREATER_THAN_SIGN:{this.emitCurrentDoctype(p),this.state=$e.DATA;break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter);break}case ve.EOF:{this.emitCurrentDoctype(p),this._emitEOFToken();break}}}_stateCdataSection(s){switch(s){case ve.RIGHT_SQUARE_BRACKET:{this.state=$e.CDATA_SECTION_BRACKET;break}case ve.EOF:{this._err(Rr.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(s)}}_stateCdataSectionBracket(s){s===ve.RIGHT_SQUARE_BRACKET?this.state=$e.CDATA_SECTION_END:(this._emitChars("]"),this.state=$e.CDATA_SECTION,this._stateCdataSection(s))}_stateCdataSectionEnd(s){switch(s){case ve.GREATER_THAN_SIGN:{this.state=$e.DATA;break}case ve.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=$e.CDATA_SECTION,this._stateCdataSection(s)}}_stateCharacterReference(){let s=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(s<0)if(this.preprocessor.lastChunkWritten)s=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}s===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(ve.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&mAe(this.preprocessor.peek(1))?$e.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(s){mAe(s)?this._flushCodePointConsumedAsCharacterReference(s):(s===ve.SEMICOLON&&this._err(Rr.unknownNamedCharacterReference),this.state=this.returnState,this._callState(s))}}const OPe=new Set([dt.DD,dt.DT,dt.LI,dt.OPTGROUP,dt.OPTION,dt.P,dt.RB,dt.RP,dt.RT,dt.RTC]),wAe=new Set([...OPe,dt.CAPTION,dt.COLGROUP,dt.TBODY,dt.TD,dt.TFOOT,dt.TH,dt.THEAD,dt.TR]),Mmt=new Set([dt.APPLET,dt.CAPTION,dt.HTML,dt.MARQUEE,dt.OBJECT,dt.TABLE,dt.TD,dt.TEMPLATE,dt.TH]),Wqn=new Set([...Mmt,dt.OL,dt.UL]),Kqn=new Set([...Mmt,dt.BUTTON]),vAe=new Set([dt.ANNOTATION_XML,dt.MI,dt.MN,dt.MO,dt.MS,dt.MTEXT]),_Ae=new Set([dt.DESC,dt.FOREIGN_OBJECT,dt.TITLE]),Gqn=new Set([dt.TR,dt.TEMPLATE,dt.HTML]),Yqn=new Set([dt.TBODY,dt.TFOOT,dt.THEAD,dt.TEMPLATE,dt.HTML]),Vqn=new Set([dt.TABLE,dt.TEMPLATE,dt.HTML]),Xqn=new Set([dt.TD,dt.TH]);class Qqn{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(s,p,y){this.treeAdapter=p,this.handler=y,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=dt.UNKNOWN,this.current=s}_indexOf(s){return this.items.lastIndexOf(s,this.stackTop)}_isInTemplate(){return this.currentTagId===dt.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Di.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(s,p){this.stackTop++,this.items[this.stackTop]=s,this.current=s,this.tagIDs[this.stackTop]=p,this.currentTagId=p,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(s,p,!0)}pop(){const s=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(s,!0)}replace(s,p){const y=this._indexOf(s);this.items[y]=p,y===this.stackTop&&(this.current=p)}insertAfter(s,p,y){const C=this._indexOf(s)+1;this.items.splice(C,0,p),this.tagIDs.splice(C,0,y),this.stackTop++,C===this.stackTop&&this._updateCurrentElement(),this.handler.onItemPush(this.current,this.currentTagId,C===this.stackTop)}popUntilTagNamePopped(s){let p=this.stackTop+1;do p=this.tagIDs.lastIndexOf(s,p-1);while(p>0&&this.treeAdapter.getNamespaceURI(this.items[p])!==Di.HTML);this.shortenToLength(p<0?0:p)}shortenToLength(s){for(;this.stackTop>=s;){const p=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(p,this.stackTop<s)}}popUntilElementPopped(s){const p=this._indexOf(s);this.shortenToLength(p<0?0:p)}popUntilPopped(s,p){const y=this._indexOfTagNames(s,p);this.shortenToLength(y<0?0:y)}popUntilNumberedHeaderPopped(){this.popUntilPopped(kFt,Di.HTML)}popUntilTableCellPopped(){this.popUntilPopped(Xqn,Di.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(s,p){for(let y=this.stackTop;y>=0;y--)if(s.has(this.tagIDs[y])&&this.treeAdapter.getNamespaceURI(this.items[y])===p)return y;return-1}clearBackTo(s,p){const y=this._indexOfTagNames(s,p);this.shortenToLength(y+1)}clearBackToTableContext(){this.clearBackTo(Vqn,Di.HTML)}clearBackToTableBodyContext(){this.clearBackTo(Yqn,Di.HTML)}clearBackToTableRowContext(){this.clearBackTo(Gqn,Di.HTML)}remove(s){const p=this._indexOf(s);p>=0&&(p===this.stackTop?this.pop():(this.items.splice(p,1),this.tagIDs.splice(p,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(s,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===dt.BODY?this.items[1]:null}contains(s){return this._indexOf(s)>-1}getCommonAncestor(s){const p=this._indexOf(s)-1;return p>=0?this.items[p]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===dt.HTML}hasInDynamicScope(s,p){for(let y=this.stackTop;y>=0;y--){const C=this.tagIDs[y];switch(this.treeAdapter.getNamespaceURI(this.items[y])){case Di.HTML:{if(C===s)return!0;if(p.has(C))return!1;break}case Di.SVG:{if(_Ae.has(C))return!1;break}case Di.MATHML:{if(vAe.has(C))return!1;break}}}return!0}hasInScope(s){return this.hasInDynamicScope(s,Mmt)}hasInListItemScope(s){return this.hasInDynamicScope(s,Wqn)}hasInButtonScope(s){return this.hasInDynamicScope(s,Kqn)}hasNumberedHeaderInScope(){for(let s=this.stackTop;s>=0;s--){const p=this.tagIDs[s];switch(this.treeAdapter.getNamespaceURI(this.items[s])){case Di.HTML:{if(kFt.has(p))return!0;if(Mmt.has(p))return!1;break}case Di.SVG:{if(_Ae.has(p))return!1;break}case Di.MATHML:{if(vAe.has(p))return!1;break}}}return!0}hasInTableScope(s){for(let p=this.stackTop;p>=0;p--)if(this.treeAdapter.getNamespaceURI(this.items[p])===Di.HTML)switch(this.tagIDs[p]){case s:return!0;case dt.TABLE:case dt.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let s=this.stackTop;s>=0;s--)if(this.treeAdapter.getNamespaceURI(this.items[s])===Di.HTML)switch(this.tagIDs[s]){case dt.TBODY:case dt.THEAD:case dt.TFOOT:return!0;case dt.TABLE:case dt.HTML:return!1}return!0}hasInSelectScope(s){for(let p=this.stackTop;p>=0;p--)if(this.treeAdapter.getNamespaceURI(this.items[p])===Di.HTML)switch(this.tagIDs[p]){case s:return!0;case dt.OPTION:case dt.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;OPe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;wAe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(s){for(;this.currentTagId!==s&&wAe.has(this.currentTagId);)this.pop()}}const dBt=3;var E6;(function(o){o[o.Marker=0]="Marker",o[o.Element=1]="Element"})(E6||(E6={}));const xAe={type:E6.Marker};class Jqn{constructor(s){this.treeAdapter=s,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(s,p){const y=[],C=p.length,N=this.treeAdapter.getTagName(s),L=this.treeAdapter.getNamespaceURI(s);for(let z=0;z<this.entries.length;z++){const G=this.entries[z];if(G.type===E6.Marker)break;const{element:q}=G;if(this.treeAdapter.getTagName(q)===N&&this.treeAdapter.getNamespaceURI(q)===L){const et=this.treeAdapter.getAttrList(q);et.length===C&&y.push({idx:z,attrs:et})}}return y}_ensureNoahArkCondition(s){if(this.entries.length<dBt)return;const p=this.treeAdapter.getAttrList(s),y=this._getNoahArkConditionCandidates(s,p);if(y.length<dBt)return;const C=new Map(p.map(L=>[L.name,L.value]));let N=0;for(let L=0;L<y.length;L++){const z=y[L];z.attrs.every(G=>C.get(G.name)===G.value)&&(N+=1,N>=dBt&&this.entries.splice(z.idx,1))}}insertMarker(){this.entries.unshift(xAe)}pushElement(s,p){this._ensureNoahArkCondition(s),this.entries.unshift({type:E6.Element,element:s,token:p})}insertElementAfterBookmark(s,p){const y=this.entries.indexOf(this.bookmark);this.entries.splice(y,0,{type:E6.Element,element:s,token:p})}removeEntry(s){const p=this.entries.indexOf(s);p>=0&&this.entries.splice(p,1)}clearToLastMarker(){const s=this.entries.indexOf(xAe);s>=0?this.entries.splice(0,s+1):this.entries.length=0}getElementEntryInScopeWithTagName(s){const p=this.entries.find(y=>y.type===E6.Marker||this.treeAdapter.getTagName(y.element)===s);return p&&p.type===E6.Element?p:null}getElementEntry(s){return this.entries.find(p=>p.type===E6.Element&&p.element===s)}}const sC={createDocument(){return{nodeName:"#document",mode:C3.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(o,s,p){return{nodeName:o,tagName:o,attrs:p,namespaceURI:s,childNodes:[],parentNode:null}},createCommentNode(o){return{nodeName:"#comment",data:o,parentNode:null}},createTextNode(o){return{nodeName:"#text",value:o,parentNode:null}},appendChild(o,s){o.childNodes.push(s),s.parentNode=o},insertBefore(o,s,p){const y=o.childNodes.indexOf(p);o.childNodes.splice(y,0,s),s.parentNode=o},setTemplateContent(o,s){o.content=s},getTemplateContent(o){return o.content},setDocumentType(o,s,p,y){const C=o.childNodes.find(N=>N.nodeName==="#documentType");if(C)C.name=s,C.publicId=p,C.systemId=y;else{const N={nodeName:"#documentType",name:s,publicId:p,systemId:y,parentNode:null};sC.appendChild(o,N)}},setDocumentMode(o,s){o.mode=s},getDocumentMode(o){return o.mode},detachNode(o){if(o.parentNode){const s=o.parentNode.childNodes.indexOf(o);o.parentNode.childNodes.splice(s,1),o.parentNode=null}},insertText(o,s){if(o.childNodes.length>0){const p=o.childNodes[o.childNodes.length-1];if(sC.isTextNode(p)){p.value+=s;return}}sC.appendChild(o,sC.createTextNode(s))},insertTextBefore(o,s,p){const y=o.childNodes[o.childNodes.indexOf(p)-1];y&&sC.isTextNode(y)?y.value+=s:sC.insertBefore(o,sC.createTextNode(s),p)},adoptAttributes(o,s){const p=new Set(o.attrs.map(y=>y.name));for(let y=0;y<s.length;y++)p.has(s[y].name)||o.attrs.push(s[y])},getFirstChild(o){return o.childNodes[0]},getChildNodes(o){return o.childNodes},getParentNode(o){return o.parentNode},getAttrList(o){return o.attrs},getTagName(o){return o.tagName},getNamespaceURI(o){return o.namespaceURI},getTextNodeContent(o){return o.value},getCommentNodeContent(o){return o.data},getDocumentTypeNodeName(o){return o.name},getDocumentTypeNodePublicId(o){return o.publicId},getDocumentTypeNodeSystemId(o){return o.systemId},isTextNode(o){return o.nodeName==="#text"},isCommentNode(o){return o.nodeName==="#comment"},isDocumentTypeNode(o){return o.nodeName==="#documentType"},isElementNode(o){return Object.prototype.hasOwnProperty.call(o,"tagName")},setNodeSourceCodeLocation(o,s){o.sourceCodeLocation=s},getNodeSourceCodeLocation(o){return o.sourceCodeLocation},updateNodeSourceCodeLocation(o,s){o.sourceCodeLocation={...o.sourceCodeLocation,...s}}},NPe="html",Zqn="about:legacy-compat",tWn="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",PPe=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],eWn=[...PPe,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],nWn=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),LPe=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],rWn=[...LPe,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function EAe(o,s){return s.some(p=>o.startsWith(p))}function iWn(o){return o.name===NPe&&o.publicId===null&&(o.systemId===null||o.systemId===Zqn)}function aWn(o){if(o.name!==NPe)return C3.QUIRKS;const{systemId:s}=o;if(s&&s.toLowerCase()===tWn)return C3.QUIRKS;let{publicId:p}=o;if(p!==null){if(p=p.toLowerCase(),nWn.has(p))return C3.QUIRKS;let y=s===null?eWn:PPe;if(EAe(p,y))return C3.QUIRKS;if(y=s===null?LPe:rWn,EAe(p,y))return C3.LIMITED_QUIRKS}return C3.NO_QUIRKS}const TAe={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},sWn="definitionurl",oWn="definitionURL",cWn=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(o=>[o.toLowerCase(),o])),uWn=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Di.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Di.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Di.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Di.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Di.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Di.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Di.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Di.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Di.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Di.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Di.XMLNS}]]),lWn=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(o=>[o.toLowerCase(),o])),hWn=new Set([dt.B,dt.BIG,dt.BLOCKQUOTE,dt.BODY,dt.BR,dt.CENTER,dt.CODE,dt.DD,dt.DIV,dt.DL,dt.DT,dt.EM,dt.EMBED,dt.H1,dt.H2,dt.H3,dt.H4,dt.H5,dt.H6,dt.HEAD,dt.HR,dt.I,dt.IMG,dt.LI,dt.LISTING,dt.MENU,dt.META,dt.NOBR,dt.OL,dt.P,dt.PRE,dt.RUBY,dt.S,dt.SMALL,dt.SPAN,dt.STRONG,dt.STRIKE,dt.SUB,dt.SUP,dt.TABLE,dt.TT,dt.U,dt.UL,dt.VAR]);function fWn(o){const s=o.tagID;return s===dt.FONT&&o.attrs.some(({name:y})=>y===pP.COLOR||y===pP.SIZE||y===pP.FACE)||hWn.has(s)}function MPe(o){for(let s=0;s<o.attrs.length;s++)if(o.attrs[s].name===sWn){o.attrs[s].name=oWn;break}}function RPe(o){for(let s=0;s<o.attrs.length;s++){const p=cWn.get(o.attrs[s].name);p!=null&&(o.attrs[s].name=p)}}function $$t(o){for(let s=0;s<o.attrs.length;s++){const p=uWn.get(o.attrs[s].name);p&&(o.attrs[s].prefix=p.prefix,o.attrs[s].name=p.name,o.attrs[s].namespace=p.namespace)}}function dWn(o){const s=lWn.get(o.tagName);s!=null&&(o.tagName=s,o.tagID=p$(o.tagName))}function pWn(o,s){return s===Di.MATHML&&(o===dt.MI||o===dt.MO||o===dt.MN||o===dt.MS||o===dt.MTEXT)}function gWn(o,s,p){if(s===Di.MATHML&&o===dt.ANNOTATION_XML){for(let y=0;y<p.length;y++)if(p[y].name===pP.ENCODING){const C=p[y].value.toLowerCase();return C===TAe.TEXT_HTML||C===TAe.APPLICATION_XML}}return s===Di.SVG&&(o===dt.FOREIGN_OBJECT||o===dt.DESC||o===dt.TITLE)}function bWn(o,s,p,y){return(!y||y===Di.HTML)&&gWn(o,s,p)||(!y||y===Di.MATHML)&&pWn(o,s)}const mWn="hidden",yWn=8,wWn=3;var Qe;(function(o){o[o.INITIAL=0]="INITIAL",o[o.BEFORE_HTML=1]="BEFORE_HTML",o[o.BEFORE_HEAD=2]="BEFORE_HEAD",o[o.IN_HEAD=3]="IN_HEAD",o[o.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",o[o.AFTER_HEAD=5]="AFTER_HEAD",o[o.IN_BODY=6]="IN_BODY",o[o.TEXT=7]="TEXT",o[o.IN_TABLE=8]="IN_TABLE",o[o.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",o[o.IN_CAPTION=10]="IN_CAPTION",o[o.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",o[o.IN_TABLE_BODY=12]="IN_TABLE_BODY",o[o.IN_ROW=13]="IN_ROW",o[o.IN_CELL=14]="IN_CELL",o[o.IN_SELECT=15]="IN_SELECT",o[o.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",o[o.IN_TEMPLATE=17]="IN_TEMPLATE",o[o.AFTER_BODY=18]="AFTER_BODY",o[o.IN_FRAMESET=19]="IN_FRAMESET",o[o.AFTER_FRAMESET=20]="AFTER_FRAMESET",o[o.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",o[o.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(Qe||(Qe={}));const vWn={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},DPe=new Set([dt.TABLE,dt.TBODY,dt.TFOOT,dt.THEAD,dt.TR]),kAe={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:sC,onParseError:null};class SAe{constructor(s,p,y=null,C=null){this.fragmentContext=y,this.scriptHandler=C,this.currentToken=null,this.stopped=!1,this.insertionMode=Qe.INITIAL,this.originalInsertionMode=Qe.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...kAe,...s},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=p??this.treeAdapter.createDocument(),this.tokenizer=new qqn(this.options,this),this.activeFormattingElements=new Jqn(this.treeAdapter),this.fragmentContextID=y?p$(this.treeAdapter.getTagName(y)):dt.UNKNOWN,this._setContextModes(y??this.document,this.fragmentContextID),this.openElements=new Qqn(this.document,this.treeAdapter,this)}static parse(s,p){const y=new this(p);return y.tokenizer.write(s,!0),y.document}static getFragmentParser(s,p){const y={...kAe,...p};s??(s=y.treeAdapter.createElement(tr.TEMPLATE,Di.HTML,[]));const C=y.treeAdapter.createElement("documentmock",Di.HTML,[]),N=new this(y,C,s);return N.fragmentContextID===dt.TEMPLATE&&N.tmplInsertionModeStack.unshift(Qe.IN_TEMPLATE),N._initTokenizerForFragmentParsing(),N._insertFakeRootElement(),N._resetInsertionMode(),N._findFormInFragmentContext(),N}getFragment(){const s=this.treeAdapter.getFirstChild(this.document),p=this.treeAdapter.createDocumentFragment();return this._adoptNodes(s,p),p}_err(s,p,y){var C;if(!this.onParseError)return;const N=(C=s.location)!==null&&C!==void 0?C:vWn,L={code:p,startLine:N.startLine,startCol:N.startCol,startOffset:N.startOffset,endLine:y?N.startLine:N.endLine,endCol:y?N.startCol:N.endCol,endOffset:y?N.startOffset:N.endOffset};this.onParseError(L)}onItemPush(s,p,y){var C,N;(N=(C=this.treeAdapter).onItemPush)===null||N===void 0||N.call(C,s),y&&this.openElements.stackTop>0&&this._setContextModes(s,p)}onItemPop(s,p){var y,C;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(s,this.currentToken),(C=(y=this.treeAdapter).onItemPop)===null||C===void 0||C.call(y,s,this.openElements.current),p){let N,L;this.openElements.stackTop===0&&this.fragmentContext?(N=this.fragmentContext,L=this.fragmentContextID):{current:N,currentTagId:L}=this.openElements,this._setContextModes(N,L)}}_setContextModes(s,p){const y=s===this.document||this.treeAdapter.getNamespaceURI(s)===Di.HTML;this.currentNotInHTML=!y,this.tokenizer.inForeignNode=!y&&!this._isIntegrationPoint(p,s)}_switchToTextParsing(s,p){this._insertElement(s,Di.HTML),this.tokenizer.state=p,this.originalInsertionMode=this.insertionMode,this.insertionMode=Qe.TEXT}switchToPlaintextParsing(){this.insertionMode=Qe.TEXT,this.originalInsertionMode=Qe.IN_BODY,this.tokenizer.state=N1.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let s=this.fragmentContext;for(;s;){if(this.treeAdapter.getTagName(s)===tr.FORM){this.formElement=s;break}s=this.treeAdapter.getParentNode(s)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Di.HTML))switch(this.fragmentContextID){case dt.TITLE:case dt.TEXTAREA:{this.tokenizer.state=N1.RCDATA;break}case dt.STYLE:case dt.XMP:case dt.IFRAME:case dt.NOEMBED:case dt.NOFRAMES:case dt.NOSCRIPT:{this.tokenizer.state=N1.RAWTEXT;break}case dt.SCRIPT:{this.tokenizer.state=N1.SCRIPT_DATA;break}case dt.PLAINTEXT:{this.tokenizer.state=N1.PLAINTEXT;break}}}_setDocumentType(s){const p=s.name||"",y=s.publicId||"",C=s.systemId||"";if(this.treeAdapter.setDocumentType(this.document,p,y,C),s.location){const L=this.treeAdapter.getChildNodes(this.document).find(z=>this.treeAdapter.isDocumentTypeNode(z));L&&this.treeAdapter.setNodeSourceCodeLocation(L,s.location)}}_attachElementToTree(s,p){if(this.options.sourceCodeLocationInfo){const y=p&&{...p,startTag:p};this.treeAdapter.setNodeSourceCodeLocation(s,y)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(s);else{const y=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(y,s)}}_appendElement(s,p){const y=this.treeAdapter.createElement(s.tagName,p,s.attrs);this._attachElementToTree(y,s.location)}_insertElement(s,p){const y=this.treeAdapter.createElement(s.tagName,p,s.attrs);this._attachElementToTree(y,s.location),this.openElements.push(y,s.tagID)}_insertFakeElement(s,p){const y=this.treeAdapter.createElement(s,Di.HTML,[]);this._attachElementToTree(y,null),this.openElements.push(y,p)}_insertTemplate(s){const p=this.treeAdapter.createElement(s.tagName,Di.HTML,s.attrs),y=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(p,y),this._attachElementToTree(p,s.location),this.openElements.push(p,s.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(y,null)}_insertFakeRootElement(){const s=this.treeAdapter.createElement(tr.HTML,Di.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,null),this.treeAdapter.appendChild(this.openElements.current,s),this.openElements.push(s,dt.HTML)}_appendCommentNode(s,p){const y=this.treeAdapter.createCommentNode(s.data);this.treeAdapter.appendChild(p,y),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(y,s.location)}_insertCharacters(s){let p,y;if(this._shouldFosterParentOnInsertion()?({parent:p,beforeElement:y}=this._findFosterParentingLocation(),y?this.treeAdapter.insertTextBefore(p,s.chars,y):this.treeAdapter.insertText(p,s.chars)):(p=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(p,s.chars)),!s.location)return;const C=this.treeAdapter.getChildNodes(p),N=y?C.lastIndexOf(y):C.length,L=C[N-1];if(this.treeAdapter.getNodeSourceCodeLocation(L)){const{endLine:G,endCol:q,endOffset:et}=s.location;this.treeAdapter.updateNodeSourceCodeLocation(L,{endLine:G,endCol:q,endOffset:et})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(L,s.location)}_adoptNodes(s,p){for(let y=this.treeAdapter.getFirstChild(s);y;y=this.treeAdapter.getFirstChild(s))this.treeAdapter.detachNode(y),this.treeAdapter.appendChild(p,y)}_setEndLocation(s,p){if(this.treeAdapter.getNodeSourceCodeLocation(s)&&p.location){const y=p.location,C=this.treeAdapter.getTagName(s),N=p.type===ku.END_TAG&&C===p.tagName?{endTag:{...y},endLine:y.endLine,endCol:y.endCol,endOffset:y.endOffset}:{endLine:y.startLine,endCol:y.startCol,endOffset:y.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(s,N)}}shouldProcessStartTagTokenInForeignContent(s){if(!this.currentNotInHTML)return!1;let p,y;return this.openElements.stackTop===0&&this.fragmentContext?(p=this.fragmentContext,y=this.fragmentContextID):{current:p,currentTagId:y}=this.openElements,s.tagID===dt.SVG&&this.treeAdapter.getTagName(p)===tr.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(p)===Di.MATHML?!1:this.tokenizer.inForeignNode||(s.tagID===dt.MGLYPH||s.tagID===dt.MALIGNMARK)&&!this._isIntegrationPoint(y,p,Di.HTML)}_processToken(s){switch(s.type){case ku.CHARACTER:{this.onCharacter(s);break}case ku.NULL_CHARACTER:{this.onNullCharacter(s);break}case ku.COMMENT:{this.onComment(s);break}case ku.DOCTYPE:{this.onDoctype(s);break}case ku.START_TAG:{this._processStartTag(s);break}case ku.END_TAG:{this.onEndTag(s);break}case ku.EOF:{this.onEof(s);break}case ku.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(s);break}}}_isIntegrationPoint(s,p,y){const C=this.treeAdapter.getNamespaceURI(p),N=this.treeAdapter.getAttrList(p);return bWn(s,C,N,y)}_reconstructActiveFormattingElements(){const s=this.activeFormattingElements.entries.length;if(s){const p=this.activeFormattingElements.entries.findIndex(C=>C.type===E6.Marker||this.openElements.contains(C.element)),y=p<0?s-1:p-1;for(let C=y;C>=0;C--){const N=this.activeFormattingElements.entries[C];this._insertElement(N.token,this.treeAdapter.getNamespaceURI(N.element)),N.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=Qe.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(dt.P),this.openElements.popUntilTagNamePopped(dt.P)}_resetInsertionMode(){for(let s=this.openElements.stackTop;s>=0;s--)switch(s===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[s]){case dt.TR:{this.insertionMode=Qe.IN_ROW;return}case dt.TBODY:case dt.THEAD:case dt.TFOOT:{this.insertionMode=Qe.IN_TABLE_BODY;return}case dt.CAPTION:{this.insertionMode=Qe.IN_CAPTION;return}case dt.COLGROUP:{this.insertionMode=Qe.IN_COLUMN_GROUP;return}case dt.TABLE:{this.insertionMode=Qe.IN_TABLE;return}case dt.BODY:{this.insertionMode=Qe.IN_BODY;return}case dt.FRAMESET:{this.insertionMode=Qe.IN_FRAMESET;return}case dt.SELECT:{this._resetInsertionModeForSelect(s);return}case dt.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case dt.HTML:{this.insertionMode=this.headElement?Qe.AFTER_HEAD:Qe.BEFORE_HEAD;return}case dt.TD:case dt.TH:{if(s>0){this.insertionMode=Qe.IN_CELL;return}break}case dt.HEAD:{if(s>0){this.insertionMode=Qe.IN_HEAD;return}break}}this.insertionMode=Qe.IN_BODY}_resetInsertionModeForSelect(s){if(s>0)for(let p=s-1;p>0;p--){const y=this.openElements.tagIDs[p];if(y===dt.TEMPLATE)break;if(y===dt.TABLE){this.insertionMode=Qe.IN_SELECT_IN_TABLE;return}}this.insertionMode=Qe.IN_SELECT}_isElementCausesFosterParenting(s){return DPe.has(s)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let s=this.openElements.stackTop;s>=0;s--){const p=this.openElements.items[s];switch(this.openElements.tagIDs[s]){case dt.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(p)===Di.HTML)return{parent:this.treeAdapter.getTemplateContent(p),beforeElement:null};break}case dt.TABLE:{const y=this.treeAdapter.getParentNode(p);return y?{parent:y,beforeElement:p}:{parent:this.openElements.items[s-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(s){const p=this._findFosterParentingLocation();p.beforeElement?this.treeAdapter.insertBefore(p.parent,s,p.beforeElement):this.treeAdapter.appendChild(p.parent,s)}_isSpecialElement(s,p){const y=this.treeAdapter.getNamespaceURI(s);return jqn[y].has(p)}onCharacter(s){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){XKn(this,s);return}switch(this.insertionMode){case Qe.INITIAL:{pQ(this,s);break}case Qe.BEFORE_HTML:{RQ(this,s);break}case Qe.BEFORE_HEAD:{DQ(this,s);break}case Qe.IN_HEAD:{BQ(this,s);break}case Qe.IN_HEAD_NO_SCRIPT:{FQ(this,s);break}case Qe.AFTER_HEAD:{$Q(this,s);break}case Qe.IN_BODY:case Qe.IN_CAPTION:case Qe.IN_CELL:case Qe.IN_TEMPLATE:{FPe(this,s);break}case Qe.TEXT:case Qe.IN_SELECT:case Qe.IN_SELECT_IN_TABLE:{this._insertCharacters(s);break}case Qe.IN_TABLE:case Qe.IN_TABLE_BODY:case Qe.IN_ROW:{pBt(this,s);break}case Qe.IN_TABLE_TEXT:{qPe(this,s);break}case Qe.IN_COLUMN_GROUP:{Rmt(this,s);break}case Qe.AFTER_BODY:{Dmt(this,s);break}case Qe.AFTER_AFTER_BODY:{emt(this,s);break}}}onNullCharacter(s){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){VKn(this,s);return}switch(this.insertionMode){case Qe.INITIAL:{pQ(this,s);break}case Qe.BEFORE_HTML:{RQ(this,s);break}case Qe.BEFORE_HEAD:{DQ(this,s);break}case Qe.IN_HEAD:{BQ(this,s);break}case Qe.IN_HEAD_NO_SCRIPT:{FQ(this,s);break}case Qe.AFTER_HEAD:{$Q(this,s);break}case Qe.TEXT:{this._insertCharacters(s);break}case Qe.IN_TABLE:case Qe.IN_TABLE_BODY:case Qe.IN_ROW:{pBt(this,s);break}case Qe.IN_COLUMN_GROUP:{Rmt(this,s);break}case Qe.AFTER_BODY:{Dmt(this,s);break}case Qe.AFTER_AFTER_BODY:{emt(this,s);break}}}onComment(s){if(this.skipNextNewLine=!1,this.currentNotInHTML){SFt(this,s);return}switch(this.insertionMode){case Qe.INITIAL:case Qe.BEFORE_HTML:case Qe.BEFORE_HEAD:case Qe.IN_HEAD:case Qe.IN_HEAD_NO_SCRIPT:case Qe.AFTER_HEAD:case Qe.IN_BODY:case Qe.IN_TABLE:case Qe.IN_CAPTION:case Qe.IN_COLUMN_GROUP:case Qe.IN_TABLE_BODY:case Qe.IN_ROW:case Qe.IN_CELL:case Qe.IN_SELECT:case Qe.IN_SELECT_IN_TABLE:case Qe.IN_TEMPLATE:case Qe.IN_FRAMESET:case Qe.AFTER_FRAMESET:{SFt(this,s);break}case Qe.IN_TABLE_TEXT:{gQ(this,s);break}case Qe.AFTER_BODY:{CWn(this,s);break}case Qe.AFTER_AFTER_BODY:case Qe.AFTER_AFTER_FRAMESET:{AWn(this,s);break}}}onDoctype(s){switch(this.skipNextNewLine=!1,this.insertionMode){case Qe.INITIAL:{IWn(this,s);break}case Qe.BEFORE_HEAD:case Qe.IN_HEAD:case Qe.IN_HEAD_NO_SCRIPT:case Qe.AFTER_HEAD:{this._err(s,Rr.misplacedDoctype);break}case Qe.IN_TABLE_TEXT:{gQ(this,s);break}}}onStartTag(s){this.skipNextNewLine=!1,this.currentToken=s,this._processStartTag(s),s.selfClosing&&!s.ackSelfClosing&&this._err(s,Rr.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(s){this.shouldProcessStartTagTokenInForeignContent(s)?QKn(this,s):this._startTagOutsideForeignContent(s)}_startTagOutsideForeignContent(s){switch(this.insertionMode){case Qe.INITIAL:{pQ(this,s);break}case Qe.BEFORE_HTML:{OWn(this,s);break}case Qe.BEFORE_HEAD:{PWn(this,s);break}case Qe.IN_HEAD:{s5(this,s);break}case Qe.IN_HEAD_NO_SCRIPT:{RWn(this,s);break}case Qe.AFTER_HEAD:{BWn(this,s);break}case Qe.IN_BODY:{Sb(this,s);break}case Qe.IN_TABLE:{n$(this,s);break}case Qe.IN_TABLE_TEXT:{gQ(this,s);break}case Qe.IN_CAPTION:{LKn(this,s);break}case Qe.IN_COLUMN_GROUP:{z$t(this,s);break}case Qe.IN_TABLE_BODY:{g2t(this,s);break}case Qe.IN_ROW:{b2t(this,s);break}case Qe.IN_CELL:{DKn(this,s);break}case Qe.IN_SELECT:{GPe(this,s);break}case Qe.IN_SELECT_IN_TABLE:{FKn(this,s);break}case Qe.IN_TEMPLATE:{jKn(this,s);break}case Qe.AFTER_BODY:{zKn(this,s);break}case Qe.IN_FRAMESET:{UKn(this,s);break}case Qe.AFTER_FRAMESET:{WKn(this,s);break}case Qe.AFTER_AFTER_BODY:{GKn(this,s);break}case Qe.AFTER_AFTER_FRAMESET:{YKn(this,s);break}}}onEndTag(s){this.skipNextNewLine=!1,this.currentToken=s,this.currentNotInHTML?JKn(this,s):this._endTagOutsideForeignContent(s)}_endTagOutsideForeignContent(s){switch(this.insertionMode){case Qe.INITIAL:{pQ(this,s);break}case Qe.BEFORE_HTML:{NWn(this,s);break}case Qe.BEFORE_HEAD:{LWn(this,s);break}case Qe.IN_HEAD:{MWn(this,s);break}case Qe.IN_HEAD_NO_SCRIPT:{DWn(this,s);break}case Qe.AFTER_HEAD:{FWn(this,s);break}case Qe.IN_BODY:{p2t(this,s);break}case Qe.TEXT:{EKn(this,s);break}case Qe.IN_TABLE:{YQ(this,s);break}case Qe.IN_TABLE_TEXT:{gQ(this,s);break}case Qe.IN_CAPTION:{MKn(this,s);break}case Qe.IN_COLUMN_GROUP:{RKn(this,s);break}case Qe.IN_TABLE_BODY:{CFt(this,s);break}case Qe.IN_ROW:{KPe(this,s);break}case Qe.IN_CELL:{BKn(this,s);break}case Qe.IN_SELECT:{YPe(this,s);break}case Qe.IN_SELECT_IN_TABLE:{$Kn(this,s);break}case Qe.IN_TEMPLATE:{HKn(this,s);break}case Qe.AFTER_BODY:{XPe(this,s);break}case Qe.IN_FRAMESET:{qKn(this,s);break}case Qe.AFTER_FRAMESET:{KKn(this,s);break}case Qe.AFTER_AFTER_BODY:{emt(this,s);break}}}onEof(s){switch(this.insertionMode){case Qe.INITIAL:{pQ(this,s);break}case Qe.BEFORE_HTML:{RQ(this,s);break}case Qe.BEFORE_HEAD:{DQ(this,s);break}case Qe.IN_HEAD:{BQ(this,s);break}case Qe.IN_HEAD_NO_SCRIPT:{FQ(this,s);break}case Qe.AFTER_HEAD:{$Q(this,s);break}case Qe.IN_BODY:case Qe.IN_TABLE:case Qe.IN_CAPTION:case Qe.IN_COLUMN_GROUP:case Qe.IN_TABLE_BODY:case Qe.IN_ROW:case Qe.IN_CELL:case Qe.IN_SELECT:case Qe.IN_SELECT_IN_TABLE:{zPe(this,s);break}case Qe.TEXT:{TKn(this,s);break}case Qe.IN_TABLE_TEXT:{gQ(this,s);break}case Qe.IN_TEMPLATE:{VPe(this,s);break}case Qe.AFTER_BODY:case Qe.IN_FRAMESET:case Qe.AFTER_FRAMESET:case Qe.AFTER_AFTER_BODY:case Qe.AFTER_AFTER_FRAMESET:{H$t(this,s);break}}}onWhitespaceCharacter(s){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,s.chars.charCodeAt(0)===ve.LINE_FEED)){if(s.chars.length===1)return;s.chars=s.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(s);return}switch(this.insertionMode){case Qe.IN_HEAD:case Qe.IN_HEAD_NO_SCRIPT:case Qe.AFTER_HEAD:case Qe.TEXT:case Qe.IN_COLUMN_GROUP:case Qe.IN_SELECT:case Qe.IN_SELECT_IN_TABLE:case Qe.IN_FRAMESET:case Qe.AFTER_FRAMESET:{this._insertCharacters(s);break}case Qe.IN_BODY:case Qe.IN_CAPTION:case Qe.IN_CELL:case Qe.IN_TEMPLATE:case Qe.AFTER_BODY:case Qe.AFTER_AFTER_BODY:case Qe.AFTER_AFTER_FRAMESET:{BPe(this,s);break}case Qe.IN_TABLE:case Qe.IN_TABLE_BODY:case Qe.IN_ROW:{pBt(this,s);break}case Qe.IN_TABLE_TEXT:{UPe(this,s);break}}}}function _Wn(o,s){let p=o.activeFormattingElements.getElementEntryInScopeWithTagName(s.tagName);return p?o.openElements.contains(p.element)?o.openElements.hasInScope(s.tagID)||(p=null):(o.activeFormattingElements.removeEntry(p),p=null):HPe(o,s),p}function xWn(o,s){let p=null,y=o.openElements.stackTop;for(;y>=0;y--){const C=o.openElements.items[y];if(C===s.element)break;o._isSpecialElement(C,o.openElements.tagIDs[y])&&(p=C)}return p||(o.openElements.shortenToLength(y<0?0:y),o.activeFormattingElements.removeEntry(s)),p}function EWn(o,s,p){let y=s,C=o.openElements.getCommonAncestor(s);for(let N=0,L=C;L!==p;N++,L=C){C=o.openElements.getCommonAncestor(L);const z=o.activeFormattingElements.getElementEntry(L),G=z&&N>=wWn;!z||G?(G&&o.activeFormattingElements.removeEntry(z),o.openElements.remove(L)):(L=TWn(o,z),y===s&&(o.activeFormattingElements.bookmark=z),o.treeAdapter.detachNode(y),o.treeAdapter.appendChild(L,y),y=L)}return y}function TWn(o,s){const p=o.treeAdapter.getNamespaceURI(s.element),y=o.treeAdapter.createElement(s.token.tagName,p,s.token.attrs);return o.openElements.replace(s.element,y),s.element=y,y}function kWn(o,s,p){const y=o.treeAdapter.getTagName(s),C=p$(y);if(o._isElementCausesFosterParenting(C))o._fosterParentElement(p);else{const N=o.treeAdapter.getNamespaceURI(s);C===dt.TEMPLATE&&N===Di.HTML&&(s=o.treeAdapter.getTemplateContent(s)),o.treeAdapter.appendChild(s,p)}}function SWn(o,s,p){const y=o.treeAdapter.getNamespaceURI(p.element),{token:C}=p,N=o.treeAdapter.createElement(C.tagName,y,C.attrs);o._adoptNodes(s,N),o.treeAdapter.appendChild(s,N),o.activeFormattingElements.insertElementAfterBookmark(N,C),o.activeFormattingElements.removeEntry(p),o.openElements.remove(p.element),o.openElements.insertAfter(s,N,C.tagID)}function j$t(o,s){for(let p=0;p<yWn;p++){const y=_Wn(o,s);if(!y)break;const C=xWn(o,y);if(!C)break;o.activeFormattingElements.bookmark=y;const N=EWn(o,C,y.element),L=o.openElements.getCommonAncestor(y.element);o.treeAdapter.detachNode(N),L&&kWn(o,L,N),SWn(o,C,y)}}function SFt(o,s){o._appendCommentNode(s,o.openElements.currentTmplContentOrNode)}function CWn(o,s){o._appendCommentNode(s,o.openElements.items[0])}function AWn(o,s){o._appendCommentNode(s,o.document)}function H$t(o,s){if(o.stopped=!0,s.location){const p=o.fragmentContext?0:2;for(let y=o.openElements.stackTop;y>=p;y--)o._setEndLocation(o.openElements.items[y],s);if(!o.fragmentContext&&o.openElements.stackTop>=0){const y=o.openElements.items[0],C=o.treeAdapter.getNodeSourceCodeLocation(y);if(C&&!C.endTag&&(o._setEndLocation(y,s),o.openElements.stackTop>=1)){const N=o.openElements.items[1],L=o.treeAdapter.getNodeSourceCodeLocation(N);L&&!L.endTag&&o._setEndLocation(N,s)}}}}function IWn(o,s){o._setDocumentType(s);const p=s.forceQuirks?C3.QUIRKS:aWn(s);iWn(s)||o._err(s,Rr.nonConformingDoctype),o.treeAdapter.setDocumentMode(o.document,p),o.insertionMode=Qe.BEFORE_HTML}function pQ(o,s){o._err(s,Rr.missingDoctype,!0),o.treeAdapter.setDocumentMode(o.document,C3.QUIRKS),o.insertionMode=Qe.BEFORE_HTML,o._processToken(s)}function OWn(o,s){s.tagID===dt.HTML?(o._insertElement(s,Di.HTML),o.insertionMode=Qe.BEFORE_HEAD):RQ(o,s)}function NWn(o,s){const p=s.tagID;(p===dt.HTML||p===dt.HEAD||p===dt.BODY||p===dt.BR)&&RQ(o,s)}function RQ(o,s){o._insertFakeRootElement(),o.insertionMode=Qe.BEFORE_HEAD,o._processToken(s)}function PWn(o,s){switch(s.tagID){case dt.HTML:{Sb(o,s);break}case dt.HEAD:{o._insertElement(s,Di.HTML),o.headElement=o.openElements.current,o.insertionMode=Qe.IN_HEAD;break}default:DQ(o,s)}}function LWn(o,s){const p=s.tagID;p===dt.HEAD||p===dt.BODY||p===dt.HTML||p===dt.BR?DQ(o,s):o._err(s,Rr.endTagWithoutMatchingOpenElement)}function DQ(o,s){o._insertFakeElement(tr.HEAD,dt.HEAD),o.headElement=o.openElements.current,o.insertionMode=Qe.IN_HEAD,o._processToken(s)}function s5(o,s){switch(s.tagID){case dt.HTML:{Sb(o,s);break}case dt.BASE:case dt.BASEFONT:case dt.BGSOUND:case dt.LINK:case dt.META:{o._appendElement(s,Di.HTML),s.ackSelfClosing=!0;break}case dt.TITLE:{o._switchToTextParsing(s,N1.RCDATA);break}case dt.NOSCRIPT:{o.options.scriptingEnabled?o._switchToTextParsing(s,N1.RAWTEXT):(o._insertElement(s,Di.HTML),o.insertionMode=Qe.IN_HEAD_NO_SCRIPT);break}case dt.NOFRAMES:case dt.STYLE:{o._switchToTextParsing(s,N1.RAWTEXT);break}case dt.SCRIPT:{o._switchToTextParsing(s,N1.SCRIPT_DATA);break}case dt.TEMPLATE:{o._insertTemplate(s),o.activeFormattingElements.insertMarker(),o.framesetOk=!1,o.insertionMode=Qe.IN_TEMPLATE,o.tmplInsertionModeStack.unshift(Qe.IN_TEMPLATE);break}case dt.HEAD:{o._err(s,Rr.misplacedStartTagForHeadElement);break}default:BQ(o,s)}}function MWn(o,s){switch(s.tagID){case dt.HEAD:{o.openElements.pop(),o.insertionMode=Qe.AFTER_HEAD;break}case dt.BODY:case dt.BR:case dt.HTML:{BQ(o,s);break}case dt.TEMPLATE:{EP(o,s);break}default:o._err(s,Rr.endTagWithoutMatchingOpenElement)}}function EP(o,s){o.openElements.tmplCount>0?(o.openElements.generateImpliedEndTagsThoroughly(),o.openElements.currentTagId!==dt.TEMPLATE&&o._err(s,Rr.closingOfElementWithOpenChildElements),o.openElements.popUntilTagNamePopped(dt.TEMPLATE),o.activeFormattingElements.clearToLastMarker(),o.tmplInsertionModeStack.shift(),o._resetInsertionMode()):o._err(s,Rr.endTagWithoutMatchingOpenElement)}function BQ(o,s){o.openElements.pop(),o.insertionMode=Qe.AFTER_HEAD,o._processToken(s)}function RWn(o,s){switch(s.tagID){case dt.HTML:{Sb(o,s);break}case dt.BASEFONT:case dt.BGSOUND:case dt.HEAD:case dt.LINK:case dt.META:case dt.NOFRAMES:case dt.STYLE:{s5(o,s);break}case dt.NOSCRIPT:{o._err(s,Rr.nestedNoscriptInHead);break}default:FQ(o,s)}}function DWn(o,s){switch(s.tagID){case dt.NOSCRIPT:{o.openElements.pop(),o.insertionMode=Qe.IN_HEAD;break}case dt.BR:{FQ(o,s);break}default:o._err(s,Rr.endTagWithoutMatchingOpenElement)}}function FQ(o,s){const p=s.type===ku.EOF?Rr.openElementsLeftAfterEof:Rr.disallowedContentInNoscriptInHead;o._err(s,p),o.openElements.pop(),o.insertionMode=Qe.IN_HEAD,o._processToken(s)}function BWn(o,s){switch(s.tagID){case dt.HTML:{Sb(o,s);break}case dt.BODY:{o._insertElement(s,Di.HTML),o.framesetOk=!1,o.insertionMode=Qe.IN_BODY;break}case dt.FRAMESET:{o._insertElement(s,Di.HTML),o.insertionMode=Qe.IN_FRAMESET;break}case dt.BASE:case dt.BASEFONT:case dt.BGSOUND:case dt.LINK:case dt.META:case dt.NOFRAMES:case dt.SCRIPT:case dt.STYLE:case dt.TEMPLATE:case dt.TITLE:{o._err(s,Rr.abandonedHeadElementChild),o.openElements.push(o.headElement,dt.HEAD),s5(o,s),o.openElements.remove(o.headElement);break}case dt.HEAD:{o._err(s,Rr.misplacedStartTagForHeadElement);break}default:$Q(o,s)}}function FWn(o,s){switch(s.tagID){case dt.BODY:case dt.HTML:case dt.BR:{$Q(o,s);break}case dt.TEMPLATE:{EP(o,s);break}default:o._err(s,Rr.endTagWithoutMatchingOpenElement)}}function $Q(o,s){o._insertFakeElement(tr.BODY,dt.BODY),o.insertionMode=Qe.IN_BODY,d2t(o,s)}function d2t(o,s){switch(s.type){case ku.CHARACTER:{FPe(o,s);break}case ku.WHITESPACE_CHARACTER:{BPe(o,s);break}case ku.COMMENT:{SFt(o,s);break}case ku.START_TAG:{Sb(o,s);break}case ku.END_TAG:{p2t(o,s);break}case ku.EOF:{zPe(o,s);break}}}function BPe(o,s){o._reconstructActiveFormattingElements(),o._insertCharacters(s)}function FPe(o,s){o._reconstructActiveFormattingElements(),o._insertCharacters(s),o.framesetOk=!1}function $Wn(o,s){o.openElements.tmplCount===0&&o.treeAdapter.adoptAttributes(o.openElements.items[0],s.attrs)}function jWn(o,s){const p=o.openElements.tryPeekProperlyNestedBodyElement();p&&o.openElements.tmplCount===0&&(o.framesetOk=!1,o.treeAdapter.adoptAttributes(p,s.attrs))}function HWn(o,s){const p=o.openElements.tryPeekProperlyNestedBodyElement();o.framesetOk&&p&&(o.treeAdapter.detachNode(p),o.openElements.popAllUpToHtmlElement(),o._insertElement(s,Di.HTML),o.insertionMode=Qe.IN_FRAMESET)}function zWn(o,s){o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),o._insertElement(s,Di.HTML)}function UWn(o,s){o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),kFt.has(o.openElements.currentTagId)&&o.openElements.pop(),o._insertElement(s,Di.HTML)}function qWn(o,s){o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),o._insertElement(s,Di.HTML),o.skipNextNewLine=!0,o.framesetOk=!1}function WWn(o,s){const p=o.openElements.tmplCount>0;(!o.formElement||p)&&(o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),o._insertElement(s,Di.HTML),p||(o.formElement=o.openElements.current))}function KWn(o,s){o.framesetOk=!1;const p=s.tagID;for(let y=o.openElements.stackTop;y>=0;y--){const C=o.openElements.tagIDs[y];if(p===dt.LI&&C===dt.LI||(p===dt.DD||p===dt.DT)&&(C===dt.DD||C===dt.DT)){o.openElements.generateImpliedEndTagsWithExclusion(C),o.openElements.popUntilTagNamePopped(C);break}if(C!==dt.ADDRESS&&C!==dt.DIV&&C!==dt.P&&o._isSpecialElement(o.openElements.items[y],C))break}o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),o._insertElement(s,Di.HTML)}function GWn(o,s){o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),o._insertElement(s,Di.HTML),o.tokenizer.state=N1.PLAINTEXT}function YWn(o,s){o.openElements.hasInScope(dt.BUTTON)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(dt.BUTTON)),o._reconstructActiveFormattingElements(),o._insertElement(s,Di.HTML),o.framesetOk=!1}function VWn(o,s){const p=o.activeFormattingElements.getElementEntryInScopeWithTagName(tr.A);p&&(j$t(o,s),o.openElements.remove(p.element),o.activeFormattingElements.removeEntry(p)),o._reconstructActiveFormattingElements(),o._insertElement(s,Di.HTML),o.activeFormattingElements.pushElement(o.openElements.current,s)}function XWn(o,s){o._reconstructActiveFormattingElements(),o._insertElement(s,Di.HTML),o.activeFormattingElements.pushElement(o.openElements.current,s)}function QWn(o,s){o._reconstructActiveFormattingElements(),o.openElements.hasInScope(dt.NOBR)&&(j$t(o,s),o._reconstructActiveFormattingElements()),o._insertElement(s,Di.HTML),o.activeFormattingElements.pushElement(o.openElements.current,s)}function JWn(o,s){o._reconstructActiveFormattingElements(),o._insertElement(s,Di.HTML),o.activeFormattingElements.insertMarker(),o.framesetOk=!1}function ZWn(o,s){o.treeAdapter.getDocumentMode(o.document)!==C3.QUIRKS&&o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),o._insertElement(s,Di.HTML),o.framesetOk=!1,o.insertionMode=Qe.IN_TABLE}function $Pe(o,s){o._reconstructActiveFormattingElements(),o._appendElement(s,Di.HTML),o.framesetOk=!1,s.ackSelfClosing=!0}function jPe(o){const s=kPe(o,pP.TYPE);return s!=null&&s.toLowerCase()===mWn}function tKn(o,s){o._reconstructActiveFormattingElements(),o._appendElement(s,Di.HTML),jPe(s)||(o.framesetOk=!1),s.ackSelfClosing=!0}function eKn(o,s){o._appendElement(s,Di.HTML),s.ackSelfClosing=!0}function nKn(o,s){o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),o._appendElement(s,Di.HTML),o.framesetOk=!1,s.ackSelfClosing=!0}function rKn(o,s){s.tagName=tr.IMG,s.tagID=dt.IMG,$Pe(o,s)}function iKn(o,s){o._insertElement(s,Di.HTML),o.skipNextNewLine=!0,o.tokenizer.state=N1.RCDATA,o.originalInsertionMode=o.insertionMode,o.framesetOk=!1,o.insertionMode=Qe.TEXT}function aKn(o,s){o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),o._reconstructActiveFormattingElements(),o.framesetOk=!1,o._switchToTextParsing(s,N1.RAWTEXT)}function sKn(o,s){o.framesetOk=!1,o._switchToTextParsing(s,N1.RAWTEXT)}function CAe(o,s){o._switchToTextParsing(s,N1.RAWTEXT)}function oKn(o,s){o._reconstructActiveFormattingElements(),o._insertElement(s,Di.HTML),o.framesetOk=!1,o.insertionMode=o.insertionMode===Qe.IN_TABLE||o.insertionMode===Qe.IN_CAPTION||o.insertionMode===Qe.IN_TABLE_BODY||o.insertionMode===Qe.IN_ROW||o.insertionMode===Qe.IN_CELL?Qe.IN_SELECT_IN_TABLE:Qe.IN_SELECT}function cKn(o,s){o.openElements.currentTagId===dt.OPTION&&o.openElements.pop(),o._reconstructActiveFormattingElements(),o._insertElement(s,Di.HTML)}function uKn(o,s){o.openElements.hasInScope(dt.RUBY)&&o.openElements.generateImpliedEndTags(),o._insertElement(s,Di.HTML)}function lKn(o,s){o.openElements.hasInScope(dt.RUBY)&&o.openElements.generateImpliedEndTagsWithExclusion(dt.RTC),o._insertElement(s,Di.HTML)}function hKn(o,s){o._reconstructActiveFormattingElements(),MPe(s),$$t(s),s.selfClosing?o._appendElement(s,Di.MATHML):o._insertElement(s,Di.MATHML),s.ackSelfClosing=!0}function fKn(o,s){o._reconstructActiveFormattingElements(),RPe(s),$$t(s),s.selfClosing?o._appendElement(s,Di.SVG):o._insertElement(s,Di.SVG),s.ackSelfClosing=!0}function AAe(o,s){o._reconstructActiveFormattingElements(),o._insertElement(s,Di.HTML)}function Sb(o,s){switch(s.tagID){case dt.I:case dt.S:case dt.B:case dt.U:case dt.EM:case dt.TT:case dt.BIG:case dt.CODE:case dt.FONT:case dt.SMALL:case dt.STRIKE:case dt.STRONG:{XWn(o,s);break}case dt.A:{VWn(o,s);break}case dt.H1:case dt.H2:case dt.H3:case dt.H4:case dt.H5:case dt.H6:{UWn(o,s);break}case dt.P:case dt.DL:case dt.OL:case dt.UL:case dt.DIV:case dt.DIR:case dt.NAV:case dt.MAIN:case dt.MENU:case dt.ASIDE:case dt.CENTER:case dt.FIGURE:case dt.FOOTER:case dt.HEADER:case dt.HGROUP:case dt.DIALOG:case dt.DETAILS:case dt.ADDRESS:case dt.ARTICLE:case dt.SEARCH:case dt.SECTION:case dt.SUMMARY:case dt.FIELDSET:case dt.BLOCKQUOTE:case dt.FIGCAPTION:{zWn(o,s);break}case dt.LI:case dt.DD:case dt.DT:{KWn(o,s);break}case dt.BR:case dt.IMG:case dt.WBR:case dt.AREA:case dt.EMBED:case dt.KEYGEN:{$Pe(o,s);break}case dt.HR:{nKn(o,s);break}case dt.RB:case dt.RTC:{uKn(o,s);break}case dt.RT:case dt.RP:{lKn(o,s);break}case dt.PRE:case dt.LISTING:{qWn(o,s);break}case dt.XMP:{aKn(o,s);break}case dt.SVG:{fKn(o,s);break}case dt.HTML:{$Wn(o,s);break}case dt.BASE:case dt.LINK:case dt.META:case dt.STYLE:case dt.TITLE:case dt.SCRIPT:case dt.BGSOUND:case dt.BASEFONT:case dt.TEMPLATE:{s5(o,s);break}case dt.BODY:{jWn(o,s);break}case dt.FORM:{WWn(o,s);break}case dt.NOBR:{QWn(o,s);break}case dt.MATH:{hKn(o,s);break}case dt.TABLE:{ZWn(o,s);break}case dt.INPUT:{tKn(o,s);break}case dt.PARAM:case dt.TRACK:case dt.SOURCE:{eKn(o,s);break}case dt.IMAGE:{rKn(o,s);break}case dt.BUTTON:{YWn(o,s);break}case dt.APPLET:case dt.OBJECT:case dt.MARQUEE:{JWn(o,s);break}case dt.IFRAME:{sKn(o,s);break}case dt.SELECT:{oKn(o,s);break}case dt.OPTION:case dt.OPTGROUP:{cKn(o,s);break}case dt.NOEMBED:case dt.NOFRAMES:{CAe(o,s);break}case dt.FRAMESET:{HWn(o,s);break}case dt.TEXTAREA:{iKn(o,s);break}case dt.NOSCRIPT:{o.options.scriptingEnabled?CAe(o,s):AAe(o,s);break}case dt.PLAINTEXT:{GWn(o,s);break}case dt.COL:case dt.TH:case dt.TD:case dt.TR:case dt.HEAD:case dt.FRAME:case dt.TBODY:case dt.TFOOT:case dt.THEAD:case dt.CAPTION:case dt.COLGROUP:break;default:AAe(o,s)}}function dKn(o,s){if(o.openElements.hasInScope(dt.BODY)&&(o.insertionMode=Qe.AFTER_BODY,o.options.sourceCodeLocationInfo)){const p=o.openElements.tryPeekProperlyNestedBodyElement();p&&o._setEndLocation(p,s)}}function pKn(o,s){o.openElements.hasInScope(dt.BODY)&&(o.insertionMode=Qe.AFTER_BODY,XPe(o,s))}function gKn(o,s){const p=s.tagID;o.openElements.hasInScope(p)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(p))}function bKn(o){const s=o.openElements.tmplCount>0,{formElement:p}=o;s||(o.formElement=null),(p||s)&&o.openElements.hasInScope(dt.FORM)&&(o.openElements.generateImpliedEndTags(),s?o.openElements.popUntilTagNamePopped(dt.FORM):p&&o.openElements.remove(p))}function mKn(o){o.openElements.hasInButtonScope(dt.P)||o._insertFakeElement(tr.P,dt.P),o._closePElement()}function yKn(o){o.openElements.hasInListItemScope(dt.LI)&&(o.openElements.generateImpliedEndTagsWithExclusion(dt.LI),o.openElements.popUntilTagNamePopped(dt.LI))}function wKn(o,s){const p=s.tagID;o.openElements.hasInScope(p)&&(o.openElements.generateImpliedEndTagsWithExclusion(p),o.openElements.popUntilTagNamePopped(p))}function vKn(o){o.openElements.hasNumberedHeaderInScope()&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilNumberedHeaderPopped())}function _Kn(o,s){const p=s.tagID;o.openElements.hasInScope(p)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(p),o.activeFormattingElements.clearToLastMarker())}function xKn(o){o._reconstructActiveFormattingElements(),o._insertFakeElement(tr.BR,dt.BR),o.openElements.pop(),o.framesetOk=!1}function HPe(o,s){const p=s.tagName,y=s.tagID;for(let C=o.openElements.stackTop;C>0;C--){const N=o.openElements.items[C],L=o.openElements.tagIDs[C];if(y===L&&(y!==dt.UNKNOWN||o.treeAdapter.getTagName(N)===p)){o.openElements.generateImpliedEndTagsWithExclusion(y),o.openElements.stackTop>=C&&o.openElements.shortenToLength(C);break}if(o._isSpecialElement(N,L))break}}function p2t(o,s){switch(s.tagID){case dt.A:case dt.B:case dt.I:case dt.S:case dt.U:case dt.EM:case dt.TT:case dt.BIG:case dt.CODE:case dt.FONT:case dt.NOBR:case dt.SMALL:case dt.STRIKE:case dt.STRONG:{j$t(o,s);break}case dt.P:{mKn(o);break}case dt.DL:case dt.UL:case dt.OL:case dt.DIR:case dt.DIV:case dt.NAV:case dt.PRE:case dt.MAIN:case dt.MENU:case dt.ASIDE:case dt.BUTTON:case dt.CENTER:case dt.FIGURE:case dt.FOOTER:case dt.HEADER:case dt.HGROUP:case dt.DIALOG:case dt.ADDRESS:case dt.ARTICLE:case dt.DETAILS:case dt.SEARCH:case dt.SECTION:case dt.SUMMARY:case dt.LISTING:case dt.FIELDSET:case dt.BLOCKQUOTE:case dt.FIGCAPTION:{gKn(o,s);break}case dt.LI:{yKn(o);break}case dt.DD:case dt.DT:{wKn(o,s);break}case dt.H1:case dt.H2:case dt.H3:case dt.H4:case dt.H5:case dt.H6:{vKn(o);break}case dt.BR:{xKn(o);break}case dt.BODY:{dKn(o,s);break}case dt.HTML:{pKn(o,s);break}case dt.FORM:{bKn(o);break}case dt.APPLET:case dt.OBJECT:case dt.MARQUEE:{_Kn(o,s);break}case dt.TEMPLATE:{EP(o,s);break}default:HPe(o,s)}}function zPe(o,s){o.tmplInsertionModeStack.length>0?VPe(o,s):H$t(o,s)}function EKn(o,s){var p;s.tagID===dt.SCRIPT&&((p=o.scriptHandler)===null||p===void 0||p.call(o,o.openElements.current)),o.openElements.pop(),o.insertionMode=o.originalInsertionMode}function TKn(o,s){o._err(s,Rr.eofInElementThatCanContainOnlyText),o.openElements.pop(),o.insertionMode=o.originalInsertionMode,o.onEof(s)}function pBt(o,s){if(DPe.has(o.openElements.currentTagId))switch(o.pendingCharacterTokens.length=0,o.hasNonWhitespacePendingCharacterToken=!1,o.originalInsertionMode=o.insertionMode,o.insertionMode=Qe.IN_TABLE_TEXT,s.type){case ku.CHARACTER:{qPe(o,s);break}case ku.WHITESPACE_CHARACTER:{UPe(o,s);break}}else oJ(o,s)}function kKn(o,s){o.openElements.clearBackToTableContext(),o.activeFormattingElements.insertMarker(),o._insertElement(s,Di.HTML),o.insertionMode=Qe.IN_CAPTION}function SKn(o,s){o.openElements.clearBackToTableContext(),o._insertElement(s,Di.HTML),o.insertionMode=Qe.IN_COLUMN_GROUP}function CKn(o,s){o.openElements.clearBackToTableContext(),o._insertFakeElement(tr.COLGROUP,dt.COLGROUP),o.insertionMode=Qe.IN_COLUMN_GROUP,z$t(o,s)}function AKn(o,s){o.openElements.clearBackToTableContext(),o._insertElement(s,Di.HTML),o.insertionMode=Qe.IN_TABLE_BODY}function IKn(o,s){o.openElements.clearBackToTableContext(),o._insertFakeElement(tr.TBODY,dt.TBODY),o.insertionMode=Qe.IN_TABLE_BODY,g2t(o,s)}function OKn(o,s){o.openElements.hasInTableScope(dt.TABLE)&&(o.openElements.popUntilTagNamePopped(dt.TABLE),o._resetInsertionMode(),o._processStartTag(s))}function NKn(o,s){jPe(s)?o._appendElement(s,Di.HTML):oJ(o,s),s.ackSelfClosing=!0}function PKn(o,s){!o.formElement&&o.openElements.tmplCount===0&&(o._insertElement(s,Di.HTML),o.formElement=o.openElements.current,o.openElements.pop())}function n$(o,s){switch(s.tagID){case dt.TD:case dt.TH:case dt.TR:{IKn(o,s);break}case dt.STYLE:case dt.SCRIPT:case dt.TEMPLATE:{s5(o,s);break}case dt.COL:{CKn(o,s);break}case dt.FORM:{PKn(o,s);break}case dt.TABLE:{OKn(o,s);break}case dt.TBODY:case dt.TFOOT:case dt.THEAD:{AKn(o,s);break}case dt.INPUT:{NKn(o,s);break}case dt.CAPTION:{kKn(o,s);break}case dt.COLGROUP:{SKn(o,s);break}default:oJ(o,s)}}function YQ(o,s){switch(s.tagID){case dt.TABLE:{o.openElements.hasInTableScope(dt.TABLE)&&(o.openElements.popUntilTagNamePopped(dt.TABLE),o._resetInsertionMode());break}case dt.TEMPLATE:{EP(o,s);break}case dt.BODY:case dt.CAPTION:case dt.COL:case dt.COLGROUP:case dt.HTML:case dt.TBODY:case dt.TD:case dt.TFOOT:case dt.TH:case dt.THEAD:case dt.TR:break;default:oJ(o,s)}}function oJ(o,s){const p=o.fosterParentingEnabled;o.fosterParentingEnabled=!0,d2t(o,s),o.fosterParentingEnabled=p}function UPe(o,s){o.pendingCharacterTokens.push(s)}function qPe(o,s){o.pendingCharacterTokens.push(s),o.hasNonWhitespacePendingCharacterToken=!0}function gQ(o,s){let p=0;if(o.hasNonWhitespacePendingCharacterToken)for(;p<o.pendingCharacterTokens.length;p++)oJ(o,o.pendingCharacterTokens[p]);else for(;p<o.pendingCharacterTokens.length;p++)o._insertCharacters(o.pendingCharacterTokens[p]);o.insertionMode=o.originalInsertionMode,o._processToken(s)}const WPe=new Set([dt.CAPTION,dt.COL,dt.COLGROUP,dt.TBODY,dt.TD,dt.TFOOT,dt.TH,dt.THEAD,dt.TR]);function LKn(o,s){const p=s.tagID;WPe.has(p)?o.openElements.hasInTableScope(dt.CAPTION)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(dt.CAPTION),o.activeFormattingElements.clearToLastMarker(),o.insertionMode=Qe.IN_TABLE,n$(o,s)):Sb(o,s)}function MKn(o,s){const p=s.tagID;switch(p){case dt.CAPTION:case dt.TABLE:{o.openElements.hasInTableScope(dt.CAPTION)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(dt.CAPTION),o.activeFormattingElements.clearToLastMarker(),o.insertionMode=Qe.IN_TABLE,p===dt.TABLE&&YQ(o,s));break}case dt.BODY:case dt.COL:case dt.COLGROUP:case dt.HTML:case dt.TBODY:case dt.TD:case dt.TFOOT:case dt.TH:case dt.THEAD:case dt.TR:break;default:p2t(o,s)}}function z$t(o,s){switch(s.tagID){case dt.HTML:{Sb(o,s);break}case dt.COL:{o._appendElement(s,Di.HTML),s.ackSelfClosing=!0;break}case dt.TEMPLATE:{s5(o,s);break}default:Rmt(o,s)}}function RKn(o,s){switch(s.tagID){case dt.COLGROUP:{o.openElements.currentTagId===dt.COLGROUP&&(o.openElements.pop(),o.insertionMode=Qe.IN_TABLE);break}case dt.TEMPLATE:{EP(o,s);break}case dt.COL:break;default:Rmt(o,s)}}function Rmt(o,s){o.openElements.currentTagId===dt.COLGROUP&&(o.openElements.pop(),o.insertionMode=Qe.IN_TABLE,o._processToken(s))}function g2t(o,s){switch(s.tagID){case dt.TR:{o.openElements.clearBackToTableBodyContext(),o._insertElement(s,Di.HTML),o.insertionMode=Qe.IN_ROW;break}case dt.TH:case dt.TD:{o.openElements.clearBackToTableBodyContext(),o._insertFakeElement(tr.TR,dt.TR),o.insertionMode=Qe.IN_ROW,b2t(o,s);break}case dt.CAPTION:case dt.COL:case dt.COLGROUP:case dt.TBODY:case dt.TFOOT:case dt.THEAD:{o.openElements.hasTableBodyContextInTableScope()&&(o.openElements.clearBackToTableBodyContext(),o.openElements.pop(),o.insertionMode=Qe.IN_TABLE,n$(o,s));break}default:n$(o,s)}}function CFt(o,s){const p=s.tagID;switch(s.tagID){case dt.TBODY:case dt.TFOOT:case dt.THEAD:{o.openElements.hasInTableScope(p)&&(o.openElements.clearBackToTableBodyContext(),o.openElements.pop(),o.insertionMode=Qe.IN_TABLE);break}case dt.TABLE:{o.openElements.hasTableBodyContextInTableScope()&&(o.openElements.clearBackToTableBodyContext(),o.openElements.pop(),o.insertionMode=Qe.IN_TABLE,YQ(o,s));break}case dt.BODY:case dt.CAPTION:case dt.COL:case dt.COLGROUP:case dt.HTML:case dt.TD:case dt.TH:case dt.TR:break;default:YQ(o,s)}}function b2t(o,s){switch(s.tagID){case dt.TH:case dt.TD:{o.openElements.clearBackToTableRowContext(),o._insertElement(s,Di.HTML),o.insertionMode=Qe.IN_CELL,o.activeFormattingElements.insertMarker();break}case dt.CAPTION:case dt.COL:case dt.COLGROUP:case dt.TBODY:case dt.TFOOT:case dt.THEAD:case dt.TR:{o.openElements.hasInTableScope(dt.TR)&&(o.openElements.clearBackToTableRowContext(),o.openElements.pop(),o.insertionMode=Qe.IN_TABLE_BODY,g2t(o,s));break}default:n$(o,s)}}function KPe(o,s){switch(s.tagID){case dt.TR:{o.openElements.hasInTableScope(dt.TR)&&(o.openElements.clearBackToTableRowContext(),o.openElements.pop(),o.insertionMode=Qe.IN_TABLE_BODY);break}case dt.TABLE:{o.openElements.hasInTableScope(dt.TR)&&(o.openElements.clearBackToTableRowContext(),o.openElements.pop(),o.insertionMode=Qe.IN_TABLE_BODY,CFt(o,s));break}case dt.TBODY:case dt.TFOOT:case dt.THEAD:{(o.openElements.hasInTableScope(s.tagID)||o.openElements.hasInTableScope(dt.TR))&&(o.openElements.clearBackToTableRowContext(),o.openElements.pop(),o.insertionMode=Qe.IN_TABLE_BODY,CFt(o,s));break}case dt.BODY:case dt.CAPTION:case dt.COL:case dt.COLGROUP:case dt.HTML:case dt.TD:case dt.TH:break;default:YQ(o,s)}}function DKn(o,s){const p=s.tagID;WPe.has(p)?(o.openElements.hasInTableScope(dt.TD)||o.openElements.hasInTableScope(dt.TH))&&(o._closeTableCell(),b2t(o,s)):Sb(o,s)}function BKn(o,s){const p=s.tagID;switch(p){case dt.TD:case dt.TH:{o.openElements.hasInTableScope(p)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(p),o.activeFormattingElements.clearToLastMarker(),o.insertionMode=Qe.IN_ROW);break}case dt.TABLE:case dt.TBODY:case dt.TFOOT:case dt.THEAD:case dt.TR:{o.openElements.hasInTableScope(p)&&(o._closeTableCell(),KPe(o,s));break}case dt.BODY:case dt.CAPTION:case dt.COL:case dt.COLGROUP:case dt.HTML:break;default:p2t(o,s)}}function GPe(o,s){switch(s.tagID){case dt.HTML:{Sb(o,s);break}case dt.OPTION:{o.openElements.currentTagId===dt.OPTION&&o.openElements.pop(),o._insertElement(s,Di.HTML);break}case dt.OPTGROUP:{o.openElements.currentTagId===dt.OPTION&&o.openElements.pop(),o.openElements.currentTagId===dt.OPTGROUP&&o.openElements.pop(),o._insertElement(s,Di.HTML);break}case dt.HR:{o.openElements.currentTagId===dt.OPTION&&o.openElements.pop(),o.openElements.currentTagId===dt.OPTGROUP&&o.openElements.pop(),o._appendElement(s,Di.HTML),s.ackSelfClosing=!0;break}case dt.INPUT:case dt.KEYGEN:case dt.TEXTAREA:case dt.SELECT:{o.openElements.hasInSelectScope(dt.SELECT)&&(o.openElements.popUntilTagNamePopped(dt.SELECT),o._resetInsertionMode(),s.tagID!==dt.SELECT&&o._processStartTag(s));break}case dt.SCRIPT:case dt.TEMPLATE:{s5(o,s);break}}}function YPe(o,s){switch(s.tagID){case dt.OPTGROUP:{o.openElements.stackTop>0&&o.openElements.currentTagId===dt.OPTION&&o.openElements.tagIDs[o.openElements.stackTop-1]===dt.OPTGROUP&&o.openElements.pop(),o.openElements.currentTagId===dt.OPTGROUP&&o.openElements.pop();break}case dt.OPTION:{o.openElements.currentTagId===dt.OPTION&&o.openElements.pop();break}case dt.SELECT:{o.openElements.hasInSelectScope(dt.SELECT)&&(o.openElements.popUntilTagNamePopped(dt.SELECT),o._resetInsertionMode());break}case dt.TEMPLATE:{EP(o,s);break}}}function FKn(o,s){const p=s.tagID;p===dt.CAPTION||p===dt.TABLE||p===dt.TBODY||p===dt.TFOOT||p===dt.THEAD||p===dt.TR||p===dt.TD||p===dt.TH?(o.openElements.popUntilTagNamePopped(dt.SELECT),o._resetInsertionMode(),o._processStartTag(s)):GPe(o,s)}function $Kn(o,s){const p=s.tagID;p===dt.CAPTION||p===dt.TABLE||p===dt.TBODY||p===dt.TFOOT||p===dt.THEAD||p===dt.TR||p===dt.TD||p===dt.TH?o.openElements.hasInTableScope(p)&&(o.openElements.popUntilTagNamePopped(dt.SELECT),o._resetInsertionMode(),o.onEndTag(s)):YPe(o,s)}function jKn(o,s){switch(s.tagID){case dt.BASE:case dt.BASEFONT:case dt.BGSOUND:case dt.LINK:case dt.META:case dt.NOFRAMES:case dt.SCRIPT:case dt.STYLE:case dt.TEMPLATE:case dt.TITLE:{s5(o,s);break}case dt.CAPTION:case dt.COLGROUP:case dt.TBODY:case dt.TFOOT:case dt.THEAD:{o.tmplInsertionModeStack[0]=Qe.IN_TABLE,o.insertionMode=Qe.IN_TABLE,n$(o,s);break}case dt.COL:{o.tmplInsertionModeStack[0]=Qe.IN_COLUMN_GROUP,o.insertionMode=Qe.IN_COLUMN_GROUP,z$t(o,s);break}case dt.TR:{o.tmplInsertionModeStack[0]=Qe.IN_TABLE_BODY,o.insertionMode=Qe.IN_TABLE_BODY,g2t(o,s);break}case dt.TD:case dt.TH:{o.tmplInsertionModeStack[0]=Qe.IN_ROW,o.insertionMode=Qe.IN_ROW,b2t(o,s);break}default:o.tmplInsertionModeStack[0]=Qe.IN_BODY,o.insertionMode=Qe.IN_BODY,Sb(o,s)}}function HKn(o,s){s.tagID===dt.TEMPLATE&&EP(o,s)}function VPe(o,s){o.openElements.tmplCount>0?(o.openElements.popUntilTagNamePopped(dt.TEMPLATE),o.activeFormattingElements.clearToLastMarker(),o.tmplInsertionModeStack.shift(),o._resetInsertionMode(),o.onEof(s)):H$t(o,s)}function zKn(o,s){s.tagID===dt.HTML?Sb(o,s):Dmt(o,s)}function XPe(o,s){var p;if(s.tagID===dt.HTML){if(o.fragmentContext||(o.insertionMode=Qe.AFTER_AFTER_BODY),o.options.sourceCodeLocationInfo&&o.openElements.tagIDs[0]===dt.HTML){o._setEndLocation(o.openElements.items[0],s);const y=o.openElements.items[1];y&&!(!((p=o.treeAdapter.getNodeSourceCodeLocation(y))===null||p===void 0)&&p.endTag)&&o._setEndLocation(y,s)}}else Dmt(o,s)}function Dmt(o,s){o.insertionMode=Qe.IN_BODY,d2t(o,s)}function UKn(o,s){switch(s.tagID){case dt.HTML:{Sb(o,s);break}case dt.FRAMESET:{o._insertElement(s,Di.HTML);break}case dt.FRAME:{o._appendElement(s,Di.HTML),s.ackSelfClosing=!0;break}case dt.NOFRAMES:{s5(o,s);break}}}function qKn(o,s){s.tagID===dt.FRAMESET&&!o.openElements.isRootHtmlElementCurrent()&&(o.openElements.pop(),!o.fragmentContext&&o.openElements.currentTagId!==dt.FRAMESET&&(o.insertionMode=Qe.AFTER_FRAMESET))}function WKn(o,s){switch(s.tagID){case dt.HTML:{Sb(o,s);break}case dt.NOFRAMES:{s5(o,s);break}}}function KKn(o,s){s.tagID===dt.HTML&&(o.insertionMode=Qe.AFTER_AFTER_FRAMESET)}function GKn(o,s){s.tagID===dt.HTML?Sb(o,s):emt(o,s)}function emt(o,s){o.insertionMode=Qe.IN_BODY,d2t(o,s)}function YKn(o,s){switch(s.tagID){case dt.HTML:{Sb(o,s);break}case dt.NOFRAMES:{s5(o,s);break}}}function VKn(o,s){s.chars=Vf,o._insertCharacters(s)}function XKn(o,s){o._insertCharacters(s),o.framesetOk=!1}function QPe(o){for(;o.treeAdapter.getNamespaceURI(o.openElements.current)!==Di.HTML&&!o._isIntegrationPoint(o.openElements.currentTagId,o.openElements.current);)o.openElements.pop()}function QKn(o,s){if(fWn(s))QPe(o),o._startTagOutsideForeignContent(s);else{const p=o._getAdjustedCurrentElement(),y=o.treeAdapter.getNamespaceURI(p);y===Di.MATHML?MPe(s):y===Di.SVG&&(dWn(s),RPe(s)),$$t(s),s.selfClosing?o._appendElement(s,y):o._insertElement(s,y),s.ackSelfClosing=!0}}function JKn(o,s){if(s.tagID===dt.P||s.tagID===dt.BR){QPe(o),o._endTagOutsideForeignContent(s);return}for(let p=o.openElements.stackTop;p>0;p--){const y=o.openElements.items[p];if(o.treeAdapter.getNamespaceURI(y)===Di.HTML){o._endTagOutsideForeignContent(s);break}const C=o.treeAdapter.getTagName(y);if(C.toLowerCase()===s.tagName){s.tagName=C,o.openElements.shortenToLength(p);break}}}tr.AREA,tr.BASE,tr.BASEFONT,tr.BGSOUND,tr.BR,tr.COL,tr.EMBED,tr.FRAME,tr.HR,tr.IMG,tr.INPUT,tr.KEYGEN,tr.LINK,tr.META,tr.PARAM,tr.SOURCE,tr.TRACK,tr.WBR;const ZKn=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,tGn=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),IAe={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function JPe(o,s){const p=lGn(o),y=B$t("type",{handlers:{root:eGn,element:nGn,text:rGn,comment:tLe,doctype:iGn,raw:sGn},unknown:oGn}),C={parser:p?new SAe(IAe):SAe.getFragmentParser(void 0,IAe),handle(z){y(z,C)},stitches:!1,options:s||{}};y(o,C),g$(C,P6());const N=p?C.parser.document:C.parser.getFragment(),L=nqn(N,{file:C.options.file});return C.stitches&&L$t(L,"comment",function(z,G,q){const et=z;if(et.value.stitch&&q&&G!==void 0){const tt=q.children;return tt[G]=et.value.stitch,G}}),L.type==="root"&&L.children.length===1&&L.children[0].type===o.type?L.children[0]:L}function ZPe(o,s){let p=-1;if(o)for(;++p<o.length;)s.handle(o[p])}function eGn(o,s){ZPe(o.children,s)}function nGn(o,s){cGn(o,s),ZPe(o.children,s),uGn(o,s)}function rGn(o,s){s.parser.tokenizer.state>4&&(s.parser.tokenizer.state=0);const p={type:ku.CHARACTER,chars:o.value,location:cJ(o)};g$(s,P6(o)),s.parser.currentToken=p,s.parser._processToken(s.parser.currentToken)}function iGn(o,s){const p={type:ku.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:cJ(o)};g$(s,P6(o)),s.parser.currentToken=p,s.parser._processToken(s.parser.currentToken)}function aGn(o,s){s.stitches=!0;const p=hGn(o);if("children"in o&&"children"in p){const y=JPe({type:"root",children:o.children},s.options);p.children=y.children}tLe({type:"comment",value:{stitch:p}},s)}function tLe(o,s){const p=o.value,y={type:ku.COMMENT,data:p,location:cJ(o)};g$(s,P6(o)),s.parser.currentToken=y,s.parser._processToken(s.parser.currentToken)}function sGn(o,s){if(s.parser.tokenizer.preprocessor.html="",s.parser.tokenizer.preprocessor.pos=-1,s.parser.tokenizer.preprocessor.lastGapPos=-2,s.parser.tokenizer.preprocessor.gapStack=[],s.parser.tokenizer.preprocessor.skipNextNewLine=!1,s.parser.tokenizer.preprocessor.lastChunkWritten=!1,s.parser.tokenizer.preprocessor.endOfChunkHit=!1,s.parser.tokenizer.preprocessor.isEol=!1,eLe(s,P6(o)),s.parser.tokenizer.write(s.options.tagfilter?o.value.replace(ZKn,"<$1$2"):o.value,!1),s.parser.tokenizer._runParsingLoop(),s.parser.tokenizer.state===72||s.parser.tokenizer.state===78){s.parser.tokenizer.preprocessor.lastChunkWritten=!0;const p=s.parser.tokenizer._consume();s.parser.tokenizer._callState(p)}}function oGn(o,s){const p=o;if(s.options.passThrough&&s.options.passThrough.includes(p.type))aGn(p,s);else{let y="";throw tGn.has(p.type)&&(y=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+p.type+"` node"+y)}}function g$(o,s){eLe(o,s);const p=o.parser.tokenizer.currentCharacterToken;p&&p.location&&(p.location.endLine=o.parser.tokenizer.preprocessor.line,p.location.endCol=o.parser.tokenizer.preprocessor.col+1,p.location.endOffset=o.parser.tokenizer.preprocessor.offset+1,o.parser.currentToken=p,o.parser._processToken(o.parser.currentToken)),o.parser.tokenizer.paused=!1,o.parser.tokenizer.inLoop=!1,o.parser.tokenizer.active=!1,o.parser.tokenizer.returnState=N1.DATA,o.parser.tokenizer.charRefCode=-1,o.parser.tokenizer.consumedAfterSnapshot=-1,o.parser.tokenizer.currentLocation=null,o.parser.tokenizer.currentCharacterToken=null,o.parser.tokenizer.currentToken=null,o.parser.tokenizer.currentAttr={name:"",value:""}}function eLe(o,s){if(s&&s.offset!==void 0){const p={startLine:s.line,startCol:s.column,startOffset:s.offset,endLine:-1,endCol:-1,endOffset:-1};o.parser.tokenizer.preprocessor.lineStartPos=-s.column+1,o.parser.tokenizer.preprocessor.droppedBufferSize=s.offset,o.parser.tokenizer.preprocessor.line=s.line,o.parser.tokenizer.currentLocation=p}}function cGn(o,s){const p=o.tagName.toLowerCase();if(s.parser.tokenizer.state===N1.PLAINTEXT)return;g$(s,P6(o));const y=s.parser.openElements.current;let C="namespaceURI"in y?y.namespaceURI:fP.html;C===fP.html&&p==="svg"&&(C=fP.svg);const N=mqn({...o,children:[]},{space:C===fP.svg?"svg":"html"}),L={type:ku.START_TAG,tagName:p,tagID:p$(p),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in N?N.attrs:[],location:cJ(o)};s.parser.currentToken=L,s.parser._processToken(s.parser.currentToken),s.parser.tokenizer.lastStartTagName=p}function uGn(o,s){const p=o.tagName.toLowerCase();if(!s.parser.tokenizer.inForeignNode&&_Pe.includes(p)||s.parser.tokenizer.state===N1.PLAINTEXT)return;g$(s,u2t(o));const y={type:ku.END_TAG,tagName:p,tagID:p$(p),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:cJ(o)};s.parser.currentToken=y,s.parser._processToken(s.parser.currentToken),p===s.parser.tokenizer.lastStartTagName&&(s.parser.tokenizer.state===N1.RCDATA||s.parser.tokenizer.state===N1.RAWTEXT||s.parser.tokenizer.state===N1.SCRIPT_DATA)&&(s.parser.tokenizer.state=N1.DATA)}function lGn(o){const s=o.type==="root"?o.children[0]:o;return!!(s&&(s.type==="doctype"||s.type==="element"&&s.tagName.toLowerCase()==="html"))}function cJ(o){const s=P6(o)||{line:void 0,column:void 0,offset:void 0},p=u2t(o)||{line:void 0,column:void 0,offset:void 0};return{startLine:s.line,startCol:s.column,startOffset:s.offset,endLine:p.line,endCol:p.column,endOffset:p.offset}}function hGn(o){return"children"in o?e$({...o,children:[]}):e$(o)}function fGn(o){return function(s,p){return JPe(s,{...o,file:p})}}const dGn=/["&'<>`]/g,pGn=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,gGn=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,bGn=/[|\\{}()[\]^$+*?.]/g,OAe=new WeakMap;function mGn(o,s){if(o=o.replace(s.subset?yGn(s.subset):dGn,y),s.subset||s.escapeOnly)return o;return o.replace(pGn,p).replace(gGn,y);function p(C,N,L){return s.format((C.charCodeAt(0)-55296)*1024+C.charCodeAt(1)-56320+65536,L.charCodeAt(N+2),s)}function y(C,N,L){return s.format(C.charCodeAt(0),L.charCodeAt(N+1),s)}}function yGn(o){let s=OAe.get(o);return s||(s=wGn(o),OAe.set(o,s)),s}function wGn(o){const s=[];let p=-1;for(;++p<o.length;)s.push(o[p].replace(bGn,"\\$&"));return new RegExp("(?:"+s.join("|")+")","g")}const vGn=/[\dA-Fa-f]/;function _Gn(o,s,p){const y="&#x"+o.toString(16).toUpperCase();return p&&s&&!vGn.test(String.fromCharCode(s))?y:y+";"}const xGn=/\d/;function EGn(o,s,p){const y="&#"+String(o);return p&&s&&!xGn.test(String.fromCharCode(s))?y:y+";"}const TGn=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],gBt={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},kGn=["cent","copy","divide","gt","lt","not","para","times"],nLe={}.hasOwnProperty,AFt={};let jbt;for(jbt in gBt)nLe.call(gBt,jbt)&&(AFt[gBt[jbt]]=jbt);const SGn=/[^\dA-Za-z]/;function CGn(o,s,p,y){const C=String.fromCharCode(o);if(nLe.call(AFt,C)){const N=AFt[C],L="&"+N;return p&&TGn.includes(N)&&!kGn.includes(N)&&(!y||s&&s!==61&&SGn.test(String.fromCharCode(s)))?L:L+";"}return""}function AGn(o,s,p){let y=_Gn(o,s,p.omitOptionalSemicolons),C;if((p.useNamedReferences||p.useShortestReferences)&&(C=CGn(o,s,p.omitOptionalSemicolons,p.attribute)),(p.useShortestReferences||!C)&&p.useShortestReferences){const N=EGn(o,s,p.omitOptionalSemicolons);N.length<y.length&&(y=N)}return C&&(!p.useShortestReferences||C.length<y.length)?C:y}function KF(o,s){return mGn(o,Object.assign({format:AGn},s))}const IGn=/^>|^->|<!--|-->|--!>|<!-$/g,OGn=[">"],NGn=["<",">"];function PGn(o,s,p,y){return y.settings.bogusComments?"<?"+KF(o.value,Object.assign({},y.settings.characterReferences,{subset:OGn}))+">":"<!--"+o.value.replace(IGn,C)+"-->";function C(N){return KF(N,Object.assign({},y.settings.characterReferences,{subset:NGn}))}}function LGn(o,s,p,y){return"<!"+(y.settings.upperDoctype?"DOCTYPE":"doctype")+(y.settings.tightDoctype?"":" ")+"html>"}function NAe(o,s){const p=String(o);if(typeof s!="string")throw new TypeError("Expected character");let y=0,C=p.indexOf(s);for(;C!==-1;)y++,C=p.indexOf(s,C+s.length);return y}const ip=iLe(1),rLe=iLe(-1),MGn=[];function iLe(o){return s;function s(p,y,C){const N=p?p.children:MGn;let L=(y||0)+o,z=N[L];if(!C)for(;z&&s2t(z);)L+=o,z=N[L];return z}}const RGn={}.hasOwnProperty;function aLe(o){return s;function s(p,y,C){return RGn.call(o,p.tagName)&&o[p.tagName](p,y,C)}}const U$t=aLe({body:BGn,caption:bBt,colgroup:bBt,dd:HGn,dt:jGn,head:bBt,html:DGn,li:$Gn,optgroup:zGn,option:UGn,p:FGn,rp:PAe,rt:PAe,tbody:WGn,td:LAe,tfoot:KGn,th:LAe,thead:qGn,tr:GGn});function bBt(o,s,p){const y=ip(p,s,!0);return!y||y.type!=="comment"&&!(y.type==="text"&&s2t(y.value.charAt(0)))}function DGn(o,s,p){const y=ip(p,s);return!y||y.type!=="comment"}function BGn(o,s,p){const y=ip(p,s);return!y||y.type!=="comment"}function FGn(o,s,p){const y=ip(p,s);return y?y.type==="element"&&(y.tagName==="address"||y.tagName==="article"||y.tagName==="aside"||y.tagName==="blockquote"||y.tagName==="details"||y.tagName==="div"||y.tagName==="dl"||y.tagName==="fieldset"||y.tagName==="figcaption"||y.tagName==="figure"||y.tagName==="footer"||y.tagName==="form"||y.tagName==="h1"||y.tagName==="h2"||y.tagName==="h3"||y.tagName==="h4"||y.tagName==="h5"||y.tagName==="h6"||y.tagName==="header"||y.tagName==="hgroup"||y.tagName==="hr"||y.tagName==="main"||y.tagName==="menu"||y.tagName==="nav"||y.tagName==="ol"||y.tagName==="p"||y.tagName==="pre"||y.tagName==="section"||y.tagName==="table"||y.tagName==="ul"):!p||!(p.type==="element"&&(p.tagName==="a"||p.tagName==="audio"||p.tagName==="del"||p.tagName==="ins"||p.tagName==="map"||p.tagName==="noscript"||p.tagName==="video"))}function $Gn(o,s,p){const y=ip(p,s);return!y||y.type==="element"&&y.tagName==="li"}function jGn(o,s,p){const y=ip(p,s);return!!(y&&y.type==="element"&&(y.tagName==="dt"||y.tagName==="dd"))}function HGn(o,s,p){const y=ip(p,s);return!y||y.type==="element"&&(y.tagName==="dt"||y.tagName==="dd")}function PAe(o,s,p){const y=ip(p,s);return!y||y.type==="element"&&(y.tagName==="rp"||y.tagName==="rt")}function zGn(o,s,p){const y=ip(p,s);return!y||y.type==="element"&&y.tagName==="optgroup"}function UGn(o,s,p){const y=ip(p,s);return!y||y.type==="element"&&(y.tagName==="option"||y.tagName==="optgroup")}function qGn(o,s,p){const y=ip(p,s);return!!(y&&y.type==="element"&&(y.tagName==="tbody"||y.tagName==="tfoot"))}function WGn(o,s,p){const y=ip(p,s);return!y||y.type==="element"&&(y.tagName==="tbody"||y.tagName==="tfoot")}function KGn(o,s,p){return!ip(p,s)}function GGn(o,s,p){const y=ip(p,s);return!y||y.type==="element"&&y.tagName==="tr"}function LAe(o,s,p){const y=ip(p,s);return!y||y.type==="element"&&(y.tagName==="td"||y.tagName==="th")}const YGn=aLe({body:QGn,colgroup:JGn,head:XGn,html:VGn,tbody:ZGn});function VGn(o){const s=ip(o,-1);return!s||s.type!=="comment"}function XGn(o){const s=new Set;for(const y of o.children)if(y.type==="element"&&(y.tagName==="base"||y.tagName==="title")){if(s.has(y.tagName))return!1;s.add(y.tagName)}const p=o.children[0];return!p||p.type==="element"}function QGn(o){const s=ip(o,-1,!0);return!s||s.type!=="comment"&&!(s.type==="text"&&s2t(s.value.charAt(0)))&&!(s.type==="element"&&(s.tagName==="meta"||s.tagName==="link"||s.tagName==="script"||s.tagName==="style"||s.tagName==="template"))}function JGn(o,s,p){const y=rLe(p,s),C=ip(o,-1,!0);return p&&y&&y.type==="element"&&y.tagName==="colgroup"&&U$t(y,p.children.indexOf(y),p)?!1:!!(C&&C.type==="element"&&C.tagName==="col")}function ZGn(o,s,p){const y=rLe(p,s),C=ip(o,-1);return p&&y&&y.type==="element"&&(y.tagName==="thead"||y.tagName==="tbody")&&U$t(y,p.children.indexOf(y),p)?!1:!!(C&&C.type==="element"&&C.tagName==="tr")}const Hbt={name:[[`
|
|
1856
|
+
`}),p}function X9e(o){let s=0,p=o.charCodeAt(s);for(;p===9||p===32;)s++,p=o.charCodeAt(s);return o.slice(s)}function Q9e(o,s){const p=dUn(o,s),y=p.one(o,void 0),C=nUn(p),N=Array.isArray(y)?{type:"root",children:y}:y||{type:"root",children:[]};return C&&N.children.push({type:"text",value:`
|
|
1857
|
+
`},C),N}function yUn(o,s){return o&&"run"in o?async function(p,y){const C=Q9e(p,{file:y,...s});await o.run(C,y)}:function(p,y){return Q9e(p,{file:y,...o||s})}}function J9e(o){if(o)throw o}var Zbt=Object.prototype.hasOwnProperty,sPe=Object.prototype.toString,Z9e=Object.defineProperty,tAe=Object.getOwnPropertyDescriptor,eAe=function(s){return typeof Array.isArray=="function"?Array.isArray(s):sPe.call(s)==="[object Array]"},nAe=function(s){if(!s||sPe.call(s)!=="[object Object]")return!1;var p=Zbt.call(s,"constructor"),y=s.constructor&&s.constructor.prototype&&Zbt.call(s.constructor.prototype,"isPrototypeOf");if(s.constructor&&!p&&!y)return!1;var C;for(C in s);return typeof C>"u"||Zbt.call(s,C)},rAe=function(s,p){Z9e&&p.name==="__proto__"?Z9e(s,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):s[p.name]=p.newValue},iAe=function(s,p){if(p==="__proto__")if(Zbt.call(s,p)){if(tAe)return tAe(s,p).value}else return;return s[p]},wUn=function o(){var s,p,y,C,N,L,z=arguments[0],G=1,q=arguments.length,et=!1;for(typeof z=="boolean"&&(et=z,z=arguments[1]||{},G=2),(z==null||typeof z!="object"&&typeof z!="function")&&(z={});G<q;++G)if(s=arguments[G],s!=null)for(p in s)y=iAe(z,p),C=iAe(s,p),z!==C&&(et&&C&&(nAe(C)||(N=eAe(C)))?(N?(N=!1,L=y&&eAe(y)?y:[]):L=y&&nAe(y)?y:{},rAe(z,{name:p,newValue:o(et,L,C)})):typeof C<"u"&&rAe(z,{name:p,newValue:C}));return z};const iBt=KAe(wUn);function wFt(o){if(typeof o!="object"||o===null)return!1;const s=Object.getPrototypeOf(o);return(s===null||s===Object.prototype||Object.getPrototypeOf(s)===null)&&!(Symbol.toStringTag in o)&&!(Symbol.iterator in o)}function vUn(){const o=[],s={run:p,use:y};return s;function p(...C){let N=-1;const L=C.pop();if(typeof L!="function")throw new TypeError("Expected function as last argument, not "+L);z(null,...C);function z(G,...q){const et=o[++N];let tt=-1;if(G){L(G);return}for(;++tt<C.length;)(q[tt]===null||q[tt]===void 0)&&(q[tt]=C[tt]);C=q,et?_Un(et,z)(...q):L(null,...q)}}function y(C){if(typeof C!="function")throw new TypeError("Expected `middelware` to be a function, not "+C);return o.push(C),s}}function _Un(o,s){let p;return y;function y(...L){const z=o.length>L.length;let G;z&&L.push(C);try{G=o.apply(this,L)}catch(q){const et=q;if(z&&p)throw et;return C(et)}z||(G&&G.then&&typeof G.then=="function"?G.then(N,C):G instanceof Error?C(G):N(G))}function C(L,...z){p||(p=!0,s(L,...z))}function N(L){C(null,L)}}const w6={basename:xUn,dirname:EUn,extname:TUn,join:kUn,sep:"/"};function xUn(o,s){if(s!==void 0&&typeof s!="string")throw new TypeError('"ext" argument must be a string');aJ(o);let p=0,y=-1,C=o.length,N;if(s===void 0||s.length===0||s.length>o.length){for(;C--;)if(o.codePointAt(C)===47){if(N){p=C+1;break}}else y<0&&(N=!0,y=C+1);return y<0?"":o.slice(p,y)}if(s===o)return"";let L=-1,z=s.length-1;for(;C--;)if(o.codePointAt(C)===47){if(N){p=C+1;break}}else L<0&&(N=!0,L=C+1),z>-1&&(o.codePointAt(C)===s.codePointAt(z--)?z<0&&(y=C):(z=-1,y=L));return p===y?y=L:y<0&&(y=o.length),o.slice(p,y)}function EUn(o){if(aJ(o),o.length===0)return".";let s=-1,p=o.length,y;for(;--p;)if(o.codePointAt(p)===47){if(y){s=p;break}}else y||(y=!0);return s<0?o.codePointAt(0)===47?"/":".":s===1&&o.codePointAt(0)===47?"//":o.slice(0,s)}function TUn(o){aJ(o);let s=o.length,p=-1,y=0,C=-1,N=0,L;for(;s--;){const z=o.codePointAt(s);if(z===47){if(L){y=s+1;break}continue}p<0&&(L=!0,p=s+1),z===46?C<0?C=s:N!==1&&(N=1):C>-1&&(N=-1)}return C<0||p<0||N===0||N===1&&C===p-1&&C===y+1?"":o.slice(C,p)}function kUn(...o){let s=-1,p;for(;++s<o.length;)aJ(o[s]),o[s]&&(p=p===void 0?o[s]:p+"/"+o[s]);return p===void 0?".":SUn(p)}function SUn(o){aJ(o);const s=o.codePointAt(0)===47;let p=CUn(o,!s);return p.length===0&&!s&&(p="."),p.length>0&&o.codePointAt(o.length-1)===47&&(p+="/"),s?"/"+p:p}function CUn(o,s){let p="",y=0,C=-1,N=0,L=-1,z,G;for(;++L<=o.length;){if(L<o.length)z=o.codePointAt(L);else{if(z===47)break;z=47}if(z===47){if(!(C===L-1||N===1))if(C!==L-1&&N===2){if(p.length<2||y!==2||p.codePointAt(p.length-1)!==46||p.codePointAt(p.length-2)!==46){if(p.length>2){if(G=p.lastIndexOf("/"),G!==p.length-1){G<0?(p="",y=0):(p=p.slice(0,G),y=p.length-1-p.lastIndexOf("/")),C=L,N=0;continue}}else if(p.length>0){p="",y=0,C=L,N=0;continue}}s&&(p=p.length>0?p+"/..":"..",y=2)}else p.length>0?p+="/"+o.slice(C+1,L):p=o.slice(C+1,L),y=L-C-1;C=L,N=0}else z===46&&N>-1?N++:N=-1}return p}function aJ(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}const AUn={cwd:IUn};function IUn(){return"/"}function vFt(o){return!!(o!==null&&typeof o=="object"&&"href"in o&&o.href&&"protocol"in o&&o.protocol&&o.auth===void 0)}function OUn(o){if(typeof o=="string")o=new URL(o);else if(!vFt(o)){const s=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+o+"`");throw s.code="ERR_INVALID_ARG_TYPE",s}if(o.protocol!=="file:"){const s=new TypeError("The URL must be of scheme file");throw s.code="ERR_INVALID_URL_SCHEME",s}return NUn(o)}function NUn(o){if(o.hostname!==""){const y=new TypeError('File URL host must be "localhost" or empty on darwin');throw y.code="ERR_INVALID_FILE_URL_HOST",y}const s=o.pathname;let p=-1;for(;++p<s.length;)if(s.codePointAt(p)===37&&s.codePointAt(p+1)===50){const y=s.codePointAt(p+2);if(y===70||y===102){const C=new TypeError("File URL path must not include encoded / characters");throw C.code="ERR_INVALID_FILE_URL_PATH",C}}return decodeURIComponent(s)}const aBt=["history","path","basename","stem","extname","dirname"];class oPe{constructor(s){let p;s?vFt(s)?p={path:s}:typeof s=="string"||PUn(s)?p={value:s}:p=s:p={},this.cwd="cwd"in p?"":AUn.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let y=-1;for(;++y<aBt.length;){const N=aBt[y];N in p&&p[N]!==void 0&&p[N]!==null&&(this[N]=N==="history"?[...p[N]]:p[N])}let C;for(C in p)aBt.includes(C)||(this[C]=p[C])}get basename(){return typeof this.path=="string"?w6.basename(this.path):void 0}set basename(s){oBt(s,"basename"),sBt(s,"basename"),this.path=w6.join(this.dirname||"",s)}get dirname(){return typeof this.path=="string"?w6.dirname(this.path):void 0}set dirname(s){aAe(this.basename,"dirname"),this.path=w6.join(s||"",this.basename)}get extname(){return typeof this.path=="string"?w6.extname(this.path):void 0}set extname(s){if(sBt(s,"extname"),aAe(this.dirname,"extname"),s){if(s.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(s.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=w6.join(this.dirname,this.stem+(s||""))}get path(){return this.history[this.history.length-1]}set path(s){vFt(s)&&(s=OUn(s)),oBt(s,"path"),this.path!==s&&this.history.push(s)}get stem(){return typeof this.path=="string"?w6.basename(this.path,this.extname):void 0}set stem(s){oBt(s,"stem"),sBt(s,"stem"),this.path=w6.join(this.dirname||"",s+(this.extname||""))}fail(s,p,y){const C=this.message(s,p,y);throw C.fatal=!0,C}info(s,p,y){const C=this.message(s,p,y);return C.fatal=void 0,C}message(s,p,y){const C=new kb(s,p,y);return this.path&&(C.name=this.path+":"+C.name,C.file=this.path),C.fatal=!1,this.messages.push(C),C}toString(s){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(s||void 0).decode(this.value)}}function sBt(o,s){if(o&&o.includes(w6.sep))throw new Error("`"+s+"` cannot be a path: did not expect `"+w6.sep+"`")}function oBt(o,s){if(!o)throw new Error("`"+s+"` cannot be empty")}function aAe(o,s){if(!o)throw new Error("Setting `"+s+"` requires `path` to be set too")}function PUn(o){return!!(o&&typeof o=="object"&&"byteLength"in o&&"byteOffset"in o)}const LUn=function(o){const y=this.constructor.prototype,C=y[o],N=function(){return C.apply(N,arguments)};return Object.setPrototypeOf(N,y),N},MUn={}.hasOwnProperty;class M$t extends LUn{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=vUn()}copy(){const s=new M$t;let p=-1;for(;++p<this.attachers.length;){const y=this.attachers[p];s.use(...y)}return s.data(iBt(!0,{},this.namespace)),s}data(s,p){return typeof s=="string"?arguments.length===2?(lBt("data",this.frozen),this.namespace[s]=p,this):MUn.call(this.namespace,s)&&this.namespace[s]||void 0:s?(lBt("data",this.frozen),this.namespace=s,this):this.namespace}freeze(){if(this.frozen)return this;const s=this;for(;++this.freezeIndex<this.attachers.length;){const[p,...y]=this.attachers[this.freezeIndex];if(y[0]===!1)continue;y[0]===!0&&(y[0]=void 0);const C=p.call(s,...y);typeof C=="function"&&this.transformers.use(C)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(s){this.freeze();const p=Fbt(s),y=this.parser||this.Parser;return cBt("parse",y),y(String(p),p)}process(s,p){const y=this;return this.freeze(),cBt("process",this.parser||this.Parser),uBt("process",this.compiler||this.Compiler),p?C(void 0,p):new Promise(C);function C(N,L){const z=Fbt(s),G=y.parse(z);y.run(G,z,function(et,tt,nt){if(et||!tt||!nt)return q(et);const st=tt,at=y.stringify(st,nt);BUn(at)?nt.value=at:nt.result=at,q(et,nt)});function q(et,tt){et||!tt?L(et):N?N(tt):p(void 0,tt)}}}processSync(s){let p=!1,y;return this.freeze(),cBt("processSync",this.parser||this.Parser),uBt("processSync",this.compiler||this.Compiler),this.process(s,C),oAe("processSync","process",p),y;function C(N,L){p=!0,J9e(N),y=L}}run(s,p,y){sAe(s),this.freeze();const C=this.transformers;return!y&&typeof p=="function"&&(y=p,p=void 0),y?N(void 0,y):new Promise(N);function N(L,z){const G=Fbt(p);C.run(s,G,q);function q(et,tt,nt){const st=tt||s;et?z(et):L?L(st):y(void 0,st,nt)}}}runSync(s,p){let y=!1,C;return this.run(s,p,N),oAe("runSync","run",y),C;function N(L,z){J9e(L),C=z,y=!0}}stringify(s,p){this.freeze();const y=Fbt(p),C=this.compiler||this.Compiler;return uBt("stringify",C),sAe(s),C(s,y)}use(s,...p){const y=this.attachers,C=this.namespace;if(lBt("use",this.frozen),s!=null)if(typeof s=="function")G(s,p);else if(typeof s=="object")Array.isArray(s)?z(s):L(s);else throw new TypeError("Expected usable value, not `"+s+"`");return this;function N(q){if(typeof q=="function")G(q,[]);else if(typeof q=="object")if(Array.isArray(q)){const[et,...tt]=q;G(et,tt)}else L(q);else throw new TypeError("Expected usable value, not `"+q+"`")}function L(q){if(!("plugins"in q)&&!("settings"in q))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");z(q.plugins),q.settings&&(C.settings=iBt(!0,C.settings,q.settings))}function z(q){let et=-1;if(q!=null)if(Array.isArray(q))for(;++et<q.length;){const tt=q[et];N(tt)}else throw new TypeError("Expected a list of plugins, not `"+q+"`")}function G(q,et){let tt=-1,nt=-1;for(;++tt<y.length;)if(y[tt][0]===q){nt=tt;break}if(nt===-1)y.push([q,...et]);else if(et.length>0){let[st,...at]=et;const Ot=y[nt][1];wFt(Ot)&&wFt(st)&&(st=iBt(!0,Ot,st)),y[nt]=[q,st,...at]}}}}const RUn=new M$t().freeze();function cBt(o,s){if(typeof s!="function")throw new TypeError("Cannot `"+o+"` without `parser`")}function uBt(o,s){if(typeof s!="function")throw new TypeError("Cannot `"+o+"` without `compiler`")}function lBt(o,s){if(s)throw new Error("Cannot call `"+o+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function sAe(o){if(!wFt(o)||typeof o.type!="string")throw new TypeError("Expected node, got `"+o+"`")}function oAe(o,s,p){if(!p)throw new Error("`"+o+"` finished async. Use `"+s+"` instead")}function Fbt(o){return DUn(o)?o:new oPe(o)}function DUn(o){return!!(o&&typeof o=="object"&&"message"in o&&"messages"in o)}function BUn(o){return typeof o=="string"||FUn(o)}function FUn(o){return!!(o&&typeof o=="object"&&"byteLength"in o&&"byteOffset"in o)}const $Un="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",cAe=[],uAe={allowDangerousHtml:!0},jUn=/^(https?|ircs?|mailto|xmpp)$/i,HUn=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function zUn(o){const s=UUn(o),p=qUn(o);return WUn(s.runSync(s.parse(p),p),o)}function UUn(o){const s=o.rehypePlugins||cAe,p=o.remarkPlugins||cAe,y=o.remarkRehypeOptions?{...o.remarkRehypeOptions,...uAe}:uAe;return RUn().use(Ezn).use(p).use(yUn,y).use(s)}function qUn(o){const s=o.children||"",p=new oPe;return typeof s=="string"&&(p.value=s),p}function WUn(o,s){const p=s.allowedElements,y=s.allowElement,C=s.components,N=s.disallowedElements,L=s.skipHtml,z=s.unwrapDisallowed,G=s.urlTransform||KUn;for(const et of HUn)Object.hasOwn(s,et.from)&&(""+et.from+(et.to?"use `"+et.to+"` instead":"remove it")+$Un+et.id,void 0);return s.className&&(o={type:"element",tagName:"div",properties:{className:s.className},children:o.type==="root"?o.children:[o]}),L$t(o,q),njn(o,{Fragment:le.Fragment,components:C,ignoreInvalidStyle:!0,jsx:le.jsx,jsxs:le.jsxs,passKeys:!0,passNode:!0});function q(et,tt,nt){if(et.type==="raw"&&nt&&typeof tt=="number")return L?nt.children.splice(tt,1):nt.children[tt]={type:"text",value:et.value},tt;if(et.type==="element"){let st;for(st in eBt)if(Object.hasOwn(eBt,st)&&Object.hasOwn(et.properties,st)){const at=et.properties[st],Ot=eBt[st];(Ot===null||Ot.includes(et.tagName))&&(et.properties[st]=G(String(at||""),st,et))}}if(et.type==="element"){let st=p?!p.includes(et.tagName):N?N.includes(et.tagName):!1;if(!st&&y&&typeof tt=="number"&&(st=!y(et,tt,nt)),st&&nt&&typeof tt=="number")return z&&et.children?nt.children.splice(tt,1,...et.children):nt.children.splice(tt,1),tt}}}function KUn(o){const s=o.indexOf(":"),p=o.indexOf("?"),y=o.indexOf("#"),C=o.indexOf("/");return s===-1||C!==-1&&s>C||p!==-1&&s>p||y!==-1&&s>y||jUn.test(o.slice(0,s))?o:""}const lAe=/[#.]/g;function GUn(o,s){const p=o||"",y={};let C=0,N,L;for(;C<p.length;){lAe.lastIndex=C;const z=lAe.exec(p),G=p.slice(C,z?z.index:p.length);G&&(N?N==="#"?y.id=G:Array.isArray(y.className)?y.className.push(G):y.className=[G]:L=G,C+=G.length),z&&(N=z[0],C++)}return{type:"element",tagName:L||s||"div",properties:y,children:[]}}function cPe(o,s,p){const y=p?QUn(p):void 0;function C(N,L,...z){let G;if(N==null){G={type:"root",children:[]};const q=L;z.unshift(q)}else{G=GUn(N,s);const q=G.tagName.toLowerCase(),et=y?y.get(q):void 0;if(G.tagName=et||q,YUn(L))z.unshift(L);else for(const[tt,nt]of Object.entries(L))VUn(o,G.properties,tt,nt)}for(const q of z)_Ft(G.children,q);return G.type==="element"&&G.tagName==="template"&&(G.content={type:"root",children:G.children},G.children=[]),G}return C}function YUn(o){if(o===null||typeof o!="object"||Array.isArray(o))return!0;if(typeof o.type!="string")return!1;const s=o,p=Object.keys(o);for(const y of p){const C=s[y];if(C&&typeof C=="object"){if(!Array.isArray(C))return!0;const N=C;for(const L of N)if(typeof L!="number"&&typeof L!="string")return!0}}return!!("children"in o&&Array.isArray(o.children))}function VUn(o,s,p,y){const C=o2t(o,p);let N;if(y!=null){if(typeof y=="number"){if(Number.isNaN(y))return;N=y}else typeof y=="boolean"?N=y:typeof y=="string"?C.spaceSeparated?N=E9e(y):C.commaSeparated?N=y9e(y):C.commaOrSpaceSeparated?N=E9e(y9e(y).join(" ")):N=hAe(C,C.property,y):Array.isArray(y)?N=[...y]:N=C.property==="style"?XUn(y):String(y);if(Array.isArray(N)){const L=[];for(const z of N)L.push(hAe(C,C.property,z));N=L}C.property==="className"&&Array.isArray(s.className)&&(N=s.className.concat(N)),s[C.property]=N}}function _Ft(o,s){if(s!=null)if(typeof s=="number"||typeof s=="string")o.push({type:"text",value:String(s)});else if(Array.isArray(s))for(const p of s)_Ft(o,p);else if(typeof s=="object"&&"type"in s)s.type==="root"?_Ft(o,s.children):o.push(s);else throw new Error("Expected node, nodes, or string, got `"+s+"`")}function hAe(o,s,p){if(typeof p=="string"){if(o.number&&p&&!Number.isNaN(Number(p)))return Number(p);if((o.boolean||o.overloadedBoolean)&&(p===""||KQ(p)===KQ(s)))return!0}return p}function XUn(o){const s=[];for(const[p,y]of Object.entries(o))s.push([p,y].join(": "));return s.join("; ")}function QUn(o){const s=new Map;for(const p of o)s.set(p.toLowerCase(),p);return s}const JUn=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],ZUn=cPe(iJ,"div"),tqn=cPe(xC,"g",JUn);function eqn(o){const s=String(o),p=[];return{toOffset:C,toPoint:y};function y(N){if(typeof N=="number"&&N>-1&&N<=s.length){let L=0;for(;;){let z=p[L];if(z===void 0){const G=fAe(s,p[L-1]);z=G===-1?s.length+1:G+1,p[L]=z}if(z>N)return{line:L+1,column:N-(L>0?p[L-1]:0)+1,offset:N};L++}}}function C(N){if(N&&typeof N.line=="number"&&typeof N.column=="number"&&!Number.isNaN(N.line)&&!Number.isNaN(N.column)){for(;p.length<N.line;){const z=p[p.length-1],G=fAe(s,z),q=G===-1?s.length+1:G+1;if(z===q)break;p.push(q)}const L=(N.line>1?p[N.line-2]:0)+N.column-1;if(L<p[N.line-1])return L}}}function fAe(o,s){const p=o.indexOf("\r",s),y=o.indexOf(`
|
|
1858
|
+
`,s);return y===-1?p:p===-1||p+1===y?y:p<y?p:y}const fP={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},uPe={}.hasOwnProperty,nqn=Object.prototype;function rqn(o,s){const p=s||{};return R$t({file:p.file||void 0,location:!1,schema:p.space==="svg"?xC:iJ,verbose:p.verbose||!1},o)}function R$t(o,s){let p;switch(s.nodeName){case"#comment":{const y=s;return p={type:"comment",value:y.data},tmt(o,y,p),p}case"#document":case"#document-fragment":{const y=s,C="mode"in y?y.mode==="quirks"||y.mode==="limited-quirks":!1;if(p={type:"root",children:lPe(o,s.childNodes),data:{quirksMode:C}},o.file&&o.location){const N=String(o.file),L=eqn(N),z=L.toPoint(0),G=L.toPoint(N.length);p.position={start:z,end:G}}return p}case"#documentType":{const y=s;return p={type:"doctype"},tmt(o,y,p),p}case"#text":{const y=s;return p={type:"text",value:y.value},tmt(o,y,p),p}default:return p=iqn(o,s),p}}function lPe(o,s){let p=-1;const y=[];for(;++p<s.length;){const C=R$t(o,s[p]);y.push(C)}return y}function iqn(o,s){const p=o.schema;o.schema=s.namespaceURI===fP.svg?xC:iJ;let y=-1;const C={};for(;++y<s.attrs.length;){const z=s.attrs[y],G=(z.prefix?z.prefix+":":"")+z.name;uPe.call(nqn,G)||(C[G]=z.value)}const L=(o.schema.space==="svg"?tqn:ZUn)(s.tagName,C,lPe(o,s.childNodes));if(tmt(o,s,L),L.tagName==="template"){const z=s,G=z.sourceCodeLocation,q=G&&G.startTag&&HF(G.startTag),et=G&&G.endTag&&HF(G.endTag),tt=R$t(o,z.content);q&&et&&o.file&&(tt.position={start:q.end,end:et.start}),L.content=tt}return o.schema=p,L}function tmt(o,s,p){if("sourceCodeLocation"in s&&s.sourceCodeLocation&&o.file){const y=aqn(o,p,s.sourceCodeLocation);y&&(o.location=!0,p.position=y)}}function aqn(o,s,p){const y=HF(p);if(s.type==="element"){const C=s.children[s.children.length-1];if(y&&!p.endTag&&C&&C.position&&C.position.end&&(y.end=Object.assign({},C.position.end)),o.verbose){const N={};let L;if(p.attrs)for(L in p.attrs)uPe.call(p.attrs,L)&&(N[o2t(o.schema,L).property]=HF(p.attrs[L]));p.startTag;const z=HF(p.startTag),G=p.endTag?HF(p.endTag):void 0,q={opening:z};G&&(q.closing=G),q.properties=N,s.data={position:q}}}return y}function HF(o){const s=dAe({line:o.startLine,column:o.startCol,offset:o.startOffset}),p=dAe({line:o.endLine,column:o.endCol,offset:o.endOffset});return s||p?{start:s,end:p}:void 0}function dAe(o){return o.line&&o.column?o:void 0}class sJ{constructor(s,p,y){this.property=s,this.normal=p,y&&(this.space=y)}}sJ.prototype.property={};sJ.prototype.normal={};sJ.prototype.space=null;function hPe(o,s){const p={},y={};let C=-1;for(;++C<o.length;)Object.assign(p,o[C].property),Object.assign(y,o[C].normal);return new sJ(p,y,s)}function xFt(o){return o.toLowerCase()}class M3{constructor(s,p){this.property=s,this.attribute=p}}M3.prototype.space=null;M3.prototype.boolean=!1;M3.prototype.booleanish=!1;M3.prototype.overloadedBoolean=!1;M3.prototype.number=!1;M3.prototype.commaSeparated=!1;M3.prototype.spaceSeparated=!1;M3.prototype.commaOrSpaceSeparated=!1;M3.prototype.mustUseProperty=!1;M3.prototype.defined=!1;let sqn=0;const jc=xP(),u0=xP(),fPe=xP(),la=xP(),sf=xP(),WF=xP(),Tw=xP();function xP(){return 2**++sqn}const EFt=Object.freeze(Object.defineProperty({__proto__:null,boolean:jc,booleanish:u0,commaOrSpaceSeparated:Tw,commaSeparated:WF,number:la,overloadedBoolean:fPe,spaceSeparated:sf},Symbol.toStringTag,{value:"Module"})),hBt=Object.keys(EFt);class D$t extends M3{constructor(s,p,y,C){let N=-1;if(super(s,p),pAe(this,"space",C),typeof y=="number")for(;++N<hBt.length;){const L=hBt[N];pAe(this,hBt[N],(y&EFt[L])===EFt[L])}}}D$t.prototype.defined=!0;function pAe(o,s,p){p&&(o[s]=p)}const oqn={}.hasOwnProperty;function f$(o){const s={},p={};let y;for(y in o.properties)if(oqn.call(o.properties,y)){const C=o.properties[y],N=new D$t(y,o.transform(o.attributes||{},y),C,o.space);o.mustUseProperty&&o.mustUseProperty.includes(y)&&(N.mustUseProperty=!0),s[y]=N,p[xFt(y)]=y,p[xFt(N.attribute)]=y}return new sJ(s,p,o.space)}const dPe=f$({space:"xlink",transform(o,s){return"xlink:"+s.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),pPe=f$({space:"xml",transform(o,s){return"xml:"+s.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function gPe(o,s){return s in o?o[s]:s}function bPe(o,s){return gPe(o,s.toLowerCase())}const mPe=f$({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:bPe,properties:{xmlns:null,xmlnsXLink:null}}),yPe=f$({transform(o,s){return s==="role"?s:"aria-"+s.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:u0,ariaAutoComplete:null,ariaBusy:u0,ariaChecked:u0,ariaColCount:la,ariaColIndex:la,ariaColSpan:la,ariaControls:sf,ariaCurrent:null,ariaDescribedBy:sf,ariaDetails:null,ariaDisabled:u0,ariaDropEffect:sf,ariaErrorMessage:null,ariaExpanded:u0,ariaFlowTo:sf,ariaGrabbed:u0,ariaHasPopup:null,ariaHidden:u0,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:sf,ariaLevel:la,ariaLive:null,ariaModal:u0,ariaMultiLine:u0,ariaMultiSelectable:u0,ariaOrientation:null,ariaOwns:sf,ariaPlaceholder:null,ariaPosInSet:la,ariaPressed:u0,ariaReadOnly:u0,ariaRelevant:null,ariaRequired:u0,ariaRoleDescription:sf,ariaRowCount:la,ariaRowIndex:la,ariaRowSpan:la,ariaSelected:u0,ariaSetSize:la,ariaSort:null,ariaValueMax:la,ariaValueMin:la,ariaValueNow:la,ariaValueText:null,role:null}}),cqn=f$({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:bPe,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:WF,acceptCharset:sf,accessKey:sf,action:null,allow:null,allowFullScreen:jc,allowPaymentRequest:jc,allowUserMedia:jc,alt:null,as:null,async:jc,autoCapitalize:null,autoComplete:sf,autoFocus:jc,autoPlay:jc,blocking:sf,capture:null,charSet:null,checked:jc,cite:null,className:sf,cols:la,colSpan:null,content:null,contentEditable:u0,controls:jc,controlsList:sf,coords:la|WF,crossOrigin:null,data:null,dateTime:null,decoding:null,default:jc,defer:jc,dir:null,dirName:null,disabled:jc,download:fPe,draggable:u0,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:jc,formTarget:null,headers:sf,height:la,hidden:jc,high:la,href:null,hrefLang:null,htmlFor:sf,httpEquiv:sf,id:null,imageSizes:null,imageSrcSet:null,inert:jc,inputMode:null,integrity:null,is:null,isMap:jc,itemId:null,itemProp:sf,itemRef:sf,itemScope:jc,itemType:sf,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:jc,low:la,manifest:null,max:null,maxLength:la,media:null,method:null,min:null,minLength:la,multiple:jc,muted:jc,name:null,nonce:null,noModule:jc,noValidate:jc,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:jc,optimum:la,pattern:null,ping:sf,placeholder:null,playsInline:jc,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:jc,referrerPolicy:null,rel:sf,required:jc,reversed:jc,rows:la,rowSpan:la,sandbox:sf,scope:null,scoped:jc,seamless:jc,selected:jc,shadowRootClonable:jc,shadowRootDelegatesFocus:jc,shadowRootMode:null,shape:null,size:la,sizes:null,slot:null,span:la,spellCheck:u0,src:null,srcDoc:null,srcLang:null,srcSet:null,start:la,step:null,style:null,tabIndex:la,target:null,title:null,translate:null,type:null,typeMustMatch:jc,useMap:null,value:u0,width:la,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:sf,axis:null,background:null,bgColor:null,border:la,borderColor:null,bottomMargin:la,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:jc,declare:jc,event:null,face:null,frame:null,frameBorder:null,hSpace:la,leftMargin:la,link:null,longDesc:null,lowSrc:null,marginHeight:la,marginWidth:la,noResize:jc,noHref:jc,noShade:jc,noWrap:jc,object:null,profile:null,prompt:null,rev:null,rightMargin:la,rules:null,scheme:null,scrolling:u0,standby:null,summary:null,text:null,topMargin:la,valueType:null,version:null,vAlign:null,vLink:null,vSpace:la,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:jc,disableRemotePlayback:jc,prefix:null,property:null,results:la,security:null,unselectable:null}}),uqn=f$({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:gPe,properties:{about:Tw,accentHeight:la,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:la,amplitude:la,arabicForm:null,ascent:la,attributeName:null,attributeType:null,azimuth:la,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:la,by:null,calcMode:null,capHeight:la,className:sf,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:la,diffuseConstant:la,direction:null,display:null,dur:null,divisor:la,dominantBaseline:null,download:jc,dx:null,dy:null,edgeMode:null,editable:null,elevation:la,enableBackground:null,end:null,event:null,exponent:la,externalResourcesRequired:null,fill:null,fillOpacity:la,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:WF,g2:WF,glyphName:WF,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:la,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:la,horizOriginX:la,horizOriginY:la,id:null,ideographic:la,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:la,k:la,k1:la,k2:la,k3:la,k4:la,kernelMatrix:Tw,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:la,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:la,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:la,overlineThickness:la,paintOrder:null,panose1:null,path:null,pathLength:la,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:sf,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:la,pointsAtY:la,pointsAtZ:la,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Tw,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Tw,rev:Tw,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Tw,requiredFeatures:Tw,requiredFonts:Tw,requiredFormats:Tw,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:la,specularExponent:la,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:la,strikethroughThickness:la,string:null,stroke:null,strokeDashArray:Tw,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:la,strokeOpacity:la,strokeWidth:null,style:null,surfaceScale:la,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Tw,tabIndex:la,tableValues:null,target:null,targetX:la,targetY:la,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Tw,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:la,underlineThickness:la,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:la,values:null,vAlphabetic:la,vMathematical:la,vectorEffect:null,vHanging:la,vIdeographic:la,version:null,vertAdvY:la,vertOriginX:la,vertOriginY:la,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:la,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),lqn=/^data[-\w.:]+$/i,gAe=/-[a-z]/g,hqn=/[A-Z]/g;function fqn(o,s){const p=xFt(s);let y=s,C=M3;if(p in o.normal)return o.property[o.normal[p]];if(p.length>4&&p.slice(0,4)==="data"&&lqn.test(s)){if(s.charAt(4)==="-"){const N=s.slice(5).replace(gAe,pqn);y="data"+N.charAt(0).toUpperCase()+N.slice(1)}else{const N=s.slice(4);if(!gAe.test(N)){let L=N.replace(hqn,dqn);L.charAt(0)!=="-"&&(L="-"+L),s="data"+L}}C=D$t}return new C(y,s)}function dqn(o){return"-"+o.toLowerCase()}function pqn(o){return o.charAt(1).toUpperCase()}const gqn=hPe([pPe,dPe,mPe,yPe,cqn],"html"),wPe=hPe([pPe,dPe,mPe,yPe,uqn],"svg"),bAe={}.hasOwnProperty;function B$t(o,s){const p=s||{};function y(C,...N){let L=y.invalid;const z=y.handlers;if(C&&bAe.call(C,o)){const G=String(C[o]);L=bAe.call(z,G)?z[G]:y.unknown}if(L)return L.call(this,C,...N)}return y.handlers=p.handlers||{},y.invalid=p.invalid,y.unknown=p.unknown,y}const bqn={},mqn={}.hasOwnProperty,vPe=B$t("type",{handlers:{root:wqn,element:Tqn,text:xqn,comment:Eqn,doctype:_qn}});function yqn(o,s){const y=(s||bqn).space;return vPe(o,y==="svg"?wPe:gqn)}function wqn(o,s){const p={nodeName:"#document",mode:(o.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return p.childNodes=F$t(o.children,p,s),d$(o,p),p}function vqn(o,s){const p={nodeName:"#document-fragment",childNodes:[]};return p.childNodes=F$t(o.children,p,s),d$(o,p),p}function _qn(o){const s={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return d$(o,s),s}function xqn(o){const s={nodeName:"#text",value:o.value,parentNode:null};return d$(o,s),s}function Eqn(o){const s={nodeName:"#comment",data:o.value,parentNode:null};return d$(o,s),s}function Tqn(o,s){const p=s;let y=p;o.type==="element"&&o.tagName.toLowerCase()==="svg"&&p.space==="html"&&(y=wPe);const C=[];let N;if(o.properties){for(N in o.properties)if(N!=="children"&&mqn.call(o.properties,N)){const G=kqn(y,N,o.properties[N]);G&&C.push(G)}}const L=y.space,z={nodeName:o.tagName,tagName:o.tagName,attrs:C,namespaceURI:fP[L],childNodes:[],parentNode:null};return z.childNodes=F$t(o.children,z,y),d$(o,z),o.tagName==="template"&&o.content&&(z.content=vqn(o.content,y)),z}function kqn(o,s,p){const y=fqn(o,s);if(p===!1||p===null||p===void 0||typeof p=="number"&&Number.isNaN(p)||!p&&y.boolean)return;Array.isArray(p)&&(p=y.commaSeparated?w$t(p):_$t(p));const C={name:y.attribute,value:p===!0?"":String(p)};if(y.space&&y.space!=="html"&&y.space!=="svg"){const N=C.name.indexOf(":");N<0?C.prefix="":(C.name=C.name.slice(N+1),C.prefix=y.attribute.slice(0,N)),C.namespace=fP[y.space]}return C}function F$t(o,s,p){let y=-1;const C=[];if(o)for(;++y<o.length;){const N=vPe(o[y],p);N.parentNode=s,C.push(N)}return C}function d$(o,s){const p=o.position;p&&p.start&&p.end&&(p.start.offset,p.end.offset,s.sourceCodeLocation={startLine:p.start.line,startCol:p.start.column,startOffset:p.start.offset,endLine:p.end.line,endCol:p.end.column,endOffset:p.end.offset})}const _Pe=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],Sqn=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Vf="�";var ve;(function(o){o[o.EOF=-1]="EOF",o[o.NULL=0]="NULL",o[o.TABULATION=9]="TABULATION",o[o.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",o[o.LINE_FEED=10]="LINE_FEED",o[o.FORM_FEED=12]="FORM_FEED",o[o.SPACE=32]="SPACE",o[o.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",o[o.QUOTATION_MARK=34]="QUOTATION_MARK",o[o.AMPERSAND=38]="AMPERSAND",o[o.APOSTROPHE=39]="APOSTROPHE",o[o.HYPHEN_MINUS=45]="HYPHEN_MINUS",o[o.SOLIDUS=47]="SOLIDUS",o[o.DIGIT_0=48]="DIGIT_0",o[o.DIGIT_9=57]="DIGIT_9",o[o.SEMICOLON=59]="SEMICOLON",o[o.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",o[o.EQUALS_SIGN=61]="EQUALS_SIGN",o[o.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",o[o.QUESTION_MARK=63]="QUESTION_MARK",o[o.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",o[o.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",o[o.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",o[o.GRAVE_ACCENT=96]="GRAVE_ACCENT",o[o.LATIN_SMALL_A=97]="LATIN_SMALL_A",o[o.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(ve||(ve={}));const X2={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function xPe(o){return o>=55296&&o<=57343}function Cqn(o){return o>=56320&&o<=57343}function Aqn(o,s){return(o-55296)*1024+9216+s}function EPe(o){return o!==32&&o!==10&&o!==13&&o!==9&&o!==12&&o>=1&&o<=31||o>=127&&o<=159}function TPe(o){return o>=64976&&o<=65007||Sqn.has(o)}var Rr;(function(o){o.controlCharacterInInputStream="control-character-in-input-stream",o.noncharacterInInputStream="noncharacter-in-input-stream",o.surrogateInInputStream="surrogate-in-input-stream",o.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",o.endTagWithAttributes="end-tag-with-attributes",o.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",o.unexpectedSolidusInTag="unexpected-solidus-in-tag",o.unexpectedNullCharacter="unexpected-null-character",o.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",o.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",o.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",o.missingEndTagName="missing-end-tag-name",o.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",o.unknownNamedCharacterReference="unknown-named-character-reference",o.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",o.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",o.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",o.eofBeforeTagName="eof-before-tag-name",o.eofInTag="eof-in-tag",o.missingAttributeValue="missing-attribute-value",o.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",o.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",o.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",o.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",o.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",o.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",o.missingDoctypePublicIdentifier="missing-doctype-public-identifier",o.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",o.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",o.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",o.cdataInHtmlContent="cdata-in-html-content",o.incorrectlyOpenedComment="incorrectly-opened-comment",o.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",o.eofInDoctype="eof-in-doctype",o.nestedComment="nested-comment",o.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",o.eofInComment="eof-in-comment",o.incorrectlyClosedComment="incorrectly-closed-comment",o.eofInCdata="eof-in-cdata",o.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",o.nullCharacterReference="null-character-reference",o.surrogateCharacterReference="surrogate-character-reference",o.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",o.controlCharacterReference="control-character-reference",o.noncharacterCharacterReference="noncharacter-character-reference",o.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",o.missingDoctypeName="missing-doctype-name",o.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",o.duplicateAttribute="duplicate-attribute",o.nonConformingDoctype="non-conforming-doctype",o.missingDoctype="missing-doctype",o.misplacedDoctype="misplaced-doctype",o.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",o.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",o.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",o.openElementsLeftAfterEof="open-elements-left-after-eof",o.abandonedHeadElementChild="abandoned-head-element-child",o.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",o.nestedNoscriptInHead="nested-noscript-in-head",o.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(Rr||(Rr={}));const Iqn=65536;class Oqn{constructor(s){this.handler=s,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=Iqn,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(s,p){const{line:y,col:C,offset:N}=this,L=C+p,z=N+p;return{code:s,startLine:y,endLine:y,startCol:L,endCol:L,startOffset:z,endOffset:z}}_err(s){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(s,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(s){if(this.pos!==this.html.length-1){const p=this.html.charCodeAt(this.pos+1);if(Cqn(p))return this.pos++,this._addGap(),Aqn(s,p)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,ve.EOF;return this._err(Rr.surrogateInInputStream),s}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(s,p){this.html.length>0?this.html+=s:this.html=s,this.endOfChunkHit=!1,this.lastChunkWritten=p}insertHtmlAtCurrentPos(s){this.html=this.html.substring(0,this.pos+1)+s+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(s,p){if(this.pos+s.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(p)return this.html.startsWith(s,this.pos);for(let y=0;y<s.length;y++)if((this.html.charCodeAt(this.pos+y)|32)!==s.charCodeAt(y))return!1;return!0}peek(s){const p=this.pos+s;if(p>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,ve.EOF;const y=this.html.charCodeAt(p);return y===ve.CARRIAGE_RETURN?ve.LINE_FEED:y}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,ve.EOF;let s=this.html.charCodeAt(this.pos);return s===ve.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,ve.LINE_FEED):s===ve.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,xPe(s)&&(s=this._processSurrogate(s)),this.handler.onParseError===null||s>31&&s<127||s===ve.LINE_FEED||s===ve.CARRIAGE_RETURN||s>159&&s<64976||this._checkForProblematicCharacters(s),s)}_checkForProblematicCharacters(s){EPe(s)?this._err(Rr.controlCharacterInInputStream):TPe(s)&&this._err(Rr.noncharacterInInputStream)}retreat(s){for(this.pos-=s;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var ku;(function(o){o[o.CHARACTER=0]="CHARACTER",o[o.NULL_CHARACTER=1]="NULL_CHARACTER",o[o.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",o[o.START_TAG=3]="START_TAG",o[o.END_TAG=4]="END_TAG",o[o.COMMENT=5]="COMMENT",o[o.DOCTYPE=6]="DOCTYPE",o[o.EOF=7]="EOF",o[o.HIBERNATION=8]="HIBERNATION"})(ku||(ku={}));function kPe(o,s){for(let p=o.attrs.length-1;p>=0;p--)if(o.attrs[p].name===s)return o.attrs[p].value;return null}const SPe=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(o=>o.charCodeAt(0))),Nqn=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(o=>o.charCodeAt(0)));var fBt;const Pqn=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),Lqn=(fBt=String.fromCodePoint)!==null&&fBt!==void 0?fBt:function(o){let s="";return o>65535&&(o-=65536,s+=String.fromCharCode(o>>>10&1023|55296),o=56320|o&1023),s+=String.fromCharCode(o),s};function Mqn(o){var s;return o>=55296&&o<=57343||o>1114111?65533:(s=Pqn.get(o))!==null&&s!==void 0?s:o}var Gp;(function(o){o[o.NUM=35]="NUM",o[o.SEMI=59]="SEMI",o[o.EQUALS=61]="EQUALS",o[o.ZERO=48]="ZERO",o[o.NINE=57]="NINE",o[o.LOWER_A=97]="LOWER_A",o[o.LOWER_F=102]="LOWER_F",o[o.LOWER_X=120]="LOWER_X",o[o.LOWER_Z=122]="LOWER_Z",o[o.UPPER_A=65]="UPPER_A",o[o.UPPER_F=70]="UPPER_F",o[o.UPPER_Z=90]="UPPER_Z"})(Gp||(Gp={}));const Rqn=32;var cC;(function(o){o[o.VALUE_LENGTH=49152]="VALUE_LENGTH",o[o.BRANCH_LENGTH=16256]="BRANCH_LENGTH",o[o.JUMP_TABLE=127]="JUMP_TABLE"})(cC||(cC={}));function TFt(o){return o>=Gp.ZERO&&o<=Gp.NINE}function Dqn(o){return o>=Gp.UPPER_A&&o<=Gp.UPPER_F||o>=Gp.LOWER_A&&o<=Gp.LOWER_F}function Bqn(o){return o>=Gp.UPPER_A&&o<=Gp.UPPER_Z||o>=Gp.LOWER_A&&o<=Gp.LOWER_Z||TFt(o)}function Fqn(o){return o===Gp.EQUALS||Bqn(o)}var Up;(function(o){o[o.EntityStart=0]="EntityStart",o[o.NumericStart=1]="NumericStart",o[o.NumericDecimal=2]="NumericDecimal",o[o.NumericHex=3]="NumericHex",o[o.NamedEntity=4]="NamedEntity"})(Up||(Up={}));var gk;(function(o){o[o.Legacy=0]="Legacy",o[o.Strict=1]="Strict",o[o.Attribute=2]="Attribute"})(gk||(gk={}));class CPe{constructor(s,p,y){this.decodeTree=s,this.emitCodePoint=p,this.errors=y,this.state=Up.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=gk.Strict}startEntity(s){this.decodeMode=s,this.state=Up.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(s,p){switch(this.state){case Up.EntityStart:return s.charCodeAt(p)===Gp.NUM?(this.state=Up.NumericStart,this.consumed+=1,this.stateNumericStart(s,p+1)):(this.state=Up.NamedEntity,this.stateNamedEntity(s,p));case Up.NumericStart:return this.stateNumericStart(s,p);case Up.NumericDecimal:return this.stateNumericDecimal(s,p);case Up.NumericHex:return this.stateNumericHex(s,p);case Up.NamedEntity:return this.stateNamedEntity(s,p)}}stateNumericStart(s,p){return p>=s.length?-1:(s.charCodeAt(p)|Rqn)===Gp.LOWER_X?(this.state=Up.NumericHex,this.consumed+=1,this.stateNumericHex(s,p+1)):(this.state=Up.NumericDecimal,this.stateNumericDecimal(s,p))}addToNumericResult(s,p,y,C){if(p!==y){const N=y-p;this.result=this.result*Math.pow(C,N)+parseInt(s.substr(p,N),C),this.consumed+=N}}stateNumericHex(s,p){const y=p;for(;p<s.length;){const C=s.charCodeAt(p);if(TFt(C)||Dqn(C))p+=1;else return this.addToNumericResult(s,y,p,16),this.emitNumericEntity(C,3)}return this.addToNumericResult(s,y,p,16),-1}stateNumericDecimal(s,p){const y=p;for(;p<s.length;){const C=s.charCodeAt(p);if(TFt(C))p+=1;else return this.addToNumericResult(s,y,p,10),this.emitNumericEntity(C,2)}return this.addToNumericResult(s,y,p,10),-1}emitNumericEntity(s,p){var y;if(this.consumed<=p)return(y=this.errors)===null||y===void 0||y.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(s===Gp.SEMI)this.consumed+=1;else if(this.decodeMode===gk.Strict)return 0;return this.emitCodePoint(Mqn(this.result),this.consumed),this.errors&&(s!==Gp.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(s,p){const{decodeTree:y}=this;let C=y[this.treeIndex],N=(C&cC.VALUE_LENGTH)>>14;for(;p<s.length;p++,this.excess++){const L=s.charCodeAt(p);if(this.treeIndex=$qn(y,C,this.treeIndex+Math.max(1,N),L),this.treeIndex<0)return this.result===0||this.decodeMode===gk.Attribute&&(N===0||Fqn(L))?0:this.emitNotTerminatedNamedEntity();if(C=y[this.treeIndex],N=(C&cC.VALUE_LENGTH)>>14,N!==0){if(L===Gp.SEMI)return this.emitNamedEntityData(this.treeIndex,N,this.consumed+this.excess);this.decodeMode!==gk.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var s;const{result:p,decodeTree:y}=this,C=(y[p]&cC.VALUE_LENGTH)>>14;return this.emitNamedEntityData(p,C,this.consumed),(s=this.errors)===null||s===void 0||s.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(s,p,y){const{decodeTree:C}=this;return this.emitCodePoint(p===1?C[s]&~cC.VALUE_LENGTH:C[s+1],y),p===3&&this.emitCodePoint(C[s+2],y),y}end(){var s;switch(this.state){case Up.NamedEntity:return this.result!==0&&(this.decodeMode!==gk.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Up.NumericDecimal:return this.emitNumericEntity(0,2);case Up.NumericHex:return this.emitNumericEntity(0,3);case Up.NumericStart:return(s=this.errors)===null||s===void 0||s.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Up.EntityStart:return 0}}}function APe(o){let s="";const p=new CPe(o,y=>s+=Lqn(y));return function(C,N){let L=0,z=0;for(;(z=C.indexOf("&",z))>=0;){s+=C.slice(L,z),p.startEntity(N);const q=p.write(C,z+1);if(q<0){L=z+p.end();break}L=z+q,z=q===0?L+1:L}const G=s+C.slice(L);return s="",G}}function $qn(o,s,p,y){const C=(s&cC.BRANCH_LENGTH)>>7,N=s&cC.JUMP_TABLE;if(C===0)return N!==0&&y===N?p:-1;if(N){const G=y-N;return G<0||G>=C?-1:o[p+G]-1}let L=p,z=L+C-1;for(;L<=z;){const G=L+z>>>1,q=o[G];if(q<y)L=G+1;else if(q>y)z=G-1;else return o[G+C]}return-1}APe(SPe);APe(Nqn);var Di;(function(o){o.HTML="http://www.w3.org/1999/xhtml",o.MATHML="http://www.w3.org/1998/Math/MathML",o.SVG="http://www.w3.org/2000/svg",o.XLINK="http://www.w3.org/1999/xlink",o.XML="http://www.w3.org/XML/1998/namespace",o.XMLNS="http://www.w3.org/2000/xmlns/"})(Di||(Di={}));var pP;(function(o){o.TYPE="type",o.ACTION="action",o.ENCODING="encoding",o.PROMPT="prompt",o.NAME="name",o.COLOR="color",o.FACE="face",o.SIZE="size"})(pP||(pP={}));var C3;(function(o){o.NO_QUIRKS="no-quirks",o.QUIRKS="quirks",o.LIMITED_QUIRKS="limited-quirks"})(C3||(C3={}));var tr;(function(o){o.A="a",o.ADDRESS="address",o.ANNOTATION_XML="annotation-xml",o.APPLET="applet",o.AREA="area",o.ARTICLE="article",o.ASIDE="aside",o.B="b",o.BASE="base",o.BASEFONT="basefont",o.BGSOUND="bgsound",o.BIG="big",o.BLOCKQUOTE="blockquote",o.BODY="body",o.BR="br",o.BUTTON="button",o.CAPTION="caption",o.CENTER="center",o.CODE="code",o.COL="col",o.COLGROUP="colgroup",o.DD="dd",o.DESC="desc",o.DETAILS="details",o.DIALOG="dialog",o.DIR="dir",o.DIV="div",o.DL="dl",o.DT="dt",o.EM="em",o.EMBED="embed",o.FIELDSET="fieldset",o.FIGCAPTION="figcaption",o.FIGURE="figure",o.FONT="font",o.FOOTER="footer",o.FOREIGN_OBJECT="foreignObject",o.FORM="form",o.FRAME="frame",o.FRAMESET="frameset",o.H1="h1",o.H2="h2",o.H3="h3",o.H4="h4",o.H5="h5",o.H6="h6",o.HEAD="head",o.HEADER="header",o.HGROUP="hgroup",o.HR="hr",o.HTML="html",o.I="i",o.IMG="img",o.IMAGE="image",o.INPUT="input",o.IFRAME="iframe",o.KEYGEN="keygen",o.LABEL="label",o.LI="li",o.LINK="link",o.LISTING="listing",o.MAIN="main",o.MALIGNMARK="malignmark",o.MARQUEE="marquee",o.MATH="math",o.MENU="menu",o.META="meta",o.MGLYPH="mglyph",o.MI="mi",o.MO="mo",o.MN="mn",o.MS="ms",o.MTEXT="mtext",o.NAV="nav",o.NOBR="nobr",o.NOFRAMES="noframes",o.NOEMBED="noembed",o.NOSCRIPT="noscript",o.OBJECT="object",o.OL="ol",o.OPTGROUP="optgroup",o.OPTION="option",o.P="p",o.PARAM="param",o.PLAINTEXT="plaintext",o.PRE="pre",o.RB="rb",o.RP="rp",o.RT="rt",o.RTC="rtc",o.RUBY="ruby",o.S="s",o.SCRIPT="script",o.SEARCH="search",o.SECTION="section",o.SELECT="select",o.SOURCE="source",o.SMALL="small",o.SPAN="span",o.STRIKE="strike",o.STRONG="strong",o.STYLE="style",o.SUB="sub",o.SUMMARY="summary",o.SUP="sup",o.TABLE="table",o.TBODY="tbody",o.TEMPLATE="template",o.TEXTAREA="textarea",o.TFOOT="tfoot",o.TD="td",o.TH="th",o.THEAD="thead",o.TITLE="title",o.TR="tr",o.TRACK="track",o.TT="tt",o.U="u",o.UL="ul",o.SVG="svg",o.VAR="var",o.WBR="wbr",o.XMP="xmp"})(tr||(tr={}));var dt;(function(o){o[o.UNKNOWN=0]="UNKNOWN",o[o.A=1]="A",o[o.ADDRESS=2]="ADDRESS",o[o.ANNOTATION_XML=3]="ANNOTATION_XML",o[o.APPLET=4]="APPLET",o[o.AREA=5]="AREA",o[o.ARTICLE=6]="ARTICLE",o[o.ASIDE=7]="ASIDE",o[o.B=8]="B",o[o.BASE=9]="BASE",o[o.BASEFONT=10]="BASEFONT",o[o.BGSOUND=11]="BGSOUND",o[o.BIG=12]="BIG",o[o.BLOCKQUOTE=13]="BLOCKQUOTE",o[o.BODY=14]="BODY",o[o.BR=15]="BR",o[o.BUTTON=16]="BUTTON",o[o.CAPTION=17]="CAPTION",o[o.CENTER=18]="CENTER",o[o.CODE=19]="CODE",o[o.COL=20]="COL",o[o.COLGROUP=21]="COLGROUP",o[o.DD=22]="DD",o[o.DESC=23]="DESC",o[o.DETAILS=24]="DETAILS",o[o.DIALOG=25]="DIALOG",o[o.DIR=26]="DIR",o[o.DIV=27]="DIV",o[o.DL=28]="DL",o[o.DT=29]="DT",o[o.EM=30]="EM",o[o.EMBED=31]="EMBED",o[o.FIELDSET=32]="FIELDSET",o[o.FIGCAPTION=33]="FIGCAPTION",o[o.FIGURE=34]="FIGURE",o[o.FONT=35]="FONT",o[o.FOOTER=36]="FOOTER",o[o.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",o[o.FORM=38]="FORM",o[o.FRAME=39]="FRAME",o[o.FRAMESET=40]="FRAMESET",o[o.H1=41]="H1",o[o.H2=42]="H2",o[o.H3=43]="H3",o[o.H4=44]="H4",o[o.H5=45]="H5",o[o.H6=46]="H6",o[o.HEAD=47]="HEAD",o[o.HEADER=48]="HEADER",o[o.HGROUP=49]="HGROUP",o[o.HR=50]="HR",o[o.HTML=51]="HTML",o[o.I=52]="I",o[o.IMG=53]="IMG",o[o.IMAGE=54]="IMAGE",o[o.INPUT=55]="INPUT",o[o.IFRAME=56]="IFRAME",o[o.KEYGEN=57]="KEYGEN",o[o.LABEL=58]="LABEL",o[o.LI=59]="LI",o[o.LINK=60]="LINK",o[o.LISTING=61]="LISTING",o[o.MAIN=62]="MAIN",o[o.MALIGNMARK=63]="MALIGNMARK",o[o.MARQUEE=64]="MARQUEE",o[o.MATH=65]="MATH",o[o.MENU=66]="MENU",o[o.META=67]="META",o[o.MGLYPH=68]="MGLYPH",o[o.MI=69]="MI",o[o.MO=70]="MO",o[o.MN=71]="MN",o[o.MS=72]="MS",o[o.MTEXT=73]="MTEXT",o[o.NAV=74]="NAV",o[o.NOBR=75]="NOBR",o[o.NOFRAMES=76]="NOFRAMES",o[o.NOEMBED=77]="NOEMBED",o[o.NOSCRIPT=78]="NOSCRIPT",o[o.OBJECT=79]="OBJECT",o[o.OL=80]="OL",o[o.OPTGROUP=81]="OPTGROUP",o[o.OPTION=82]="OPTION",o[o.P=83]="P",o[o.PARAM=84]="PARAM",o[o.PLAINTEXT=85]="PLAINTEXT",o[o.PRE=86]="PRE",o[o.RB=87]="RB",o[o.RP=88]="RP",o[o.RT=89]="RT",o[o.RTC=90]="RTC",o[o.RUBY=91]="RUBY",o[o.S=92]="S",o[o.SCRIPT=93]="SCRIPT",o[o.SEARCH=94]="SEARCH",o[o.SECTION=95]="SECTION",o[o.SELECT=96]="SELECT",o[o.SOURCE=97]="SOURCE",o[o.SMALL=98]="SMALL",o[o.SPAN=99]="SPAN",o[o.STRIKE=100]="STRIKE",o[o.STRONG=101]="STRONG",o[o.STYLE=102]="STYLE",o[o.SUB=103]="SUB",o[o.SUMMARY=104]="SUMMARY",o[o.SUP=105]="SUP",o[o.TABLE=106]="TABLE",o[o.TBODY=107]="TBODY",o[o.TEMPLATE=108]="TEMPLATE",o[o.TEXTAREA=109]="TEXTAREA",o[o.TFOOT=110]="TFOOT",o[o.TD=111]="TD",o[o.TH=112]="TH",o[o.THEAD=113]="THEAD",o[o.TITLE=114]="TITLE",o[o.TR=115]="TR",o[o.TRACK=116]="TRACK",o[o.TT=117]="TT",o[o.U=118]="U",o[o.UL=119]="UL",o[o.SVG=120]="SVG",o[o.VAR=121]="VAR",o[o.WBR=122]="WBR",o[o.XMP=123]="XMP"})(dt||(dt={}));const jqn=new Map([[tr.A,dt.A],[tr.ADDRESS,dt.ADDRESS],[tr.ANNOTATION_XML,dt.ANNOTATION_XML],[tr.APPLET,dt.APPLET],[tr.AREA,dt.AREA],[tr.ARTICLE,dt.ARTICLE],[tr.ASIDE,dt.ASIDE],[tr.B,dt.B],[tr.BASE,dt.BASE],[tr.BASEFONT,dt.BASEFONT],[tr.BGSOUND,dt.BGSOUND],[tr.BIG,dt.BIG],[tr.BLOCKQUOTE,dt.BLOCKQUOTE],[tr.BODY,dt.BODY],[tr.BR,dt.BR],[tr.BUTTON,dt.BUTTON],[tr.CAPTION,dt.CAPTION],[tr.CENTER,dt.CENTER],[tr.CODE,dt.CODE],[tr.COL,dt.COL],[tr.COLGROUP,dt.COLGROUP],[tr.DD,dt.DD],[tr.DESC,dt.DESC],[tr.DETAILS,dt.DETAILS],[tr.DIALOG,dt.DIALOG],[tr.DIR,dt.DIR],[tr.DIV,dt.DIV],[tr.DL,dt.DL],[tr.DT,dt.DT],[tr.EM,dt.EM],[tr.EMBED,dt.EMBED],[tr.FIELDSET,dt.FIELDSET],[tr.FIGCAPTION,dt.FIGCAPTION],[tr.FIGURE,dt.FIGURE],[tr.FONT,dt.FONT],[tr.FOOTER,dt.FOOTER],[tr.FOREIGN_OBJECT,dt.FOREIGN_OBJECT],[tr.FORM,dt.FORM],[tr.FRAME,dt.FRAME],[tr.FRAMESET,dt.FRAMESET],[tr.H1,dt.H1],[tr.H2,dt.H2],[tr.H3,dt.H3],[tr.H4,dt.H4],[tr.H5,dt.H5],[tr.H6,dt.H6],[tr.HEAD,dt.HEAD],[tr.HEADER,dt.HEADER],[tr.HGROUP,dt.HGROUP],[tr.HR,dt.HR],[tr.HTML,dt.HTML],[tr.I,dt.I],[tr.IMG,dt.IMG],[tr.IMAGE,dt.IMAGE],[tr.INPUT,dt.INPUT],[tr.IFRAME,dt.IFRAME],[tr.KEYGEN,dt.KEYGEN],[tr.LABEL,dt.LABEL],[tr.LI,dt.LI],[tr.LINK,dt.LINK],[tr.LISTING,dt.LISTING],[tr.MAIN,dt.MAIN],[tr.MALIGNMARK,dt.MALIGNMARK],[tr.MARQUEE,dt.MARQUEE],[tr.MATH,dt.MATH],[tr.MENU,dt.MENU],[tr.META,dt.META],[tr.MGLYPH,dt.MGLYPH],[tr.MI,dt.MI],[tr.MO,dt.MO],[tr.MN,dt.MN],[tr.MS,dt.MS],[tr.MTEXT,dt.MTEXT],[tr.NAV,dt.NAV],[tr.NOBR,dt.NOBR],[tr.NOFRAMES,dt.NOFRAMES],[tr.NOEMBED,dt.NOEMBED],[tr.NOSCRIPT,dt.NOSCRIPT],[tr.OBJECT,dt.OBJECT],[tr.OL,dt.OL],[tr.OPTGROUP,dt.OPTGROUP],[tr.OPTION,dt.OPTION],[tr.P,dt.P],[tr.PARAM,dt.PARAM],[tr.PLAINTEXT,dt.PLAINTEXT],[tr.PRE,dt.PRE],[tr.RB,dt.RB],[tr.RP,dt.RP],[tr.RT,dt.RT],[tr.RTC,dt.RTC],[tr.RUBY,dt.RUBY],[tr.S,dt.S],[tr.SCRIPT,dt.SCRIPT],[tr.SEARCH,dt.SEARCH],[tr.SECTION,dt.SECTION],[tr.SELECT,dt.SELECT],[tr.SOURCE,dt.SOURCE],[tr.SMALL,dt.SMALL],[tr.SPAN,dt.SPAN],[tr.STRIKE,dt.STRIKE],[tr.STRONG,dt.STRONG],[tr.STYLE,dt.STYLE],[tr.SUB,dt.SUB],[tr.SUMMARY,dt.SUMMARY],[tr.SUP,dt.SUP],[tr.TABLE,dt.TABLE],[tr.TBODY,dt.TBODY],[tr.TEMPLATE,dt.TEMPLATE],[tr.TEXTAREA,dt.TEXTAREA],[tr.TFOOT,dt.TFOOT],[tr.TD,dt.TD],[tr.TH,dt.TH],[tr.THEAD,dt.THEAD],[tr.TITLE,dt.TITLE],[tr.TR,dt.TR],[tr.TRACK,dt.TRACK],[tr.TT,dt.TT],[tr.U,dt.U],[tr.UL,dt.UL],[tr.SVG,dt.SVG],[tr.VAR,dt.VAR],[tr.WBR,dt.WBR],[tr.XMP,dt.XMP]]);function p$(o){var s;return(s=jqn.get(o))!==null&&s!==void 0?s:dt.UNKNOWN}const Xi=dt,Hqn={[Di.HTML]:new Set([Xi.ADDRESS,Xi.APPLET,Xi.AREA,Xi.ARTICLE,Xi.ASIDE,Xi.BASE,Xi.BASEFONT,Xi.BGSOUND,Xi.BLOCKQUOTE,Xi.BODY,Xi.BR,Xi.BUTTON,Xi.CAPTION,Xi.CENTER,Xi.COL,Xi.COLGROUP,Xi.DD,Xi.DETAILS,Xi.DIR,Xi.DIV,Xi.DL,Xi.DT,Xi.EMBED,Xi.FIELDSET,Xi.FIGCAPTION,Xi.FIGURE,Xi.FOOTER,Xi.FORM,Xi.FRAME,Xi.FRAMESET,Xi.H1,Xi.H2,Xi.H3,Xi.H4,Xi.H5,Xi.H6,Xi.HEAD,Xi.HEADER,Xi.HGROUP,Xi.HR,Xi.HTML,Xi.IFRAME,Xi.IMG,Xi.INPUT,Xi.LI,Xi.LINK,Xi.LISTING,Xi.MAIN,Xi.MARQUEE,Xi.MENU,Xi.META,Xi.NAV,Xi.NOEMBED,Xi.NOFRAMES,Xi.NOSCRIPT,Xi.OBJECT,Xi.OL,Xi.P,Xi.PARAM,Xi.PLAINTEXT,Xi.PRE,Xi.SCRIPT,Xi.SECTION,Xi.SELECT,Xi.SOURCE,Xi.STYLE,Xi.SUMMARY,Xi.TABLE,Xi.TBODY,Xi.TD,Xi.TEMPLATE,Xi.TEXTAREA,Xi.TFOOT,Xi.TH,Xi.THEAD,Xi.TITLE,Xi.TR,Xi.TRACK,Xi.UL,Xi.WBR,Xi.XMP]),[Di.MATHML]:new Set([Xi.MI,Xi.MO,Xi.MN,Xi.MS,Xi.MTEXT,Xi.ANNOTATION_XML]),[Di.SVG]:new Set([Xi.TITLE,Xi.FOREIGN_OBJECT,Xi.DESC]),[Di.XLINK]:new Set,[Di.XML]:new Set,[Di.XMLNS]:new Set},kFt=new Set([Xi.H1,Xi.H2,Xi.H3,Xi.H4,Xi.H5,Xi.H6]);tr.STYLE,tr.SCRIPT,tr.XMP,tr.IFRAME,tr.NOEMBED,tr.NOFRAMES,tr.PLAINTEXT;var $e;(function(o){o[o.DATA=0]="DATA",o[o.RCDATA=1]="RCDATA",o[o.RAWTEXT=2]="RAWTEXT",o[o.SCRIPT_DATA=3]="SCRIPT_DATA",o[o.PLAINTEXT=4]="PLAINTEXT",o[o.TAG_OPEN=5]="TAG_OPEN",o[o.END_TAG_OPEN=6]="END_TAG_OPEN",o[o.TAG_NAME=7]="TAG_NAME",o[o.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",o[o.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",o[o.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",o[o.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",o[o.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",o[o.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",o[o.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",o[o.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",o[o.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",o[o.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",o[o.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",o[o.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",o[o.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",o[o.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",o[o.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",o[o.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",o[o.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",o[o.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",o[o.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",o[o.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",o[o.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",o[o.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",o[o.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",o[o.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",o[o.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",o[o.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",o[o.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",o[o.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",o[o.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",o[o.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",o[o.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",o[o.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",o[o.BOGUS_COMMENT=40]="BOGUS_COMMENT",o[o.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",o[o.COMMENT_START=42]="COMMENT_START",o[o.COMMENT_START_DASH=43]="COMMENT_START_DASH",o[o.COMMENT=44]="COMMENT",o[o.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",o[o.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",o[o.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",o[o.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",o[o.COMMENT_END_DASH=49]="COMMENT_END_DASH",o[o.COMMENT_END=50]="COMMENT_END",o[o.COMMENT_END_BANG=51]="COMMENT_END_BANG",o[o.DOCTYPE=52]="DOCTYPE",o[o.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",o[o.DOCTYPE_NAME=54]="DOCTYPE_NAME",o[o.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",o[o.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",o[o.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",o[o.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",o[o.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",o[o.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",o[o.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",o[o.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",o[o.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",o[o.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",o[o.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",o[o.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",o[o.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",o[o.CDATA_SECTION=68]="CDATA_SECTION",o[o.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",o[o.CDATA_SECTION_END=70]="CDATA_SECTION_END",o[o.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",o[o.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})($e||($e={}));const N1={DATA:$e.DATA,RCDATA:$e.RCDATA,RAWTEXT:$e.RAWTEXT,SCRIPT_DATA:$e.SCRIPT_DATA,PLAINTEXT:$e.PLAINTEXT,CDATA_SECTION:$e.CDATA_SECTION};function zqn(o){return o>=ve.DIGIT_0&&o<=ve.DIGIT_9}function SQ(o){return o>=ve.LATIN_CAPITAL_A&&o<=ve.LATIN_CAPITAL_Z}function Uqn(o){return o>=ve.LATIN_SMALL_A&&o<=ve.LATIN_SMALL_Z}function aC(o){return Uqn(o)||SQ(o)}function mAe(o){return aC(o)||zqn(o)}function $bt(o){return o+32}function IPe(o){return o===ve.SPACE||o===ve.LINE_FEED||o===ve.TABULATION||o===ve.FORM_FEED}function yAe(o){return IPe(o)||o===ve.SOLIDUS||o===ve.GREATER_THAN_SIGN}function qqn(o){return o===ve.NULL?Rr.nullCharacterReference:o>1114111?Rr.characterReferenceOutsideUnicodeRange:xPe(o)?Rr.surrogateCharacterReference:TPe(o)?Rr.noncharacterCharacterReference:EPe(o)||o===ve.CARRIAGE_RETURN?Rr.controlCharacterReference:null}class Wqn{constructor(s,p){this.options=s,this.handler=p,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=$e.DATA,this.returnState=$e.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new Oqn(p),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new CPe(SPe,(y,C)=>{this.preprocessor.pos=this.entityStartPos+C-1,this._flushCodePointConsumedAsCharacterReference(y)},p.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(Rr.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:y=>{this._err(Rr.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+y)},validateNumericCharacterReference:y=>{const C=qqn(y);C&&this._err(C,1)}}:void 0)}_err(s,p=0){var y,C;(C=(y=this.handler).onParseError)===null||C===void 0||C.call(y,this.preprocessor.getError(s,p))}getCurrentLocation(s){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-s,startOffset:this.preprocessor.offset-s,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const s=this._consume();this._ensureHibernation()||this._callState(s)}this.inLoop=!1}}pause(){this.paused=!0}resume(s){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||s==null||s())}write(s,p,y){this.active=!0,this.preprocessor.write(s,p),this._runParsingLoop(),this.paused||y==null||y()}insertHtmlAtCurrentPos(s){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(s),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(s){this.consumedAfterSnapshot+=s;for(let p=0;p<s;p++)this.preprocessor.advance()}_consumeSequenceIfMatch(s,p){return this.preprocessor.startsWith(s,p)?(this._advanceBy(s.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:ku.START_TAG,tagName:"",tagID:dt.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:ku.END_TAG,tagName:"",tagID:dt.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(s){this.currentToken={type:ku.COMMENT,data:"",location:this.getCurrentLocation(s)}}_createDoctypeToken(s){this.currentToken={type:ku.DOCTYPE,name:s,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(s,p){this.currentCharacterToken={type:s,chars:p,location:this.currentLocation}}_createAttr(s){this.currentAttr={name:s,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var s,p;const y=this.currentToken;if(kPe(y,this.currentAttr.name)===null){if(y.attrs.push(this.currentAttr),y.location&&this.currentLocation){const C=(s=(p=y.location).attrs)!==null&&s!==void 0?s:p.attrs=Object.create(null);C[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(Rr.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(s){this._emitCurrentCharacterToken(s.location),this.currentToken=null,s.location&&(s.location.endLine=this.preprocessor.line,s.location.endCol=this.preprocessor.col+1,s.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const s=this.currentToken;this.prepareToken(s),s.tagID=p$(s.tagName),s.type===ku.START_TAG?(this.lastStartTagName=s.tagName,this.handler.onStartTag(s)):(s.attrs.length>0&&this._err(Rr.endTagWithAttributes),s.selfClosing&&this._err(Rr.endTagWithTrailingSolidus),this.handler.onEndTag(s)),this.preprocessor.dropParsedChunk()}emitCurrentComment(s){this.prepareToken(s),this.handler.onComment(s),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(s){this.prepareToken(s),this.handler.onDoctype(s),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(s){if(this.currentCharacterToken){switch(s&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=s.startLine,this.currentCharacterToken.location.endCol=s.startCol,this.currentCharacterToken.location.endOffset=s.startOffset),this.currentCharacterToken.type){case ku.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case ku.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case ku.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const s=this.getCurrentLocation(0);s&&(s.endLine=s.startLine,s.endCol=s.startCol,s.endOffset=s.startOffset),this._emitCurrentCharacterToken(s),this.handler.onEof({type:ku.EOF,location:s}),this.active=!1}_appendCharToCurrentCharacterToken(s,p){if(this.currentCharacterToken)if(this.currentCharacterToken.type===s){this.currentCharacterToken.chars+=p;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(s,p)}_emitCodePoint(s){const p=IPe(s)?ku.WHITESPACE_CHARACTER:s===ve.NULL?ku.NULL_CHARACTER:ku.CHARACTER;this._appendCharToCurrentCharacterToken(p,String.fromCodePoint(s))}_emitChars(s){this._appendCharToCurrentCharacterToken(ku.CHARACTER,s)}_startCharacterReference(){this.returnState=this.state,this.state=$e.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?gk.Attribute:gk.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===$e.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===$e.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===$e.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(s){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(s):this._emitCodePoint(s)}_callState(s){switch(this.state){case $e.DATA:{this._stateData(s);break}case $e.RCDATA:{this._stateRcdata(s);break}case $e.RAWTEXT:{this._stateRawtext(s);break}case $e.SCRIPT_DATA:{this._stateScriptData(s);break}case $e.PLAINTEXT:{this._statePlaintext(s);break}case $e.TAG_OPEN:{this._stateTagOpen(s);break}case $e.END_TAG_OPEN:{this._stateEndTagOpen(s);break}case $e.TAG_NAME:{this._stateTagName(s);break}case $e.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(s);break}case $e.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(s);break}case $e.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(s);break}case $e.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(s);break}case $e.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(s);break}case $e.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(s);break}case $e.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(s);break}case $e.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(s);break}case $e.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(s);break}case $e.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(s);break}case $e.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(s);break}case $e.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(s);break}case $e.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(s);break}case $e.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(s);break}case $e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(s);break}case $e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(s);break}case $e.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(s);break}case $e.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(s);break}case $e.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(s);break}case $e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(s);break}case $e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(s);break}case $e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(s);break}case $e.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(s);break}case $e.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(s);break}case $e.ATTRIBUTE_NAME:{this._stateAttributeName(s);break}case $e.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(s);break}case $e.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(s);break}case $e.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(s);break}case $e.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(s);break}case $e.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(s);break}case $e.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(s);break}case $e.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(s);break}case $e.BOGUS_COMMENT:{this._stateBogusComment(s);break}case $e.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(s);break}case $e.COMMENT_START:{this._stateCommentStart(s);break}case $e.COMMENT_START_DASH:{this._stateCommentStartDash(s);break}case $e.COMMENT:{this._stateComment(s);break}case $e.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(s);break}case $e.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(s);break}case $e.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(s);break}case $e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(s);break}case $e.COMMENT_END_DASH:{this._stateCommentEndDash(s);break}case $e.COMMENT_END:{this._stateCommentEnd(s);break}case $e.COMMENT_END_BANG:{this._stateCommentEndBang(s);break}case $e.DOCTYPE:{this._stateDoctype(s);break}case $e.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(s);break}case $e.DOCTYPE_NAME:{this._stateDoctypeName(s);break}case $e.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(s);break}case $e.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(s);break}case $e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(s);break}case $e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(s);break}case $e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(s);break}case $e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(s);break}case $e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(s);break}case $e.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(s);break}case $e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(s);break}case $e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(s);break}case $e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(s);break}case $e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(s);break}case $e.BOGUS_DOCTYPE:{this._stateBogusDoctype(s);break}case $e.CDATA_SECTION:{this._stateCdataSection(s);break}case $e.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(s);break}case $e.CDATA_SECTION_END:{this._stateCdataSectionEnd(s);break}case $e.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case $e.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(s);break}default:throw new Error("Unknown state")}}_stateData(s){switch(s){case ve.LESS_THAN_SIGN:{this.state=$e.TAG_OPEN;break}case ve.AMPERSAND:{this._startCharacterReference();break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),this._emitCodePoint(s);break}case ve.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(s)}}_stateRcdata(s){switch(s){case ve.AMPERSAND:{this._startCharacterReference();break}case ve.LESS_THAN_SIGN:{this.state=$e.RCDATA_LESS_THAN_SIGN;break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),this._emitChars(Vf);break}case ve.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(s)}}_stateRawtext(s){switch(s){case ve.LESS_THAN_SIGN:{this.state=$e.RAWTEXT_LESS_THAN_SIGN;break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),this._emitChars(Vf);break}case ve.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(s)}}_stateScriptData(s){switch(s){case ve.LESS_THAN_SIGN:{this.state=$e.SCRIPT_DATA_LESS_THAN_SIGN;break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),this._emitChars(Vf);break}case ve.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(s)}}_statePlaintext(s){switch(s){case ve.NULL:{this._err(Rr.unexpectedNullCharacter),this._emitChars(Vf);break}case ve.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(s)}}_stateTagOpen(s){if(aC(s))this._createStartTagToken(),this.state=$e.TAG_NAME,this._stateTagName(s);else switch(s){case ve.EXCLAMATION_MARK:{this.state=$e.MARKUP_DECLARATION_OPEN;break}case ve.SOLIDUS:{this.state=$e.END_TAG_OPEN;break}case ve.QUESTION_MARK:{this._err(Rr.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=$e.BOGUS_COMMENT,this._stateBogusComment(s);break}case ve.EOF:{this._err(Rr.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(Rr.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=$e.DATA,this._stateData(s)}}_stateEndTagOpen(s){if(aC(s))this._createEndTagToken(),this.state=$e.TAG_NAME,this._stateTagName(s);else switch(s){case ve.GREATER_THAN_SIGN:{this._err(Rr.missingEndTagName),this.state=$e.DATA;break}case ve.EOF:{this._err(Rr.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(Rr.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=$e.BOGUS_COMMENT,this._stateBogusComment(s)}}_stateTagName(s){const p=this.currentToken;switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:{this.state=$e.BEFORE_ATTRIBUTE_NAME;break}case ve.SOLIDUS:{this.state=$e.SELF_CLOSING_START_TAG;break}case ve.GREATER_THAN_SIGN:{this.state=$e.DATA,this.emitCurrentTagToken();break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),p.tagName+=Vf;break}case ve.EOF:{this._err(Rr.eofInTag),this._emitEOFToken();break}default:p.tagName+=String.fromCodePoint(SQ(s)?$bt(s):s)}}_stateRcdataLessThanSign(s){s===ve.SOLIDUS?this.state=$e.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=$e.RCDATA,this._stateRcdata(s))}_stateRcdataEndTagOpen(s){aC(s)?(this.state=$e.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(s)):(this._emitChars("</"),this.state=$e.RCDATA,this._stateRcdata(s))}handleSpecialEndTag(s){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const p=this.currentToken;switch(p.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=$e.BEFORE_ATTRIBUTE_NAME,!1;case ve.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=$e.SELF_CLOSING_START_TAG,!1;case ve.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=$e.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(s){this.handleSpecialEndTag(s)&&(this._emitChars("</"),this.state=$e.RCDATA,this._stateRcdata(s))}_stateRawtextLessThanSign(s){s===ve.SOLIDUS?this.state=$e.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=$e.RAWTEXT,this._stateRawtext(s))}_stateRawtextEndTagOpen(s){aC(s)?(this.state=$e.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(s)):(this._emitChars("</"),this.state=$e.RAWTEXT,this._stateRawtext(s))}_stateRawtextEndTagName(s){this.handleSpecialEndTag(s)&&(this._emitChars("</"),this.state=$e.RAWTEXT,this._stateRawtext(s))}_stateScriptDataLessThanSign(s){switch(s){case ve.SOLIDUS:{this.state=$e.SCRIPT_DATA_END_TAG_OPEN;break}case ve.EXCLAMATION_MARK:{this.state=$e.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=$e.SCRIPT_DATA,this._stateScriptData(s)}}_stateScriptDataEndTagOpen(s){aC(s)?(this.state=$e.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(s)):(this._emitChars("</"),this.state=$e.SCRIPT_DATA,this._stateScriptData(s))}_stateScriptDataEndTagName(s){this.handleSpecialEndTag(s)&&(this._emitChars("</"),this.state=$e.SCRIPT_DATA,this._stateScriptData(s))}_stateScriptDataEscapeStart(s){s===ve.HYPHEN_MINUS?(this.state=$e.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=$e.SCRIPT_DATA,this._stateScriptData(s))}_stateScriptDataEscapeStartDash(s){s===ve.HYPHEN_MINUS?(this.state=$e.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=$e.SCRIPT_DATA,this._stateScriptData(s))}_stateScriptDataEscaped(s){switch(s){case ve.HYPHEN_MINUS:{this.state=$e.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case ve.LESS_THAN_SIGN:{this.state=$e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),this._emitChars(Vf);break}case ve.EOF:{this._err(Rr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(s)}}_stateScriptDataEscapedDash(s){switch(s){case ve.HYPHEN_MINUS:{this.state=$e.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case ve.LESS_THAN_SIGN:{this.state=$e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),this.state=$e.SCRIPT_DATA_ESCAPED,this._emitChars(Vf);break}case ve.EOF:{this._err(Rr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=$e.SCRIPT_DATA_ESCAPED,this._emitCodePoint(s)}}_stateScriptDataEscapedDashDash(s){switch(s){case ve.HYPHEN_MINUS:{this._emitChars("-");break}case ve.LESS_THAN_SIGN:{this.state=$e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case ve.GREATER_THAN_SIGN:{this.state=$e.SCRIPT_DATA,this._emitChars(">");break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),this.state=$e.SCRIPT_DATA_ESCAPED,this._emitChars(Vf);break}case ve.EOF:{this._err(Rr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=$e.SCRIPT_DATA_ESCAPED,this._emitCodePoint(s)}}_stateScriptDataEscapedLessThanSign(s){s===ve.SOLIDUS?this.state=$e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:aC(s)?(this._emitChars("<"),this.state=$e.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(s)):(this._emitChars("<"),this.state=$e.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(s))}_stateScriptDataEscapedEndTagOpen(s){aC(s)?(this.state=$e.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(s)):(this._emitChars("</"),this.state=$e.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(s))}_stateScriptDataEscapedEndTagName(s){this.handleSpecialEndTag(s)&&(this._emitChars("</"),this.state=$e.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(s))}_stateScriptDataDoubleEscapeStart(s){if(this.preprocessor.startsWith(X2.SCRIPT,!1)&&yAe(this.preprocessor.peek(X2.SCRIPT.length))){this._emitCodePoint(s);for(let p=0;p<X2.SCRIPT.length;p++)this._emitCodePoint(this._consume());this.state=$e.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=$e.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(s))}_stateScriptDataDoubleEscaped(s){switch(s){case ve.HYPHEN_MINUS:{this.state=$e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case ve.LESS_THAN_SIGN:{this.state=$e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),this._emitChars(Vf);break}case ve.EOF:{this._err(Rr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(s)}}_stateScriptDataDoubleEscapedDash(s){switch(s){case ve.HYPHEN_MINUS:{this.state=$e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case ve.LESS_THAN_SIGN:{this.state=$e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),this.state=$e.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Vf);break}case ve.EOF:{this._err(Rr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=$e.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(s)}}_stateScriptDataDoubleEscapedDashDash(s){switch(s){case ve.HYPHEN_MINUS:{this._emitChars("-");break}case ve.LESS_THAN_SIGN:{this.state=$e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case ve.GREATER_THAN_SIGN:{this.state=$e.SCRIPT_DATA,this._emitChars(">");break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),this.state=$e.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Vf);break}case ve.EOF:{this._err(Rr.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=$e.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(s)}}_stateScriptDataDoubleEscapedLessThanSign(s){s===ve.SOLIDUS?(this.state=$e.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=$e.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(s))}_stateScriptDataDoubleEscapeEnd(s){if(this.preprocessor.startsWith(X2.SCRIPT,!1)&&yAe(this.preprocessor.peek(X2.SCRIPT.length))){this._emitCodePoint(s);for(let p=0;p<X2.SCRIPT.length;p++)this._emitCodePoint(this._consume());this.state=$e.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=$e.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(s))}_stateBeforeAttributeName(s){switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:break;case ve.SOLIDUS:case ve.GREATER_THAN_SIGN:case ve.EOF:{this.state=$e.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(s);break}case ve.EQUALS_SIGN:{this._err(Rr.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=$e.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=$e.ATTRIBUTE_NAME,this._stateAttributeName(s)}}_stateAttributeName(s){switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:case ve.SOLIDUS:case ve.GREATER_THAN_SIGN:case ve.EOF:{this._leaveAttrName(),this.state=$e.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(s);break}case ve.EQUALS_SIGN:{this._leaveAttrName(),this.state=$e.BEFORE_ATTRIBUTE_VALUE;break}case ve.QUOTATION_MARK:case ve.APOSTROPHE:case ve.LESS_THAN_SIGN:{this._err(Rr.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(s);break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),this.currentAttr.name+=Vf;break}default:this.currentAttr.name+=String.fromCodePoint(SQ(s)?$bt(s):s)}}_stateAfterAttributeName(s){switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:break;case ve.SOLIDUS:{this.state=$e.SELF_CLOSING_START_TAG;break}case ve.EQUALS_SIGN:{this.state=$e.BEFORE_ATTRIBUTE_VALUE;break}case ve.GREATER_THAN_SIGN:{this.state=$e.DATA,this.emitCurrentTagToken();break}case ve.EOF:{this._err(Rr.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=$e.ATTRIBUTE_NAME,this._stateAttributeName(s)}}_stateBeforeAttributeValue(s){switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:break;case ve.QUOTATION_MARK:{this.state=$e.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case ve.APOSTROPHE:{this.state=$e.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case ve.GREATER_THAN_SIGN:{this._err(Rr.missingAttributeValue),this.state=$e.DATA,this.emitCurrentTagToken();break}default:this.state=$e.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(s)}}_stateAttributeValueDoubleQuoted(s){switch(s){case ve.QUOTATION_MARK:{this.state=$e.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case ve.AMPERSAND:{this._startCharacterReference();break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),this.currentAttr.value+=Vf;break}case ve.EOF:{this._err(Rr.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(s)}}_stateAttributeValueSingleQuoted(s){switch(s){case ve.APOSTROPHE:{this.state=$e.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case ve.AMPERSAND:{this._startCharacterReference();break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),this.currentAttr.value+=Vf;break}case ve.EOF:{this._err(Rr.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(s)}}_stateAttributeValueUnquoted(s){switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:{this._leaveAttrValue(),this.state=$e.BEFORE_ATTRIBUTE_NAME;break}case ve.AMPERSAND:{this._startCharacterReference();break}case ve.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=$e.DATA,this.emitCurrentTagToken();break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),this.currentAttr.value+=Vf;break}case ve.QUOTATION_MARK:case ve.APOSTROPHE:case ve.LESS_THAN_SIGN:case ve.EQUALS_SIGN:case ve.GRAVE_ACCENT:{this._err(Rr.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(s);break}case ve.EOF:{this._err(Rr.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(s)}}_stateAfterAttributeValueQuoted(s){switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:{this._leaveAttrValue(),this.state=$e.BEFORE_ATTRIBUTE_NAME;break}case ve.SOLIDUS:{this._leaveAttrValue(),this.state=$e.SELF_CLOSING_START_TAG;break}case ve.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=$e.DATA,this.emitCurrentTagToken();break}case ve.EOF:{this._err(Rr.eofInTag),this._emitEOFToken();break}default:this._err(Rr.missingWhitespaceBetweenAttributes),this.state=$e.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(s)}}_stateSelfClosingStartTag(s){switch(s){case ve.GREATER_THAN_SIGN:{const p=this.currentToken;p.selfClosing=!0,this.state=$e.DATA,this.emitCurrentTagToken();break}case ve.EOF:{this._err(Rr.eofInTag),this._emitEOFToken();break}default:this._err(Rr.unexpectedSolidusInTag),this.state=$e.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(s)}}_stateBogusComment(s){const p=this.currentToken;switch(s){case ve.GREATER_THAN_SIGN:{this.state=$e.DATA,this.emitCurrentComment(p);break}case ve.EOF:{this.emitCurrentComment(p),this._emitEOFToken();break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),p.data+=Vf;break}default:p.data+=String.fromCodePoint(s)}}_stateMarkupDeclarationOpen(s){this._consumeSequenceIfMatch(X2.DASH_DASH,!0)?(this._createCommentToken(X2.DASH_DASH.length+1),this.state=$e.COMMENT_START):this._consumeSequenceIfMatch(X2.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(X2.DOCTYPE.length+1),this.state=$e.DOCTYPE):this._consumeSequenceIfMatch(X2.CDATA_START,!0)?this.inForeignNode?this.state=$e.CDATA_SECTION:(this._err(Rr.cdataInHtmlContent),this._createCommentToken(X2.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=$e.BOGUS_COMMENT):this._ensureHibernation()||(this._err(Rr.incorrectlyOpenedComment),this._createCommentToken(2),this.state=$e.BOGUS_COMMENT,this._stateBogusComment(s))}_stateCommentStart(s){switch(s){case ve.HYPHEN_MINUS:{this.state=$e.COMMENT_START_DASH;break}case ve.GREATER_THAN_SIGN:{this._err(Rr.abruptClosingOfEmptyComment),this.state=$e.DATA;const p=this.currentToken;this.emitCurrentComment(p);break}default:this.state=$e.COMMENT,this._stateComment(s)}}_stateCommentStartDash(s){const p=this.currentToken;switch(s){case ve.HYPHEN_MINUS:{this.state=$e.COMMENT_END;break}case ve.GREATER_THAN_SIGN:{this._err(Rr.abruptClosingOfEmptyComment),this.state=$e.DATA,this.emitCurrentComment(p);break}case ve.EOF:{this._err(Rr.eofInComment),this.emitCurrentComment(p),this._emitEOFToken();break}default:p.data+="-",this.state=$e.COMMENT,this._stateComment(s)}}_stateComment(s){const p=this.currentToken;switch(s){case ve.HYPHEN_MINUS:{this.state=$e.COMMENT_END_DASH;break}case ve.LESS_THAN_SIGN:{p.data+="<",this.state=$e.COMMENT_LESS_THAN_SIGN;break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),p.data+=Vf;break}case ve.EOF:{this._err(Rr.eofInComment),this.emitCurrentComment(p),this._emitEOFToken();break}default:p.data+=String.fromCodePoint(s)}}_stateCommentLessThanSign(s){const p=this.currentToken;switch(s){case ve.EXCLAMATION_MARK:{p.data+="!",this.state=$e.COMMENT_LESS_THAN_SIGN_BANG;break}case ve.LESS_THAN_SIGN:{p.data+="<";break}default:this.state=$e.COMMENT,this._stateComment(s)}}_stateCommentLessThanSignBang(s){s===ve.HYPHEN_MINUS?this.state=$e.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=$e.COMMENT,this._stateComment(s))}_stateCommentLessThanSignBangDash(s){s===ve.HYPHEN_MINUS?this.state=$e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=$e.COMMENT_END_DASH,this._stateCommentEndDash(s))}_stateCommentLessThanSignBangDashDash(s){s!==ve.GREATER_THAN_SIGN&&s!==ve.EOF&&this._err(Rr.nestedComment),this.state=$e.COMMENT_END,this._stateCommentEnd(s)}_stateCommentEndDash(s){const p=this.currentToken;switch(s){case ve.HYPHEN_MINUS:{this.state=$e.COMMENT_END;break}case ve.EOF:{this._err(Rr.eofInComment),this.emitCurrentComment(p),this._emitEOFToken();break}default:p.data+="-",this.state=$e.COMMENT,this._stateComment(s)}}_stateCommentEnd(s){const p=this.currentToken;switch(s){case ve.GREATER_THAN_SIGN:{this.state=$e.DATA,this.emitCurrentComment(p);break}case ve.EXCLAMATION_MARK:{this.state=$e.COMMENT_END_BANG;break}case ve.HYPHEN_MINUS:{p.data+="-";break}case ve.EOF:{this._err(Rr.eofInComment),this.emitCurrentComment(p),this._emitEOFToken();break}default:p.data+="--",this.state=$e.COMMENT,this._stateComment(s)}}_stateCommentEndBang(s){const p=this.currentToken;switch(s){case ve.HYPHEN_MINUS:{p.data+="--!",this.state=$e.COMMENT_END_DASH;break}case ve.GREATER_THAN_SIGN:{this._err(Rr.incorrectlyClosedComment),this.state=$e.DATA,this.emitCurrentComment(p);break}case ve.EOF:{this._err(Rr.eofInComment),this.emitCurrentComment(p),this._emitEOFToken();break}default:p.data+="--!",this.state=$e.COMMENT,this._stateComment(s)}}_stateDoctype(s){switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:{this.state=$e.BEFORE_DOCTYPE_NAME;break}case ve.GREATER_THAN_SIGN:{this.state=$e.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(s);break}case ve.EOF:{this._err(Rr.eofInDoctype),this._createDoctypeToken(null);const p=this.currentToken;p.forceQuirks=!0,this.emitCurrentDoctype(p),this._emitEOFToken();break}default:this._err(Rr.missingWhitespaceBeforeDoctypeName),this.state=$e.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(s)}}_stateBeforeDoctypeName(s){if(SQ(s))this._createDoctypeToken(String.fromCharCode($bt(s))),this.state=$e.DOCTYPE_NAME;else switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:break;case ve.NULL:{this._err(Rr.unexpectedNullCharacter),this._createDoctypeToken(Vf),this.state=$e.DOCTYPE_NAME;break}case ve.GREATER_THAN_SIGN:{this._err(Rr.missingDoctypeName),this._createDoctypeToken(null);const p=this.currentToken;p.forceQuirks=!0,this.emitCurrentDoctype(p),this.state=$e.DATA;break}case ve.EOF:{this._err(Rr.eofInDoctype),this._createDoctypeToken(null);const p=this.currentToken;p.forceQuirks=!0,this.emitCurrentDoctype(p),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(s)),this.state=$e.DOCTYPE_NAME}}_stateDoctypeName(s){const p=this.currentToken;switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:{this.state=$e.AFTER_DOCTYPE_NAME;break}case ve.GREATER_THAN_SIGN:{this.state=$e.DATA,this.emitCurrentDoctype(p);break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),p.name+=Vf;break}case ve.EOF:{this._err(Rr.eofInDoctype),p.forceQuirks=!0,this.emitCurrentDoctype(p),this._emitEOFToken();break}default:p.name+=String.fromCodePoint(SQ(s)?$bt(s):s)}}_stateAfterDoctypeName(s){const p=this.currentToken;switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:break;case ve.GREATER_THAN_SIGN:{this.state=$e.DATA,this.emitCurrentDoctype(p);break}case ve.EOF:{this._err(Rr.eofInDoctype),p.forceQuirks=!0,this.emitCurrentDoctype(p),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(X2.PUBLIC,!1)?this.state=$e.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(X2.SYSTEM,!1)?this.state=$e.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(Rr.invalidCharacterSequenceAfterDoctypeName),p.forceQuirks=!0,this.state=$e.BOGUS_DOCTYPE,this._stateBogusDoctype(s))}}_stateAfterDoctypePublicKeyword(s){const p=this.currentToken;switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:{this.state=$e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case ve.QUOTATION_MARK:{this._err(Rr.missingWhitespaceAfterDoctypePublicKeyword),p.publicId="",this.state=$e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case ve.APOSTROPHE:{this._err(Rr.missingWhitespaceAfterDoctypePublicKeyword),p.publicId="",this.state=$e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case ve.GREATER_THAN_SIGN:{this._err(Rr.missingDoctypePublicIdentifier),p.forceQuirks=!0,this.state=$e.DATA,this.emitCurrentDoctype(p);break}case ve.EOF:{this._err(Rr.eofInDoctype),p.forceQuirks=!0,this.emitCurrentDoctype(p),this._emitEOFToken();break}default:this._err(Rr.missingQuoteBeforeDoctypePublicIdentifier),p.forceQuirks=!0,this.state=$e.BOGUS_DOCTYPE,this._stateBogusDoctype(s)}}_stateBeforeDoctypePublicIdentifier(s){const p=this.currentToken;switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:break;case ve.QUOTATION_MARK:{p.publicId="",this.state=$e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case ve.APOSTROPHE:{p.publicId="",this.state=$e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case ve.GREATER_THAN_SIGN:{this._err(Rr.missingDoctypePublicIdentifier),p.forceQuirks=!0,this.state=$e.DATA,this.emitCurrentDoctype(p);break}case ve.EOF:{this._err(Rr.eofInDoctype),p.forceQuirks=!0,this.emitCurrentDoctype(p),this._emitEOFToken();break}default:this._err(Rr.missingQuoteBeforeDoctypePublicIdentifier),p.forceQuirks=!0,this.state=$e.BOGUS_DOCTYPE,this._stateBogusDoctype(s)}}_stateDoctypePublicIdentifierDoubleQuoted(s){const p=this.currentToken;switch(s){case ve.QUOTATION_MARK:{this.state=$e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),p.publicId+=Vf;break}case ve.GREATER_THAN_SIGN:{this._err(Rr.abruptDoctypePublicIdentifier),p.forceQuirks=!0,this.emitCurrentDoctype(p),this.state=$e.DATA;break}case ve.EOF:{this._err(Rr.eofInDoctype),p.forceQuirks=!0,this.emitCurrentDoctype(p),this._emitEOFToken();break}default:p.publicId+=String.fromCodePoint(s)}}_stateDoctypePublicIdentifierSingleQuoted(s){const p=this.currentToken;switch(s){case ve.APOSTROPHE:{this.state=$e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),p.publicId+=Vf;break}case ve.GREATER_THAN_SIGN:{this._err(Rr.abruptDoctypePublicIdentifier),p.forceQuirks=!0,this.emitCurrentDoctype(p),this.state=$e.DATA;break}case ve.EOF:{this._err(Rr.eofInDoctype),p.forceQuirks=!0,this.emitCurrentDoctype(p),this._emitEOFToken();break}default:p.publicId+=String.fromCodePoint(s)}}_stateAfterDoctypePublicIdentifier(s){const p=this.currentToken;switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:{this.state=$e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case ve.GREATER_THAN_SIGN:{this.state=$e.DATA,this.emitCurrentDoctype(p);break}case ve.QUOTATION_MARK:{this._err(Rr.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),p.systemId="",this.state=$e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case ve.APOSTROPHE:{this._err(Rr.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),p.systemId="",this.state=$e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case ve.EOF:{this._err(Rr.eofInDoctype),p.forceQuirks=!0,this.emitCurrentDoctype(p),this._emitEOFToken();break}default:this._err(Rr.missingQuoteBeforeDoctypeSystemIdentifier),p.forceQuirks=!0,this.state=$e.BOGUS_DOCTYPE,this._stateBogusDoctype(s)}}_stateBetweenDoctypePublicAndSystemIdentifiers(s){const p=this.currentToken;switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:break;case ve.GREATER_THAN_SIGN:{this.emitCurrentDoctype(p),this.state=$e.DATA;break}case ve.QUOTATION_MARK:{p.systemId="",this.state=$e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case ve.APOSTROPHE:{p.systemId="",this.state=$e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case ve.EOF:{this._err(Rr.eofInDoctype),p.forceQuirks=!0,this.emitCurrentDoctype(p),this._emitEOFToken();break}default:this._err(Rr.missingQuoteBeforeDoctypeSystemIdentifier),p.forceQuirks=!0,this.state=$e.BOGUS_DOCTYPE,this._stateBogusDoctype(s)}}_stateAfterDoctypeSystemKeyword(s){const p=this.currentToken;switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:{this.state=$e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case ve.QUOTATION_MARK:{this._err(Rr.missingWhitespaceAfterDoctypeSystemKeyword),p.systemId="",this.state=$e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case ve.APOSTROPHE:{this._err(Rr.missingWhitespaceAfterDoctypeSystemKeyword),p.systemId="",this.state=$e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case ve.GREATER_THAN_SIGN:{this._err(Rr.missingDoctypeSystemIdentifier),p.forceQuirks=!0,this.state=$e.DATA,this.emitCurrentDoctype(p);break}case ve.EOF:{this._err(Rr.eofInDoctype),p.forceQuirks=!0,this.emitCurrentDoctype(p),this._emitEOFToken();break}default:this._err(Rr.missingQuoteBeforeDoctypeSystemIdentifier),p.forceQuirks=!0,this.state=$e.BOGUS_DOCTYPE,this._stateBogusDoctype(s)}}_stateBeforeDoctypeSystemIdentifier(s){const p=this.currentToken;switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:break;case ve.QUOTATION_MARK:{p.systemId="",this.state=$e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case ve.APOSTROPHE:{p.systemId="",this.state=$e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case ve.GREATER_THAN_SIGN:{this._err(Rr.missingDoctypeSystemIdentifier),p.forceQuirks=!0,this.state=$e.DATA,this.emitCurrentDoctype(p);break}case ve.EOF:{this._err(Rr.eofInDoctype),p.forceQuirks=!0,this.emitCurrentDoctype(p),this._emitEOFToken();break}default:this._err(Rr.missingQuoteBeforeDoctypeSystemIdentifier),p.forceQuirks=!0,this.state=$e.BOGUS_DOCTYPE,this._stateBogusDoctype(s)}}_stateDoctypeSystemIdentifierDoubleQuoted(s){const p=this.currentToken;switch(s){case ve.QUOTATION_MARK:{this.state=$e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),p.systemId+=Vf;break}case ve.GREATER_THAN_SIGN:{this._err(Rr.abruptDoctypeSystemIdentifier),p.forceQuirks=!0,this.emitCurrentDoctype(p),this.state=$e.DATA;break}case ve.EOF:{this._err(Rr.eofInDoctype),p.forceQuirks=!0,this.emitCurrentDoctype(p),this._emitEOFToken();break}default:p.systemId+=String.fromCodePoint(s)}}_stateDoctypeSystemIdentifierSingleQuoted(s){const p=this.currentToken;switch(s){case ve.APOSTROPHE:{this.state=$e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter),p.systemId+=Vf;break}case ve.GREATER_THAN_SIGN:{this._err(Rr.abruptDoctypeSystemIdentifier),p.forceQuirks=!0,this.emitCurrentDoctype(p),this.state=$e.DATA;break}case ve.EOF:{this._err(Rr.eofInDoctype),p.forceQuirks=!0,this.emitCurrentDoctype(p),this._emitEOFToken();break}default:p.systemId+=String.fromCodePoint(s)}}_stateAfterDoctypeSystemIdentifier(s){const p=this.currentToken;switch(s){case ve.SPACE:case ve.LINE_FEED:case ve.TABULATION:case ve.FORM_FEED:break;case ve.GREATER_THAN_SIGN:{this.emitCurrentDoctype(p),this.state=$e.DATA;break}case ve.EOF:{this._err(Rr.eofInDoctype),p.forceQuirks=!0,this.emitCurrentDoctype(p),this._emitEOFToken();break}default:this._err(Rr.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=$e.BOGUS_DOCTYPE,this._stateBogusDoctype(s)}}_stateBogusDoctype(s){const p=this.currentToken;switch(s){case ve.GREATER_THAN_SIGN:{this.emitCurrentDoctype(p),this.state=$e.DATA;break}case ve.NULL:{this._err(Rr.unexpectedNullCharacter);break}case ve.EOF:{this.emitCurrentDoctype(p),this._emitEOFToken();break}}}_stateCdataSection(s){switch(s){case ve.RIGHT_SQUARE_BRACKET:{this.state=$e.CDATA_SECTION_BRACKET;break}case ve.EOF:{this._err(Rr.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(s)}}_stateCdataSectionBracket(s){s===ve.RIGHT_SQUARE_BRACKET?this.state=$e.CDATA_SECTION_END:(this._emitChars("]"),this.state=$e.CDATA_SECTION,this._stateCdataSection(s))}_stateCdataSectionEnd(s){switch(s){case ve.GREATER_THAN_SIGN:{this.state=$e.DATA;break}case ve.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=$e.CDATA_SECTION,this._stateCdataSection(s)}}_stateCharacterReference(){let s=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(s<0)if(this.preprocessor.lastChunkWritten)s=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}s===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(ve.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&mAe(this.preprocessor.peek(1))?$e.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(s){mAe(s)?this._flushCodePointConsumedAsCharacterReference(s):(s===ve.SEMICOLON&&this._err(Rr.unknownNamedCharacterReference),this.state=this.returnState,this._callState(s))}}const OPe=new Set([dt.DD,dt.DT,dt.LI,dt.OPTGROUP,dt.OPTION,dt.P,dt.RB,dt.RP,dt.RT,dt.RTC]),wAe=new Set([...OPe,dt.CAPTION,dt.COLGROUP,dt.TBODY,dt.TD,dt.TFOOT,dt.TH,dt.THEAD,dt.TR]),Mmt=new Set([dt.APPLET,dt.CAPTION,dt.HTML,dt.MARQUEE,dt.OBJECT,dt.TABLE,dt.TD,dt.TEMPLATE,dt.TH]),Kqn=new Set([...Mmt,dt.OL,dt.UL]),Gqn=new Set([...Mmt,dt.BUTTON]),vAe=new Set([dt.ANNOTATION_XML,dt.MI,dt.MN,dt.MO,dt.MS,dt.MTEXT]),_Ae=new Set([dt.DESC,dt.FOREIGN_OBJECT,dt.TITLE]),Yqn=new Set([dt.TR,dt.TEMPLATE,dt.HTML]),Vqn=new Set([dt.TBODY,dt.TFOOT,dt.THEAD,dt.TEMPLATE,dt.HTML]),Xqn=new Set([dt.TABLE,dt.TEMPLATE,dt.HTML]),Qqn=new Set([dt.TD,dt.TH]);class Jqn{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(s,p,y){this.treeAdapter=p,this.handler=y,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=dt.UNKNOWN,this.current=s}_indexOf(s){return this.items.lastIndexOf(s,this.stackTop)}_isInTemplate(){return this.currentTagId===dt.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Di.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(s,p){this.stackTop++,this.items[this.stackTop]=s,this.current=s,this.tagIDs[this.stackTop]=p,this.currentTagId=p,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(s,p,!0)}pop(){const s=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(s,!0)}replace(s,p){const y=this._indexOf(s);this.items[y]=p,y===this.stackTop&&(this.current=p)}insertAfter(s,p,y){const C=this._indexOf(s)+1;this.items.splice(C,0,p),this.tagIDs.splice(C,0,y),this.stackTop++,C===this.stackTop&&this._updateCurrentElement(),this.handler.onItemPush(this.current,this.currentTagId,C===this.stackTop)}popUntilTagNamePopped(s){let p=this.stackTop+1;do p=this.tagIDs.lastIndexOf(s,p-1);while(p>0&&this.treeAdapter.getNamespaceURI(this.items[p])!==Di.HTML);this.shortenToLength(p<0?0:p)}shortenToLength(s){for(;this.stackTop>=s;){const p=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(p,this.stackTop<s)}}popUntilElementPopped(s){const p=this._indexOf(s);this.shortenToLength(p<0?0:p)}popUntilPopped(s,p){const y=this._indexOfTagNames(s,p);this.shortenToLength(y<0?0:y)}popUntilNumberedHeaderPopped(){this.popUntilPopped(kFt,Di.HTML)}popUntilTableCellPopped(){this.popUntilPopped(Qqn,Di.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(s,p){for(let y=this.stackTop;y>=0;y--)if(s.has(this.tagIDs[y])&&this.treeAdapter.getNamespaceURI(this.items[y])===p)return y;return-1}clearBackTo(s,p){const y=this._indexOfTagNames(s,p);this.shortenToLength(y+1)}clearBackToTableContext(){this.clearBackTo(Xqn,Di.HTML)}clearBackToTableBodyContext(){this.clearBackTo(Vqn,Di.HTML)}clearBackToTableRowContext(){this.clearBackTo(Yqn,Di.HTML)}remove(s){const p=this._indexOf(s);p>=0&&(p===this.stackTop?this.pop():(this.items.splice(p,1),this.tagIDs.splice(p,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(s,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===dt.BODY?this.items[1]:null}contains(s){return this._indexOf(s)>-1}getCommonAncestor(s){const p=this._indexOf(s)-1;return p>=0?this.items[p]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===dt.HTML}hasInDynamicScope(s,p){for(let y=this.stackTop;y>=0;y--){const C=this.tagIDs[y];switch(this.treeAdapter.getNamespaceURI(this.items[y])){case Di.HTML:{if(C===s)return!0;if(p.has(C))return!1;break}case Di.SVG:{if(_Ae.has(C))return!1;break}case Di.MATHML:{if(vAe.has(C))return!1;break}}}return!0}hasInScope(s){return this.hasInDynamicScope(s,Mmt)}hasInListItemScope(s){return this.hasInDynamicScope(s,Kqn)}hasInButtonScope(s){return this.hasInDynamicScope(s,Gqn)}hasNumberedHeaderInScope(){for(let s=this.stackTop;s>=0;s--){const p=this.tagIDs[s];switch(this.treeAdapter.getNamespaceURI(this.items[s])){case Di.HTML:{if(kFt.has(p))return!0;if(Mmt.has(p))return!1;break}case Di.SVG:{if(_Ae.has(p))return!1;break}case Di.MATHML:{if(vAe.has(p))return!1;break}}}return!0}hasInTableScope(s){for(let p=this.stackTop;p>=0;p--)if(this.treeAdapter.getNamespaceURI(this.items[p])===Di.HTML)switch(this.tagIDs[p]){case s:return!0;case dt.TABLE:case dt.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let s=this.stackTop;s>=0;s--)if(this.treeAdapter.getNamespaceURI(this.items[s])===Di.HTML)switch(this.tagIDs[s]){case dt.TBODY:case dt.THEAD:case dt.TFOOT:return!0;case dt.TABLE:case dt.HTML:return!1}return!0}hasInSelectScope(s){for(let p=this.stackTop;p>=0;p--)if(this.treeAdapter.getNamespaceURI(this.items[p])===Di.HTML)switch(this.tagIDs[p]){case s:return!0;case dt.OPTION:case dt.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;OPe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;wAe.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(s){for(;this.currentTagId!==s&&wAe.has(this.currentTagId);)this.pop()}}const dBt=3;var E6;(function(o){o[o.Marker=0]="Marker",o[o.Element=1]="Element"})(E6||(E6={}));const xAe={type:E6.Marker};class Zqn{constructor(s){this.treeAdapter=s,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(s,p){const y=[],C=p.length,N=this.treeAdapter.getTagName(s),L=this.treeAdapter.getNamespaceURI(s);for(let z=0;z<this.entries.length;z++){const G=this.entries[z];if(G.type===E6.Marker)break;const{element:q}=G;if(this.treeAdapter.getTagName(q)===N&&this.treeAdapter.getNamespaceURI(q)===L){const et=this.treeAdapter.getAttrList(q);et.length===C&&y.push({idx:z,attrs:et})}}return y}_ensureNoahArkCondition(s){if(this.entries.length<dBt)return;const p=this.treeAdapter.getAttrList(s),y=this._getNoahArkConditionCandidates(s,p);if(y.length<dBt)return;const C=new Map(p.map(L=>[L.name,L.value]));let N=0;for(let L=0;L<y.length;L++){const z=y[L];z.attrs.every(G=>C.get(G.name)===G.value)&&(N+=1,N>=dBt&&this.entries.splice(z.idx,1))}}insertMarker(){this.entries.unshift(xAe)}pushElement(s,p){this._ensureNoahArkCondition(s),this.entries.unshift({type:E6.Element,element:s,token:p})}insertElementAfterBookmark(s,p){const y=this.entries.indexOf(this.bookmark);this.entries.splice(y,0,{type:E6.Element,element:s,token:p})}removeEntry(s){const p=this.entries.indexOf(s);p>=0&&this.entries.splice(p,1)}clearToLastMarker(){const s=this.entries.indexOf(xAe);s>=0?this.entries.splice(0,s+1):this.entries.length=0}getElementEntryInScopeWithTagName(s){const p=this.entries.find(y=>y.type===E6.Marker||this.treeAdapter.getTagName(y.element)===s);return p&&p.type===E6.Element?p:null}getElementEntry(s){return this.entries.find(p=>p.type===E6.Element&&p.element===s)}}const sC={createDocument(){return{nodeName:"#document",mode:C3.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(o,s,p){return{nodeName:o,tagName:o,attrs:p,namespaceURI:s,childNodes:[],parentNode:null}},createCommentNode(o){return{nodeName:"#comment",data:o,parentNode:null}},createTextNode(o){return{nodeName:"#text",value:o,parentNode:null}},appendChild(o,s){o.childNodes.push(s),s.parentNode=o},insertBefore(o,s,p){const y=o.childNodes.indexOf(p);o.childNodes.splice(y,0,s),s.parentNode=o},setTemplateContent(o,s){o.content=s},getTemplateContent(o){return o.content},setDocumentType(o,s,p,y){const C=o.childNodes.find(N=>N.nodeName==="#documentType");if(C)C.name=s,C.publicId=p,C.systemId=y;else{const N={nodeName:"#documentType",name:s,publicId:p,systemId:y,parentNode:null};sC.appendChild(o,N)}},setDocumentMode(o,s){o.mode=s},getDocumentMode(o){return o.mode},detachNode(o){if(o.parentNode){const s=o.parentNode.childNodes.indexOf(o);o.parentNode.childNodes.splice(s,1),o.parentNode=null}},insertText(o,s){if(o.childNodes.length>0){const p=o.childNodes[o.childNodes.length-1];if(sC.isTextNode(p)){p.value+=s;return}}sC.appendChild(o,sC.createTextNode(s))},insertTextBefore(o,s,p){const y=o.childNodes[o.childNodes.indexOf(p)-1];y&&sC.isTextNode(y)?y.value+=s:sC.insertBefore(o,sC.createTextNode(s),p)},adoptAttributes(o,s){const p=new Set(o.attrs.map(y=>y.name));for(let y=0;y<s.length;y++)p.has(s[y].name)||o.attrs.push(s[y])},getFirstChild(o){return o.childNodes[0]},getChildNodes(o){return o.childNodes},getParentNode(o){return o.parentNode},getAttrList(o){return o.attrs},getTagName(o){return o.tagName},getNamespaceURI(o){return o.namespaceURI},getTextNodeContent(o){return o.value},getCommentNodeContent(o){return o.data},getDocumentTypeNodeName(o){return o.name},getDocumentTypeNodePublicId(o){return o.publicId},getDocumentTypeNodeSystemId(o){return o.systemId},isTextNode(o){return o.nodeName==="#text"},isCommentNode(o){return o.nodeName==="#comment"},isDocumentTypeNode(o){return o.nodeName==="#documentType"},isElementNode(o){return Object.prototype.hasOwnProperty.call(o,"tagName")},setNodeSourceCodeLocation(o,s){o.sourceCodeLocation=s},getNodeSourceCodeLocation(o){return o.sourceCodeLocation},updateNodeSourceCodeLocation(o,s){o.sourceCodeLocation={...o.sourceCodeLocation,...s}}},NPe="html",tWn="about:legacy-compat",eWn="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",PPe=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],nWn=[...PPe,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],rWn=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),LPe=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],iWn=[...LPe,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function EAe(o,s){return s.some(p=>o.startsWith(p))}function aWn(o){return o.name===NPe&&o.publicId===null&&(o.systemId===null||o.systemId===tWn)}function sWn(o){if(o.name!==NPe)return C3.QUIRKS;const{systemId:s}=o;if(s&&s.toLowerCase()===eWn)return C3.QUIRKS;let{publicId:p}=o;if(p!==null){if(p=p.toLowerCase(),rWn.has(p))return C3.QUIRKS;let y=s===null?nWn:PPe;if(EAe(p,y))return C3.QUIRKS;if(y=s===null?LPe:iWn,EAe(p,y))return C3.LIMITED_QUIRKS}return C3.NO_QUIRKS}const TAe={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},oWn="definitionurl",cWn="definitionURL",uWn=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(o=>[o.toLowerCase(),o])),lWn=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Di.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Di.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Di.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Di.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Di.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Di.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Di.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Di.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Di.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Di.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Di.XMLNS}]]),hWn=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(o=>[o.toLowerCase(),o])),fWn=new Set([dt.B,dt.BIG,dt.BLOCKQUOTE,dt.BODY,dt.BR,dt.CENTER,dt.CODE,dt.DD,dt.DIV,dt.DL,dt.DT,dt.EM,dt.EMBED,dt.H1,dt.H2,dt.H3,dt.H4,dt.H5,dt.H6,dt.HEAD,dt.HR,dt.I,dt.IMG,dt.LI,dt.LISTING,dt.MENU,dt.META,dt.NOBR,dt.OL,dt.P,dt.PRE,dt.RUBY,dt.S,dt.SMALL,dt.SPAN,dt.STRONG,dt.STRIKE,dt.SUB,dt.SUP,dt.TABLE,dt.TT,dt.U,dt.UL,dt.VAR]);function dWn(o){const s=o.tagID;return s===dt.FONT&&o.attrs.some(({name:y})=>y===pP.COLOR||y===pP.SIZE||y===pP.FACE)||fWn.has(s)}function MPe(o){for(let s=0;s<o.attrs.length;s++)if(o.attrs[s].name===oWn){o.attrs[s].name=cWn;break}}function RPe(o){for(let s=0;s<o.attrs.length;s++){const p=uWn.get(o.attrs[s].name);p!=null&&(o.attrs[s].name=p)}}function $$t(o){for(let s=0;s<o.attrs.length;s++){const p=lWn.get(o.attrs[s].name);p&&(o.attrs[s].prefix=p.prefix,o.attrs[s].name=p.name,o.attrs[s].namespace=p.namespace)}}function pWn(o){const s=hWn.get(o.tagName);s!=null&&(o.tagName=s,o.tagID=p$(o.tagName))}function gWn(o,s){return s===Di.MATHML&&(o===dt.MI||o===dt.MO||o===dt.MN||o===dt.MS||o===dt.MTEXT)}function bWn(o,s,p){if(s===Di.MATHML&&o===dt.ANNOTATION_XML){for(let y=0;y<p.length;y++)if(p[y].name===pP.ENCODING){const C=p[y].value.toLowerCase();return C===TAe.TEXT_HTML||C===TAe.APPLICATION_XML}}return s===Di.SVG&&(o===dt.FOREIGN_OBJECT||o===dt.DESC||o===dt.TITLE)}function mWn(o,s,p,y){return(!y||y===Di.HTML)&&bWn(o,s,p)||(!y||y===Di.MATHML)&&gWn(o,s)}const yWn="hidden",wWn=8,vWn=3;var Qe;(function(o){o[o.INITIAL=0]="INITIAL",o[o.BEFORE_HTML=1]="BEFORE_HTML",o[o.BEFORE_HEAD=2]="BEFORE_HEAD",o[o.IN_HEAD=3]="IN_HEAD",o[o.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",o[o.AFTER_HEAD=5]="AFTER_HEAD",o[o.IN_BODY=6]="IN_BODY",o[o.TEXT=7]="TEXT",o[o.IN_TABLE=8]="IN_TABLE",o[o.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",o[o.IN_CAPTION=10]="IN_CAPTION",o[o.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",o[o.IN_TABLE_BODY=12]="IN_TABLE_BODY",o[o.IN_ROW=13]="IN_ROW",o[o.IN_CELL=14]="IN_CELL",o[o.IN_SELECT=15]="IN_SELECT",o[o.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",o[o.IN_TEMPLATE=17]="IN_TEMPLATE",o[o.AFTER_BODY=18]="AFTER_BODY",o[o.IN_FRAMESET=19]="IN_FRAMESET",o[o.AFTER_FRAMESET=20]="AFTER_FRAMESET",o[o.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",o[o.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(Qe||(Qe={}));const _Wn={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},DPe=new Set([dt.TABLE,dt.TBODY,dt.TFOOT,dt.THEAD,dt.TR]),kAe={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:sC,onParseError:null};class SAe{constructor(s,p,y=null,C=null){this.fragmentContext=y,this.scriptHandler=C,this.currentToken=null,this.stopped=!1,this.insertionMode=Qe.INITIAL,this.originalInsertionMode=Qe.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...kAe,...s},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=p??this.treeAdapter.createDocument(),this.tokenizer=new Wqn(this.options,this),this.activeFormattingElements=new Zqn(this.treeAdapter),this.fragmentContextID=y?p$(this.treeAdapter.getTagName(y)):dt.UNKNOWN,this._setContextModes(y??this.document,this.fragmentContextID),this.openElements=new Jqn(this.document,this.treeAdapter,this)}static parse(s,p){const y=new this(p);return y.tokenizer.write(s,!0),y.document}static getFragmentParser(s,p){const y={...kAe,...p};s??(s=y.treeAdapter.createElement(tr.TEMPLATE,Di.HTML,[]));const C=y.treeAdapter.createElement("documentmock",Di.HTML,[]),N=new this(y,C,s);return N.fragmentContextID===dt.TEMPLATE&&N.tmplInsertionModeStack.unshift(Qe.IN_TEMPLATE),N._initTokenizerForFragmentParsing(),N._insertFakeRootElement(),N._resetInsertionMode(),N._findFormInFragmentContext(),N}getFragment(){const s=this.treeAdapter.getFirstChild(this.document),p=this.treeAdapter.createDocumentFragment();return this._adoptNodes(s,p),p}_err(s,p,y){var C;if(!this.onParseError)return;const N=(C=s.location)!==null&&C!==void 0?C:_Wn,L={code:p,startLine:N.startLine,startCol:N.startCol,startOffset:N.startOffset,endLine:y?N.startLine:N.endLine,endCol:y?N.startCol:N.endCol,endOffset:y?N.startOffset:N.endOffset};this.onParseError(L)}onItemPush(s,p,y){var C,N;(N=(C=this.treeAdapter).onItemPush)===null||N===void 0||N.call(C,s),y&&this.openElements.stackTop>0&&this._setContextModes(s,p)}onItemPop(s,p){var y,C;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(s,this.currentToken),(C=(y=this.treeAdapter).onItemPop)===null||C===void 0||C.call(y,s,this.openElements.current),p){let N,L;this.openElements.stackTop===0&&this.fragmentContext?(N=this.fragmentContext,L=this.fragmentContextID):{current:N,currentTagId:L}=this.openElements,this._setContextModes(N,L)}}_setContextModes(s,p){const y=s===this.document||this.treeAdapter.getNamespaceURI(s)===Di.HTML;this.currentNotInHTML=!y,this.tokenizer.inForeignNode=!y&&!this._isIntegrationPoint(p,s)}_switchToTextParsing(s,p){this._insertElement(s,Di.HTML),this.tokenizer.state=p,this.originalInsertionMode=this.insertionMode,this.insertionMode=Qe.TEXT}switchToPlaintextParsing(){this.insertionMode=Qe.TEXT,this.originalInsertionMode=Qe.IN_BODY,this.tokenizer.state=N1.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let s=this.fragmentContext;for(;s;){if(this.treeAdapter.getTagName(s)===tr.FORM){this.formElement=s;break}s=this.treeAdapter.getParentNode(s)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Di.HTML))switch(this.fragmentContextID){case dt.TITLE:case dt.TEXTAREA:{this.tokenizer.state=N1.RCDATA;break}case dt.STYLE:case dt.XMP:case dt.IFRAME:case dt.NOEMBED:case dt.NOFRAMES:case dt.NOSCRIPT:{this.tokenizer.state=N1.RAWTEXT;break}case dt.SCRIPT:{this.tokenizer.state=N1.SCRIPT_DATA;break}case dt.PLAINTEXT:{this.tokenizer.state=N1.PLAINTEXT;break}}}_setDocumentType(s){const p=s.name||"",y=s.publicId||"",C=s.systemId||"";if(this.treeAdapter.setDocumentType(this.document,p,y,C),s.location){const L=this.treeAdapter.getChildNodes(this.document).find(z=>this.treeAdapter.isDocumentTypeNode(z));L&&this.treeAdapter.setNodeSourceCodeLocation(L,s.location)}}_attachElementToTree(s,p){if(this.options.sourceCodeLocationInfo){const y=p&&{...p,startTag:p};this.treeAdapter.setNodeSourceCodeLocation(s,y)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(s);else{const y=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(y,s)}}_appendElement(s,p){const y=this.treeAdapter.createElement(s.tagName,p,s.attrs);this._attachElementToTree(y,s.location)}_insertElement(s,p){const y=this.treeAdapter.createElement(s.tagName,p,s.attrs);this._attachElementToTree(y,s.location),this.openElements.push(y,s.tagID)}_insertFakeElement(s,p){const y=this.treeAdapter.createElement(s,Di.HTML,[]);this._attachElementToTree(y,null),this.openElements.push(y,p)}_insertTemplate(s){const p=this.treeAdapter.createElement(s.tagName,Di.HTML,s.attrs),y=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(p,y),this._attachElementToTree(p,s.location),this.openElements.push(p,s.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(y,null)}_insertFakeRootElement(){const s=this.treeAdapter.createElement(tr.HTML,Di.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,null),this.treeAdapter.appendChild(this.openElements.current,s),this.openElements.push(s,dt.HTML)}_appendCommentNode(s,p){const y=this.treeAdapter.createCommentNode(s.data);this.treeAdapter.appendChild(p,y),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(y,s.location)}_insertCharacters(s){let p,y;if(this._shouldFosterParentOnInsertion()?({parent:p,beforeElement:y}=this._findFosterParentingLocation(),y?this.treeAdapter.insertTextBefore(p,s.chars,y):this.treeAdapter.insertText(p,s.chars)):(p=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(p,s.chars)),!s.location)return;const C=this.treeAdapter.getChildNodes(p),N=y?C.lastIndexOf(y):C.length,L=C[N-1];if(this.treeAdapter.getNodeSourceCodeLocation(L)){const{endLine:G,endCol:q,endOffset:et}=s.location;this.treeAdapter.updateNodeSourceCodeLocation(L,{endLine:G,endCol:q,endOffset:et})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(L,s.location)}_adoptNodes(s,p){for(let y=this.treeAdapter.getFirstChild(s);y;y=this.treeAdapter.getFirstChild(s))this.treeAdapter.detachNode(y),this.treeAdapter.appendChild(p,y)}_setEndLocation(s,p){if(this.treeAdapter.getNodeSourceCodeLocation(s)&&p.location){const y=p.location,C=this.treeAdapter.getTagName(s),N=p.type===ku.END_TAG&&C===p.tagName?{endTag:{...y},endLine:y.endLine,endCol:y.endCol,endOffset:y.endOffset}:{endLine:y.startLine,endCol:y.startCol,endOffset:y.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(s,N)}}shouldProcessStartTagTokenInForeignContent(s){if(!this.currentNotInHTML)return!1;let p,y;return this.openElements.stackTop===0&&this.fragmentContext?(p=this.fragmentContext,y=this.fragmentContextID):{current:p,currentTagId:y}=this.openElements,s.tagID===dt.SVG&&this.treeAdapter.getTagName(p)===tr.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(p)===Di.MATHML?!1:this.tokenizer.inForeignNode||(s.tagID===dt.MGLYPH||s.tagID===dt.MALIGNMARK)&&!this._isIntegrationPoint(y,p,Di.HTML)}_processToken(s){switch(s.type){case ku.CHARACTER:{this.onCharacter(s);break}case ku.NULL_CHARACTER:{this.onNullCharacter(s);break}case ku.COMMENT:{this.onComment(s);break}case ku.DOCTYPE:{this.onDoctype(s);break}case ku.START_TAG:{this._processStartTag(s);break}case ku.END_TAG:{this.onEndTag(s);break}case ku.EOF:{this.onEof(s);break}case ku.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(s);break}}}_isIntegrationPoint(s,p,y){const C=this.treeAdapter.getNamespaceURI(p),N=this.treeAdapter.getAttrList(p);return mWn(s,C,N,y)}_reconstructActiveFormattingElements(){const s=this.activeFormattingElements.entries.length;if(s){const p=this.activeFormattingElements.entries.findIndex(C=>C.type===E6.Marker||this.openElements.contains(C.element)),y=p<0?s-1:p-1;for(let C=y;C>=0;C--){const N=this.activeFormattingElements.entries[C];this._insertElement(N.token,this.treeAdapter.getNamespaceURI(N.element)),N.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=Qe.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(dt.P),this.openElements.popUntilTagNamePopped(dt.P)}_resetInsertionMode(){for(let s=this.openElements.stackTop;s>=0;s--)switch(s===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[s]){case dt.TR:{this.insertionMode=Qe.IN_ROW;return}case dt.TBODY:case dt.THEAD:case dt.TFOOT:{this.insertionMode=Qe.IN_TABLE_BODY;return}case dt.CAPTION:{this.insertionMode=Qe.IN_CAPTION;return}case dt.COLGROUP:{this.insertionMode=Qe.IN_COLUMN_GROUP;return}case dt.TABLE:{this.insertionMode=Qe.IN_TABLE;return}case dt.BODY:{this.insertionMode=Qe.IN_BODY;return}case dt.FRAMESET:{this.insertionMode=Qe.IN_FRAMESET;return}case dt.SELECT:{this._resetInsertionModeForSelect(s);return}case dt.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case dt.HTML:{this.insertionMode=this.headElement?Qe.AFTER_HEAD:Qe.BEFORE_HEAD;return}case dt.TD:case dt.TH:{if(s>0){this.insertionMode=Qe.IN_CELL;return}break}case dt.HEAD:{if(s>0){this.insertionMode=Qe.IN_HEAD;return}break}}this.insertionMode=Qe.IN_BODY}_resetInsertionModeForSelect(s){if(s>0)for(let p=s-1;p>0;p--){const y=this.openElements.tagIDs[p];if(y===dt.TEMPLATE)break;if(y===dt.TABLE){this.insertionMode=Qe.IN_SELECT_IN_TABLE;return}}this.insertionMode=Qe.IN_SELECT}_isElementCausesFosterParenting(s){return DPe.has(s)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let s=this.openElements.stackTop;s>=0;s--){const p=this.openElements.items[s];switch(this.openElements.tagIDs[s]){case dt.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(p)===Di.HTML)return{parent:this.treeAdapter.getTemplateContent(p),beforeElement:null};break}case dt.TABLE:{const y=this.treeAdapter.getParentNode(p);return y?{parent:y,beforeElement:p}:{parent:this.openElements.items[s-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(s){const p=this._findFosterParentingLocation();p.beforeElement?this.treeAdapter.insertBefore(p.parent,s,p.beforeElement):this.treeAdapter.appendChild(p.parent,s)}_isSpecialElement(s,p){const y=this.treeAdapter.getNamespaceURI(s);return Hqn[y].has(p)}onCharacter(s){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){QKn(this,s);return}switch(this.insertionMode){case Qe.INITIAL:{pQ(this,s);break}case Qe.BEFORE_HTML:{RQ(this,s);break}case Qe.BEFORE_HEAD:{DQ(this,s);break}case Qe.IN_HEAD:{BQ(this,s);break}case Qe.IN_HEAD_NO_SCRIPT:{FQ(this,s);break}case Qe.AFTER_HEAD:{$Q(this,s);break}case Qe.IN_BODY:case Qe.IN_CAPTION:case Qe.IN_CELL:case Qe.IN_TEMPLATE:{FPe(this,s);break}case Qe.TEXT:case Qe.IN_SELECT:case Qe.IN_SELECT_IN_TABLE:{this._insertCharacters(s);break}case Qe.IN_TABLE:case Qe.IN_TABLE_BODY:case Qe.IN_ROW:{pBt(this,s);break}case Qe.IN_TABLE_TEXT:{qPe(this,s);break}case Qe.IN_COLUMN_GROUP:{Rmt(this,s);break}case Qe.AFTER_BODY:{Dmt(this,s);break}case Qe.AFTER_AFTER_BODY:{emt(this,s);break}}}onNullCharacter(s){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){XKn(this,s);return}switch(this.insertionMode){case Qe.INITIAL:{pQ(this,s);break}case Qe.BEFORE_HTML:{RQ(this,s);break}case Qe.BEFORE_HEAD:{DQ(this,s);break}case Qe.IN_HEAD:{BQ(this,s);break}case Qe.IN_HEAD_NO_SCRIPT:{FQ(this,s);break}case Qe.AFTER_HEAD:{$Q(this,s);break}case Qe.TEXT:{this._insertCharacters(s);break}case Qe.IN_TABLE:case Qe.IN_TABLE_BODY:case Qe.IN_ROW:{pBt(this,s);break}case Qe.IN_COLUMN_GROUP:{Rmt(this,s);break}case Qe.AFTER_BODY:{Dmt(this,s);break}case Qe.AFTER_AFTER_BODY:{emt(this,s);break}}}onComment(s){if(this.skipNextNewLine=!1,this.currentNotInHTML){SFt(this,s);return}switch(this.insertionMode){case Qe.INITIAL:case Qe.BEFORE_HTML:case Qe.BEFORE_HEAD:case Qe.IN_HEAD:case Qe.IN_HEAD_NO_SCRIPT:case Qe.AFTER_HEAD:case Qe.IN_BODY:case Qe.IN_TABLE:case Qe.IN_CAPTION:case Qe.IN_COLUMN_GROUP:case Qe.IN_TABLE_BODY:case Qe.IN_ROW:case Qe.IN_CELL:case Qe.IN_SELECT:case Qe.IN_SELECT_IN_TABLE:case Qe.IN_TEMPLATE:case Qe.IN_FRAMESET:case Qe.AFTER_FRAMESET:{SFt(this,s);break}case Qe.IN_TABLE_TEXT:{gQ(this,s);break}case Qe.AFTER_BODY:{AWn(this,s);break}case Qe.AFTER_AFTER_BODY:case Qe.AFTER_AFTER_FRAMESET:{IWn(this,s);break}}}onDoctype(s){switch(this.skipNextNewLine=!1,this.insertionMode){case Qe.INITIAL:{OWn(this,s);break}case Qe.BEFORE_HEAD:case Qe.IN_HEAD:case Qe.IN_HEAD_NO_SCRIPT:case Qe.AFTER_HEAD:{this._err(s,Rr.misplacedDoctype);break}case Qe.IN_TABLE_TEXT:{gQ(this,s);break}}}onStartTag(s){this.skipNextNewLine=!1,this.currentToken=s,this._processStartTag(s),s.selfClosing&&!s.ackSelfClosing&&this._err(s,Rr.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(s){this.shouldProcessStartTagTokenInForeignContent(s)?JKn(this,s):this._startTagOutsideForeignContent(s)}_startTagOutsideForeignContent(s){switch(this.insertionMode){case Qe.INITIAL:{pQ(this,s);break}case Qe.BEFORE_HTML:{NWn(this,s);break}case Qe.BEFORE_HEAD:{LWn(this,s);break}case Qe.IN_HEAD:{s5(this,s);break}case Qe.IN_HEAD_NO_SCRIPT:{DWn(this,s);break}case Qe.AFTER_HEAD:{FWn(this,s);break}case Qe.IN_BODY:{Sb(this,s);break}case Qe.IN_TABLE:{n$(this,s);break}case Qe.IN_TABLE_TEXT:{gQ(this,s);break}case Qe.IN_CAPTION:{MKn(this,s);break}case Qe.IN_COLUMN_GROUP:{z$t(this,s);break}case Qe.IN_TABLE_BODY:{g2t(this,s);break}case Qe.IN_ROW:{b2t(this,s);break}case Qe.IN_CELL:{BKn(this,s);break}case Qe.IN_SELECT:{GPe(this,s);break}case Qe.IN_SELECT_IN_TABLE:{$Kn(this,s);break}case Qe.IN_TEMPLATE:{HKn(this,s);break}case Qe.AFTER_BODY:{UKn(this,s);break}case Qe.IN_FRAMESET:{qKn(this,s);break}case Qe.AFTER_FRAMESET:{KKn(this,s);break}case Qe.AFTER_AFTER_BODY:{YKn(this,s);break}case Qe.AFTER_AFTER_FRAMESET:{VKn(this,s);break}}}onEndTag(s){this.skipNextNewLine=!1,this.currentToken=s,this.currentNotInHTML?ZKn(this,s):this._endTagOutsideForeignContent(s)}_endTagOutsideForeignContent(s){switch(this.insertionMode){case Qe.INITIAL:{pQ(this,s);break}case Qe.BEFORE_HTML:{PWn(this,s);break}case Qe.BEFORE_HEAD:{MWn(this,s);break}case Qe.IN_HEAD:{RWn(this,s);break}case Qe.IN_HEAD_NO_SCRIPT:{BWn(this,s);break}case Qe.AFTER_HEAD:{$Wn(this,s);break}case Qe.IN_BODY:{p2t(this,s);break}case Qe.TEXT:{TKn(this,s);break}case Qe.IN_TABLE:{YQ(this,s);break}case Qe.IN_TABLE_TEXT:{gQ(this,s);break}case Qe.IN_CAPTION:{RKn(this,s);break}case Qe.IN_COLUMN_GROUP:{DKn(this,s);break}case Qe.IN_TABLE_BODY:{CFt(this,s);break}case Qe.IN_ROW:{KPe(this,s);break}case Qe.IN_CELL:{FKn(this,s);break}case Qe.IN_SELECT:{YPe(this,s);break}case Qe.IN_SELECT_IN_TABLE:{jKn(this,s);break}case Qe.IN_TEMPLATE:{zKn(this,s);break}case Qe.AFTER_BODY:{XPe(this,s);break}case Qe.IN_FRAMESET:{WKn(this,s);break}case Qe.AFTER_FRAMESET:{GKn(this,s);break}case Qe.AFTER_AFTER_BODY:{emt(this,s);break}}}onEof(s){switch(this.insertionMode){case Qe.INITIAL:{pQ(this,s);break}case Qe.BEFORE_HTML:{RQ(this,s);break}case Qe.BEFORE_HEAD:{DQ(this,s);break}case Qe.IN_HEAD:{BQ(this,s);break}case Qe.IN_HEAD_NO_SCRIPT:{FQ(this,s);break}case Qe.AFTER_HEAD:{$Q(this,s);break}case Qe.IN_BODY:case Qe.IN_TABLE:case Qe.IN_CAPTION:case Qe.IN_COLUMN_GROUP:case Qe.IN_TABLE_BODY:case Qe.IN_ROW:case Qe.IN_CELL:case Qe.IN_SELECT:case Qe.IN_SELECT_IN_TABLE:{zPe(this,s);break}case Qe.TEXT:{kKn(this,s);break}case Qe.IN_TABLE_TEXT:{gQ(this,s);break}case Qe.IN_TEMPLATE:{VPe(this,s);break}case Qe.AFTER_BODY:case Qe.IN_FRAMESET:case Qe.AFTER_FRAMESET:case Qe.AFTER_AFTER_BODY:case Qe.AFTER_AFTER_FRAMESET:{H$t(this,s);break}}}onWhitespaceCharacter(s){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,s.chars.charCodeAt(0)===ve.LINE_FEED)){if(s.chars.length===1)return;s.chars=s.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(s);return}switch(this.insertionMode){case Qe.IN_HEAD:case Qe.IN_HEAD_NO_SCRIPT:case Qe.AFTER_HEAD:case Qe.TEXT:case Qe.IN_COLUMN_GROUP:case Qe.IN_SELECT:case Qe.IN_SELECT_IN_TABLE:case Qe.IN_FRAMESET:case Qe.AFTER_FRAMESET:{this._insertCharacters(s);break}case Qe.IN_BODY:case Qe.IN_CAPTION:case Qe.IN_CELL:case Qe.IN_TEMPLATE:case Qe.AFTER_BODY:case Qe.AFTER_AFTER_BODY:case Qe.AFTER_AFTER_FRAMESET:{BPe(this,s);break}case Qe.IN_TABLE:case Qe.IN_TABLE_BODY:case Qe.IN_ROW:{pBt(this,s);break}case Qe.IN_TABLE_TEXT:{UPe(this,s);break}}}}function xWn(o,s){let p=o.activeFormattingElements.getElementEntryInScopeWithTagName(s.tagName);return p?o.openElements.contains(p.element)?o.openElements.hasInScope(s.tagID)||(p=null):(o.activeFormattingElements.removeEntry(p),p=null):HPe(o,s),p}function EWn(o,s){let p=null,y=o.openElements.stackTop;for(;y>=0;y--){const C=o.openElements.items[y];if(C===s.element)break;o._isSpecialElement(C,o.openElements.tagIDs[y])&&(p=C)}return p||(o.openElements.shortenToLength(y<0?0:y),o.activeFormattingElements.removeEntry(s)),p}function TWn(o,s,p){let y=s,C=o.openElements.getCommonAncestor(s);for(let N=0,L=C;L!==p;N++,L=C){C=o.openElements.getCommonAncestor(L);const z=o.activeFormattingElements.getElementEntry(L),G=z&&N>=vWn;!z||G?(G&&o.activeFormattingElements.removeEntry(z),o.openElements.remove(L)):(L=kWn(o,z),y===s&&(o.activeFormattingElements.bookmark=z),o.treeAdapter.detachNode(y),o.treeAdapter.appendChild(L,y),y=L)}return y}function kWn(o,s){const p=o.treeAdapter.getNamespaceURI(s.element),y=o.treeAdapter.createElement(s.token.tagName,p,s.token.attrs);return o.openElements.replace(s.element,y),s.element=y,y}function SWn(o,s,p){const y=o.treeAdapter.getTagName(s),C=p$(y);if(o._isElementCausesFosterParenting(C))o._fosterParentElement(p);else{const N=o.treeAdapter.getNamespaceURI(s);C===dt.TEMPLATE&&N===Di.HTML&&(s=o.treeAdapter.getTemplateContent(s)),o.treeAdapter.appendChild(s,p)}}function CWn(o,s,p){const y=o.treeAdapter.getNamespaceURI(p.element),{token:C}=p,N=o.treeAdapter.createElement(C.tagName,y,C.attrs);o._adoptNodes(s,N),o.treeAdapter.appendChild(s,N),o.activeFormattingElements.insertElementAfterBookmark(N,C),o.activeFormattingElements.removeEntry(p),o.openElements.remove(p.element),o.openElements.insertAfter(s,N,C.tagID)}function j$t(o,s){for(let p=0;p<wWn;p++){const y=xWn(o,s);if(!y)break;const C=EWn(o,y);if(!C)break;o.activeFormattingElements.bookmark=y;const N=TWn(o,C,y.element),L=o.openElements.getCommonAncestor(y.element);o.treeAdapter.detachNode(N),L&&SWn(o,L,N),CWn(o,C,y)}}function SFt(o,s){o._appendCommentNode(s,o.openElements.currentTmplContentOrNode)}function AWn(o,s){o._appendCommentNode(s,o.openElements.items[0])}function IWn(o,s){o._appendCommentNode(s,o.document)}function H$t(o,s){if(o.stopped=!0,s.location){const p=o.fragmentContext?0:2;for(let y=o.openElements.stackTop;y>=p;y--)o._setEndLocation(o.openElements.items[y],s);if(!o.fragmentContext&&o.openElements.stackTop>=0){const y=o.openElements.items[0],C=o.treeAdapter.getNodeSourceCodeLocation(y);if(C&&!C.endTag&&(o._setEndLocation(y,s),o.openElements.stackTop>=1)){const N=o.openElements.items[1],L=o.treeAdapter.getNodeSourceCodeLocation(N);L&&!L.endTag&&o._setEndLocation(N,s)}}}}function OWn(o,s){o._setDocumentType(s);const p=s.forceQuirks?C3.QUIRKS:sWn(s);aWn(s)||o._err(s,Rr.nonConformingDoctype),o.treeAdapter.setDocumentMode(o.document,p),o.insertionMode=Qe.BEFORE_HTML}function pQ(o,s){o._err(s,Rr.missingDoctype,!0),o.treeAdapter.setDocumentMode(o.document,C3.QUIRKS),o.insertionMode=Qe.BEFORE_HTML,o._processToken(s)}function NWn(o,s){s.tagID===dt.HTML?(o._insertElement(s,Di.HTML),o.insertionMode=Qe.BEFORE_HEAD):RQ(o,s)}function PWn(o,s){const p=s.tagID;(p===dt.HTML||p===dt.HEAD||p===dt.BODY||p===dt.BR)&&RQ(o,s)}function RQ(o,s){o._insertFakeRootElement(),o.insertionMode=Qe.BEFORE_HEAD,o._processToken(s)}function LWn(o,s){switch(s.tagID){case dt.HTML:{Sb(o,s);break}case dt.HEAD:{o._insertElement(s,Di.HTML),o.headElement=o.openElements.current,o.insertionMode=Qe.IN_HEAD;break}default:DQ(o,s)}}function MWn(o,s){const p=s.tagID;p===dt.HEAD||p===dt.BODY||p===dt.HTML||p===dt.BR?DQ(o,s):o._err(s,Rr.endTagWithoutMatchingOpenElement)}function DQ(o,s){o._insertFakeElement(tr.HEAD,dt.HEAD),o.headElement=o.openElements.current,o.insertionMode=Qe.IN_HEAD,o._processToken(s)}function s5(o,s){switch(s.tagID){case dt.HTML:{Sb(o,s);break}case dt.BASE:case dt.BASEFONT:case dt.BGSOUND:case dt.LINK:case dt.META:{o._appendElement(s,Di.HTML),s.ackSelfClosing=!0;break}case dt.TITLE:{o._switchToTextParsing(s,N1.RCDATA);break}case dt.NOSCRIPT:{o.options.scriptingEnabled?o._switchToTextParsing(s,N1.RAWTEXT):(o._insertElement(s,Di.HTML),o.insertionMode=Qe.IN_HEAD_NO_SCRIPT);break}case dt.NOFRAMES:case dt.STYLE:{o._switchToTextParsing(s,N1.RAWTEXT);break}case dt.SCRIPT:{o._switchToTextParsing(s,N1.SCRIPT_DATA);break}case dt.TEMPLATE:{o._insertTemplate(s),o.activeFormattingElements.insertMarker(),o.framesetOk=!1,o.insertionMode=Qe.IN_TEMPLATE,o.tmplInsertionModeStack.unshift(Qe.IN_TEMPLATE);break}case dt.HEAD:{o._err(s,Rr.misplacedStartTagForHeadElement);break}default:BQ(o,s)}}function RWn(o,s){switch(s.tagID){case dt.HEAD:{o.openElements.pop(),o.insertionMode=Qe.AFTER_HEAD;break}case dt.BODY:case dt.BR:case dt.HTML:{BQ(o,s);break}case dt.TEMPLATE:{EP(o,s);break}default:o._err(s,Rr.endTagWithoutMatchingOpenElement)}}function EP(o,s){o.openElements.tmplCount>0?(o.openElements.generateImpliedEndTagsThoroughly(),o.openElements.currentTagId!==dt.TEMPLATE&&o._err(s,Rr.closingOfElementWithOpenChildElements),o.openElements.popUntilTagNamePopped(dt.TEMPLATE),o.activeFormattingElements.clearToLastMarker(),o.tmplInsertionModeStack.shift(),o._resetInsertionMode()):o._err(s,Rr.endTagWithoutMatchingOpenElement)}function BQ(o,s){o.openElements.pop(),o.insertionMode=Qe.AFTER_HEAD,o._processToken(s)}function DWn(o,s){switch(s.tagID){case dt.HTML:{Sb(o,s);break}case dt.BASEFONT:case dt.BGSOUND:case dt.HEAD:case dt.LINK:case dt.META:case dt.NOFRAMES:case dt.STYLE:{s5(o,s);break}case dt.NOSCRIPT:{o._err(s,Rr.nestedNoscriptInHead);break}default:FQ(o,s)}}function BWn(o,s){switch(s.tagID){case dt.NOSCRIPT:{o.openElements.pop(),o.insertionMode=Qe.IN_HEAD;break}case dt.BR:{FQ(o,s);break}default:o._err(s,Rr.endTagWithoutMatchingOpenElement)}}function FQ(o,s){const p=s.type===ku.EOF?Rr.openElementsLeftAfterEof:Rr.disallowedContentInNoscriptInHead;o._err(s,p),o.openElements.pop(),o.insertionMode=Qe.IN_HEAD,o._processToken(s)}function FWn(o,s){switch(s.tagID){case dt.HTML:{Sb(o,s);break}case dt.BODY:{o._insertElement(s,Di.HTML),o.framesetOk=!1,o.insertionMode=Qe.IN_BODY;break}case dt.FRAMESET:{o._insertElement(s,Di.HTML),o.insertionMode=Qe.IN_FRAMESET;break}case dt.BASE:case dt.BASEFONT:case dt.BGSOUND:case dt.LINK:case dt.META:case dt.NOFRAMES:case dt.SCRIPT:case dt.STYLE:case dt.TEMPLATE:case dt.TITLE:{o._err(s,Rr.abandonedHeadElementChild),o.openElements.push(o.headElement,dt.HEAD),s5(o,s),o.openElements.remove(o.headElement);break}case dt.HEAD:{o._err(s,Rr.misplacedStartTagForHeadElement);break}default:$Q(o,s)}}function $Wn(o,s){switch(s.tagID){case dt.BODY:case dt.HTML:case dt.BR:{$Q(o,s);break}case dt.TEMPLATE:{EP(o,s);break}default:o._err(s,Rr.endTagWithoutMatchingOpenElement)}}function $Q(o,s){o._insertFakeElement(tr.BODY,dt.BODY),o.insertionMode=Qe.IN_BODY,d2t(o,s)}function d2t(o,s){switch(s.type){case ku.CHARACTER:{FPe(o,s);break}case ku.WHITESPACE_CHARACTER:{BPe(o,s);break}case ku.COMMENT:{SFt(o,s);break}case ku.START_TAG:{Sb(o,s);break}case ku.END_TAG:{p2t(o,s);break}case ku.EOF:{zPe(o,s);break}}}function BPe(o,s){o._reconstructActiveFormattingElements(),o._insertCharacters(s)}function FPe(o,s){o._reconstructActiveFormattingElements(),o._insertCharacters(s),o.framesetOk=!1}function jWn(o,s){o.openElements.tmplCount===0&&o.treeAdapter.adoptAttributes(o.openElements.items[0],s.attrs)}function HWn(o,s){const p=o.openElements.tryPeekProperlyNestedBodyElement();p&&o.openElements.tmplCount===0&&(o.framesetOk=!1,o.treeAdapter.adoptAttributes(p,s.attrs))}function zWn(o,s){const p=o.openElements.tryPeekProperlyNestedBodyElement();o.framesetOk&&p&&(o.treeAdapter.detachNode(p),o.openElements.popAllUpToHtmlElement(),o._insertElement(s,Di.HTML),o.insertionMode=Qe.IN_FRAMESET)}function UWn(o,s){o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),o._insertElement(s,Di.HTML)}function qWn(o,s){o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),kFt.has(o.openElements.currentTagId)&&o.openElements.pop(),o._insertElement(s,Di.HTML)}function WWn(o,s){o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),o._insertElement(s,Di.HTML),o.skipNextNewLine=!0,o.framesetOk=!1}function KWn(o,s){const p=o.openElements.tmplCount>0;(!o.formElement||p)&&(o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),o._insertElement(s,Di.HTML),p||(o.formElement=o.openElements.current))}function GWn(o,s){o.framesetOk=!1;const p=s.tagID;for(let y=o.openElements.stackTop;y>=0;y--){const C=o.openElements.tagIDs[y];if(p===dt.LI&&C===dt.LI||(p===dt.DD||p===dt.DT)&&(C===dt.DD||C===dt.DT)){o.openElements.generateImpliedEndTagsWithExclusion(C),o.openElements.popUntilTagNamePopped(C);break}if(C!==dt.ADDRESS&&C!==dt.DIV&&C!==dt.P&&o._isSpecialElement(o.openElements.items[y],C))break}o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),o._insertElement(s,Di.HTML)}function YWn(o,s){o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),o._insertElement(s,Di.HTML),o.tokenizer.state=N1.PLAINTEXT}function VWn(o,s){o.openElements.hasInScope(dt.BUTTON)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(dt.BUTTON)),o._reconstructActiveFormattingElements(),o._insertElement(s,Di.HTML),o.framesetOk=!1}function XWn(o,s){const p=o.activeFormattingElements.getElementEntryInScopeWithTagName(tr.A);p&&(j$t(o,s),o.openElements.remove(p.element),o.activeFormattingElements.removeEntry(p)),o._reconstructActiveFormattingElements(),o._insertElement(s,Di.HTML),o.activeFormattingElements.pushElement(o.openElements.current,s)}function QWn(o,s){o._reconstructActiveFormattingElements(),o._insertElement(s,Di.HTML),o.activeFormattingElements.pushElement(o.openElements.current,s)}function JWn(o,s){o._reconstructActiveFormattingElements(),o.openElements.hasInScope(dt.NOBR)&&(j$t(o,s),o._reconstructActiveFormattingElements()),o._insertElement(s,Di.HTML),o.activeFormattingElements.pushElement(o.openElements.current,s)}function ZWn(o,s){o._reconstructActiveFormattingElements(),o._insertElement(s,Di.HTML),o.activeFormattingElements.insertMarker(),o.framesetOk=!1}function tKn(o,s){o.treeAdapter.getDocumentMode(o.document)!==C3.QUIRKS&&o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),o._insertElement(s,Di.HTML),o.framesetOk=!1,o.insertionMode=Qe.IN_TABLE}function $Pe(o,s){o._reconstructActiveFormattingElements(),o._appendElement(s,Di.HTML),o.framesetOk=!1,s.ackSelfClosing=!0}function jPe(o){const s=kPe(o,pP.TYPE);return s!=null&&s.toLowerCase()===yWn}function eKn(o,s){o._reconstructActiveFormattingElements(),o._appendElement(s,Di.HTML),jPe(s)||(o.framesetOk=!1),s.ackSelfClosing=!0}function nKn(o,s){o._appendElement(s,Di.HTML),s.ackSelfClosing=!0}function rKn(o,s){o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),o._appendElement(s,Di.HTML),o.framesetOk=!1,s.ackSelfClosing=!0}function iKn(o,s){s.tagName=tr.IMG,s.tagID=dt.IMG,$Pe(o,s)}function aKn(o,s){o._insertElement(s,Di.HTML),o.skipNextNewLine=!0,o.tokenizer.state=N1.RCDATA,o.originalInsertionMode=o.insertionMode,o.framesetOk=!1,o.insertionMode=Qe.TEXT}function sKn(o,s){o.openElements.hasInButtonScope(dt.P)&&o._closePElement(),o._reconstructActiveFormattingElements(),o.framesetOk=!1,o._switchToTextParsing(s,N1.RAWTEXT)}function oKn(o,s){o.framesetOk=!1,o._switchToTextParsing(s,N1.RAWTEXT)}function CAe(o,s){o._switchToTextParsing(s,N1.RAWTEXT)}function cKn(o,s){o._reconstructActiveFormattingElements(),o._insertElement(s,Di.HTML),o.framesetOk=!1,o.insertionMode=o.insertionMode===Qe.IN_TABLE||o.insertionMode===Qe.IN_CAPTION||o.insertionMode===Qe.IN_TABLE_BODY||o.insertionMode===Qe.IN_ROW||o.insertionMode===Qe.IN_CELL?Qe.IN_SELECT_IN_TABLE:Qe.IN_SELECT}function uKn(o,s){o.openElements.currentTagId===dt.OPTION&&o.openElements.pop(),o._reconstructActiveFormattingElements(),o._insertElement(s,Di.HTML)}function lKn(o,s){o.openElements.hasInScope(dt.RUBY)&&o.openElements.generateImpliedEndTags(),o._insertElement(s,Di.HTML)}function hKn(o,s){o.openElements.hasInScope(dt.RUBY)&&o.openElements.generateImpliedEndTagsWithExclusion(dt.RTC),o._insertElement(s,Di.HTML)}function fKn(o,s){o._reconstructActiveFormattingElements(),MPe(s),$$t(s),s.selfClosing?o._appendElement(s,Di.MATHML):o._insertElement(s,Di.MATHML),s.ackSelfClosing=!0}function dKn(o,s){o._reconstructActiveFormattingElements(),RPe(s),$$t(s),s.selfClosing?o._appendElement(s,Di.SVG):o._insertElement(s,Di.SVG),s.ackSelfClosing=!0}function AAe(o,s){o._reconstructActiveFormattingElements(),o._insertElement(s,Di.HTML)}function Sb(o,s){switch(s.tagID){case dt.I:case dt.S:case dt.B:case dt.U:case dt.EM:case dt.TT:case dt.BIG:case dt.CODE:case dt.FONT:case dt.SMALL:case dt.STRIKE:case dt.STRONG:{QWn(o,s);break}case dt.A:{XWn(o,s);break}case dt.H1:case dt.H2:case dt.H3:case dt.H4:case dt.H5:case dt.H6:{qWn(o,s);break}case dt.P:case dt.DL:case dt.OL:case dt.UL:case dt.DIV:case dt.DIR:case dt.NAV:case dt.MAIN:case dt.MENU:case dt.ASIDE:case dt.CENTER:case dt.FIGURE:case dt.FOOTER:case dt.HEADER:case dt.HGROUP:case dt.DIALOG:case dt.DETAILS:case dt.ADDRESS:case dt.ARTICLE:case dt.SEARCH:case dt.SECTION:case dt.SUMMARY:case dt.FIELDSET:case dt.BLOCKQUOTE:case dt.FIGCAPTION:{UWn(o,s);break}case dt.LI:case dt.DD:case dt.DT:{GWn(o,s);break}case dt.BR:case dt.IMG:case dt.WBR:case dt.AREA:case dt.EMBED:case dt.KEYGEN:{$Pe(o,s);break}case dt.HR:{rKn(o,s);break}case dt.RB:case dt.RTC:{lKn(o,s);break}case dt.RT:case dt.RP:{hKn(o,s);break}case dt.PRE:case dt.LISTING:{WWn(o,s);break}case dt.XMP:{sKn(o,s);break}case dt.SVG:{dKn(o,s);break}case dt.HTML:{jWn(o,s);break}case dt.BASE:case dt.LINK:case dt.META:case dt.STYLE:case dt.TITLE:case dt.SCRIPT:case dt.BGSOUND:case dt.BASEFONT:case dt.TEMPLATE:{s5(o,s);break}case dt.BODY:{HWn(o,s);break}case dt.FORM:{KWn(o,s);break}case dt.NOBR:{JWn(o,s);break}case dt.MATH:{fKn(o,s);break}case dt.TABLE:{tKn(o,s);break}case dt.INPUT:{eKn(o,s);break}case dt.PARAM:case dt.TRACK:case dt.SOURCE:{nKn(o,s);break}case dt.IMAGE:{iKn(o,s);break}case dt.BUTTON:{VWn(o,s);break}case dt.APPLET:case dt.OBJECT:case dt.MARQUEE:{ZWn(o,s);break}case dt.IFRAME:{oKn(o,s);break}case dt.SELECT:{cKn(o,s);break}case dt.OPTION:case dt.OPTGROUP:{uKn(o,s);break}case dt.NOEMBED:case dt.NOFRAMES:{CAe(o,s);break}case dt.FRAMESET:{zWn(o,s);break}case dt.TEXTAREA:{aKn(o,s);break}case dt.NOSCRIPT:{o.options.scriptingEnabled?CAe(o,s):AAe(o,s);break}case dt.PLAINTEXT:{YWn(o,s);break}case dt.COL:case dt.TH:case dt.TD:case dt.TR:case dt.HEAD:case dt.FRAME:case dt.TBODY:case dt.TFOOT:case dt.THEAD:case dt.CAPTION:case dt.COLGROUP:break;default:AAe(o,s)}}function pKn(o,s){if(o.openElements.hasInScope(dt.BODY)&&(o.insertionMode=Qe.AFTER_BODY,o.options.sourceCodeLocationInfo)){const p=o.openElements.tryPeekProperlyNestedBodyElement();p&&o._setEndLocation(p,s)}}function gKn(o,s){o.openElements.hasInScope(dt.BODY)&&(o.insertionMode=Qe.AFTER_BODY,XPe(o,s))}function bKn(o,s){const p=s.tagID;o.openElements.hasInScope(p)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(p))}function mKn(o){const s=o.openElements.tmplCount>0,{formElement:p}=o;s||(o.formElement=null),(p||s)&&o.openElements.hasInScope(dt.FORM)&&(o.openElements.generateImpliedEndTags(),s?o.openElements.popUntilTagNamePopped(dt.FORM):p&&o.openElements.remove(p))}function yKn(o){o.openElements.hasInButtonScope(dt.P)||o._insertFakeElement(tr.P,dt.P),o._closePElement()}function wKn(o){o.openElements.hasInListItemScope(dt.LI)&&(o.openElements.generateImpliedEndTagsWithExclusion(dt.LI),o.openElements.popUntilTagNamePopped(dt.LI))}function vKn(o,s){const p=s.tagID;o.openElements.hasInScope(p)&&(o.openElements.generateImpliedEndTagsWithExclusion(p),o.openElements.popUntilTagNamePopped(p))}function _Kn(o){o.openElements.hasNumberedHeaderInScope()&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilNumberedHeaderPopped())}function xKn(o,s){const p=s.tagID;o.openElements.hasInScope(p)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(p),o.activeFormattingElements.clearToLastMarker())}function EKn(o){o._reconstructActiveFormattingElements(),o._insertFakeElement(tr.BR,dt.BR),o.openElements.pop(),o.framesetOk=!1}function HPe(o,s){const p=s.tagName,y=s.tagID;for(let C=o.openElements.stackTop;C>0;C--){const N=o.openElements.items[C],L=o.openElements.tagIDs[C];if(y===L&&(y!==dt.UNKNOWN||o.treeAdapter.getTagName(N)===p)){o.openElements.generateImpliedEndTagsWithExclusion(y),o.openElements.stackTop>=C&&o.openElements.shortenToLength(C);break}if(o._isSpecialElement(N,L))break}}function p2t(o,s){switch(s.tagID){case dt.A:case dt.B:case dt.I:case dt.S:case dt.U:case dt.EM:case dt.TT:case dt.BIG:case dt.CODE:case dt.FONT:case dt.NOBR:case dt.SMALL:case dt.STRIKE:case dt.STRONG:{j$t(o,s);break}case dt.P:{yKn(o);break}case dt.DL:case dt.UL:case dt.OL:case dt.DIR:case dt.DIV:case dt.NAV:case dt.PRE:case dt.MAIN:case dt.MENU:case dt.ASIDE:case dt.BUTTON:case dt.CENTER:case dt.FIGURE:case dt.FOOTER:case dt.HEADER:case dt.HGROUP:case dt.DIALOG:case dt.ADDRESS:case dt.ARTICLE:case dt.DETAILS:case dt.SEARCH:case dt.SECTION:case dt.SUMMARY:case dt.LISTING:case dt.FIELDSET:case dt.BLOCKQUOTE:case dt.FIGCAPTION:{bKn(o,s);break}case dt.LI:{wKn(o);break}case dt.DD:case dt.DT:{vKn(o,s);break}case dt.H1:case dt.H2:case dt.H3:case dt.H4:case dt.H5:case dt.H6:{_Kn(o);break}case dt.BR:{EKn(o);break}case dt.BODY:{pKn(o,s);break}case dt.HTML:{gKn(o,s);break}case dt.FORM:{mKn(o);break}case dt.APPLET:case dt.OBJECT:case dt.MARQUEE:{xKn(o,s);break}case dt.TEMPLATE:{EP(o,s);break}default:HPe(o,s)}}function zPe(o,s){o.tmplInsertionModeStack.length>0?VPe(o,s):H$t(o,s)}function TKn(o,s){var p;s.tagID===dt.SCRIPT&&((p=o.scriptHandler)===null||p===void 0||p.call(o,o.openElements.current)),o.openElements.pop(),o.insertionMode=o.originalInsertionMode}function kKn(o,s){o._err(s,Rr.eofInElementThatCanContainOnlyText),o.openElements.pop(),o.insertionMode=o.originalInsertionMode,o.onEof(s)}function pBt(o,s){if(DPe.has(o.openElements.currentTagId))switch(o.pendingCharacterTokens.length=0,o.hasNonWhitespacePendingCharacterToken=!1,o.originalInsertionMode=o.insertionMode,o.insertionMode=Qe.IN_TABLE_TEXT,s.type){case ku.CHARACTER:{qPe(o,s);break}case ku.WHITESPACE_CHARACTER:{UPe(o,s);break}}else oJ(o,s)}function SKn(o,s){o.openElements.clearBackToTableContext(),o.activeFormattingElements.insertMarker(),o._insertElement(s,Di.HTML),o.insertionMode=Qe.IN_CAPTION}function CKn(o,s){o.openElements.clearBackToTableContext(),o._insertElement(s,Di.HTML),o.insertionMode=Qe.IN_COLUMN_GROUP}function AKn(o,s){o.openElements.clearBackToTableContext(),o._insertFakeElement(tr.COLGROUP,dt.COLGROUP),o.insertionMode=Qe.IN_COLUMN_GROUP,z$t(o,s)}function IKn(o,s){o.openElements.clearBackToTableContext(),o._insertElement(s,Di.HTML),o.insertionMode=Qe.IN_TABLE_BODY}function OKn(o,s){o.openElements.clearBackToTableContext(),o._insertFakeElement(tr.TBODY,dt.TBODY),o.insertionMode=Qe.IN_TABLE_BODY,g2t(o,s)}function NKn(o,s){o.openElements.hasInTableScope(dt.TABLE)&&(o.openElements.popUntilTagNamePopped(dt.TABLE),o._resetInsertionMode(),o._processStartTag(s))}function PKn(o,s){jPe(s)?o._appendElement(s,Di.HTML):oJ(o,s),s.ackSelfClosing=!0}function LKn(o,s){!o.formElement&&o.openElements.tmplCount===0&&(o._insertElement(s,Di.HTML),o.formElement=o.openElements.current,o.openElements.pop())}function n$(o,s){switch(s.tagID){case dt.TD:case dt.TH:case dt.TR:{OKn(o,s);break}case dt.STYLE:case dt.SCRIPT:case dt.TEMPLATE:{s5(o,s);break}case dt.COL:{AKn(o,s);break}case dt.FORM:{LKn(o,s);break}case dt.TABLE:{NKn(o,s);break}case dt.TBODY:case dt.TFOOT:case dt.THEAD:{IKn(o,s);break}case dt.INPUT:{PKn(o,s);break}case dt.CAPTION:{SKn(o,s);break}case dt.COLGROUP:{CKn(o,s);break}default:oJ(o,s)}}function YQ(o,s){switch(s.tagID){case dt.TABLE:{o.openElements.hasInTableScope(dt.TABLE)&&(o.openElements.popUntilTagNamePopped(dt.TABLE),o._resetInsertionMode());break}case dt.TEMPLATE:{EP(o,s);break}case dt.BODY:case dt.CAPTION:case dt.COL:case dt.COLGROUP:case dt.HTML:case dt.TBODY:case dt.TD:case dt.TFOOT:case dt.TH:case dt.THEAD:case dt.TR:break;default:oJ(o,s)}}function oJ(o,s){const p=o.fosterParentingEnabled;o.fosterParentingEnabled=!0,d2t(o,s),o.fosterParentingEnabled=p}function UPe(o,s){o.pendingCharacterTokens.push(s)}function qPe(o,s){o.pendingCharacterTokens.push(s),o.hasNonWhitespacePendingCharacterToken=!0}function gQ(o,s){let p=0;if(o.hasNonWhitespacePendingCharacterToken)for(;p<o.pendingCharacterTokens.length;p++)oJ(o,o.pendingCharacterTokens[p]);else for(;p<o.pendingCharacterTokens.length;p++)o._insertCharacters(o.pendingCharacterTokens[p]);o.insertionMode=o.originalInsertionMode,o._processToken(s)}const WPe=new Set([dt.CAPTION,dt.COL,dt.COLGROUP,dt.TBODY,dt.TD,dt.TFOOT,dt.TH,dt.THEAD,dt.TR]);function MKn(o,s){const p=s.tagID;WPe.has(p)?o.openElements.hasInTableScope(dt.CAPTION)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(dt.CAPTION),o.activeFormattingElements.clearToLastMarker(),o.insertionMode=Qe.IN_TABLE,n$(o,s)):Sb(o,s)}function RKn(o,s){const p=s.tagID;switch(p){case dt.CAPTION:case dt.TABLE:{o.openElements.hasInTableScope(dt.CAPTION)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(dt.CAPTION),o.activeFormattingElements.clearToLastMarker(),o.insertionMode=Qe.IN_TABLE,p===dt.TABLE&&YQ(o,s));break}case dt.BODY:case dt.COL:case dt.COLGROUP:case dt.HTML:case dt.TBODY:case dt.TD:case dt.TFOOT:case dt.TH:case dt.THEAD:case dt.TR:break;default:p2t(o,s)}}function z$t(o,s){switch(s.tagID){case dt.HTML:{Sb(o,s);break}case dt.COL:{o._appendElement(s,Di.HTML),s.ackSelfClosing=!0;break}case dt.TEMPLATE:{s5(o,s);break}default:Rmt(o,s)}}function DKn(o,s){switch(s.tagID){case dt.COLGROUP:{o.openElements.currentTagId===dt.COLGROUP&&(o.openElements.pop(),o.insertionMode=Qe.IN_TABLE);break}case dt.TEMPLATE:{EP(o,s);break}case dt.COL:break;default:Rmt(o,s)}}function Rmt(o,s){o.openElements.currentTagId===dt.COLGROUP&&(o.openElements.pop(),o.insertionMode=Qe.IN_TABLE,o._processToken(s))}function g2t(o,s){switch(s.tagID){case dt.TR:{o.openElements.clearBackToTableBodyContext(),o._insertElement(s,Di.HTML),o.insertionMode=Qe.IN_ROW;break}case dt.TH:case dt.TD:{o.openElements.clearBackToTableBodyContext(),o._insertFakeElement(tr.TR,dt.TR),o.insertionMode=Qe.IN_ROW,b2t(o,s);break}case dt.CAPTION:case dt.COL:case dt.COLGROUP:case dt.TBODY:case dt.TFOOT:case dt.THEAD:{o.openElements.hasTableBodyContextInTableScope()&&(o.openElements.clearBackToTableBodyContext(),o.openElements.pop(),o.insertionMode=Qe.IN_TABLE,n$(o,s));break}default:n$(o,s)}}function CFt(o,s){const p=s.tagID;switch(s.tagID){case dt.TBODY:case dt.TFOOT:case dt.THEAD:{o.openElements.hasInTableScope(p)&&(o.openElements.clearBackToTableBodyContext(),o.openElements.pop(),o.insertionMode=Qe.IN_TABLE);break}case dt.TABLE:{o.openElements.hasTableBodyContextInTableScope()&&(o.openElements.clearBackToTableBodyContext(),o.openElements.pop(),o.insertionMode=Qe.IN_TABLE,YQ(o,s));break}case dt.BODY:case dt.CAPTION:case dt.COL:case dt.COLGROUP:case dt.HTML:case dt.TD:case dt.TH:case dt.TR:break;default:YQ(o,s)}}function b2t(o,s){switch(s.tagID){case dt.TH:case dt.TD:{o.openElements.clearBackToTableRowContext(),o._insertElement(s,Di.HTML),o.insertionMode=Qe.IN_CELL,o.activeFormattingElements.insertMarker();break}case dt.CAPTION:case dt.COL:case dt.COLGROUP:case dt.TBODY:case dt.TFOOT:case dt.THEAD:case dt.TR:{o.openElements.hasInTableScope(dt.TR)&&(o.openElements.clearBackToTableRowContext(),o.openElements.pop(),o.insertionMode=Qe.IN_TABLE_BODY,g2t(o,s));break}default:n$(o,s)}}function KPe(o,s){switch(s.tagID){case dt.TR:{o.openElements.hasInTableScope(dt.TR)&&(o.openElements.clearBackToTableRowContext(),o.openElements.pop(),o.insertionMode=Qe.IN_TABLE_BODY);break}case dt.TABLE:{o.openElements.hasInTableScope(dt.TR)&&(o.openElements.clearBackToTableRowContext(),o.openElements.pop(),o.insertionMode=Qe.IN_TABLE_BODY,CFt(o,s));break}case dt.TBODY:case dt.TFOOT:case dt.THEAD:{(o.openElements.hasInTableScope(s.tagID)||o.openElements.hasInTableScope(dt.TR))&&(o.openElements.clearBackToTableRowContext(),o.openElements.pop(),o.insertionMode=Qe.IN_TABLE_BODY,CFt(o,s));break}case dt.BODY:case dt.CAPTION:case dt.COL:case dt.COLGROUP:case dt.HTML:case dt.TD:case dt.TH:break;default:YQ(o,s)}}function BKn(o,s){const p=s.tagID;WPe.has(p)?(o.openElements.hasInTableScope(dt.TD)||o.openElements.hasInTableScope(dt.TH))&&(o._closeTableCell(),b2t(o,s)):Sb(o,s)}function FKn(o,s){const p=s.tagID;switch(p){case dt.TD:case dt.TH:{o.openElements.hasInTableScope(p)&&(o.openElements.generateImpliedEndTags(),o.openElements.popUntilTagNamePopped(p),o.activeFormattingElements.clearToLastMarker(),o.insertionMode=Qe.IN_ROW);break}case dt.TABLE:case dt.TBODY:case dt.TFOOT:case dt.THEAD:case dt.TR:{o.openElements.hasInTableScope(p)&&(o._closeTableCell(),KPe(o,s));break}case dt.BODY:case dt.CAPTION:case dt.COL:case dt.COLGROUP:case dt.HTML:break;default:p2t(o,s)}}function GPe(o,s){switch(s.tagID){case dt.HTML:{Sb(o,s);break}case dt.OPTION:{o.openElements.currentTagId===dt.OPTION&&o.openElements.pop(),o._insertElement(s,Di.HTML);break}case dt.OPTGROUP:{o.openElements.currentTagId===dt.OPTION&&o.openElements.pop(),o.openElements.currentTagId===dt.OPTGROUP&&o.openElements.pop(),o._insertElement(s,Di.HTML);break}case dt.HR:{o.openElements.currentTagId===dt.OPTION&&o.openElements.pop(),o.openElements.currentTagId===dt.OPTGROUP&&o.openElements.pop(),o._appendElement(s,Di.HTML),s.ackSelfClosing=!0;break}case dt.INPUT:case dt.KEYGEN:case dt.TEXTAREA:case dt.SELECT:{o.openElements.hasInSelectScope(dt.SELECT)&&(o.openElements.popUntilTagNamePopped(dt.SELECT),o._resetInsertionMode(),s.tagID!==dt.SELECT&&o._processStartTag(s));break}case dt.SCRIPT:case dt.TEMPLATE:{s5(o,s);break}}}function YPe(o,s){switch(s.tagID){case dt.OPTGROUP:{o.openElements.stackTop>0&&o.openElements.currentTagId===dt.OPTION&&o.openElements.tagIDs[o.openElements.stackTop-1]===dt.OPTGROUP&&o.openElements.pop(),o.openElements.currentTagId===dt.OPTGROUP&&o.openElements.pop();break}case dt.OPTION:{o.openElements.currentTagId===dt.OPTION&&o.openElements.pop();break}case dt.SELECT:{o.openElements.hasInSelectScope(dt.SELECT)&&(o.openElements.popUntilTagNamePopped(dt.SELECT),o._resetInsertionMode());break}case dt.TEMPLATE:{EP(o,s);break}}}function $Kn(o,s){const p=s.tagID;p===dt.CAPTION||p===dt.TABLE||p===dt.TBODY||p===dt.TFOOT||p===dt.THEAD||p===dt.TR||p===dt.TD||p===dt.TH?(o.openElements.popUntilTagNamePopped(dt.SELECT),o._resetInsertionMode(),o._processStartTag(s)):GPe(o,s)}function jKn(o,s){const p=s.tagID;p===dt.CAPTION||p===dt.TABLE||p===dt.TBODY||p===dt.TFOOT||p===dt.THEAD||p===dt.TR||p===dt.TD||p===dt.TH?o.openElements.hasInTableScope(p)&&(o.openElements.popUntilTagNamePopped(dt.SELECT),o._resetInsertionMode(),o.onEndTag(s)):YPe(o,s)}function HKn(o,s){switch(s.tagID){case dt.BASE:case dt.BASEFONT:case dt.BGSOUND:case dt.LINK:case dt.META:case dt.NOFRAMES:case dt.SCRIPT:case dt.STYLE:case dt.TEMPLATE:case dt.TITLE:{s5(o,s);break}case dt.CAPTION:case dt.COLGROUP:case dt.TBODY:case dt.TFOOT:case dt.THEAD:{o.tmplInsertionModeStack[0]=Qe.IN_TABLE,o.insertionMode=Qe.IN_TABLE,n$(o,s);break}case dt.COL:{o.tmplInsertionModeStack[0]=Qe.IN_COLUMN_GROUP,o.insertionMode=Qe.IN_COLUMN_GROUP,z$t(o,s);break}case dt.TR:{o.tmplInsertionModeStack[0]=Qe.IN_TABLE_BODY,o.insertionMode=Qe.IN_TABLE_BODY,g2t(o,s);break}case dt.TD:case dt.TH:{o.tmplInsertionModeStack[0]=Qe.IN_ROW,o.insertionMode=Qe.IN_ROW,b2t(o,s);break}default:o.tmplInsertionModeStack[0]=Qe.IN_BODY,o.insertionMode=Qe.IN_BODY,Sb(o,s)}}function zKn(o,s){s.tagID===dt.TEMPLATE&&EP(o,s)}function VPe(o,s){o.openElements.tmplCount>0?(o.openElements.popUntilTagNamePopped(dt.TEMPLATE),o.activeFormattingElements.clearToLastMarker(),o.tmplInsertionModeStack.shift(),o._resetInsertionMode(),o.onEof(s)):H$t(o,s)}function UKn(o,s){s.tagID===dt.HTML?Sb(o,s):Dmt(o,s)}function XPe(o,s){var p;if(s.tagID===dt.HTML){if(o.fragmentContext||(o.insertionMode=Qe.AFTER_AFTER_BODY),o.options.sourceCodeLocationInfo&&o.openElements.tagIDs[0]===dt.HTML){o._setEndLocation(o.openElements.items[0],s);const y=o.openElements.items[1];y&&!(!((p=o.treeAdapter.getNodeSourceCodeLocation(y))===null||p===void 0)&&p.endTag)&&o._setEndLocation(y,s)}}else Dmt(o,s)}function Dmt(o,s){o.insertionMode=Qe.IN_BODY,d2t(o,s)}function qKn(o,s){switch(s.tagID){case dt.HTML:{Sb(o,s);break}case dt.FRAMESET:{o._insertElement(s,Di.HTML);break}case dt.FRAME:{o._appendElement(s,Di.HTML),s.ackSelfClosing=!0;break}case dt.NOFRAMES:{s5(o,s);break}}}function WKn(o,s){s.tagID===dt.FRAMESET&&!o.openElements.isRootHtmlElementCurrent()&&(o.openElements.pop(),!o.fragmentContext&&o.openElements.currentTagId!==dt.FRAMESET&&(o.insertionMode=Qe.AFTER_FRAMESET))}function KKn(o,s){switch(s.tagID){case dt.HTML:{Sb(o,s);break}case dt.NOFRAMES:{s5(o,s);break}}}function GKn(o,s){s.tagID===dt.HTML&&(o.insertionMode=Qe.AFTER_AFTER_FRAMESET)}function YKn(o,s){s.tagID===dt.HTML?Sb(o,s):emt(o,s)}function emt(o,s){o.insertionMode=Qe.IN_BODY,d2t(o,s)}function VKn(o,s){switch(s.tagID){case dt.HTML:{Sb(o,s);break}case dt.NOFRAMES:{s5(o,s);break}}}function XKn(o,s){s.chars=Vf,o._insertCharacters(s)}function QKn(o,s){o._insertCharacters(s),o.framesetOk=!1}function QPe(o){for(;o.treeAdapter.getNamespaceURI(o.openElements.current)!==Di.HTML&&!o._isIntegrationPoint(o.openElements.currentTagId,o.openElements.current);)o.openElements.pop()}function JKn(o,s){if(dWn(s))QPe(o),o._startTagOutsideForeignContent(s);else{const p=o._getAdjustedCurrentElement(),y=o.treeAdapter.getNamespaceURI(p);y===Di.MATHML?MPe(s):y===Di.SVG&&(pWn(s),RPe(s)),$$t(s),s.selfClosing?o._appendElement(s,y):o._insertElement(s,y),s.ackSelfClosing=!0}}function ZKn(o,s){if(s.tagID===dt.P||s.tagID===dt.BR){QPe(o),o._endTagOutsideForeignContent(s);return}for(let p=o.openElements.stackTop;p>0;p--){const y=o.openElements.items[p];if(o.treeAdapter.getNamespaceURI(y)===Di.HTML){o._endTagOutsideForeignContent(s);break}const C=o.treeAdapter.getTagName(y);if(C.toLowerCase()===s.tagName){s.tagName=C,o.openElements.shortenToLength(p);break}}}tr.AREA,tr.BASE,tr.BASEFONT,tr.BGSOUND,tr.BR,tr.COL,tr.EMBED,tr.FRAME,tr.HR,tr.IMG,tr.INPUT,tr.KEYGEN,tr.LINK,tr.META,tr.PARAM,tr.SOURCE,tr.TRACK,tr.WBR;const tGn=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,eGn=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),IAe={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function JPe(o,s){const p=hGn(o),y=B$t("type",{handlers:{root:nGn,element:rGn,text:iGn,comment:tLe,doctype:aGn,raw:oGn},unknown:cGn}),C={parser:p?new SAe(IAe):SAe.getFragmentParser(void 0,IAe),handle(z){y(z,C)},stitches:!1,options:s||{}};y(o,C),g$(C,P6());const N=p?C.parser.document:C.parser.getFragment(),L=rqn(N,{file:C.options.file});return C.stitches&&L$t(L,"comment",function(z,G,q){const et=z;if(et.value.stitch&&q&&G!==void 0){const tt=q.children;return tt[G]=et.value.stitch,G}}),L.type==="root"&&L.children.length===1&&L.children[0].type===o.type?L.children[0]:L}function ZPe(o,s){let p=-1;if(o)for(;++p<o.length;)s.handle(o[p])}function nGn(o,s){ZPe(o.children,s)}function rGn(o,s){uGn(o,s),ZPe(o.children,s),lGn(o,s)}function iGn(o,s){s.parser.tokenizer.state>4&&(s.parser.tokenizer.state=0);const p={type:ku.CHARACTER,chars:o.value,location:cJ(o)};g$(s,P6(o)),s.parser.currentToken=p,s.parser._processToken(s.parser.currentToken)}function aGn(o,s){const p={type:ku.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:cJ(o)};g$(s,P6(o)),s.parser.currentToken=p,s.parser._processToken(s.parser.currentToken)}function sGn(o,s){s.stitches=!0;const p=fGn(o);if("children"in o&&"children"in p){const y=JPe({type:"root",children:o.children},s.options);p.children=y.children}tLe({type:"comment",value:{stitch:p}},s)}function tLe(o,s){const p=o.value,y={type:ku.COMMENT,data:p,location:cJ(o)};g$(s,P6(o)),s.parser.currentToken=y,s.parser._processToken(s.parser.currentToken)}function oGn(o,s){if(s.parser.tokenizer.preprocessor.html="",s.parser.tokenizer.preprocessor.pos=-1,s.parser.tokenizer.preprocessor.lastGapPos=-2,s.parser.tokenizer.preprocessor.gapStack=[],s.parser.tokenizer.preprocessor.skipNextNewLine=!1,s.parser.tokenizer.preprocessor.lastChunkWritten=!1,s.parser.tokenizer.preprocessor.endOfChunkHit=!1,s.parser.tokenizer.preprocessor.isEol=!1,eLe(s,P6(o)),s.parser.tokenizer.write(s.options.tagfilter?o.value.replace(tGn,"<$1$2"):o.value,!1),s.parser.tokenizer._runParsingLoop(),s.parser.tokenizer.state===72||s.parser.tokenizer.state===78){s.parser.tokenizer.preprocessor.lastChunkWritten=!0;const p=s.parser.tokenizer._consume();s.parser.tokenizer._callState(p)}}function cGn(o,s){const p=o;if(s.options.passThrough&&s.options.passThrough.includes(p.type))sGn(p,s);else{let y="";throw eGn.has(p.type)&&(y=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+p.type+"` node"+y)}}function g$(o,s){eLe(o,s);const p=o.parser.tokenizer.currentCharacterToken;p&&p.location&&(p.location.endLine=o.parser.tokenizer.preprocessor.line,p.location.endCol=o.parser.tokenizer.preprocessor.col+1,p.location.endOffset=o.parser.tokenizer.preprocessor.offset+1,o.parser.currentToken=p,o.parser._processToken(o.parser.currentToken)),o.parser.tokenizer.paused=!1,o.parser.tokenizer.inLoop=!1,o.parser.tokenizer.active=!1,o.parser.tokenizer.returnState=N1.DATA,o.parser.tokenizer.charRefCode=-1,o.parser.tokenizer.consumedAfterSnapshot=-1,o.parser.tokenizer.currentLocation=null,o.parser.tokenizer.currentCharacterToken=null,o.parser.tokenizer.currentToken=null,o.parser.tokenizer.currentAttr={name:"",value:""}}function eLe(o,s){if(s&&s.offset!==void 0){const p={startLine:s.line,startCol:s.column,startOffset:s.offset,endLine:-1,endCol:-1,endOffset:-1};o.parser.tokenizer.preprocessor.lineStartPos=-s.column+1,o.parser.tokenizer.preprocessor.droppedBufferSize=s.offset,o.parser.tokenizer.preprocessor.line=s.line,o.parser.tokenizer.currentLocation=p}}function uGn(o,s){const p=o.tagName.toLowerCase();if(s.parser.tokenizer.state===N1.PLAINTEXT)return;g$(s,P6(o));const y=s.parser.openElements.current;let C="namespaceURI"in y?y.namespaceURI:fP.html;C===fP.html&&p==="svg"&&(C=fP.svg);const N=yqn({...o,children:[]},{space:C===fP.svg?"svg":"html"}),L={type:ku.START_TAG,tagName:p,tagID:p$(p),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in N?N.attrs:[],location:cJ(o)};s.parser.currentToken=L,s.parser._processToken(s.parser.currentToken),s.parser.tokenizer.lastStartTagName=p}function lGn(o,s){const p=o.tagName.toLowerCase();if(!s.parser.tokenizer.inForeignNode&&_Pe.includes(p)||s.parser.tokenizer.state===N1.PLAINTEXT)return;g$(s,u2t(o));const y={type:ku.END_TAG,tagName:p,tagID:p$(p),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:cJ(o)};s.parser.currentToken=y,s.parser._processToken(s.parser.currentToken),p===s.parser.tokenizer.lastStartTagName&&(s.parser.tokenizer.state===N1.RCDATA||s.parser.tokenizer.state===N1.RAWTEXT||s.parser.tokenizer.state===N1.SCRIPT_DATA)&&(s.parser.tokenizer.state=N1.DATA)}function hGn(o){const s=o.type==="root"?o.children[0]:o;return!!(s&&(s.type==="doctype"||s.type==="element"&&s.tagName.toLowerCase()==="html"))}function cJ(o){const s=P6(o)||{line:void 0,column:void 0,offset:void 0},p=u2t(o)||{line:void 0,column:void 0,offset:void 0};return{startLine:s.line,startCol:s.column,startOffset:s.offset,endLine:p.line,endCol:p.column,endOffset:p.offset}}function fGn(o){return"children"in o?e$({...o,children:[]}):e$(o)}function dGn(o){return function(s,p){return JPe(s,{...o,file:p})}}const pGn=/["&'<>`]/g,gGn=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,bGn=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,mGn=/[|\\{}()[\]^$+*?.]/g,OAe=new WeakMap;function yGn(o,s){if(o=o.replace(s.subset?wGn(s.subset):pGn,y),s.subset||s.escapeOnly)return o;return o.replace(gGn,p).replace(bGn,y);function p(C,N,L){return s.format((C.charCodeAt(0)-55296)*1024+C.charCodeAt(1)-56320+65536,L.charCodeAt(N+2),s)}function y(C,N,L){return s.format(C.charCodeAt(0),L.charCodeAt(N+1),s)}}function wGn(o){let s=OAe.get(o);return s||(s=vGn(o),OAe.set(o,s)),s}function vGn(o){const s=[];let p=-1;for(;++p<o.length;)s.push(o[p].replace(mGn,"\\$&"));return new RegExp("(?:"+s.join("|")+")","g")}const _Gn=/[\dA-Fa-f]/;function xGn(o,s,p){const y="&#x"+o.toString(16).toUpperCase();return p&&s&&!_Gn.test(String.fromCharCode(s))?y:y+";"}const EGn=/\d/;function TGn(o,s,p){const y="&#"+String(o);return p&&s&&!EGn.test(String.fromCharCode(s))?y:y+";"}const kGn=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],gBt={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},SGn=["cent","copy","divide","gt","lt","not","para","times"],nLe={}.hasOwnProperty,AFt={};let jbt;for(jbt in gBt)nLe.call(gBt,jbt)&&(AFt[gBt[jbt]]=jbt);const CGn=/[^\dA-Za-z]/;function AGn(o,s,p,y){const C=String.fromCharCode(o);if(nLe.call(AFt,C)){const N=AFt[C],L="&"+N;return p&&kGn.includes(N)&&!SGn.includes(N)&&(!y||s&&s!==61&&CGn.test(String.fromCharCode(s)))?L:L+";"}return""}function IGn(o,s,p){let y=xGn(o,s,p.omitOptionalSemicolons),C;if((p.useNamedReferences||p.useShortestReferences)&&(C=AGn(o,s,p.omitOptionalSemicolons,p.attribute)),(p.useShortestReferences||!C)&&p.useShortestReferences){const N=TGn(o,s,p.omitOptionalSemicolons);N.length<y.length&&(y=N)}return C&&(!p.useShortestReferences||C.length<y.length)?C:y}function KF(o,s){return yGn(o,Object.assign({format:IGn},s))}const OGn=/^>|^->|<!--|-->|--!>|<!-$/g,NGn=[">"],PGn=["<",">"];function LGn(o,s,p,y){return y.settings.bogusComments?"<?"+KF(o.value,Object.assign({},y.settings.characterReferences,{subset:NGn}))+">":"<!--"+o.value.replace(OGn,C)+"-->";function C(N){return KF(N,Object.assign({},y.settings.characterReferences,{subset:PGn}))}}function MGn(o,s,p,y){return"<!"+(y.settings.upperDoctype?"DOCTYPE":"doctype")+(y.settings.tightDoctype?"":" ")+"html>"}function NAe(o,s){const p=String(o);if(typeof s!="string")throw new TypeError("Expected character");let y=0,C=p.indexOf(s);for(;C!==-1;)y++,C=p.indexOf(s,C+s.length);return y}const ip=iLe(1),rLe=iLe(-1),RGn=[];function iLe(o){return s;function s(p,y,C){const N=p?p.children:RGn;let L=(y||0)+o,z=N[L];if(!C)for(;z&&s2t(z);)L+=o,z=N[L];return z}}const DGn={}.hasOwnProperty;function aLe(o){return s;function s(p,y,C){return DGn.call(o,p.tagName)&&o[p.tagName](p,y,C)}}const U$t=aLe({body:FGn,caption:bBt,colgroup:bBt,dd:zGn,dt:HGn,head:bBt,html:BGn,li:jGn,optgroup:UGn,option:qGn,p:$Gn,rp:PAe,rt:PAe,tbody:KGn,td:LAe,tfoot:GGn,th:LAe,thead:WGn,tr:YGn});function bBt(o,s,p){const y=ip(p,s,!0);return!y||y.type!=="comment"&&!(y.type==="text"&&s2t(y.value.charAt(0)))}function BGn(o,s,p){const y=ip(p,s);return!y||y.type!=="comment"}function FGn(o,s,p){const y=ip(p,s);return!y||y.type!=="comment"}function $Gn(o,s,p){const y=ip(p,s);return y?y.type==="element"&&(y.tagName==="address"||y.tagName==="article"||y.tagName==="aside"||y.tagName==="blockquote"||y.tagName==="details"||y.tagName==="div"||y.tagName==="dl"||y.tagName==="fieldset"||y.tagName==="figcaption"||y.tagName==="figure"||y.tagName==="footer"||y.tagName==="form"||y.tagName==="h1"||y.tagName==="h2"||y.tagName==="h3"||y.tagName==="h4"||y.tagName==="h5"||y.tagName==="h6"||y.tagName==="header"||y.tagName==="hgroup"||y.tagName==="hr"||y.tagName==="main"||y.tagName==="menu"||y.tagName==="nav"||y.tagName==="ol"||y.tagName==="p"||y.tagName==="pre"||y.tagName==="section"||y.tagName==="table"||y.tagName==="ul"):!p||!(p.type==="element"&&(p.tagName==="a"||p.tagName==="audio"||p.tagName==="del"||p.tagName==="ins"||p.tagName==="map"||p.tagName==="noscript"||p.tagName==="video"))}function jGn(o,s,p){const y=ip(p,s);return!y||y.type==="element"&&y.tagName==="li"}function HGn(o,s,p){const y=ip(p,s);return!!(y&&y.type==="element"&&(y.tagName==="dt"||y.tagName==="dd"))}function zGn(o,s,p){const y=ip(p,s);return!y||y.type==="element"&&(y.tagName==="dt"||y.tagName==="dd")}function PAe(o,s,p){const y=ip(p,s);return!y||y.type==="element"&&(y.tagName==="rp"||y.tagName==="rt")}function UGn(o,s,p){const y=ip(p,s);return!y||y.type==="element"&&y.tagName==="optgroup"}function qGn(o,s,p){const y=ip(p,s);return!y||y.type==="element"&&(y.tagName==="option"||y.tagName==="optgroup")}function WGn(o,s,p){const y=ip(p,s);return!!(y&&y.type==="element"&&(y.tagName==="tbody"||y.tagName==="tfoot"))}function KGn(o,s,p){const y=ip(p,s);return!y||y.type==="element"&&(y.tagName==="tbody"||y.tagName==="tfoot")}function GGn(o,s,p){return!ip(p,s)}function YGn(o,s,p){const y=ip(p,s);return!y||y.type==="element"&&y.tagName==="tr"}function LAe(o,s,p){const y=ip(p,s);return!y||y.type==="element"&&(y.tagName==="td"||y.tagName==="th")}const VGn=aLe({body:JGn,colgroup:ZGn,head:QGn,html:XGn,tbody:tYn});function XGn(o){const s=ip(o,-1);return!s||s.type!=="comment"}function QGn(o){const s=new Set;for(const y of o.children)if(y.type==="element"&&(y.tagName==="base"||y.tagName==="title")){if(s.has(y.tagName))return!1;s.add(y.tagName)}const p=o.children[0];return!p||p.type==="element"}function JGn(o){const s=ip(o,-1,!0);return!s||s.type!=="comment"&&!(s.type==="text"&&s2t(s.value.charAt(0)))&&!(s.type==="element"&&(s.tagName==="meta"||s.tagName==="link"||s.tagName==="script"||s.tagName==="style"||s.tagName==="template"))}function ZGn(o,s,p){const y=rLe(p,s),C=ip(o,-1,!0);return p&&y&&y.type==="element"&&y.tagName==="colgroup"&&U$t(y,p.children.indexOf(y),p)?!1:!!(C&&C.type==="element"&&C.tagName==="col")}function tYn(o,s,p){const y=rLe(p,s),C=ip(o,-1);return p&&y&&y.type==="element"&&(y.tagName==="thead"||y.tagName==="tbody")&&U$t(y,p.children.indexOf(y),p)?!1:!!(C&&C.type==="element"&&C.tagName==="tr")}const Hbt={name:[[`
|
|
1856
1859
|
\f\r &/=>`.split(""),`
|
|
1857
1860
|
\f\r "&'/=>\``.split("")],[`\0
|
|
1858
1861
|
\f\r "&'/<=>`.split(""),`\0
|
|
@@ -1860,7 +1863,7 @@ https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety
|
|
|
1860
1863
|
\f\r &>`.split(""),`\0
|
|
1861
1864
|
\f\r "&'<=>\``.split("")],[`\0
|
|
1862
1865
|
\f\r "&'<=>\``.split(""),`\0
|
|
1863
|
-
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function
|
|
1866
|
+
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function eYn(o,s,p,y){const C=y.schema,N=C.space==="svg"?!1:y.settings.omitOptionalTags;let L=C.space==="svg"?y.settings.closeEmptyElements:y.settings.voids.includes(o.tagName.toLowerCase());const z=[];let G;C.space==="html"&&o.tagName==="svg"&&(y.schema=xC);const q=nYn(y,o.properties),et=y.all(C.space==="html"&&o.tagName==="template"?o.content:o);return y.schema=C,et&&(L=!1),(q||!N||!VGn(o,s,p))&&(z.push("<",o.tagName,q?" "+q:""),L&&(C.space==="svg"||y.settings.closeSelfClosing)&&(G=q.charAt(q.length-1),(!y.settings.tightSelfClosing||G==="/"||G&&G!=='"'&&G!=="'")&&z.push(" "),z.push("/")),z.push(">")),z.push(et),!L&&(!N||!U$t(o,s,p))&&z.push("</"+o.tagName+">"),z.join("")}function nYn(o,s){const p=[];let y=-1,C;if(s){for(C in s)if(s[C]!==null&&s[C]!==void 0){const N=rYn(o,C,s[C]);N&&p.push(N)}}for(;++y<p.length;){const N=o.settings.tightAttributes?p[y].charAt(p[y].length-1):void 0;y!==p.length-1&&N!=='"'&&N!=="'"&&(p[y]+=" ")}return p.join("")}function rYn(o,s,p){const y=o2t(o.schema,s),C=o.settings.allowParseErrors&&o.schema.space==="html"?0:1,N=o.settings.allowDangerousCharacters?0:1;let L=o.quote,z;if(y.overloadedBoolean&&(p===y.attribute||p==="")?p=!0:(y.boolean||y.overloadedBoolean)&&(typeof p!="string"||p===y.attribute||p==="")&&(p=!!p),p==null||p===!1||typeof p=="number"&&Number.isNaN(p))return"";const G=KF(y.attribute,Object.assign({},o.settings.characterReferences,{subset:Hbt.name[C][N]}));return p===!0||(p=Array.isArray(p)?(y.commaSeparated?w$t:_$t)(p,{padLeft:!o.settings.tightCommaSeparatedLists}):String(p),o.settings.collapseEmptyAttributes&&!p)?G:(o.settings.preferUnquoted&&(z=KF(p,Object.assign({},o.settings.characterReferences,{attribute:!0,subset:Hbt.unquoted[C][N]}))),z!==p&&(o.settings.quoteSmart&&NAe(p,L)>NAe(p,o.alternative)&&(L=o.alternative),z=L+KF(p,Object.assign({},o.settings.characterReferences,{subset:(L==="'"?Hbt.single:Hbt.double)[C][N],attribute:!0}))+L),G+(z&&"="+z))}const iYn=["<","&"];function sLe(o,s,p,y){return p&&p.type==="element"&&(p.tagName==="script"||p.tagName==="style")?o.value:KF(o.value,Object.assign({},y.settings.characterReferences,{subset:iYn}))}function aYn(o,s,p,y){return y.settings.allowDangerousHtml?o.value:sLe(o,s,p,y)}function sYn(o,s,p,y){return y.all(o)}const oYn=B$t("type",{invalid:cYn,unknown:uYn,handlers:{comment:LGn,doctype:MGn,element:eYn,raw:aYn,root:sYn,text:sLe}});function cYn(o){throw new Error("Expected node, not `"+o+"`")}function uYn(o){const s=o;throw new Error("Cannot compile unknown node `"+s.type+"`")}const lYn={},hYn={},fYn=[];function dYn(o,s){const p=s||lYn,y=p.quote||'"',C=y==='"'?"'":'"';if(y!=='"'&&y!=="'")throw new Error("Invalid quote `"+y+"`, expected `'` or `\"`");return{one:pYn,all:gYn,settings:{omitOptionalTags:p.omitOptionalTags||!1,allowParseErrors:p.allowParseErrors||!1,allowDangerousCharacters:p.allowDangerousCharacters||!1,quoteSmart:p.quoteSmart||!1,preferUnquoted:p.preferUnquoted||!1,tightAttributes:p.tightAttributes||!1,upperDoctype:p.upperDoctype||!1,tightDoctype:p.tightDoctype||!1,bogusComments:p.bogusComments||!1,tightCommaSeparatedLists:p.tightCommaSeparatedLists||!1,tightSelfClosing:p.tightSelfClosing||!1,collapseEmptyAttributes:p.collapseEmptyAttributes||!1,allowDangerousHtml:p.allowDangerousHtml||!1,voids:p.voids||_Pe,characterReferences:p.characterReferences||hYn,closeSelfClosing:p.closeSelfClosing||!1,closeEmptyElements:p.closeEmptyElements||!1},schema:p.space==="svg"?xC:iJ,quote:y,alternative:C}.one(Array.isArray(o)?{type:"root",children:o}:o,void 0,void 0)}function pYn(o,s,p){return oYn(o,s,p,this)}function gYn(o){const s=[],p=o&&o.children||fYn;let y=-1;for(;++y<p.length;)s[y]=this.one(p[y],y,o);return s.join("")}function bYn(o){const s=this,p={...s.data("settings"),...o};s.compiler=y;function y(C){return dYn(C,p)}}var oLe={};const cLe=function(o){if(o==null)return vYn;if(typeof o=="string")return wYn(o);if(typeof o=="object")return Array.isArray(o)?mYn(o):yYn(o);if(typeof o=="function")return m2t(o);throw new Error("Expected function, string, or object as test")};function mYn(o){const s=[];let p=-1;for(;++p<o.length;)s[p]=cLe(o[p]);return m2t(y);function y(...C){let N=-1;for(;++N<s.length;)if(s[N].call(this,...C))return!0;return!1}}function yYn(o){return m2t(s);function s(p){let y;for(y in o)if(p[y]!==o[y])return!1;return!0}}function wYn(o){return m2t(s);function s(p){return p&&p.type===o}}function m2t(o){return s;function s(p,...y){return!!(p&&typeof p=="object"&&"type"in p&&o.call(this,p,...y))}}function vYn(){return!0}const uLe=!0,IFt=!1,lLe="skip",_Yn=function(o,s,p,y){typeof s=="function"&&typeof p!="function"&&(y=p,p=s,s=null);const C=cLe(s),N=y?-1:1;L(o,void 0,[])();function L(z,G,q){const et=z&&typeof z=="object"?z:{};if(typeof et.type=="string"){const nt=typeof et.tagName=="string"?et.tagName:typeof et.name=="string"?et.name:void 0;Object.defineProperty(tt,"name",{value:"node ("+(z.type+(nt?"<"+nt+">":""))+")"})}return tt;function tt(){let nt=[],st,at,Ot;if((!s||C(z,G,q[q.length-1]||null))&&(nt=xYn(p(z,q)),nt[0]===IFt))return nt;if(z.children&&nt[0]!==lLe)for(at=(y?z.children.length:-1)+N,Ot=q.concat(z);at>-1&&at<z.children.length;){if(st=L(z.children[at],at,Ot)(),st[0]===IFt)return st;at=typeof st[1]=="number"?st[1]:at+N}return nt}}};function xYn(o){return Array.isArray(o)?o:typeof o=="number"?[uLe,o]:[o]}const EYn=function(o,s,p,y){typeof s=="function"&&typeof p!="function"&&(y=p,p=s,s=null),_Yn(o,s,C,y);function C(N,L){const z=L[L.length-1];return p(N,z?z.children.indexOf(N):null,z)}},TYn=Object.freeze(Object.defineProperty({__proto__:null,CONTINUE:uLe,EXIT:IFt,SKIP:lLe,visit:EYn},Symbol.toStringTag,{value:"Module"})),kYn=rOn(TYn);var Bmt={exports:{}};Bmt.exports;(function(o,s){(function(p,y){o.exports=y()})(Cw,function(){function p(i){for(var l=[],b=1;b<arguments.length;b++)l[b-1]=arguments[b];var v=Array.from(typeof i=="string"?[i]:i);v[v.length-1]=v[v.length-1].replace(/\r?\n([\t ]*)$/,"");var E=v.reduce(function(I,P){var $=P.match(/\n([\t ]+|(?!\s).)/g);return $?I.concat($.map(function(W){var K,Z;return(Z=(K=W.match(/[\t ]/g))===null||K===void 0?void 0:K.length)!==null&&Z!==void 0?Z:0})):I},[]);if(E.length){var T=new RegExp(`
|
|
1864
1867
|
[ ]{`+Math.min.apply(Math,E)+"}","g");v=v.map(function(I){return I.replace(T,`
|
|
1865
1868
|
`)})}v[0]=v[0].replace(/^\r?\n/,"");var _=v[0];return l.forEach(function(I,P){var $=_.match(/(?:^|\n)( *)$/),W=$?$[1]:"",K=I;typeof I=="string"&&I.includes(`
|
|
1866
1869
|
`)&&(K=String(I).split(`
|
|
@@ -3438,6 +3441,6 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
|
|
|
3438
3441
|
.edge {
|
|
3439
3442
|
fill: none;
|
|
3440
3443
|
}
|
|
3441
|
-
`}},Symbol.toStringTag,{value:"Module"}));return Bw})})(Bmt,Bmt.exports);var
|
|
3444
|
+
`}},Symbol.toStringTag,{value:"Module"}));return Bw})})(Bmt,Bmt.exports);var SYn=Bmt.exports,CYn=Cw&&Cw.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(oLe,"__esModule",{value:!0});var AYn=kYn,MAe=CYn(SYn),IYn=function(s){var p=s===void 0?{}:s,y=p.theme,C=y===void 0?"default":y;return function(N){var L=[];if((0,AYn.visit)(N,{type:"code",lang:"mermaid"},function(G,q,et){L.push([G.value,q,et])}),!L.length)return N;var z=L.map(function(G){var q=G[0],et="mermaid"+Math.random().toString(36).slice(2);MAe.default.initialize({theme:C});var tt=document.createElement("div");return tt.innerHTML='<pre><code class="hljs language-mermaid">'.concat(MAe.default.render(et,q),"</code></pre>"),tt.innerHTML});L.forEach(function(G,q){var et=G[1],tt=G[2],nt=z[q];tt.children.splice(et,1,{type:"html",value:nt})})}},OYn=oLe.default=IYn;function C6(o){return le.jsx(zUn,{remarkPlugins:[OYn],rehypePlugins:[dGn,bYn],components:{img:({...s})=>le.jsx("img",{...s,style:{display:"block",maxWidth:"100%",height:"auto"}})},children:o.children})}function NYn({prompt:o}){return le.jsx("div",{style:{display:"flex",justifyContent:"flex-start"},children:le.jsx(JQ,{elevation:3,style:{marginTop:15,marginBottom:15,marginRight:"15%",textAlign:"left"},children:le.jsxs(bP,{children:[le.jsx(QQ,{icon:le.jsx(SNe,{}),label:"Assistant",variant:"outlined",color:"success"}),le.jsx(C6,{children:o.text})]})})})}const hLe=a5(le.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");function PYn({execute:o}){return le.jsxs(uP.Fragment,{children:[le.jsxs(A3,{variant:"h5",children:[" ",LYn(o)," "]}),le.jsx("hr",{}),le.jsx(A3,{variant:"h6",children:" Description "}),le.jsx(C6,{children:o.operation.function.description}),le.jsx("br",{}),le.jsx(A3,{variant:"h6",children:" Arguments "}),le.jsx(C6,{children:["```json",JSON.stringify(o.arguments,null,2),"```"].join(`
|
|
3442
3445
|
`)}),le.jsx("br",{}),le.jsx(A3,{variant:"h6",children:" Return Value "}),le.jsx(C6,{children:["```json",JSON.stringify(o.value,null,2),"```"].join(`
|
|
3443
|
-
`)})]})}function PYn(o){return o.operation.protocol==="http"?`${o.operation.function.method.toUpperCase()} ${o.operation.function.path}`:o.operation.function.name}function LYn({history:o}){const[s,p]=hn.useState(!1);return le.jsxs(JQ,{elevation:3,style:{marginTop:15,marginBottom:15,marginRight:"15%"},children:[le.jsxs(bP,{children:[le.jsx(QQ,{label:"Function Describer",variant:"outlined",color:"secondary"}),le.jsx(C6,{children:o.text})]}),le.jsx(nIe,{style:{textAlign:"right"},children:le.jsx(rmt,{startIcon:le.jsx(hLe,{style:{transform:`rotate(${s?180:0}deg)`}}),onClick:()=>p(!s),children:s?"Hide Function Calls":"Show Function Calls"})}),le.jsx(HQ,{in:s,timeout:"auto",unmountOnExit:!0,children:le.jsx(bP,{children:o.executes.map(y=>le.jsx(NYn,{execute:y}))})})]})}const MYn=a5(le.jsx("path",{d:"M4 7h16v2H4zm0 6h16v-2H4zm0 4h7v-2H4zm0 4h7v-2H4zm11.41-2.83L14 16.75l-1.41 1.41L15.41 21 20 16.42 18.58 15zM4 3v2h16V3z"}),"Grading");function RYn({selection:o}){const[s,p]=hn.useState(!1);return le.jsxs(JQ,{elevation:3,style:{marginTop:15,marginBottom:15,marginRight:"15%"},children:[le.jsxs(bP,{children:[le.jsx(QQ,{icon:le.jsx(MYn,{}),label:"Function Selector",variant:"outlined",color:"warning"}),le.jsx("br",{}),le.jsx("br",{}),"Operation:",o.operation.protocol==="http"?le.jsxs("ul",{children:[le.jsx("li",{children:o.operation.function.method.toUpperCase()}),le.jsx("li",{children:o.operation.function.path})]}):le.jsx("ul",{children:le.jsx("li",{children:o.operation.function.name})}),le.jsx(C6,{children:o.reason})]}),le.jsx(nIe,{style:{textAlign:"right"},children:le.jsx(rmt,{onClick:()=>p(!s),children:s?"Hide Function Description":"Show Function Description"})}),le.jsx(HQ,{in:s,timeout:"auto",unmountOnExit:!0,children:le.jsx(bP,{children:le.jsx(C6,{children:o.operation.function.description})})})]})}function DYn({prompt:o}){return le.jsx("div",{style:{display:"flex",justifyContent:"flex-start"},children:le.jsx(JQ,{elevation:3,style:{marginTop:15,marginBottom:15,marginRight:"15%",textAlign:"left"},children:le.jsxs(bP,{children:[le.jsx(QQ,{icon:le.jsx(SNe,{}),label:"System",variant:"outlined",color:"success"}),le.jsx(C6,{children:o.text})]})})})}const BYn=a5(le.jsx("path",{d:"M9 11.75c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25m6 0c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8 0-.29.02-.58.05-.86 2.36-1.05 4.23-2.98 5.21-5.37C11.07 8.33 14.05 10 17.42 10c.78 0 1.53-.09 2.25-.26.21.71.33 1.47.33 2.26 0 4.41-3.59 8-8 8"}),"Face");function FYn({prompt:o}){return le.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:o.contents.map((s,p)=>s.type==="text"?le.jsx(JQ,{elevation:3,style:{marginTop:15,marginBottom:15,marginLeft:"15%",textAlign:"right",backgroundColor:"lightyellow"},children:le.jsxs(bP,{children:[le.jsx(QQ,{icon:le.jsx(BYn,{}),label:"User",variant:"outlined",color:"primary"}),le.jsx(C6,{children:s.text})]})},p):null)})}function $Yn({prompt:o}){return o.type==="assistantMessage"?le.jsx(OYn,{prompt:o}):o.type==="select"?le.jsx(RYn,{selection:o.selection}):o.type==="describe"?le.jsx(LYn,{history:o}):o.type==="cancel"||o.type==="execute"?null:o.type==="userMessage"?le.jsx(FYn,{prompt:o}):o.type==="systemMessage"?le.jsx(DYn,{prompt:o}):null}function jYn(o){return le.jsxs(uP.Fragment,{children:[le.jsx(A3,{variant:"h5",children:" Function Stack "}),le.jsx("hr",{}),o.selections.map(s=>le.jsxs(NOn,{children:[le.jsx(HOn,{expandIcon:le.jsx(hLe,{}),children:le.jsx(A3,{component:"h6",children:s.operation.protocol==="http"?`${s.operation.function.method.toUpperCase()} ${s.operation.function.path}`:s.operation.function.name})}),le.jsxs(ROn,{children:[le.jsx("hr",{}),s.reason,le.jsx("br",{}),le.jsx("br",{}),le.jsx(C6,{children:s.operation.function.description})]})]}))]})}function HYn(o){const s=zYn(o.usage);return le.jsxs(uP.Fragment,{children:[le.jsx(A3,{variant:"h5",children:" Token Usage "}),le.jsx("hr",{}),le.jsxs(tMn,{children:[le.jsx(pMn,{children:le.jsxs(kbt,{children:[le.jsx(k3,{children:"Type"}),le.jsx(k3,{children:"Token Usage"}),le.jsx(k3,{children:"Price"})]})}),le.jsxs(aMn,{children:[le.jsxs(kbt,{children:[le.jsx(k3,{children:"Total"}),le.jsx(k3,{children:o.usage.aggregate.total.toLocaleString()}),le.jsxs(k3,{children:["$",s.total.toLocaleString()]})]}),le.jsxs(kbt,{children:[le.jsx(k3,{children:"Input"}),le.jsx(k3,{children:o.usage.aggregate.input.total.toLocaleString()}),le.jsxs(k3,{children:["$",s.prompt.toLocaleString()]})]}),le.jsxs(kbt,{children:[le.jsx(k3,{children:"Output"}),le.jsx(k3,{children:o.usage.aggregate.output.total.toLocaleString()}),le.jsxs(k3,{children:["$",s.completion.toLocaleString()]})]})]})]})]})}function zYn(o){const s=(o.aggregate.input.total-o.aggregate.input.cached)*25e-7+o.aggregate.input.cached*125e-8,p=o.aggregate.output.total*(10/1e6);return{total:s+p,prompt:s,completion:p}}function UYn(o){var s,p;return le.jsxs("div",{style:{padding:25},children:[o.error!==null?le.jsxs(le.Fragment,{children:[le.jsx(A3,{variant:"h5",color:"error",children:"OpenAI Error"}),le.jsx("hr",{}),o.error.message,le.jsx("br",{}),le.jsx("br",{}),"Your OpenAI API key may not valid.",le.jsx("br",{}),le.jsx("br",{}),le.jsx("br",{})]}):null,le.jsx(A3,{variant:"h5",children:"Agent Information"}),le.jsx("hr",{}),le.jsxs("ul",{children:[le.jsxs("li",{children:["Model:"," ",o.vendor.model]}),le.jsxs("li",{children:["Locale:"," ",((s=o.config)==null?void 0:s.locale)??navigator.language]}),le.jsxs("li",{children:["Timezone:"," ",((p=o.config)==null?void 0:p.timezone)??Intl.DateTimeFormat().resolvedOptions().timeZone]})]}),le.jsx("br",{}),le.jsx("br",{}),le.jsx(HYn,{usage:o.usage}),le.jsx("br",{}),le.jsx("br",{}),le.jsx(jYn,{selections:o.selections})]})}const RAe=450;function qYn({agent:o,title:s}){const p=hn.useRef(null),y=hn.useRef(null),C=hn.useRef(null),N=hn.useRef(null),L=hn.useRef(null),[z,G]=hn.useState(null),[q,et]=hn.useState(""),[tt,nt]=hn.useState(o.getHistories().slice()),[st,at]=hn.useState(JSON.parse(JSON.stringify(o.getTokenUsage()))),[Ot,Dt]=hn.useState(122),[St,ie]=hn.useState(!0),[ae,Ne]=hn.useState([]),[pn,de]=hn.useState(!1),cn=async Ba=>{nt(Ts=>[...Ts,Ba.toHistory()])},er=async Ba=>{await Ba.join(),nt(Ts=>[...Ts,Ba.toHistory()])},Dn=async Ba=>{await Ba.join(),nt(Ts=>[...Ts,Ba.toHistory()])},jn=Ba=>{nt(Ts=>[...Ts,Ba.toHistory()]),Ne(Ts=>[...Ts,Ba.selection])},or=Ba=>{console.error(Ba)},gr=Ba=>{console.error(Ba)};hn.useEffect(()=>(L.current!==null&&L.current.select(),o.on("assistantMessage",er),o.on("userMessage",cn),o.on("select",jn),o.on("describe",Dn),o.on("validate",or),o.on("jsonParseError",gr),at(o.getTokenUsage()),()=>{o.off("assistantMessage",er),o.off("userMessage",cn),o.off("select",jn),o.off("describe",Dn),o.off("validate",or),o.off("jsonParseError",gr)}),[]);const fi=()=>{setTimeout(()=>{if(p.current===null||y.current===null||C.current===null)return;const Ba=p.current.clientHeight+C.current.clientHeight;Ba!==Ot&&Dt(Ba)})},pi=async()=>{et(""),ie(!1),fi();try{await o.conversate(q)}catch(Ts){Ts instanceof Error?(alert(Ts.message),G(Ts)):G(new Error("Unknown error"));return}tt.splice(0,tt.length),tt.push(...o.getHistories()),nt(tt),at(o.getTokenUsage()),ie(!0);const Ba=o.getHistories().filter(Ts=>Ts.type==="select").map(Ts=>Ts.selection);for(const Ts of o.getHistories().filter(Ke=>Ke.type==="cancel").map(Ke=>Ke.selection)){const Ke=Ba.findIndex(xo=>xo.operation.protocol===Ts.operation.protocol&&xo.operation.controller.name===Ts.operation.controller.name&&xo.operation.function.name===Ts.operation.function.name);Ke!==-1&&Ba.splice(Ke,1)}Ne(Ba)},Or=async Ba=>{Ba.key==="Enter"&&Ba.shiftKey===!1&&(St===!1?Ba.preventDefault():await pi())},di=async()=>{if(N.current===null)return;const Ba=await l$n(N.current,{}),Ts=document.createElement("a");Ts.download="nestia-chat-screenshot.png",Ts.href=Ba,Ts.click(),Ts.remove()},Ea=vP(),Qi=YPn(Ea.breakpoints.down("lg")),li=()=>le.jsx("div",{style:{overflowY:"auto",height:"100%",width:Qi?"100%":`calc(100% - ${RAe}px)`,margin:0,backgroundColor:"lightblue"},children:le.jsx(rCe,{style:{paddingBottom:50,width:"100%",minHeight:"100%",backgroundColor:"lightblue",margin:0},ref:N,children:tt.map((Ba,Ts)=>le.jsx($Yn,{prompt:Ba},Ts)).filter(Ba=>Ba!==null)})}),ze=()=>le.jsx("div",{style:{width:Qi?void 0:RAe,height:"100%",overflowY:"auto",backgroundColor:"#eeeeee"},children:le.jsx(rCe,{maxWidth:!1,onClick:Qi?()=>de(!1):void 0,children:le.jsx(UYn,{vendor:o.getVendor(),config:o.getConfig(),usage:st,selections:ae,error:z})})});return le.jsxs("div",{style:{width:"100%",height:"100%"},children:[le.jsx(XSe,{ref:p,position:"relative",component:"div",children:le.jsxs(_Ce,{children:[le.jsx(A3,{variant:"h6",component:"div",sx:{flexGrow:1},children:s??"Agentica Chatbot"}),Qi?le.jsxs(le.Fragment,{children:[le.jsx(YSe,{onClick:()=>void di().catch(()=>{}),children:le.jsx(l9e,{})}),le.jsx(YSe,{onClick:()=>de(!0),children:le.jsx(bFn,{})})]}):le.jsx(rmt,{color:"inherit",startIcon:le.jsx(l9e,{}),onClick:()=>void di().catch(()=>{}),children:"Screenshot Capture"})]})}),le.jsx("div",{ref:y,style:{width:"100%",height:`calc(100% - ${Ot}px)`,display:"flex",flexDirection:"row"},children:Qi?le.jsxs(le.Fragment,{children:[li(),le.jsx(xPn,{anchor:"right",open:pn,onClose:()=>de(!1),children:ze()})]}):le.jsxs(le.Fragment,{children:[li(),ze()]})}),le.jsx(XSe,{ref:C,position:"static",component:"div",color:"inherit",children:le.jsxs(_Ce,{children:[le.jsx(zmt,{inputRef:L,fullWidth:!0,placeholder:"Conversate with AI Chatbot",value:q,multiline:!0,onKeyUp:Ba=>void Or(Ba).catch(()=>{}),onChange:Ba=>{et(Ba.target.value),fi()}}),le.jsx(rmt,{variant:"contained",style:{marginLeft:10},startIcon:le.jsx(mFn,{}),disabled:!St,onClick:()=>void pi().catch(()=>{}),children:"Send"})]})})]})}function iVn(o){return le.jsx(qYn,{...o})}function DAe(o){const[s,p]=hn.useState(o.config.apiKey),[y,C]=hn.useState(o.config.baseURL===void 0&&(o.config.vendorModel==="gpt-4o"||o.config.vendorModel==="gpt-4o-mini")?o.config.vendorModel:"manual"),[N,L]=hn.useState(o.config.vendorModel),[z,G]=hn.useState(o.config.schemaModel),[q,et]=hn.useState(o.config.baseURL),tt=()=>({schemaModel:z,vendorModel:N,apiKey:s,baseURL:q}),nt=St=>{const ie=tt();ie.apiKey=St,p(St),o.onChange(ie)},st=(St,ie)=>{const ae=tt();C(ie),ie==="gpt-4o"||ie==="gpt-4o-mini"?(ae.vendorModel=ie,ae.baseURL=void 0,ae.schemaModel="chatgpt",et(void 0),L(ie),G("chatgpt")):(ae.baseURL="https://openrouter.ai/api/v1",et("https://openrouter.ai/api/v1")),o.onChange(ae)},at=St=>{const ie=tt();ie.baseURL=St,et(St),o.onChange(ie)},Ot=St=>{const ie=tt();ie.vendorModel=St,L(St),o.onChange(ie)},Dt=St=>{const ie=tt();ie.schemaModel=St,G(St),o.onChange(ie)};return le.jsxs(le.Fragment,{children:[le.jsx($Dt,{onChange:St=>nt(St.target.value),defaultValue:s,label:"OpenAI API Key",variant:"outlined",placeholder:"Your OpenAI API Key",error:s.length===0}),le.jsx("br",{}),le.jsxs(gCe,{defaultValue:y,onChange:st,style:{paddingLeft:15},children:[le.jsx(hk,{control:le.jsx(fk,{}),label:"GPT-4o Mini",value:"gpt-4o-mini"}),le.jsx(hk,{control:le.jsx(fk,{}),label:"GPT-4o",value:"gpt-4o"}),le.jsx(hk,{control:le.jsx(fk,{}),label:"Manual Configuration",value:"manual"})]}),y==="manual"?le.jsxs(le.Fragment,{children:[le.jsx("br",{}),le.jsx($Dt,{fullWidth:!0,label:"Base URL",defaultValue:q,onChange:St=>at(St.target.value)}),le.jsx("br",{}),le.jsx($Dt,{fullWidth:!0,label:"Vendor Model",defaultValue:N,onChange:St=>Ot(St.target.value)}),le.jsx("br",{}),le.jsxs(gCe,{title:"Schema Model",defaultValue:z,onChange:(St,ie)=>Dt(ie),style:{paddingLeft:15},children:[le.jsx(hk,{control:le.jsx(fk,{}),label:"OpenAI ChatGPT",value:"chatgpt"}),le.jsx(hk,{control:le.jsx(fk,{}),label:"Anthropic Claude",value:"claude"}),le.jsx(hk,{control:le.jsx(fk,{}),label:"Google Gemini",value:"gemini"}),le.jsx(hk,{control:le.jsx(fk,{}),label:"Meta Llama",value:"llama"}),le.jsx(hk,{control:le.jsx(fk,{}),label:"OpenAPI v3.0",value:"3.0"}),le.jsx(hk,{control:le.jsx(fk,{}),label:"OpenAPI v3.1",value:"3.1"})]}),le.jsx("br",{})]}):null,le.jsx("br",{})]})}(o=>{function s(){return{schemaModel:"chatgpt",vendorModel:"gpt-4o-mini",apiKey:"",baseURL:void 0}}o.defaultConfig=s})(DAe||(DAe={}));export{QIe as A,rmt as B,O1 as C,yRn as D,IPn as F,FBt as G,QBt as H,YSe as I,zF as L,LBt as O,XQ as P,IBt as S,$Dt as T,DAe as V,c$ as _,YPn as a,KPn as b,dl as c,iVn as d,OBt as e,Pr as f,YAe as g,t$ as h,mRn as i,lRn as j,BBt as k,wRn as l,Eb as m,xf as n,CBt as o,ABt as p,vP as u,wk as v};
|
|
3446
|
+
`)})]})}function LYn(o){return o.operation.protocol==="http"?`${o.operation.function.method.toUpperCase()} ${o.operation.function.path}`:o.operation.function.name}function MYn({history:o}){const[s,p]=hn.useState(!1);return le.jsxs(JQ,{elevation:3,style:{marginTop:15,marginBottom:15,marginRight:"15%"},children:[le.jsxs(bP,{children:[le.jsx(QQ,{label:"Function Describer",variant:"outlined",color:"secondary"}),le.jsx(C6,{children:o.text})]}),le.jsx(nIe,{style:{textAlign:"right"},children:le.jsx(rmt,{startIcon:le.jsx(hLe,{style:{transform:`rotate(${s?180:0}deg)`}}),onClick:()=>p(!s),children:s?"Hide Function Calls":"Show Function Calls"})}),le.jsx(HQ,{in:s,timeout:"auto",unmountOnExit:!0,children:le.jsx(bP,{children:o.executes.map(y=>le.jsx(PYn,{execute:y}))})})]})}const RYn=a5(le.jsx("path",{d:"M4 7h16v2H4zm0 6h16v-2H4zm0 4h7v-2H4zm0 4h7v-2H4zm11.41-2.83L14 16.75l-1.41 1.41L15.41 21 20 16.42 18.58 15zM4 3v2h16V3z"}),"Grading");function DYn({selection:o}){const[s,p]=hn.useState(!1);return le.jsxs(JQ,{elevation:3,style:{marginTop:15,marginBottom:15,marginRight:"15%"},children:[le.jsxs(bP,{children:[le.jsx(QQ,{icon:le.jsx(RYn,{}),label:"Function Selector",variant:"outlined",color:"warning"}),le.jsx("br",{}),le.jsx("br",{}),"Operation:",o.operation.protocol==="http"?le.jsxs("ul",{children:[le.jsx("li",{children:o.operation.function.method.toUpperCase()}),le.jsx("li",{children:o.operation.function.path})]}):le.jsx("ul",{children:le.jsx("li",{children:o.operation.function.name})}),le.jsx(C6,{children:o.reason})]}),le.jsx(nIe,{style:{textAlign:"right"},children:le.jsx(rmt,{onClick:()=>p(!s),children:s?"Hide Function Description":"Show Function Description"})}),le.jsx(HQ,{in:s,timeout:"auto",unmountOnExit:!0,children:le.jsx(bP,{children:le.jsx(C6,{children:o.operation.function.description})})})]})}function BYn({prompt:o}){return le.jsx("div",{style:{display:"flex",justifyContent:"flex-start"},children:le.jsx(JQ,{elevation:3,style:{marginTop:15,marginBottom:15,marginRight:"15%",textAlign:"left"},children:le.jsxs(bP,{children:[le.jsx(QQ,{icon:le.jsx(SNe,{}),label:"System",variant:"outlined",color:"success"}),le.jsx(C6,{children:o.text})]})})})}const FYn=a5(le.jsx("path",{d:"M9 11.75c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25m6 0c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8 0-.29.02-.58.05-.86 2.36-1.05 4.23-2.98 5.21-5.37C11.07 8.33 14.05 10 17.42 10c.78 0 1.53-.09 2.25-.26.21.71.33 1.47.33 2.26 0 4.41-3.59 8-8 8"}),"Face");function $Yn({prompt:o}){return le.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:o.contents.map((s,p)=>s.type==="text"?le.jsx(JQ,{elevation:3,style:{marginTop:15,marginBottom:15,marginLeft:"15%",textAlign:"right",backgroundColor:"lightyellow"},children:le.jsxs(bP,{children:[le.jsx(QQ,{icon:le.jsx(FYn,{}),label:"User",variant:"outlined",color:"primary"}),le.jsx(C6,{children:s.text})]})},p):null)})}function jYn({prompt:o}){return o.type==="assistantMessage"?le.jsx(NYn,{prompt:o}):o.type==="select"?le.jsx(DYn,{selection:o.selection}):o.type==="describe"?le.jsx(MYn,{history:o}):o.type==="cancel"||o.type==="execute"?null:o.type==="userMessage"?le.jsx($Yn,{prompt:o}):o.type==="systemMessage"?le.jsx(BYn,{prompt:o}):null}function HYn(o){return le.jsxs(uP.Fragment,{children:[le.jsx(A3,{variant:"h5",children:" Function Stack "}),le.jsx("hr",{}),o.selections.map(s=>le.jsxs(NOn,{children:[le.jsx(HOn,{expandIcon:le.jsx(hLe,{}),children:le.jsx(A3,{component:"h6",children:s.operation.protocol==="http"?`${s.operation.function.method.toUpperCase()} ${s.operation.function.path}`:s.operation.function.name})}),le.jsxs(ROn,{children:[le.jsx("hr",{}),s.reason,le.jsx("br",{}),le.jsx("br",{}),le.jsx(C6,{children:s.operation.function.description})]})]}))]})}function zYn(o){const s=UYn(o.usage);return le.jsxs(uP.Fragment,{children:[le.jsx(A3,{variant:"h5",children:" Token Usage "}),le.jsx("hr",{}),le.jsxs(tMn,{children:[le.jsx(pMn,{children:le.jsxs(kbt,{children:[le.jsx(k3,{children:"Type"}),le.jsx(k3,{children:"Token Usage"}),le.jsx(k3,{children:"Price"})]})}),le.jsxs(aMn,{children:[le.jsxs(kbt,{children:[le.jsx(k3,{children:"Total"}),le.jsx(k3,{children:o.usage.aggregate.total.toLocaleString()}),le.jsxs(k3,{children:["$",s.total.toLocaleString()]})]}),le.jsxs(kbt,{children:[le.jsx(k3,{children:"Input"}),le.jsx(k3,{children:o.usage.aggregate.input.total.toLocaleString()}),le.jsxs(k3,{children:["$",s.prompt.toLocaleString()]})]}),le.jsxs(kbt,{children:[le.jsx(k3,{children:"Output"}),le.jsx(k3,{children:o.usage.aggregate.output.total.toLocaleString()}),le.jsxs(k3,{children:["$",s.completion.toLocaleString()]})]})]})]})]})}function UYn(o){const s=(o.aggregate.input.total-o.aggregate.input.cached)*25e-7+o.aggregate.input.cached*125e-8,p=o.aggregate.output.total*(10/1e6);return{total:s+p,prompt:s,completion:p}}function qYn(o){var s,p;return le.jsxs("div",{style:{padding:25},children:[o.error!==null?le.jsxs(le.Fragment,{children:[le.jsx(A3,{variant:"h5",color:"error",children:"OpenAI Error"}),le.jsx("hr",{}),o.error.message,le.jsx("br",{}),le.jsx("br",{}),"Your OpenAI API key may not valid.",le.jsx("br",{}),le.jsx("br",{}),le.jsx("br",{})]}):null,le.jsx(A3,{variant:"h5",children:"Agent Information"}),le.jsx("hr",{}),le.jsxs("ul",{children:[le.jsxs("li",{children:["Model:"," ",o.vendor.model]}),le.jsxs("li",{children:["Locale:"," ",((s=o.config)==null?void 0:s.locale)??navigator.language]}),le.jsxs("li",{children:["Timezone:"," ",((p=o.config)==null?void 0:p.timezone)??Intl.DateTimeFormat().resolvedOptions().timeZone]})]}),le.jsx("br",{}),le.jsx("br",{}),le.jsx(zYn,{usage:o.usage}),le.jsx("br",{}),le.jsx("br",{}),le.jsx(HYn,{selections:o.selections})]})}const RAe=450;function WYn({agent:o,title:s}){const p=hn.useRef(null),y=hn.useRef(null),C=hn.useRef(null),N=hn.useRef(null),L=hn.useRef(null),[z,G]=hn.useState(null),[q,et]=hn.useState(""),[tt,nt]=hn.useState(o.getHistories().slice()),[st,at]=hn.useState(JSON.parse(JSON.stringify(o.getTokenUsage()))),[Ot,Dt]=hn.useState(122),[St,ie]=hn.useState(!0),[ae,Ne]=hn.useState([]),[pn,de]=hn.useState(!1),cn=async Ba=>{nt(Ts=>[...Ts,Ba.toHistory()])},er=async Ba=>{await Ba.join(),nt(Ts=>[...Ts,Ba.toHistory()])},Dn=async Ba=>{await Ba.join(),nt(Ts=>[...Ts,Ba.toHistory()])},jn=Ba=>{nt(Ts=>[...Ts,Ba.toHistory()]),Ne(Ts=>[...Ts,Ba.selection])},or=Ba=>{console.error(Ba)},gr=Ba=>{console.error(Ba)};hn.useEffect(()=>(L.current!==null&&L.current.select(),o.on("assistantMessage",er),o.on("userMessage",cn),o.on("select",jn),o.on("describe",Dn),o.on("validate",or),o.on("jsonParseError",gr),at(o.getTokenUsage()),()=>{o.off("assistantMessage",er),o.off("userMessage",cn),o.off("select",jn),o.off("describe",Dn),o.off("validate",or),o.off("jsonParseError",gr)}),[]);const fi=()=>{setTimeout(()=>{if(p.current===null||y.current===null||C.current===null)return;const Ba=p.current.clientHeight+C.current.clientHeight;Ba!==Ot&&Dt(Ba)})},pi=async()=>{et(""),ie(!1),fi();try{await o.conversate(q)}catch(Ts){Ts instanceof Error?(alert(Ts.message),G(Ts)):G(new Error("Unknown error"));return}tt.splice(0,tt.length),tt.push(...o.getHistories()),nt(tt),at(o.getTokenUsage()),ie(!0);const Ba=o.getHistories().filter(Ts=>Ts.type==="select").map(Ts=>Ts.selection);for(const Ts of o.getHistories().filter(Ke=>Ke.type==="cancel").map(Ke=>Ke.selection)){const Ke=Ba.findIndex(xo=>xo.operation.protocol===Ts.operation.protocol&&xo.operation.controller.name===Ts.operation.controller.name&&xo.operation.function.name===Ts.operation.function.name);Ke!==-1&&Ba.splice(Ke,1)}Ne(Ba)},Or=async Ba=>{Ba.key==="Enter"&&Ba.shiftKey===!1&&(St===!1?Ba.preventDefault():await pi())},di=async()=>{if(N.current===null)return;const Ba=await h$n(N.current,{}),Ts=document.createElement("a");Ts.download="nestia-chat-screenshot.png",Ts.href=Ba,Ts.click(),Ts.remove()},Ea=vP(),Qi=YPn(Ea.breakpoints.down("lg")),li=()=>le.jsx("div",{style:{overflowY:"auto",height:"100%",width:Qi?"100%":`calc(100% - ${RAe}px)`,margin:0,backgroundColor:"lightblue"},children:le.jsx(rCe,{style:{paddingBottom:50,width:"100%",minHeight:"100%",backgroundColor:"lightblue",margin:0},ref:N,children:tt.map((Ba,Ts)=>le.jsx(jYn,{prompt:Ba},Ts)).filter(Ba=>Ba!==null)})}),ze=()=>le.jsx("div",{style:{width:Qi?void 0:RAe,height:"100%",overflowY:"auto",backgroundColor:"#eeeeee"},children:le.jsx(rCe,{maxWidth:!1,onClick:Qi?()=>de(!1):void 0,children:le.jsx(qYn,{vendor:o.getVendor(),config:o.getConfig(),usage:st,selections:ae,error:z})})});return le.jsxs("div",{style:{width:"100%",height:"100%"},children:[le.jsx(XSe,{ref:p,position:"relative",component:"div",children:le.jsxs(_Ce,{children:[le.jsx(A3,{variant:"h6",component:"div",sx:{flexGrow:1},children:s??"Agentica Chatbot"}),Qi?le.jsxs(le.Fragment,{children:[le.jsx(YSe,{onClick:()=>void di().catch(()=>{}),children:le.jsx(l9e,{})}),le.jsx(YSe,{onClick:()=>de(!0),children:le.jsx(mFn,{})})]}):le.jsx(rmt,{color:"inherit",startIcon:le.jsx(l9e,{}),onClick:()=>void di().catch(()=>{}),children:"Screenshot Capture"})]})}),le.jsx("div",{ref:y,style:{width:"100%",height:`calc(100% - ${Ot}px)`,display:"flex",flexDirection:"row"},children:Qi?le.jsxs(le.Fragment,{children:[li(),le.jsx(xPn,{anchor:"right",open:pn,onClose:()=>de(!1),children:ze()})]}):le.jsxs(le.Fragment,{children:[li(),ze()]})}),le.jsx(XSe,{ref:C,position:"static",component:"div",color:"inherit",children:le.jsxs(_Ce,{children:[le.jsx(zmt,{inputRef:L,fullWidth:!0,placeholder:"Conversate with AI Chatbot",value:q,multiline:!0,onKeyUp:Ba=>void Or(Ba).catch(()=>{}),onChange:Ba=>{et(Ba.target.value),fi()}}),le.jsx(rmt,{variant:"contained",style:{marginLeft:10},startIcon:le.jsx(yFn,{}),disabled:!St,onClick:()=>void pi().catch(()=>{}),children:"Send"})]})})]})}function aVn(o){return le.jsx(WYn,{...o})}function DAe(o){const[s,p]=hn.useState(o.config.apiKey),[y,C]=hn.useState(o.config.baseURL===void 0&&(o.config.vendorModel==="gpt-4o"||o.config.vendorModel==="gpt-4o-mini")?o.config.vendorModel:"manual"),[N,L]=hn.useState(o.config.vendorModel),[z,G]=hn.useState(o.config.schemaModel),[q,et]=hn.useState(o.config.baseURL),tt=()=>({schemaModel:z,vendorModel:N,apiKey:s,baseURL:q}),nt=St=>{const ie=tt();ie.apiKey=St,p(St),o.onChange(ie)},st=(St,ie)=>{const ae=tt();C(ie),ie==="gpt-4o"||ie==="gpt-4o-mini"?(ae.vendorModel=ie,ae.baseURL=void 0,ae.schemaModel="chatgpt",et(void 0),L(ie),G("chatgpt")):(ae.baseURL="https://openrouter.ai/api/v1",et("https://openrouter.ai/api/v1")),o.onChange(ae)},at=St=>{const ie=tt();ie.baseURL=St,et(St),o.onChange(ie)},Ot=St=>{const ie=tt();ie.vendorModel=St,L(St),o.onChange(ie)},Dt=St=>{const ie=tt();ie.schemaModel=St,G(St),o.onChange(ie)};return le.jsxs(le.Fragment,{children:[le.jsx($Dt,{onChange:St=>nt(St.target.value),defaultValue:s,label:"OpenAI API Key",variant:"outlined",placeholder:"Your OpenAI API Key",error:s.length===0}),le.jsx("br",{}),le.jsxs(gCe,{defaultValue:y,onChange:st,style:{paddingLeft:15},children:[le.jsx(hk,{control:le.jsx(fk,{}),label:"GPT-4o Mini",value:"gpt-4o-mini"}),le.jsx(hk,{control:le.jsx(fk,{}),label:"GPT-4o",value:"gpt-4o"}),le.jsx(hk,{control:le.jsx(fk,{}),label:"Manual Configuration",value:"manual"})]}),y==="manual"?le.jsxs(le.Fragment,{children:[le.jsx("br",{}),le.jsx($Dt,{fullWidth:!0,label:"Base URL",defaultValue:q,onChange:St=>at(St.target.value)}),le.jsx("br",{}),le.jsx($Dt,{fullWidth:!0,label:"Vendor Model",defaultValue:N,onChange:St=>Ot(St.target.value)}),le.jsx("br",{}),le.jsxs(gCe,{title:"Schema Model",defaultValue:z,onChange:(St,ie)=>Dt(ie),style:{paddingLeft:15},children:[le.jsx(hk,{control:le.jsx(fk,{}),label:"OpenAI ChatGPT",value:"chatgpt"}),le.jsx(hk,{control:le.jsx(fk,{}),label:"Anthropic Claude",value:"claude"}),le.jsx(hk,{control:le.jsx(fk,{}),label:"Google Gemini",value:"gemini"}),le.jsx(hk,{control:le.jsx(fk,{}),label:"Meta Llama",value:"llama"}),le.jsx(hk,{control:le.jsx(fk,{}),label:"OpenAPI v3.0",value:"3.0"}),le.jsx(hk,{control:le.jsx(fk,{}),label:"OpenAPI v3.1",value:"3.1"})]}),le.jsx("br",{})]}):null,le.jsx("br",{})]})}(o=>{function s(){return{schemaModel:"chatgpt",vendorModel:"gpt-4o-mini",apiKey:"",baseURL:void 0}}o.defaultConfig=s})(DAe||(DAe={}));export{QIe as A,rmt as B,O1 as C,wRn as D,IPn as F,FBt as G,QBt as H,YSe as I,zF as L,LBt as O,XQ as P,IBt as S,$Dt as T,DAe as V,c$ as _,YPn as a,KPn as b,dl as c,aVn as d,OBt as e,Pr as f,YAe as g,t$ as h,yRn as i,hRn as j,BBt as k,vRn as l,Eb as m,xf as n,CBt as o,ABt as p,vP as u,wk as v};
|