@techdocs/cli 0.0.0-nightly-20230619022652 → 0.0.0-nightly-20230620022155

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.
@@ -29,7 +29,7 @@ spec:
29
29
  hsla(0, 0%, ${o}, 0.049) 84.5%,
30
30
  hsla(0, 0%, ${o}, 0.013) 91.9%,
31
31
  hsla(0, 0%, ${o}, 0) 100%
32
- `},Ar=100,S=10,c=(0,g.Z)(e=>({root:{position:"relative",display:"flex",flexFlow:"row nowrap",alignItems:"center"},container:{overflow:"auto",scrollbarWidth:0,"&::-webkit-scrollbar":{display:"none"}},fade:{position:"absolute",width:Ar,height:`calc(100% + ${S}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-S,background:`linear-gradient(90deg, ${Gn(e.palette.type)})`},fadeRight:{right:-S,background:`linear-gradient(270deg, ${Gn(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function b(e){const[[o,l],d]=React.useState([0,0]);return React.useLayoutEffect(()=>{const m=e.current;if(!m){d([0,0]);return}const y=()=>{const I=m.scrollLeft,B=m.scrollWidth-m.offsetWidth-m.scrollLeft;d([I,B])};return y(),m.addEventListener("scroll",y),window.addEventListener("resize",y),()=>{m.removeEventListener("scroll",y),window.removeEventListener("resize",y)}},[e]),[o,l]}function j(e,o,l){const[d,m]=React.useState(0);return React.useLayoutEffect(()=>{if(d===0)return;const y=window.performance.now(),I=requestAnimationFrame(B=>{if(!e.current)return;const Y=B-y,Z=Math.abs(d)*Y/o,pe=Math.max(l,Z)*Math.sign(d);e.current.scrollBy({left:pe});const Te=d-pe;Math.sign(d)!==Math.sign(Te)?m(0):m(Te)});return()=>cancelAnimationFrame(I)},[e,d,o,l]),m}function K(e){const{scrollStep:o=100,scrollSpeed:l=50,minScrollDistance:d=5,children:m,...y}=e,I=c(e),B=React.useRef(),[Y,Z]=b(B),fe=j(B,l,d),pe=Te=>{B.current&&fe(Te?o:-o)};return _jsxs(Box,{...y,className:I.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:I.container,ref:B,children:m}),_jsx(Box,{className:classNames(I.fade,I.fadeLeft,{[I.fadeHidden]:Y===0})}),_jsx(Box,{className:classNames(I.fade,I.fadeRight,{[I.fadeHidden]:Z===0})}),Y>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>pe(!1),className:classNames(I.button,I.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),Z>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>pe(!0),className:classNames(I.button,I.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const me=(0,g.Z)(e=>({alpha:{color:e.palette.common.white,fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"},beta:{color:"#4d65cc",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"}}),{name:"BackstageLifecycle"});function we(e){const o=me(e),{shorthand:l,alpha:d}=e;return l?_jsx(Typography,{component:"span",className:o[d?"alpha":"beta"],style:{fontSize:"120%"},children:d?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx(Typography,{component:"span",className:o[d?"alpha":"beta"],children:d?"Alpha":"Beta"})}const Fe=(0,f.lazy)(()=>Promise.all([n.e(1049),n.e(6051)]).then(n.bind(n,76051)).then(e=>({default:e.RealLogViewer})));function Xe(e){const{Progress:o}=(0,p.qD)().getComponents();return(0,r.jsx)(f.Suspense,{fallback:(0,r.jsx)(o,{}),children:(0,r.jsx)(Fe,{...e})})}var Mt=n(28865),jn=n(60251);const qn=(0,g.Z)(e=>({markdown:{"& table":{borderCollapse:"collapse",border:`1px solid ${e.palette.border}`},"& th, & td":{border:`1px solid ${e.palette.border}`,padding:e.spacing(1)},"& td":{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:e.spacing(3,2,3,2.5),borderBottom:0},"& th":{backgroundColor:e.palette.background.paper},"& tr":{backgroundColor:e.palette.background.paper},"& tr:nth-child(odd)":{backgroundColor:e.palette.background.default},"& a":{color:e.palette.link},"& img":{maxWidth:"100%"}}}),{name:"BackstageMarkdownContent"}),ar=(e,o)=>o?typeof o=="string"?e+o:f.Children.toArray(o.props.children).reduce(ar,e):e,vr=({level:e,children:o})=>{const m=f.Children.toArray(o).reduce(ar,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return f.createElement(`h${e}`,{id:m},o)},an={code:({inline:e,className:o,children:l,...d})=>{const m=String(l).replace(/\n+$/,""),y=/language-(\w+)/.exec(o||"");return!e&&y?(0,r.jsx)(je,{language:y[1],text:m}):(0,r.jsx)("code",{className:o,...d,children:l})},h1:vr,h2:vr,h3:vr,h4:vr,h5:vr,h6:vr};function ho(e){const{content:o,dialect:l="gfm",linkTarget:d,transformLinkUri:m,transformImageUri:y,className:I}=e,B=qn();return(0,r.jsx)(Mt.D,{remarkPlugins:l==="gfm"?[jn.Z]:[],className:`${B.markdown} ${I}`,children:o,components:an,linkTarget:d,transformLinkUri:m,transformImageUri:y})}var qr=n(23054);const Oo=(0,g.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),_r=({request:e,busy:o,setBusy:l})=>{const d=Oo(),[m,y]=useState(),I=async()=>{l(!0);try{await e.trigger()}catch(Y){y(isError(Y)?Y.message:"An unspecified error occurred")}finally{l(!1)}},B=e.provider.icon;return _jsxs(ListItem,{disabled:o,classes:{root:d.root},children:[_jsx(ListItemAvatar,{children:_jsx(B,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:m&&_jsx(Typography,{color:"error",children:m})}),_jsx(Button,{color:"primary",variant:"contained",onClick:I,children:"Log in"})]})};var po=null;const ko=(0,g.Z)(e=>({dialog:{paddingTop:e.spacing(1)},title:{minWidth:0},titleHeading:{fontSize:e.typography.h6.fontSize},contentList:{padding:0},actionButtons:{padding:e.spacing(2,0)}}),{name:"OAuthRequestDialog"});function vs(e){const o=ko(),[l,d]=useState(!1),m=useApi(oauthRequestApiRef),y=useApi(configApiRef);var I;const B=(I=y.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&I!==void 0?I:!1,Y=useObservable(useMemo(()=>m.authRequest$(),[m]),[]),Z=()=>{Y.forEach(fe=>fe.reject())};return _jsxs(Dialog,{open:Boolean(Y.length),fullWidth:!0,maxWidth:"xs",classes:{paper:o.dialog},"aria-labelledby":"oauth-req-dialog-title",children:[_jsxs("main",{children:[_jsxs(DialogTitle,{classes:{root:o.title},id:"oauth-req-dialog-title",children:[_jsx(Typography,{className:o.titleHeading,variant:"h1",variantMapping:{h1:"span"},children:"Login Required"}),B?_jsx(Typography,{children:"This will trigger a http redirect to OAuth Login."}):null]}),_jsx(DialogContent,{dividers:!0,classes:{root:o.contentList},children:_jsx(List,{children:Y.map(fe=>_jsx(LoginRequestListItem,{request:fe,busy:l,setBusy:d},fe.provider.title))})})]}),_jsx(DialogActions,{classes:{root:o.actionButtons},children:_jsx(Button,{onClick:Z,children:"Reject All"})})]})}var Bo=n(15277),$o=n.n(Bo),yr=n(29862);const nr=(0,g.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function Lr(e){const[o,l]=(0,f.useState)(!1),d=(0,yr.t)(),m=nr(),y=B=>{d()&&l(B)};var I;return(0,r.jsx)(T.ZP,{title:(I=e.title)!==null&&I!==void 0?I:e.text||"",placement:e.placement,disableHoverListener:!o,children:(0,r.jsx)($o(),{text:e.text,line:e.line,onToggled:y,containerClassName:m.container})})}var Zr=n(67358);function eo(e){const o=(0,ae.Z)(),[l,d]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{const m=setTimeout(()=>d(!0),o.transitions.duration.short);return()=>clearTimeout(m)},[o.transitions.duration.short]),l?(0,r.jsx)(Zr.Z,{...e,"data-testid":"progress"}):(0,r.jsx)(A.Z,{display:"none"})}var to=n(94339),Ur=n(14503),Do=n(24579),fo=n(32552),kn=n(15459),_n=n(27597);const Or=(0,g.Z)(e=>({root:{maxWidth:"fit-content",padding:e.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:e.palette.textSubtle},arrow:{color:e.palette.textSubtle}}),{name:"BackstageBottomLink"});function Mr(e){const{link:o,title:l,onClick:d}=e,m=Or();return(0,r.jsxs)(A.Z,{children:[(0,r.jsx)(Ne.Z,{}),(0,r.jsx)(de.r,{to:o,onClick:d,underline:"none",children:(0,r.jsxs)(A.Z,{display:"flex",alignItems:"center",className:m.root,children:[(0,r.jsx)(A.Z,{className:m.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,r.jsx)(rt.Z,{children:(0,r.jsx)("strong",{children:l})})}),(0,r.jsx)(_n.Z,{className:m.arrow})]})})]})}const Tr=e=>{const{slackChannel:o}=e;if(o){if(typeof o=="string")return(0,r.jsxs)(rt.Z,{children:["Please contact ",o," for help."]});if(!o.href)return(0,r.jsxs)(rt.Z,{children:["Please contact ",o.name," for help."]})}else return null;return(0,r.jsx)(te,{to:o.href,variant:"contained",children:o.name})},no=class extends f.Component{componentDidCatch(o,l){console.error(`ErrorBoundary, error: ${o}, info: ${l}`),this.setState({error:o,errorInfo:l})}render(){const{slackChannel:o,children:l}=this.props,{error:d}=this.state;return d?(0,r.jsx)(st,{title:"Something Went Wrong",error:d,children:(0,r.jsx)(Tr,{slackChannel:o})}):l}constructor(o){super(o),this.state={error:void 0,errorInfo:void 0}}},ro=(0,g.Z)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:e.typography.fontWeightBold},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),Fo=(0,kn.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(Ur.Z),go={card:{flex:{display:"flex",flexDirection:"column"},fullHeight:{display:"flex",flexDirection:"column",height:"100%"},gridItem:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px",breakInside:"avoid-page","@media print":{height:"auto"}}},cardContent:{fullHeight:{flex:1},gridItem:{flex:1}}};function lr(e){const{title:o,subheader:l,divider:d=!0,deepLink:m,slackChannel:y,errorBoundaryProps:I,variant:B,children:Y,headerStyle:Z,headerProps:fe,icon:pe,action:Te,actionsClassName:Ee,actions:Ze,cardClassName:it,actionsTopRight:Pt,className:mn,noPadding:Fn,titleTypographyProps:or}=e,Bt=ro();let vn={},yn={};B&&B.split(/[\s]+/g).forEach(wr=>{vn={...vn,...go.card[wr]},yn={...yn,...go.cardContent[wr]}});const gr=()=>!l&&!pe?null:(0,r.jsxs)("div",{className:Bt.headerSubheader,"data-testid":"info-card-subheader",children:[l&&(0,r.jsx)("div",{className:Bt.subheader,children:l}),pe]}),Sr=I||(y?{slackChannel:y}:{});return(0,r.jsx)(to.Z,{style:vn,className:mn,children:(0,r.jsxs)(no,{...Sr,children:[o&&(0,r.jsx)(fo.Z,{classes:{root:Bt.header,title:Bt.headerTitle,subheader:Bt.headerSubheader,avatar:Bt.headerAvatar,action:Bt.headerAction,content:Bt.headerContent},title:o,subheader:gr(),action:Te,style:{...Z},titleTypographyProps:or,...fe}),Pt&&(0,r.jsx)(Fo,{children:Pt}),d&&(0,r.jsx)(Ne.Z,{}),(0,r.jsx)(Do.Z,{className:on()(it,{[Bt.noPadding]:Fn}),style:yn,children:Y}),Ze&&(0,r.jsx)(Ur.Z,{className:Ee,children:Ze}),m&&(0,r.jsx)(Mr,{...m})]})})}var ys=n(39307);const No=(0,g.Z)(e=>({root:{position:"relative",lineHeight:0},overlay:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -60%)",fontSize:e.typography.pxToRem(45),fontWeight:e.typography.fontWeightBold,color:e.palette.textContrast},description:{fontSize:"100%",top:"50%",left:"50%",transform:"translate(-50%, -50%)",position:"absolute",wordBreak:"break-all",display:"inline-block"},circle:{width:"80%",transform:"translate(10%, 0)"},colorUnknown:{}}),{name:"BackstageGauge"}),zr={fractional:!0,inverse:!1,unit:"%",max:100},Zo=({palette:e,value:o,inverse:l,max:d})=>{if(isNaN(o))return"#ddd";const m=d||zr.max,y=l?m-o:o;return y<m/3?e.status.error:y<m*(2/3)?e.status.warning:e.status.ok};function Uo(e){const[o,l]=useState(null),{getColor:d=Zo}=e,m=No(e),{palette:y}=useTheme(),{value:I,fractional:B,inverse:Y,unit:Z,max:fe,description:pe}={...zr,...e},Te=B?Math.round(I*fe):I,Ee=fe!==100?Math.round(I):Te,[Ze,it]=useState(!1);return useEffect(()=>{const Pt=o,mn=()=>it(!0),Fn=()=>it(!1);return Pt&&pe?(Pt.addEventListener("mouseenter",mn),Pt.addEventListener("mouseleave",Fn),()=>{Pt.removeEventListener("mouseenter",mn),Pt.removeEventListener("mouseleave",Fn)}):()=>{it(!1)}},[pe,o]),_jsxs(Box,{ref:l,className:m.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:Te,strokeWidth:12,trailWidth:12,strokeColor:d({palette:y,value:Ee,inverse:Y,max:fe}),className:m.circle}),pe&&Ze?_jsx(Box,{className:m.description,children:pe}):_jsx(Box,{className:m.overlay,children:isNaN(I)?"N/A":`${Ee}${Z}`})]})}const er=(0,g.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function si(e){const o=er(e),{title:l,subheader:d,progress:m,inverse:y,deepLink:I,description:B,icon:Y,variant:Z,getColor:fe}=e,pe={inverse:y,description:B,getColor:fe,value:m};return _jsx(Box,{className:o.root,children:_jsx(InfoCard,{title:l,subheader:d,deepLink:I,variant:Z,icon:Y,children:_jsx(Gauge,{...pe})})})}function xs(e){const{value:o,getColor:l=getProgressColor,width:d="thick"}=e,{palette:m}=useTheme();if(isNaN(o))return null;let y=Math.round(o*100*100)/100;y>100&&(y=100);const I=d==="thick"?4:1,B=l({palette:m,value:y,inverse:!1,max:100});return _jsx(Tooltip,{title:`${y}%`,children:_jsx(Typography,{component:"span",children:_jsx(Line,{percent:y,strokeWidth:I,trailWidth:I,strokeColor:B})})})}var bs=n(21324),Ss=n(7089),oo=n(42494),Wr=n(74603),Vr=n(56939),Kn=n(12231),Mo=n(73698),Yn=n(12420),so=n(72379);const zo=(0,g.Z)(e=>(0,Yn.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var Wo=()=>{const e=zo();return(0,r.jsx)(so.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z",fill:"#616161"})})};const Vo=(0,g.Z)(e=>(0,Yn.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var Ho=()=>{const e=Vo();return(0,r.jsx)(so.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z",fill:"#616161"})})};const ao=(0,kn.Z)(e=>(0,Yn.Z)({root:{"label + &":{marginTop:e.spacing(3)}},input:{borderRadius:e.shape.borderRadius,position:"relative",backgroundColor:e.palette.background.paper,border:"1px solid #ced4da",fontSize:e.typography.body1.fontSize,padding:e.spacing(1.25,3.25,1.25,1.5),transition:e.transitions.create(["border-color","box-shadow"]),fontFamily:"Helvetica Neue","&:focus":{background:e.palette.background.paper,borderRadius:e.shape.borderRadius}}}),{name:"BackstageSelectInputBase"})(Wr.Z),Go=(0,g.Z)(e=>(0,Yn.Z)({formControl:{margin:`${e.spacing(1)} 0px`,maxWidth:300},label:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},formLabel:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},chips:{display:"flex",flexWrap:"wrap"},chip:{margin:2},checkbox:{},root:{display:"flex",flexDirection:"column"}}),{name:"BackstageSelect"});function mo(e){const{multiple:o,items:l,label:d,placeholder:m,selected:y,onChange:I,triggerReset:B,native:Y=!1,disabled:Z=!1,margin:fe}=e,pe=Go(),[Te,Ee]=(0,f.useState)(y||(o?[]:"")),[Ze,it]=(0,f.useState)(!1);(0,f.useEffect)(()=>{Ee(o?[]:"")},[B,o]),(0,f.useEffect)(()=>{Ee(y||(o?[]:""))},[y,o]);const Pt=Bt=>{Ee(Bt.target.value),I(Bt.target.value)},mn=Bt=>{if(Z){Bt.preventDefault();return}it(vn=>o&&!(Bt.target instanceof HTMLElement)?!0:!vn)},Fn=()=>{it(!1)},or=Bt=>()=>{const vn=Te.filter(yn=>yn!==Bt);Ee(vn),I(vn)};return(0,r.jsx)(A.Z,{className:pe.root,children:(0,r.jsxs)(oo.Z,{className:pe.formControl,children:[(0,r.jsx)(Vr.Z,{className:pe.formLabel,children:d}),(0,r.jsxs)(Mo.Z,{"aria-label":d,value:Te,native:Y,disabled:Z,"data-testid":"select",displayEmpty:!0,multiple:o,margin:fe,onChange:Pt,open:Ze,onOpen:mn,onClose:Fn,input:(0,r.jsx)(ao,{}),label:d,tabIndex:0,renderValue:Bt=>{var vn;return o&&Te.length!==0?(0,r.jsx)(A.Z,{className:pe.chips,children:Bt.map(yn=>{var gr,Sr;return(0,r.jsx)(Ss.Z,{label:(gr=l.find(Cr=>Cr.value===yn))===null||gr===void 0?void 0:gr.label,clickable:!0,onDelete:or(yn),className:pe.chip},(Sr=l.find(Cr=>Cr.value===yn))===null||Sr===void 0?void 0:Sr.value)})}):(0,r.jsx)(rt.Z,{children:Te.length===0?m||"":(vn=l.find(yn=>yn.value===Bt))===null||vn===void 0?void 0:vn.label})},IconComponent:()=>Ze?(0,r.jsx)(Ho,{}):(0,r.jsx)(Wo,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[m&&!o&&(0,r.jsx)(Kn.Z,{value:[],children:m}),Y?l&&l.map(Bt=>(0,r.jsx)("option",{value:Bt.value,children:Bt.label},Bt.value)):l&&l.map(Bt=>(0,r.jsxs)(Kn.Z,{value:Bt.value,children:[o&&(0,r.jsx)(bs.Z,{color:"primary",checked:Te.includes(Bt.value)||!1,className:pe.checkbox}),Bt.label]},Bt.value))]})]})})}const vo=()=>{},ws=f.createContext({stepperLength:0,stepIndex:0,setStepIndex:vo,stepHistory:[],setStepHistory:vo,onStepChange:vo});function js(e){const{children:o,elevated:l,onStepChange:d,activeStep:m=0}=e,[y,I]=useState(m),[B,Y]=useState([0]);useEffect(()=>{I(m)},[m]);const Z=[];let fe;return Children.forEach(o,pe=>{isValidElement(pe)&&(pe.props.end?fe=pe:Z.push(pe))}),_jsxs(_Fragment,{children:[_jsx(ws.Provider,{value:{stepIndex:y,setStepIndex:I,stepHistory:B,setStepHistory:Y,onStepChange:d,stepperLength:Children.count(o)},children:_jsx(MuiStepper,{activeStep:y,orientation:"vertical",elevation:l?2:0,children:Z})}),y>=Children.count(o)-1&&fe]})}const Ko=(0,g.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),ln=({text:e,handleClick:o})=>_jsx(Button,{onClick:o,children:e||"Reset"}),Yo=({text:e,handleClick:o,disabled:l,last:d,stepIndex:m})=>_jsx(Button,{variant:"contained",color:"primary",disabled:l,"data-testid":`nextButton-${m}`,onClick:o,children:e||(d?"Finish":"Next")}),Es=({text:e,handleClick:o,disabled:l,stepIndex:d})=>_jsx(Button,{variant:"outlined",color:"primary",disabled:l,"data-testid":`skipButton-${d}`,onClick:o,children:e||"Skip"}),x=({text:e,handleClick:o,disabled:l,stepIndex:d})=>_jsx(Button,{onClick:o,"data-testid":`backButton-${d}`,disabled:l,children:e||"Back"}),C=({actions:e={},children:o})=>{const l=Ko(),{stepperLength:d,stepIndex:m,setStepIndex:y,stepHistory:I,setStepHistory:B,onStepChange:Y}=useContext(VerticalStepperContext),Z=(Ee,Ze)=>{Ze&&Ze(),Y&&Y(m,Ee),y(Ee)},fe=()=>{const Ee=e.nextStep?e.nextStep(m,d-1):m+1;Z(Ee,e.onNext),B([...I,Ee])},pe=()=>{I.pop(),Z(I[I.length-1],e.onBack),B([...I])},Te=()=>{Z(0,e.onRestart),B([0])};return _jsxs(Box,{className:l.root,children:[[void 0,!0].includes(e.showBack)&&m!==0&&_jsx(x,{text:e.backText,handleClick:pe,disabled:m===0,stepIndex:m}),e.showSkip&&_jsx(Es,{text:e.skipText,handleClick:fe,disabled:!!d&&m>=d||!!e.canSkip&&!e.canSkip(),stepIndex:m}),[void 0,!0].includes(e.showNext)&&_jsx(Yo,{text:e.nextText,handleClick:fe,disabled:!!d&&m>=d||!!e.canNext&&!e.canNext(),stepIndex:m}),e.showRestart&&m!==0&&_jsx(ln,{text:e.restartText,handleClick:Te,stepIndex:m}),o]})},E=(0,g.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function $(e){const{title:o,children:l,end:d,actions:m,...y}=e,I=E();return d?_jsxs(Box,{className:I.end,children:[_jsx(Typography,{variant:"h6",children:o}),l,_jsx(SimpleStepperFooter,{actions:{...m||{},showNext:!1}})]}):_jsxs(MuiStep,{...y,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:o})}),_jsxs(StepContent,{children:[l,_jsx(SimpleStepperFooter,{actions:m})]})]})}const Q=(0,g.Z)(e=>({status:{fontWeight:e.typography.fontWeightMedium,"&::before":{width:"0.7em",height:"0.7em",display:"inline-block",marginRight:e.spacing(1),borderRadius:"50%",content:'""'}},ok:{"&::before":{backgroundColor:e.palette.status.ok}},warning:{"&::before":{backgroundColor:e.palette.status.warning}},error:{"&::before":{backgroundColor:e.palette.status.error}},pending:{"&::before":{backgroundColor:e.palette.status.pending}},running:{"&::before":{backgroundColor:e.palette.status.running}},aborted:{"&::before":{backgroundColor:e.palette.status.aborted}}}),{name:"BackstageStatus"});function ne(e){const o=Q(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function re(e){const o=Q(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function ve(e){const o=Q(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.error),"aria-label":"Status error","aria-hidden":"true",...e})}function Ae(e){const o=Q(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function Oe(e){const o=Q(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.running),"aria-label":"Status running","aria-hidden":"true",...e})}function De(e){const o=Q(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var Be=n(74600),tt=n(15584);const ft=e=>(0,Yn.Z)({root:{fontWeight:e.typography.fontWeightBold,whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),qe={root:{border:"0",verticalAlign:"top"}},We=e=>(0,Yn.Z)({root:{margin:e.spacing(0,0,-1,0)}}),gt=e=>(0,Yn.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),Ot=(0,kn.Z)(ft,{name:"BackstageMetadataTableTitleCell"})(tt.Z),bn=(0,kn.Z)(qe,{name:"BackstageMetadataTableCell"})(tt.Z),Rt=({dense:e,children:o})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:o})}),Gt=({title:e,children:o,...l})=>_jsxs(TableRow,{children:[e&&_jsx(Ot,{children:e}),_jsx(bn,{colSpan:e?1:2,...l,children:o})]}),kt=(0,kn.Z)(We,{name:"BackstageMetadataTableList"})(({classes:e,children:o})=>(0,r.jsx)(Zt.Z,{disablePadding:!0,className:e.root,children:o})),dn=(0,kn.Z)(gt,{name:"BackstageMetadataTableListItem"})(({classes:e,children:o})=>(0,r.jsx)(_t.Z,{className:e.root,children:o})),$n=(0,Yn.Z)({root:{margin:"0 0",listStyleType:"none"}}),Rr=e=>(0,Yn.Z)({root:{...$n.root,paddingLeft:e.spacing(1)}}),cr=(0,kn.Z)($n,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:o})=>(0,r.jsx)(kt,{classes:e,children:o})),Hr=(0,kn.Z)(Rr,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:o})=>(0,r.jsx)(kt,{classes:e,children:o}));function Nn(e,o){const l=e.map((d,m)=>_jsx(MetadataListItem,{children:xr(d)},m));return o?_jsx(Hr,{children:l}):_jsx(cr,{children:l})}function zn(e,o,l){const d=Object.keys(e).map(m=>{const y=xr(e[m],!0),I=l&&l.titleFormat?l.titleFormat(m):startCase(m);return _jsxs(MetadataListItem,{children:[_jsx(Typography,{variant:"body2",component:"span",children:`${I}: `}),y]},m)});return o?_jsx(Hr,{children:d}):_jsx(cr,{children:d})}function xr(e,o,l){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?zn(e,o,l):Array.isArray(e)?Nn(e,l):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Typography,{variant:"body2",component:"span",children:e})}const ii=({value:e,options:o})=>_jsx(Fragment,{children:xr(e,o)}),As=({title:e,value:o,options:l})=>_jsx(MetadataTableItem,{title:l&&l.titleFormat?l.titleFormat(e):startCase(e),children:_jsx(ii,{value:o,options:l})});function Ts(e,o){return Object.keys(e).map(l=>_jsx(As,{title:l,value:e[l],options:o},l))}function kr(e){const{metadata:o,dense:l=!0,options:d}=e,m=Ts(o,d||{});return _jsx(MetadataTable,{dense:l,children:m})}var dr=n(49429),ur=n(86136),hr=n(50758),Rs=n(79784),Gr=n(76635),ai=n(19126),Is=n.n(ai);function Ps(e){return qs.stringify(e,{strictNullHandling:!0})}function Kr(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function Jo(e,o){return Kr(e)[o]}function Ls(e,o,l){const d={...Kr(e),[o]:l};return Ps(d)}function Ua(e,o=250){const[l,d]=useSearchParams(),m=l.toString(),[y,I]=useState(Jo(m,e));return useEffect(()=>{const B=Jo(m,e);I(Y=>isEqual(B,Y)?Y:B)},[m,I,e]),useDebouncedEffect(()=>{const B=Ls(m,e,y);m!==B&&d(B,{replace:!0})},[d,y,m,e],o),[y,I]}const yo={url:"https://github.com/backstage/backstage/issues",items:[{title:"Support Not Configured",icon:"warning",links:[{title:"Add `app.support` config key",url:"https://github.com/backstage/backstage/blob/master/app-config.yaml"}]}]};function Qo(){const o=(0,p.I_)().get(p.Ds),l=o==null?void 0:o.getOptionalConfig("app.support");if(!l)return yo;var d;return{url:l.getString("url"),items:l.getConfigArray("items").flatMap(m=>({title:m.getString("title"),icon:m.getOptionalString("icon"),links:((d=m.getOptionalConfigArray("links"))!==null&&d!==void 0?d:[]).flatMap(y=>({url:y.getString("url"),title:y.getString("title")}))}))}}var li=n(80079);function rr(e,o){const d=(0,p.qD)().getSystemIcon(e);return d?(0,r.jsx)(d,{...o}):(0,r.jsx)(li.Z,{...o})}function sa(e){return rr("brokenImage",e)}function ia(e){return rr("catalog",e)}function aa(e){return rr("chat",e)}function la(e){return rr("dashboard",e)}function ca(e){return rr("docs",e)}function da(e){return rr("email",e)}function ci(e){return rr("github",e)}function ua(e){return rr("group",e)}function xo(e){return rr("help",e)}function di(e){return rr("user",e)}function Ma(e){return rr("warning",e)}const ha=(0,g.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),ui=({icon:e})=>{const o=(0,p.qD)();var l;const d=e&&(l=o.getSystemIcon(e))!==null&&l!==void 0?l:xo;return(0,r.jsx)(d,{})};var Xo;const hi=({link:e})=>(0,r.jsx)(de.r,{to:e.url,children:(Xo=e.title)!==null&&Xo!==void 0?Xo:e.url}),pi=({item:e})=>{var o;return(0,r.jsxs)(Kn.Z,{children:[(0,r.jsx)(ur.Z,{children:(0,r.jsx)(ui,{icon:e.icon})}),(0,r.jsx)(en.Z,{primary:e.title,secondary:(o=e.links)===null||o===void 0?void 0:o.reduce((l,d,m)=>[...l,m>0&&(0,r.jsx)("br",{},m),(0,r.jsx)(hi,{link:d},d.url)],[])})]})};function bo(e){const{title:o,items:l,children:d}=e,{items:m}=Qo(),[y,I]=(0,f.useState)(!1),[B,Y]=(0,f.useState)(null),Z=ha(),fe=(0,Pe.Z)(Ee=>Ee.breakpoints.down("sm")),pe=Ee=>{Y(Ee.currentTarget),I(!0)},Te=()=>{I(!1)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(A.Z,{display:"flex",ml:1,children:fe?(0,r.jsx)(H.Z,{color:"primary",size:"small",onClick:pe,"data-testid":"support-button","aria-label":"Support",children:(0,r.jsx)(xo,{})}):(0,r.jsx)(ge.Z,{"data-testid":"support-button","aria-label":"Support",color:"primary",onClick:pe,startIcon:(0,r.jsx)(xo,{}),children:"Support"})}),(0,r.jsxs)(Rs.ZP,{"data-testid":"support-button-popover",open:y,anchorEl:B,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:Te,children:[(0,r.jsxs)(hr.Z,{className:Z.popoverList,autoFocusItem:Boolean(B),children:[o&&(0,r.jsx)(Kn.Z,{alignItems:"flex-start",children:(0,r.jsx)(rt.Z,{variant:"subtitle1",children:o})}),f.Children.map(d,(Ee,Ze)=>(0,r.jsx)(Kn.Z,{alignItems:"flex-start",children:Ee},`child-${Ze}`)),(l!=null?l:m).map((Ee,Ze)=>(0,r.jsx)(pi,{item:Ee},`item-${Ze}`))]}),(0,r.jsx)(dr.Z,{children:(0,r.jsx)(ge.Z,{color:"primary",onClick:Te,"aria-label":"Close",children:"Close"})})]})]})}var So=n(18671),pr=n(73557),qo=n(84800);const _o=72,Br=24,Os=18,Sn={drawerWidthClosed:_o,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:_o,iconSize:_o-Br*2,iconPadding:Br,selectedIndicatorWidth:3,userBadgePadding:Os,userBadgeDiameter:_o-Os*2,mobileSidebarHeight:56},pa=e=>({...Sn,...e,iconContainerWidth:Sn.drawerWidthClosed,iconSize:Sn.drawerWidthClosed-Sn.iconPadding*2,userBadgeDiameter:Sn.drawerWidthClosed-Sn.userBadgePadding*2}),fi={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:Sn.defaultOpenDelayMs+200},fa=e=>({...fi,...e}),ga="@backstage/core/sidebar-intro-dismissed",br=(0,f.createContext)({sidebarConfig:Sn,submenuConfig:fi}),gi=(0,f.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var es=n(50023),mi=n(4190),Co=n(87685),wo=n(44882),$r=n(51837);const ks={isOpen:!1,setOpen:()=>{}},ts=(0,f.createContext)(ks),ns=(0,$r.CT)("sidebar-open-state-context");function Bs(e){const{children:o,value:l}=e;return(0,r.jsx)(ts.Provider,{value:l,children:(0,r.jsx)(ns.Provider,{value:(0,$r.EI)({1:l}),children:o})})}const rs=()=>{const e=(0,f.useContext)(ns),o=(0,f.useContext)(ts);if(e===void 0)return o||ks;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l};var vi=n(57998);const $s={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},Ds=(0,f.createContext)($s),yi=(0,$r.CT)("sidebar-pin-state-context");function xi(e){const{children:o,value:l}=e;return(0,r.jsx)(Ds.Provider,{value:l,children:(0,r.jsx)(yi.Provider,{value:(0,$r.EI)({1:l}),children:o})})}const jo=()=>{const e=(0,f.useContext)(yi),o=(0,f.useContext)(Ds);if(e===void 0)return o||$s;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l},os=(0,g.Z)(e=>({root:{flexGrow:0,margin:e.spacing(0,2),color:e.palette.navigation.color},selected:o=>({color:`${e.palette.navigation.selectedColor}!important`,borderTop:`solid ${o.sidebarConfig.selectedIndicatorWidth}px ${e.palette.navigation.indicator}`,marginTop:"-1px"}),label:{display:"none"}})),bi=e=>{const{to:o,label:l,icon:d,value:m}=e,{sidebarConfig:y}=(0,f.useContext)(br),I=os({sidebarConfig:y}),B=(0,pr.TH)(),{selectedMenuItemIndex:Y,setSelectedMenuItemIndex:Z}=(0,f.useContext)(Ns),fe=(Te,Ee)=>{Z(Ee===Y?-1:Ee)},pe=m===Y&&Y>=0||m!==Y&&!(Y>=0)&&o===B.pathname;return(0,r.jsx)(vi.Z,{"aria-label":l,label:l,icon:d,component:de.r,to:o||B.pathname,onChange:fe,value:m,selected:pe,classes:I})},Fs=e=>{const{children:o,to:l,label:d,icon:m,value:y}=e,{isMobile:I}=jo();return I?(0,r.jsx)(bi,{to:l,label:d,icon:m,value:y}):(0,r.jsx)(r.Fragment,{children:o})},ss=(0,g.Z)(e=>({root:{position:"fixed",backgroundColor:e.palette.navigation.background,color:e.palette.navigation.color,bottom:0,left:0,right:0,zIndex:e.zIndex.snackbar,borderTop:"1px solid #383838","@media print":{display:"none"}},overlay:o=>({background:e.palette.navigation.background,width:"100%",bottom:`${o.sidebarConfig.mobileSidebarHeight}px`,height:`calc(100% - ${o.sidebarConfig.mobileSidebarHeight}px)`,flex:"0 1 auto",overflow:"auto"}),overlayHeader:{display:"flex",color:e.palette.text.primary,alignItems:"center",justifyContent:"space-between",padding:e.spacing(2,3)},overlayHeaderClose:{color:e.palette.text.primary},marginMobileSidebar:o=>({marginBottom:`${o.sidebarConfig.mobileSidebarHeight}px`})})),Si=e=>(0,Gr.orderBy)(e,({props:{priority:o}})=>Number.isInteger(o)?o:-1,"desc"),Ci=f.createElement(Fs).type,wi=({children:e,label:o="Menu",open:l,onClose:d})=>{const{sidebarConfig:m}=(0,f.useContext)(br),y=ss({sidebarConfig:m});return(0,r.jsxs)(mi.ZP,{anchor:"bottom",open:l,onClose:d,ModalProps:{BackdropProps:{classes:{root:y.marginMobileSidebar}}},classes:{root:y.marginMobileSidebar,paperAnchorBottom:y.overlay},children:[(0,r.jsxs)(A.Z,{className:y.overlayHeader,children:[(0,r.jsx)(rt.Z,{variant:"h3",children:o}),(0,r.jsx)(H.Z,{onClick:d,classes:{root:y.overlayHeaderClose},children:(0,r.jsx)(Co.Z,{})})]}),(0,r.jsx)(A.Z,{component:"nav",children:e})]})},Ns=(0,f.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),ma=e=>{const{sidebarConfig:o}=(0,f.useContext)(br),{children:l}=e,d=ss({sidebarConfig:o}),m=(0,pr.TH)(),[y,I]=(0,f.useState)(-1);(0,f.useEffect)(()=>{I(-1)},[m.pathname]);let B=(0,p.vJ)(l,Z=>Z.getElements().filter(fe=>fe.type===Ci));if(l)B.length?B=Si(B):B.push((0,r.jsx)(Fs,{icon:(0,r.jsx)(wo.Z,{}),children:l},"default_menu"));else return null;const Y=y>=0&&!B[y].props.to;return(0,r.jsx)(Bs,{value:{isOpen:!0,setOpen:()=>{}},children:(0,r.jsxs)(Ns.Provider,{value:{selectedMenuItemIndex:y,setSelectedMenuItemIndex:I},children:[(0,r.jsx)(wi,{label:B[y]&&B[y].props.label,open:Y,onClose:()=>I(-1),children:B[y]&&B[y].props.children}),(0,r.jsx)(es.Z,{className:d.root,"data-testid":"mobile-sidebar-root",component:"nav",children:B})]})})};var Eo;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(Eo||(Eo={}));const Zs={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(Eo.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(Eo.SIDEBAR_PIN_STATE,JSON.stringify(e))}},ji=(0,g.Z)(e=>({root:{width:"100%",transition:"padding-left 0.1s ease-out",isolation:"isolate",[e.breakpoints.up("sm")]:{paddingLeft:o=>o.isPinned?o.sidebarConfig.drawerWidthOpen:o.sidebarConfig.drawerWidthClosed},[e.breakpoints.down("xs")]:{paddingBottom:o=>o.sidebarConfig.mobileSidebarHeight},"@media print":{padding:"0px !important"}},content:{zIndex:0,isolation:"isolate","&:focus":{outline:0}}}),{name:"BackstageSidebarPage"}),Us=(0,f.createContext)({content:{contentRef:void 0}});function Ms(e){const[o,l]=(0,f.useState)(()=>Zs.getSidebarPinState()),{sidebarConfig:d}=(0,f.useContext)(br),m=(0,f.useRef)(null),y=(0,f.useMemo)(()=>({content:{contentRef:m}}),[m]);(0,f.useEffect)(()=>{Zs.setSidebarPinState(o)},[o]);const I=(0,Pe.Z)(Z=>Z.breakpoints.down("xs"),{noSsr:!0}),B=()=>l(!o),Y=ji({isPinned:o,sidebarConfig:d});return(0,r.jsx)(xi,{value:{isPinned:o,toggleSidebarPinState:B,isMobile:I},children:(0,r.jsx)(Us.Provider,{value:y,children:(0,r.jsx)(A.Z,{className:Y.root,children:e.children})})})}function Ao(){const{content:e}=(0,f.useContext)(Us);return{focusContent:(0,f.useCallback)(()=>{var l,d;e==null||(l=e.contentRef)===null||l===void 0||(d=l.current)===null||d===void 0||d.focus()},[e]),contentRef:e==null?void 0:e.contentRef}}const zs=(0,g.Z)(e=>({drawer:{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",left:0,top:0,bottom:0,zIndex:e.zIndex.appBar,background:e.palette.navigation.background,overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest}),"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"},"@media print":{display:"none"}},drawerWidth:o=>({width:o.sidebarConfig.drawerWidthClosed}),drawerOpen:o=>({width:o.sidebarConfig.drawerWidthOpen,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shorter})}),visuallyHidden:{top:0,position:"absolute",zIndex:1e3,transform:"translateY(-200%)","&:focus":{transform:"translateY(5px)"}}}),{name:"BackstageSidebar"});var Jn;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(Jn||(Jn={}));const Ei=e=>{const{sidebarConfig:o}=(0,f.useContext)(br),{openDelayMs:l=o.defaultOpenDelayMs,closeDelayMs:d=o.defaultCloseDelayMs,disableExpandOnHover:m,children:y}=e,I=zs({sidebarConfig:o}),B=(0,Pe.Z)(mn=>mn.breakpoints.down("md"),{noSsr:!0}),[Y,Z]=(0,f.useState)(Jn.Closed),fe=(0,f.useRef)(),{isPinned:pe,toggleSidebarPinState:Te}=jo(),Ee=()=>{pe||m||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),Y!==Jn.Open&&!B&&(fe.current=window.setTimeout(()=>{fe.current=void 0,Z(Jn.Open)},l),Z(Jn.Idle)))},Ze=()=>{pe||m||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),Y===Jn.Idle?Z(Jn.Closed):Y===Jn.Open&&(fe.current=window.setTimeout(()=>{fe.current=void 0,Z(Jn.Closed)},d)))},it=Y===Jn.Open&&!B||pe,Pt=mn=>{mn?(Z(Jn.Open),Te()):(Z(Jn.Closed),Te())};return(0,r.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,r.jsx)(va,{}),(0,r.jsx)(Bs,{value:{isOpen:it,setOpen:Pt},children:(0,r.jsx)(A.Z,{className:I.root,"data-testid":"sidebar-root",onMouseEnter:m?()=>{}:Ee,onFocus:m?()=>{}:Ee,onMouseLeave:m?()=>{}:Ze,onBlur:m?()=>{}:Ze,children:(0,r.jsx)(A.Z,{className:on()(I.drawer,I.drawerWidth,{[I.drawerOpen]:it}),children:y})})})]})},Ai=e=>{var o;const l=pa((o=e.sidebarOptions)!==null&&o!==void 0?o:{});var d;const m=fa((d=e.submenuOptions)!==null&&d!==void 0?d:{}),{children:y,disableExpandOnHover:I,openDelayMs:B,closeDelayMs:Y}=e,{isMobile:Z}=jo();return Z?(0,r.jsx)(ma,{children:y}):(0,r.jsx)(br.Provider,{value:{sidebarConfig:l,submenuConfig:m},children:(0,r.jsx)(Ei,{openDelayMs:B,closeDelayMs:Y,disableExpandOnHover:I,children:y})})};function va(){const{sidebarConfig:e}=(0,f.useContext)(br),{focusContent:o,contentRef:l}=Ao(),d=zs({sidebarConfig:e});return l!=null&&l.current?(0,r.jsx)(ge.Z,{onClick:o,variant:"contained",className:on()(d.visuallyHidden),children:"Skip to content"}):null}function Yr(e,o,l=!1){const d=new URLSearchParams(o.search).toString(),m=Is().parse(d),y=new URLSearchParams(e.search).toString(),I=Is().parse(y),B=l?Gr.isEqual:Gr.isMatch;return(0,Gr.isEqual)(o.pathname,e.pathname)&&B(I,m)}const ya=(0,g.Z)(e=>{var o,l;return{item:{height:48,width:"100%","&:hover":{background:((o=e.palette.navigation.navItem)===null||o===void 0?void 0:o.hoverBackground)||"#6f6f6f",color:e.palette.navigation.selectedColor},display:"flex",alignItems:"center",color:e.palette.navigation.color,padding:e.spacing(2.5),cursor:"pointer",position:"relative",background:"none",border:"none"},itemContainer:{width:"100%"},selected:{background:"#6f6f6f",color:e.palette.common.white},label:{margin:e.spacing(1.75),marginLeft:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis",lineHeight:1},subtitle:{fontSize:10,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"},dropdownArrow:{position:"absolute",right:21},dropdown:{display:"flex",flexDirection:"column",alignItems:"end"},dropdownItem:{width:"100%",padding:"10px 0 10px 0","&:hover":{background:((l=e.palette.navigation.navItem)===null||l===void 0?void 0:l.hoverBackground)||"#6f6f6f",color:e.palette.navigation.selectedColor}},textContent:{color:e.palette.navigation.color,paddingLeft:e.spacing(4),paddingRight:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"}}},{name:"BackstageSidebarSubmenuItem"}),za=e=>{const{title:o,subtitle:l,to:d,icon:m,dropdownItems:y,exact:I}=e,B=ya(),{setIsHoveredOn:Y}=useContext(SidebarItemWithSubmenuContext),Z=()=>{Y(!1)},fe=useResolvedPath(d!=null?d:""),pe=useLocation();let Te=isLocationMatch(pe,fe,I);const[Ee,Ze]=useState(!1),it=()=>{Ze(!Ee)};return y!==void 0?(y.some(Pt=>{const mn=resolvePath(Pt.to);return Te=isLocationMatch(pe,mn,I),Te}),_jsxs(Box,{className:B.itemContainer,children:[_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Button,{role:"button",onClick:it,onTouchStart:Pt=>Pt.stopPropagation(),className:classnames(B.item,Te?B.selected:void 0),children:[m&&_jsx(m,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",component:"span",className:B.label,children:[o,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",component:"span",className:B.subtitle,children:l})]}),Ee?_jsx(ArrowDropUpIcon,{className:B.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:B.dropdownArrow})]})}),y&&Ee&&_jsx(Box,{className:B.dropdown,children:y.map((Pt,mn)=>_jsx(Tooltip,{title:Pt.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:Pt.to,underline:"none",className:B.dropdownItem,onClick:Z,onTouchStart:Fn=>Fn.stopPropagation(),children:_jsx(Typography,{component:"span",className:B.textContent,children:Pt.title})})},mn))})]})):_jsx(Box,{className:B.itemContainer,children:_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:d,underline:"none",className:classnames(B.item,Te?B.selected:void 0),onClick:Z,onTouchStart:Pt=>Pt.stopPropagation(),children:[m&&_jsx(m,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",component:"span",className:B.label,children:[o,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",component:"span",className:B.subtitle,children:l})]})]})})})};var is;const Ti=(0,g.Z)(e=>({root:{zIndex:1e3,position:"relative",overflow:"visible",width:e.spacing(7)+1},drawer:o=>{var l;return{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",[e.breakpoints.up("sm")]:{marginLeft:o.left,transition:e.transitions.create("margin-left",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})},top:0,bottom:0,padding:0,background:(is=(l=e.palette.navigation.submenu)===null||l===void 0?void 0:l.background)!==null&&is!==void 0?is:"#404040",overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",cursor:"default",width:o.submenuConfig.drawerWidthClosed,transitionDelay:`${o.submenuConfig.defaultOpenDelayMs}ms`,"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}},drawerOpen:o=>({width:o.submenuConfig.drawerWidthOpen,[e.breakpoints.down("xs")]:{width:"100%",position:"relative",paddingLeft:e.spacing(3),left:0,top:0}}),title:{fontSize:e.typography.h5.fontSize,fontWeight:e.typography.fontWeightMedium,color:e.palette.common.white,padding:e.spacing(2.5),[e.breakpoints.down("xs")]:{display:"none"}}}),{name:"BackstageSidebarSubmenu"}),Ws=e=>{const{isOpen:o}=rs(),{sidebarConfig:l,submenuConfig:d}=(0,f.useContext)(br),m=o?l.drawerWidthOpen:l.drawerWidthClosed,y=Ti({left:m,submenuConfig:d}),{isHoveredOn:I}=(0,f.useContext)(gi),[B,Y]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{Y(I)},[I]),(0,r.jsxs)(A.Z,{className:on()(y.drawer,{[y.drawerOpen]:B}),children:[(0,r.jsx)(rt.Z,{variant:"h5",component:"span",className:y.title,children:e.title}),e.children]})};var xa=n(26739),as=n(76600),Vs=n(83543),Hs=n(59797),Gs=n(98989);const Ri=(0,g.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),ls=()=>{const e=Ri();return _jsxs(Box,{className:e.iconContainer,children:[_jsx(Box,{className:e.arrow1,children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})}),_jsx(Box,{children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})})]})};var Wa=null;const ba=(0,g.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),Va=()=>{const e=ba();return _jsxs(Box,{className:e.iconContainer,children:[_jsx(Box,{className:e.arrow1,children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})}),_jsx(Box,{children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})})]})};var Ha=null,cs,Dn;const Sa=e=>(0,g.Z)(o=>{var l,d;return{root:{color:o.palette.navigation.color,display:"flex",flexFlow:"row nowrap",alignItems:"center",height:48,cursor:"pointer"},buttonItem:{background:"none",border:"none",width:"100%",margin:0,padding:0,textAlign:"inherit",font:"inherit",textTransform:"none"},closed:{width:e.drawerWidthClosed,justifyContent:"center"},open:{[o.breakpoints.up("sm")]:{width:e.drawerWidthOpen}},highlightable:{"&:hover":{background:(cs=(l=o.palette.navigation.navItem)===null||l===void 0?void 0:l.hoverBackground)!==null&&cs!==void 0?cs:"#404040"}},highlighted:{background:(Dn=(d=o.palette.navigation.navItem)===null||d===void 0?void 0:d.hoverBackground)!==null&&Dn!==void 0?Dn:"#404040"},label:{fontWeight:"bold",whiteSpace:"nowrap",lineHeight:"auto",flex:"3 1 auto",width:"110px",overflow:"hidden","text-overflow":"ellipsis"},iconContainer:{boxSizing:"border-box",height:"100%",width:e.iconContainerWidth,marginRight:-o.spacing(2),display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"0"},searchRoot:{marginBottom:12},searchField:{color:"#b5b5b5",fontWeight:o.typography.fontWeightBold,fontSize:o.typography.fontSize},searchFieldHTMLInput:{padding:o.spacing(2,0,2)},searchContainer:{width:e.drawerWidthOpen-e.iconContainerWidth},secondaryAction:{width:o.spacing(6),textAlign:"center",marginRight:o.spacing(1)},closedItemIcon:{width:"100%",justifyContent:"center"},submenuArrow:{display:"flex"},expandButton:{background:"none",border:"none",color:o.palette.navigation.color,width:"100%",cursor:"pointer",position:"relative",height:48},arrows:{position:"absolute",right:10},selected:{"&$root":{borderLeft:`solid ${e.selectedIndicatorWidth}px ${o.palette.navigation.indicator}`,color:o.palette.navigation.selectedColor},"&$closed":{width:e.drawerWidthClosed},"& $closedItemIcon":{paddingRight:e.selectedIndicatorWidth},"& $iconContainer":{marginLeft:-e.selectedIndicatorWidth}}}},{name:"BackstageSidebarItem"});function To(e){return(0,f.useMemo)(()=>Sa(e),[e])()}const Ca=(e,o)=>(0,p.vJ)(e.props.children,l=>{let d=!1;return l.getElements().forEach(({props:{to:m,dropdownItems:y}})=>{if(!d){if(y!=null&&y.length){y.forEach(({to:I})=>d=d||Yr(o,(0,qo.i3)(I)));return}m&&(d=Yr(o,(0,qo.i3)(m)))}}),d},[o.pathname]);function Ks(e){return e.to===void 0}const wa=f.createElement(Ws).type,ja=f.forwardRef(function({to:o,end:l,style:d,className:m,activeStyle:y,caseSensitive:I,activeClassName:B="active","aria-current":Y="page",...Z},fe){let{pathname:pe}=(0,pr.TH)(),{pathname:Te}=(0,pr.WU)(o);I||(pe=pe.toLocaleLowerCase("en-US"),Te=Te.toLocaleLowerCase("en-US"));let Ee=pe===Te;!Ee&&!l&&(Ee=pe.startsWith(`${Te}/`));const Ze=Ee?Y:void 0;return(0,r.jsx)(N.rU,{...Z,to:o,ref:fe,"aria-current":Ze,style:{...d,...Ee?y:void 0},className:on()([m,Ee?B:void 0])})}),Ii=(0,f.forwardRef)((e,o)=>{const{icon:l,text:d,hasNotifications:m=!1,hasSubmenu:y=!1,disableHighlight:I=!1,onClick:B,noTrack:Y,children:Z,className:fe,...pe}=e,{sidebarConfig:Te}=(0,f.useContext)(br),Ee=To(Te),{isOpen:Ze}=rs(),it=!Ze&&y?{display:"flex",marginLeft:"20px"}:{lineHeight:"0"},Pt=(0,r.jsxs)(A.Z,{style:it,children:[(0,r.jsx)(l,{fontSize:"small"}),!Ze&&y?(0,r.jsx)(Gs.Z,{fontSize:"small"}):(0,r.jsx)(r.Fragment,{})]}),mn=(0,r.jsx)(xa.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!m,className:on()({[Ee.closedItemIcon]:!Ze}),children:Pt}),Fn=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(A.Z,{"data-testid":"login-button",className:Ee.iconContainer,children:mn}),d&&(0,r.jsx)(rt.Z,{variant:"subtitle2",component:"span",className:Ee.label,children:d}),(0,r.jsx)("div",{className:Ee.secondaryAction,children:Z})]}),or=Ze?Fn:mn,Bt={onClick:B,className:on()(fe,Ee.root,Ze?Ee.open:Ee.closed,Ks(e)&&Ee.buttonItem,{[Ee.highlightable]:!I})},vn=(0,p.z$)(),{pathname:yn}=(0,pr.WU)(!Ks(e)&&e.to?e.to:""),gr=(0,f.useCallback)(Sr=>{if(!Y){const Cr="click",wr=d!=null?d:"Sidebar Item",fs=yn?{attributes:{to:yn}}:void 0;vn.captureEvent(Cr,wr,fs)}B==null||B(Sr)},[vn,d,yn,Y,B]);return Ks(e)?(0,r.jsx)(ge.Z,{role:"button","aria-label":d,...Bt,ref:o,onClick:gr,children:or}):(0,r.jsx)(ja,{...Bt,activeClassName:Ee.selected,to:e.to?e.to:"",ref:o,"aria-label":d||e.to,...pe,onClick:gr,children:or})}),Ea=({children:e,...o})=>{const{sidebarConfig:l}=(0,f.useContext)(br),d=To(l),[m,y]=(0,f.useState)(!1),I=(0,pr.TH)(),B=Ca(e,I),Y=(0,Pe.Z)(Te=>Te.breakpoints.down("sm")),Z=()=>{y(!0)},fe=()=>{y(!1)},pe=()=>Y?m?(0,r.jsx)(Hs.Z,{fontSize:"small",className:d.submenuArrow}):(0,r.jsx)(Vs.Z,{fontSize:"small",className:d.submenuArrow}):!m&&(0,r.jsx)(Gs.Z,{fontSize:"small",className:d.submenuArrow});return(0,r.jsx)(gi.Provider,{value:{isHoveredOn:m,setIsHoveredOn:y},children:(0,r.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:fe,onTouchStart:m?fe:Z,onMouseEnter:Z,className:on()(m&&d.highlighted),children:[(0,r.jsx)(Ii,{hasSubmenu:!0,className:B?d.selected:"",...o,children:pe()}),m&&e]})})},Pi=(0,f.forwardRef)((e,o)=>{const[l]=(0,p.vJ)(e.children,d=>d.getElements().filter(m=>m.type===wa));return l?(0,r.jsx)(Ea,{...e,children:l}):(0,r.jsx)(Ii,{...e,ref:o})});function Ga(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),[l,d]=useState(""),m=To(o),y=e.icon?e.icon:SearchIcon,I=()=>{e.onSearch(l),d("")},B=pe=>{pe.key==="Enter"&&(pe.preventDefault(),I())},Y=pe=>{d(pe.target.value)},Z=pe=>{pe.preventDefault(),pe.stopPropagation()},fe=pe=>{I(),pe.preventDefault()};return _jsx(Box,{className:m.searchRoot,children:_jsx(Pi,{icon:y,to:e.to,onClick:fe,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:l,onClick:Z,onChange:Y,onKeyDown:B,className:m.searchContainer,InputProps:{disableUnderline:!0,className:m.searchField},inputProps:{className:m.searchFieldHTMLInput}})})})}const Ka=(0,as.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),Ya=(0,as.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),Aa=(0,as.Z)("hr")(({theme:e})=>({height:1,width:"100%",background:"#383838",border:"none",margin:e.spacing(1.2,0)}),{name:"BackstageSidebarDivider"}),Ta=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.secondary,borderRadius:"5px"}}),Li=(0,as.Z)("div")(({theme:e})=>{const o=Ta(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":o,"&:hover":o}}),Ra=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),o=To(e),{isOpen:l,setOpen:d}=useSidebarOpenState();if(useMediaQuery(I=>I.breakpoints.down("md"),{noSsr:!0}))return null;const y=()=>{d(!l)};return _jsx(Button,{role:"button",onClick:y,className:o.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx(Box,{className:o.arrows,children:l?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},Oi=(0,g.Z)(e=>({introCard:o=>({color:"#b5b5b5",fontSize:12,width:o.sidebarConfig.drawerWidthOpen,marginTop:e.spacing(2.25),marginBottom:e.spacing(1.5),paddingLeft:o.sidebarConfig.iconPadding,paddingRight:o.sidebarConfig.iconPadding}),introDismiss:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:e.spacing(1.5)},introDismissLink:{color:"#dddddd",display:"flex",alignItems:"center",marginBottom:e.spacing(.5),"&:hover":{color:e.palette.linkHover,transition:e.transitions.create("color",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})}},introDismissText:{fontSize:"0.7rem",fontWeight:"bold",textTransform:"uppercase",letterSpacing:1},introDismissIcon:{width:18,height:18,marginRight:e.spacing(1.5)}}),{name:"BackstageSidebarIntro"});function ki(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),l=Oi({sidebarConfig:o}),{text:d,onClose:m}=e,y=()=>m();return _jsxs(Box,{className:l.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:d}),_jsx(Box,{className:l.introDismiss,children:_jsxs(IconButton,{onClick:y,className:l.introDismissLink,children:[_jsx(CloseIcon,{className:l.introDismissIcon}),_jsx(Typography,{component:"span",className:l.introDismissText,children:"Dismiss"})]})})]})}const Ys=e=>{const{text:o,onDismiss:l}=e,[d,m]=useState(!1),y=()=>{m(!0)};return _jsx(Collapse,{in:!d,onExited:l,children:_jsx(ki,{text:o,onClose:y})})},Bi=null,$i="And your recently viewed plugins will pop up here!";function Ia(e){const{isOpen:o}=useSidebarOpenState(),l={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},{value:d,set:m}=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:y,recentlyViewedItemsDismissed:I}=d!=null?d:{},B=()=>{m(Z=>({...l,...Z,starredItemsDismissed:!0}))},Y=()=>{m(Z=>({...l,...Z,recentlyViewedItemsDismissed:!0}))};return o?_jsxs(_Fragment,{children:[!y&&_jsxs(_Fragment,{children:[_jsx(Ys,{text:Bi,onDismiss:B}),_jsx(SidebarDivider,{})]}),!I&&_jsx(Ys,{text:$i,onDismiss:Y})]}):null}const Di=(0,g.Z)(e=>({root:{gridArea:"pageContent",minWidth:0,paddingTop:e.spacing(3),paddingBottom:e.spacing(3),paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}},stretch:{display:"flex",flexDirection:"column",flexGrow:1},noPadding:{padding:0}}),{name:"BackstageContent"});function Js(e){const{className:o,stretch:l,noPadding:d,children:m,...y}=e,{contentRef:I}=Ao(),B=Di();return(0,r.jsx)("article",{ref:I,tabIndex:-1,...y,className:on()(B.root,o,{[B.stretch]:l,[B.noPadding]:d}),children:m})}var Pa=n(6487),Fi=n(99152);const Ni=(0,g.Z)(e=>({tabsWrapper:{gridArea:"pageSubheader",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(3),minWidth:0},defaultTab:{...e.typography.caption,padding:e.spacing(3,3),textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,color:e.palette.text.secondary},selected:{color:e.palette.text.primary},tabRoot:{"&:hover":{backgroundColor:e.palette.background.default,color:e.palette.text.primary}}}),{name:"BackstageHeaderTabs"});function Zi(e){const{tabs:o,onChange:l,selectedIndex:d}=e,[m,y]=(0,f.useState)(d!=null?d:0),I=Ni(),B=(0,f.useCallback)((Y,Z)=>{d===void 0&&y(Z),l&&d!==Z&&l(Z)},[d,l]);return(0,f.useEffect)(()=>{d!==void 0&&y(d)},[d]),(0,r.jsx)(A.Z,{className:I.tabsWrapper,children:(0,r.jsx)(Fi.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"tabs",onChange:B,value:m,children:o.map((Y,Z)=>(0,f.createElement)(Pa.Z,{...Y.tabProps,"data-testid":`header-tab-${Z}`,label:Y.label,key:Y.id,value:Z,className:I.defaultTab,classes:{selected:I.selected,root:I.tabRoot}}))})})}function Ui(e){const o=(0,pr.UO)(),d=e.map(({path:Te,children:Ee})=>({caseSensitive:!1,path:`${Te}/*`,element:Ee})).sort((Te,Ee)=>Ee.path.replace(/\/\*$/,"").localeCompare(Te.path.replace(/\/\*$/,"")));var m;const y=(m=(0,pr.V$)(d))!==null&&m!==void 0?m:e[0].children;var I;let B=(I=o["*"])!==null&&I!==void 0?I:"";B.startsWith("/")||(B=`/${B}`);var Y;const[Z]=(Y=(0,qo.fp)(d,B))!==null&&Y!==void 0?Y:[],fe=Z?e.findIndex(Te=>`${Te.path}/*`===Z.route.path):0;var pe;return{index:fe===-1?0:fe,element:y,route:(pe=e[fe])!==null&&pe!==void 0?pe:e[0]}}function Qs(e){const{routes:o}=e,l=(0,pr.s0)(),{index:d,route:m,element:y}=Ui(o),I=(0,f.useMemo)(()=>o.map(Y=>({id:Y.path,label:Y.title,tabProps:Y.tabProps})),[o]),B=Y=>{let{path:Z}=o[Y];Z=Z.replace(/\/\*$/,""),Z=Z.replace(/^\//,""),l(Z)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Zi,{tabs:I,selectedIndex:d,onChange:B}),(0,r.jsxs)(Js,{children:[(0,r.jsx)(So.q,{title:m.title}),y]})]})}const ds=()=>null;(0,p.R5)(ds,"core.gatherMountPoints",!0);function Xs(e){const o=(0,r.jsx)(ds,{path:"",title:"",children:(0,r.jsx)("div",{})}).type;return f.Children.toArray(e).flatMap(l=>{if(!(0,f.isValidElement)(l))return[];if(l.type===f.Fragment)return Xs(l.props.children);if(l.type!==o)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:d,title:m,children:y,tabProps:I}=l.props;return[{path:d,title:m,children:y,tabProps:I}]})}function Mi(e){const o=Xs(e.children);return(0,r.jsx)(Qs,{routes:o})}Mi.Route=ds;const zi=(0,g.Z)(e=>({value:{marginBottom:e.spacing(.75)},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function Wi(e){const{value:o,subvalue:l}=e,d=zi();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(A.Z,{className:d.value,children:o}),(0,r.jsx)(A.Z,{className:d.subvalue,children:l})]})}var Qn=n(67222),Vi=n(21070),Hi=n(90324),Gi=n(98281),_s=n(48049),ei=n(51209),ti=n(33375),Ki=n(44233),Yi=n(27604),ni=n(36444),Ji=n(37971),i=n(59709),t=n(17373),s=n(3702),a=n(93111);const h=(0,g.Z)(e=>({root:{height:"100%",width:"315px",display:"flex",flexDirection:"column",marginRight:e.spacing(3)},value:{fontWeight:"bold",fontSize:18},header:{display:"flex",alignItems:"center",height:e.spacing(7.5),justifyContent:"space-between",borderBottom:`1px solid ${e.palette.grey[500]}`},filters:{display:"flex",flexDirection:"column","& > *":{marginTop:e.spacing(2)}}}),{name:"BackstageTableFilters"}),w=e=>{var o;const l=h(),{onChangeFilters:d}=e,[m,y]=(0,f.useState)({...e.selectedFilters}),[I,B]=(0,f.useState)(!1),Y=()=>{y({}),B(Z=>!Z)};return(0,f.useEffect)(()=>{d(m)},[m,d]),(0,r.jsxs)(A.Z,{className:l.root,children:[(0,r.jsxs)(A.Z,{className:l.header,children:[(0,r.jsx)(A.Z,{className:l.value,children:"Filters"}),(0,r.jsx)(ge.Z,{color:"primary",onClick:Y,children:"Clear all"})]}),(0,r.jsx)(A.Z,{className:l.filters,children:((o=e.filters)===null||o===void 0?void 0:o.length)&&e.filters.map(Z=>(0,r.jsx)(mo,{triggerReset:I,...Z.element,selected:m[Z.element.label],onChange:fe=>y({...m,[Z.element.label]:fe})},Z.element.label))})]})},k={Add:(0,f.forwardRef)((e,o)=>(0,r.jsx)(Vi.Z,{...e,ref:o})),Check:(0,f.forwardRef)((e,o)=>(0,r.jsx)(Gi.Z,{...e,ref:o})),Clear:(0,f.forwardRef)((e,o)=>(0,r.jsx)(ti.Z,{...e,ref:o})),Delete:(0,f.forwardRef)((e,o)=>(0,r.jsx)(Ki.Z,{...e,ref:o})),DetailPanel:(0,f.forwardRef)((e,o)=>(0,r.jsx)(ei.Z,{...e,ref:o})),Edit:(0,f.forwardRef)((e,o)=>(0,r.jsx)(Yi.Z,{...e,ref:o})),Export:(0,f.forwardRef)((e,o)=>(0,r.jsx)(s.Z,{...e,ref:o})),Filter:(0,f.forwardRef)((e,o)=>(0,r.jsx)(ni.Z,{...e,ref:o})),FirstPage:(0,f.forwardRef)((e,o)=>(0,r.jsx)(Ji.Z,{...e,ref:o})),LastPage:(0,f.forwardRef)((e,o)=>(0,r.jsx)(i.Z,{...e,ref:o})),NextPage:(0,f.forwardRef)((e,o)=>(0,r.jsx)(ei.Z,{...e,ref:o})),PreviousPage:(0,f.forwardRef)((e,o)=>(0,r.jsx)(_s.Z,{...e,ref:o})),ResetSearch:(0,f.forwardRef)((e,o)=>(0,r.jsx)(ti.Z,{...e,ref:o})),Search:(0,f.forwardRef)((e,o)=>(0,r.jsx)(ni.Z,{...e,ref:o})),SortArrow:(0,f.forwardRef)((e,o)=>(0,r.jsx)(Hi.Z,{...e,ref:o})),ThirdStateCheck:(0,f.forwardRef)((e,o)=>(0,r.jsx)(t.Z,{...e,ref:o})),ViewColumn:(0,f.forwardRef)((e,o)=>(0,r.jsx)(a.Z,{...e,ref:o}))};function F(e,o){const l=o.split(".");let d=e[l[0]];for(let m=1;m<l.length;++m){if(d===void 0)return d;const y=l[m];d=d[y]}return d}const ie=(0,kn.Z)(e=>({header:{padding:e.spacing(1,2,1,2.5),borderTop:`1px solid ${e.palette.grey.A100}`,borderBottom:`1px solid ${e.palette.grey.A100}`,fontWeight:e.typography.fontWeightBold,position:"static",wordBreak:"normal"}}),{name:"BackstageTableHeader"})(Qn.W$),xe=(0,kn.Z)(e=>({root:{padding:e.spacing(3,0,2.5,2.5)},title:{"& > h6":{fontWeight:e.typography.fontWeightBold}},searchField:{paddingRight:e.spacing(2)}}),{name:"BackstageTableToolbar"})(Qn.UW),Re=(0,g.Z)(e=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:e.typography.fontWeightBold,fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),ze=(0,g.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function mt(e,o){return e.map(l=>{var d;const m=(d=l.headerStyle)!==null&&d!==void 0?d:{};let y=l.cellStyle||{};if(l.highlight)if(m.color=o.palette.textContrast,typeof y=="object")y.fontWeight=o.typography.fontWeightBold;else{const I=y;y=(B,Y,Z)=>({...I(B,Y,Z),fontWeight:o.typography.fontWeightBold})}return{...l,headerStyle:m,cellStyle:y}})}function wt(e,o){return(0,Gr.transform)(e,(l,d,m)=>{(0,Gr.isEqual)(d,o[m])||(l[m]=d)})}const jt={search:"",filtersOpen:!1,filters:{}};function Vt(e){const{toolbarRef:o,setSearch:l,hasFilters:d,selectedFiltersLength:m,toggleFilters:y}=e,I=Re(),B=(0,f.useCallback)(Y=>{e.onSearchChanged(Y),l(Y)},[e,l]);return d?(0,r.jsxs)(A.Z,{className:I.root,children:[(0,r.jsxs)(A.Z,{className:I.root,children:[(0,r.jsx)(H.Z,{onClick:y,"aria-label":"filter list",children:(0,r.jsx)(ni.Z,{})}),(0,r.jsxs)(rt.Z,{className:I.title,children:["Filters (",m,")"]})]}),(0,r.jsx)(xe,{...e,ref:o,onSearchChanged:B})]}):(0,r.jsx)(xe,{...e,ref:o,onSearchChanged:B})}function Wt(e){const{data:o,columns:l,options:d,title:m,subtitle:y,filters:I,initialState:B,emptyContent:Y,onStateChange:Z,components:fe,...pe}=e,Te=ze(),Ee=(0,ae.Z)(),Ze={...jt,...B},[it,Pt]=(0,f.useState)(Ze.filtersOpen),mn=(0,f.useCallback)(()=>Pt(Wn=>!Wn),[Pt]),[Fn,or]=(0,f.useState)(0),[Bt,vn]=(0,f.useState)(o),[yn,gr]=(0,f.useState)(Ze.filters),Sr=mt(l,Ee),[Cr,wr]=(0,f.useState)(Ze.search);(0,f.useEffect)(()=>{if(Z){const Wn=wt({search:Cr,filtersOpen:it,filters:yn},jt);Z(Wn)}},[Cr,it,yn,Z]);const fs={headerStyle:{textTransform:"uppercase"}},Qr=(0,f.useCallback)(Wn=>{var Pr;return(Pr=l.find(lo=>lo.title===Wn))===null||Pr===void 0?void 0:Pr.field},[l]);(0,f.useEffect)(()=>{if(typeof o=="function")return;if(!yn){vn(o);return}const Wn=Object.values(yn);if(o&&Wn.flat().length){const Pr=o.filter(lo=>!!Object.entries(yn).filter(([,co])=>!!co.length).every(([co,Tn])=>{const Bn=F(lo,Qr(co));return Array.isArray(Bn)&&Array.isArray(Tn)?Bn.some(Lo=>Tn.includes(Lo)):Array.isArray(Bn)?Bn.includes(Tn):Array.isArray(Tn)?Tn.includes(Bn):Bn===Tn}));vn(Pr)}else vn(o);or(Wn.flat().length)},[o,yn,Qr]);const ra=(Wn,Pr)=>{const lo=Tn=>{const Bn=new Set,Lo=uo=>{uo!=null&&Bn.add(uo)};return Pr&&Pr.forEach(uo=>{const gs=F(uo,Qr(Tn));Array.isArray(gs)?gs.forEach(Lo):Lo(gs)}),Bn},co=Tn=>({placeholder:"All results",label:Tn.column,multiple:Tn.type==="multiple-select",items:[...lo(Tn.column)].sort().map(Bn=>({label:Bn,value:Bn}))});return Wn.map(Tn=>({type:Tn.type,element:co(Tn)}))},un=!!(I!=null&&I.length),Po=(0,f.useCallback)(Wn=>(0,r.jsx)(Vt,{setSearch:wr,hasFilters:un,selectedFiltersLength:Fn,toggleFilters:mn,...Wn}),[mn,un,Fn,wr]),ri=typeof o!="function"&&o.length===0,Xr=l.length,oa=(0,f.useCallback)(Wn=>Y&&ri?(0,r.jsx)("tbody",{children:(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:Xr,children:Y})})}):(0,r.jsx)(Qn.os,{...Wn}),[ri,Y,Xr]);return(0,r.jsxs)(A.Z,{className:Te.root,children:[it&&o&&typeof o!="function"&&(I==null?void 0:I.length)&&(0,r.jsx)(w,{filters:ra(I,o),selectedFilters:yn,onChangeFilters:gr}),(0,r.jsx)(Qn.ZP,{components:{Header:ie,Toolbar:Po,Body:oa,...fe},options:{...fs,...d},columns:Sr,icons:k,title:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rt.Z,{variant:"h5",component:"h2",children:m}),y&&(0,r.jsx)(rt.Z,{color:"textSecondary",variant:"body1",children:y})]}),data:typeof o=="function"?o:Bt,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...pe})]})}Wt.icons=Object.freeze(k);var Xn=n(44311);function fr(e,o){const l=e[e.length-1];if(l)return l>=.9?o.palette.status.ok:l>=.5?o.palette.status.warning:o.palette.status.error}function Ir(e){const o=useTheme();if(!e.data)return null;var l;return _jsxs(Sparklines,{width:120,height:30,min:0,max:1,...e,children:[e.title&&_jsx("title",{children:e.title}),_jsx(SparklinesLine,{color:(l=e.color)!==null&&l!==void 0?l:fr(e.data,o)})]})}const Ro=e=>(0,g.Z)(o=>({container:{width:"100%",display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-end",alignItems:"center",marginBottom:o.spacing(2),textAlign:e.textAlign},leftItemsBox:{flex:"1 1 auto",minWidth:0,overflow:"visible"},rightItemsBox:{flex:"0 1 auto",display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center",marginLeft:o.spacing(1),minWidth:0,overflow:"visible"},description:{},title:{display:"inline-flex",marginBottom:0}}),{name:"BackstageContentHeader"}),Qi=({title:e="Unknown page",className:o})=>(0,r.jsx)(rt.Z,{variant:"h4",component:"h2",className:o,"data-testid":"header-title",children:e});function Xi(e){const{description:o,title:l,titleComponent:d=void 0,children:m,textAlign:y="left"}=e,I=Ro({textAlign:y})(),B=d||(0,r.jsx)(Qi,{title:l,className:I.title});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(So.q,{title:l}),(0,r.jsxs)(A.Z,{className:I.container,children:[(0,r.jsxs)(A.Z,{className:I.leftItemsBox,children:[B,o&&(0,r.jsx)(rt.Z,{className:I.description,variant:"body2",children:o})]}),(0,r.jsx)(A.Z,{className:I.rightItemsBox,children:m})]})]})}var us=n.p+"static/mic-drop.fe3ef4d0..svg";const qi=(0,g.Z)(e=>({micDrop:{maxWidth:"60%",bottom:e.spacing(2),right:e.spacing(2),[e.breakpoints.down("xs")]:{maxWidth:"96%",bottom:"unset",right:"unset",margin:`${e.spacing(10)}px auto ${e.spacing(4)}px`}}}),{name:"BackstageErrorPageMicDrop"}),Jr=()=>{const e=qi();return(0,r.jsx)("img",{src:us,className:e.micDrop,alt:"Girl dropping mic from her hands"})},Ja=(0,g.Z)(e=>({container:{padding:e.spacing(8),[e.breakpoints.down("xs")]:{padding:e.spacing(2)}},title:{paddingBottom:e.spacing(5),[e.breakpoints.down("xs")]:{paddingBottom:e.spacing(4),fontSize:e.typography.h3.fontSize}},subtitle:{color:e.palette.textSubtle}}),{name:"BackstageErrorPage"});function Qa(e){const{status:o,statusMessage:l,additionalInfo:d,supportUrl:m}=e,y=Ja(),I=(0,pr.s0)(),B=Qo();return(0,r.jsxs)(Yt.Z,{container:!0,spacing:0,className:y.container,children:[(0,r.jsxs)(Yt.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,r.jsxs)(rt.Z,{"data-testid":"error",variant:"body1",className:y.subtitle,children:["ERROR ",o,": ",l]}),(0,r.jsx)(rt.Z,{variant:"body1",className:y.subtitle,children:d}),(0,r.jsx)(rt.Z,{variant:"h2",className:y.title,children:"Looks like someone dropped the mic!"}),(0,r.jsxs)(rt.Z,{variant:"h6",children:[(0,r.jsx)(de.r,{to:"#","data-testid":"go-back-link",onClick:()=>I(-1),children:"Go back"}),"... or please"," ",(0,r.jsx)(de.r,{to:m||B.url,children:"contact support"})," if you think this is a bug."]})]}),(0,r.jsx)(Jr,{})]})}var Xa=n(16173);const qa=(0,kn.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(rt.Z),_i=(0,kn.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(A.Z);function _a(e){const{children:o,...l}=e,[d,m]=f.useState(null),y=f.Children.toArray(o),[I,B,...Y]=y,Z=Y.length?Y.pop():y[y.length-1],fe=y.length>3,pe=Ze=>{m(Ze.currentTarget)},Te=()=>{m(null)},Ee=Boolean(d);return(0,r.jsxs)(f.Fragment,{children:[(0,r.jsxs)(Xa.Z,{"aria-label":"breadcrumb",...l,children:[y.length>1&&(0,r.jsx)(_i,{clone:!0,children:I}),y.length>2&&(0,r.jsx)(_i,{clone:!0,children:B}),fe&&(0,r.jsx)(qa,{onClick:pe,children:"..."}),(0,r.jsx)(A.Z,{style:{fontStyle:"italic"},children:Z})]}),(0,r.jsx)(Rs.ZP,{open:Ee,anchorEl:d,onClose:Te,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,r.jsx)(Zt.Z,{children:Y.map((Ze,it)=>(0,r.jsx)(_t.Z,{button:!0,children:(0,r.jsx)(_i,{clone:!0,children:Ze})},it))})})]})}const el=(0,g.Z)(e=>({header:{gridArea:"pageHeader",padding:e.spacing(3),width:"100%",boxShadow:e.shadows[4],position:"relative",zIndex:100,display:"flex",flexDirection:"row",alignItems:"center",backgroundImage:e.page.backgroundImage,backgroundPosition:"center",backgroundSize:"cover",[e.breakpoints.down("sm")]:{flexWrap:"wrap"}},leftItemsBox:{maxWidth:"100%",flexGrow:1},rightItemsBox:{width:"auto",alignItems:"center"},title:{color:e.page.fontColor,wordBreak:"break-word",fontSize:e.typography.h3.fontSize,marginBottom:0},subtitle:{color:e.page.fontColor,opacity:.8,display:"inline-block",marginTop:e.spacing(1),maxWidth:"75ch"},type:{textTransform:"uppercase",fontSize:11,opacity:.8,marginBottom:e.spacing(1),color:e.page.fontColor},breadcrumb:{color:e.page.fontColor},breadcrumbType:{fontSize:"inherit",opacity:.7,marginRight:-e.spacing(.3),marginBottom:e.spacing(.3)},breadcrumbTitle:{fontSize:"inherit",marginLeft:-e.spacing(.3),marginBottom:e.spacing(.3)}}),{name:"BackstageHeader"}),tl=({type:e,typeLink:o,classes:l,pageTitle:d})=>e?o?(0,r.jsxs)(_a,{className:l.breadcrumb,children:[(0,r.jsx)(de.r,{to:o,children:e}),(0,r.jsx)(rt.Z,{children:d})]}):(0,r.jsx)(rt.Z,{className:l.type,children:e}):null,nl=({pageTitle:e,classes:o,tooltip:l})=>{const d=(0,r.jsx)(rt.Z,{className:o.title,variant:"h1",children:e});return l?(0,r.jsx)(T.ZP,{title:l,placement:"top-start",children:d}):d},rl=({classes:e,subtitle:o})=>o?typeof o!="string"?(0,r.jsx)(r.Fragment,{children:o}):(0,r.jsx)(rt.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:o}):null;function La(e){const{children:o,pageTitleOverride:l,style:d,subtitle:m,title:y,tooltip:I,type:B,typeLink:Y}=e,Z=el(),pe=(0,p.h_)(p.Ds).getOptionalString("app.title")||"Backstage",Te=l||y,Ee=y||l,Ze=`${Te} | %s | ${pe}`,it=`${Te} | ${pe}`;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(So.q,{titleTemplate:Ze,defaultTitle:it}),(0,r.jsxs)("header",{style:d,className:Z.header,children:[(0,r.jsxs)(A.Z,{className:Z.leftItemsBox,children:[(0,r.jsx)(tl,{classes:Z,type:B,typeLink:Y,pageTitle:Ee}),(0,r.jsx)(nl,{classes:Z,pageTitle:Ee,tooltip:I}),(0,r.jsx)(rl,{classes:Z,subtitle:m})]}),(0,r.jsx)(Yt.Z,{container:!0,className:Z.rightItemsBox,spacing:4,children:o})]})]})}const ol=({label:e,secondaryLabel:o,icon:l,disabled:d=!1,onClick:m})=>_jsx(Fragment,{children:_jsxs(ListItem,{"data-testid":"header-action-item",disabled:d,button:!0,onClick:y=>{m&&m(y)},children:[l&&_jsx(ListItemIcon,{children:l}),_jsx(ListItemText,{primary:e,secondary:o})]})});function Dl(e){const{palette:{common:{white:o}}}=useTheme(),{actionItems:l}=e,[d,m]=React.useState(!1),y=React.useRef(null);return _jsxs(Fragment,{children:[_jsx(IconButton,{onClick:()=>m(!0),"data-testid":"header-action-menu",ref:y,style:{color:o,height:56,width:56,marginRight:-4,padding:0},children:_jsx(MoreVert,{})}),_jsx(Popover,{open:d,anchorEl:y.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>m(!1),children:_jsx(List,{children:l.map((I,B)=>_jsx(ol,{...I},`header-action-menu-${B}`))})})]})}const sl=(0,g.Z)(e=>({root:{textAlign:"left"},label:{color:e.page.fontColor,fontWeight:e.typography.fontWeightBold,letterSpacing:0,fontSize:e.typography.fontSize,marginBottom:e.spacing(1)/2,lineHeight:1},value:{color:(0,Qt.Fq)(e.page.fontColor,.8),fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),il=({value:e,className:o})=>(0,r.jsx)(rt.Z,{component:typeof e=="string"?"p":"span",className:o,children:e});function al(e){const{label:o,value:l,url:d}=e,m=sl(),y=(0,r.jsx)(il,{className:m.value,value:l||"<Unknown>"});return(0,r.jsx)(Yt.Z,{item:!0,children:(0,r.jsxs)(rt.Z,{component:"span",className:m.root,children:[(0,r.jsx)(rt.Z,{className:m.label,children:o}),d?(0,r.jsx)(de.r,{to:d,children:y}):y]})})}const ll=e=>(0,Yn.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),cl=(0,g.Z)(ll,{name:"BackstageItemCardHeader"});function dl(e){const{title:o,subtitle:l,children:d}=e,m=cl(e);return(0,r.jsxs)(A.Z,{className:m.root,children:[l&&(0,r.jsx)(rt.Z,{variant:"subtitle2",component:"h3",children:l}),o&&(0,r.jsx)(rt.Z,{variant:"h6",component:"h4",children:o}),d]})}function Fl(e){const{description:o,tags:l,title:d,type:m,subtitle:y,label:I,onClick:B,href:Y}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:d,subtitle:y||m})}),_jsxs(CardContent,{children:[l!=null&&l.length?_jsx(Box,{children:l.map((Z,fe)=>_jsx(Chip,{size:"small",label:Z},fe))}):null,o]}),_jsxs(CardActions,{children:[!Y&&_jsx(LinkButton,{to:"#",onClick:B,color:"primary",children:I}),Y&&_jsx(LinkButton,{to:Y,color:"primary",children:I})]})]})}const ul=e=>(0,Yn.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),hl=(0,g.Z)(ul,{name:"BackstageItemCardGrid"});function pl(e){const{children:o,...l}=e,d=hl(l);return(0,r.jsx)(A.Z,{className:d.root,...l,children:o})}var fl=n(41547);const gl=(0,g.Z)(e=>({root:{display:"grid",gridTemplateAreas:"'pageHeader pageHeader pageHeader' 'pageSubheader pageSubheader pageSubheader' 'pageNav pageContent pageSidebar'",gridTemplateRows:"max-content auto 1fr",gridTemplateColumns:"auto 1fr auto",overflowY:"auto",height:"100vh",[e.breakpoints.down("xs")]:{height:"100%"},"@media print":{display:"block",height:"auto",overflowY:"inherit"}}}),{name:"BackstagePage"});function Oa(e){const{themeId:o,children:l}=e,d=gl();return(0,r.jsx)(fl.Z,{theme:m=>({...m,page:m.getPageTheme({themeId:o})}),children:(0,r.jsx)("main",{className:d.root,children:l})})}function ml(e){const{themeId:o,children:l,...d}=e;return(0,r.jsxs)(Oa,{themeId:o,children:[(0,r.jsx)(La,{...d}),l]})}var tr=n(30195);const Nl=tr.z.object({providerInfo:tr.z.object({}).catchall(tr.z.unknown()).optional(),profile:tr.z.object({email:tr.z.string().optional(),displayName:tr.z.string().optional(),picture:tr.z.string().optional()}),backstageIdentity:tr.z.object({token:tr.z.string(),identity:tr.z.object({type:tr.z.literal("user"),userEntityRef:tr.z.string(),ownershipEntityRefs:tr.z.array(tr.z.string())})})}),ka={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function vl(e){const o=new Date(Date.now()+ka.defaultTokenExpiryMillis);if(!e)return o;const[l,d,m]=e.split("."),y=JSON.parse(window.atob(d));return typeof y.exp!="number"?o:new Date(y.exp*1e3-ka.tokenExpiryMarginMillis)}class Zl{async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:o}=this.getSessionSync(),l=o.identity.userEntityRef,d=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(l);if(!d)throw new TypeError(`Invalid user entity reference "${l}"`);return d[3]}async getIdToken(){return(await this.getSessionAsync()).backstageIdentity.token}getProfile(){return this.getSessionSync().profile}async getProfileInfo(){return(await this.getSessionAsync()).profile}async getBackstageIdentity(){return(await this.getSessionAsync()).backstageIdentity.identity}async getCredentials(){return{token:(await this.getSessionAsync()).backstageIdentity.token}}async signOut(){this.abortController.abort()}getSessionSync(){if(this.state.type==="active")return this.state.session;if(this.state.type==="fetching"&&this.state.previous)return this.state.previous;throw new Error("No session available. Try reloading your browser page.")}async getSessionAsync(){if(this.state.type==="fetching")return this.state.promise;if(this.state.type==="active"&&new Date<this.state.expiresAt)return this.state.session;const o=this.state.type==="active"?this.state.session:void 0,l=this.fetchSession().then(d=>(this.state={type:"active",session:d,expiresAt:vl(d.backstageIdentity.token)},d),d=>{throw this.state={type:"failed",error:d},d});return this.state={type:"fetching",promise:l,previous:o},l}async fetchSession(){const o=await this.options.discoveryApi.getBaseUrl("auth"),l=typeof this.options.headers=="function"?await this.options.headers():this.options.headers,d=new Headers(l);d.set("X-Requested-With","XMLHttpRequest");const m=await fetch(`${o}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:d,credentials:"include"});if(!m.ok)throw await ResponseError.fromResponse(m);return proxiedSessionSchema.parse(await m.json())}constructor(o){_define_property(this,"options",void 0),_define_property(this,"abortController",void 0),_define_property(this,"state",void 0),this.options=o,this.abortController=new AbortController,this.state={type:"empty"}}}const Ul=e=>{const o=useApi(discoveryApiRef),[{status:l,error:d},{execute:m}]=useAsync(async()=>{const y=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:o,headers:e.headers});await y.start(),e.onSignInSuccess(y)});return useMountEffect(m),l==="loading"?_jsx(Progress,{}):d?_jsx(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:d}):null},yl=(0,g.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),ea=({children:e})=>{const o=yl();return(0,r.jsx)(Yt.Z,{component:"li",item:!0,classes:o,children:e})};var hs=n(87612);class ta{getUserId(){return"guest"}async getIdToken(){}getProfile(){return{email:"guest@example.com",displayName:"Guest"}}async getProfileInfo(){return{email:"guest@example.com",displayName:"Guest"}}async getBackstageIdentity(){const o="user:default/guest";return{type:"user",userEntityRef:o,ownershipEntityRefs:[o]}}async getCredentials(){return{}}async signOut(){}}function xl(e){const[o,l,d]=e.split(".");return JSON.parse(window.atob(l))}class na{getUserId(){return this.result.userId}static fromResult(o){return new na(o)}async getIdToken(){var o,l;return(l=(o=this.result).getIdToken)===null||l===void 0?void 0:l.call(o)}getProfile(){return this.result.profile}async getProfileInfo(){return this.result.profile}async getBackstageIdentity(){const o=await this.getIdToken();if(!o){const m=`user:default/${this.getUserId()}`;return{type:"user",userEntityRef:m,ownershipEntityRefs:[m]}}const{sub:l,ent:d}=xl(o);return{type:"user",userEntityRef:l,ownershipEntityRefs:d!=null?d:[]}}async getCredentials(){var o,l;return{token:await((l=(o=this.result).getIdToken)===null||l===void 0?void 0:l.call(o))}}async signOut(){var o,l;return(l=(o=this.result).signOut)===null||l===void 0?void 0:l.call(o)}constructor(o){(0,hs._)(this,"result",void 0),this.result=o}}class ps{static createGuest(){return new ta}static fromLegacy(o){return na.fromResult(o)}static create(o){return new ps(o.identity,o.authApi,o.profile)}getUserId(){const o=this.identity.userEntityRef,l=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(o);if(!l)throw new TypeError(`Invalid user entity reference "${o}"`);return l[3]}async getIdToken(){return(await this.authApi.getBackstageIdentity()).token}getProfile(){if(!this.profile)throw new Error("The identity API does not implement synchronous profile fetching, use getProfileInfo() instead");return this.profile}async getProfileInfo(){if(this.profilePromise)return await this.profilePromise;try{return this.profilePromise=this.authApi.getProfile(),await this.profilePromise}catch(o){throw this.profilePromise=void 0,o}}async getBackstageIdentity(){return this.identity}async getCredentials(){return{token:(await this.authApi.getBackstageIdentity()).token}}async signOut(){return this.authApi.signOut()}constructor(o,l,d){(0,hs._)(this,"identity",void 0),(0,hs._)(this,"authApi",void 0),(0,hs._)(this,"profile",void 0),(0,hs._)(this,"profilePromise",void 0),this.identity=o,this.authApi=l,this.profile=d}}const bl={Component:({config:e,onSignInStarted:o,onSignInSuccess:l,onSignInFailure:d})=>{const{apiRef:m,title:y,message:I}=e,B=(0,p.h_)(m),Y=(0,p.h_)(p.VE),Z=async()=>{try{o();const fe=await B.getBackstageIdentity({instantPopup:!0});if(!fe)throw d(),new Error(`The ${y} provider is not configured to support sign-in`);const pe=await B.getProfile();l(ps.create({identity:fe.identity,profile:pe,authApi:B}))}catch(fe){d(),Y.post(new qr.SP("Login failed",fe))}};return(0,r.jsx)(ea,{children:(0,r.jsx)(lr,{variant:"fullHeight",title:y,actions:(0,r.jsx)(ge.Z,{color:"primary",variant:"outlined",onClick:Z,children:"Sign In"}),children:(0,r.jsx)(rt.Z,{variant:"body1",children:I})})})},loader:async(e,o)=>{const l=e.get(o),d=await l.getBackstageIdentity({optional:!0});if(!d)return;const m=await l.getProfile();return ps.create({identity:d.identity,profile:m,authApi:l})}},Sl={Component:({onSignInStarted:e,onSignInSuccess:o})=>(0,r.jsx)(ea,{children:(0,r.jsx)(lr,{title:"Guest",variant:"fullHeight",actions:(0,r.jsx)(ge.Z,{color:"primary",variant:"outlined",onClick:()=>{e(),o(new ta)},children:"Enter"}),children:(0,r.jsxs)(rt.Z,{variant:"body1",children:["Enter as a Guest User.",(0,r.jsx)("br",{}),"You will not have a verified identity,",(0,r.jsx)("br",{}),"meaning some features might be unavailable."]})})}),loader:async()=>new ta};var Cl=n(63955),Ba=n(86619),$a=n(74828),wl=n(45455),jl=n.n(wl);const El=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,Al=(0,g.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),Da=e=>{const{ref:o,...l}=e;return{inputRef:o,...l}},Tl={Component:({onSignInStarted:e,onSignInSuccess:o})=>{const l=Al(),{register:d,handleSubmit:m,formState:y}=(0,Cl.cI)({mode:"onChange"}),{errors:I}=y,B=({userId:Y,idToken:Z})=>{e(),o(ps.fromLegacy({userId:Y,getIdToken:Z!==void 0?async()=>Z:void 0,profile:{email:`${Y}@example.com`}}))};return(0,r.jsx)(ea,{children:(0,r.jsxs)(lr,{title:"Custom User",variant:"fullHeight",children:[(0,r.jsxs)(rt.Z,{variant:"body1",children:["Enter your own User ID and credentials.",(0,r.jsx)("br",{}),"This selection will not be stored."]}),(0,r.jsxs)("form",{className:l.form,onSubmit:m(B),children:[(0,r.jsxs)(oo.Z,{children:[(0,r.jsx)(Ba.Z,{...Da(d("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(I.userId)}),I.userId&&(0,r.jsx)($a.Z,{error:!0,children:I.userId.message})]}),(0,r.jsxs)(oo.Z,{children:[(0,r.jsx)(Ba.Z,{...Da(d("idToken",{required:!1,validate:Y=>!Y||El.test(Y)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(I.idToken)}),I.idToken&&(0,r.jsx)($a.Z,{error:!0,children:I.idToken.message})]}),(0,r.jsx)(ge.Z,{type:"submit",color:"primary",variant:"outlined",className:l.button,disabled:!(y!=null&&y.isDirty)||!jl()(I),children:"Continue"})]})]})})},loader:async()=>{}},Io="@backstage/core:SignInPage:provider",Fa={guest:Sl,custom:Tl,common:bl};function Na(e,o){if(e in o)throw new Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}function Kl(e){return e.reduce((l,d)=>{if(typeof d=="string")return Na(d,l),l[d]={components:Fa[d],id:d},l;const{id:m}=d;return Na(m,l),l[m]={components:Fa.common,id:m,config:d},l},{})}const Yl=(e,o)=>{const l=useApi(errorApiRef),d=useApiHolder(),[m,y]=useState(!0),I=useCallback(Y=>{o(IdentityApiSignOutProxy.from({identityApi:Y,signOut:async()=>{var Z;localStorage.removeItem(Io),await((Z=Y.signOut)===null||Z===void 0?void 0:Z.call(Y))}}))},[o]);useLayoutEffect(()=>{var Y;if(!m)return;const Z=localStorage.getItem(Io);if(Z===null){y(!1);return}const fe=e[Z];if(!fe){y(!1);return}let pe=!1;return fe.components.loader(d,(Y=fe.config)===null||Y===void 0?void 0:Y.apiRef).then(Te=>{if(pe){localStorage.removeItem(Io);return}Te?I(Te):y(!1)}).catch(Te=>{localStorage.removeItem(Io),!pe&&(l.post(Te),y(!1))}),()=>{pe=!0}},[m,l,o,d,e,I]);const B=useMemo(()=>Object.keys(e).map(Y=>{const Z=e[Y],{Component:fe}=Z.components,pe=Ze=>{I(Ze)},Te=()=>{var Ze;localStorage.setItem(Io,(Z==null||(Ze=Z.config)===null||Ze===void 0?void 0:Ze.id)||Z.id)},Ee=()=>{localStorage.removeItem(Io)};return _jsx(fe,{config:Z.config,onSignInStarted:Te,onSignInSuccess:pe,onSignInFailure:Ee},Z.id)}),[e,I]);return[m,B]},Rl=({onSignInSuccess:e,providers:o=[],title:l,align:d="left"})=>{const m=useApi(configApiRef),y=useStyles(),I=getSignInProviders(o),[B,Y]=useSignInProviders(I,e);return B?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:m.getString("app.title")}),_jsxs(Content,{children:[l&&_jsx(ContentHeader,{title:l,textAlign:d}),_jsx(Grid,{container:!0,justifyContent:d==="center"?d:"flex-start",spacing:2,component:"ul",classes:y,children:Y})]})]})},Il=({provider:e,auto:o,onSignInSuccess:l})=>{const d=useStyles(),m=useApi(e.apiRef),y=useApi(configApiRef),[I,B]=useState(),[Y,Z]=useState(!1),fe=async({checkExisting:pe,showPopup:Te})=>{try{let Ee;if(pe&&(Ee=await m.getBackstageIdentity({optional:!0})),!Ee&&(Te||o)&&(Z(!0),Ee=await m.getBackstageIdentity({instantPopup:!0}),!Ee))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Ee){Z(!0);return}const Ze=await m.getProfile();l(UserIdentity.create({identity:Ee.identity,authApi:m,profile:Ze}))}catch(Ee){B(Ee),Z(!0)}};return useMountEffect(()=>fe({checkExisting:!0})),Y?_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:y.getString("app.title")}),_jsx(Content,{children:_jsx(Grid,{container:!0,justifyContent:"center",spacing:2,component:"ul",classes:d,children:_jsx(GridItem,{children:_jsxs(InfoCard,{variant:"fullHeight",title:e.title,actions:_jsx(Button,{color:"primary",variant:"outlined",onClick:()=>{fe({showPopup:!0})},children:"Sign In"}),children:[_jsx(Typography,{variant:"body1",children:e.message}),I&&I.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:I.message})]})})})})]}):_jsx(Progress,{})};function Jl(e){return"provider"in e?_jsx(Il,{...e}):_jsx(Rl,{...e})}const Pl=(0,g.Z)(e=>({root:{padding:e.spacing(0,2,0,2.5),minHeight:e.spacing(3)},indicator:{backgroundColor:e.palette.info.main,height:e.spacing(.3)}}),{name:"BackstageTabbedCard"}),Ll=(0,kn.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(fo.Z);function Ql(e){const{slackChannel:o,errorBoundaryProps:l,children:d,title:m,deepLink:y,value:I,onChange:B}=e,Y=Pl(),[Z,fe]=useState(0),pe=B||((Ze,it)=>fe(it));let Te;I?React.Children.map(d,Ze=>{if(React.isValidElement(Ze)&&(Ze==null?void 0:Ze.props.value)===I){var it;Te=Ze==null||(it=Ze.props)===null||it===void 0?void 0:it.children}}):React.Children.map(d,(Ze,it)=>{React.isValidElement(Ze)&&it===Z&&(Te=Ze==null?void 0:Ze.props.children)});const Ee=l||(o?{slackChannel:o}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Ee,children:[m&&_jsx(Ll,{title:m}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:Y,value:I||Z,onChange:pe,children:d}),_jsx(Divider,{}),_jsx(CardContent,{children:Te}),y&&_jsx(BottomLink,{...y})]})})}const Ol=(0,g.Z)(e=>({root:{minWidth:e.spacing(6),minHeight:e.spacing(3),margin:e.spacing(0,2,0,0),padding:e.spacing(.5,0,.5,0),textTransform:"none","&:hover":{opacity:1,backgroundColor:"transparent",color:e.palette.text.primary}},selected:{fontWeight:e.typography.fontWeightBold}}),{name:"BackstageCardTab"});function Xl(e){const{children:o,...l}=e,d=Ol();return _jsx(Tab,{disableRipple:!0,classes:d,...l})}},60871:function(St,ke,n){"use strict";n.d(ke,{fC:function(){return g},CL:function(){return xt},sM:function(){return ae},$v:function(){return Pe},v_:function(){return N},hg:function(){return _e},uB:function(){return je},R5:function(){return Le},bq:function(){return P},Km:function(){return G},Ds:function(){return at},ni:function(){return A},T0:function(){return L},CO:function(){return rt},x8:function(){return En},rx:function(){return Mn},YO:function(){return Pn},P4:function(){return Yt},NT:function(){return ut},NW:function(){return It},VE:function(){return zt},W0:function(){return Nt},gP:function(){return Dt},IY:function(){return ct},F4:function(){return se},ux:function(){return H},Kp:function(){return oe},$4:function(){return et},p_:function(){return T},ZM:function(){return lt},D:function(){return q},gW:function(){return R},E6:function(){return yt},z$:function(){return Ht},h_:function(){return ge},I_:function(){return D},qD:function(){return be},vJ:function(){return Un},tg:function(){return An},Oi:function(){return Zn}});var r=n(52322),p=n(51837),W=n(2784);const f=(0,p.CT)("analytics-context"),z=()=>{const Se=(0,W.useContext)(f);if(Se===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const ce=Se.atVersion(1);if(ce===void 0)throw new Error("No context found for version 1.");return ce},g=Se=>{const{attributes:ce,children:Ie}=Se,Ve={...z(),...ce},le=(0,p.EI)({1:Ve});return(0,r.jsx)(f.Provider,{value:le,children:Ie})};function u(Se,ce){const Ie=Ue=>_jsx(g,{attributes:ce,children:_jsx(Se,{...Ue})});return Ie.displayName=`WithAnalyticsContext(${Se.displayName||Se.name||"Component"})`,Ie}function D(){const Se=(0,p.Vt)("api-context");if(!Se)throw new Error("API context is not available");const ce=Se.atVersion(1);if(!ce)throw new Error("ApiContext v1 not available");return ce}function ge(Se){const Ie=D().get(Se);if(!Ie)throw new Error(`No implementation available for ${Se}`);return Ie}function de(Se){return function(Ie){const Ue=le=>{const U=D(),he={};for(const $e in Se)if(Se.hasOwnProperty($e)){const Ke=Se[$e],Je=U.get(Ke);if(!Je)throw new Error(`No implementation available for ${Ke}`);he[$e]=Je}return _jsx(Ie,{...le,...he})},Ve=Ie.displayName||Ie.name||"Component";return Ue.displayName=`withApis(${Ve})`,Ue}}var V=n(87612);class te{get id(){return this.config.id}get T(){throw new Error(`tried to read ApiRef.T of ${this}`)}toString(){return`apiRef{${this.config.id}}`}constructor(ce){if((0,V._)(this,"config",void 0),this.config=ce,!ce.id.split(".").flatMap(Ue=>Ue.split("-")).every(Ue=>Ue.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${ce.id}'`)}}function L(Se){return new te(Se)}function A(Se,ce){return"id"in Se?{api:Se,deps:{},factory:()=>ce}:Se}var ae;(function(Se){Se.SignedIn="SignedIn",Se.SignedOut="SignedOut"})(ae||(ae={}));const oe=L({id:"core.auth.google"}),se=L({id:"core.auth.github"}),q=L({id:"core.auth.okta"}),H=L({id:"core.auth.gitlab"}),T=L({id:"core.auth.microsoft"}),R=L({id:"core.auth.onelogin"}),P=L({id:"core.auth.bitbucket"}),G=L({id:"core.auth.bitbucket-server"}),je=L({id:"core.auth.atlassian"}),Pe=L({id:"core.alert"}),N=L({id:"core.analytics"}),_e=L({id:"core.apptheme"}),at=L({id:"core.config"}),It=L({id:"core.discovery"}),zt=L({id:"core.error"});var xt;(function(Se){Se[Se.None=0]="None",Se[Se.Active=1]="Active"})(xt||(xt={}));const Nt=L({id:"core.featureflags"}),Dt=L({id:"core.fetch"}),et=L({id:"core.identity"}),lt=L({id:"core.oauthrequest"}),yt=L({id:"core.storage"});class At{setContext(ce){this.context=ce}captureEvent(ce,Ie,{value:Ue,attributes:Ve}={}){try{this.analyticsApi.captureEvent({action:ce,subject:Ie,value:Ue,attributes:Ve,context:this.context})}catch(le){console.warn("Error during analytics event capture. %o",le)}}constructor(ce,Ie={routeRef:"unknown",pluginId:"root",extension:"App"}){(0,V._)(this,"analyticsApi",void 0),(0,V._)(this,"context",void 0),this.analyticsApi=ce,this.context=Ie}}function $t(){try{return ge(N)}catch{return{captureEvent:()=>{}}}}function Ht(){const Se=(0,W.useRef)(null),ce=z(),Ie=$t();function Ue(){return Se.current===null&&(Se.current=new At(Ie)),Se.current}const Ve=Ue();return Ve.setContext(ce),Ve}const be=()=>{const Se=(0,p.Vt)("app-context");if(!Se)throw new Error("App context is not available");const ce=Se.atVersion(1);if(!ce)throw new Error("AppContext v1 not available");return ce},Ce=(0,p.uW)("component-data-store",()=>new WeakMap),Ye="__backstage_data";function Le(Se,ce,Ie){const Ue=Se;var Ve;let le=(Ve=Ue[Ye])!==null&&Ve!==void 0?Ve:Ce.get(Se);if(le||(le={map:new Map},Object.defineProperty(Ue,Ye,{enumerable:!1,configurable:!0,writable:!1,value:le}),Ce.set(Se,le)),le.map.has(ce)){const U=Se.displayName||Se.name;throw new Error(`Attempted to attach duplicate data "${ce}" to component "${U}"`)}le.map.set(ce,Ie)}function ct(Se,ce){if(!Se)return;const Ie=Se.type;if(!Ie)return;var Ue;const Ve=(Ue=Ie[Ye])!==null&&Ue!==void 0?Ue:Ce.get(Ie);if(Ve)return Ve.map.get(ce)}const Ct=(0,p.uW)("route-ref-type",()=>Symbol("route-ref-type"));let dt=Ct,Qe=dt;class Ge{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(ce,Ie){(0,V._)(this,"id",void 0),(0,V._)(this,"params",void 0),(0,V._)(this,Qe,void 0),this.id=ce,this.params=Ie,this[dt]="absolute"}}function ut(Se){var ce;return new Ge(Se.id,(ce=Se.params)!==null&&ce!==void 0?ce:[])}const pt=/^\w+$/;let hn=null,pn=null;class fn{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(ce,Ie,Ue,Ve){_define_property(this,"id",void 0),_define_property(this,"path",void 0),_define_property(this,"parent",void 0),_define_property(this,"params",void 0),_define_property(this,pn,void 0),this.id=ce,this.path=Ie,this.parent=Ue,this.params=Ve,this[hn]="sub"}}function qt(Se){const{id:ce,path:Ie,parent:Ue}=Se,Ve=Ie.split("/").filter(he=>he.startsWith(":")).map(he=>he.substring(1)),le=[...Ue.params,...Ve];if(Ue.params.some(he=>Ve.includes(he)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!Ie.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${Ie}'`);if(Ie.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${Ie}'`);for(const he of Ve)if(!pt.test(he))throw new Error(`SubRouteRef path has invalid param, got '${he}'`);return new fn(ce,Ie,Ue,le)}let Cn=Ct,Kt=Cn;class rn{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(ce,Ie,Ue){(0,V._)(this,"id",void 0),(0,V._)(this,"params",void 0),(0,V._)(this,"optional",void 0),(0,V._)(this,Kt,void 0),this.id=ce,this.params=Ie,this.optional=Ue,this[Cn]="external"}}function En(Se){var ce;return new rn(Se.id,(ce=Se.params)!==null&&ce!==void 0?ce:[],Boolean(Se.optional))}var on=n(73557);function An(Se){const{pathname:ce}=(0,on.TH)(),Ie=(0,p.Vt)("routing-context");if(!Ie)throw new Error("Routing context is not available");const Ue=Ie.atVersion(1),Ve=(0,W.useMemo)(()=>Ue&&Ue.resolve(Se,{pathname:ce}),[Ue,Se,ce]);if(!Ie)throw new Error("useRouteRef used outside of routing context");if(!Ue)throw new Error("RoutingContext v1 not available");const le="optional"in Se&&Se.optional;if(!Ve&&!le)throw new Error(`No path for ${Se}`);return Ve}function Zn(Se){return(0,on.UO)()}class nt extends W.Component{static getDerivedStateFromError(ce){return{error:ce}}render(){const{error:ce}=this.state,{app:Ie,plugin:Ue}=this.props,{ErrorBoundaryFallback:Ve}=Ie.getComponents();return ce?(0,r.jsx)(Ve,{error:ce,resetError:this.handleErrorReset,plugin:Ue}):this.props.children}constructor(...ce){super(...ce),(0,V._)(this,"state",{error:void 0}),(0,V._)(this,"handleErrorReset",()=>{this.setState({error:void 0})})}}var sn=n(64355);function Yt(Se){const{component:ce,mountPoint:Ie,name:Ue}=Se;return Pn({component:{lazy:()=>ce().then(Ve=>{const le=he=>{try{An(Ie)}catch($e){if(typeof $e=="object"&&$e!==null){const{message:Ke}=$e;if(typeof Ke=="string"&&Ke.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${Ie} was not discovered in the app element tree. Routable extension components may not be rendered by other components and must be directly available as an element within the App provider component.`)}throw $e}return(0,r.jsx)(Ve,{...he})},U=Ue||Ve.displayName||Ve.name||"LazyComponent";return le.displayName=`RoutableExtension(${U})`,le},Ve=>U=>{const he=be(),{BootErrorPage:$e}=he.getComponents();return(0,r.jsx)($e,{step:"load-chunk",error:Ve})})},data:{"core.mountPoint":Ie},name:Ue})}function rt(Se){const{component:ce,name:Ie}=Se;return Pn({component:ce,name:Ie})}function Pn(Se){const{data:ce={},name:Ie}=Se;Ie||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let Ue;if("lazy"in Se.component){const le=Se.component.lazy;Ue=(0,W.lazy)(()=>le().then(U=>({default:U})))}else Ue=Se.component.sync;const Ve=Ie||Ue.displayName||Ue.name||"Component";return{expose(le){const U=he=>{const $e=be(),{Progress:Ke}=$e.getComponents(),Je=ce==null?void 0:ce["core.mountPoint"];return(0,r.jsx)(W.Suspense,{fallback:(0,r.jsx)(Ke,{}),children:(0,r.jsx)(nt,{app:$e,plugin:le,children:(0,r.jsx)(g,{attributes:{pluginId:le.getId(),...Ie&&{extension:Ie},...Je&&{routeRef:Je.id}},children:(0,r.jsx)(sn.o,{plugin:le,children:(0,r.jsx)(Ue,{...he})})})})})};Le(U,"core.plugin",le),Le(U,"core.extensionName",Ie);for(const[he,$e]of Object.entries(ce))Le(U,he,$e);return U.displayName=`Extension(${Ve})`,U}}}function Jt(Se,ce,Ie,Ue){return W.Children.toArray(Se).flatMap(Ve=>{if(!(0,W.isValidElement)(Ve))return[];if(Ve.type===W.Fragment)return Jt(Ve.props.children,ce,Ie,Ue);if(ct(Ve,"core.featureFlagged")){const le=Ve.props;return("with"in le?ce.isActive(le.with):!ce.isActive(le.without))?Jt(Ve.props.children,ce,Ie,Ue):[]}if(Ie===void 0||Ie(Ve))return[Ve];if(Ue)throw new Error(Ue);return Jt(Ve.props.children,ce,Ie,Ue)})}class Ln{selectByComponentData(ce){const Ie=Jt(this.node,this.featureFlagsApi,Ue=>ct(Ue,ce.key)!==void 0,ce.withStrictError);return new Ln(Ie,this.featureFlagsApi)}findComponentData(ce){return Jt(this.node,this.featureFlagsApi,Ue=>ct(Ue,ce.key)!==void 0).map(Ue=>ct(Ue,ce.key)).filter(Ue=>Ue!==void 0)}getElements(){return Jt(this.node,this.featureFlagsApi)}constructor(ce,Ie){(0,V._)(this,"node",void 0),(0,V._)(this,"featureFlagsApi",void 0),this.node=ce,this.featureFlagsApi=Ie}}function Un(Se,ce,Ie=[]){const Ue=ge(Nt),Ve=new Ln(Se,Ue);return(0,W.useMemo)(()=>ce(Ve),[Se,...Ie])}class On{getId(){return this.config.id}getApis(){var ce;return(ce=this.config.apis)!==null&&ce!==void 0?ce:[]}getFeatureFlags(){var ce,Ie;return(Ie=(ce=this.config.featureFlags)===null||ce===void 0?void 0:ce.slice())!==null&&Ie!==void 0?Ie:[]}get routes(){var ce;return(ce=this.config.routes)!==null&&ce!==void 0?ce:{}}get externalRoutes(){var ce;return(ce=this.config.externalRoutes)!==null&&ce!==void 0?ce:{}}provide(ce){return ce.expose(this)}__experimentalReconfigure(ce){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(ce))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var ce;return(ce=this.options)!==null&&ce!==void 0?ce:{}}toString(){return`plugin{${this.config.id}}`}constructor(ce){(0,V._)(this,"config",void 0),(0,V._)(this,"options",void 0),this.config=ce,this.options=void 0}}function Mn(Se){return new On(Se)}},64355:function(St,ke,n){"use strict";n.d(ke,{o:function(){return z},y:function(){return g}});var r=n(52322),p=n(51837),W=n(2784);const f="plugin-context",z=u=>{const{children:D,plugin:ge}=u,{Provider:de}=(0,p.CT)(f);return(0,r.jsx)(de,{value:(0,p.EI)({1:{plugin:ge}}),children:D})};function g(){const u=(0,p.Vt)(f);if(!u)throw new Error("Plugin Options context is not available");const D=u.atVersion(1);if(!D)throw new Error("Plugin Options v1 is not available");return D.plugin.getPluginOptions()}},23054:function(St,ke,n){"use strict";n.d(ke,{SP:function(){return se},dR:function(){return te},VL:function(){return H},BD:function(){return p}});function r(T){if(typeof T!="object"||T===null||Array.isArray(T))return!1;const R=T;return!(typeof R.name!="string"||R.name===""||typeof R.message!="string")}function p(T){if(typeof T!="object"||T===null||Array.isArray(T))throw new Error(`Encountered invalid error, not an object, got '${T}'`);const R=T;if(typeof R.name!="string"||R.name==="")throw new Error(`Encountered error object without a name, got '${T}'`);if(typeof R.message!="string")throw new Error(`Encountered error object without a message, got '${T}'`)}var W=n(87612),f=n(24852);function z(T,R){const G={name:"Unknown",message:"<no reason given>",...serializeErrorInternal(T)};return R!=null&&R.includeStack||delete G.stack,G}function g(T){const R=(0,f.deserializeError)(T);return T.stack||(R.stack=void 0),R}function u(T){if(r(T)){const R=String(T);return R!=="[object Object]"?R:`${T.name}: ${T.message}`}return`unknown error '${T}'`}class D extends Error{constructor(R,P){var G;let je=R;if(P!==void 0){const Pe=u(P);je?je+=`; caused by ${Pe}`:je=`caused by ${Pe}`}super(je),(0,W._)(this,"cause",void 0),(G=Error.captureStackTrace)===null||G===void 0||G.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=r(P)?P:void 0}}class ge extends null{}class de extends null{}class V extends null{}class te extends D{}class L extends null{}class A extends null{}class ae extends null{}class oe extends null{}class se extends D{constructor(R,P){super(R,P),this.name=r(P)?P.name:"Error"}}async function q(T){try{const P=await T.text();if(P){var R;if(!((R=T.headers.get("content-type"))===null||R===void 0)&&R.startsWith("application/json"))try{const G=JSON.parse(P);if(G.error&&G.response)return G}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}, ${P}`},response:{statusCode:T.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}`},response:{statusCode:T.status}}}class H extends Error{static async fromResponse(R){const P=await q(R),G=P.response.statusCode||R.status,je=P.error.name||R.statusText,Pe=`Request failed with ${G} ${je}`,N=g(P.error);return new H({message:Pe,response:R,data:P,cause:N})}constructor(R){super(R.message),(0,W._)(this,"response",void 0),(0,W._)(this,"body",void 0),(0,W._)(this,"cause",void 0),this.name="ResponseError",this.response=R.response,this.body=R.data,this.cause=R.cause}}},32838:function(St,ke,n){"use strict";n.d(ke,{nW:function(){return oe},ae:function(){return V},q3:function(){return te}});var r=n(60871);const p=(0,r.T0)({id:"core.scmauth"});var W=new WeakMap;class f{async getCredentials(q){const H=new URL(q.url),T=_class_private_field_get(this,W).find(R=>R.isUrlSupported(H));if(!T)throw new Error(`No auth provider available for '${q.url}', see https://backstage.io/link?scm-auth`);return T.getCredentials(q)}constructor(q){_class_private_field_init(this,W,{writable:!0,value:void 0}),_class_private_field_set(this,W,q)}}var z=new WeakMap,g=new WeakMap,u=new WeakMap,D=new WeakMap;class ge{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:q,gitlab:H,azure:T,bitbucket:R})=>ge.merge(ge.forGithub(q),ge.forGitlab(H),ge.forAzure(T),ge.forBitbucket(R))})}static forAuthApi(q,H){return new ge("generic",q,H.host,H.scopeMapping)}static forGithub(q,H){var T;const R=(T=H==null?void 0:H.host)!==null&&T!==void 0?T:"github.com";return new ge("github",q,R,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(q,H){var T;const R=(T=H==null?void 0:H.host)!==null&&T!==void 0?T:"gitlab.com";return new ge("gitlab",q,R,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(q,H){var T;const R=(T=H==null?void 0:H.host)!==null&&T!==void 0?T:"dev.azure.com";return new ge("azure",q,R,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(q,H){var T;const R=(T=H==null?void 0:H.host)!==null&&T!==void 0?T:"bitbucket.org";return new ge("bitbucket",q,R,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...q){return new f(q)}isUrlSupported(q){return q.host===_class_private_field_get(this,g)}getAdditionalScopesForProvider(q){var H;if(!(q!=null&&q.customScopes)||_class_private_field_get(this,D)==="generic")return[];var T;return(T=(H=q.customScopes)===null||H===void 0?void 0:H[_class_private_field_get(this,D)])!==null&&T!==void 0?T:[]}async getCredentials(q){const{url:H,additionalScope:T,...R}=q,P=_class_private_field_get(this,u).default.slice();T!=null&&T.repoWrite&&P.push(..._class_private_field_get(this,u).repoWrite);const G=this.getAdditionalScopesForProvider(T);G.length&&P.push(...G);const je=[...new Set(P)],Pe=await _class_private_field_get(this,z).getAccessToken(je,R);return{token:Pe,headers:{Authorization:`Bearer ${Pe}`}}}constructor(q,H,T,R){_class_private_field_init(this,z,{writable:!0,value:void 0}),_class_private_field_init(this,g,{writable:!0,value:void 0}),_class_private_field_init(this,u,{writable:!0,value:void 0}),_class_private_field_init(this,D,{writable:!0,value:void 0}),_class_private_field_set(this,z,H),_class_private_field_set(this,g,T),_class_private_field_set(this,u,R),_class_private_field_set(this,D,q)}}var de=n(40556);class V{static fromConfig(q){return de.Lx.fromConfig(q)}}const te=(0,r.T0)({id:"integration.scmintegrations"});var L=n(52322),A=n(73250),ae=n(2784);const oe=se=>{const{type:q}=se,H=(0,r.qD)(),T=A.Z;var R;const P=q&&(R=H.getSystemIcon(q))!==null&&R!==void 0?R:T;return(0,L.jsx)(P,{})}},40556:function(St,ke,n){"use strict";n.d(ke,{Lx:function(){return Ar},BT:function(){return Ut}});var r=n(87612),p=n(82717),W=n.n(p),f=n(76635);function z(S){const c=new URL("http://example.com");return c.host=S,c.host===S}function g(S){try{return new URL(S),!0}catch{return!1}}function u(S,c){return{list(){return S},byUrl(b){try{const j=typeof b=="string"?new URL(b):b;return S.find(K=>c(K)===j.host)}catch{return}},byHost(b){return S.find(j=>c(j)===b)}}}function D(S){const{url:c,base:b,lineNumber:j}=S;try{return new URL(c),c}catch{}let K;if(c.startsWith("/")){const{filepath:me}=W()(b);K=new URL(b);const we=(0,f.trimEnd)(K.pathname.substring(0,K.pathname.length-me.length),"/");K.pathname=`${we}${c}`}else K=new URL(c,b);return K.search=new URL(b).search,j&&(K.hash=`L${j}`),K.toString()}function ge(S){beforeAll(()=>S.listen({onUnhandledRequest:"error"})),afterAll(()=>S.close()),afterEach(()=>S.resetHandlers())}const de="amazonaws.com";function V(S){const c=S.getOptionalString("endpoint");var b;const j=(b=S.getOptionalBoolean("s3ForcePathStyle"))!==null&&b!==void 0?b:!1;let K,me;if(c){try{const jn=new URL(c);K=jn.host,me=jn.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${c}' is not a valid URL`)}if(me!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${c}'`)}else K=de;const we=S.getOptionalString("accessKeyId"),Fe=S.getOptionalString("secretAccessKey"),Xe=S.getOptionalString("roleArn"),Mt=S.getOptionalString("externalId");return{host:K,endpoint:c,s3ForcePathStyle:j,accessKeyId:we,secretAccessKey:Fe,roleArn:Xe,externalId:Mt}}function te(S){const c=S.map(V);return c.some(b=>b.host===de)||c.push({host:de}),c}class L{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return D(c)}resolveEditUrl(c){return c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(L,"factory",({config:S})=>{var c;const b=te((c=S.getOptionalConfigArray("integrations.awsS3"))!==null&&c!==void 0?c:[]);return u(b.map(j=>new L(j)),j=>j.config.host)});var A=n(88412),ae=n(50629),oe=n(80956);const se="GB";var q=new WeakMap,H=new WeakMap,T=new WeakMap,R=new WeakMap,P=new WeakMap,G=new WeakMap,je=new WeakMap;class Pe{static fromRepoUrl(c){const b=new URL(c);let j,K,me;const we=b.pathname.split("/").map(qn=>decodeURIComponent(qn));if(we[2]==="_git"?(j=we[1],K=me=we[3]):we[3]==="_git"?(j=we[1],K=we[2],me=we[4]):we[4]==="_git"&&(j=`${we[1]}/${we[2]}`,K=we[3],me=we[5]),!j||!K||!me)throw new Error("Azure URL must point to a git repository");var Fe;const Xe=(Fe=b.searchParams.get("path"))!==null&&Fe!==void 0?Fe:void 0;let Mt;const jn=b.searchParams.get("version");if(jn){if(jn.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");Mt=jn.slice(2)}return new Pe(b.origin,j,K,me,Xe,Mt)}toRepoUrl(){let c;return(0,A._)(this,T)===(0,A._)(this,R)?c=(0,A._)(this,je).call(this,(0,A._)(this,H),"_git",(0,A._)(this,R)):c=(0,A._)(this,je).call(this,(0,A._)(this,H),(0,A._)(this,T),"_git",(0,A._)(this,R)),(0,A._)(this,P)&&c.searchParams.set("path",(0,A._)(this,P)),(0,A._)(this,G)&&c.searchParams.set("version",se+(0,A._)(this,G)),c.toString()}toFileUrl(){if(!(0,A._)(this,P))throw new Error("Azure URL must point to a specific path to be able to download a file");const c=(0,A._)(this,je).call(this,(0,A._)(this,H),(0,A._)(this,T),"_apis","git","repositories",(0,A._)(this,R),"items");return c.searchParams.set("api-version","6.0"),c.searchParams.set("path",(0,A._)(this,P)),(0,A._)(this,G)&&c.searchParams.set("version",(0,A._)(this,G)),c.toString()}toArchiveUrl(){const c=(0,A._)(this,je).call(this,(0,A._)(this,H),(0,A._)(this,T),"_apis","git","repositories",(0,A._)(this,R),"items");return c.searchParams.set("recursionLevel","full"),c.searchParams.set("download","true"),c.searchParams.set("api-version","6.0"),(0,A._)(this,P)&&c.searchParams.set("scopePath",(0,A._)(this,P)),(0,A._)(this,G)&&c.searchParams.set("version",(0,A._)(this,G)),c.toString()}toCommitsUrl(){const c=(0,A._)(this,je).call(this,(0,A._)(this,H),(0,A._)(this,T),"_apis","git","repositories",(0,A._)(this,R),"commits");return c.searchParams.set("api-version","6.0"),(0,A._)(this,G)&&c.searchParams.set("searchCriteria.itemVersion.version",(0,A._)(this,G)),c.toString()}getOwner(){return(0,A._)(this,H)}getProject(){return(0,A._)(this,T)}getRepo(){return(0,A._)(this,R)}getPath(){return(0,A._)(this,P)}getRef(){return(0,A._)(this,G)}constructor(c,b,j,K,me,we){(0,ae._)(this,q,{writable:!0,value:void 0}),(0,ae._)(this,H,{writable:!0,value:void 0}),(0,ae._)(this,T,{writable:!0,value:void 0}),(0,ae._)(this,R,{writable:!0,value:void 0}),(0,ae._)(this,P,{writable:!0,value:void 0}),(0,ae._)(this,G,{writable:!0,value:void 0}),(0,ae._)(this,je,{writable:!0,value:(...Fe)=>{const Xe=new URL((0,A._)(this,q));return Xe.pathname=Fe.map(Mt=>encodeURIComponent(Mt)).join("/"),Xe}}),(0,oe._)(this,q,c),(0,oe._)(this,H,b),(0,oe._)(this,T,j),(0,oe._)(this,R,K),(0,oe._)(this,P,me),(0,oe._)(this,G,we)}}const N="dev.azure.com",_e=S=>{const c=S;return Object.keys(S).length===3&&c.clientId!==void 0&&c.clientSecret!==void 0&&c.tenantId!==void 0},at=S=>Object.keys(S).length===1&&S.clientId!==void 0;function It(S){var c;const b=(c=S.getOptionalString("host"))!==null&&c!==void 0?c:N,j=S.getOptionalString("token"),K=S.getOptional("credential")?{tenantId:S.getOptionalString("credential.tenantId"),clientId:S.getOptionalString("credential.clientId"),clientSecret:S.getOptionalString("credential.clientSecret")}:void 0;if(!z(b))throw new Error(`Invalid Azure integration config, '${b}' is not a valid host`);if(K&&!_e(K)&&!at(K))throw new Error("Invalid Azure integration config, credential is not valid");if(K&&b!==N)throw new Error(`Invalid Azure integration config, credential can only be used with ${N}`);if(K&&j)throw new Error("Invalid Azure integration config, specify either a token or a credential but not both");return{host:b,token:j,credential:K}}function zt(S){const c=S.map(It);return c.some(b=>b.host===N)||c.push({host:N}),c}class xt{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:b,base:j}=c;if(g(b))return b;try{const me=Pe.fromRepoUrl(j),we=new URL(j);var K;const Fe=new URL(`https://a.com${(K=me.getPath())!==null&&K!==void 0?K:""}`),Xe=new URL(b,Fe).pathname;return we.searchParams.set("path",Xe),c.lineNumber&&(we.searchParams.set("line",String(c.lineNumber)),we.searchParams.set("lineEnd",String(c.lineNumber+1)),we.searchParams.set("lineStartColumn","1"),we.searchParams.set("lineEndColumn","1")),we.toString()}catch{return new URL(b,j).toString()}}resolveEditUrl(c){return c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(xt,"factory",({config:S})=>{var c;const b=zt((c=S.getOptionalConfigArray("integrations.azure"))!==null&&c!==void 0?c:[]);return u(b.map(j=>new xt(j)),j=>j.config.host)});var Nt=n(48834).lW;function Dt(S){return AzureUrl.fromRepoUrl(S).toFileUrl()}function et(S){return AzureUrl.fromRepoUrl(S).toArchiveUrl()}function lt(S){return AzureUrl.fromRepoUrl(S).toCommitsUrl()}async function yt(S,c){const b="499b84ac-1321-427f-aa17-267ca6975798/.default",j=c?{...c}:{},{token:K,credential:me}=S;if(me){if(isServicePrincipal(me)){const Fe=await new ClientSecretCredential(me.tenantId,me.clientId,me.clientSecret).getToken(b);j.Authorization=`Bearer ${Fe.token}`}else if(isManagedIdentity(me)){const Fe=await new ManagedIdentityCredential(me.clientId).getToken(b);j.Authorization=`Bearer ${Fe.token}`}}else if(K){const we=Nt.from(`:${S.token}`,"utf8");j.Authorization=`Basic ${we.toString("base64")}`}return{headers:j}}const At="bitbucket.org",$t="https://api.bitbucket.org/2.0";function Ht(S){var c;const b=(c=S.getOptionalString("host"))!==null&&c!==void 0?c:At;let j=S.getOptionalString("apiBaseUrl");const K=S.getOptionalString("token"),me=S.getOptionalString("username"),we=S.getOptionalString("appPassword");if(!z(b))throw new Error(`Invalid Bitbucket integration config, '${b}' is not a valid host`);return j?j=(0,f.trimEnd)(j,"/"):b===At?j=$t:j=`https://${b}/rest/api/1.0`,{host:b,apiBaseUrl:j,token:K,username:me,appPassword:we}}function be(S){const c=S.map(Ht);return c.some(b=>b.host===At)||c.push({host:At,apiBaseUrl:$t}),c}class Ce{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=D(c);if(!c.lineNumber)return b;const j=new URL(b);return this.integrationConfig.host==="bitbucket.org"?j.hash=`lines-${c.lineNumber}`:j.hash=`${c.lineNumber}`,j.toString()}resolveEditUrl(c){const b=W()(c),j=new URL(c);return j.searchParams.set("mode","edit"),j.searchParams.set("spa","0"),j.searchParams.set("at",b.ref),j.toString()}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(Ce,"factory",({config:S})=>{var c,b,j;const K=be((j=S.getOptionalConfigArray("integrations.bitbucket"))!==null&&j!==void 0?j:[...(c=S.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[],...(b=S.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&b!==void 0?b:[]]);return u(K.map(me=>new Ce(me)),me=>me.config.host)});var Ye=n(96279),Le=n(48834).lW;async function ct(S,c){const{name:b,owner:j,resource:K}=parseGitUrl(S),me=K==="bitbucket.org";let we=me?`${c.apiBaseUrl}/repositories/${j}/${b}`:`${c.apiBaseUrl}/projects/${j}/repos/${b}/default-branch`,Fe=await fetch(we,Qe(c));if(Fe.status===404&&!me&&(we=`${c.apiBaseUrl}/projects/${j}/repos/${b}/branches/default`,Fe=await fetch(we,Qe(c))),!Fe.ok){const Mt=`Failed to retrieve default branch from ${we}, ${Fe.status} ${Fe.statusText}`;throw new Error(Mt)}let Xe;if(me)Xe=(await Fe.json()).mainbranch.name;else{const{displayId:Mt}=await Fe.json();Xe=Mt}if(!Xe)throw new Error(`Failed to read default branch from ${we}. Response ${Fe.status} ${Fe.json()}`);return Xe}async function Ct(S,c){const{name:b,owner:j,ref:K,protocol:me,resource:we,filepath:Fe}=parseGitUrl(S),Xe=we==="bitbucket.org";let Mt=K;Mt||(Mt=await ct(S,c));const jn=Fe?`&path=${encodeURIComponent(decodeURIComponent(Fe))}`:"";return Xe?`${me}://${we}/${j}/${b}/get/${Mt}.tar.gz`:`${c.apiBaseUrl}/projects/${j}/repos/${b}/archive?format=tgz&at=${Mt}&prefix=${j}-${b}${jn}`}function dt(S,c){try{const{owner:b,name:j,ref:K,filepathtype:me,filepath:we}=parseGitUrl(S);if(!b||!j||me!=="browse"&&me!=="raw"&&me!=="src")throw new Error("Invalid Bitbucket URL or file path");const Fe=we.replace(/^\//,"");if(c.host==="bitbucket.org"){if(!K)throw new Error("Invalid Bitbucket URL or file path");return`${c.apiBaseUrl}/repositories/${b}/${j}/src/${K}/${Fe}`}return`${c.apiBaseUrl}/projects/${b}/repos/${j}/raw/${Fe}?at=${K}`}catch(b){throw new Error(`Incorrect URL: ${S}, ${b}`)}}function Qe(S){const c={};if(S.token)c.Authorization=`Bearer ${S.token}`;else if(S.username&&S.appPassword){const b=Le.from(`${S.username}:${S.appPassword}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}const Ge="bitbucket.org",ut="https://api.bitbucket.org/2.0";function pt(S){const c=Ge,b=ut,j=S.getString("username"),K=S.getString("appPassword");return{host:c,apiBaseUrl:b,username:j,appPassword:K}}function hn(S){const c=S.map(pt);return c.length===0&&c.push({host:Ge,apiBaseUrl:ut}),c}class pn{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=D(c);if(c.lineNumber){const j=new URL(b);return j.hash=`lines-${c.lineNumber}`,j.toString()}return b}resolveEditUrl(c){const b=W()(c),j=new URL(c);return j.searchParams.set("mode","edit"),j.searchParams.set("at",b.ref),j.toString()}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(pn,"factory",({config:S})=>{var c;const b=hn((c=S.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[]);return u(b.map(j=>new pn(j)),j=>j.config.host)});var fn=n(48834).lW;async function qt(S,c){const{name:b,owner:j}=parseGitUrl(S),K=`${c.apiBaseUrl}/repositories/${j}/${b}`,me=await fetch(K,rn(c));if(!me.ok){const Xe=`Failed to retrieve default branch from ${K}, ${me.status} ${me.statusText}`;throw new Error(Xe)}const Fe=(await me.json()).mainbranch.name;if(!Fe)throw new Error(`Failed to read default branch from ${K}. Response ${me.status} ${me.json()}`);return Fe}async function Cn(S,c){const{name:b,owner:j,ref:K,protocol:me,resource:we}=parseGitUrl(S);let Fe=K;return Fe||(Fe=await qt(S,c)),`${me}://${we}/${j}/${b}/get/${Fe}.tar.gz`}function Kt(S,c){try{const{owner:b,name:j,ref:K,filepathtype:me,filepath:we}=parseGitUrl(S);if(!b||!j||me!=="src"&&me!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const Fe=we.replace(/^\//,"");if(!K)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${c.apiBaseUrl}/repositories/${b}/${j}/src/${K}/${Fe}`}catch(b){throw new Error(`Incorrect URL: ${S}, ${b}`)}}function rn(S){const c={};if(S.username&&S.appPassword){const b=fn.from(`${S.username}:${S.appPassword}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}function En(S){const c=S.getString("host");let b=S.getOptionalString("apiBaseUrl");const j=S.getOptionalString("token"),K=S.getOptionalString("username"),me=S.getOptionalString("password");if(!z(c))throw new Error(`Invalid Bitbucket Server integration config, '${c}' is not a valid host`);return b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}/rest/api/1.0`,{host:c,apiBaseUrl:b,token:j,username:K,password:me}}function on(S){return S.map(En)}class An{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=D(c);if(c.lineNumber){const j=new URL(b);return j.hash=c.lineNumber.toString(),j.toString()}return b}resolveEditUrl(c){return c.includes("?")?c.substring(0,c.indexOf("?")):c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(An,"factory",({config:S})=>{var c;const b=on((c=S.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&c!==void 0?c:[]);return u(b.map(j=>new An(j)),j=>j.config.host)});var Zn=n(48834).lW;async function nt(S,c){const{name:b,owner:j}=parseGitUrl(S);let K=`${c.apiBaseUrl}/projects/${j}/repos/${b}/default-branch`,me=await fetch(K,rt(c));if(me.status===404&&(K=`${c.apiBaseUrl}/projects/${j}/repos/${b}/branches/default`,me=await fetch(K,rt(c))),!me.ok){const Xe=`Failed to retrieve default branch from ${K}, ${me.status} ${me.statusText}`;throw new Error(Xe)}const{displayId:we}=await me.json(),Fe=we;if(!Fe)throw new Error(`Failed to read default branch from ${K}. Response ${me.status} ${me.json()}`);return Fe}async function sn(S,c){const{name:b,owner:j,ref:K,filepath:me}=parseGitUrl(S);let we=K;we||(we=await nt(S,c));const Fe=me?`&path=${encodeURIComponent(decodeURIComponent(me))}`:"";return`${c.apiBaseUrl}/projects/${j}/repos/${b}/archive?format=tgz&at=${we}&prefix=${j}-${b}${Fe}`}function Yt(S,c){try{const{owner:b,name:j,ref:K,filepathtype:me,filepath:we}=parseGitUrl(S);if(!b||!j||me!=="browse"&&me!=="raw"&&me!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const Fe=we.replace(/^\//,"");return`${c.apiBaseUrl}/projects/${b}/repos/${j}/raw/${Fe}?at=${K}`}catch(b){throw new Error(`Incorrect URL: ${S}, ${b}`)}}function rt(S){const c={};if(S.token)c.Authorization=`Bearer ${S.token}`;else if(S.username&&S.password){const b=Zn.from(`${S.username}:${S.password}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}function Pn(S){const c=S.getString("host");let b=S.getOptionalString("baseUrl"),j=S.getOptionalString("cloneUrl"),K=S.getOptionalString("gitilesBaseUrl");const me=S.getOptionalString("username"),we=S.getOptionalString("password");if(z(c)){if(b&&!g(b))throw new Error(`Invalid Gerrit integration config, '${b}' is not a valid baseUrl`);if(j&&!g(j))throw new Error(`Invalid Gerrit integration config, '${j}' is not a valid cloneUrl`);if(K&&!g(K))throw new Error(`Invalid Gerrit integration config, '${K}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${c}' is not a valid host`);return b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}`,K?K=(0,f.trimEnd)(K,"/"):K=`https://${c}`,j?j=(0,f.trimEnd)(j,"/"):j=b,{host:c,baseUrl:b,cloneUrl:j,gitilesBaseUrl:K,username:me,password:we}}function Jt(S){return S.map(Pn)}var Ln=n(48834).lW;const Un=")]}'";function On(S,c){const j=c.replace(S.gitilesBaseUrl,"").split("/").filter(Mt=>!!Mt),K=j.indexOf("+");if(K<=0)throw new Error(`Unable to parse project from url: ${c}`);const me=(0,f.trimStart)(j.slice(0,K).join("/"),"/"),we=j.indexOf("heads");if(we<=0)throw new Error(`Unable to parse branch from url: ${c}`);const Fe=j[we+1],Xe=j.slice(we+2).join("/");return{branch:Fe,filePath:Xe===""?"/":Xe,project:me}}function Mn(S,c,b,j){return`${S.gitilesBaseUrl}/${c}/+/refs/heads/${b}/${(0,f.trimStart)(j,"/")}`}function Se(S){return S.password?"/a/":"/"}function ce(S,c){const{branch:b,project:j}=On(S,c);return`${S.baseUrl}${Se(S)}projects/${encodeURIComponent(j)}/branches/${b}`}function Ie(S,c){const{project:b}=On(S,c);return`${S.cloneUrl}${Se(S)}${b}`}function Ue(S,c){const{branch:b,filePath:j,project:K}=On(S,c);return`${S.baseUrl}${Se(S)}projects/${encodeURIComponent(K)}/branches/${b}/files/${encodeURIComponent(j)}/content`}function Ve(S){return`${S.baseUrl}${Se(S)}projects/`}function le(S){const c={};if(!S.password)return c;const b=Ln.from(`${S.username}:${S.password}`,"utf8");return c.Authorization=`Basic ${b.toString("base64")}`,{headers:c}}async function U(S){const c=await S.text();if(c.startsWith(Un))try{return JSON.parse(c.slice(Un.length))}catch(b){throw new Error(`Invalid response from Gerrit: ${c.slice(0,10)} - ${b}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${c.slice(0,10)}`)}class he{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:b,base:j,lineNumber:K}=c;let me;if(b.startsWith("/")){const{branch:we,project:Fe}=On(this.config,j);return Mn(this.config,Fe,we,b)}return b?me=new URL(b,j):me=new URL(j),K&&(me.hash=K.toString()),me.toString()}resolveEditUrl(c){return c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(he,"factory",({config:S})=>{var c;const b=Jt((c=S.getOptionalConfigArray("integrations.gerrit"))!==null&&c!==void 0?c:[]);return u(b.map(j=>new he(j)),j=>j.config.host)});function $e(S){const c=S.getString("host");let b=S.getOptionalString("baseUrl");const j=S.getOptionalString("username"),K=S.getOptionalString("password");if(!z(c))throw new Error(`Invalid Gitea integration config, '${c}' is not a valid host`);return b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}`,{host:c,baseUrl:b,username:j,password:K}}var Ke=n(48834).lW;function Je(S,c){try{var b;const j=(b=S.baseUrl)!==null&&b!==void 0?b:`https://${S.host}`,[K,me,we,Fe,Xe,Mt,...jn]=c.replace(j,"").split("/"),qn=jn.join("/").replace(/^\//,"");return`${j}/${me}/${we}/_edit/${Mt}/${qn}`}catch(j){throw new Error(`Incorrect URL: ${c}, ${j}`)}}function Zt(S,c){try{var b;const j=(b=S.baseUrl)!==null&&b!==void 0?b:`https://${S.host}`,[K,me,we,Fe,Xe,Mt,...jn]=c.replace(j,"").split("/"),qn=jn.join("/").replace(/^\//,"");return`${j}/api/v1/repos/${me}/${we}/contents/${qn}?ref=${Mt}`}catch(j){throw new Error(`Incorrect URL: ${c}, ${j}`)}}function _t(S){const c={},{username:b,password:j}=S;return j?(b?c.Authorization=`basic ${Ke.from(`${b}:${j}`).toString("base64")}`:c.Authorization=`token ${j}`,{headers:c}):c}class en{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(c){return D(c)}resolveEditUrl(c){return Je(this.config,c)}constructor(c){(0,r._)(this,"config",void 0),this.config=c}}(0,r._)(en,"factory",({config:S})=>{var c;const j=((c=S.getOptionalConfigArray("integrations.gitea"))!==null&&c!==void 0?c:[]).map(K=>$e(K));return u(j.map(K=>new en(K)),K=>K.config.host)});const Qt="github.com",tn="https://api.github.com",_="https://raw.githubusercontent.com";function X(S){var c,b;const j=(b=S.getOptionalString("host"))!==null&&b!==void 0?b:Qt;let K=S.getOptionalString("apiBaseUrl"),me=S.getOptionalString("rawBaseUrl");const we=S.getOptionalString("token"),Fe=(c=S.getOptionalConfigArray("apps"))===null||c===void 0?void 0:c.map(Xe=>({appId:Xe.getNumber("appId"),clientId:Xe.getString("clientId"),clientSecret:Xe.getString("clientSecret"),webhookSecret:Xe.getString("webhookSecret"),privateKey:Xe.getString("privateKey"),allowedInstallationOwners:Xe.getOptionalStringArray("allowedInstallationOwners")}));if(!z(j))throw new Error(`Invalid GitHub integration config, '${j}' is not a valid host`);return K?K=(0,f.trimEnd)(K,"/"):j===Qt&&(K=tn),me?me=(0,f.trimEnd)(me,"/"):j===Qt&&(me=_),{host:j,apiBaseUrl:K,rawBaseUrl:me,token:we,apps:Fe}}function ee(S){const c=S.map(X);return c.some(b=>b.host===Qt)||c.push({host:Qt,apiBaseUrl:tn,rawBaseUrl:_}),c}function v(S,c,b){try{const{owner:j,name:K,ref:me,filepathtype:we,filepath:Fe}=parseGitUrl(S);if(!j||!K||!me||we!=="blob"&&we!=="raw"&&we!=="tree")throw new Error("Invalid GitHub URL or file path");const Xe=Fe.replace(/^\//,"");return J(c,b)==="api"?`${c.apiBaseUrl}/repos/${j}/${K}/contents/${Xe}?ref=${me}`:`${c.rawBaseUrl}/${j}/${K}/${me}/${Xe}`}catch(j){throw new Error(`Incorrect URL: ${S}, ${j}`)}}function O(S,c){const b={};return J(S,c)==="api"&&(b.Accept="application/vnd.github.v3.raw"),c.token&&(b.Authorization=`token ${c.token}`),{headers:b}}function J(S,c){return S.apiBaseUrl&&(c.token||!S.rawBaseUrl)?"api":"raw"}var M=n(35355),ue=n(89393),ye=n(26228);class Me{async getOrCreateToken(c,b,j){let K=this.tokenCache.get(c);if((!K||this.isExpired(K.expiresAt))&&(K=await j(),K.expiresAt=K.expiresAt.minus({minutes:10}),this.tokenCache.set(c,K)),!this.appliesToRepo(K,b))throw new Error(`The Backstage GitHub application used in the ${c} organization does not have access to a repository with the name ${b}`);return{accessToken:K.token}}appliesToRepo(c,b){return b===void 0?!0:c.repositories!==void 0?c.repositories.includes(b):!0}constructor(){(0,r._)(this,"tokenCache",new Map),(0,r._)(this,"isExpired",c=>ye.ou.local()>c)}}const ot={Accept:"application/vnd.github.machine-man-preview+json"};class ht{async getInstallationCredentials(c,b){if(this.allowedInstallationOwners){var j;if(!(!((j=this.allowedInstallationOwners)===null||j===void 0)&&j.includes(c)))return{accessToken:void 0}}return this.cache.getOrCreateToken(c,b,async()=>{const{installationId:K,suspended:me}=await this.getInstallationData(c);if(me)throw new Error(`The GitHub application for ${c} is suspended`);const we=await this.appClient.apps.createInstallationAccessToken({installation_id:K,headers:ot});let Fe;if(we.data.repository_selection==="selected"){const Mt=new ue.v({baseUrl:this.baseUrl,auth:we.data.token}),jn=await Mt.paginate(Mt.apps.listReposAccessibleToInstallation);var Xe;Fe=((Xe=jn.repositories)!==null&&Xe!==void 0?Xe:jn).map(ar=>ar.name)}return{token:we.data.token,expiresAt:ye.ou.fromISO(we.data.expires_at),repositories:Fe}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(c){const j=(await this.getInstallations()).find(me=>{var we;return me.account&&"login"in me.account&&((we=me.account.login)===null||we===void 0?void 0:we.toLocaleLowerCase("en-US"))===c.toLocaleLowerCase("en-US")});if(j)return{installationId:j.id,suspended:Boolean(j.suspended_by)};const K=new Error(`No app installation found for ${c} in ${this.baseAuthConfig.appId}`);throw K.name="NotFoundError",K}constructor(c,b){(0,r._)(this,"appClient",void 0),(0,r._)(this,"baseUrl",void 0),(0,r._)(this,"baseAuthConfig",void 0),(0,r._)(this,"cache",new Me),(0,r._)(this,"allowedInstallationOwners",void 0),this.allowedInstallationOwners=c.allowedInstallationOwners,this.baseUrl=b,this.baseAuthConfig={appId:c.appId,privateKey:c.privateKey.replace(/\\n/gm,`
32
+ `},Ar=100,S=10,c=(0,g.Z)(e=>({root:{position:"relative",display:"flex",flexFlow:"row nowrap",alignItems:"center"},container:{overflow:"auto",scrollbarWidth:0,"&::-webkit-scrollbar":{display:"none"}},fade:{position:"absolute",width:Ar,height:`calc(100% + ${S}px)`,transition:"opacity 300ms",pointerEvents:"none"},fadeLeft:{left:-S,background:`linear-gradient(90deg, ${Gn(e.palette.type)})`},fadeRight:{right:-S,background:`linear-gradient(270deg, ${Gn(e.palette.type)})`},fadeHidden:{opacity:0},button:{position:"absolute"},buttonLeft:{left:-e.spacing(2)},buttonRight:{right:-e.spacing(2)}}),{name:"BackstageHorizontalScrollGrid"});function b(e){const[[o,l],d]=React.useState([0,0]);return React.useLayoutEffect(()=>{const m=e.current;if(!m){d([0,0]);return}const y=()=>{const I=m.scrollLeft,B=m.scrollWidth-m.offsetWidth-m.scrollLeft;d([I,B])};return y(),m.addEventListener("scroll",y),window.addEventListener("resize",y),()=>{m.removeEventListener("scroll",y),window.removeEventListener("resize",y)}},[e]),[o,l]}function j(e,o,l){const[d,m]=React.useState(0);return React.useLayoutEffect(()=>{if(d===0)return;const y=window.performance.now(),I=requestAnimationFrame(B=>{if(!e.current)return;const Y=B-y,Z=Math.abs(d)*Y/o,pe=Math.max(l,Z)*Math.sign(d);e.current.scrollBy({left:pe});const Te=d-pe;Math.sign(d)!==Math.sign(Te)?m(0):m(Te)});return()=>cancelAnimationFrame(I)},[e,d,o,l]),m}function K(e){const{scrollStep:o=100,scrollSpeed:l=50,minScrollDistance:d=5,children:m,...y}=e,I=c(e),B=React.useRef(),[Y,Z]=b(B),fe=j(B,l,d),pe=Te=>{B.current&&fe(Te?o:-o)};return _jsxs(Box,{...y,className:I.root,children:[_jsx(Grid,{container:!0,direction:"row",wrap:"nowrap",className:I.container,ref:B,children:m}),_jsx(Box,{className:classNames(I.fade,I.fadeLeft,{[I.fadeHidden]:Y===0})}),_jsx(Box,{className:classNames(I.fade,I.fadeRight,{[I.fadeHidden]:Z===0})}),Y>0&&_jsx(IconButton,{title:"Scroll Left",onClick:()=>pe(!1),className:classNames(I.button,I.buttonLeft,{}),children:_jsx(ChevronLeftIcon,{})}),Z>0&&_jsx(IconButton,{title:"Scroll Right",onClick:()=>pe(!0),className:classNames(I.button,I.buttonRight,{}),children:_jsx(ChevronRightIcon,{})})]})}const me=(0,g.Z)(e=>({alpha:{color:e.palette.common.white,fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"},beta:{color:"#4d65cc",fontFamily:"serif",fontWeight:"normal",fontStyle:"italic"}}),{name:"BackstageLifecycle"});function we(e){const o=me(e),{shorthand:l,alpha:d}=e;return l?_jsx(Typography,{component:"span",className:o[d?"alpha":"beta"],style:{fontSize:"120%"},children:d?_jsx(_Fragment,{children:"\u03B1"}):_jsx(_Fragment,{children:"\u03B2"})}):_jsx(Typography,{component:"span",className:o[d?"alpha":"beta"],children:d?"Alpha":"Beta"})}const Fe=(0,f.lazy)(()=>Promise.all([n.e(1049),n.e(6051)]).then(n.bind(n,76051)).then(e=>({default:e.RealLogViewer})));function Xe(e){const{Progress:o}=(0,p.qD)().getComponents();return(0,r.jsx)(f.Suspense,{fallback:(0,r.jsx)(o,{}),children:(0,r.jsx)(Fe,{...e})})}var Mt=n(28865),jn=n(60251);const qn=(0,g.Z)(e=>({markdown:{"& table":{borderCollapse:"collapse",border:`1px solid ${e.palette.border}`},"& th, & td":{border:`1px solid ${e.palette.border}`,padding:e.spacing(1)},"& td":{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:e.spacing(3,2,3,2.5),borderBottom:0},"& th":{backgroundColor:e.palette.background.paper},"& tr":{backgroundColor:e.palette.background.paper},"& tr:nth-child(odd)":{backgroundColor:e.palette.background.default},"& a":{color:e.palette.link},"& img":{maxWidth:"100%"}}}),{name:"BackstageMarkdownContent"}),ar=(e,o)=>o?typeof o=="string"?e+o:f.Children.toArray(o.props.children).reduce(ar,e):e,vr=({level:e,children:o})=>{const m=f.Children.toArray(o).reduce(ar,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return f.createElement(`h${e}`,{id:m},o)},an={code:({inline:e,className:o,children:l,...d})=>{const m=String(l).replace(/\n+$/,""),y=/language-(\w+)/.exec(o||"");return!e&&y?(0,r.jsx)(je,{language:y[1],text:m}):(0,r.jsx)("code",{className:o,...d,children:l})},h1:vr,h2:vr,h3:vr,h4:vr,h5:vr,h6:vr};function ho(e){const{content:o,dialect:l="gfm",linkTarget:d,transformLinkUri:m,transformImageUri:y,className:I}=e,B=qn();return(0,r.jsx)(Mt.D,{remarkPlugins:l==="gfm"?[jn.Z]:[],className:`${B.markdown} ${I}`,children:o,components:an,linkTarget:d,transformLinkUri:m,transformImageUri:y})}var qr=n(23054);const Oo=(0,g.Z)(e=>({root:{paddingLeft:e.spacing(3)}}),{name:"BackstageLoginRequestListItem"}),_r=({request:e,busy:o,setBusy:l})=>{const d=Oo(),[m,y]=useState(),I=async()=>{l(!0);try{await e.trigger()}catch(Y){y(isError(Y)?Y.message:"An unspecified error occurred")}finally{l(!1)}},B=e.provider.icon;return _jsxs(ListItem,{disabled:o,classes:{root:d.root},children:[_jsx(ListItemAvatar,{children:_jsx(B,{fontSize:"large"})}),_jsx(ListItemText,{primary:e.provider.title,secondary:m&&_jsx(Typography,{color:"error",children:m})}),_jsx(Button,{color:"primary",variant:"contained",onClick:I,children:"Log in"})]})};var po=null;const ko=(0,g.Z)(e=>({dialog:{paddingTop:e.spacing(1)},title:{minWidth:0},titleHeading:{fontSize:e.typography.h6.fontSize},contentList:{padding:0},actionButtons:{padding:e.spacing(2,0)}}),{name:"OAuthRequestDialog"});function vs(e){const o=ko(),[l,d]=useState(!1),m=useApi(oauthRequestApiRef),y=useApi(configApiRef);var I;const B=(I=y.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&I!==void 0?I:!1,Y=useObservable(useMemo(()=>m.authRequest$(),[m]),[]),Z=()=>{Y.forEach(fe=>fe.reject())};return _jsxs(Dialog,{open:Boolean(Y.length),fullWidth:!0,maxWidth:"xs",classes:{paper:o.dialog},"aria-labelledby":"oauth-req-dialog-title",children:[_jsxs("main",{children:[_jsxs(DialogTitle,{classes:{root:o.title},id:"oauth-req-dialog-title",children:[_jsx(Typography,{className:o.titleHeading,variant:"h1",variantMapping:{h1:"span"},children:"Login Required"}),B?_jsx(Typography,{children:"This will trigger a http redirect to OAuth Login."}):null]}),_jsx(DialogContent,{dividers:!0,classes:{root:o.contentList},children:_jsx(List,{children:Y.map(fe=>_jsx(LoginRequestListItem,{request:fe,busy:l,setBusy:d},fe.provider.title))})})]}),_jsx(DialogActions,{classes:{root:o.actionButtons},children:_jsx(Button,{onClick:Z,children:"Reject All"})})]})}var Bo=n(15277),$o=n.n(Bo),yr=n(29862);const nr=(0,g.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function Lr(e){const[o,l]=(0,f.useState)(!1),d=(0,yr.t)(),m=nr(),y=B=>{d()&&l(B)};var I;return(0,r.jsx)(T.ZP,{title:(I=e.title)!==null&&I!==void 0?I:e.text||"",placement:e.placement,disableHoverListener:!o,children:(0,r.jsx)($o(),{text:e.text,line:e.line,onToggled:y,containerClassName:m.container})})}var Zr=n(67358);function eo(e){const o=(0,ae.Z)(),[l,d]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{const m=setTimeout(()=>d(!0),o.transitions.duration.short);return()=>clearTimeout(m)},[o.transitions.duration.short]),l?(0,r.jsx)(Zr.Z,{...e,"data-testid":"progress"}):(0,r.jsx)(A.Z,{display:"none"})}var to=n(94339),Ur=n(14503),Do=n(24579),fo=n(32552),kn=n(15459),_n=n(27597);const Or=(0,g.Z)(e=>({root:{maxWidth:"fit-content",padding:e.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:e.palette.textSubtle},arrow:{color:e.palette.textSubtle}}),{name:"BackstageBottomLink"});function Mr(e){const{link:o,title:l,onClick:d}=e,m=Or();return(0,r.jsxs)(A.Z,{children:[(0,r.jsx)(Ne.Z,{}),(0,r.jsx)(de.r,{to:o,onClick:d,underline:"none",children:(0,r.jsxs)(A.Z,{display:"flex",alignItems:"center",className:m.root,children:[(0,r.jsx)(A.Z,{className:m.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,r.jsx)(rt.Z,{children:(0,r.jsx)("strong",{children:l})})}),(0,r.jsx)(_n.Z,{className:m.arrow})]})})]})}const Tr=e=>{const{slackChannel:o}=e;if(o){if(typeof o=="string")return(0,r.jsxs)(rt.Z,{children:["Please contact ",o," for help."]});if(!o.href)return(0,r.jsxs)(rt.Z,{children:["Please contact ",o.name," for help."]})}else return null;return(0,r.jsx)(te,{to:o.href,variant:"contained",children:o.name})},no=class extends f.Component{componentDidCatch(o,l){console.error(`ErrorBoundary, error: ${o}, info: ${l}`),this.setState({error:o,errorInfo:l})}render(){const{slackChannel:o,children:l}=this.props,{error:d}=this.state;return d?(0,r.jsx)(st,{title:"Something Went Wrong",error:d,children:(0,r.jsx)(Tr,{slackChannel:o})}):l}constructor(o){super(o),this.state={error:void 0,errorInfo:void 0}}},ro=(0,g.Z)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:e.typography.fontWeightBold},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),Fo=(0,kn.Z)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(Ur.Z),go={card:{flex:{display:"flex",flexDirection:"column"},fullHeight:{display:"flex",flexDirection:"column",height:"100%"},gridItem:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px",breakInside:"avoid-page","@media print":{height:"auto"}}},cardContent:{fullHeight:{flex:1},gridItem:{flex:1}}};function lr(e){const{title:o,subheader:l,divider:d=!0,deepLink:m,slackChannel:y,errorBoundaryProps:I,variant:B,children:Y,headerStyle:Z,headerProps:fe,icon:pe,action:Te,actionsClassName:Ee,actions:Ze,cardClassName:it,actionsTopRight:Pt,className:mn,noPadding:Fn,titleTypographyProps:or}=e,Bt=ro();let vn={},yn={};B&&B.split(/[\s]+/g).forEach(wr=>{vn={...vn,...go.card[wr]},yn={...yn,...go.cardContent[wr]}});const gr=()=>!l&&!pe?null:(0,r.jsxs)("div",{className:Bt.headerSubheader,"data-testid":"info-card-subheader",children:[l&&(0,r.jsx)("div",{className:Bt.subheader,children:l}),pe]}),Sr=I||(y?{slackChannel:y}:{});return(0,r.jsx)(to.Z,{style:vn,className:mn,children:(0,r.jsxs)(no,{...Sr,children:[o&&(0,r.jsx)(fo.Z,{classes:{root:Bt.header,title:Bt.headerTitle,subheader:Bt.headerSubheader,avatar:Bt.headerAvatar,action:Bt.headerAction,content:Bt.headerContent},title:o,subheader:gr(),action:Te,style:{...Z},titleTypographyProps:or,...fe}),Pt&&(0,r.jsx)(Fo,{children:Pt}),d&&(0,r.jsx)(Ne.Z,{}),(0,r.jsx)(Do.Z,{className:on()(it,{[Bt.noPadding]:Fn}),style:yn,children:Y}),Ze&&(0,r.jsx)(Ur.Z,{className:Ee,children:Ze}),m&&(0,r.jsx)(Mr,{...m})]})})}var ys=n(39307);const No=(0,g.Z)(e=>({root:{position:"relative",lineHeight:0},overlay:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -60%)",fontSize:e.typography.pxToRem(45),fontWeight:e.typography.fontWeightBold,color:e.palette.textContrast},description:{fontSize:"100%",top:"50%",left:"50%",transform:"translate(-50%, -50%)",position:"absolute",wordBreak:"break-all",display:"inline-block"},circle:{width:"80%",transform:"translate(10%, 0)"},colorUnknown:{}}),{name:"BackstageGauge"}),zr={fractional:!0,inverse:!1,unit:"%",max:100},Zo=({palette:e,value:o,inverse:l,max:d})=>{if(isNaN(o))return"#ddd";const m=d||zr.max,y=l?m-o:o;return y<m/3?e.status.error:y<m*(2/3)?e.status.warning:e.status.ok};function Uo(e){const[o,l]=useState(null),{getColor:d=Zo}=e,m=No(e),{palette:y}=useTheme(),{value:I,fractional:B,inverse:Y,unit:Z,max:fe,description:pe}={...zr,...e},Te=B?Math.round(I*fe):I,Ee=fe!==100?Math.round(I):Te,[Ze,it]=useState(!1);return useEffect(()=>{const Pt=o,mn=()=>it(!0),Fn=()=>it(!1);return Pt&&pe?(Pt.addEventListener("mouseenter",mn),Pt.addEventListener("mouseleave",Fn),()=>{Pt.removeEventListener("mouseenter",mn),Pt.removeEventListener("mouseleave",Fn)}):()=>{it(!1)}},[pe,o]),_jsxs(Box,{ref:l,className:m.root,children:[_jsx(Circle,{strokeLinecap:"butt",percent:Te,strokeWidth:12,trailWidth:12,strokeColor:d({palette:y,value:Ee,inverse:Y,max:fe}),className:m.circle}),pe&&Ze?_jsx(Box,{className:m.description,children:pe}):_jsx(Box,{className:m.overlay,children:isNaN(I)?"N/A":`${Ee}${Z}`})]})}const er=(0,g.Z)({root:{height:"100%",width:250}},{name:"BackstageGaugeCard"});function si(e){const o=er(e),{title:l,subheader:d,progress:m,inverse:y,deepLink:I,description:B,icon:Y,variant:Z,getColor:fe}=e,pe={inverse:y,description:B,getColor:fe,value:m};return _jsx(Box,{className:o.root,children:_jsx(InfoCard,{title:l,subheader:d,deepLink:I,variant:Z,icon:Y,children:_jsx(Gauge,{...pe})})})}function xs(e){const{value:o,getColor:l=getProgressColor,width:d="thick"}=e,{palette:m}=useTheme();if(isNaN(o))return null;let y=Math.round(o*100*100)/100;y>100&&(y=100);const I=d==="thick"?4:1,B=l({palette:m,value:y,inverse:!1,max:100});return _jsx(Tooltip,{title:`${y}%`,children:_jsx(Typography,{component:"span",children:_jsx(Line,{percent:y,strokeWidth:I,trailWidth:I,strokeColor:B})})})}var bs=n(21324),Ss=n(7089),oo=n(42494),Wr=n(74603),Vr=n(56939),Kn=n(12231),Mo=n(73698),Yn=n(12420),so=n(72379);const zo=(0,g.Z)(e=>(0,Yn.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageClosedDropdown"});var Wo=()=>{const e=zo();return(0,r.jsx)(so.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z",fill:"#616161"})})};const Vo=(0,g.Z)(e=>(0,Yn.Z)({icon:{position:"absolute",right:e.spacing(.5),pointerEvents:"none"}}),{name:"BackstageOpenedDropdown"});var Ho=()=>{const e=Vo();return(0,r.jsx)(so.Z,{className:e.icon,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z",fill:"#616161"})})};const ao=(0,kn.Z)(e=>(0,Yn.Z)({root:{"label + &":{marginTop:e.spacing(3)}},input:{borderRadius:e.shape.borderRadius,position:"relative",backgroundColor:e.palette.background.paper,border:"1px solid #ced4da",fontSize:e.typography.body1.fontSize,padding:e.spacing(1.25,3.25,1.25,1.5),transition:e.transitions.create(["border-color","box-shadow"]),fontFamily:"Helvetica Neue","&:focus":{background:e.palette.background.paper,borderRadius:e.shape.borderRadius}}}),{name:"BackstageSelectInputBase"})(Wr.Z),Go=(0,g.Z)(e=>(0,Yn.Z)({formControl:{margin:`${e.spacing(1)} 0px`,maxWidth:300},label:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},formLabel:{transform:"initial",fontWeight:"bold",fontSize:e.typography.body2.fontSize,fontFamily:e.typography.fontFamily,color:e.palette.text.primary,"&.Mui-focused":{color:e.palette.text.primary}},chips:{display:"flex",flexWrap:"wrap"},chip:{margin:2},checkbox:{},root:{display:"flex",flexDirection:"column"}}),{name:"BackstageSelect"});function mo(e){const{multiple:o,items:l,label:d,placeholder:m,selected:y,onChange:I,triggerReset:B,native:Y=!1,disabled:Z=!1,margin:fe}=e,pe=Go(),[Te,Ee]=(0,f.useState)(y||(o?[]:"")),[Ze,it]=(0,f.useState)(!1);(0,f.useEffect)(()=>{Ee(o?[]:"")},[B,o]),(0,f.useEffect)(()=>{Ee(y||(o?[]:""))},[y,o]);const Pt=Bt=>{Ee(Bt.target.value),I(Bt.target.value)},mn=Bt=>{if(Z){Bt.preventDefault();return}it(vn=>o&&!(Bt.target instanceof HTMLElement)?!0:!vn)},Fn=()=>{it(!1)},or=Bt=>()=>{const vn=Te.filter(yn=>yn!==Bt);Ee(vn),I(vn)};return(0,r.jsx)(A.Z,{className:pe.root,children:(0,r.jsxs)(oo.Z,{className:pe.formControl,children:[(0,r.jsx)(Vr.Z,{className:pe.formLabel,children:d}),(0,r.jsxs)(Mo.Z,{"aria-label":d,value:Te,native:Y,disabled:Z,"data-testid":"select",displayEmpty:!0,multiple:o,margin:fe,onChange:Pt,open:Ze,onOpen:mn,onClose:Fn,input:(0,r.jsx)(ao,{}),label:d,tabIndex:0,renderValue:Bt=>{var vn;return o&&Te.length!==0?(0,r.jsx)(A.Z,{className:pe.chips,children:Bt.map(yn=>{var gr,Sr;return(0,r.jsx)(Ss.Z,{label:(gr=l.find(Cr=>Cr.value===yn))===null||gr===void 0?void 0:gr.label,clickable:!0,onDelete:or(yn),className:pe.chip},(Sr=l.find(Cr=>Cr.value===yn))===null||Sr===void 0?void 0:Sr.value)})}):(0,r.jsx)(rt.Z,{children:Te.length===0?m||"":(vn=l.find(yn=>yn.value===Bt))===null||vn===void 0?void 0:vn.label})},IconComponent:()=>Ze?(0,r.jsx)(Ho,{}):(0,r.jsx)(Wo,{}),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},getContentAnchorEl:null},children:[m&&!o&&(0,r.jsx)(Kn.Z,{value:[],children:m}),Y?l&&l.map(Bt=>(0,r.jsx)("option",{value:Bt.value,children:Bt.label},Bt.value)):l&&l.map(Bt=>(0,r.jsxs)(Kn.Z,{value:Bt.value,children:[o&&(0,r.jsx)(bs.Z,{color:"primary",checked:Te.includes(Bt.value)||!1,className:pe.checkbox}),Bt.label]},Bt.value))]})]})})}const vo=()=>{},ws=f.createContext({stepperLength:0,stepIndex:0,setStepIndex:vo,stepHistory:[],setStepHistory:vo,onStepChange:vo});function js(e){const{children:o,elevated:l,onStepChange:d,activeStep:m=0}=e,[y,I]=useState(m),[B,Y]=useState([0]);useEffect(()=>{I(m)},[m]);const Z=[];let fe;return Children.forEach(o,pe=>{isValidElement(pe)&&(pe.props.end?fe=pe:Z.push(pe))}),_jsxs(_Fragment,{children:[_jsx(ws.Provider,{value:{stepIndex:y,setStepIndex:I,stepHistory:B,setStepHistory:Y,onStepChange:d,stepperLength:Children.count(o)},children:_jsx(MuiStepper,{activeStep:y,orientation:"vertical",elevation:l?2:0,children:Z})}),y>=Children.count(o)-1&&fe]})}const Ko=(0,g.Z)(e=>({root:{marginTop:e.spacing(3),"& button":{marginRight:e.spacing(1)}}}),{name:"BackstageSimpleStepperFooter"}),ln=({text:e,handleClick:o})=>_jsx(Button,{onClick:o,children:e||"Reset"}),Yo=({text:e,handleClick:o,disabled:l,last:d,stepIndex:m})=>_jsx(Button,{variant:"contained",color:"primary",disabled:l,"data-testid":`nextButton-${m}`,onClick:o,children:e||(d?"Finish":"Next")}),Es=({text:e,handleClick:o,disabled:l,stepIndex:d})=>_jsx(Button,{variant:"outlined",color:"primary",disabled:l,"data-testid":`skipButton-${d}`,onClick:o,children:e||"Skip"}),x=({text:e,handleClick:o,disabled:l,stepIndex:d})=>_jsx(Button,{onClick:o,"data-testid":`backButton-${d}`,disabled:l,children:e||"Back"}),C=({actions:e={},children:o})=>{const l=Ko(),{stepperLength:d,stepIndex:m,setStepIndex:y,stepHistory:I,setStepHistory:B,onStepChange:Y}=useContext(VerticalStepperContext),Z=(Ee,Ze)=>{Ze&&Ze(),Y&&Y(m,Ee),y(Ee)},fe=()=>{const Ee=e.nextStep?e.nextStep(m,d-1):m+1;Z(Ee,e.onNext),B([...I,Ee])},pe=()=>{I.pop(),Z(I[I.length-1],e.onBack),B([...I])},Te=()=>{Z(0,e.onRestart),B([0])};return _jsxs(Box,{className:l.root,children:[[void 0,!0].includes(e.showBack)&&m!==0&&_jsx(x,{text:e.backText,handleClick:pe,disabled:m===0,stepIndex:m}),e.showSkip&&_jsx(Es,{text:e.skipText,handleClick:fe,disabled:!!d&&m>=d||!!e.canSkip&&!e.canSkip(),stepIndex:m}),[void 0,!0].includes(e.showNext)&&_jsx(Yo,{text:e.nextText,handleClick:fe,disabled:!!d&&m>=d||!!e.canNext&&!e.canNext(),stepIndex:m}),e.showRestart&&m!==0&&_jsx(ln,{text:e.restartText,handleClick:Te,stepIndex:m}),o]})},E=(0,g.Z)(e=>({end:{padding:e.spacing(3)}}),{name:"SimpleStepperStep"});function $(e){const{title:o,children:l,end:d,actions:m,...y}=e,I=E();return d?_jsxs(Box,{className:I.end,children:[_jsx(Typography,{variant:"h6",children:o}),l,_jsx(SimpleStepperFooter,{actions:{...m||{},showNext:!1}})]}):_jsxs(MuiStep,{...y,children:[_jsx(StepLabel,{children:_jsx(Typography,{variant:"h6",children:o})}),_jsxs(StepContent,{children:[l,_jsx(SimpleStepperFooter,{actions:m})]})]})}const Q=(0,g.Z)(e=>({status:{fontWeight:e.typography.fontWeightMedium,"&::before":{width:"0.7em",height:"0.7em",display:"inline-block",marginRight:e.spacing(1),borderRadius:"50%",content:'""'}},ok:{"&::before":{backgroundColor:e.palette.status.ok}},warning:{"&::before":{backgroundColor:e.palette.status.warning}},error:{"&::before":{backgroundColor:e.palette.status.error}},pending:{"&::before":{backgroundColor:e.palette.status.pending}},running:{"&::before":{backgroundColor:e.palette.status.running}},aborted:{"&::before":{backgroundColor:e.palette.status.aborted}}}),{name:"BackstageStatus"});function ne(e){const o=Q(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.ok),"aria-label":"Status ok","aria-hidden":"true",...e})}function re(e){const o=Q(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.warning),"aria-label":"Status warning","aria-hidden":"true",...e})}function ve(e){const o=Q(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.error),"aria-label":"Status error","aria-hidden":"true",...e})}function Ae(e){const o=Q(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.pending),"aria-label":"Status pending","aria-hidden":"true",...e})}function Oe(e){const o=Q(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.running),"aria-label":"Status running","aria-hidden":"true",...e})}function De(e){const o=Q(e);return _jsx(Typography,{component:"span",className:classNames(o.status,o.aborted),"aria-label":"Status aborted","aria-hidden":"true",...e})}var Be=n(74600),tt=n(15584);const ft=e=>(0,Yn.Z)({root:{fontWeight:e.typography.fontWeightBold,whiteSpace:"nowrap",paddingRight:e.spacing(4),border:"0",verticalAlign:"top"}}),qe={root:{border:"0",verticalAlign:"top"}},We=e=>(0,Yn.Z)({root:{margin:e.spacing(0,0,-1,0)}}),gt=e=>(0,Yn.Z)({root:{padding:e.spacing(0,0,1,0)},random:{}}),Ot=(0,kn.Z)(ft,{name:"BackstageMetadataTableTitleCell"})(tt.Z),bn=(0,kn.Z)(qe,{name:"BackstageMetadataTableCell"})(tt.Z),Rt=({dense:e,children:o})=>_jsx(Table,{size:e?"small":"medium",children:_jsx(TableBody,{children:o})}),Gt=({title:e,children:o,...l})=>_jsxs(TableRow,{children:[e&&_jsx(Ot,{children:e}),_jsx(bn,{colSpan:e?1:2,...l,children:o})]}),kt=(0,kn.Z)(We,{name:"BackstageMetadataTableList"})(({classes:e,children:o})=>(0,r.jsx)(Zt.Z,{disablePadding:!0,className:e.root,children:o})),dn=(0,kn.Z)(gt,{name:"BackstageMetadataTableListItem"})(({classes:e,children:o})=>(0,r.jsx)(_t.Z,{className:e.root,children:o})),$n=(0,Yn.Z)({root:{margin:"0 0",listStyleType:"none"}}),Rr=e=>(0,Yn.Z)({root:{...$n.root,paddingLeft:e.spacing(1)}}),cr=(0,kn.Z)($n,{name:"BackstageStructuredMetadataTableList"})(({classes:e,children:o})=>(0,r.jsx)(kt,{classes:e,children:o})),Hr=(0,kn.Z)(Rr,{name:"BackstageStructuredMetadataTableNestedList"})(({classes:e,children:o})=>(0,r.jsx)(kt,{classes:e,children:o}));function Nn(e,o){const l=e.map((d,m)=>_jsx(MetadataListItem,{children:xr(d)},m));return o?_jsx(Hr,{children:l}):_jsx(cr,{children:l})}function zn(e,o,l){const d=Object.keys(e).map(m=>{const y=xr(e[m],!0),I=l&&l.titleFormat?l.titleFormat(m):startCase(m);return _jsxs(MetadataListItem,{children:[_jsx(Typography,{variant:"body2",component:"span",children:`${I}: `}),y]},m)});return o?_jsx(Hr,{children:d}):_jsx(cr,{children:d})}function xr(e,o,l){return React.isValidElement(e)?_jsx(Fragment,{children:e}):typeof e=="object"&&!Array.isArray(e)?zn(e,o,l):Array.isArray(e)?Nn(e,l):typeof e=="boolean"?_jsx(Fragment,{children:e?"\u2705":"\u274C"}):_jsx(Typography,{variant:"body2",component:"span",children:e})}const ii=({value:e,options:o})=>_jsx(Fragment,{children:xr(e,o)}),As=({title:e,value:o,options:l})=>_jsx(MetadataTableItem,{title:l&&l.titleFormat?l.titleFormat(e):startCase(e),children:_jsx(ii,{value:o,options:l})});function Ts(e,o){return Object.keys(e).map(l=>_jsx(As,{title:l,value:e[l],options:o},l))}function kr(e){const{metadata:o,dense:l=!0,options:d}=e,m=Ts(o,d||{});return _jsx(MetadataTable,{dense:l,children:m})}var dr=n(49429),ur=n(86136),hr=n(50758),Rs=n(79784),Gr=n(76635),ai=n(19126),Is=n.n(ai);function Ps(e){return qs.stringify(e,{strictNullHandling:!0})}function Kr(e){return qs.parse(e,{ignoreQueryPrefix:!0,strictNullHandling:!0})}function Jo(e,o){return Kr(e)[o]}function Ls(e,o,l){const d={...Kr(e),[o]:l};return Ps(d)}function Ua(e,o=250){const[l,d]=useSearchParams(),m=l.toString(),[y,I]=useState(Jo(m,e));return useEffect(()=>{const B=Jo(m,e);I(Y=>isEqual(B,Y)?Y:B)},[m,I,e]),useDebouncedEffect(()=>{const B=Ls(m,e,y);m!==B&&d(B,{replace:!0})},[d,y,m,e],o),[y,I]}const yo={url:"https://github.com/backstage/backstage/issues",items:[{title:"Support Not Configured",icon:"warning",links:[{title:"Add `app.support` config key",url:"https://github.com/backstage/backstage/blob/master/app-config.yaml"}]}]};function Qo(){const o=(0,p.I_)().get(p.Ds),l=o==null?void 0:o.getOptionalConfig("app.support");if(!l)return yo;var d;return{url:l.getString("url"),items:l.getConfigArray("items").flatMap(m=>({title:m.getString("title"),icon:m.getOptionalString("icon"),links:((d=m.getOptionalConfigArray("links"))!==null&&d!==void 0?d:[]).flatMap(y=>({url:y.getString("url"),title:y.getString("title")}))}))}}var li=n(80079);function rr(e,o){const d=(0,p.qD)().getSystemIcon(e);return d?(0,r.jsx)(d,{...o}):(0,r.jsx)(li.Z,{...o})}function sa(e){return rr("brokenImage",e)}function ia(e){return rr("catalog",e)}function aa(e){return rr("chat",e)}function la(e){return rr("dashboard",e)}function ca(e){return rr("docs",e)}function da(e){return rr("email",e)}function ci(e){return rr("github",e)}function ua(e){return rr("group",e)}function xo(e){return rr("help",e)}function di(e){return rr("user",e)}function Ma(e){return rr("warning",e)}const ha=(0,g.Z)({popoverList:{minWidth:260,maxWidth:400}},{name:"BackstageSupportButton"}),ui=({icon:e})=>{const o=(0,p.qD)();var l;const d=e&&(l=o.getSystemIcon(e))!==null&&l!==void 0?l:xo;return(0,r.jsx)(d,{})};var Xo;const hi=({link:e})=>(0,r.jsx)(de.r,{to:e.url,children:(Xo=e.title)!==null&&Xo!==void 0?Xo:e.url}),pi=({item:e})=>{var o;return(0,r.jsxs)(Kn.Z,{children:[(0,r.jsx)(ur.Z,{children:(0,r.jsx)(ui,{icon:e.icon})}),(0,r.jsx)(en.Z,{primary:e.title,secondary:(o=e.links)===null||o===void 0?void 0:o.reduce((l,d,m)=>[...l,m>0&&(0,r.jsx)("br",{},m),(0,r.jsx)(hi,{link:d},d.url)],[])})]})};function bo(e){const{title:o,items:l,children:d}=e,{items:m}=Qo(),[y,I]=(0,f.useState)(!1),[B,Y]=(0,f.useState)(null),Z=ha(),fe=(0,Pe.Z)(Ee=>Ee.breakpoints.down("sm")),pe=Ee=>{Y(Ee.currentTarget),I(!0)},Te=()=>{I(!1)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(A.Z,{display:"flex",ml:1,children:fe?(0,r.jsx)(H.Z,{color:"primary",size:"small",onClick:pe,"data-testid":"support-button","aria-label":"Support",children:(0,r.jsx)(xo,{})}):(0,r.jsx)(ge.Z,{"data-testid":"support-button","aria-label":"Support",color:"primary",onClick:pe,startIcon:(0,r.jsx)(xo,{}),children:"Support"})}),(0,r.jsxs)(Rs.ZP,{"data-testid":"support-button-popover",open:y,anchorEl:B,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:Te,children:[(0,r.jsxs)(hr.Z,{className:Z.popoverList,autoFocusItem:Boolean(B),children:[o&&(0,r.jsx)(Kn.Z,{alignItems:"flex-start",children:(0,r.jsx)(rt.Z,{variant:"subtitle1",children:o})}),f.Children.map(d,(Ee,Ze)=>(0,r.jsx)(Kn.Z,{alignItems:"flex-start",children:Ee},`child-${Ze}`)),(l!=null?l:m).map((Ee,Ze)=>(0,r.jsx)(pi,{item:Ee},`item-${Ze}`))]}),(0,r.jsx)(dr.Z,{children:(0,r.jsx)(ge.Z,{color:"primary",onClick:Te,"aria-label":"Close",children:"Close"})})]})]})}var So=n(18671),pr=n(73557),qo=n(84800);const _o=72,Br=24,Os=18,Sn={drawerWidthClosed:_o,drawerWidthOpen:224,defaultOpenDelayMs:100,defaultCloseDelayMs:0,defaultFadeDuration:200,logoHeight:32,iconContainerWidth:_o,iconSize:_o-Br*2,iconPadding:Br,selectedIndicatorWidth:3,userBadgePadding:Os,userBadgeDiameter:_o-Os*2,mobileSidebarHeight:56},pa=e=>({...Sn,...e,iconContainerWidth:Sn.drawerWidthClosed,iconSize:Sn.drawerWidthClosed-Sn.iconPadding*2,userBadgeDiameter:Sn.drawerWidthClosed-Sn.userBadgePadding*2}),fi={drawerWidthClosed:0,drawerWidthOpen:202,defaultOpenDelayMs:Sn.defaultOpenDelayMs+200},fa=e=>({...fi,...e}),ga="@backstage/core/sidebar-intro-dismissed",br=(0,f.createContext)({sidebarConfig:Sn,submenuConfig:fi}),gi=(0,f.createContext)({isHoveredOn:!1,setIsHoveredOn:()=>{}});var es=n(50023),mi=n(4190),Co=n(87685),wo=n(44882),$r=n(51837);const ks={isOpen:!1,setOpen:()=>{}},ts=(0,f.createContext)(ks),ns=(0,$r.CT)("sidebar-open-state-context");function Bs(e){const{children:o,value:l}=e;return(0,r.jsx)(ts.Provider,{value:l,children:(0,r.jsx)(ns.Provider,{value:(0,$r.EI)({1:l}),children:o})})}const rs=()=>{const e=(0,f.useContext)(ns),o=(0,f.useContext)(ts);if(e===void 0)return o||ks;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l};var vi=n(57998);const $s={isPinned:!0,toggleSidebarPinState:()=>{},isMobile:!1},Ds=(0,f.createContext)($s),yi=(0,$r.CT)("sidebar-pin-state-context");function xi(e){const{children:o,value:l}=e;return(0,r.jsx)(Ds.Provider,{value:l,children:(0,r.jsx)(yi.Provider,{value:(0,$r.EI)({1:l}),children:o})})}const jo=()=>{const e=(0,f.useContext)(yi),o=(0,f.useContext)(Ds);if(e===void 0)return o||$s;const l=e.atVersion(1);if(l===void 0)throw new Error("No context found for version 1.");return l},os=(0,g.Z)(e=>({root:{flexGrow:0,margin:e.spacing(0,2),color:e.palette.navigation.color},selected:o=>({color:`${e.palette.navigation.selectedColor}!important`,borderTop:`solid ${o.sidebarConfig.selectedIndicatorWidth}px ${e.palette.navigation.indicator}`,marginTop:"-1px"}),label:{display:"none"}})),bi=e=>{const{to:o,label:l,icon:d,value:m}=e,{sidebarConfig:y}=(0,f.useContext)(br),I=os({sidebarConfig:y}),B=(0,pr.TH)(),{selectedMenuItemIndex:Y,setSelectedMenuItemIndex:Z}=(0,f.useContext)(Ns),fe=(Te,Ee)=>{Z(Ee===Y?-1:Ee)},pe=m===Y&&Y>=0||m!==Y&&!(Y>=0)&&o===B.pathname;return(0,r.jsx)(vi.Z,{"aria-label":l,label:l,icon:d,component:de.r,to:o||B.pathname,onChange:fe,value:m,selected:pe,classes:I})},Fs=e=>{const{children:o,to:l,label:d,icon:m,value:y}=e,{isMobile:I}=jo();return I?(0,r.jsx)(bi,{to:l,label:d,icon:m,value:y}):(0,r.jsx)(r.Fragment,{children:o})},ss=(0,g.Z)(e=>({root:{position:"fixed",backgroundColor:e.palette.navigation.background,color:e.palette.navigation.color,bottom:0,left:0,right:0,zIndex:e.zIndex.snackbar,borderTop:"1px solid #383838","@media print":{display:"none"}},overlay:o=>({background:e.palette.navigation.background,width:"100%",bottom:`${o.sidebarConfig.mobileSidebarHeight}px`,height:`calc(100% - ${o.sidebarConfig.mobileSidebarHeight}px)`,flex:"0 1 auto",overflow:"auto"}),overlayHeader:{display:"flex",color:e.palette.text.primary,alignItems:"center",justifyContent:"space-between",padding:e.spacing(2,3)},overlayHeaderClose:{color:e.palette.text.primary},marginMobileSidebar:o=>({marginBottom:`${o.sidebarConfig.mobileSidebarHeight}px`})})),Si=e=>(0,Gr.orderBy)(e,({props:{priority:o}})=>Number.isInteger(o)?o:-1,"desc"),Ci=f.createElement(Fs).type,wi=({children:e,label:o="Menu",open:l,onClose:d})=>{const{sidebarConfig:m}=(0,f.useContext)(br),y=ss({sidebarConfig:m});return(0,r.jsxs)(mi.ZP,{anchor:"bottom",open:l,onClose:d,ModalProps:{BackdropProps:{classes:{root:y.marginMobileSidebar}}},classes:{root:y.marginMobileSidebar,paperAnchorBottom:y.overlay},children:[(0,r.jsxs)(A.Z,{className:y.overlayHeader,children:[(0,r.jsx)(rt.Z,{variant:"h3",children:o}),(0,r.jsx)(H.Z,{onClick:d,classes:{root:y.overlayHeaderClose},children:(0,r.jsx)(Co.Z,{})})]}),(0,r.jsx)(A.Z,{component:"nav",children:e})]})},Ns=(0,f.createContext)({selectedMenuItemIndex:-1,setSelectedMenuItemIndex:()=>{}}),ma=e=>{const{sidebarConfig:o}=(0,f.useContext)(br),{children:l}=e,d=ss({sidebarConfig:o}),m=(0,pr.TH)(),[y,I]=(0,f.useState)(-1);(0,f.useEffect)(()=>{I(-1)},[m.pathname]);let B=(0,p.vJ)(l,Z=>Z.getElements().filter(fe=>fe.type===Ci));if(l)B.length?B=Si(B):B.push((0,r.jsx)(Fs,{icon:(0,r.jsx)(wo.Z,{}),children:l},"default_menu"));else return null;const Y=y>=0&&!B[y].props.to;return(0,r.jsx)(Bs,{value:{isOpen:!0,setOpen:()=>{}},children:(0,r.jsxs)(Ns.Provider,{value:{selectedMenuItemIndex:y,setSelectedMenuItemIndex:I},children:[(0,r.jsx)(wi,{label:B[y]&&B[y].props.label,open:Y,onClose:()=>I(-1),children:B[y]&&B[y].props.children}),(0,r.jsx)(es.Z,{className:d.root,"data-testid":"mobile-sidebar-root",component:"nav",children:B})]})})};var Eo;(function(e){e.SIDEBAR_PIN_STATE="sidebarPinState"})(Eo||(Eo={}));const Zs={getSidebarPinState(){let e;try{e=JSON.parse(window.localStorage.getItem(Eo.SIDEBAR_PIN_STATE)||"true")}catch{return!0}return!!e},setSidebarPinState(e){return window.localStorage.setItem(Eo.SIDEBAR_PIN_STATE,JSON.stringify(e))}},ji=(0,g.Z)(e=>({root:{width:"100%",transition:"padding-left 0.1s ease-out",isolation:"isolate",[e.breakpoints.up("sm")]:{paddingLeft:o=>o.isPinned?o.sidebarConfig.drawerWidthOpen:o.sidebarConfig.drawerWidthClosed},[e.breakpoints.down("xs")]:{paddingBottom:o=>o.sidebarConfig.mobileSidebarHeight},"@media print":{padding:"0px !important"}},content:{zIndex:0,isolation:"isolate","&:focus":{outline:0}}}),{name:"BackstageSidebarPage"}),Us=(0,f.createContext)({content:{contentRef:void 0}});function Ms(e){const[o,l]=(0,f.useState)(()=>Zs.getSidebarPinState()),{sidebarConfig:d}=(0,f.useContext)(br),m=(0,f.useRef)(null),y=(0,f.useMemo)(()=>({content:{contentRef:m}}),[m]);(0,f.useEffect)(()=>{Zs.setSidebarPinState(o)},[o]);const I=(0,Pe.Z)(Z=>Z.breakpoints.down("xs"),{noSsr:!0}),B=()=>l(!o),Y=ji({isPinned:o,sidebarConfig:d});return(0,r.jsx)(xi,{value:{isPinned:o,toggleSidebarPinState:B,isMobile:I},children:(0,r.jsx)(Us.Provider,{value:y,children:(0,r.jsx)(A.Z,{className:Y.root,children:e.children})})})}function Ao(){const{content:e}=(0,f.useContext)(Us);return{focusContent:(0,f.useCallback)(()=>{var l,d;e==null||(l=e.contentRef)===null||l===void 0||(d=l.current)===null||d===void 0||d.focus()},[e]),contentRef:e==null?void 0:e.contentRef}}const zs=(0,g.Z)(e=>({drawer:{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",left:0,top:0,bottom:0,zIndex:e.zIndex.appBar,background:e.palette.navigation.background,overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest}),"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"},"@media print":{display:"none"}},drawerWidth:o=>({width:o.sidebarConfig.drawerWidthClosed}),drawerOpen:o=>({width:o.sidebarConfig.drawerWidthOpen,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shorter})}),visuallyHidden:{top:0,position:"absolute",zIndex:1e3,transform:"translateY(-200%)","&:focus":{transform:"translateY(5px)"}}}),{name:"BackstageSidebar"});var Jn;(function(e){e[e.Closed=0]="Closed",e[e.Idle=1]="Idle",e[e.Open=2]="Open"})(Jn||(Jn={}));const Ei=e=>{const{sidebarConfig:o}=(0,f.useContext)(br),{openDelayMs:l=o.defaultOpenDelayMs,closeDelayMs:d=o.defaultCloseDelayMs,disableExpandOnHover:m,children:y}=e,I=zs({sidebarConfig:o}),B=(0,Pe.Z)(mn=>mn.breakpoints.down("md"),{noSsr:!0}),[Y,Z]=(0,f.useState)(Jn.Closed),fe=(0,f.useRef)(),{isPinned:pe,toggleSidebarPinState:Te}=jo(),Ee=()=>{pe||m||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),Y!==Jn.Open&&!B&&(fe.current=window.setTimeout(()=>{fe.current=void 0,Z(Jn.Open)},l),Z(Jn.Idle)))},Ze=()=>{pe||m||(fe.current&&(clearTimeout(fe.current),fe.current=void 0),Y===Jn.Idle?Z(Jn.Closed):Y===Jn.Open&&(fe.current=window.setTimeout(()=>{fe.current=void 0,Z(Jn.Closed)},d)))},it=Y===Jn.Open&&!B||pe,Pt=mn=>{mn?(Z(Jn.Open),Te()):(Z(Jn.Closed),Te())};return(0,r.jsxs)("nav",{style:{},"aria-label":"sidebar nav",children:[(0,r.jsx)(va,{}),(0,r.jsx)(Bs,{value:{isOpen:it,setOpen:Pt},children:(0,r.jsx)(A.Z,{className:I.root,"data-testid":"sidebar-root",onMouseEnter:m?()=>{}:Ee,onFocus:m?()=>{}:Ee,onMouseLeave:m?()=>{}:Ze,onBlur:m?()=>{}:Ze,children:(0,r.jsx)(A.Z,{className:on()(I.drawer,I.drawerWidth,{[I.drawerOpen]:it}),children:y})})})]})},Ai=e=>{var o;const l=pa((o=e.sidebarOptions)!==null&&o!==void 0?o:{});var d;const m=fa((d=e.submenuOptions)!==null&&d!==void 0?d:{}),{children:y,disableExpandOnHover:I,openDelayMs:B,closeDelayMs:Y}=e,{isMobile:Z}=jo();return Z?(0,r.jsx)(ma,{children:y}):(0,r.jsx)(br.Provider,{value:{sidebarConfig:l,submenuConfig:m},children:(0,r.jsx)(Ei,{openDelayMs:B,closeDelayMs:Y,disableExpandOnHover:I,children:y})})};function va(){const{sidebarConfig:e}=(0,f.useContext)(br),{focusContent:o,contentRef:l}=Ao(),d=zs({sidebarConfig:e});return l!=null&&l.current?(0,r.jsx)(ge.Z,{onClick:o,variant:"contained",className:on()(d.visuallyHidden),children:"Skip to content"}):null}function Yr(e,o,l=!1){const d=new URLSearchParams(o.search).toString(),m=Is().parse(d),y=new URLSearchParams(e.search).toString(),I=Is().parse(y),B=l?Gr.isEqual:Gr.isMatch;return(0,Gr.isEqual)(o.pathname,e.pathname)&&B(I,m)}const ya=(0,g.Z)(e=>{var o,l;return{item:{height:48,width:"100%","&:hover":{background:((o=e.palette.navigation.navItem)===null||o===void 0?void 0:o.hoverBackground)||"#6f6f6f",color:e.palette.navigation.selectedColor},display:"flex",alignItems:"center",color:e.palette.navigation.color,padding:e.spacing(2.5),cursor:"pointer",position:"relative",background:"none",border:"none"},itemContainer:{width:"100%"},selected:{background:"#6f6f6f",color:e.palette.common.white},label:{margin:e.spacing(1.75),marginLeft:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis",lineHeight:1},subtitle:{fontSize:10,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"},dropdownArrow:{position:"absolute",right:21},dropdown:{display:"flex",flexDirection:"column",alignItems:"end"},dropdownItem:{width:"100%",padding:"10px 0 10px 0","&:hover":{background:((l=e.palette.navigation.navItem)===null||l===void 0?void 0:l.hoverBackground)||"#6f6f6f",color:e.palette.navigation.selectedColor}},textContent:{color:e.palette.navigation.color,paddingLeft:e.spacing(4),paddingRight:e.spacing(1),fontSize:e.typography.body2.fontSize,whiteSpace:"nowrap",overflow:"hidden","text-overflow":"ellipsis"}}},{name:"BackstageSidebarSubmenuItem"}),za=e=>{const{title:o,subtitle:l,to:d,icon:m,dropdownItems:y,exact:I}=e,B=ya(),{setIsHoveredOn:Y}=useContext(SidebarItemWithSubmenuContext),Z=()=>{Y(!1)},fe=useResolvedPath(d!=null?d:""),pe=useLocation();let Te=isLocationMatch(pe,fe,I);const[Ee,Ze]=useState(!1),it=()=>{Ze(!Ee)};return y!==void 0?(y.some(Pt=>{const mn=resolvePath(Pt.to);return Te=isLocationMatch(pe,mn,I),Te}),_jsxs(Box,{className:B.itemContainer,children:[_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Button,{role:"button",onClick:it,onTouchStart:Pt=>Pt.stopPropagation(),className:classnames(B.item,Te?B.selected:void 0),children:[m&&_jsx(m,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",component:"span",className:B.label,children:[o,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",component:"span",className:B.subtitle,children:l})]}),Ee?_jsx(ArrowDropUpIcon,{className:B.dropdownArrow}):_jsx(ArrowDropDownIcon,{className:B.dropdownArrow})]})}),y&&Ee&&_jsx(Box,{className:B.dropdown,children:y.map((Pt,mn)=>_jsx(Tooltip,{title:Pt.title,enterDelay:500,enterNextDelay:500,children:_jsx(Link,{to:Pt.to,underline:"none",className:B.dropdownItem,onClick:Z,onTouchStart:Fn=>Fn.stopPropagation(),children:_jsx(Typography,{component:"span",className:B.textContent,children:Pt.title})})},mn))})]})):_jsx(Box,{className:B.itemContainer,children:_jsx(Tooltip,{title:o,enterDelay:500,enterNextDelay:500,children:_jsxs(Link,{to:d,underline:"none",className:classnames(B.item,Te?B.selected:void 0),onClick:Z,onTouchStart:Pt=>Pt.stopPropagation(),children:[m&&_jsx(m,{fontSize:"small"}),_jsxs(Typography,{variant:"subtitle1",component:"span",className:B.label,children:[o,_jsx("br",{}),l&&_jsx(Typography,{variant:"caption",component:"span",className:B.subtitle,children:l})]})]})})})};var is;const Ti=(0,g.Z)(e=>({root:{zIndex:1e3,position:"relative",overflow:"visible",width:e.spacing(7)+1},drawer:o=>{var l;return{display:"flex",flexFlow:"column nowrap",alignItems:"flex-start",position:"fixed",[e.breakpoints.up("sm")]:{marginLeft:o.left,transition:e.transitions.create("margin-left",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})},top:0,bottom:0,padding:0,background:(is=(l=e.palette.navigation.submenu)===null||l===void 0?void 0:l.background)!==null&&is!==void 0?is:"#404040",overflowX:"hidden",msOverflowStyle:"none",scrollbarWidth:"none",cursor:"default",width:o.submenuConfig.drawerWidthClosed,transitionDelay:`${o.submenuConfig.defaultOpenDelayMs}ms`,"& > *":{flexShrink:0},"&::-webkit-scrollbar":{display:"none"}}},drawerOpen:o=>({width:o.submenuConfig.drawerWidthOpen,[e.breakpoints.down("xs")]:{width:"100%",position:"relative",paddingLeft:e.spacing(3),left:0,top:0}}),title:{fontSize:e.typography.h5.fontSize,fontWeight:e.typography.fontWeightMedium,color:e.palette.common.white,padding:e.spacing(2.5),[e.breakpoints.down("xs")]:{display:"none"}}}),{name:"BackstageSidebarSubmenu"}),Ws=e=>{const{isOpen:o}=rs(),{sidebarConfig:l,submenuConfig:d}=(0,f.useContext)(br),m=o?l.drawerWidthOpen:l.drawerWidthClosed,y=Ti({left:m,submenuConfig:d}),{isHoveredOn:I}=(0,f.useContext)(gi),[B,Y]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{Y(I)},[I]),(0,r.jsxs)(A.Z,{className:on()(y.drawer,{[y.drawerOpen]:B}),children:[(0,r.jsx)(rt.Z,{variant:"h5",component:"span",className:y.title,children:e.title}),e.children]})};var xa=n(26739),as=n(76600),Vs=n(83543),Hs=n(59797),Gs=n(98989);const Ri=(0,g.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),ls=()=>{const e=Ri();return _jsxs(Box,{className:e.iconContainer,children:[_jsx(Box,{className:e.arrow1,children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})}),_jsx(Box,{children:_jsx(ArrowBackIosIcon,{style:{fontSize:"12px"}})})]})};var Wa=null;const ba=(0,g.Z)({iconContainer:{display:"flex",position:"relative",width:"100%"},arrow1:{right:"6px",position:"absolute"}}),Va=()=>{const e=ba();return _jsxs(Box,{className:e.iconContainer,children:[_jsx(Box,{className:e.arrow1,children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})}),_jsx(Box,{children:_jsx(ArrowForwardIosIcon,{style:{fontSize:"12px"}})})]})};var Ha=null,cs,Dn;const Sa=e=>(0,g.Z)(o=>{var l,d;return{root:{color:o.palette.navigation.color,display:"flex",flexFlow:"row nowrap",alignItems:"center",height:48,cursor:"pointer"},buttonItem:{background:"none",border:"none",width:"100%",margin:0,padding:0,textAlign:"inherit",font:"inherit",textTransform:"none"},closed:{width:e.drawerWidthClosed,justifyContent:"center"},open:{[o.breakpoints.up("sm")]:{width:e.drawerWidthOpen}},highlightable:{"&:hover":{background:(cs=(l=o.palette.navigation.navItem)===null||l===void 0?void 0:l.hoverBackground)!==null&&cs!==void 0?cs:"#404040"}},highlighted:{background:(Dn=(d=o.palette.navigation.navItem)===null||d===void 0?void 0:d.hoverBackground)!==null&&Dn!==void 0?Dn:"#404040"},label:{fontWeight:"bold",whiteSpace:"nowrap",lineHeight:"auto",flex:"3 1 auto",width:"110px",overflow:"hidden","text-overflow":"ellipsis"},iconContainer:{boxSizing:"border-box",height:"100%",width:e.iconContainerWidth,marginRight:-o.spacing(2),display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"0"},searchRoot:{marginBottom:12},searchField:{color:"#b5b5b5",fontWeight:o.typography.fontWeightBold,fontSize:o.typography.fontSize},searchFieldHTMLInput:{padding:o.spacing(2,0,2)},searchContainer:{width:e.drawerWidthOpen-e.iconContainerWidth},secondaryAction:{width:o.spacing(6),textAlign:"center",marginRight:o.spacing(1)},closedItemIcon:{width:"100%",justifyContent:"center"},submenuArrow:{display:"flex"},expandButton:{background:"none",border:"none",color:o.palette.navigation.color,width:"100%",cursor:"pointer",position:"relative",height:48},arrows:{position:"absolute",right:10},selected:{"&$root":{borderLeft:`solid ${e.selectedIndicatorWidth}px ${o.palette.navigation.indicator}`,color:o.palette.navigation.selectedColor},"&$closed":{width:e.drawerWidthClosed},"& $closedItemIcon":{paddingRight:e.selectedIndicatorWidth},"& $iconContainer":{marginLeft:-e.selectedIndicatorWidth}}}},{name:"BackstageSidebarItem"});function To(e){return(0,f.useMemo)(()=>Sa(e),[e])()}const Ca=(e,o)=>(0,p.vJ)(e.props.children,l=>{let d=!1;return l.getElements().forEach(({props:{to:m,dropdownItems:y}})=>{if(!d){if(y!=null&&y.length){y.forEach(({to:I})=>d=d||Yr(o,(0,qo.i3)(I)));return}m&&(d=Yr(o,(0,qo.i3)(m)))}}),d},[o.pathname]);function Ks(e){return e.to===void 0}const wa=f.createElement(Ws).type,ja=f.forwardRef(function({to:o,end:l,style:d,className:m,activeStyle:y,caseSensitive:I,activeClassName:B="active","aria-current":Y="page",...Z},fe){let{pathname:pe}=(0,pr.TH)(),{pathname:Te}=(0,pr.WU)(o);I||(pe=pe.toLocaleLowerCase("en-US"),Te=Te.toLocaleLowerCase("en-US"));let Ee=pe===Te;!Ee&&!l&&(Ee=pe.startsWith(`${Te}/`));const Ze=Ee?Y:void 0;return(0,r.jsx)(N.rU,{...Z,to:o,ref:fe,"aria-current":Ze,style:{...d,...Ee?y:void 0},className:on()([m,Ee?B:void 0])})}),Ii=(0,f.forwardRef)((e,o)=>{const{icon:l,text:d,hasNotifications:m=!1,hasSubmenu:y=!1,disableHighlight:I=!1,onClick:B,noTrack:Y,children:Z,className:fe,...pe}=e,{sidebarConfig:Te}=(0,f.useContext)(br),Ee=To(Te),{isOpen:Ze}=rs(),it=!Ze&&y?{display:"flex",marginLeft:"20px"}:{lineHeight:"0"},Pt=(0,r.jsxs)(A.Z,{style:it,children:[(0,r.jsx)(l,{fontSize:"small"}),!Ze&&y?(0,r.jsx)(Gs.Z,{fontSize:"small"}):(0,r.jsx)(r.Fragment,{})]}),mn=(0,r.jsx)(xa.Z,{color:"secondary",variant:"dot",overlap:"circular",invisible:!m,className:on()({[Ee.closedItemIcon]:!Ze}),children:Pt}),Fn=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(A.Z,{"data-testid":"login-button",className:Ee.iconContainer,children:mn}),d&&(0,r.jsx)(rt.Z,{variant:"subtitle2",component:"span",className:Ee.label,children:d}),(0,r.jsx)("div",{className:Ee.secondaryAction,children:Z})]}),or=Ze?Fn:mn,Bt={onClick:B,className:on()(fe,Ee.root,Ze?Ee.open:Ee.closed,Ks(e)&&Ee.buttonItem,{[Ee.highlightable]:!I})},vn=(0,p.z$)(),{pathname:yn}=(0,pr.WU)(!Ks(e)&&e.to?e.to:""),gr=(0,f.useCallback)(Sr=>{if(!Y){const Cr="click",wr=d!=null?d:"Sidebar Item",fs=yn?{attributes:{to:yn}}:void 0;vn.captureEvent(Cr,wr,fs)}B==null||B(Sr)},[vn,d,yn,Y,B]);return Ks(e)?(0,r.jsx)(ge.Z,{role:"button","aria-label":d,...Bt,ref:o,onClick:gr,children:or}):(0,r.jsx)(ja,{...Bt,activeClassName:Ee.selected,to:e.to?e.to:"",ref:o,"aria-label":d||e.to,...pe,onClick:gr,children:or})}),Ea=({children:e,...o})=>{const{sidebarConfig:l}=(0,f.useContext)(br),d=To(l),[m,y]=(0,f.useState)(!1),I=(0,pr.TH)(),B=Ca(e,I),Y=(0,Pe.Z)(Te=>Te.breakpoints.down("sm")),Z=()=>{y(!0)},fe=()=>{y(!1)},pe=()=>Y?m?(0,r.jsx)(Hs.Z,{fontSize:"small",className:d.submenuArrow}):(0,r.jsx)(Vs.Z,{fontSize:"small",className:d.submenuArrow}):!m&&(0,r.jsx)(Gs.Z,{fontSize:"small",className:d.submenuArrow});return(0,r.jsx)(gi.Provider,{value:{isHoveredOn:m,setIsHoveredOn:y},children:(0,r.jsxs)("div",{"data-testid":"item-with-submenu",onMouseLeave:fe,onTouchStart:m?fe:Z,onMouseEnter:Z,className:on()(m&&d.highlighted),children:[(0,r.jsx)(Ii,{hasSubmenu:!0,className:B?d.selected:"",...o,children:pe()}),m&&e]})})},Pi=(0,f.forwardRef)((e,o)=>{const[l]=(0,p.vJ)(e.children,d=>d.getElements().filter(m=>m.type===wa));return l?(0,r.jsx)(Ea,{...e,children:l}):(0,r.jsx)(Ii,{...e,ref:o})});function Ga(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),[l,d]=useState(""),m=To(o),y=e.icon?e.icon:SearchIcon,I=()=>{e.onSearch(l),d("")},B=pe=>{pe.key==="Enter"&&(pe.preventDefault(),I())},Y=pe=>{d(pe.target.value)},Z=pe=>{pe.preventDefault(),pe.stopPropagation()},fe=pe=>{I(),pe.preventDefault()};return _jsx(Box,{className:m.searchRoot,children:_jsx(Pi,{icon:y,to:e.to,onClick:fe,disableHighlight:!0,children:_jsx(TextField,{placeholder:"Search",value:l,onClick:Z,onChange:Y,onKeyDown:B,className:m.searchContainer,InputProps:{disableUnderline:!0,className:m.searchField},inputProps:{className:m.searchFieldHTMLInput}})})})}const Ka=(0,as.Z)("div")({flex:1},{name:"BackstageSidebarSpace"}),Ya=(0,as.Z)("div")({height:8},{name:"BackstageSidebarSpacer"}),Aa=(0,as.Z)("hr")(({theme:e})=>({height:1,width:"100%",background:"#383838",border:"none",margin:e.spacing(1.2,0)}),{name:"BackstageSidebarDivider"}),Ta=e=>({overflowY:"auto","&::-webkit-scrollbar":{backgroundColor:e.palette.background.default,width:"5px",borderRadius:"5px"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.text.secondary,borderRadius:"5px"}}),Li=(0,as.Z)("div")(({theme:e})=>{const o=Ta(e);return{flex:"0 1 auto",overflowX:"hidden",width:"calc(100% - 5px)",minHeight:"48px",overflowY:"hidden","@media (hover: none)":o,"&:hover":o}}),Ra=()=>{const{sidebarConfig:e}=useContext(SidebarConfigContext),o=To(e),{isOpen:l,setOpen:d}=useSidebarOpenState();if(useMediaQuery(I=>I.breakpoints.down("md"),{noSsr:!0}))return null;const y=()=>{d(!l)};return _jsx(Button,{role:"button",onClick:y,className:o.expandButton,"aria-label":"Expand Sidebar","data-testid":"sidebar-expand-button",children:_jsx(Box,{className:o.arrows,children:l?_jsx(DoubleArrowLeft,{}):_jsx(DoubleArrowRight,{})})})},Oi=(0,g.Z)(e=>({introCard:o=>({color:"#b5b5b5",fontSize:12,width:o.sidebarConfig.drawerWidthOpen,marginTop:e.spacing(2.25),marginBottom:e.spacing(1.5),paddingLeft:o.sidebarConfig.iconPadding,paddingRight:o.sidebarConfig.iconPadding}),introDismiss:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:e.spacing(1.5)},introDismissLink:{color:"#dddddd",display:"flex",alignItems:"center",marginBottom:e.spacing(.5),"&:hover":{color:e.palette.linkHover,transition:e.transitions.create("color",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.shortest})}},introDismissText:{fontSize:"0.7rem",fontWeight:"bold",textTransform:"uppercase",letterSpacing:1},introDismissIcon:{width:18,height:18,marginRight:e.spacing(1.5)}}),{name:"BackstageSidebarIntro"});function ki(e){const{sidebarConfig:o}=useContext(SidebarConfigContext),l=Oi({sidebarConfig:o}),{text:d,onClose:m}=e,y=()=>m();return _jsxs(Box,{className:l.introCard,children:[_jsx(Typography,{variant:"subtitle2",children:d}),_jsx(Box,{className:l.introDismiss,children:_jsxs(IconButton,{onClick:y,className:l.introDismissLink,children:[_jsx(CloseIcon,{className:l.introDismissIcon}),_jsx(Typography,{component:"span",className:l.introDismissText,children:"Dismiss"})]})})]})}const Ys=e=>{const{text:o,onDismiss:l}=e,[d,m]=useState(!1),y=()=>{m(!0)};return _jsx(Collapse,{in:!d,onExited:l,children:_jsx(ki,{text:o,onClose:y})})},Bi=null,$i="And your recently viewed plugins will pop up here!";function Ia(e){const{isOpen:o}=useSidebarOpenState(),l={starredItemsDismissed:!1,recentlyViewedItemsDismissed:!1},{value:d,set:m}=useLocalStorageValue(SIDEBAR_INTRO_LOCAL_STORAGE),{starredItemsDismissed:y,recentlyViewedItemsDismissed:I}=d!=null?d:{},B=()=>{m(Z=>({...l,...Z,starredItemsDismissed:!0}))},Y=()=>{m(Z=>({...l,...Z,recentlyViewedItemsDismissed:!0}))};return o?_jsxs(_Fragment,{children:[!y&&_jsxs(_Fragment,{children:[_jsx(Ys,{text:Bi,onDismiss:B}),_jsx(SidebarDivider,{})]}),!I&&_jsx(Ys,{text:$i,onDismiss:Y})]}):null}const Di=(0,g.Z)(e=>({root:{gridArea:"pageContent",minWidth:0,paddingTop:e.spacing(3),paddingBottom:e.spacing(3),paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}},stretch:{display:"flex",flexDirection:"column",flexGrow:1},noPadding:{padding:0}}),{name:"BackstageContent"});function Js(e){const{className:o,stretch:l,noPadding:d,children:m,...y}=e,{contentRef:I}=Ao(),B=Di();return(0,r.jsx)("article",{ref:I,tabIndex:-1,...y,className:on()(B.root,o,{[B.stretch]:l,[B.noPadding]:d}),children:m})}var Pa=n(6487),Fi=n(99152);const Ni=(0,g.Z)(e=>({tabsWrapper:{gridArea:"pageSubheader",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(3),minWidth:0},defaultTab:{...e.typography.caption,padding:e.spacing(3,3),textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,color:e.palette.text.secondary},selected:{color:e.palette.text.primary},tabRoot:{"&:hover":{backgroundColor:e.palette.background.default,color:e.palette.text.primary}}}),{name:"BackstageHeaderTabs"});function Zi(e){const{tabs:o,onChange:l,selectedIndex:d}=e,[m,y]=(0,f.useState)(d!=null?d:0),I=Ni(),B=(0,f.useCallback)((Y,Z)=>{d===void 0&&y(Z),l&&d!==Z&&l(Z)},[d,l]);return(0,f.useEffect)(()=>{d!==void 0&&y(d)},[d]),(0,r.jsx)(A.Z,{className:I.tabsWrapper,children:(0,r.jsx)(Fi.Z,{selectionFollowsFocus:!0,indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"tabs",onChange:B,value:m,children:o.map((Y,Z)=>(0,f.createElement)(Pa.Z,{...Y.tabProps,"data-testid":`header-tab-${Z}`,label:Y.label,key:Y.id,value:Z,className:I.defaultTab,classes:{selected:I.selected,root:I.tabRoot}}))})})}function Ui(e){const o=(0,pr.UO)(),d=e.map(({path:Te,children:Ee})=>({caseSensitive:!1,path:`${Te}/*`,element:Ee})).sort((Te,Ee)=>Ee.path.replace(/\/\*$/,"").localeCompare(Te.path.replace(/\/\*$/,"")));var m;const y=(m=(0,pr.V$)(d))!==null&&m!==void 0?m:e[0].children;var I;let B=(I=o["*"])!==null&&I!==void 0?I:"";B.startsWith("/")||(B=`/${B}`);var Y;const[Z]=(Y=(0,qo.fp)(d,B))!==null&&Y!==void 0?Y:[],fe=Z?e.findIndex(Te=>`${Te.path}/*`===Z.route.path):0;var pe;return{index:fe===-1?0:fe,element:y,route:(pe=e[fe])!==null&&pe!==void 0?pe:e[0]}}function Qs(e){const{routes:o}=e,l=(0,pr.s0)(),{index:d,route:m,element:y}=Ui(o),I=(0,f.useMemo)(()=>o.map(Y=>({id:Y.path,label:Y.title,tabProps:Y.tabProps})),[o]),B=Y=>{let{path:Z}=o[Y];Z=Z.replace(/\/\*$/,""),Z=Z.replace(/^\//,""),l(Z)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Zi,{tabs:I,selectedIndex:d,onChange:B}),(0,r.jsxs)(Js,{children:[(0,r.jsx)(So.q,{title:m.title}),y]})]})}const ds=()=>null;(0,p.R5)(ds,"core.gatherMountPoints",!0);function Xs(e){const o=(0,r.jsx)(ds,{path:"",title:"",children:(0,r.jsx)("div",{})}).type;return f.Children.toArray(e).flatMap(l=>{if(!(0,f.isValidElement)(l))return[];if(l.type===f.Fragment)return Xs(l.props.children);if(l.type!==o)throw new Error("Child of TabbedLayout must be an TabbedLayout.Route");const{path:d,title:m,children:y,tabProps:I}=l.props;return[{path:d,title:m,children:y,tabProps:I}]})}function Mi(e){const o=Xs(e.children);return(0,r.jsx)(Qs,{routes:o})}Mi.Route=ds;const zi=(0,g.Z)(e=>({value:{marginBottom:e.spacing(.75)},subvalue:{color:e.palette.textSubtle,fontWeight:"normal"}}),{name:"BackstageSubvalueCell"});function Wi(e){const{value:o,subvalue:l}=e,d=zi();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(A.Z,{className:d.value,children:o}),(0,r.jsx)(A.Z,{className:d.subvalue,children:l})]})}var Qn=n(67222),Vi=n(21070),Hi=n(90324),Gi=n(98281),_s=n(48049),ei=n(51209),ti=n(33375),Ki=n(44233),Yi=n(27604),ni=n(36444),Ji=n(37971),i=n(59709),t=n(17373),s=n(3702),a=n(93111);const h=(0,g.Z)(e=>({root:{height:"100%",width:"315px",display:"flex",flexDirection:"column",marginRight:e.spacing(3)},value:{fontWeight:"bold",fontSize:18},header:{display:"flex",alignItems:"center",height:e.spacing(7.5),justifyContent:"space-between",borderBottom:`1px solid ${e.palette.grey[500]}`},filters:{display:"flex",flexDirection:"column","& > *":{marginTop:e.spacing(2)}}}),{name:"BackstageTableFilters"}),w=e=>{var o;const l=h(),{onChangeFilters:d}=e,[m,y]=(0,f.useState)({...e.selectedFilters}),[I,B]=(0,f.useState)(!1),Y=()=>{y({}),B(Z=>!Z)};return(0,f.useEffect)(()=>{d(m)},[m,d]),(0,r.jsxs)(A.Z,{className:l.root,children:[(0,r.jsxs)(A.Z,{className:l.header,children:[(0,r.jsx)(A.Z,{className:l.value,children:"Filters"}),(0,r.jsx)(ge.Z,{color:"primary",onClick:Y,children:"Clear all"})]}),(0,r.jsx)(A.Z,{className:l.filters,children:((o=e.filters)===null||o===void 0?void 0:o.length)&&e.filters.map(Z=>(0,r.jsx)(mo,{triggerReset:I,...Z.element,selected:m[Z.element.label],onChange:fe=>y({...m,[Z.element.label]:fe})},Z.element.label))})]})},k={Add:(0,f.forwardRef)((e,o)=>(0,r.jsx)(Vi.Z,{...e,ref:o})),Check:(0,f.forwardRef)((e,o)=>(0,r.jsx)(Gi.Z,{...e,ref:o})),Clear:(0,f.forwardRef)((e,o)=>(0,r.jsx)(ti.Z,{...e,ref:o})),Delete:(0,f.forwardRef)((e,o)=>(0,r.jsx)(Ki.Z,{...e,ref:o})),DetailPanel:(0,f.forwardRef)((e,o)=>(0,r.jsx)(ei.Z,{...e,ref:o})),Edit:(0,f.forwardRef)((e,o)=>(0,r.jsx)(Yi.Z,{...e,ref:o})),Export:(0,f.forwardRef)((e,o)=>(0,r.jsx)(s.Z,{...e,ref:o})),Filter:(0,f.forwardRef)((e,o)=>(0,r.jsx)(ni.Z,{...e,ref:o})),FirstPage:(0,f.forwardRef)((e,o)=>(0,r.jsx)(Ji.Z,{...e,ref:o})),LastPage:(0,f.forwardRef)((e,o)=>(0,r.jsx)(i.Z,{...e,ref:o})),NextPage:(0,f.forwardRef)((e,o)=>(0,r.jsx)(ei.Z,{...e,ref:o})),PreviousPage:(0,f.forwardRef)((e,o)=>(0,r.jsx)(_s.Z,{...e,ref:o})),ResetSearch:(0,f.forwardRef)((e,o)=>(0,r.jsx)(ti.Z,{...e,ref:o})),Search:(0,f.forwardRef)((e,o)=>(0,r.jsx)(ni.Z,{...e,ref:o})),SortArrow:(0,f.forwardRef)((e,o)=>(0,r.jsx)(Hi.Z,{...e,ref:o})),ThirdStateCheck:(0,f.forwardRef)((e,o)=>(0,r.jsx)(t.Z,{...e,ref:o})),ViewColumn:(0,f.forwardRef)((e,o)=>(0,r.jsx)(a.Z,{...e,ref:o}))};function F(e,o){const l=o.split(".");let d=e[l[0]];for(let m=1;m<l.length;++m){if(d===void 0)return d;const y=l[m];d=d[y]}return d}const ie=(0,kn.Z)(e=>({header:{padding:e.spacing(1,2,1,2.5),borderTop:`1px solid ${e.palette.grey.A100}`,borderBottom:`1px solid ${e.palette.grey.A100}`,fontWeight:e.typography.fontWeightBold,position:"static",wordBreak:"normal"}}),{name:"BackstageTableHeader"})(Qn.W$),xe=(0,kn.Z)(e=>({root:{padding:e.spacing(3,0,2.5,2.5)},title:{"& > h6":{fontWeight:e.typography.fontWeightBold}},searchField:{paddingRight:e.spacing(2)}}),{name:"BackstageTableToolbar"})(Qn.UW),Re=(0,g.Z)(e=>({root:{display:"flex",alignItems:"center",justifyContent:"space-between"},title:{fontWeight:e.typography.fontWeightBold,fontSize:18,whiteSpace:"nowrap"}}),{name:"BackstageTableFiltersContainer"}),ze=(0,g.Z)(()=>({root:{display:"flex",alignItems:"start"}}),{name:"BackstageTable"});function mt(e,o){return e.map(l=>{var d;const m=(d=l.headerStyle)!==null&&d!==void 0?d:{};let y=l.cellStyle||{};if(l.highlight)if(m.color=o.palette.textContrast,typeof y=="object")y.fontWeight=o.typography.fontWeightBold;else{const I=y;y=(B,Y,Z)=>({...I(B,Y,Z),fontWeight:o.typography.fontWeightBold})}return{...l,headerStyle:m,cellStyle:y}})}function wt(e,o){return(0,Gr.transform)(e,(l,d,m)=>{(0,Gr.isEqual)(d,o[m])||(l[m]=d)})}const jt={search:"",filtersOpen:!1,filters:{}};function Vt(e){const{toolbarRef:o,setSearch:l,hasFilters:d,selectedFiltersLength:m,toggleFilters:y}=e,I=Re(),B=(0,f.useCallback)(Y=>{e.onSearchChanged(Y),l(Y)},[e,l]);return d?(0,r.jsxs)(A.Z,{className:I.root,children:[(0,r.jsxs)(A.Z,{className:I.root,children:[(0,r.jsx)(H.Z,{onClick:y,"aria-label":"filter list",children:(0,r.jsx)(ni.Z,{})}),(0,r.jsxs)(rt.Z,{className:I.title,children:["Filters (",m,")"]})]}),(0,r.jsx)(xe,{...e,ref:o,onSearchChanged:B})]}):(0,r.jsx)(xe,{...e,ref:o,onSearchChanged:B})}function Wt(e){const{data:o,columns:l,options:d,title:m,subtitle:y,filters:I,initialState:B,emptyContent:Y,onStateChange:Z,components:fe,...pe}=e,Te=ze(),Ee=(0,ae.Z)(),Ze={...jt,...B},[it,Pt]=(0,f.useState)(Ze.filtersOpen),mn=(0,f.useCallback)(()=>Pt(Wn=>!Wn),[Pt]),[Fn,or]=(0,f.useState)(0),[Bt,vn]=(0,f.useState)(o),[yn,gr]=(0,f.useState)(Ze.filters),Sr=mt(l,Ee),[Cr,wr]=(0,f.useState)(Ze.search);(0,f.useEffect)(()=>{if(Z){const Wn=wt({search:Cr,filtersOpen:it,filters:yn},jt);Z(Wn)}},[Cr,it,yn,Z]);const fs={headerStyle:{textTransform:"uppercase"}},Qr=(0,f.useCallback)(Wn=>{var Pr;return(Pr=l.find(lo=>lo.title===Wn))===null||Pr===void 0?void 0:Pr.field},[l]);(0,f.useEffect)(()=>{if(typeof o=="function")return;if(!yn){vn(o);return}const Wn=Object.values(yn);if(o&&Wn.flat().length){const Pr=o.filter(lo=>!!Object.entries(yn).filter(([,co])=>!!co.length).every(([co,Tn])=>{const Bn=F(lo,Qr(co));return Array.isArray(Bn)&&Array.isArray(Tn)?Bn.some(Lo=>Tn.includes(Lo)):Array.isArray(Bn)?Bn.includes(Tn):Array.isArray(Tn)?Tn.includes(Bn):Bn===Tn}));vn(Pr)}else vn(o);or(Wn.flat().length)},[o,yn,Qr]);const ra=(Wn,Pr)=>{const lo=Tn=>{const Bn=new Set,Lo=uo=>{uo!=null&&Bn.add(uo)};return Pr&&Pr.forEach(uo=>{const gs=F(uo,Qr(Tn));Array.isArray(gs)?gs.forEach(Lo):Lo(gs)}),Bn},co=Tn=>({placeholder:"All results",label:Tn.column,multiple:Tn.type==="multiple-select",items:[...lo(Tn.column)].sort().map(Bn=>({label:Bn,value:Bn}))});return Wn.map(Tn=>({type:Tn.type,element:co(Tn)}))},un=!!(I!=null&&I.length),Po=(0,f.useCallback)(Wn=>(0,r.jsx)(Vt,{setSearch:wr,hasFilters:un,selectedFiltersLength:Fn,toggleFilters:mn,...Wn}),[mn,un,Fn,wr]),ri=typeof o!="function"&&o.length===0,Xr=l.length,oa=(0,f.useCallback)(Wn=>Y&&ri?(0,r.jsx)("tbody",{children:(0,r.jsx)("tr",{children:(0,r.jsx)("td",{colSpan:Xr,children:Y})})}):(0,r.jsx)(Qn.os,{...Wn}),[ri,Y,Xr]);return(0,r.jsxs)(A.Z,{className:Te.root,children:[it&&o&&typeof o!="function"&&(I==null?void 0:I.length)&&(0,r.jsx)(w,{filters:ra(I,o),selectedFilters:yn,onChangeFilters:gr}),(0,r.jsx)(Qn.ZP,{components:{Header:ie,Toolbar:Po,Body:oa,...fe},options:{...fs,...d},columns:Sr,icons:k,title:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(rt.Z,{variant:"h5",component:"h2",children:m}),y&&(0,r.jsx)(rt.Z,{color:"textSecondary",variant:"body1",children:y})]}),data:typeof o=="function"?o:Bt,style:{width:"100%"},localization:{toolbar:{searchPlaceholder:"Filter",searchTooltip:"Filter"}},...pe})]})}Wt.icons=Object.freeze(k);var Xn=n(44311);function fr(e,o){const l=e[e.length-1];if(l)return l>=.9?o.palette.status.ok:l>=.5?o.palette.status.warning:o.palette.status.error}function Ir(e){const o=useTheme();if(!e.data)return null;var l;return _jsxs(Sparklines,{width:120,height:30,min:0,max:1,...e,children:[e.title&&_jsx("title",{children:e.title}),_jsx(SparklinesLine,{color:(l=e.color)!==null&&l!==void 0?l:fr(e.data,o)})]})}const Ro=e=>(0,g.Z)(o=>({container:{width:"100%",display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-end",alignItems:"center",marginBottom:o.spacing(2),textAlign:e.textAlign},leftItemsBox:{flex:"1 1 auto",minWidth:0,overflow:"visible"},rightItemsBox:{flex:"0 1 auto",display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center",marginLeft:o.spacing(1),minWidth:0,overflow:"visible"},description:{},title:{display:"inline-flex",marginBottom:0}}),{name:"BackstageContentHeader"}),Qi=({title:e="Unknown page",className:o})=>(0,r.jsx)(rt.Z,{variant:"h4",component:"h2",className:o,"data-testid":"header-title",children:e});function Xi(e){const{description:o,title:l,titleComponent:d=void 0,children:m,textAlign:y="left"}=e,I=Ro({textAlign:y})(),B=d||(0,r.jsx)(Qi,{title:l,className:I.title});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(So.q,{title:l}),(0,r.jsxs)(A.Z,{className:I.container,children:[(0,r.jsxs)(A.Z,{className:I.leftItemsBox,children:[B,o&&(0,r.jsx)(rt.Z,{className:I.description,variant:"body2",children:o})]}),(0,r.jsx)(A.Z,{className:I.rightItemsBox,children:m})]})]})}var us=n.p+"static/mic-drop.fe3ef4d0..svg";const qi=(0,g.Z)(e=>({micDrop:{maxWidth:"60%",bottom:e.spacing(2),right:e.spacing(2),[e.breakpoints.down("xs")]:{maxWidth:"96%",bottom:"unset",right:"unset",margin:`${e.spacing(10)}px auto ${e.spacing(4)}px`}}}),{name:"BackstageErrorPageMicDrop"}),Jr=()=>{const e=qi();return(0,r.jsx)("img",{src:us,className:e.micDrop,alt:"Girl dropping mic from her hands"})},Ja=(0,g.Z)(e=>({container:{padding:e.spacing(8),[e.breakpoints.down("xs")]:{padding:e.spacing(2)}},title:{paddingBottom:e.spacing(5),[e.breakpoints.down("xs")]:{paddingBottom:e.spacing(4),fontSize:e.typography.h3.fontSize}},subtitle:{color:e.palette.textSubtle}}),{name:"BackstageErrorPage"});function Qa(e){const{status:o,statusMessage:l,additionalInfo:d,supportUrl:m}=e,y=Ja(),I=(0,pr.s0)(),B=Qo();return(0,r.jsxs)(Yt.Z,{container:!0,spacing:0,className:y.container,children:[(0,r.jsxs)(Yt.Z,{item:!0,xs:12,sm:8,md:4,children:[(0,r.jsxs)(rt.Z,{"data-testid":"error",variant:"body1",className:y.subtitle,children:["ERROR ",o,": ",l]}),(0,r.jsx)(rt.Z,{variant:"body1",className:y.subtitle,children:d}),(0,r.jsx)(rt.Z,{variant:"h2",className:y.title,children:"Looks like someone dropped the mic!"}),(0,r.jsxs)(rt.Z,{variant:"h6",children:[(0,r.jsx)(de.r,{to:"#","data-testid":"go-back-link",onClick:()=>I(-1),children:"Go back"}),"... or please"," ",(0,r.jsx)(de.r,{to:m||B.url,children:"contact support"})," if you think this is a bug."]})]}),(0,r.jsx)(Jr,{})]})}var Xa=n(16173);const qa=(0,kn.Z)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(rt.Z),_i=(0,kn.Z)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(A.Z);function _a(e){const{children:o,...l}=e,[d,m]=f.useState(null),y=f.Children.toArray(o),[I,B,...Y]=y,Z=Y.length?Y.pop():y[y.length-1],fe=y.length>3,pe=Ze=>{m(Ze.currentTarget)},Te=()=>{m(null)},Ee=Boolean(d);return(0,r.jsxs)(f.Fragment,{children:[(0,r.jsxs)(Xa.Z,{"aria-label":"breadcrumb",...l,children:[y.length>1&&(0,r.jsx)(_i,{clone:!0,children:I}),y.length>2&&(0,r.jsx)(_i,{clone:!0,children:B}),fe&&(0,r.jsx)(qa,{onClick:pe,children:"..."}),(0,r.jsx)(A.Z,{style:{fontStyle:"italic"},children:Z})]}),(0,r.jsx)(Rs.ZP,{open:Ee,anchorEl:d,onClose:Te,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,r.jsx)(Zt.Z,{children:Y.map((Ze,it)=>(0,r.jsx)(_t.Z,{button:!0,children:(0,r.jsx)(_i,{clone:!0,children:Ze})},it))})})]})}const el=(0,g.Z)(e=>({header:{gridArea:"pageHeader",padding:e.spacing(3),width:"100%",boxShadow:e.shadows[4],position:"relative",zIndex:100,display:"flex",flexDirection:"row",alignItems:"center",backgroundImage:e.page.backgroundImage,backgroundPosition:"center",backgroundSize:"cover",[e.breakpoints.down("sm")]:{flexWrap:"wrap"}},leftItemsBox:{maxWidth:"100%",flexGrow:1},rightItemsBox:{width:"auto",alignItems:"center"},title:{color:e.page.fontColor,wordBreak:"break-word",fontSize:e.typography.h3.fontSize,marginBottom:0},subtitle:{color:e.page.fontColor,opacity:.8,display:"inline-block",marginTop:e.spacing(1),maxWidth:"75ch"},type:{textTransform:"uppercase",fontSize:11,opacity:.8,marginBottom:e.spacing(1),color:e.page.fontColor},breadcrumb:{color:e.page.fontColor},breadcrumbType:{fontSize:"inherit",opacity:.7,marginRight:-e.spacing(.3),marginBottom:e.spacing(.3)},breadcrumbTitle:{fontSize:"inherit",marginLeft:-e.spacing(.3),marginBottom:e.spacing(.3)}}),{name:"BackstageHeader"}),tl=({type:e,typeLink:o,classes:l,pageTitle:d})=>e?o?(0,r.jsxs)(_a,{className:l.breadcrumb,children:[(0,r.jsx)(de.r,{to:o,children:e}),(0,r.jsx)(rt.Z,{children:d})]}):(0,r.jsx)(rt.Z,{className:l.type,children:e}):null,nl=({pageTitle:e,classes:o,tooltip:l})=>{const d=(0,r.jsx)(rt.Z,{className:o.title,variant:"h1",children:e});return l?(0,r.jsx)(T.ZP,{title:l,placement:"top-start",children:d}):d},rl=({classes:e,subtitle:o})=>o?typeof o!="string"?(0,r.jsx)(r.Fragment,{children:o}):(0,r.jsx)(rt.Z,{className:e.subtitle,variant:"subtitle2",component:"span",children:o}):null;function La(e){const{children:o,pageTitleOverride:l,style:d,subtitle:m,title:y,tooltip:I,type:B,typeLink:Y}=e,Z=el(),pe=(0,p.h_)(p.Ds).getOptionalString("app.title")||"Backstage",Te=l||y,Ee=y||l,Ze=`${Te} | %s | ${pe}`,it=`${Te} | ${pe}`;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(So.q,{titleTemplate:Ze,defaultTitle:it}),(0,r.jsxs)("header",{style:d,className:Z.header,children:[(0,r.jsxs)(A.Z,{className:Z.leftItemsBox,children:[(0,r.jsx)(tl,{classes:Z,type:B,typeLink:Y,pageTitle:Ee}),(0,r.jsx)(nl,{classes:Z,pageTitle:Ee,tooltip:I}),(0,r.jsx)(rl,{classes:Z,subtitle:m})]}),(0,r.jsx)(Yt.Z,{container:!0,className:Z.rightItemsBox,spacing:4,children:o})]})]})}const ol=({label:e,secondaryLabel:o,icon:l,disabled:d=!1,onClick:m})=>_jsx(Fragment,{children:_jsxs(ListItem,{"data-testid":"header-action-item",disabled:d,button:!0,onClick:y=>{m&&m(y)},children:[l&&_jsx(ListItemIcon,{children:l}),_jsx(ListItemText,{primary:e,secondary:o})]})});function Dl(e){const{palette:{common:{white:o}}}=useTheme(),{actionItems:l}=e,[d,m]=React.useState(!1),y=React.useRef(null);return _jsxs(Fragment,{children:[_jsx(IconButton,{onClick:()=>m(!0),"data-testid":"header-action-menu",ref:y,style:{color:o,height:56,width:56,marginRight:-4,padding:0},children:_jsx(MoreVert,{})}),_jsx(Popover,{open:d,anchorEl:y.current,anchorOrigin:{horizontal:"right",vertical:"bottom"},transformOrigin:{horizontal:"right",vertical:"top"},onClose:()=>m(!1),children:_jsx(List,{children:l.map((I,B)=>_jsx(ol,{...I},`header-action-menu-${B}`))})})]})}const sl=(0,g.Z)(e=>({root:{textAlign:"left"},label:{color:e.page.fontColor,fontWeight:e.typography.fontWeightBold,letterSpacing:0,fontSize:e.typography.fontSize,marginBottom:e.spacing(1)/2,lineHeight:1},value:{color:(0,Qt.Fq)(e.page.fontColor,.8),fontSize:e.typography.fontSize,lineHeight:1}}),{name:"BackstageHeaderLabel"}),il=({value:e,className:o})=>(0,r.jsx)(rt.Z,{component:typeof e=="string"?"p":"span",className:o,children:e});function al(e){const{label:o,value:l,url:d}=e,m=sl(),y=(0,r.jsx)(il,{className:m.value,value:l||"<Unknown>"});return(0,r.jsx)(Yt.Z,{item:!0,children:(0,r.jsxs)(rt.Z,{component:"span",className:m.root,children:[(0,r.jsx)(rt.Z,{className:m.label,children:o}),d?(0,r.jsx)(de.r,{to:d,children:y}):y]})})}const ll=e=>(0,Yn.Z)({root:{color:e.palette.common.white,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),cl=(0,g.Z)(ll,{name:"BackstageItemCardHeader"});function dl(e){const{title:o,subtitle:l,children:d}=e,m=cl(e);return(0,r.jsxs)(A.Z,{className:m.root,children:[l&&(0,r.jsx)(rt.Z,{variant:"subtitle2",component:"h3",children:l}),o&&(0,r.jsx)(rt.Z,{variant:"h6",component:"h4",children:o}),d]})}function Fl(e){const{description:o,tags:l,title:d,type:m,subtitle:y,label:I,onClick:B,href:Y}=e;return _jsxs(Card,{children:[_jsx(CardMedia,{children:_jsx(ItemCardHeader,{title:d,subtitle:y||m})}),_jsxs(CardContent,{children:[l!=null&&l.length?_jsx(Box,{children:l.map((Z,fe)=>_jsx(Chip,{size:"small",label:Z},fe))}):null,o]}),_jsxs(CardActions,{children:[!Y&&_jsx(LinkButton,{to:"#",onClick:B,color:"primary",children:I}),Y&&_jsx(LinkButton,{to:Y,color:"primary",children:I})]})]})}const ul=e=>(0,Yn.Z)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),hl=(0,g.Z)(ul,{name:"BackstageItemCardGrid"});function pl(e){const{children:o,...l}=e,d=hl(l);return(0,r.jsx)(A.Z,{className:d.root,...l,children:o})}var fl=n(41547);const gl=(0,g.Z)(e=>({root:{display:"grid",gridTemplateAreas:"'pageHeader pageHeader pageHeader' 'pageSubheader pageSubheader pageSubheader' 'pageNav pageContent pageSidebar'",gridTemplateRows:"max-content auto 1fr",gridTemplateColumns:"auto 1fr auto",overflowY:"auto",height:"100vh",[e.breakpoints.down("xs")]:{height:"100%"},"@media print":{display:"block",height:"auto",overflowY:"inherit"}}}),{name:"BackstagePage"});function Oa(e){const{themeId:o,children:l}=e,d=gl();return(0,r.jsx)(fl.Z,{theme:m=>({...m,page:m.getPageTheme({themeId:o})}),children:(0,r.jsx)("main",{className:d.root,children:l})})}function ml(e){const{themeId:o,children:l,...d}=e;return(0,r.jsxs)(Oa,{themeId:o,children:[(0,r.jsx)(La,{...d}),l]})}var tr=n(30195);const Nl=tr.z.object({providerInfo:tr.z.object({}).catchall(tr.z.unknown()).optional(),profile:tr.z.object({email:tr.z.string().optional(),displayName:tr.z.string().optional(),picture:tr.z.string().optional()}),backstageIdentity:tr.z.object({token:tr.z.string(),identity:tr.z.object({type:tr.z.literal("user"),userEntityRef:tr.z.string(),ownershipEntityRefs:tr.z.array(tr.z.string())})})}),ka={defaultTokenExpiryMillis:5*60*1e3,tokenExpiryMarginMillis:5*60*1e3};function vl(e){const o=new Date(Date.now()+ka.defaultTokenExpiryMillis);if(!e)return o;const[l,d,m]=e.split("."),y=JSON.parse(window.atob(d));return typeof y.exp!="number"?o:new Date(y.exp*1e3-ka.tokenExpiryMarginMillis)}class Zl{async start(){await this.getSessionAsync()}getUserId(){const{backstageIdentity:o}=this.getSessionSync(),l=o.identity.userEntityRef,d=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(l);if(!d)throw new TypeError(`Invalid user entity reference "${l}"`);return d[3]}async getIdToken(){return(await this.getSessionAsync()).backstageIdentity.token}getProfile(){return this.getSessionSync().profile}async getProfileInfo(){return(await this.getSessionAsync()).profile}async getBackstageIdentity(){return(await this.getSessionAsync()).backstageIdentity.identity}async getCredentials(){return{token:(await this.getSessionAsync()).backstageIdentity.token}}async signOut(){this.abortController.abort()}getSessionSync(){if(this.state.type==="active")return this.state.session;if(this.state.type==="fetching"&&this.state.previous)return this.state.previous;throw new Error("No session available. Try reloading your browser page.")}async getSessionAsync(){if(this.state.type==="fetching")return this.state.promise;if(this.state.type==="active"&&new Date<this.state.expiresAt)return this.state.session;const o=this.state.type==="active"?this.state.session:void 0,l=this.fetchSession().then(d=>(this.state={type:"active",session:d,expiresAt:vl(d.backstageIdentity.token)},d),d=>{throw this.state={type:"failed",error:d},d});return this.state={type:"fetching",promise:l,previous:o},l}async fetchSession(){const o=await this.options.discoveryApi.getBaseUrl("auth"),l=typeof this.options.headers=="function"?await this.options.headers():this.options.headers,d=new Headers(l);d.set("X-Requested-With","XMLHttpRequest");const m=await fetch(`${o}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:d,credentials:"include"});if(!m.ok)throw await ResponseError.fromResponse(m);return proxiedSessionSchema.parse(await m.json())}constructor(o){_define_property(this,"options",void 0),_define_property(this,"abortController",void 0),_define_property(this,"state",void 0),this.options=o,this.abortController=new AbortController,this.state={type:"empty"}}}const Ul=e=>{const o=useApi(discoveryApiRef),[{status:l,error:d},{execute:m}]=useAsync(async()=>{const y=new ProxiedSignInIdentity({provider:e.provider,discoveryApi:o,headers:e.headers});await y.start(),e.onSignInSuccess(y)});return useMountEffect(m),l==="loading"?_jsx(Progress,{}):d?_jsx(ErrorPanel,{title:"You do not appear to be signed in. Please try reloading the browser page.",error:d}):null},yl=(0,g.Z)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),ea=({children:e})=>{const o=yl();return(0,r.jsx)(Yt.Z,{component:"li",item:!0,classes:o,children:e})};var hs=n(87612);class ta{getUserId(){return"guest"}async getIdToken(){}getProfile(){return{email:"guest@example.com",displayName:"Guest"}}async getProfileInfo(){return{email:"guest@example.com",displayName:"Guest"}}async getBackstageIdentity(){const o="user:default/guest";return{type:"user",userEntityRef:o,ownershipEntityRefs:[o]}}async getCredentials(){return{}}async signOut(){}}function xl(e){const[o,l,d]=e.split(".");return JSON.parse(window.atob(l))}class na{getUserId(){return this.result.userId}static fromResult(o){return new na(o)}async getIdToken(){var o,l;return(l=(o=this.result).getIdToken)===null||l===void 0?void 0:l.call(o)}getProfile(){return this.result.profile}async getProfileInfo(){return this.result.profile}async getBackstageIdentity(){const o=await this.getIdToken();if(!o){const m=`user:default/${this.getUserId()}`;return{type:"user",userEntityRef:m,ownershipEntityRefs:[m]}}const{sub:l,ent:d}=xl(o);return{type:"user",userEntityRef:l,ownershipEntityRefs:d!=null?d:[]}}async getCredentials(){var o,l;return{token:await((l=(o=this.result).getIdToken)===null||l===void 0?void 0:l.call(o))}}async signOut(){var o,l;return(l=(o=this.result).signOut)===null||l===void 0?void 0:l.call(o)}constructor(o){(0,hs._)(this,"result",void 0),this.result=o}}class ps{static createGuest(){return new ta}static fromLegacy(o){return na.fromResult(o)}static create(o){return new ps(o.identity,o.authApi,o.profile)}getUserId(){const o=this.identity.userEntityRef,l=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(o);if(!l)throw new TypeError(`Invalid user entity reference "${o}"`);return l[3]}async getIdToken(){return(await this.authApi.getBackstageIdentity()).token}getProfile(){if(!this.profile)throw new Error("The identity API does not implement synchronous profile fetching, use getProfileInfo() instead");return this.profile}async getProfileInfo(){if(this.profilePromise)return await this.profilePromise;try{return this.profilePromise=this.authApi.getProfile(),await this.profilePromise}catch(o){throw this.profilePromise=void 0,o}}async getBackstageIdentity(){return this.identity}async getCredentials(){return{token:(await this.authApi.getBackstageIdentity()).token}}async signOut(){return this.authApi.signOut()}constructor(o,l,d){(0,hs._)(this,"identity",void 0),(0,hs._)(this,"authApi",void 0),(0,hs._)(this,"profile",void 0),(0,hs._)(this,"profilePromise",void 0),this.identity=o,this.authApi=l,this.profile=d}}const bl={Component:({config:e,onSignInStarted:o,onSignInSuccess:l,onSignInFailure:d})=>{const{apiRef:m,title:y,message:I}=e,B=(0,p.h_)(m),Y=(0,p.h_)(p.VE),Z=async()=>{try{o();const fe=await B.getBackstageIdentity({instantPopup:!0});if(!fe)throw d(),new Error(`The ${y} provider is not configured to support sign-in`);const pe=await B.getProfile();l(ps.create({identity:fe.identity,profile:pe,authApi:B}))}catch(fe){d(),Y.post(new qr.SP("Login failed",fe))}};return(0,r.jsx)(ea,{children:(0,r.jsx)(lr,{variant:"fullHeight",title:y,actions:(0,r.jsx)(ge.Z,{color:"primary",variant:"outlined",onClick:Z,children:"Sign In"}),children:(0,r.jsx)(rt.Z,{variant:"body1",children:I})})})},loader:async(e,o)=>{const l=e.get(o),d=await l.getBackstageIdentity({optional:!0});if(!d)return;const m=await l.getProfile();return ps.create({identity:d.identity,profile:m,authApi:l})}},Sl={Component:({onSignInStarted:e,onSignInSuccess:o})=>(0,r.jsx)(ea,{children:(0,r.jsx)(lr,{title:"Guest",variant:"fullHeight",actions:(0,r.jsx)(ge.Z,{color:"primary",variant:"outlined",onClick:()=>{e(),o(new ta)},children:"Enter"}),children:(0,r.jsxs)(rt.Z,{variant:"body1",children:["Enter as a Guest User.",(0,r.jsx)("br",{}),"You will not have a verified identity,",(0,r.jsx)("br",{}),"meaning some features might be unavailable."]})})}),loader:async()=>new ta};var Cl=n(63955),Ba=n(86619),$a=n(74828),wl=n(45455),jl=n.n(wl);const El=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,Al=(0,g.Z)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)}}),{name:"BackstageCustomProvider"}),Da=e=>{const{ref:o,...l}=e;return{inputRef:o,...l}},Tl={Component:({onSignInStarted:e,onSignInSuccess:o})=>{const l=Al(),{register:d,handleSubmit:m,formState:y}=(0,Cl.cI)({mode:"onChange"}),{errors:I}=y,B=({userId:Y,idToken:Z})=>{e(),o(ps.fromLegacy({userId:Y,getIdToken:Z!==void 0?async()=>Z:void 0,profile:{email:`${Y}@example.com`}}))};return(0,r.jsx)(ea,{children:(0,r.jsxs)(lr,{title:"Custom User",variant:"fullHeight",children:[(0,r.jsxs)(rt.Z,{variant:"body1",children:["Enter your own User ID and credentials.",(0,r.jsx)("br",{}),"This selection will not be stored."]}),(0,r.jsxs)("form",{className:l.form,onSubmit:m(B),children:[(0,r.jsxs)(oo.Z,{children:[(0,r.jsx)(Ba.Z,{...Da(d("userId",{required:!0})),label:"User ID",margin:"normal",error:Boolean(I.userId)}),I.userId&&(0,r.jsx)($a.Z,{error:!0,children:I.userId.message})]}),(0,r.jsxs)(oo.Z,{children:[(0,r.jsx)(Ba.Z,{...Da(d("idToken",{required:!1,validate:Y=>!Y||El.test(Y)||"Token is not a valid OpenID Connect JWT Token"})),label:"ID Token (optional)",margin:"normal",autoComplete:"off",error:Boolean(I.idToken)}),I.idToken&&(0,r.jsx)($a.Z,{error:!0,children:I.idToken.message})]}),(0,r.jsx)(ge.Z,{type:"submit",color:"primary",variant:"outlined",className:l.button,disabled:!(y!=null&&y.isDirty)||!jl()(I),children:"Continue"})]})]})})},loader:async()=>{}},Io="@backstage/core:SignInPage:provider",Fa={guest:Sl,custom:Tl,common:bl};function Na(e,o){if(e in o)throw new Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}function Kl(e){return e.reduce((l,d)=>{if(typeof d=="string")return Na(d,l),l[d]={components:Fa[d],id:d},l;const{id:m}=d;return Na(m,l),l[m]={components:Fa.common,id:m,config:d},l},{})}const Yl=(e,o)=>{const l=useApi(errorApiRef),d=useApiHolder(),[m,y]=useState(!0),I=useCallback(Y=>{o(IdentityApiSignOutProxy.from({identityApi:Y,signOut:async()=>{var Z;localStorage.removeItem(Io),await((Z=Y.signOut)===null||Z===void 0?void 0:Z.call(Y))}}))},[o]);useLayoutEffect(()=>{var Y;if(!m)return;const Z=localStorage.getItem(Io);if(Z===null){y(!1);return}const fe=e[Z];if(!fe){y(!1);return}let pe=!1;return fe.components.loader(d,(Y=fe.config)===null||Y===void 0?void 0:Y.apiRef).then(Te=>{if(pe){localStorage.removeItem(Io);return}Te?I(Te):y(!1)}).catch(Te=>{localStorage.removeItem(Io),!pe&&(l.post(Te),y(!1))}),()=>{pe=!0}},[m,l,o,d,e,I]);const B=useMemo(()=>Object.keys(e).map(Y=>{const Z=e[Y],{Component:fe}=Z.components,pe=Ze=>{I(Ze)},Te=()=>{var Ze;localStorage.setItem(Io,(Z==null||(Ze=Z.config)===null||Ze===void 0?void 0:Ze.id)||Z.id)},Ee=()=>{localStorage.removeItem(Io)};return _jsx(fe,{config:Z.config,onSignInStarted:Te,onSignInSuccess:pe,onSignInFailure:Ee},Z.id)}),[e,I]);return[m,B]},Rl=({onSignInSuccess:e,providers:o=[],title:l,align:d="left"})=>{const m=useApi(configApiRef),y=useStyles(),I=getSignInProviders(o),[B,Y]=useSignInProviders(I,e);return B?_jsx(Progress,{}):_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:m.getString("app.title")}),_jsxs(Content,{children:[l&&_jsx(ContentHeader,{title:l,textAlign:d}),_jsx(Grid,{container:!0,justifyContent:d==="center"?d:"flex-start",spacing:2,component:"ul",classes:y,children:Y})]})]})},Il=({provider:e,auto:o,onSignInSuccess:l})=>{const d=useStyles(),m=useApi(e.apiRef),y=useApi(configApiRef),[I,B]=useState(),[Y,Z]=useState(!1),fe=async({checkExisting:pe,showPopup:Te})=>{try{let Ee;if(pe&&(Ee=await m.getBackstageIdentity({optional:!0})),!Ee&&(Te||o)&&(Z(!0),Ee=await m.getBackstageIdentity({instantPopup:!0}),!Ee))throw new Error(`The ${e.title} provider is not configured to support sign-in`);if(!Ee){Z(!0);return}const Ze=await m.getProfile();l(UserIdentity.create({identity:Ee.identity,authApi:m,profile:Ze}))}catch(Ee){B(Ee),Z(!0)}};return useMountEffect(()=>fe({checkExisting:!0})),Y?_jsxs(Page,{themeId:"home",children:[_jsx(Header,{title:y.getString("app.title")}),_jsx(Content,{children:_jsx(Grid,{container:!0,justifyContent:"center",spacing:2,component:"ul",classes:d,children:_jsx(GridItem,{children:_jsxs(InfoCard,{variant:"fullHeight",title:e.title,actions:_jsx(Button,{color:"primary",variant:"outlined",onClick:()=>{fe({showPopup:!0})},children:"Sign In"}),children:[_jsx(Typography,{variant:"body1",children:e.message}),I&&I.name!=="PopupRejectedError"&&_jsx(Typography,{variant:"body1",color:"error",children:I.message})]})})})})]}):_jsx(Progress,{})};function Jl(e){return"provider"in e?_jsx(Il,{...e}):_jsx(Rl,{...e})}const Pl=(0,g.Z)(e=>({root:{padding:e.spacing(0,2,0,2.5),minHeight:e.spacing(3)},indicator:{backgroundColor:e.palette.info.main,height:e.spacing(.3)}}),{name:"BackstageTabbedCard"}),Ll=(0,kn.Z)(e=>({root:{padding:e.spacing(2,2,2,2.5),display:"inline-block"},title:{fontWeight:700},subheader:{paddingTop:e.spacing(1)}}),{name:"BackstageTabbedCardBoldHeader"})(fo.Z);function Ql(e){const{slackChannel:o,errorBoundaryProps:l,children:d,title:m,deepLink:y,value:I,onChange:B}=e,Y=Pl(),[Z,fe]=useState(0),pe=B||((Ze,it)=>fe(it));let Te;I?React.Children.map(d,Ze=>{if(React.isValidElement(Ze)&&(Ze==null?void 0:Ze.props.value)===I){var it;Te=Ze==null||(it=Ze.props)===null||it===void 0?void 0:it.children}}):React.Children.map(d,(Ze,it)=>{React.isValidElement(Ze)&&it===Z&&(Te=Ze==null?void 0:Ze.props.children)});const Ee=l||(o?{slackChannel:o}:{});return _jsx(Card,{children:_jsxs(ErrorBoundary,{...Ee,children:[m&&_jsx(Ll,{title:m}),_jsx(Tabs,{selectionFollowsFocus:!0,classes:Y,value:I||Z,onChange:pe,children:d}),_jsx(Divider,{}),_jsx(CardContent,{children:Te}),y&&_jsx(BottomLink,{...y})]})})}const Ol=(0,g.Z)(e=>({root:{minWidth:e.spacing(6),minHeight:e.spacing(3),margin:e.spacing(0,2,0,0),padding:e.spacing(.5,0,.5,0),textTransform:"none","&:hover":{opacity:1,backgroundColor:"transparent",color:e.palette.text.primary}},selected:{fontWeight:e.typography.fontWeightBold}}),{name:"BackstageCardTab"});function Xl(e){const{children:o,...l}=e,d=Ol();return _jsx(Tab,{disableRipple:!0,classes:d,...l})}},60871:function(St,ke,n){"use strict";n.d(ke,{fC:function(){return g},CL:function(){return xt},sM:function(){return ae},$v:function(){return Pe},v_:function(){return N},hg:function(){return _e},uB:function(){return je},R5:function(){return Le},bq:function(){return P},Km:function(){return G},Ds:function(){return at},ni:function(){return A},T0:function(){return L},CO:function(){return rt},x8:function(){return En},rx:function(){return Mn},YO:function(){return Pn},P4:function(){return Yt},NT:function(){return ut},NW:function(){return It},VE:function(){return zt},W0:function(){return Nt},gP:function(){return Dt},IY:function(){return ct},F4:function(){return se},ux:function(){return H},Kp:function(){return oe},$4:function(){return et},p_:function(){return T},ZM:function(){return lt},D:function(){return q},gW:function(){return R},E6:function(){return yt},z$:function(){return Ht},h_:function(){return ge},I_:function(){return D},qD:function(){return be},vJ:function(){return Un},tg:function(){return An},Oi:function(){return Zn}});var r=n(52322),p=n(51837),W=n(2784);const f=(0,p.CT)("analytics-context"),z=()=>{const Se=(0,W.useContext)(f);if(Se===void 0)return{routeRef:"unknown",pluginId:"root",extension:"App"};const ce=Se.atVersion(1);if(ce===void 0)throw new Error("No context found for version 1.");return ce},g=Se=>{const{attributes:ce,children:Ie}=Se,Ve={...z(),...ce},le=(0,p.EI)({1:Ve});return(0,r.jsx)(f.Provider,{value:le,children:Ie})};function u(Se,ce){const Ie=Ue=>_jsx(g,{attributes:ce,children:_jsx(Se,{...Ue})});return Ie.displayName=`WithAnalyticsContext(${Se.displayName||Se.name||"Component"})`,Ie}function D(){const Se=(0,p.Vt)("api-context");if(!Se)throw new Error("API context is not available");const ce=Se.atVersion(1);if(!ce)throw new Error("ApiContext v1 not available");return ce}function ge(Se){const Ie=D().get(Se);if(!Ie)throw new Error(`No implementation available for ${Se}`);return Ie}function de(Se){return function(Ie){const Ue=le=>{const U=D(),he={};for(const $e in Se)if(Se.hasOwnProperty($e)){const Ke=Se[$e],Je=U.get(Ke);if(!Je)throw new Error(`No implementation available for ${Ke}`);he[$e]=Je}return _jsx(Ie,{...le,...he})},Ve=Ie.displayName||Ie.name||"Component";return Ue.displayName=`withApis(${Ve})`,Ue}}var V=n(87612);class te{get id(){return this.config.id}get T(){throw new Error(`tried to read ApiRef.T of ${this}`)}toString(){return`apiRef{${this.config.id}}`}constructor(ce){if((0,V._)(this,"config",void 0),this.config=ce,!ce.id.split(".").flatMap(Ue=>Ue.split("-")).every(Ue=>Ue.match(/^[a-z][a-z0-9]*$/)))throw new Error(`API id must only contain period separated lowercase alphanum tokens with dashes, got '${ce.id}'`)}}function L(Se){return new te(Se)}function A(Se,ce){return"id"in Se?{api:Se,deps:{},factory:()=>ce}:Se}var ae;(function(Se){Se.SignedIn="SignedIn",Se.SignedOut="SignedOut"})(ae||(ae={}));const oe=L({id:"core.auth.google"}),se=L({id:"core.auth.github"}),q=L({id:"core.auth.okta"}),H=L({id:"core.auth.gitlab"}),T=L({id:"core.auth.microsoft"}),R=L({id:"core.auth.onelogin"}),P=L({id:"core.auth.bitbucket"}),G=L({id:"core.auth.bitbucket-server"}),je=L({id:"core.auth.atlassian"}),Pe=L({id:"core.alert"}),N=L({id:"core.analytics"}),_e=L({id:"core.apptheme"}),at=L({id:"core.config"}),It=L({id:"core.discovery"}),zt=L({id:"core.error"});var xt;(function(Se){Se[Se.None=0]="None",Se[Se.Active=1]="Active"})(xt||(xt={}));const Nt=L({id:"core.featureflags"}),Dt=L({id:"core.fetch"}),et=L({id:"core.identity"}),lt=L({id:"core.oauthrequest"}),yt=L({id:"core.storage"});class At{setContext(ce){this.context=ce}captureEvent(ce,Ie,{value:Ue,attributes:Ve}={}){try{this.analyticsApi.captureEvent({action:ce,subject:Ie,value:Ue,attributes:Ve,context:this.context})}catch(le){console.warn("Error during analytics event capture. %o",le)}}constructor(ce,Ie={routeRef:"unknown",pluginId:"root",extension:"App"}){(0,V._)(this,"analyticsApi",void 0),(0,V._)(this,"context",void 0),this.analyticsApi=ce,this.context=Ie}}function $t(){try{return ge(N)}catch{return{captureEvent:()=>{}}}}function Ht(){const Se=(0,W.useRef)(null),ce=z(),Ie=$t();function Ue(){return Se.current===null&&(Se.current=new At(Ie)),Se.current}const Ve=Ue();return Ve.setContext(ce),Ve}const be=()=>{const Se=(0,p.Vt)("app-context");if(!Se)throw new Error("App context is not available");const ce=Se.atVersion(1);if(!ce)throw new Error("AppContext v1 not available");return ce},Ce=(0,p.uW)("component-data-store",()=>new WeakMap),Ye="__backstage_data";function Le(Se,ce,Ie){const Ue=Se;var Ve;let le=(Ve=Ue[Ye])!==null&&Ve!==void 0?Ve:Ce.get(Se);if(le||(le={map:new Map},Object.defineProperty(Ue,Ye,{enumerable:!1,configurable:!0,writable:!1,value:le}),Ce.set(Se,le)),le.map.has(ce)){const U=Se.displayName||Se.name;throw new Error(`Attempted to attach duplicate data "${ce}" to component "${U}"`)}le.map.set(ce,Ie)}function ct(Se,ce){if(!Se)return;const Ie=Se.type;if(!Ie)return;var Ue;const Ve=(Ue=Ie[Ye])!==null&&Ue!==void 0?Ue:Ce.get(Ie);if(Ve)return Ve.map.get(ce)}const Ct=(0,p.uW)("route-ref-type",()=>Symbol("route-ref-type"));let dt=Ct,Qe=dt;class Ge{get title(){return this.id}toString(){return`routeRef{type=absolute,id=${this.id}}`}constructor(ce,Ie){(0,V._)(this,"id",void 0),(0,V._)(this,"params",void 0),(0,V._)(this,Qe,void 0),this.id=ce,this.params=Ie,this[dt]="absolute"}}function ut(Se){var ce;return new Ge(Se.id,(ce=Se.params)!==null&&ce!==void 0?ce:[])}const pt=/^\w+$/;let hn=null,pn=null;class fn{toString(){return`routeRef{type=sub,id=${this.id}}`}constructor(ce,Ie,Ue,Ve){_define_property(this,"id",void 0),_define_property(this,"path",void 0),_define_property(this,"parent",void 0),_define_property(this,"params",void 0),_define_property(this,pn,void 0),this.id=ce,this.path=Ie,this.parent=Ue,this.params=Ve,this[hn]="sub"}}function qt(Se){const{id:ce,path:Ie,parent:Ue}=Se,Ve=Ie.split("/").filter(he=>he.startsWith(":")).map(he=>he.substring(1)),le=[...Ue.params,...Ve];if(Ue.params.some(he=>Ve.includes(he)))throw new Error("SubRouteRef may not have params that overlap with its parent");if(!Ie.startsWith("/"))throw new Error(`SubRouteRef path must start with '/', got '${Ie}'`);if(Ie.endsWith("/"))throw new Error(`SubRouteRef path must not end with '/', got '${Ie}'`);for(const he of Ve)if(!pt.test(he))throw new Error(`SubRouteRef path has invalid param, got '${he}'`);return new fn(ce,Ie,Ue,le)}let Cn=Ct,Kt=Cn;class rn{toString(){return`routeRef{type=external,id=${this.id}}`}constructor(ce,Ie,Ue){(0,V._)(this,"id",void 0),(0,V._)(this,"params",void 0),(0,V._)(this,"optional",void 0),(0,V._)(this,Kt,void 0),this.id=ce,this.params=Ie,this.optional=Ue,this[Cn]="external"}}function En(Se){var ce;return new rn(Se.id,(ce=Se.params)!==null&&ce!==void 0?ce:[],Boolean(Se.optional))}var on=n(73557);function An(Se){const{pathname:ce}=(0,on.TH)(),Ie=(0,p.Vt)("routing-context");if(!Ie)throw new Error("Routing context is not available");const Ue=Ie.atVersion(1),Ve=(0,W.useMemo)(()=>Ue&&Ue.resolve(Se,{pathname:ce}),[Ue,Se,ce]);if(!Ie)throw new Error("useRouteRef used outside of routing context");if(!Ue)throw new Error("RoutingContext v1 not available");const le="optional"in Se&&Se.optional;if(!Ve&&!le)throw new Error(`No path for ${Se}`);return Ve}function Zn(Se){return(0,on.UO)()}class nt extends W.Component{static getDerivedStateFromError(ce){return{error:ce}}render(){const{error:ce}=this.state,{app:Ie,plugin:Ue}=this.props,{ErrorBoundaryFallback:Ve}=Ie.getComponents();return ce?(0,r.jsx)(Ve,{error:ce,resetError:this.handleErrorReset,plugin:Ue}):this.props.children}constructor(...ce){super(...ce),(0,V._)(this,"state",{error:void 0}),(0,V._)(this,"handleErrorReset",()=>{this.setState({error:void 0})})}}var sn=n(64355);function Yt(Se){const{component:ce,mountPoint:Ie,name:Ue}=Se;return Pn({component:{lazy:()=>ce().then(Ve=>{const le=he=>{try{An(Ie)}catch($e){if(typeof $e=="object"&&$e!==null){const{message:Ke}=$e;if(typeof Ke=="string"&&Ke.startsWith("No path for "))throw new Error(`Routable extension component with mount point ${Ie} was not discovered in the app element tree. Routable extension components may not be rendered by other components and must be directly available as an element within the App provider component.`)}throw $e}return(0,r.jsx)(Ve,{...he})},U=Ue||Ve.displayName||Ve.name||"LazyComponent";return le.displayName=`RoutableExtension(${U})`,le},Ve=>U=>{const he=be(),{BootErrorPage:$e}=he.getComponents();return(0,r.jsx)($e,{step:"load-chunk",error:Ve})})},data:{"core.mountPoint":Ie},name:Ue})}function rt(Se){const{component:ce,name:Ie}=Se;return Pn({component:ce,name:Ie})}function Pn(Se){const{data:ce={},name:Ie}=Se;Ie||console.warn("Declaring extensions without name is DEPRECATED. Make sure that all usages of createReactExtension, createComponentExtension and createRoutableExtension provide a name.");let Ue;if("lazy"in Se.component){const le=Se.component.lazy;Ue=(0,W.lazy)(()=>le().then(U=>({default:U})))}else Ue=Se.component.sync;const Ve=Ie||Ue.displayName||Ue.name||"Component";return{expose(le){const U=he=>{const $e=be(),{Progress:Ke}=$e.getComponents(),Je=ce==null?void 0:ce["core.mountPoint"];return(0,r.jsx)(W.Suspense,{fallback:(0,r.jsx)(Ke,{}),children:(0,r.jsx)(nt,{app:$e,plugin:le,children:(0,r.jsx)(g,{attributes:{pluginId:le.getId(),...Ie&&{extension:Ie},...Je&&{routeRef:Je.id}},children:(0,r.jsx)(sn.o,{plugin:le,children:(0,r.jsx)(Ue,{...he})})})})})};Le(U,"core.plugin",le),Le(U,"core.extensionName",Ie);for(const[he,$e]of Object.entries(ce))Le(U,he,$e);return U.displayName=`Extension(${Ve})`,U}}}function Jt(Se,ce,Ie,Ue){return W.Children.toArray(Se).flatMap(Ve=>{if(!(0,W.isValidElement)(Ve))return[];if(Ve.type===W.Fragment)return Jt(Ve.props.children,ce,Ie,Ue);if(ct(Ve,"core.featureFlagged")){const le=Ve.props;return("with"in le?ce.isActive(le.with):!ce.isActive(le.without))?Jt(Ve.props.children,ce,Ie,Ue):[]}if(Ie===void 0||Ie(Ve))return[Ve];if(Ue)throw new Error(Ue);return Jt(Ve.props.children,ce,Ie,Ue)})}class Ln{selectByComponentData(ce){const Ie=Jt(this.node,this.featureFlagsApi,Ue=>ct(Ue,ce.key)!==void 0,ce.withStrictError);return new Ln(Ie,this.featureFlagsApi)}findComponentData(ce){return Jt(this.node,this.featureFlagsApi,Ue=>ct(Ue,ce.key)!==void 0).map(Ue=>ct(Ue,ce.key)).filter(Ue=>Ue!==void 0)}getElements(){return Jt(this.node,this.featureFlagsApi)}constructor(ce,Ie){(0,V._)(this,"node",void 0),(0,V._)(this,"featureFlagsApi",void 0),this.node=ce,this.featureFlagsApi=Ie}}function Un(Se,ce,Ie=[]){const Ue=ge(Nt),Ve=new Ln(Se,Ue);return(0,W.useMemo)(()=>ce(Ve),[Se,...Ie])}class On{getId(){return this.config.id}getApis(){var ce;return(ce=this.config.apis)!==null&&ce!==void 0?ce:[]}getFeatureFlags(){var ce,Ie;return(Ie=(ce=this.config.featureFlags)===null||ce===void 0?void 0:ce.slice())!==null&&Ie!==void 0?Ie:[]}get routes(){var ce;return(ce=this.config.routes)!==null&&ce!==void 0?ce:{}}get externalRoutes(){var ce;return(ce=this.config.externalRoutes)!==null&&ce!==void 0?ce:{}}provide(ce){return ce.expose(this)}__experimentalReconfigure(ce){this.config.__experimentalConfigure&&(this.options=this.config.__experimentalConfigure(ce))}getPluginOptions(){this.config.__experimentalConfigure&&!this.options&&(this.options=this.config.__experimentalConfigure());var ce;return(ce=this.options)!==null&&ce!==void 0?ce:{}}toString(){return`plugin{${this.config.id}}`}constructor(ce){(0,V._)(this,"config",void 0),(0,V._)(this,"options",void 0),this.config=ce,this.options=void 0}}function Mn(Se){return new On(Se)}},64355:function(St,ke,n){"use strict";n.d(ke,{o:function(){return z},y:function(){return g}});var r=n(52322),p=n(51837),W=n(2784);const f="plugin-context",z=u=>{const{children:D,plugin:ge}=u,{Provider:de}=(0,p.CT)(f);return(0,r.jsx)(de,{value:(0,p.EI)({1:{plugin:ge}}),children:D})};function g(){const u=(0,p.Vt)(f);if(!u)throw new Error("Plugin Options context is not available");const D=u.atVersion(1);if(!D)throw new Error("Plugin Options v1 is not available");return D.plugin.getPluginOptions()}},23054:function(St,ke,n){"use strict";n.d(ke,{SP:function(){return se},dR:function(){return te},VL:function(){return H},BD:function(){return p}});function r(T){if(typeof T!="object"||T===null||Array.isArray(T))return!1;const R=T;return!(typeof R.name!="string"||R.name===""||typeof R.message!="string")}function p(T){if(typeof T!="object"||T===null||Array.isArray(T))throw new Error(`Encountered invalid error, not an object, got '${T}'`);const R=T;if(typeof R.name!="string"||R.name==="")throw new Error(`Encountered error object without a name, got '${T}'`);if(typeof R.message!="string")throw new Error(`Encountered error object without a message, got '${T}'`)}var W=n(87612),f=n(24852);function z(T,R){const G={name:"Unknown",message:"<no reason given>",...serializeErrorInternal(T)};return R!=null&&R.includeStack||delete G.stack,G}function g(T){const R=(0,f.deserializeError)(T);return T.stack||(R.stack=void 0),R}function u(T){if(r(T)){const R=String(T);return R!=="[object Object]"?R:`${T.name}: ${T.message}`}return`unknown error '${T}'`}class D extends Error{constructor(R,P){var G;let je=R;if(P!==void 0){const Pe=u(P);je?je+=`; caused by ${Pe}`:je=`caused by ${Pe}`}super(je),(0,W._)(this,"cause",void 0),(G=Error.captureStackTrace)===null||G===void 0||G.call(Error,this,this.constructor),this.name=this.constructor.name,this.cause=r(P)?P:void 0}}class ge extends null{}class de extends null{}class V extends null{}class te extends D{}class L extends null{}class A extends null{}class ae extends null{}class oe extends null{}class se extends D{constructor(R,P){super(R,P),this.name=r(P)?P.name:"Error"}}async function q(T){try{const P=await T.text();if(P){var R;if(!((R=T.headers.get("content-type"))===null||R===void 0)&&R.startsWith("application/json"))try{const G=JSON.parse(P);if(G.error&&G.response)return G}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}, ${P}`},response:{statusCode:T.status}}}}catch{}return{error:{name:"Error",message:`Request failed with status ${T.status} ${T.statusText}`},response:{statusCode:T.status}}}class H extends Error{static async fromResponse(R){const P=await q(R),G=P.response.statusCode||R.status,je=P.error.name||R.statusText,Pe=`Request failed with ${G} ${je}`,N=g(P.error);return new H({message:Pe,response:R,data:P,cause:N})}constructor(R){super(R.message),(0,W._)(this,"response",void 0),(0,W._)(this,"body",void 0),(0,W._)(this,"cause",void 0),this.name="ResponseError",this.response=R.response,this.body=R.data,this.cause=R.cause}}},32838:function(St,ke,n){"use strict";n.d(ke,{nW:function(){return oe},ae:function(){return V},q3:function(){return te}});var r=n(60871);const p=(0,r.T0)({id:"core.scmauth"});var W=new WeakMap;class f{async getCredentials(q){const H=new URL(q.url),T=_class_private_field_get(this,W).find(R=>R.isUrlSupported(H));if(!T)throw new Error(`No auth provider available for '${q.url}', see https://backstage.io/link?scm-auth`);return T.getCredentials(q)}constructor(q){_class_private_field_init(this,W,{writable:!0,value:void 0}),_class_private_field_set(this,W,q)}}var z=new WeakMap,g=new WeakMap,u=new WeakMap,D=new WeakMap;class ge{static createDefaultApiFactory(){return createApiFactory({api:scmAuthApiRef,deps:{github:githubAuthApiRef,gitlab:gitlabAuthApiRef,azure:microsoftAuthApiRef,bitbucket:bitbucketAuthApiRef},factory:({github:q,gitlab:H,azure:T,bitbucket:R})=>ge.merge(ge.forGithub(q),ge.forGitlab(H),ge.forAzure(T),ge.forBitbucket(R))})}static forAuthApi(q,H){return new ge("generic",q,H.host,H.scopeMapping)}static forGithub(q,H){var T;const R=(T=H==null?void 0:H.host)!==null&&T!==void 0?T:"github.com";return new ge("github",q,R,{default:["repo","read:org","read:user"],repoWrite:["gist"]})}static forGitlab(q,H){var T;const R=(T=H==null?void 0:H.host)!==null&&T!==void 0?T:"gitlab.com";return new ge("gitlab",q,R,{default:["read_user","read_api","read_repository"],repoWrite:["write_repository","api"]})}static forAzure(q,H){var T;const R=(T=H==null?void 0:H.host)!==null&&T!==void 0?T:"dev.azure.com";return new ge("azure",q,R,{default:["vso.build","vso.code","vso.graph","vso.project","vso.profile"],repoWrite:["vso.code_manage"]})}static forBitbucket(q,H){var T;const R=(T=H==null?void 0:H.host)!==null&&T!==void 0?T:"bitbucket.org";return new ge("bitbucket",q,R,{default:["account","team","pullrequest","snippet","issue"],repoWrite:["pullrequest:write","snippet:write","issue:write"]})}static merge(...q){return new f(q)}isUrlSupported(q){return q.host===_class_private_field_get(this,g)}getAdditionalScopesForProvider(q){var H;if(!(q!=null&&q.customScopes)||_class_private_field_get(this,D)==="generic")return[];var T;return(T=(H=q.customScopes)===null||H===void 0?void 0:H[_class_private_field_get(this,D)])!==null&&T!==void 0?T:[]}async getCredentials(q){const{url:H,additionalScope:T,...R}=q,P=_class_private_field_get(this,u).default.slice();T!=null&&T.repoWrite&&P.push(..._class_private_field_get(this,u).repoWrite);const G=this.getAdditionalScopesForProvider(T);G.length&&P.push(...G);const je=[...new Set(P)],Pe=await _class_private_field_get(this,z).getAccessToken(je,R);return{token:Pe,headers:{Authorization:`Bearer ${Pe}`}}}constructor(q,H,T,R){_class_private_field_init(this,z,{writable:!0,value:void 0}),_class_private_field_init(this,g,{writable:!0,value:void 0}),_class_private_field_init(this,u,{writable:!0,value:void 0}),_class_private_field_init(this,D,{writable:!0,value:void 0}),_class_private_field_set(this,z,H),_class_private_field_set(this,g,T),_class_private_field_set(this,u,R),_class_private_field_set(this,D,q)}}var de=n(40556);class V{static fromConfig(q){return de.Lx.fromConfig(q)}}const te=(0,r.T0)({id:"integration.scmintegrations"});var L=n(52322),A=n(73250),ae=n(2784);const oe=se=>{const{type:q}=se,H=(0,r.qD)(),T=A.Z;var R;const P=q&&(R=H.getSystemIcon(q))!==null&&R!==void 0?R:T;return(0,L.jsx)(P,{})}},40556:function(St,ke,n){"use strict";n.d(ke,{Lx:function(){return Ar},BT:function(){return Ut}});var r=n(87612),p=n(82717),W=n.n(p),f=n(76635);function z(S){const c=new URL("http://example.com");return c.host=S,c.host===S}function g(S){try{return new URL(S),!0}catch{return!1}}function u(S,c){return{list(){return S},byUrl(b){try{const j=typeof b=="string"?new URL(b):b;return S.find(K=>c(K)===j.host)}catch{return}},byHost(b){return S.find(j=>c(j)===b)}}}function D(S){const{url:c,base:b,lineNumber:j}=S;try{return new URL(c),c}catch{}let K;if(c.startsWith("/")){const{filepath:me}=W()(b);K=new URL(b);const we=(0,f.trimEnd)(K.pathname.substring(0,K.pathname.length-me.length),"/");K.pathname=`${we}${c}`}else K=new URL(c,b);return K.search=new URL(b).search,j&&(K.hash=`L${j}`),K.toString()}function ge(S){beforeAll(()=>S.listen({onUnhandledRequest:"error"})),afterAll(()=>S.close()),afterEach(()=>S.resetHandlers())}const de="amazonaws.com";function V(S){const c=S.getOptionalString("endpoint");var b;const j=(b=S.getOptionalBoolean("s3ForcePathStyle"))!==null&&b!==void 0?b:!1;let K,me;if(c){try{const jn=new URL(c);K=jn.host,me=jn.pathname}catch{throw new Error(`invalid awsS3 integration config, endpoint '${c}' is not a valid URL`)}if(me!=="/")throw new Error(`invalid awsS3 integration config, endpoints cannot contain path, got '${c}'`)}else K=de;const we=S.getOptionalString("accessKeyId"),Fe=S.getOptionalString("secretAccessKey"),Xe=S.getOptionalString("roleArn"),Mt=S.getOptionalString("externalId");return{host:K,endpoint:c,s3ForcePathStyle:j,accessKeyId:we,secretAccessKey:Fe,roleArn:Xe,externalId:Mt}}function te(S){const c=S.map(V);return c.some(b=>b.host===de)||c.push({host:de}),c}class L{get type(){return"awsS3"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return D(c)}resolveEditUrl(c){return c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(L,"factory",({config:S})=>{var c;const b=te((c=S.getOptionalConfigArray("integrations.awsS3"))!==null&&c!==void 0?c:[]);return u(b.map(j=>new L(j)),j=>j.config.host)});var A=n(88412),ae=n(50629),oe=n(80956);const se="GB";var q=new WeakMap,H=new WeakMap,T=new WeakMap,R=new WeakMap,P=new WeakMap,G=new WeakMap,je=new WeakMap;class Pe{static fromRepoUrl(c){const b=new URL(c);let j,K,me;const we=b.pathname.split("/").map(qn=>decodeURIComponent(qn));if(we[2]==="_git"?(j=we[1],K=me=we[3]):we[3]==="_git"?(j=we[1],K=we[2],me=we[4]):we[4]==="_git"&&(j=`${we[1]}/${we[2]}`,K=we[3],me=we[5]),!j||!K||!me)throw new Error("Azure URL must point to a git repository");var Fe;const Xe=(Fe=b.searchParams.get("path"))!==null&&Fe!==void 0?Fe:void 0;let Mt;const jn=b.searchParams.get("version");if(jn){if(jn.slice(0,2)!=="GB")throw new Error("Azure URL version must point to a git branch");Mt=jn.slice(2)}return new Pe(b.origin,j,K,me,Xe,Mt)}toRepoUrl(){let c;return(0,A._)(this,T)===(0,A._)(this,R)?c=(0,A._)(this,je).call(this,(0,A._)(this,H),"_git",(0,A._)(this,R)):c=(0,A._)(this,je).call(this,(0,A._)(this,H),(0,A._)(this,T),"_git",(0,A._)(this,R)),(0,A._)(this,P)&&c.searchParams.set("path",(0,A._)(this,P)),(0,A._)(this,G)&&c.searchParams.set("version",se+(0,A._)(this,G)),c.toString()}toFileUrl(){if(!(0,A._)(this,P))throw new Error("Azure URL must point to a specific path to be able to download a file");const c=(0,A._)(this,je).call(this,(0,A._)(this,H),(0,A._)(this,T),"_apis","git","repositories",(0,A._)(this,R),"items");return c.searchParams.set("api-version","6.0"),c.searchParams.set("path",(0,A._)(this,P)),(0,A._)(this,G)&&c.searchParams.set("version",(0,A._)(this,G)),c.toString()}toArchiveUrl(){const c=(0,A._)(this,je).call(this,(0,A._)(this,H),(0,A._)(this,T),"_apis","git","repositories",(0,A._)(this,R),"items");return c.searchParams.set("recursionLevel","full"),c.searchParams.set("download","true"),c.searchParams.set("api-version","6.0"),(0,A._)(this,P)&&c.searchParams.set("scopePath",(0,A._)(this,P)),(0,A._)(this,G)&&c.searchParams.set("version",(0,A._)(this,G)),c.toString()}toCommitsUrl(){const c=(0,A._)(this,je).call(this,(0,A._)(this,H),(0,A._)(this,T),"_apis","git","repositories",(0,A._)(this,R),"commits");return c.searchParams.set("api-version","6.0"),(0,A._)(this,G)&&c.searchParams.set("searchCriteria.itemVersion.version",(0,A._)(this,G)),c.toString()}getOwner(){return(0,A._)(this,H)}getProject(){return(0,A._)(this,T)}getRepo(){return(0,A._)(this,R)}getPath(){return(0,A._)(this,P)}getRef(){return(0,A._)(this,G)}constructor(c,b,j,K,me,we){(0,ae._)(this,q,{writable:!0,value:void 0}),(0,ae._)(this,H,{writable:!0,value:void 0}),(0,ae._)(this,T,{writable:!0,value:void 0}),(0,ae._)(this,R,{writable:!0,value:void 0}),(0,ae._)(this,P,{writable:!0,value:void 0}),(0,ae._)(this,G,{writable:!0,value:void 0}),(0,ae._)(this,je,{writable:!0,value:(...Fe)=>{const Xe=new URL((0,A._)(this,q));return Xe.pathname=Fe.map(Mt=>encodeURIComponent(Mt)).join("/"),Xe}}),(0,oe._)(this,q,c),(0,oe._)(this,H,b),(0,oe._)(this,T,j),(0,oe._)(this,R,K),(0,oe._)(this,P,me),(0,oe._)(this,G,we)}}const N="dev.azure.com",_e=S=>{const c=S;return Object.keys(S).length===3&&c.clientId!==void 0&&c.clientSecret!==void 0&&c.tenantId!==void 0},at=S=>Object.keys(S).length===1&&S.clientId!==void 0;function It(S){var c;const b=(c=S.getOptionalString("host"))!==null&&c!==void 0?c:N,j=S.getOptionalString("token"),K=S.getOptional("credential")?{tenantId:S.getOptionalString("credential.tenantId"),clientId:S.getOptionalString("credential.clientId"),clientSecret:S.getOptionalString("credential.clientSecret")}:void 0;if(!z(b))throw new Error(`Invalid Azure integration config, '${b}' is not a valid host`);if(K&&!_e(K)&&!at(K))throw new Error("Invalid Azure integration config, credential is not valid");if(K&&b!==N)throw new Error(`Invalid Azure integration config, credential can only be used with ${N}`);if(K&&j)throw new Error("Invalid Azure integration config, specify either a token or a credential but not both");return{host:b,token:j,credential:K}}function zt(S){const c=S.map(It);return c.some(b=>b.host===N)||c.push({host:N}),c}class xt{get type(){return"azure"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:b,base:j}=c;if(g(b))return b;try{const me=Pe.fromRepoUrl(j),we=new URL(j);var K;const Fe=new URL(`https://a.com${(K=me.getPath())!==null&&K!==void 0?K:""}`),Xe=new URL(b,Fe).pathname;return we.searchParams.set("path",Xe),c.lineNumber&&(we.searchParams.set("line",String(c.lineNumber)),we.searchParams.set("lineEnd",String(c.lineNumber+1)),we.searchParams.set("lineStartColumn","1"),we.searchParams.set("lineEndColumn","1")),we.toString()}catch{return new URL(b,j).toString()}}resolveEditUrl(c){return c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(xt,"factory",({config:S})=>{var c;const b=zt((c=S.getOptionalConfigArray("integrations.azure"))!==null&&c!==void 0?c:[]);return u(b.map(j=>new xt(j)),j=>j.config.host)});var Nt=n(48834).lW;function Dt(S){return AzureUrl.fromRepoUrl(S).toFileUrl()}function et(S){return AzureUrl.fromRepoUrl(S).toArchiveUrl()}function lt(S){return AzureUrl.fromRepoUrl(S).toCommitsUrl()}async function yt(S,c){const b="499b84ac-1321-427f-aa17-267ca6975798/.default",j=c?{...c}:{},{token:K,credential:me}=S;if(me){if(isAzureClientSecretCredential(me)){const Fe=await new ClientSecretCredential(me.tenantId,me.clientId,me.clientSecret).getToken(b);j.Authorization=`Bearer ${Fe.token}`}else if(isAzureManagedIdentityCredential(me)){const Fe=await new ManagedIdentityCredential(me.clientId).getToken(b);j.Authorization=`Bearer ${Fe.token}`}}else if(K){const we=Nt.from(`:${S.token}`,"utf8");j.Authorization=`Basic ${we.toString("base64")}`}return{headers:j}}const At="bitbucket.org",$t="https://api.bitbucket.org/2.0";function Ht(S){var c;const b=(c=S.getOptionalString("host"))!==null&&c!==void 0?c:At;let j=S.getOptionalString("apiBaseUrl");const K=S.getOptionalString("token"),me=S.getOptionalString("username"),we=S.getOptionalString("appPassword");if(!z(b))throw new Error(`Invalid Bitbucket integration config, '${b}' is not a valid host`);return j?j=(0,f.trimEnd)(j,"/"):b===At?j=$t:j=`https://${b}/rest/api/1.0`,{host:b,apiBaseUrl:j,token:K,username:me,appPassword:we}}function be(S){const c=S.map(Ht);return c.some(b=>b.host===At)||c.push({host:At,apiBaseUrl:$t}),c}class Ce{get type(){return"bitbucket"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=D(c);if(!c.lineNumber)return b;const j=new URL(b);return this.integrationConfig.host==="bitbucket.org"?j.hash=`lines-${c.lineNumber}`:j.hash=`${c.lineNumber}`,j.toString()}resolveEditUrl(c){const b=W()(c),j=new URL(c);return j.searchParams.set("mode","edit"),j.searchParams.set("spa","0"),j.searchParams.set("at",b.ref),j.toString()}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(Ce,"factory",({config:S})=>{var c,b,j;const K=be((j=S.getOptionalConfigArray("integrations.bitbucket"))!==null&&j!==void 0?j:[...(c=S.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[],...(b=S.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&b!==void 0?b:[]]);return u(K.map(me=>new Ce(me)),me=>me.config.host)});var Ye=n(96279),Le=n(48834).lW;async function ct(S,c){const{name:b,owner:j,resource:K}=parseGitUrl(S),me=K==="bitbucket.org";let we=me?`${c.apiBaseUrl}/repositories/${j}/${b}`:`${c.apiBaseUrl}/projects/${j}/repos/${b}/default-branch`,Fe=await fetch(we,Qe(c));if(Fe.status===404&&!me&&(we=`${c.apiBaseUrl}/projects/${j}/repos/${b}/branches/default`,Fe=await fetch(we,Qe(c))),!Fe.ok){const Mt=`Failed to retrieve default branch from ${we}, ${Fe.status} ${Fe.statusText}`;throw new Error(Mt)}let Xe;if(me)Xe=(await Fe.json()).mainbranch.name;else{const{displayId:Mt}=await Fe.json();Xe=Mt}if(!Xe)throw new Error(`Failed to read default branch from ${we}. Response ${Fe.status} ${Fe.json()}`);return Xe}async function Ct(S,c){const{name:b,owner:j,ref:K,protocol:me,resource:we,filepath:Fe}=parseGitUrl(S),Xe=we==="bitbucket.org";let Mt=K;Mt||(Mt=await ct(S,c));const jn=Fe?`&path=${encodeURIComponent(decodeURIComponent(Fe))}`:"";return Xe?`${me}://${we}/${j}/${b}/get/${Mt}.tar.gz`:`${c.apiBaseUrl}/projects/${j}/repos/${b}/archive?format=tgz&at=${Mt}&prefix=${j}-${b}${jn}`}function dt(S,c){try{const{owner:b,name:j,ref:K,filepathtype:me,filepath:we}=parseGitUrl(S);if(!b||!j||me!=="browse"&&me!=="raw"&&me!=="src")throw new Error("Invalid Bitbucket URL or file path");const Fe=we.replace(/^\//,"");if(c.host==="bitbucket.org"){if(!K)throw new Error("Invalid Bitbucket URL or file path");return`${c.apiBaseUrl}/repositories/${b}/${j}/src/${K}/${Fe}`}return`${c.apiBaseUrl}/projects/${b}/repos/${j}/raw/${Fe}?at=${K}`}catch(b){throw new Error(`Incorrect URL: ${S}, ${b}`)}}function Qe(S){const c={};if(S.token)c.Authorization=`Bearer ${S.token}`;else if(S.username&&S.appPassword){const b=Le.from(`${S.username}:${S.appPassword}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}const Ge="bitbucket.org",ut="https://api.bitbucket.org/2.0";function pt(S){const c=Ge,b=ut,j=S.getString("username"),K=S.getString("appPassword");return{host:c,apiBaseUrl:b,username:j,appPassword:K}}function hn(S){const c=S.map(pt);return c.length===0&&c.push({host:Ge,apiBaseUrl:ut}),c}class pn{get type(){return"bitbucketCloud"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=D(c);if(c.lineNumber){const j=new URL(b);return j.hash=`lines-${c.lineNumber}`,j.toString()}return b}resolveEditUrl(c){const b=W()(c),j=new URL(c);return j.searchParams.set("mode","edit"),j.searchParams.set("at",b.ref),j.toString()}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(pn,"factory",({config:S})=>{var c;const b=hn((c=S.getOptionalConfigArray("integrations.bitbucketCloud"))!==null&&c!==void 0?c:[]);return u(b.map(j=>new pn(j)),j=>j.config.host)});var fn=n(48834).lW;async function qt(S,c){const{name:b,owner:j}=parseGitUrl(S),K=`${c.apiBaseUrl}/repositories/${j}/${b}`,me=await fetch(K,rn(c));if(!me.ok){const Xe=`Failed to retrieve default branch from ${K}, ${me.status} ${me.statusText}`;throw new Error(Xe)}const Fe=(await me.json()).mainbranch.name;if(!Fe)throw new Error(`Failed to read default branch from ${K}. Response ${me.status} ${me.json()}`);return Fe}async function Cn(S,c){const{name:b,owner:j,ref:K,protocol:me,resource:we}=parseGitUrl(S);let Fe=K;return Fe||(Fe=await qt(S,c)),`${me}://${we}/${j}/${b}/get/${Fe}.tar.gz`}function Kt(S,c){try{const{owner:b,name:j,ref:K,filepathtype:me,filepath:we}=parseGitUrl(S);if(!b||!j||me!=="src"&&me!=="raw")throw new Error("Invalid Bitbucket Cloud URL or file path");const Fe=we.replace(/^\//,"");if(!K)throw new Error("Invalid Bitbucket Cloud URL or file path");return`${c.apiBaseUrl}/repositories/${b}/${j}/src/${K}/${Fe}`}catch(b){throw new Error(`Incorrect URL: ${S}, ${b}`)}}function rn(S){const c={};if(S.username&&S.appPassword){const b=fn.from(`${S.username}:${S.appPassword}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}function En(S){const c=S.getString("host");let b=S.getOptionalString("apiBaseUrl");const j=S.getOptionalString("token"),K=S.getOptionalString("username"),me=S.getOptionalString("password");if(!z(c))throw new Error(`Invalid Bitbucket Server integration config, '${c}' is not a valid host`);return b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}/rest/api/1.0`,{host:c,apiBaseUrl:b,token:j,username:K,password:me}}function on(S){return S.map(En)}class An{get type(){return"bitbucketServer"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const b=D(c);if(c.lineNumber){const j=new URL(b);return j.hash=c.lineNumber.toString(),j.toString()}return b}resolveEditUrl(c){return c.includes("?")?c.substring(0,c.indexOf("?")):c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(An,"factory",({config:S})=>{var c;const b=on((c=S.getOptionalConfigArray("integrations.bitbucketServer"))!==null&&c!==void 0?c:[]);return u(b.map(j=>new An(j)),j=>j.config.host)});var Zn=n(48834).lW;async function nt(S,c){const{name:b,owner:j}=parseGitUrl(S);let K=`${c.apiBaseUrl}/projects/${j}/repos/${b}/default-branch`,me=await fetch(K,rt(c));if(me.status===404&&(K=`${c.apiBaseUrl}/projects/${j}/repos/${b}/branches/default`,me=await fetch(K,rt(c))),!me.ok){const Xe=`Failed to retrieve default branch from ${K}, ${me.status} ${me.statusText}`;throw new Error(Xe)}const{displayId:we}=await me.json(),Fe=we;if(!Fe)throw new Error(`Failed to read default branch from ${K}. Response ${me.status} ${me.json()}`);return Fe}async function sn(S,c){const{name:b,owner:j,ref:K,filepath:me}=parseGitUrl(S);let we=K;we||(we=await nt(S,c));const Fe=me?`&path=${encodeURIComponent(decodeURIComponent(me))}`:"";return`${c.apiBaseUrl}/projects/${j}/repos/${b}/archive?format=tgz&at=${we}&prefix=${j}-${b}${Fe}`}function Yt(S,c){try{const{owner:b,name:j,ref:K,filepathtype:me,filepath:we}=parseGitUrl(S);if(!b||!j||me!=="browse"&&me!=="raw"&&me!=="src")throw new Error("Invalid Bitbucket Server URL or file path");const Fe=we.replace(/^\//,"");return`${c.apiBaseUrl}/projects/${b}/repos/${j}/raw/${Fe}?at=${K}`}catch(b){throw new Error(`Incorrect URL: ${S}, ${b}`)}}function rt(S){const c={};if(S.token)c.Authorization=`Bearer ${S.token}`;else if(S.username&&S.password){const b=Zn.from(`${S.username}:${S.password}`,"utf8");c.Authorization=`Basic ${b.toString("base64")}`}return{headers:c}}function Pn(S){const c=S.getString("host");let b=S.getOptionalString("baseUrl"),j=S.getOptionalString("cloneUrl"),K=S.getOptionalString("gitilesBaseUrl");const me=S.getOptionalString("username"),we=S.getOptionalString("password");if(z(c)){if(b&&!g(b))throw new Error(`Invalid Gerrit integration config, '${b}' is not a valid baseUrl`);if(j&&!g(j))throw new Error(`Invalid Gerrit integration config, '${j}' is not a valid cloneUrl`);if(K&&!g(K))throw new Error(`Invalid Gerrit integration config, '${K}' is not a valid gitilesBaseUrl`)}else throw new Error(`Invalid Gerrit integration config, '${c}' is not a valid host`);return b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}`,K?K=(0,f.trimEnd)(K,"/"):K=`https://${c}`,j?j=(0,f.trimEnd)(j,"/"):j=b,{host:c,baseUrl:b,cloneUrl:j,gitilesBaseUrl:K,username:me,password:we}}function Jt(S){return S.map(Pn)}var Ln=n(48834).lW;const Un=")]}'";function On(S,c){const j=c.replace(S.gitilesBaseUrl,"").split("/").filter(Mt=>!!Mt),K=j.indexOf("+");if(K<=0)throw new Error(`Unable to parse project from url: ${c}`);const me=(0,f.trimStart)(j.slice(0,K).join("/"),"/"),we=j.indexOf("heads");if(we<=0)throw new Error(`Unable to parse branch from url: ${c}`);const Fe=j[we+1],Xe=j.slice(we+2).join("/");return{branch:Fe,filePath:Xe===""?"/":Xe,project:me}}function Mn(S,c,b,j){return`${S.gitilesBaseUrl}/${c}/+/refs/heads/${b}/${(0,f.trimStart)(j,"/")}`}function Se(S){return S.password?"/a/":"/"}function ce(S,c){const{branch:b,project:j}=On(S,c);return`${S.baseUrl}${Se(S)}projects/${encodeURIComponent(j)}/branches/${b}`}function Ie(S,c){const{project:b}=On(S,c);return`${S.cloneUrl}${Se(S)}${b}`}function Ue(S,c){const{branch:b,filePath:j,project:K}=On(S,c);return`${S.baseUrl}${Se(S)}projects/${encodeURIComponent(K)}/branches/${b}/files/${encodeURIComponent(j)}/content`}function Ve(S){return`${S.baseUrl}${Se(S)}projects/`}function le(S){const c={};if(!S.password)return c;const b=Ln.from(`${S.username}:${S.password}`,"utf8");return c.Authorization=`Basic ${b.toString("base64")}`,{headers:c}}async function U(S){const c=await S.text();if(c.startsWith(Un))try{return JSON.parse(c.slice(Un.length))}catch(b){throw new Error(`Invalid response from Gerrit: ${c.slice(0,10)} - ${b}`)}throw new Error(`Gerrit JSON body prefix missing. Found: ${c.slice(0,10)}`)}class he{get type(){return"gerrit"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){const{url:b,base:j,lineNumber:K}=c;let me;if(b.startsWith("/")){const{branch:we,project:Fe}=On(this.config,j);return Mn(this.config,Fe,we,b)}return b?me=new URL(b,j):me=new URL(j),K&&(me.hash=K.toString()),me.toString()}resolveEditUrl(c){return c}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(he,"factory",({config:S})=>{var c;const b=Jt((c=S.getOptionalConfigArray("integrations.gerrit"))!==null&&c!==void 0?c:[]);return u(b.map(j=>new he(j)),j=>j.config.host)});function $e(S){const c=S.getString("host");let b=S.getOptionalString("baseUrl");const j=S.getOptionalString("username"),K=S.getOptionalString("password");if(!z(c))throw new Error(`Invalid Gitea integration config, '${c}' is not a valid host`);return b?b=(0,f.trimEnd)(b,"/"):b=`https://${c}`,{host:c,baseUrl:b,username:j,password:K}}var Ke=n(48834).lW;function Je(S,c){try{var b;const j=(b=S.baseUrl)!==null&&b!==void 0?b:`https://${S.host}`,[K,me,we,Fe,Xe,Mt,...jn]=c.replace(j,"").split("/"),qn=jn.join("/").replace(/^\//,"");return`${j}/${me}/${we}/_edit/${Mt}/${qn}`}catch(j){throw new Error(`Incorrect URL: ${c}, ${j}`)}}function Zt(S,c){try{var b;const j=(b=S.baseUrl)!==null&&b!==void 0?b:`https://${S.host}`,[K,me,we,Fe,Xe,Mt,...jn]=c.replace(j,"").split("/"),qn=jn.join("/").replace(/^\//,"");return`${j}/api/v1/repos/${me}/${we}/contents/${qn}?ref=${Mt}`}catch(j){throw new Error(`Incorrect URL: ${c}, ${j}`)}}function _t(S){const c={},{username:b,password:j}=S;return j?(b?c.Authorization=`basic ${Ke.from(`${b}:${j}`).toString("base64")}`:c.Authorization=`token ${j}`,{headers:c}):c}class en{get type(){return"gitea"}get title(){return this.config.host}resolveUrl(c){return D(c)}resolveEditUrl(c){return Je(this.config,c)}constructor(c){(0,r._)(this,"config",void 0),this.config=c}}(0,r._)(en,"factory",({config:S})=>{var c;const j=((c=S.getOptionalConfigArray("integrations.gitea"))!==null&&c!==void 0?c:[]).map(K=>$e(K));return u(j.map(K=>new en(K)),K=>K.config.host)});const Qt="github.com",tn="https://api.github.com",_="https://raw.githubusercontent.com";function X(S){var c,b;const j=(b=S.getOptionalString("host"))!==null&&b!==void 0?b:Qt;let K=S.getOptionalString("apiBaseUrl"),me=S.getOptionalString("rawBaseUrl");const we=S.getOptionalString("token"),Fe=(c=S.getOptionalConfigArray("apps"))===null||c===void 0?void 0:c.map(Xe=>({appId:Xe.getNumber("appId"),clientId:Xe.getString("clientId"),clientSecret:Xe.getString("clientSecret"),webhookSecret:Xe.getString("webhookSecret"),privateKey:Xe.getString("privateKey"),allowedInstallationOwners:Xe.getOptionalStringArray("allowedInstallationOwners")}));if(!z(j))throw new Error(`Invalid GitHub integration config, '${j}' is not a valid host`);return K?K=(0,f.trimEnd)(K,"/"):j===Qt&&(K=tn),me?me=(0,f.trimEnd)(me,"/"):j===Qt&&(me=_),{host:j,apiBaseUrl:K,rawBaseUrl:me,token:we,apps:Fe}}function ee(S){const c=S.map(X);return c.some(b=>b.host===Qt)||c.push({host:Qt,apiBaseUrl:tn,rawBaseUrl:_}),c}function v(S,c,b){try{const{owner:j,name:K,ref:me,filepathtype:we,filepath:Fe}=parseGitUrl(S);if(!j||!K||!me||we!=="blob"&&we!=="raw"&&we!=="tree")throw new Error("Invalid GitHub URL or file path");const Xe=Fe.replace(/^\//,"");return J(c,b)==="api"?`${c.apiBaseUrl}/repos/${j}/${K}/contents/${Xe}?ref=${me}`:`${c.rawBaseUrl}/${j}/${K}/${me}/${Xe}`}catch(j){throw new Error(`Incorrect URL: ${S}, ${j}`)}}function O(S,c){const b={};return J(S,c)==="api"&&(b.Accept="application/vnd.github.v3.raw"),c.token&&(b.Authorization=`token ${c.token}`),{headers:b}}function J(S,c){return S.apiBaseUrl&&(c.token||!S.rawBaseUrl)?"api":"raw"}var M=n(35355),ue=n(89393),ye=n(26228);class Me{async getOrCreateToken(c,b,j){let K=this.tokenCache.get(c);if((!K||this.isExpired(K.expiresAt))&&(K=await j(),K.expiresAt=K.expiresAt.minus({minutes:10}),this.tokenCache.set(c,K)),!this.appliesToRepo(K,b))throw new Error(`The Backstage GitHub application used in the ${c} organization does not have access to a repository with the name ${b}`);return{accessToken:K.token}}appliesToRepo(c,b){return b===void 0?!0:c.repositories!==void 0?c.repositories.includes(b):!0}constructor(){(0,r._)(this,"tokenCache",new Map),(0,r._)(this,"isExpired",c=>ye.ou.local()>c)}}const ot={Accept:"application/vnd.github.machine-man-preview+json"};class ht{async getInstallationCredentials(c,b){if(this.allowedInstallationOwners){var j;if(!(!((j=this.allowedInstallationOwners)===null||j===void 0)&&j.includes(c)))return{accessToken:void 0}}return this.cache.getOrCreateToken(c,b,async()=>{const{installationId:K,suspended:me}=await this.getInstallationData(c);if(me)throw new Error(`The GitHub application for ${c} is suspended`);const we=await this.appClient.apps.createInstallationAccessToken({installation_id:K,headers:ot});let Fe;if(we.data.repository_selection==="selected"){const Mt=new ue.v({baseUrl:this.baseUrl,auth:we.data.token}),jn=await Mt.paginate(Mt.apps.listReposAccessibleToInstallation);var Xe;Fe=((Xe=jn.repositories)!==null&&Xe!==void 0?Xe:jn).map(ar=>ar.name)}return{token:we.data.token,expiresAt:ye.ou.fromISO(we.data.expires_at),repositories:Fe}})}getInstallations(){return this.appClient.paginate(this.appClient.apps.listInstallations)}async getInstallationData(c){const j=(await this.getInstallations()).find(me=>{var we;return me.account&&"login"in me.account&&((we=me.account.login)===null||we===void 0?void 0:we.toLocaleLowerCase("en-US"))===c.toLocaleLowerCase("en-US")});if(j)return{installationId:j.id,suspended:Boolean(j.suspended_by)};const K=new Error(`No app installation found for ${c} in ${this.baseAuthConfig.appId}`);throw K.name="NotFoundError",K}constructor(c,b){(0,r._)(this,"appClient",void 0),(0,r._)(this,"baseUrl",void 0),(0,r._)(this,"baseAuthConfig",void 0),(0,r._)(this,"cache",new Me),(0,r._)(this,"allowedInstallationOwners",void 0),this.allowedInstallationOwners=c.allowedInstallationOwners,this.baseUrl=b,this.baseAuthConfig={appId:c.appId,privateKey:c.privateKey.replace(/\\n/gm,`
33
33
  `)},this.appClient=new ue.v({baseUrl:b,headers:ot,authStrategy:M.i,auth:this.baseAuthConfig})}}class Tt{async getAllInstallations(){return this.apps.length?(await Promise.all(this.apps.map(b=>b.getInstallations()))).flat():[]}async getAppToken(c,b){if(this.apps.length===0)return;const j=await Promise.all(this.apps.map(Fe=>Fe.getInstallationCredentials(c,b).then(Xe=>({credentials:Xe,error:void 0}),Xe=>({credentials:void 0,error:Xe})))),K=j.find(Fe=>{var Xe;return(Xe=Fe.credentials)===null||Xe===void 0?void 0:Xe.accessToken});if(K)return K.credentials.accessToken;const we=j.map(Fe=>Fe.error).find(Fe=>(Fe==null?void 0:Fe.name)!=="NotFoundError");if(we)throw we}constructor(c){var b;(0,r._)(this,"apps",void 0);var j;this.apps=(j=(b=c.apps)===null||b===void 0?void 0:b.map(K=>new ht(K,c.apiBaseUrl)))!==null&&j!==void 0?j:[]}}class Et{async getCredentials(c){const b=W()(c.url),j=b.owner||b.name,K=b.owner?b.name:void 0;let me="app",we=await this.githubAppCredentialsMux.getAppToken(j,K);return we||(me="token",we=this.token),{headers:we?{Authorization:`Bearer ${we}`}:void 0,token:we,type:me}}constructor(c,b){(0,r._)(this,"githubAppCredentialsMux",void 0),(0,r._)(this,"token",void 0),this.githubAppCredentialsMux=c,this.token=b}}(0,r._)(Et,"create",S=>new Et(new Tt(S),S.token));class st{static fromIntegrations(c){const b=new Map;return c.github.list().forEach(j=>{const K=SingleInstanceGithubCredentialsProvider.create(j.config);b.set(j.config.host,K)}),new st(b)}async getCredentials(c){const b=new URL(c.url),j=this.providers.get(b.host);if(!j)throw new Error(`There is no GitHub integration that matches ${c.url}. Please add a configuration for an integration.`);return j.getCredentials(c)}constructor(c){_define_property(this,"providers",void 0),this.providers=c}}class Ne{get type(){return"github"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return Ut(D(c),"tree")}resolveEditUrl(c){return Ut(c,"edit")}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(Ne,"factory",({config:S})=>{var c;const b=ee((c=S.getOptionalConfigArray("integrations.github"))!==null&&c!==void 0?c:[]);return u(b.map(j=>new Ne(j)),j=>j.config.host)});function Ut(S,c){return S.replace(/\/\/([^/]+)\/([^/]+)\/([^/]+)\/(blob|tree|edit)\//,(b,j,K,me)=>`//${j}/${K}/${me}/${c}/`)}const Xt=null;class bt extends Ne{get config(){return super.config}constructor(c){super(c)}}(0,r._)(bt,"factory",Ne.factory);const Ft=null,gn=null,wn=null,vt="gitlab.com",He="https://gitlab.com/api/v4";function Lt(S){const c=S.getString("host");let b=S.getOptionalString("apiBaseUrl");const j=S.getOptionalString("token");let K=S.getOptionalString("baseUrl");if(b?b=(0,f.trimEnd)(b,"/"):c===vt&&(b=He),K?K=(0,f.trimEnd)(K,"/"):K=`https://${c}`,z(c)){if(!b||!g(b))throw new Error(`Invalid GitLab integration config, '${b}' is not a valid apiBaseUrl`);if(!g(K))throw new Error(`Invalid GitLab integration config, '${K}' is not a valid baseUrl`)}else throw new Error(`Invalid GitLab integration config, '${c}' is not a valid host`);return{host:c,token:j,apiBaseUrl:b,baseUrl:K}}function xn(S){const c=S.map(Lt);return c.some(b=>b.host===vt)||c.push({host:vt,apiBaseUrl:He,baseUrl:`https://${vt}`}),c}function nn(S){let c="";return S.host!==vt&&(c=new URL(S.baseUrl).pathname),trimEnd(c,"/")}async function sr(S,c){const b=await cn(S,c);return Hn(S,b,c).toString()}function mr(S){const{token:c=""}=S;return{headers:{"PRIVATE-TOKEN":c}}}function Hn(S,c,b){try{const j=new URL(S),K=j.pathname.split("/blob/").slice(1).join("/blob/"),[me,...we]=K.split("/"),Fe=getGitLabIntegrationRelativePath(b);return j.pathname=[...Fe?[Fe]:[],"api/v4/projects",c,"repository/files",encodeURIComponent(decodeURIComponent(we.join("/"))),"raw"].join("/"),j.search=`?ref=${me}`,j}catch(j){throw new Error(`Incorrect url: ${S}, ${j}`)}}async function cn(S,c){const b=new URL(S);if(!b.pathname.includes("/blob/"))throw new Error("Please provide full path to yaml file from GitLab");try{let j=b.pathname.split("/-/blob/")[0].split("/blob/")[0];const K=getGitLabIntegrationRelativePath(c);K&&(j=j.replace(K,""));const me=new URL(`${b.origin}${K}/api/v4/projects/${encodeURIComponent(j.replace(/^\//,""))}`),we=await fetch(me.toString(),mr(c)),Fe=await we.json();if(!we.ok)throw new Error(`GitLab Error '${Fe.error}', ${Fe.error_description}`);return Number(Fe.id)}catch(j){throw new Error(`Could not get GitLab project ID for: ${S}, ${j}`)}}class ir{get type(){return"gitlab"}get title(){return this.integrationConfig.host}get config(){return this.integrationConfig}resolveUrl(c){return D(c)}resolveEditUrl(c){return Fr(c,"edit")}constructor(c){(0,r._)(this,"integrationConfig",void 0),this.integrationConfig=c}}(0,r._)(ir,"factory",({config:S})=>{var c;const b=xn((c=S.getOptionalConfigArray("integrations.gitlab"))!==null&&c!==void 0?c:[]);return u(b.map(j=>new ir(j)),j=>j.config.host)});function Fr(S,c){return S.replace(/\/\-\/(blob|tree|edit)\//,`/-/${c}/`)}class Nr{async getCredentials(c){return this.token?{headers:{Authorization:`Bearer ${this.token}`},token:this.token}:{}}constructor(c){(0,r._)(this,"token",void 0),this.token=c}}(0,r._)(Nr,"create",S=>new Nr(S.token));class Gn{static fromIntegrations(c){const b=new Map;return c.gitlab.list().forEach(j=>{const K=SingleInstanceGitlabCredentialsProvider.create(j.config);b.set(j.config.host,K)}),new Gn(b)}async getCredentials(c){const b=new URL(c.url),j=this.providers.get(b.host);if(!j)throw new Error(`There is no GitLab integration that matches ${c.url}. Please add a configuration for an integration.`);return j.getCredentials(c)}constructor(c){_define_property(this,"providers",void 0),this.providers=c}}class Ar{static fromConfig(c){return new Ar({awsS3:L.factory({config:c}),azure:xt.factory({config:c}),bitbucket:Ce.factory({config:c}),bitbucketCloud:pn.factory({config:c}),bitbucketServer:An.factory({config:c}),gerrit:he.factory({config:c}),github:Ne.factory({config:c}),gitlab:ir.factory({config:c}),gitea:en.factory({config:c})})}get awsS3(){return this.byType.awsS3}get azure(){return this.byType.azure}get bitbucket(){return this.byType.bitbucket}get bitbucketCloud(){return this.byType.bitbucketCloud}get bitbucketServer(){return this.byType.bitbucketServer}get gerrit(){return this.byType.gerrit}get github(){return this.byType.github}get gitlab(){return this.byType.gitlab}get gitea(){return this.byType.gitea}list(){return Object.values(this.byType).flatMap(c=>c.list())}byUrl(c){let b=Object.values(this.byType).map(j=>j.byUrl(c)).filter(Boolean);if(b.length>1){const j=b.filter(K=>!(K instanceof Ce));j.length!==0&&(b=j)}return b[0]}byHost(c){return Object.values(this.byType).map(b=>b.byHost(c)).find(Boolean)}resolveUrl(c){const b=this.byUrl(c.base);return b?b.resolveUrl(c):D(c)}resolveEditUrl(c){const b=this.byUrl(c);return b?b.resolveEditUrl(c):c}constructor(c){(0,r._)(this,"byType",void 0),this.byType=c}}},30966:function(St,ke,n){"use strict";var r={};n.r(r),n.d(r,{TechDocsPlugin:function(){return R.s4}});var p=n(52322),W=n(2784),f=n(28316),z=n(73557),g=n(60871);const u=(0,g.T0)({id:"plugin.techdocs.storageservice"}),D=(0,g.T0)({id:"plugin.techdocs.service"});var ge=n(92077),de=n(95481),V=n(7476),te=n(93225),L=n(86317),A=n(65124),ae=n(22478),oe=n(85478),se=n(68435),q=n(3482),H=n(42081),T=n(48431),R=n(89258),P=n(52943),G=n(61886),je=n(13980),Pe=n.n(je),N=n(87612);class _e{get(t){for(const s of this.holders){const a=s.get(t);if(a)return a}}constructor(...t){(0,N._)(this,"holders",void 0),this.holders=t}}var at=n(51837);const It=(0,at.CT)("api-context"),zt=i=>{var t;const{apis:s,children:a}=i,h=(t=(0,W.useContext)(It))===null||t===void 0?void 0:t.atVersion(1),w=h?new _e(s,h):s;return(0,p.jsx)(It.Provider,{value:(0,at.EI)({1:w}),children:a})};zt.propTypes={apis:Pe().shape({get:Pe().func.isRequired}).isRequired,children:Pe().node};class xt{static validateFactories(t,s){for(const a of s){const h=[a],w=new Set;for(;h.length;){const k=h.shift(),F=t.get(k);if(F)for(const ie of Object.values(F.deps)){if(ie.id===a.id)throw new Error(`Circular dependency of api factory for ${a}`);w.has(ie)||(w.add(ie),h.push(ie))}}}}get(t){return this.load(t)}load(t,s=[]){const a=this.apis.get(t.id);if(a)return a;const h=this.factories.get(t);if(!h)return;if(s.includes(h.api))throw new Error(`Circular dependency of api factory for ${h.api}`);const w=this.loadDeps(t,h.deps,[...s,h.api]),k=h.factory(w);return this.apis.set(t.id,k),k}loadDeps(t,s,a){const h={};for(const w in s)if(s.hasOwnProperty(w)){const k=s[w],F=this.load(k,a);if(!F)throw new Error(`No API factory available for dependency ${k} of dependent ${t}`);h[w]=F}return h}constructor(t){(0,N._)(this,"factories",void 0),(0,N._)(this,"apis",void 0),this.factories=t,this.apis=new Map}}var Nt;(function(i){i[i.default=10]="default",i[i.app=50]="app",i[i.static=100]="static"})(Nt||(Nt={}));class Dt{register(t,s){const a=Nt[t],h=this.factories.get(s.api.id);return h&&h.priority>=a?!1:(this.factories.set(s.api.id,{priority:a,factory:s}),!0)}get(t){const s=this.factories.get(t.id);if(s)return s.factory}getAllApis(){const t=new Set;for(const{factory:s}of this.factories.values())t.add(s.api);return t}constructor(){(0,N._)(this,"factories",new Map)}}function et(i){return new Promise((t,s)=>{const a=i.width||500,h=i.height||700,w=window.screen.width/2-a/2,k=window.screen.height/2-h/2,F=window.open(i.url,i.name,`menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=${a},height=${h},top=${k},left=${w}`);let ie="";if(!F||typeof F.closed=="undefined"||F.closed){const mt=new Error("Failed to open auth popup.");mt.name="PopupRejectedError",s(mt);return}const xe=mt=>{if(mt.source!==F||mt.origin!==i.origin)return;const{data:wt}=mt;if(wt.type==="config_info"){ie=wt.targetOrigin;return}if(wt.type!=="authorization_response")return;const jt=wt;if("error"in jt){const Vt=new Error(jt.error.message);Vt.name=jt.error.name,s(Vt)}else t(jt.response);ze()},Re=setInterval(()=>{if(F.closed){const mt=`Login failed, ${ie&&ie!==window.location.origin?`Incorrect app origin, expected ${ie}`:"popup was closed"}`,wt=new Error(mt);wt.name="PopupClosedError",s(wt),ze()}},100);function ze(){window.removeEventListener("message",xe),clearInterval(Re)}window.addEventListener("message",xe)})}let lt=!1;function yt(i){return[...i].join(" ")}class At{async createSession(t){return t.instantPopup?this.enableExperimentalRedirectFlow?this.executeRedirect(t.scopes):this.showPopup(t.scopes):this.authRequester(t.scopes)}async refreshSession(t){const s=await fetch(await this.buildUrl("/refresh",{optional:!0,...t&&{scope:this.joinScopesFunc(t)}}),{headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(h=>{throw new Error(`Auth refresh request failed, ${h}`)});if(!s.ok){const h=new Error(`Auth refresh request failed, ${s.statusText}`);throw h.status=s.status,h}const a=await s.json();if(a.error){const h=new Error(a.error.message);throw a.error.name&&(h.name=a.error.name),h}return await this.sessionTransform(a)}async removeSession(){const t=await fetch(await this.buildUrl("/logout"),{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},credentials:"include"}).catch(s=>{throw new Error(`Logout request failed, ${s}`)});if(!t.ok){const s=new Error(`Logout request failed, ${t.statusText}`);throw s.status=t.status,s}}async showPopup(t){const s=this.joinScopesFunc(t),a=await this.buildUrl("/start",{scope:s,origin:window.location.origin,flow:"popup"}),h=await et({url:a,name:`${this.provider.title} Login`,origin:new URL(a).origin,width:450,height:730});return await this.sessionTransform(h)}async executeRedirect(t){const s=this.joinScopesFunc(t);return window.location.href=await this.buildUrl("/start",{scope:s,origin:window.location.origin,redirectUrl:window.location.href,flow:"redirect"}),new Promise(()=>{})}async buildUrl(t,s){const a=await this.discoveryApi.getBaseUrl("auth"),h=this.buildQueryString({...s,env:this.environment});return`${a}/${this.provider.id}${t}${h}`}buildQueryString(t){if(!t)return"";const s=Object.entries(t).map(([a,h])=>{if(typeof h=="string")return`${encodeURIComponent(a)}=${encodeURIComponent(h)}`;if(h)return encodeURIComponent(a)}).filter(Boolean).join("&");return s?`?${s}`:""}constructor(t){(0,N._)(this,"discoveryApi",void 0),(0,N._)(this,"environment",void 0),(0,N._)(this,"provider",void 0),(0,N._)(this,"joinScopesFunc",void 0),(0,N._)(this,"authRequester",void 0),(0,N._)(this,"sessionTransform",void 0),(0,N._)(this,"enableExperimentalRedirectFlow",void 0);const{configApi:s,discoveryApi:a,environment:h,provider:w,joinScopes:k=yt,oauthRequestApi:F,sessionTransform:ie=Re=>Re}=t;!lt&&!s&&(console.warn("DEPRECATION WARNING: Authentication providers require a configApi instance to configure the authentication flow. Please provide one to the authentication provider constructor."),lt=!0);var xe;this.enableExperimentalRedirectFlow=s&&(xe=s.getOptionalBoolean("enableExperimentalRedirectFlow"))!==null&&xe!==void 0?xe:!1,this.authRequester=F.createAuthRequester({provider:w,onAuthRequest:async Re=>this.enableExperimentalRedirectFlow?this.executeRedirect(Re):this.showPopup(Re)}),this.discoveryApi=a,this.environment=h,this.provider=w,this.joinScopesFunc=k,this.sessionTransform=ie}}function $t(i,t){for(const s of t)if(!i.has(s))return!1;return!0}class Ht{sessionExistsAndHasScope(t,s){if(!t)return!1;if(!s||this.options.sessionScopes===void 0)return!0;const a=this.options.sessionScopes(t);return $t(a,s)}getExtendedScope(t,s){const a=new Set(this.options.defaultScopes);if(t&&this.options.sessionScopes!==void 0){const h=this.options.sessionScopes(t);for(const w of h)a.add(w)}if(s)for(const h of s)a.add(h);return a}constructor(t){(0,N._)(this,"options",void 0),this.options=t}}var be=n(82394),Ce=n.n(be);let Ye=Symbol.observable;class Le{[Ye](){return this}get closed(){return this.isClosed}next(t){if(this.isClosed)throw new Error("PublishSubject is closed");this.subscribers.forEach(s=>s.next(t))}error(t){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.terminatingError=t,this.subscribers.forEach(s=>s.error(t))}complete(){if(this.isClosed)throw new Error("PublishSubject is closed");this.isClosed=!0,this.subscribers.forEach(t=>t.complete())}subscribe(t,s,a){const h=typeof t=="function"?{next:t,error:s,complete:a}:t;return this.observable.subscribe(h)}constructor(){(0,N._)(this,"isClosed",!1),(0,N._)(this,"terminatingError",void 0),(0,N._)(this,"observable",new(Ce())(t=>this.isClosed?(this.terminatingError?t.error(this.terminatingError):t.complete(),()=>{}):(this.subscribers.add(t),()=>{this.subscribers.delete(t)}))),(0,N._)(this,"subscribers",new Set)}}let ct=Symbol.observable;class Ct{[ct](){return this}get closed(){return this.isClosed}next(t){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.currentValue=t,this.subscribers.forEach(s=>s.next(t))}error(t){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.terminatingError=t,this.subscribers.forEach(s=>s.error(t))}complete(){if(this.isClosed)throw new Error("BehaviorSubject is closed");this.isClosed=!0,this.subscribers.forEach(t=>t.complete())}subscribe(t,s,a){const h=typeof t=="function"?{next:t,error:s,complete:a}:t;return this.observable.subscribe(h)}constructor(t){(0,N._)(this,"isClosed",void 0),(0,N._)(this,"currentValue",void 0),(0,N._)(this,"terminatingError",void 0),(0,N._)(this,"observable",void 0),(0,N._)(this,"subscribers",new Set),this.isClosed=!1,this.currentValue=t,this.terminatingError=void 0,this.observable=new(Ce())(s=>this.isClosed?(this.terminatingError?s.error(this.terminatingError):s.complete(),()=>{}):(s.next(this.currentValue),this.subscribers.add(s),()=>{this.subscribers.delete(s)}))}}class dt{setIsSignedIn(t){this.signedIn!==t&&(this.signedIn=t,this.subject.next(this.signedIn?g.sM.SignedIn:g.sM.SignedOut))}sessionState$(){return this.subject}constructor(){(0,N._)(this,"subject",new Ct(g.sM.SignedOut)),(0,N._)(this,"signedIn",!1)}}class Qe{async getSession(t){if(this.helper.sessionExistsAndHasScope(this.currentSession,t.scopes)){if(!this.sessionShouldRefreshFunc(this.currentSession))return this.currentSession;try{const a=await this.collapsedSessionRefresh(t.scopes),h=this.sessionScopesFunc(this.currentSession),w=this.sessionScopesFunc(a);return $t(w,h)&&(this.currentSession=a),a}catch(a){if(t.optional)return;throw a}}if(!this.currentSession&&!t.instantPopup)try{const s=await this.collapsedSessionRefresh(t.scopes);return this.currentSession=s,this.getSession(t)}catch{}if(!t.optional)return this.currentSession=await this.connector.createSession({...t,scopes:this.helper.getExtendedScope(this.currentSession,t.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,await this.connector.removeSession(),this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}async collapsedSessionRefresh(t){if(this.refreshPromise)return this.refreshPromise;this.refreshPromise=this.connector.refreshSession(t);try{const s=await this.refreshPromise;return this.stateTracker.setIsSignedIn(!0),s}finally{delete this.refreshPromise}}constructor(t){(0,N._)(this,"connector",void 0),(0,N._)(this,"helper",void 0),(0,N._)(this,"sessionScopesFunc",void 0),(0,N._)(this,"sessionShouldRefreshFunc",void 0),(0,N._)(this,"stateTracker",new dt),(0,N._)(this,"refreshPromise",void 0),(0,N._)(this,"currentSession",void 0);const{connector:s,defaultScopes:a=new Set,sessionScopes:h,sessionShouldRefresh:w}=t;this.connector=s,this.sessionScopesFunc=h,this.sessionShouldRefreshFunc=w,this.helper=new Ht({sessionScopes:h,defaultScopes:a})}}class Ge{setSession(t){this.currentSession=t,this.stateTracker.setIsSignedIn(Boolean(t))}async getSession(t){if(this.helper.sessionExistsAndHasScope(this.currentSession,t.scopes))return this.currentSession;if(!t.optional)return this.currentSession=await this.connector.createSession({...t,scopes:this.helper.getExtendedScope(this.currentSession,t.scopes)}),this.stateTracker.setIsSignedIn(!0),this.currentSession}async removeSession(){this.currentSession=void 0,this.stateTracker.setIsSignedIn(!1)}sessionState$(){return this.stateTracker.sessionState$()}constructor(t){_define_property(this,"connector",void 0),_define_property(this,"helper",void 0),_define_property(this,"stateTracker",new SessionStateTracker),_define_property(this,"currentSession",void 0);const{connector:s,defaultScopes:a=new Set,sessionScopes:h}=t;this.connector=s,this.helper=new SessionScopeHelper({sessionScopes:h,defaultScopes:a})}}const ut={id:"oauth2",title:"Your Identity Provider",icon:()=>null};class pt{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:w=ut,oauthRequestApi:k,defaultScopes:F=[],scopeTransform:ie=ze=>ze}=t,xe=new At({configApi:s,discoveryApi:a,environment:h,provider:w,oauthRequestApi:k,sessionTransform(ze){return{...ze,providerInfo:{idToken:ze.providerInfo.idToken,accessToken:ze.providerInfo.accessToken,scopes:pt.normalizeScopes(ie,ze.providerInfo.scope),expiresAt:new Date(Date.now()+ze.providerInfo.expiresInSeconds*1e3)}}}}),Re=new Qe({connector:xe,defaultScopes:new Set(F),sessionScopes:ze=>ze.providerInfo.scopes,sessionShouldRefresh:ze=>(ze.providerInfo.expiresAt.getTime()-Date.now())/1e3<60*5});return new pt({sessionManager:Re,scopeTransform:ie})}async signIn(){await this.getAccessToken()}async signOut(){await this.sessionManager.removeSession()}sessionState$(){return this.sessionManager.sessionState$()}async getAccessToken(t,s){const a=pt.normalizeScopes(this.scopeTransform,t),h=await this.sessionManager.getSession({...s,scopes:a});var w;return(w=h==null?void 0:h.providerInfo.accessToken)!==null&&w!==void 0?w:""}async getIdToken(t={}){const s=await this.sessionManager.getSession({...t,scopes:new Set(["openid"])});var a;return(a=s==null?void 0:s.providerInfo.idToken)!==null&&a!==void 0?a:""}async getBackstageIdentity(t={}){const s=await this.sessionManager.getSession(t);return s==null?void 0:s.backstageIdentity}async getProfile(t={}){const s=await this.sessionManager.getSession(t);return s==null?void 0:s.profile}static normalizeScopes(t,s){if(!s)return new Set;const a=Array.isArray(s)?s:s.split(/[\s|,]/).filter(Boolean);return new Set(t(a))}constructor(t){(0,N._)(this,"sessionManager",void 0),(0,N._)(this,"scopeTransform",void 0),this.sessionManager=t.sessionManager,this.scopeTransform=t.scopeTransform}}const hn={id:"github",title:"GitHub",icon:()=>null};class pn{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:w=hn,oauthRequestApi:k,defaultScopes:F=["read:user"]}=t;return pt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:w,environment:h,defaultScopes:F})}}const fn={id:"gitlab",title:"GitLab",icon:()=>null};class qt{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:w=fn,oauthRequestApi:k,defaultScopes:F=["read_user"]}=t;return pt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:w,environment:h,defaultScopes:F})}}const Cn={id:"google",title:"Google",icon:()=>null},Kt="https://www.googleapis.com/auth/";class rn{static create(t){const{configApi:s,discoveryApi:a,oauthRequestApi:h,environment:w="development",provider:k=Cn,defaultScopes:F=["openid",`${Kt}userinfo.email`,`${Kt}userinfo.profile`]}=t;return pt.create({configApi:s,discoveryApi:a,oauthRequestApi:h,provider:k,environment:w,defaultScopes:F,scopeTransform(ie){return ie.map(xe=>xe==="openid"?xe:xe==="profile"||xe==="email"?`${Kt}userinfo.${xe}`:xe.startsWith(Kt)?xe:`${Kt}${xe}`)}})}}const En={id:"okta",title:"Okta",icon:()=>null},on=new Set(["openid","profile","email","phone","address","groups","offline_access"]),An="okta.";class Zn{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:w=En,oauthRequestApi:k,defaultScopes:F=["openid","email","profile","offline_access"]}=t;return pt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:w,environment:h,defaultScopes:F,scopeTransform(ie){return ie.map(xe=>on.has(xe)||xe.startsWith(An)?xe:`${An}${xe}`)}})}}var nt=n(30195);const sn=nt.z.object({profile:nt.z.object({email:nt.z.string().optional(),displayName:nt.z.string().optional(),picture:nt.z.string().optional()}),backstageIdentity:nt.z.object({token:nt.z.string(),identity:nt.z.object({type:nt.z.literal("user"),userEntityRef:nt.z.string(),ownershipEntityRefs:nt.z.array(nt.z.string())})})}),Yt={id:"saml",title:"SAML",icon:()=>null};class rt{static create(t){const{discoveryApi:s,environment:a="development",provider:h=Yt}=t,w=new DirectAuthConnector({discoveryApi:s,environment:a,provider:h}),k=new StaticAuthSessionManager({connector:w}),F=new AuthSessionStore({manager:k,storageKey:`${h.id}Session`,schema:samlSessionSchema});return new rt(F)}sessionState$(){return this.sessionManager.sessionState$()}async signIn(){await this.getBackstageIdentity({})}async signOut(){await this.sessionManager.removeSession()}async getBackstageIdentity(t={}){const s=await this.sessionManager.getSession(t);return s==null?void 0:s.backstageIdentity}async getProfile(t={}){const s=await this.sessionManager.getSession(t);return s==null?void 0:s.profile}constructor(t){_define_property(this,"sessionManager",void 0),this.sessionManager=t}}const Pn={id:"microsoft",title:"Microsoft",icon:()=>null};class Jt{static create(t){return new Jt(t)}microsoftGraph(){return this.oauth2[Jt.MicrosoftGraphID]}static resourceForScopes(t){const s=[...new Set(t.split(" ").map(Jt.resourceForScope).filter(w=>w!=="openid"))];if(s.length>1)return Promise.reject(new Error(`Requested access token with scopes from multiple Azure resources: ${s.join(", ")}. Access tokens can only have a single audience.`));var a;const h=(a=s[0])!==null&&a!==void 0?a:Jt.MicrosoftGraphID;return Promise.resolve(h)}static resourceForScope(t){var s;const a=(s=t.match(RegExp("^(?<resourceURI>.*)\\/(?<scp>[^\\/]*)$")))===null||s===void 0?void 0:s.groups;if(a){const{resourceURI:h}=a;return h.replace(/^api:\/\//,"")}switch(t){case"email":case"openid":case"offline_access":case"profile":return"openid";default:return Jt.MicrosoftGraphID}}async getAccessToken(t,s){const a=t===void 0?Jt.MicrosoftGraphID:await Jt.resourceForScopes(Array.isArray(t)?t.join(" "):t);return a in this.oauth2||(this.oauth2[a]=pt.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform})),this.oauth2[a].getAccessToken(t,s)}getIdToken(t){return this.microsoftGraph().getIdToken(t)}getProfile(t){return this.microsoftGraph().getProfile(t)}getBackstageIdentity(t){return this.microsoftGraph().getBackstageIdentity(t)}signIn(){return this.microsoftGraph().signIn()}signOut(){return this.microsoftGraph().signOut()}sessionState$(){return this.microsoftGraph().sessionState$()}constructor(t){(0,N._)(this,"oauth2",void 0),(0,N._)(this,"configApi",void 0),(0,N._)(this,"environment",void 0),(0,N._)(this,"provider",void 0),(0,N._)(this,"oauthRequestApi",void 0),(0,N._)(this,"discoveryApi",void 0),(0,N._)(this,"scopeTransform",void 0);const{configApi:s,environment:a="development",provider:h=Pn,oauthRequestApi:w,discoveryApi:k,defaultScopes:F=["openid","offline_access","profile","email","User.Read"],scopeTransform:ie=xe=>xe.concat("offline_access")}=t;this.configApi=s,this.environment=a,this.provider=h,this.oauthRequestApi=w,this.discoveryApi=k,this.scopeTransform=ie,this.oauth2={[Jt.MicrosoftGraphID]:pt.create({configApi:this.configApi,discoveryApi:this.discoveryApi,oauthRequestApi:this.oauthRequestApi,provider:this.provider,environment:this.environment,scopeTransform:this.scopeTransform,defaultScopes:F})}}}(0,N._)(Jt,"MicrosoftGraphID","00000003-0000-0000-c000-000000000000");const Ln={id:"onelogin",title:"onelogin",icon:()=>null},Un=new Set(["openid","profile","email","phone","address","groups","offline_access"]),On="onelogin.";class Mn{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:w=Ln,oauthRequestApi:k}=t;return pt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:w,environment:h,defaultScopes:["openid","email","profile","offline_access"],scopeTransform(F){return F.map(ie=>Un.has(ie)||ie.startsWith(On)?ie:`${On}${ie}`)}})}}const Se={id:"bitbucket",title:"Bitbucket",icon:()=>null};class ce{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:w=Se,oauthRequestApi:k,defaultScopes:F=["team"]}=t;return pt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:w,environment:h,defaultScopes:F})}}const Ie={id:"bitbucketServer",title:"Bitbucket Server",icon:()=>null};class Ue{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:w=Ie,oauthRequestApi:k,defaultScopes:F=["PROJECT_ADMIN"]}=t;return pt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:w,environment:h,defaultScopes:F})}}const Ve={id:"atlassian",title:"Atlassian",icon:()=>null};class le{static create(t){const{configApi:s,discoveryApi:a,environment:h="development",provider:w=Ve,oauthRequestApi:k}=t;return pt.create({configApi:s,discoveryApi:a,oauthRequestApi:k,provider:w,environment:h})}}class U{post(t){this.subject.next(t)}alert$(){return this.subject}constructor(){(0,N._)(this,"subject",new Le)}}class he{captureEvent(t){}}const $e="theme";class Ke{static createWithStorage(t){const s=new Ke(t);if(!window.localStorage)return s;var a;const h=(a=window.localStorage.getItem($e))!==null&&a!==void 0?a:void 0;return s.setActiveThemeId(h),s.activeThemeId$().subscribe(w=>{w?window.localStorage.setItem($e,w):window.localStorage.removeItem($e)}),window.addEventListener("storage",w=>{if(w.key===$e){var k;const F=(k=localStorage.getItem($e))!==null&&k!==void 0?k:void 0;s.setActiveThemeId(F)}}),s}getInstalledThemes(){return this.themes.slice()}activeThemeId$(){return this.subject}getActiveThemeId(){return this.activeThemeId}setActiveThemeId(t){this.activeThemeId=t,this.subject.next(t)}constructor(t){(0,N._)(this,"themes",void 0),(0,N._)(this,"activeThemeId",void 0),(0,N._)(this,"subject",void 0),this.themes=t,this.subject=new Ct(void 0)}}var Je=n(9850),Zt=n.n(Je),_t=n(12782),en=n.n(_t);const Qt=/^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i;function tn(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function _(i){if(i===null)return"null";if(Array.isArray(i))return"array";const t=typeof i;return t==="number"&&isNaN(i)?"nan":t==="string"&&i===""?"empty-string":t}const X={type(i,t,s,a){return`Invalid type in config for key '${i}' in '${t}', got ${s}, wanted ${a}`},missing(i){return`Missing required config value at '${i}'`},convert(i,t,s){return`Unable to convert config value for key '${i}' in '${t}' to a ${s}`}};class ee{static fromConfigs(t){return t.length===0?new ee(void 0):t.reduce((s,{data:a,context:h,filteredKeys:w,deprecatedKeys:k})=>{const F=new ee(a,h,s);if(F.filteredKeys=w,k)for(const{key:ie,description:xe}of k)console.warn(`The configuration key '${ie}' of ${h} is deprecated and may be removed soon. ${xe||""}`);return F},void 0)}has(t){var s;if(this.readValue(t)!==void 0)return!0;var h;return(h=(s=this.fallback)===null||s===void 0?void 0:s.has(t))!==null&&h!==void 0?h:!1}keys(){var t;const s=this.data?Object.keys(this.data):[];var a;const h=(a=(t=this.fallback)===null||t===void 0?void 0:t.keys())!==null&&a!==void 0?a:[];return[...new Set([...s,...h])]}get(t){const s=this.getOptional(t);if(s===void 0)throw new Error(X.missing(this.fullKey(t!=null?t:"")));return s}getOptional(t){var s;const a=Zt()(this.readValue(t)),h=(s=this.fallback)===null||s===void 0?void 0:s.getOptional(t);if(a===void 0){if(!1)var w;return h}else if(h===void 0)return a;return en()({},{value:h},{value:a},(k,F)=>!tn(F)||!tn(k)?F:void 0).value}getConfig(t){const s=this.getOptionalConfig(t);if(s===void 0)throw new Error(X.missing(this.fullKey(t)));return s}getOptionalConfig(t){var s;const a=this.readValue(t),h=(s=this.fallback)===null||s===void 0?void 0:s.getOptionalConfig(t);if(tn(a))return this.copy(a,t,h);if(a!==void 0)throw new TypeError(X.type(this.fullKey(t),this.context,_(a),"object"));return h}getConfigArray(t){const s=this.getOptionalConfigArray(t);if(s===void 0)throw new Error(X.missing(this.fullKey(t)));return s}getOptionalConfigArray(t){const s=this.readConfigValue(t,h=>{if(!Array.isArray(h))return{expected:"object-array"};for(const[w,k]of h.entries())if(!tn(k))return{expected:"object-array",value:k,key:`${t}[${w}]`};return!0});if(!s){if(!1)var a;return}return s.map((h,w)=>this.copy(h,`${t}[${w}]`))}getNumber(t){const s=this.getOptionalNumber(t);if(s===void 0)throw new Error(X.missing(this.fullKey(t)));return s}getOptionalNumber(t){const s=this.readConfigValue(t,h=>typeof h=="number"||typeof h=="string"||{expected:"number"});if(typeof s=="number"||s===void 0)return s;const a=Number(s);if(!Number.isFinite(a))throw new Error(X.convert(this.fullKey(t),this.context,"number"));return a}getBoolean(t){const s=this.getOptionalBoolean(t);if(s===void 0)throw new Error(X.missing(this.fullKey(t)));return s}getOptionalBoolean(t){const s=this.readConfigValue(t,h=>typeof h=="boolean"||typeof h=="number"||typeof h=="string"||{expected:"boolean"});if(typeof s=="boolean"||s===void 0)return s;const a=String(s).trim();if(/^(?:y|yes|true|1|on)$/i.test(a))return!0;if(/^(?:n|no|false|0|off)$/i.test(a))return!1;throw new Error(X.convert(this.fullKey(t),this.context,"boolean"))}getString(t){const s=this.getOptionalString(t);if(s===void 0)throw new Error(X.missing(this.fullKey(t)));return s}getOptionalString(t){return this.readConfigValue(t,s=>typeof s=="string"&&s!==""||{expected:"string"})}getStringArray(t){const s=this.getOptionalStringArray(t);if(s===void 0)throw new Error(X.missing(this.fullKey(t)));return s}getOptionalStringArray(t){return this.readConfigValue(t,s=>{if(!Array.isArray(s))return{expected:"string-array"};for(const[a,h]of s.entries())if(typeof h!="string"||h==="")return{expected:"string-array",value:h,key:`${t}[${a}]`};return!0})}fullKey(t){return`${this.prefix}${this.prefix?".":""}${t}`}copy(t,s,a){const h=new ee(t,this.context,a,this.fullKey(s));return h.filteredKeys=this.filteredKeys,h}readConfigValue(t,s){const a=this.readValue(t);if(a===void 0){var h;if(!1)var w;return(h=this.fallback)===null||h===void 0?void 0:h.readConfigValue(t,s)}const k=s(a);if(k!==!0){const{key:F=t,value:ie=a,expected:xe}=k;throw new TypeError(X.type(this.fullKey(F),this.context,_(ie),xe))}return a}readValue(t){const s=t?t.split("."):[];for(const h of s)if(!Qt.test(h))throw new TypeError(`Invalid config key '${t}'`);if(this.data===void 0)return;let a=this.data;for(const[h,w]of s.entries())if(tn(a))a=a[w];else if(a!==void 0){const k=this.fullKey(s.slice(0,h).join("."));throw new TypeError(X.type(k,this.context,_(a),"object"))}return a}constructor(t,s="mock-config",a,h=""){(0,N._)(this,"data",void 0),(0,N._)(this,"context",void 0),(0,N._)(this,"fallback",void 0),(0,N._)(this,"prefix",void 0),(0,N._)(this,"filteredKeys",void 0),(0,N._)(this,"notifiedFilteredKeys",void 0),this.data=t,this.context=s,this.fallback=a,this.prefix=h,this.notifiedFilteredKeys=new Set}}const v="Invalid discovery URL pattern,";class O{static compile(t){const s=t.split(/\{\{\s*pluginId\s*\}\}/),a=s.join("pluginId");let h;try{h=new URL(a)}catch{throw new Error(`${v} URL '${a}' is invalid`)}if(h.hash)throw new Error(`${v} URL must not have a hash`);if(h.search)throw new Error(`${v} URL must not have a query`);if(a.endsWith("/"))throw new Error(`${v} URL must not end with a slash`);return new O(s)}async getBaseUrl(t){return this.parts.join(encodeURIComponent(t))}constructor(t){(0,N._)(this,"parts",void 0),this.parts=t}}class J{post(t,s){return s!=null&&s.hidden||this.alertApi.post({message:t.message,severity:"error"}),this.errorApi.post(t,s)}error$(){return this.errorApi.error$()}constructor(t,s){(0,N._)(this,"alertApi",void 0),(0,N._)(this,"errorApi",void 0),this.alertApi=t,this.errorApi=s}}class M{post(t,s){this.subject.next({error:t,context:s})}error$(){return this.subject}constructor(){(0,N._)(this,"subject",new Le)}}class ue{static forward(t,s){window.addEventListener("unhandledrejection",a=>{t.post(a.reason,s)})}}function ye(i){if(i.length<3)throw new Error(`The '${i}' feature flag must have a minimum length of three characters.`);if(i.length>150)throw new Error(`The '${i}' feature flag must not exceed 150 characters.`);if(!i.match(/^[a-z]+[a-z0-9-]+$/))throw new Error(`The '${i}' feature flag must start with a lowercase letter and only contain lowercase letters, numbers and hyphens. Examples: feature-flag-one, alpha, release-2020`)}class Me{registerFlag(t){ye(t.name),this.registeredFeatureFlags.push(t)}getRegisteredFlags(){return this.registeredFeatureFlags.slice()}isActive(t){return this.flags||(this.flags=this.load()),this.flags.get(t)===g.CL.Active}save(t){this.flags||(this.flags=this.load()),t.merge||this.flags.clear();for(const[a,h]of Object.entries(t.states))this.flags.set(a,h);const s=Array.from(this.flags.entries()).filter(([,a])=>a===g.CL.Active);window.localStorage.setItem("featureFlags",JSON.stringify(Object.fromEntries(s)))}load(){try{const t=window.localStorage.getItem("featureFlags");if(!t)return new Map;const s=JSON.parse(t);if(typeof s!="object"||s===null||Array.isArray(s))return new Map;const a=Object.entries(s).filter(([h,w])=>(ye(h),w===g.CL.Active));return new Map(a)}catch{return new Map}}constructor(){(0,N._)(this,"registeredFeatureFlags",[]),(0,N._)(this,"flags",void 0)}}function ot(i){let t=i.baseImplementation||n.g.fetch;var s;const a=[(s=i.middleware)!==null&&s!==void 0?s:[]].flat().reverse();for(const h of a)t=h.apply(t);return{fetch:t}}class ht{static create(t){var s,a;const h=Tt(t),w=((s=t.header)===null||s===void 0?void 0:s.name)||"authorization",k=((a=t.header)===null||a===void 0?void 0:a.value)||(F=>`Bearer ${F}`);return new ht(t.identityApi,h,w,k)}apply(t){return async(s,a)=>{const h=new Request(s,a),{token:w}=await this.identityApi.getCredentials();return h.headers.get(this.headerName)||typeof w!="string"||!w||!this.allowUrl(h.url)?t(s,a):(h.headers.set(this.headerName,this.headerValue(w)),t(h))}}constructor(t,s,a,h){(0,N._)(this,"identityApi",void 0),(0,N._)(this,"allowUrl",void 0),(0,N._)(this,"headerName",void 0),(0,N._)(this,"headerValue",void 0),this.identityApi=t,this.allowUrl=s,this.headerName=a,this.headerValue=h}}function Tt(i){return i.allowUrl?i.allowUrl:i.urlPrefixAllowlist?Et(i.urlPrefixAllowlist):i.config?Et([i.config.getString("backend.baseUrl")]):()=>!1}function Et(i){const t=i.map(s=>s.replace(/\/$/,""));return s=>t.some(a=>s===a||s.startsWith(`${a}/`))}function st(i,t){return!t||t==="/"?i:`${i.replace(/\/$/,"")}/${t.replace(/^\//,"")}`}class Ne{apply(t){return async(s,a)=>{const h=new Request(s,a),w="plugin://";if(!h.url.startsWith(w))return t(s,a);const{hostname:k,pathname:F,search:ie,hash:xe,username:Re,password:ze}=new URL(`http://${h.url.substring(w.length)}`);let mt=await this.discoveryApi.getBaseUrl(k);if(Re||ze){const jt=new URL(mt),Vt=`${Re}${ze?`:${ze}`:""}@`;mt=`${jt.protocol}//${Vt}${jt.host}${jt.pathname}`}const wt=`${st(mt,F)}${ie}${xe}`;return t(wt,typeof s=="string"||Ut(s)?a:s)}}constructor(t){(0,N._)(this,"discoveryApi",void 0),this.discoveryApi=t}}function Ut(i){return typeof i=="object"&&(i==null?void 0:i.constructor)===URL}class Xt{static resolvePluginProtocol(t){return new Ne(t.discoveryApi)}static injectIdentityAuth(t){return ht.create(t)}constructor(){}}function bt(i,t){for(const s of t)if(!i.has(s))return!1;return!0}function Ft(i,...t){const s=new Set(i);for(const a of t)for(const h of a)s.add(h);return s}class gn{request(t){return new Promise((s,a)=>{this.requests.push({scopes:t,resolve:s,reject:a}),this.subject.next(this.getCurrentPending())})}resolve(t,s){this.requests=this.requests.filter(a=>bt(t,a.scopes)?(a.resolve(s),!1):!0),this.subject.next(this.getCurrentPending())}reject(t){this.requests.forEach(s=>s.reject(t)),this.requests=[],this.subject.next(this.getCurrentPending())}pending(){return this.subject}getCurrentPending(){const t=this.requests.length===0?void 0:this.requests.slice(1).reduce((s,a)=>Ft(s,a.scopes),this.requests[0].scopes);return{scopes:t,resolve:s=>{t&&this.resolve(t,s)},reject:s=>{t&&this.reject(s)}}}constructor(){(0,N._)(this,"requests",[]),(0,N._)(this,"subject",new Ct(this.getCurrentPending()))}}class wn{createAuthRequester(t){const s=new gn,a=this.handlerCount;return this.handlerCount++,s.pending().subscribe({next:h=>{const w=this.currentRequests.slice(),k=this.makeAuthRequest(h,t);k?w[a]=k:delete w[a],this.currentRequests=w,this.subject.next(w.filter(Boolean))}}),h=>s.request(h)}makeAuthRequest(t,s){const{scopes:a}=t;if(a)return{provider:s.provider,trigger:async()=>{const h=await s.onAuthRequest(a);t.resolve(h)},reject:()=>{const h=new Error("Login failed, rejected by user");h.name="RejectedError",t.reject(h)}}}authRequest$(){return this.subject}constructor(){(0,N._)(this,"subject",new Ct([])),(0,N._)(this,"currentRequests",[]),(0,N._)(this,"handlerCount",0)}}const vt=new Map;class He{static create(t){var s;return new He((s=t.namespace)!==null&&s!==void 0?s:"",t.errorApi)}static addStorageEventListener(){window.addEventListener("storage",t=>{for(const[a,h]of vt.entries()){var s;!((s=t.key)===null||s===void 0)&&s.startsWith(a)&&h.handleStorageChange(t.key)}})}get(t){return this.snapshot(t).value}snapshot(t){let s,a="absent";try{const h=localStorage.getItem(this.getKeyName(t));h&&(s=JSON.parse(h,(w,k)=>(typeof k=="object"&&k!==null&&Object.freeze(k),k)),a="present")}catch{this.errorApi.post(new Error(`Error when parsing JSON config from storage for: ${t}`))}return{key:t,value:s,presence:a}}forBucket(t){const s=`${this.namespace}/${t}`;return vt.has(s)||vt.set(s,new He(s,this.errorApi)),vt.get(s)}async set(t,s){localStorage.setItem(this.getKeyName(t),JSON.stringify(s)),this.notifyChanges(t)}async remove(t){localStorage.removeItem(this.getKeyName(t)),this.notifyChanges(t)}observe$(t){return He.hasSubscribed||(He.addStorageEventListener(),He.hasSubscribed=!0),this.observable.filter(({key:s})=>s===t)}handleStorageChange(t){if(!(t!=null&&t.startsWith(this.namespace)))return;const s=t==null?void 0:t.slice(`${this.namespace}/`.length);s.includes("/")||this.notifyChanges(decodeURIComponent(s))}getKeyName(t){return`${this.namespace}/${encodeURIComponent(t)}`}notifyChanges(t){const s=this.snapshot(t);for(const a of this.subscribers)a.next(s)}constructor(t,s){(0,N._)(this,"namespace",void 0),(0,N._)(this,"errorApi",void 0),(0,N._)(this,"subscribers",void 0),(0,N._)(this,"observable",void 0),this.namespace=t,this.errorApi=s,this.subscribers=new Set,this.observable=new(Ce())(a=>(this.subscribers.add(a),()=>{this.subscribers.delete(a)}))}}(0,N._)(He,"hasSubscribed",!1);const Lt=(0,W.createContext)(void 0);function xn(){const[i]=(0,z.is)((0,p.jsx)(z.AW,{index:!0,element:(0,p.jsx)("div",{})}));return!i.index}var nn=n(84800);const sr=(i,t)=>{try{var s;const a=(0,nn.fp)(t,{pathname:i}),h=a==null?void 0:a.filter(ie=>{var xe;return((xe=ie==null?void 0:ie.route.routeRefs)===null||xe===void 0?void 0:xe.size)>0}).pop(),w=h==null?void 0:h.route;if(!w)return;let k;w.routeRefs.size===1&&(k=w.routeRefs.values().next().value);const F=Object.entries((h==null?void 0:h.params)||{}).reduce((ie,[xe,Re])=>(Re!==void 0&&(ie[xe]=Re),ie),{});return{extension:"App",pluginId:((s=w.plugin)===null||s===void 0?void 0:s.getId())||"root",...k?{routeRef:k.id}:{},params:F}}catch{return}},mr=({pathname:i,search:t,hash:s,attributes:a})=>{const h=(0,g.z$)();return(0,W.useEffect)(()=>{h.captureEvent("navigate",`${i}${t}${s}`,{attributes:a})},[h,i,t,s,a]),null},Hn=({routeObjects:i})=>{const{pathname:t,search:s,hash:a}=(0,z.TH)(),{params:h,...w}=sr(t,i)||{params:{}};return(0,p.jsx)(g.fC,{attributes:w,children:(0,p.jsx)(mr,{pathname:t,search:s,hash:a,attributes:h})})};function cn(i){return xn()?ir(i):""}function ir(i){var t;let{pathname:s}=new URL((t=i.getOptionalString("app.baseUrl"))!==null&&t!==void 0?t:"/","http://sample.dev");return s=s.replace(/\/*$/,""),s}function Fr({component:i,appIdentityProxy:t,children:s}){const[a,h]=(0,W.useState)(),w=(0,g.h_)(g.Ds),k=cn(w);return a?(t.setTarget(a,{signOutTargetUrl:k||"/"}),(0,p.jsx)(p.Fragment,{children:s})):(0,p.jsx)(i,{onSignInSuccess:h})}function Nr(i){const{Router:t,SignInPage:s}=(0,g.qD)().getComponents(),a=(0,g.h_)(g.Ds),h=ir(a),w=`${h}/*`,k=(0,W.useContext)(Lt);if(!k)throw new Error("AppRouter must be rendered within the AppProvider");const{routeObjects:F,appIdentityProxy:ie}=k;return s?xn()?(0,p.jsxs)(t,{children:[(0,p.jsx)(Hn,{routeObjects:F}),(0,p.jsx)(Fr,{component:s,appIdentityProxy:ie,children:(0,p.jsx)(z.Z5,{children:(0,p.jsx)(z.AW,{path:w,element:(0,p.jsx)(p.Fragment,{children:i.children})})})})]}):(0,p.jsxs)(t,{basename:h,children:[(0,p.jsx)(Hn,{routeObjects:F}),(0,p.jsx)(Fr,{component:s,appIdentityProxy:ie,children:i.children})]}):(ie.setTarget({getUserId:()=>"guest",getIdToken:async()=>{},getProfile:()=>({email:"guest@example.com",displayName:"Guest"}),getProfileInfo:async()=>({email:"guest@example.com",displayName:"Guest"}),getBackstageIdentity:async()=>({type:"user",userEntityRef:"user:default/guest",ownershipEntityRefs:["user:default/guest"]}),getCredentials:async()=>({}),signOut:async()=>{}},{signOutTargetUrl:h||"/"}),xn()?(0,p.jsxs)(t,{children:[(0,p.jsx)(Hn,{routeObjects:F}),(0,p.jsx)(z.Z5,{children:(0,p.jsx)(z.AW,{path:w,element:(0,p.jsx)(p.Fragment,{children:i.children})})})]}):(0,p.jsxs)(t,{basename:h,children:[(0,p.jsx)(Hn,{routeObjects:F}),i.children]}))}var Gn=n(88412),Ar=n(50629),S=n(80956),c=n(64279);function b(i){const t={};for(const a in i.collectors)i.collectors.hasOwnProperty(a)&&(t[a]=i.collectors[a]());const s=[{node:W.Children.toArray(i.root),parent:void 0,contexts:{}}];for(;s.length!==0;){const{node:a,parent:h,contexts:w}=s.shift();W.Children.forEach(a,k=>{if(!(0,W.isValidElement)(k))return;const F={};for(const ie in t)if(t.hasOwnProperty(ie)){const xe=t[ie];F[ie]=xe.visit(xe.accumulator,k,h,w[ie])}for(const ie of i.discoverers){const xe=ie(k);xe&&s.push({node:xe,parent:k,contexts:F})}})}return Object.fromEntries(Object.entries(t).map(([a,h])=>[a,h.accumulator]))}function j(i,t){return()=>({accumulator:i(),visit:t})}function K(i){var t;return(t=i.props)===null||t===void 0?void 0:t.children}function me(i){var t,s;if(!((t=i.props)===null||t===void 0)&&t.path&&(!((s=i.props)===null||s===void 0)&&s.element)){var a;return(a=i.props)===null||a===void 0?void 0:a.element}}const we=j(()=>new Set,(i,t)=>{const s=(0,g.IY)(t,"core.plugin");s&&i.add(s)}),Fe=i=>{const{children:t}=i,s=(0,g.h_)(g.W0),a="with"in i?s.isActive(i.with):!s.isActive(i.without);return(0,p.jsx)(p.Fragment,{children:a?t:null})};(0,g.R5)(Fe,"core.featureFlagged",!0);const Xe={caseSensitive:!1,path:"*",element:"match-all",routeRefs:new Set};function Mt(i){const t=i;if(t!=null&&t.type){var s,a;return(a=(s=t.type.displayName)!==null&&s!==void 0?s:t.type.name)!==null&&a!==void 0?a:String(t.type)}return String(t)}function jn(i,t=new Array){return W.Children.forEach(i,s=>{if(!(0,W.isValidElement)(s))return;const a=(0,g.IY)(s,"core.mountPoint");if(a){const h=(0,g.IY)(s,"core.plugin");t.push({routeRef:a,plugin:h})}jn(s.props.children,t)}),t}const qn=j(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,t,s,a)=>{var h,w;if(a!=null&&a.isElementAncestor)return a;if((s==null?void 0:s.props.element)===t)return{...a,isElementAncestor:!0};const k=(h=t.props)===null||h===void 0?void 0:h.path,F=(0,g.IY)(t,"core.mountPoint");if(F&&k)throw new Error(`Path property may not be set directly on a routable extension "${Mt(t)}"`);var ie;const xe=(ie=a==null||(w=a.obj)===null||w===void 0?void 0:w.children)!==null&&ie!==void 0?ie:i.objects;if(k!==void 0){if(typeof k!="string")throw new Error(`Element path must be a string at "${Mt(t)}"`);const wt=k.startsWith("/")?k.slice(1):k,jt=t.props.element;if((0,g.IY)(t,"core.gatherMountPoints")){var Re;if(jt)throw new Error(`Mount point gatherers may not have an element prop "${Mt(t)}"`);const Vt={path:wt,element:"gathered",routeRefs:new Set,caseSensitive:Boolean((Re=t.props)===null||Re===void 0?void 0:Re.caseSensitive),children:[Xe],plugin:void 0};return xe.push(Vt),{obj:Vt,gatherPath:wt,routeRef:a==null?void 0:a.routeRef,gatherRouteRef:a==null?void 0:a.routeRef}}if(jt){var ze;const[Vt,...Wt]=jn(jt);if(Wt.length>0)throw new Error(`Route element with path "${k}" may not contain multiple routable extensions`);if(!Vt)return a;const{routeRef:Xn,plugin:fr}=Vt,Ir={path:wt,element:"mounted",routeRefs:new Set([Xn]),caseSensitive:Boolean((ze=t.props)===null||ze===void 0?void 0:ze.caseSensitive),children:[Xe],plugin:fr};return xe.push(Ir),i.paths.set(Xn,wt),i.parents.set(Xn,a==null?void 0:a.routeRef),{obj:Ir,routeRef:Xn!=null?Xn:a==null?void 0:a.routeRef,gatherPath:wt,gatherRouteRef:a==null?void 0:a.gatherRouteRef}}}if(F){var mt;if((a==null?void 0:a.gatherPath)===void 0)throw new Error(`Routable extension "${Mt(t)}" with mount point "${F}" must be assigned a path`);return a==null||(mt=a.obj)===null||mt===void 0||mt.routeRefs.add(F),i.paths.set(F,a.gatherPath),i.parents.set(F,a==null?void 0:a.gatherRouteRef),{...a,routeRef:F}}return a}),ar=j(()=>({paths:new Map,parents:new Map,objects:new Array}),(i,t,s,a)=>{var h,w,k;if((s==null?void 0:s.props.element)===t)return a;let F=a==null?void 0:a.obj,ie=a==null?void 0:a.routeRef,xe=a==null?void 0:a.sticky;const Re=(h=t.props)===null||h===void 0?void 0:h.path;var ze;const mt=(ze=F==null?void 0:F.children)!==null&&ze!==void 0?ze:i.objects,wt=Boolean((w=t.props)===null||w===void 0?void 0:w.caseSensitive);let jt=a==null?void 0:a.path;if((0,g.IY)(t,"core.gatherMountPoints")){if(!Re)throw new Error("Mount point gatherer must have a path");jt=Re}const Vt=(k=t.props)===null||k===void 0?void 0:k.element;let Wt=(0,g.IY)(t,"core.mountPoint");if(!Wt&&(0,W.isValidElement)(Vt)&&(Wt=(0,g.IY)(Vt,"core.mountPoint")),Wt){let Ir=Re;if(jt&&(Ir?jt=void 0:Ir=jt),!Ir)throw new Error("Mounted routable extension must have a path");i.paths.set(Wt,Ir),ie&&xe?(i.parents.set(Wt,ie),Re&&(ie=Wt,xe=!1)):(i.parents.set(Wt,ie),ie=Wt),Re?(F={caseSensitive:wt,path:Re,element:"mounted",routeRefs:new Set([Wt]),children:[Xe],plugin:(0,g.IY)(t.props.element,"core.plugin")},mt.push(F)):F==null||F.routeRefs.add(Wt)}if((0,g.IY)(t,"core.gatherMountPoints")&&(xe=!0),(0,g.IY)(t,"core.gatherMountPoints")){if(!Re)throw new Error("Mount point gatherer must have a path");if(!Wt){var fr;F={caseSensitive:wt,path:Re,element:"gathered",routeRefs:new Set,children:[Xe],plugin:a==null||(fr=a.obj)===null||fr===void 0?void 0:fr.plugin},mt.push(F)}}return{obj:F,path:jt,routeRef:ie,sticky:xe}}),vr=j(()=>new Set,(i,t)=>{if(t.type===Fe){const s=t.props;i.add("with"in s?s.with:s.without)}}),an=(0,at.uW)("route-ref-type",()=>Symbol("route-ref-type"));function ho(i){return i[an]==="absolute"}function qr(i){return i[an]==="sub"}function Oo(i){return i[an]==="external"}function _r(...i){const t=i.join("/").replace(/\/\/+/g,"/");return t!=="/"&&t.endsWith("/")?t.slice(0,-1):t}function po(i,t,s){let a,h="";if(ho(i))a=i;else if(qr(i))a=i.parent,h=i.path;else if(Oo(i)){const F=s.get(i);if(!F)return[void 0,""];if(ho(F))a=F;else if(qr(F))a=F.parent,h=F.path;else throw new Error(`ExternalRouteRef was bound to invalid target, ${F}`)}else throw i[an]?new Error(`Unknown or invalid route ref type, ${i[an]}`):new Error(`Unknown object passed to useRouteRef, got ${i}`);if(!a)return[void 0,""];const w=t.get(a);if(w===void 0)return[void 0,""];const k=_r(w,h);return[a,k]}function ko(i,t,s,a,h){var w;const k=(w=(0,nn.fp)(h,t))!==null&&w!==void 0?w:[],F=Array();let ie=-1;for(let ze=i;ze&&(ie=k.findIndex(mt=>mt.route.routeRefs.has(ze)),ie===-1);ze=a.get(ze))F.unshift(ze);F.length===0&&(ie-=1);const xe=ie===-1?"":k[ie].pathname,Re=F.slice(0,-1).map(ze=>{const mt=s.get(ze);if(mt===void 0)throw new Error(`No path for ${ze}`);if(mt.includes(":"))throw new Error(`Cannot route to ${i} with parent ${ze} as it has parameters`);return mt});return`${_r(xe,...Re)}/`}class vs{resolve(t,s){const[a,h]=po(t,this.routePaths,this.routeBindings);if(!a)return;let w;typeof s=="string"?w=this.trimPath(s):s.pathname?w={...s,pathname:this.trimPath(s.pathname)}:w=s;const k=this.appBasePath+ko(a,w,this.routePaths,this.routeParents,this.routeObjects);return(...[ie])=>_r(k,(0,nn.Gn)(h,ie))}trimPath(t){return t&&(t.startsWith(this.appBasePath)?t.slice(this.appBasePath.length):t)}constructor(t,s,a,h,w){(0,N._)(this,"routePaths",void 0),(0,N._)(this,"routeParents",void 0),(0,N._)(this,"routeObjects",void 0),(0,N._)(this,"routeBindings",void 0),(0,N._)(this,"appBasePath",void 0),this.routePaths=t,this.routeParents=s,this.routeObjects=a,this.routeBindings=h,this.appBasePath=w}}const Bo=(0,at.CT)("routing-context"),$o=({routePaths:i,routeParents:t,routeObjects:s,routeBindings:a,basePath:h="",children:w})=>{const k=new vs(i,t,s,a,h),F=(0,at.EI)({1:k});return(0,p.jsx)(Bo.Provider,{value:F,children:w})};function yr(i,t){const s=new Set(t.values());s.delete(void 0);for(const a of t.keys()){if(s.has(a))continue;let h=a,w="";for(;h;){const F=i.get(h);if(F===void 0)throw new Error(`No path for ${h}`);w=_r(F,w),h=t.get(h)}const k=w.match(/:(\w+)/g);if(k){for(let F=0;F<k.length;F++)for(let ie=F+1;ie<k.length;ie++)if(k[ie]===k[F])throw new Error(`Parameter ${k[ie]} is duplicated in path ${w}`)}}}function nr(i,t){for(const s of t)if(s.externalRoutes){for(const[a,h]of Object.entries(s.externalRoutes))if(!h.optional&&!i.has(h))throw new Error(`External route '${a}' of the '${s.getId()}' plugin must be bound to a target route. See https://backstage.io/link?bind-routes for details.`)}}const Lr=(0,at.CT)("app-context"),Zr=({appContext:i,children:t})=>{const s=(0,at.EI)({1:i});return(0,p.jsx)(Lr.Provider,{value:s,children:t})};function eo(i){return new Error(`Tried to access IdentityApi ${i} before app was loaded`)}function to(i){console.warn(`WARNING: Call to ${i} is deprecated and will break in the future`)}class Ur{setTarget(t,s){this.target=t,this.signOutTargetUrl=s.signOutTargetUrl,this.resolveTarget(t)}getUserId(){if(!this.target)throw eo("getUserId");if(!this.target.getUserId)throw new Error("IdentityApi does not implement getUserId");return to("getUserId"),this.target.getUserId()}getProfile(){if(!this.target)throw eo("getProfile");if(!this.target.getProfile)throw new Error("IdentityApi does not implement getProfile");return to("getProfile"),this.target.getProfile()}async getProfileInfo(){return this.waitForTarget.then(t=>t.getProfileInfo())}async getBackstageIdentity(){const t=await this.waitForTarget.then(s=>s.getBackstageIdentity());return t.userEntityRef.match(/^.*:.*\/.*$/)||console.warn(`WARNING: The App IdentityApi provided an invalid userEntityRef, '${t.userEntityRef}'. It must be a full Entity Reference of the form '<kind>:<namespace>/<name>'.`),t}async getCredentials(){return this.waitForTarget.then(t=>t.getCredentials())}async getIdToken(){return this.waitForTarget.then(t=>{if(!t.getIdToken)throw new Error("IdentityApi does not implement getIdToken");return to("getIdToken"),t.getIdToken()})}async signOut(){await this.waitForTarget.then(t=>t.signOut()),window.location.href=this.signOutTargetUrl}constructor(){(0,N._)(this,"target",void 0),(0,N._)(this,"waitForTarget",void 0),(0,N._)(this,"resolveTarget",()=>{}),(0,N._)(this,"signOutTargetUrl","/"),this.waitForTarget=new Promise(t=>{this.resolveTarget=t})}}var Do=n(72164);function fo(i,t,s){if(i!==void 0){const h=s.find(w=>w.id===i);if(h)return h}if(t){const h=s.find(w=>w.variant==="dark");if(h)return h}const a=s.find(h=>h.variant==="light");return a||s[0]}const kn=()=>{const i=(0,W.useMemo)(()=>window.matchMedia("(prefers-color-scheme: dark)"),[]),[t,s]=(0,W.useState)(i.matches);return(0,W.useEffect)(()=>{const a=h=>{s(h.matches)};return i.addListener(a),()=>{i.removeListener(a)}},[i]),t};function _n({children:i}){const t=(0,g.h_)(g.hg),s=(0,Do.Z)(t.activeThemeId$(),t.getActiveThemeId()),a=Boolean(window.matchMedia)?kn():!1,h=fo(s,a,t.getInstalledThemes());if(!h)throw new Error("App has no themes");return(0,p.jsx)(h.Provider,{children:i})}const Or=async(i="__APP_INJECTED_RUNTIME_CONFIG__")=>{const t=[{context:"app-config.yaml",data:{app:{title:"Techdocs Preview App",baseUrl:"http://localhost:3000"},backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}}}];if(!t)throw new Error("No static configuration provided");if(!Array.isArray(t))throw new Error("Static configuration has invalid format");const s=t.slice();if(i!=="__app_injected_runtime_config__".toLocaleUpperCase("en-US"))try{const h=JSON.parse(i);Array.isArray(h)?s.push(...h):s.push({data:h,context:"env"})}catch(h){throw new Error(`Failed to load runtime configuration, ${h}`)}const a=window.__APP_CONFIG__;return a&&s.push({context:"window",data:a}),s};class Mr{add(t,s){return this.apis.push([t.id,s]),s}build(){return new Tr(new Map(this.apis))}constructor(){(0,N._)(this,"apis",[])}}class Tr{static builder(){return new Mr}static from(t){return new Tr(new Map(t.map(([s,a])=>[s.id,a])))}static with(t,s){return new Tr(new Map([[t.id,s]]))}with(t,s){return new Tr(new Map([...this.apis,[t.id,s]]))}get(t){return this.apis.get(t.id)}constructor(t){(0,N._)(this,"apis",void 0),this.apis=t}}function no(i){const t=new Map;return i&&i({bind:(a,h)=>{for(const[w,k]of Object.entries(h)){const F=a[w];if(!F)throw new Error(`Key ${w} is not an existing external route`);if(!k&&!F.optional)throw new Error(`External route ${w} is required but was undefined`);k&&t.set(F,k)}}}),t}function ro(i){const t=new URL(i);return t.protocol=document.location.protocol,t.hostname=document.location.hostname,t.port=document.location.port,t.toString().replace(/\/$/,"")}function Fo(i,t,s){var a;const h=Boolean(i),w=(0,c.default)(i||(()=>Promise.resolve([])));let k;if(h&&w.loading){const{Progress:xe}=t;k=(0,p.jsx)(xe,{})}else if(w.error){const{BootErrorPage:xe}=t;k=(0,p.jsx)(xe,{step:"load-config",error:w.error})}const{ThemeProvider:F=_n}=t;if(k)return{node:(0,p.jsx)(zt,{apis:Tr.with(g.hg,s),children:(0,p.jsx)(F,{children:k})})};let ie;if(!((a=w.value)===null||a===void 0)&&a.length){const xe=ee.fromConfigs(w.value),Re=xe.getOptionalString("app.baseUrl"),ze=xe.getOptionalString("backend.baseUrl");let mt=w.value;const wt={data:{},context:"relative-resolver"};if(Re&&ze){const jt=new URL(Re).origin,Vt=new URL(ze).origin;if(jt===Vt){const Wt=ro(ze);ze!==Wt&&(wt.data.backend={baseUrl:Wt})}}if(Re){const jt=ro(Re);Re!==jt&&(wt.data.app={baseUrl:jt})}Object.keys(wt.data).length&&(mt=mt.concat([wt])),ie=ee.fromConfigs(mt)}else ie=ee.fromConfigs([]);return{api:ie}}class go{getPlugins(){return this.app.getPlugins()}getSystemIcon(t){return this.app.getSystemIcon(t)}getSystemIcons(){return this.app.getSystemIcons()}getComponents(){return this.app.getComponents()}constructor(t){(0,N._)(this,"app",void 0),this.app=t}}var lr=new WeakMap;class ys{getPlugins(){return Array.from(this.plugins)}getSystemIcon(t){return this.icons[t]}getSystemIcons(){return this.icons}getComponents(){return this.components}createRoot(t){const s=this.getProvider();return()=>(0,p.jsx)(s,{children:t})}getProvider(){if((0,Gn._)(this,lr))throw new Error("app.getProvider() or app.createRoot() has already been called, and can only be called once");(0,S._)(this,lr,!0);const t=new go(this);let s=!1;return({children:h})=>{const w=(0,W.useRef)(!0),k=(0,W.useMemo)(()=>Ke.createWithStorage(this.themes),[]),{routing:F,featureFlags:ie,routeBindings:xe}=(0,W.useMemo)(()=>{const wt=b({root:h,discoverers:[K,me],collectors:{routing:xn()?ar:qn,collectedPlugins:we,featureFlags:vr}});return wt.collectedPlugins.forEach(jt=>this.plugins.add(jt)),this.verifyPlugins(this.plugins),this.getApiHolder(),{...wt,routeBindings:no(this.bindRoutes)}},[h]);s||(s=!0,yr(F.paths,F.parents),nr(xe,this.plugins));const Re=Fo(this.configLoader,this.components,k),ze="api"in Re;if(ze){const{api:wt}=Re;this.configApi=wt}if("node"in Re)return Re.node;if(ze&&w.current){w.current=!1;const wt=this.getApiHolder().get(g.W0);if(wt){for(const Wt of this.featureFlags)wt.registerFlag({...Wt,pluginId:""});for(const Wt of this.plugins.values())if("getFeatureFlags"in Wt)for(const Xn of Wt.getFeatureFlags())wt.registerFlag({name:Xn.name,pluginId:Wt.getId()});else for(const Xn of Wt.output())Xn.type==="feature-flag"&&wt.registerFlag({name:Xn.name,pluginId:Wt.getId()});const jt=wt.getRegisteredFlags(),Vt=new Set(jt.map(Wt=>Wt.name));for(const Wt of ie)Vt.has(Wt)||wt.registerFlag({name:Wt,pluginId:""})}}const{ThemeProvider:mt=_n}=this.components;return(0,p.jsx)(zt,{apis:this.getApiHolder(),children:(0,p.jsx)(Zr,{appContext:t,children:(0,p.jsx)(mt,{children:(0,p.jsx)($o,{routePaths:F.paths,routeParents:F.parents,routeObjects:F.objects,routeBindings:xe,basePath:cn(Re.api),children:(0,p.jsx)(Lt.Provider,{value:{routeObjects:F.objects,appIdentityProxy:this.appIdentityProxy},children:h})})})})})}}getRouter(){return Nr}getApiHolder(){if(this.apiHolder){for(const t of this.plugins)for(const s of t.getApis())this.apiFactoryRegistry.get(s.api)||this.apiFactoryRegistry.register("default",s);return xt.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder}this.apiFactoryRegistry.register("static",{api:g.hg,deps:{},factory:()=>Ke.createWithStorage(this.themes)}),this.apiFactoryRegistry.register("static",{api:g.Ds,deps:{},factory:()=>{if(!this.configApi)throw new Error("Tried to access config API before config was loaded");return this.configApi}}),this.apiFactoryRegistry.register("static",{api:g.$4,deps:{},factory:()=>this.appIdentityProxy}),this.apiFactoryRegistry.register("default",{api:g.W0,deps:{},factory:()=>new Me});for(const t of this.defaultApis)this.apiFactoryRegistry.register("default",t);for(const t of this.plugins)for(const s of t.getApis())if(!this.apiFactoryRegistry.register("default",s))throw new Error(`Plugin ${t.getId()} tried to register duplicate or forbidden API factory for ${s.api}`);for(const t of this.apis)if(!this.apiFactoryRegistry.register("app",t))throw new Error(`Duplicate or forbidden API factory for ${t.api} in app`);return xt.validateFactories(this.apiFactoryRegistry,this.apiFactoryRegistry.getAllApis()),this.apiHolder=new xt(this.apiFactoryRegistry),this.apiHolder}verifyPlugins(t){const s=new Set;for(const a of t){const h=a.getId();if(s.has(h))throw new Error(`Duplicate plugin found '${h}'`);s.add(h)}}constructor(t){(0,N._)(this,"apiHolder",void 0),(0,N._)(this,"configApi",void 0),(0,N._)(this,"apis",void 0),(0,N._)(this,"icons",void 0),(0,N._)(this,"plugins",void 0),(0,N._)(this,"featureFlags",void 0),(0,N._)(this,"components",void 0),(0,N._)(this,"themes",void 0),(0,N._)(this,"configLoader",void 0),(0,N._)(this,"defaultApis",void 0),(0,N._)(this,"bindRoutes",void 0),(0,N._)(this,"appIdentityProxy",new Ur),(0,N._)(this,"apiFactoryRegistry",void 0),(0,Ar._)(this,lr,{writable:!0,value:!1});var s;this.apis=(s=t.apis)!==null&&s!==void 0?s:[],this.icons=t.icons;var a;this.plugins=new Set((a=t.plugins)!==null&&a!==void 0?a:[]);var h;this.featureFlags=(h=t.featureFlags)!==null&&h!==void 0?h:[],this.components=t.components,this.themes=t.themes;var w;this.configLoader=(w=t.configLoader)!==null&&w!==void 0?w:Or;var k;this.defaultApis=(k=t.defaultApis)!==null&&k!==void 0?k:[],this.bindRoutes=t.bindRoutes,this.apiFactoryRegistry=new Dt}}function No(i){return new ys(i)}let zr=!1;const Zo=i=>{const t=(0,g.qD)(),{NotFoundErrorPage:s}=t.getComponents(),a=(0,W.useMemo)(()=>xn(),[]),w=[...(0,g.vJ)(i.children,k=>k.getElements().flatMap(F=>{let ie=F.props.path;if(ie==="")return[];var xe;ie=(xe=ie==null?void 0:ie.replace(/\/\*$/,""))!==null&&xe!==void 0?xe:"/";let Re=a?F:F.props.element;return!a&&!Re&&(Re=F,zr||(console.warn("DEPRECATION WARNING: All elements within <FlatRoutes> must be of type <Route> with an element prop. Existing usages of <Navigate key=[path] to=[to] /> should be replaced with <Route path=[path] element={<Navigate to=[to] />} />."),zr=!0)),[{path:ie,element:Re,children:F.props.children?[{path:ie==="/"?"/":"*",element:F.props.children}]:void 0}]}).sort((F,ie)=>ie.path.localeCompare(F.path)).map(F=>({...F,path:F.path==="/"?"/":`${F.path}/*`}))),{path:"*",element:(0,p.jsx)(s,{})}];return(0,z.V$)(w)},Uo=(0,g.T0)({id:"plugin.permission.api"});var er;(function(i){i.DENY="DENY",i.ALLOW="ALLOW",i.CONDITIONAL="CONDITIONAL"})(er||(er={}));function si(i,t){return i.name===t.name}function xs(i,t){return"resourceType"in i?!t||i.resourceType===t:!1}function bs(i){return i.attributes.action==="create"}function Ss(i){return i.attributes.action==="read"}function oo(i){return i.attributes.action==="update"}function Wr(i){return i.attributes.action==="delete"}function Vr(i){return{authorize:async(t,s)=>await i.authorize(t,s),authorizeConditional(t,s){const a=t;return i.authorize(a,s)}}}function Kn({name:i,attributes:t,resourceType:s}){return s?{type:"resource",name:i,attributes:t,resourceType:s}:{type:"basic",name:i,attributes:t}}var Mo=n(23054),Yn=n(96279),so=n.n(Yn),zo=n(9571);const io=nt.z.lazy(()=>nt.z.object({rule:nt.z.string(),resourceType:nt.z.string(),params:nt.z.record(nt.z.any()).optional()}).or(nt.z.object({anyOf:nt.z.array(io).nonempty()})).or(nt.z.object({allOf:nt.z.array(io).nonempty()})).or(nt.z.object({not:io}))),Wo=nt.z.object({result:nt.z.literal(er.ALLOW).or(nt.z.literal(er.DENY))}),Vo=nt.z.union([nt.z.object({result:nt.z.literal(er.ALLOW).or(nt.z.literal(er.DENY))}),nt.z.object({result:nt.z.literal(er.CONDITIONAL),pluginId:nt.z.string(),resourceType:nt.z.string(),conditions:io})]),Cs=(i,t)=>nt.z.object({items:nt.z.array(nt.z.intersection(nt.z.object({id:nt.z.string()}),i)).refine(s=>s.length===t.size&&s.every(({id:a})=>t.has(a)),{message:"Items in response do not match request"})});class Ho{async authorize(t,s){return this.makeRequest(t,Wo,s)}async authorizeConditional(t,s){return this.makeRequest(t,Vo,s)}async makeRequest(t,s,a){if(!this.enabled)return t.map(Re=>({result:er.ALLOW}));const h={items:t.map(Re=>({id:zo.Z(),...Re}))},w=await this.discovery.getBaseUrl("permission"),k=await so()(`${w}/authorize`,{method:"POST",body:JSON.stringify(h),headers:{...this.getAuthorizationHeader(a==null?void 0:a.token),"content-type":"application/json"}});if(!k.ok)throw await Mo.VL.fromResponse(k);const F=await k.json(),xe=Cs(s,new Set(h.items.map(({id:Re})=>Re))).parse(F).items.reduce((Re,ze)=>(Re[ze.id]=ze,Re),{});return h.items.map(Re=>xe[Re.id])}getAuthorizationHeader(t){return t?{Authorization:`Bearer ${t}`}:{}}constructor(t){(0,N._)(this,"enabled",void 0),(0,N._)(this,"discovery",void 0),this.discovery=t.discovery;var s;this.enabled=(s=t.config.getOptionalBoolean("permission.enabled"))!==null&&s!==void 0?s:!1}}class ao{static create(t){const{config:s,discovery:a,identity:h}=t,w=new Ho({discovery:a,config:s});return new ao(w,h)}async authorize(t){return(await this.permissionClient.authorize([t],await this.identityApi.getCredentials()))[0]}constructor(t,s){(0,N._)(this,"permissionClient",void 0),(0,N._)(this,"identityApi",void 0),this.permissionClient=t,this.identityApi=s}}var Go=n(69984);function mo(i){const t=(0,g.h_)(Uo),{data:s,error:a}=(0,Go.ZP)(i,async h=>{if(xs(h.permission)&&!h.resourceRef)return er.DENY;const{result:w}=await t.authorize(h);return w});return a?{error:a,loading:!1,allowed:!1}:s===void 0?{loading:!0,allowed:!1}:{loading:!1,allowed:s===er.ALLOW}}const vo=i=>{const{permission:t,resourceRef:s,errorComponent:a,...h}=i,w=usePermission(isResourcePermission(t)?{permission:t,resourceRef:s}:{permission:t}),k=useApp(),{NotFoundErrorPage:F}=k.getComponents();let ie=a===void 0?_jsx(F,{}):a;return w.loading?ie=null:w.allowed&&(ie=i.element),_jsx(Route,{...h,element:ie})};function ws(i){const{permission:t,resourceRef:s}=i,a=usePermission(isResourcePermission(t)?{permission:t,resourceRef:s}:{permission:t}),h=useApp();if(a.loading)return null;if(a.allowed)return _jsx(_Fragment,{children:i.children});if(i.errorPage)return _jsx(_Fragment,{children:i.errorPage});const{NotFoundErrorPage:w}=h.getComponents();return _jsx(w,{})}const js=[(0,g.ni)({api:g.NW,deps:{configApi:g.Ds},factory:({configApi:i})=>O.compile(`${i.getString("backend.baseUrl")}/api/{{ pluginId }}`)}),(0,g.ni)({api:g.$v,deps:{},factory:()=>new U}),(0,g.ni)({api:g.v_,deps:{},factory:()=>new he}),(0,g.ni)({api:g.VE,deps:{alertApi:g.$v},factory:({alertApi:i})=>{const t=new J(i,new M);return ue.forward(t,{hidden:!1}),t}}),(0,g.ni)({api:g.E6,deps:{errorApi:g.VE},factory:({errorApi:i})=>He.create({errorApi:i})}),(0,g.ni)({api:g.gP,deps:{configApi:g.Ds,identityApi:g.$4,discoveryApi:g.NW},factory:({configApi:i,identityApi:t,discoveryApi:s})=>ot({middleware:[Xt.resolvePluginProtocol({discoveryApi:s}),Xt.injectIdentityAuth({identityApi:t,config:i})]})}),(0,g.ni)({api:g.ZM,deps:{},factory:()=>new wn}),(0,g.ni)({api:g.Kp,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>rn.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.p_,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>Jt.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.F4,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>pn.create({configApi:s,discoveryApi:i,oauthRequestApi:t,defaultScopes:["read:user"],environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.D,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>Zn.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.ux,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>qt.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.gW,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>Mn.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.bq,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>ce.create({configApi:s,discoveryApi:i,oauthRequestApi:t,defaultScopes:["team"],environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:g.Km,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>Ue.create({configApi:s,discoveryApi:i,oauthRequestApi:t,defaultScopes:["REPO_READ"]})}),(0,g.ni)({api:g.uB,deps:{discoveryApi:g.NW,oauthRequestApi:g.ZM,configApi:g.Ds},factory:({discoveryApi:i,oauthRequestApi:t,configApi:s})=>le.create({configApi:s,discoveryApi:i,oauthRequestApi:t,environment:s.getOptionalString("auth.environment")})}),(0,g.ni)({api:Uo,deps:{discovery:g.NW,identity:g.$4,config:g.Ds},factory:({config:i,discovery:t,identity:s})=>ao.create({config:i,discovery:t,identity:s})})];var Ko=n(77277),ln=n(53974),Yo=n(71597);function Es({children:i}){return(0,z.GV)()?(0,p.jsx)(p.Fragment,{children:i}):(0,p.jsx)(z.VA,{children:i})}const x=()=>(0,p.jsx)(ln.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}),C=({step:i,error:t})=>{let s="";return i==="load-config"?s=`The configuration failed to load, someone should have a look at this error: ${t.message}`:i==="load-chunk"&&(s=`Lazy loaded chunk failed to load, try to reload the page: ${t.message}`),(0,p.jsx)(Es,{children:(0,p.jsx)(ln.mf,{status:"501",statusMessage:s})})},E=({error:i,resetError:t,plugin:s})=>(0,p.jsx)(ln.yu,{title:`Error in ${s==null?void 0:s.getId()}`,defaultExpanded:!0,error:i,children:(0,p.jsx)(Ko.Z,{variant:"outlined",onClick:t,children:"Retry"})}),$={Progress:ln.Ex,Router:Yo.VK,NotFoundErrorPage:x,BootErrorPage:C,ErrorBoundaryFallback:E};var Q=n(43642),ne=n(80079),re=n(90941),ve=n(32915),Ae=n(40562),Oe=n(21853),De=n(60744),Be=n(66569),tt=n(30254),ft=n(13384),qe=n(15933),We=n(58838),gt=n(86737),Ot=n(4989),bn=n(44407),Rt=n(18628),Gt=n(84219),kt=n(98685),dn=n(39781),$n=n(39412);const Rr={brokenImage:ne.Z,catalog:Rt.Z,scaffolder:ve.Z,techdocs:Ae.Z,search:Oe.Z,chat:De.Z,dashboard:Be.Z,docs:tt.Z,email:ft.Z,github:We.Z,group:Gt.Z,help:gt.Z,"kind:api":qe.Z,"kind:component":bn.Z,"kind:domain":Q.Z,"kind:group":Gt.Z,"kind:location":Ot.Z,"kind:system":re.Z,"kind:user":kt.Z,"kind:resource":$n.Z,user:kt.Z,warning:dn.Z};var cr=n(73689),Hr=n(4707);function Nn(i,t){if(!t||typeof t=="string")return;const s=typeof t=="function"?t(i):t;if(s)return{"@global":s}}function zn(i,t){if(!(!t||typeof t=="string"))return typeof t=="object"?Object.fromEntries(Object.entries(t).map(([s,a])=>typeof a=="function"?[s,a({theme:i})]:[s,a])):t}const xr=/^&.Mui-([\w-]+)$/;function ii(i){let t=i;if(!i||typeof i!="object")return t;for(const s of Object.keys(i)){const a=i[s];if(!(!a||typeof a!="object"))for(const h of Object.keys(a)){const w=h,k=w.match(xr);if(k){const[,F]=k,{[w]:ie,...xe}=a;ie&&(t={...t,[s]:xe,[F]:ie})}}}return t}function As(i,t={}){const s={},a={};for(const h of Object.keys(t)){const w=t[h];w&&("styleOverrides"in w&&(h==="MuiCssBaseline"?s[h]=Nn(i,w.styleOverrides):s[h]=ii(zn(i,w.styleOverrides))),"defaultProps"in w&&(a[h]=w.defaultProps))}return{overrides:s,props:a}}var Ts=n(47591);const kr={MuiCssBaseline:{styleOverrides:i=>({html:{height:"100%",fontFamily:i.typography.fontFamily},body:{height:"100%",fontFamily:i.typography.fontFamily,overscrollBehaviorY:"none",fontSize:"0.875rem",lineHeight:1.43},a:{color:"inherit",textDecoration:"none"}})},MuiGrid:{defaultProps:{spacing:2}},MuiSwitch:{defaultProps:{color:"primary"}},MuiTableRow:{styleOverrides:{root:({theme:i})=>({"&:nth-of-type(odd)":{backgroundColor:i.palette.background.default}}),hover:{"&:hover":{cursor:"pointer"}},head:({theme:i})=>({"&:nth-of-type(odd)":{backgroundColor:i.palette.background.paper}})}},MuiTableCell:{styleOverrides:{root:({theme:i})=>({wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:i.spacing(3,2,3,2.5),borderBottom:0}),sizeSmall:({theme:i})=>({padding:i.spacing(1.5,2,1.5,2.5)}),head:({theme:i})=>({wordBreak:"break-word",overflow:"hidden",color:i.palette.textSubtle,fontWeight:"normal",lineHeight:"1"})}},MuiTabs:{styleOverrides:{root:{minHeight:24}}},MuiTab:{styleOverrides:{root:({theme:i})=>({color:i.palette.link,minHeight:24,textTransform:"initial",letterSpacing:"0.07em","&:hover":{color:(0,Ts._j)(i.palette.link,.3),background:(0,Ts.$n)(i.palette.link,.95)},[i.breakpoints.up("md")]:{minWidth:120,fontSize:i.typography.pxToRem(14),fontWeight:500}}),textColorPrimary:({theme:i})=>({color:i.palette.link})}},MuiTableSortLabel:{styleOverrides:{root:{color:"inherit","&:hover":{color:"inherit"},"&:focus":{color:"inherit"},"&.Mui-active":{fontWeight:"bold",color:"inherit"}}}},MuiListItemText:{styleOverrides:{dense:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}},MuiButton:{styleOverrides:{text:{padding:void 0}}},MuiChip:{styleOverrides:{root:({theme:i})=>({backgroundColor:"#D9D9D9",marginRight:i.spacing(1),marginBottom:i.spacing(1),color:i.palette.grey[900]}),outlined:({theme:i})=>({color:i.palette.text.primary}),label:({theme:i})=>({lineHeight:i.spacing(2.5),fontWeight:i.typography.fontWeightMedium,fontSize:i.spacing(1.75)}),labelSmall:({theme:i})=>({fontSize:i.spacing(1.5)}),deleteIcon:({theme:i})=>({color:i.palette.grey[500],width:i.spacing(3),height:i.spacing(3),margin:`0 ${i.spacing(.75)} 0 -${i.spacing(.75)}`}),deleteIconSmall:({theme:i})=>({width:i.spacing(2),height:i.spacing(2),margin:`0 ${i.spacing(.5)} 0 -${i.spacing(.5)}`})}},MuiCard:{styleOverrides:{root:{display:"flex",flexDirection:"column"}}},MuiCardHeader:{styleOverrides:{root:{paddingBottom:0}}},MuiCardContent:{styleOverrides:{root:{flexGrow:1,"&:last-child":{paddingBottom:void 0}}}},MuiCardActions:{styleOverrides:{root:{justifyContent:"flex-end"}}}},dr={wave:`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='1368' height='400' fill='none'%3e%3cmask id='a' width='1368' height='401' x='0' y='0' maskUnits='userSpaceOnUse'%3e%3cpath fill='url(%23paint0_linear)' d='M437 116C223 116 112 0 112 0h1256v400c-82 0-225-21-282-109-112-175-436-175-649-175z'/%3e%3cpath fill='url(%23paint1_linear)' d='M1368 400V282C891-29 788 40 711 161 608 324 121 372 0 361v39h1368z'/%3e%3cpath fill='url(%23paint2_linear)' d='M1368 244v156H0V94c92-24 198-46 375 0l135 41c176 51 195 109 858 109z'/%3e%3cpath fill='url(%23paint3_linear)' d='M1252 400h116c-14-7-35-14-116-16-663-14-837-128-1013-258l-85-61C98 28 46 8 0 0v400h1252z'/%3e%3c/mask%3e%3cg mask='url(%23a)'%3e%3cpath fill='white' d='M-172-98h1671v601H-172z'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient id='paint0_linear' x1='602' x2='1093.5' y1='-960.5' y2='272' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint1_linear' x1='482' x2='480' y1='1058.5' y2='70.5' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint2_linear' x1='424' x2='446.1' y1='-587.5' y2='274.6' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint3_linear' x1='587' x2='349' y1='-1120.5' y2='341' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")`,wave2:`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='1368' height='400' fill='none'%3e%3cmask id='a' width='1764' height='479' x='-229' y='-6' maskUnits='userSpaceOnUse'%3e%3cpath fill='url(%23paint0_linear)' d='M0 400h1350C1321 336 525 33 179-2c-345-34-395 236-408 402H0z'/%3e%3cpath fill='url(%23paint1_linear)' d='M1378 177v223H0V217s219 75 327 52C436 246 717-35 965 45s254 144 413 132z'/%3e%3cpath fill='url(%23paint2_linear)' d='M26 400l-78-16c-170 205-44-6-137-30l-4-1 4 1 137 30c37-45 89-110 159-201 399-514-45 238 1176-50 275-65 354-39 91 267H26z'/%3e%3c/mask%3e%3cg mask='url(%23a)'%3e%3cpath fill='white' d='M0 0h1368v400H0z'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient id='paint0_linear' x1='431' x2='397.3' y1='-599' y2='372.8' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint1_linear' x1='236.5' x2='446.6' y1='-586' y2='381.5' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint2_linear' x1='851.8' x2='640.4' y1='-867.2' y2='363.7' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")`,round:`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='1368' height='400' fill='none'%3e%3cmask id='a' width='2269' height='1408' x='-610' y='-509' maskUnits='userSpaceOnUse'%3e%3ccircle cx='1212.8' cy='74.8' r='317.5' fill='url(%23paint0_linear)' transform='rotate(-52 1213 75)'/%3e%3ccircle cx='737.8' cy='445.8' r='317.5' fill='url(%23paint1_linear)' transform='rotate(-116 738 446)'/%3e%3ccircle cx='601.8' cy='52.8' r='418.6' fill='url(%23paint2_linear)' transform='rotate(-117 602 53)'/%3e%3ccircle cx='999.8' cy='364' r='389.1' fill='url(%23paint3_linear)' transform='rotate(31 1000 364)'/%3e%3cellipse cx='-109.2' cy='263.5' fill='url(%23paint4_linear)' rx='429.2' ry='465.8' transform='rotate(-85 -109 264)'/%3e%3c/mask%3e%3cg mask='url(%23a)'%3e%3cpath fill='white' d='M0 0h1368v400H0z'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient id='paint0_linear' x1='1301.2' x2='161.4' y1='-1879.7' y2='-969.6' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint1_linear' x1='826.2' x2='-313.6' y1='-1508.7' y2='-598.6' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint2_linear' x1='718.4' x2='-784.3' y1='-2524' y2='-1324.2' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint3_linear' x1='1108.2' x2='-288.6' y1='-2031.1' y2='-915.9' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint4_linear' x1='10.4' x2='-1626.5' y1='-2603.8' y2='-1399.5' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")`},ur={darkGrey:["#171717","#383838"],marineBlue:["#006D8F","#0049A1"],veryBlue:["#0027AF","#270094"],rubyRed:["#98002B","#8D1134"],toastyOrange:["#BE2200","#A41D00"],purpleSky:["#8912CA","#3E00EA"],eveningSea:["#00FFF2","#035355"],teal:["#005B4B"],pinkSea:["#C8077A","#C2297D"],greens:["#4BB8A5","#187656"]};function hr(i){const{colors:t,shape:s,options:a}=i,w=`linear-gradient(90deg, ${(t.length===1?[t[0],t[0]]:t).join(", ")})`,k=`${s}, ${w}`;var F;const ie=(F=a==null?void 0:a.fontColor)!==null&&F!==void 0?F:"#FFFFFF";return{colors:t,shape:s,backgroundImage:k,fontColor:ie}}const Rs={home:hr({colors:ur.teal,shape:dr.wave}),documentation:hr({colors:ur.pinkSea,shape:dr.wave2}),tool:hr({colors:ur.purpleSky,shape:dr.round}),service:hr({colors:ur.marineBlue,shape:dr.wave}),website:hr({colors:ur.veryBlue,shape:dr.wave}),library:hr({colors:ur.rubyRed,shape:dr.wave}),other:hr({colors:ur.darkGrey,shape:dr.wave}),app:hr({colors:ur.toastyOrange,shape:dr.wave}),apis:hr({colors:ur.teal,shape:dr.wave2}),card:hr({colors:ur.greens,shape:dr.wave})},Gr=16,ai='"Helvetica Neue", Helvetica, Roboto, Arial, sans-serif',Is="home";function Ps(i){const{palette:t,htmlFontSize:s=Gr,fontFamily:a=ai,defaultPageTheme:h=Is,pageTheme:w=Rs}=i;if(!w[h])throw new Error(`${h} is not defined in pageTheme.`);var k;return{palette:t,typography:{htmlFontSize:s,fontFamily:a,h1:{fontSize:54,fontWeight:700,marginBottom:10},h2:{fontSize:40,fontWeight:700,marginBottom:8},h3:{fontSize:32,fontWeight:700,marginBottom:6},h4:{fontWeight:700,fontSize:28,marginBottom:6},h5:{fontWeight:700,fontSize:24,marginBottom:4},h6:{fontWeight:700,fontSize:20,marginBottom:2}},page:w[h],getPageTheme:({themeId:F})=>(k=w[F])!==null&&k!==void 0?k:w[h]}}var Kr=new WeakMap;class Jo{getTheme(t){return(0,Gn._)(this,Kr).get(t)}constructor(t,s){(0,Ar._)(this,Kr,{writable:!0,value:new Map}),(0,S._)(this,Kr,new Map),t&&(0,Gn._)(this,Kr).set("v4",t),s&&(0,Gn._)(this,Kr).set("v5",s)}}function Ls(i){const t=Ps(i),s={...kr,...i.components},a=(0,Hr.Z)({...t,components:s}),h=As(a,s),w={...(0,cr.Z)(t),...h};return new Jo(w,a)}function Ua(i){const t=adaptV4Theme(i),s=createTheme(i);return new Jo(s,t)}const yo={light:{type:"light",mode:"light",background:{default:"#F8F8F8",paper:"#FFFFFF"},status:{ok:"#1DB954",warning:"#FF9800",error:"#E22134",running:"#1F5493",pending:"#FFED51",aborted:"#757575"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#1F5493"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",closeButtonColor:"#FFFFFF",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#000000",textVerySubtle:"#DDD",textSubtle:"#6E6E6E",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#2196F3",link:"#0A6EBE",gold:"#FFD600",navigation:{background:"#171717",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#181818",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}},dark:{type:"dark",mode:"dark",background:{default:"#333333",paper:"#424242"},status:{ok:"#71CF88",warning:"#FFB84D",error:"#F84C55",running:"#3488E3",pending:"#FEF071",aborted:"#9E9E9E"},bursts:{fontColor:"#FEFEFE",slackChannelText:"#ddd",backgroundColor:{default:"#7C3699"},gradient:{linear:"linear-gradient(-137deg, #4BB8A5 0%, #187656 100%)"}},primary:{main:"#9CC9FF",dark:"#82BAFD"},secondary:{main:"#FF88B2"},banner:{info:"#2E77D0",error:"#E22134",text:"#FFFFFF",link:"#000000",closeButtonColor:"#FFFFFF",warning:"#FF9800"},border:"#E6E6E6",textContrast:"#FFFFFF",textVerySubtle:"#727272",textSubtle:"#CCCCCC",highlight:"#FFFBCC",errorBackground:"#FFEBEE",warningBackground:"#F59B23",infoBackground:"#ebf5ff",errorText:"#CA001B",infoText:"#004e8a",warningText:"#000000",linkHover:"#82BAFD",link:"#9CC9FF",gold:"#FFD600",navigation:{background:"#424242",indicator:"#9BF0E1",color:"#b5b5b5",selectedColor:"#FFF",navItem:{hoverBackground:"#404040"},submenu:{background:"#404040"}},pinSidebarButton:{icon:"#404040",background:"#BDBDBD"},tabbar:{indicator:"#9BF0E1"}}},Qo={light:Ls({palette:yo.light}),dark:Ls({palette:yo.dark})};var li=n(68542);li.Z.configure(i=>`v5-${i}`);var rr=n(12536),sa=n(19219),ia=n(41547),aa=n(3493),la=n(76919),ca=n(91994);const da=(0,rr.Z)({productionPrefix:"jss4-"});function ci(i){const{children:t,theme:s,noCssBaseline:a=!1}=i,h=s.getTheme("v4"),w=s.getTheme("v5");let k;a||(k=(0,p.jsx)(ca.ZP,{}));let F=(0,p.jsxs)(p.Fragment,{children:[k,t]});return h&&(F=(0,p.jsx)(sa.ZP,{generateClassName:da,children:(0,p.jsx)(ia.Z,{theme:h,children:F})})),w&&(F=(0,p.jsx)(aa.Z,{injectFirst:!0,children:(0,p.jsx)(la.Z,{theme:w,children:F})})),F}function ua(i){var t,s;return{props:{MuiGrid:kr==null||(t=kr.MuiGrid)===null||t===void 0?void 0:t.defaultProps,MuiSwitch:kr==null||(s=kr.MuiSwitch)===null||s===void 0?void 0:s.defaultProps},...Ps(i)}}function xo(i){return As(i,kr).overrides}function di(i){const t=ua(i),s=(0,cr.Z)(t),a=xo(s);return{...s,overrides:a}}const Ma=di({palette:yo.light}),ha=di({palette:yo.dark});var ui=n(98192),Xo=n(15222);const hi=[{id:"light",title:"Light Theme",variant:"light",icon:(0,p.jsx)(Xo.Z,{}),Provider:({children:i})=>(0,p.jsx)(ci,{theme:Qo.light,children:i})},{id:"dark",title:"Dark Theme",variant:"dark",icon:(0,p.jsx)(ui.Z,{}),Provider:({children:i})=>(0,p.jsx)(ci,{theme:Qo.dark,children:i})}];function pi(i){var t,s,a,h;return No({...i,apis:(t=i==null?void 0:i.apis)!==null&&t!==void 0?t:[],bindRoutes:i==null?void 0:i.bindRoutes,components:{...$,...i==null?void 0:i.components},configLoader:i==null?void 0:i.configLoader,defaultApis:js,icons:{...Rr,...i==null?void 0:i.icons},plugins:(s=i==null?void 0:i.plugins)!==null&&s!==void 0?s:[],featureFlags:(a=i==null?void 0:i.featureFlags)!==null&&a!==void 0?a:[],themes:(h=i==null?void 0:i.themes)!==null&&h!==void 0?h:hi})}var bo=n(25271),So=n(76635);async function pr({storageApi:i}){const t=i.forBucket("settings"),s=i.forBucket("starredEntities"),a=t.snapshot("starredEntities").value;if(!(0,So.isArray)(a))return;var h;const w=new Set((h=s.snapshot("entityRefs").value)!==null&&h!==void 0?h:[]);a.filter(So.isString).map(k=>k.split(":")).filter(k=>k.length===4&&k[0]==="entity").map(([k,F,ie,xe])=>(0,bo.eE)({kind:F,namespace:ie,name:xe})).forEach(k=>w.add(k)),await s.set("entityRefs",Array.from(w)),await t.remove("starredEntities")}class qo{async toggleStarred(t){this.starredEntities.has(t)?this.starredEntities.delete(t):this.starredEntities.add(t),await this.settingsStore.set("entityRefs",Array.from(this.starredEntities))}starredEntitie$(){return this.observable}notifyChanges(){for(const t of this.subscribers)t.next(new Set(this.starredEntities))}constructor(t){(0,N._)(this,"settingsStore",void 0),(0,N._)(this,"starredEntities",void 0),(0,N._)(this,"subscribers",new Set),(0,N._)(this,"observable",new(Ce())(a=>(a.next(new Set(this.starredEntities)),this.subscribers.add(a),()=>{this.subscribers.delete(a)}))),pr(t).then(),this.settingsStore=t.storageApi.forBucket("starredEntities");var s;this.starredEntities=new Set((s=this.settingsStore.snapshot("entityRefs").value)!==null&&s!==void 0?s:[]),this.settingsStore.observe$("entityRefs").subscribe({next:a=>{var h;this.starredEntities=new Set((h=a.value)!==null&&h!==void 0?h:[]),this.notifyChanges()}})}}var _o=n(8799),Br=n(79692),Os=n(12420),Sn=n(39709),pa=n(19928);function fi(){const i=useApi(catalogApiRef),{error:t,loading:s,value:a}=useAsync(async()=>await i.getEntityFacets({facets:["kind"]}).then(w=>{var k;return((k=w.facets.kind)===null||k===void 0?void 0:k.map(F=>F.value).sort())||[]}),[i]);return{loading:s,error:t,allKinds:a!=null?a:[]}}function fa(i,t,s){let a=i;return t&&(a=a.filter(w=>t.some(k=>k.toLocaleLowerCase("en-US")===w.toLocaleLowerCase("en-US")))),s&&!i.some(w=>w.toLocaleLowerCase("en-US")===s.toLocaleLowerCase("en-US"))&&(a=a.concat([s])),a.sort().reduce((w,k)=>(w[k.toLocaleLowerCase("en-US")]=k,w),{})}const ga=(0,Br.Z)(i=>(0,Os.Z)({root:{...i.typography.h4}}));function br(i){var t;const{initialFilter:s="component",allowedKinds:a}=i,h=ga(),{allKinds:w}=useAllKinds(),{filters:k,updateFilters:F,queryParameters:{kind:ie}}=useEntityList(),xe=useMemo(()=>[ie].flat()[0],[ie]);var Re;const[ze,mt]=useState((Re=xe!=null?xe:(t=k.kind)===null||t===void 0?void 0:t.value)!==null&&Re!==void 0?Re:s);useEffect(()=>{xe&&mt(xe)},[xe]),useEffect(()=>{var jt;if(!((jt=k.kind)===null||jt===void 0)&&jt.value){var Vt;mt((Vt=k.kind)===null||Vt===void 0?void 0:Vt.value)}},[k.kind]),useEffect(()=>{F({kind:ze?new EntityKindFilter(ze):void 0})},[ze,F]);const wt=filterKinds(w,a,ze);return _jsx(Select,{input:_jsx(InputBase,{}),value:ze.toLocaleLowerCase("en-US"),onChange:jt=>mt(jt.target.value),classes:h,children:Object.keys(wt).map(jt=>_jsx(MenuItem,{value:jt,children:`${pluralize(wt[jt])}`},jt))})}var gi=n(86359),es=n(95544),mi=n(99688),Co=n(12231),wo=n(86136),$r=n(49378),ks=n(85256),ts=n(80030),ns=n(61837),Bs=n(79784),rs=n(50758),vi=n(31654),$s=n(43054),Ds=n(65759),yi=n(49280),xi=n(96641);function jo(i){const{entity:t,loading:s,error:a}=(0,xi.ce)(),{allowed:h,loading:w,error:k}=mo({permission:i,resourceRef:t?(0,bo.eE)(t):void 0});return s||w?{loading:!0,allowed:!1}:a?{loading:!1,allowed:!1,error:a}:{loading:!1,allowed:h,error:k}}const os="catalog-entity",bi=Kn({name:"catalog.entity.read",attributes:{action:"read"},resourceType:os}),Fs=Kn({name:"catalog.entity.create",attributes:{action:"create"}}),ss=Kn({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:os}),Si=Kn({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:os}),Ci=Kn({name:"catalog.location.read",attributes:{action:"read"}}),wi=Kn({name:"catalog.location.create",attributes:{action:"create"}}),Ns=Kn({name:"catalog.location.delete",attributes:{action:"delete"}}),ma=[bi,Fs,ss,Si,Ci,wi,Ns];var Eo=n(49166);function Zs(i){const{unregisterEntityOptions:t,isUnregisterAllowed:s,onUnregisterEntity:a,onClose:h}=i,w=typeof(t==null?void 0:t.disableUnregister)=="boolean";var k;const F=(k=!s||(w?!!(t!=null&&t.disableUnregister):(t==null?void 0:t.disableUnregister)==="disable"))!==null&&k!==void 0?k:!1;let ie=(0,p.jsx)(p.Fragment,{});return(t==null?void 0:t.disableUnregister)!=="hidden"&&(ie=(0,p.jsxs)(Co.Z,{onClick:()=>{h(),a()},disabled:F,children:[(0,p.jsx)(wo.Z,{children:(0,p.jsx)(Eo.Z,{fontSize:"small"})}),(0,p.jsx)($r.Z,{primary:"Unregister entity"})]})),(0,p.jsx)(p.Fragment,{children:ie})}const ji=(0,Br.Z)(i=>({button:{color:i.page.fontColor}}),{name:"PluginCatalogEntityContextMenu"});function Us(i){const{UNSTABLE_extraContextMenuItems:t,UNSTABLE_contextMenuOptions:s,onUnregisterEntity:a,onInspectEntity:h}=i,[w,k]=(0,W.useState)(),F=ji(),xe=jo(ss).allowed,Re=Vt=>{k(Vt.currentTarget)},ze=()=>{k(void 0)},mt=(0,g.h_)(g.$v),wt=(0,W.useCallback)(()=>{window.navigator.clipboard.writeText(window.location.toString()).then(()=>mt.post({message:"Copied!",severity:"info",display:"transient"}))},[mt]),jt=t&&[...t.map(Vt=>(0,p.jsxs)(Co.Z,{onClick:()=>{ze(),Vt.onClick()},children:[(0,p.jsx)(wo.Z,{children:(0,p.jsx)(Vt.Icon,{fontSize:"small"})}),(0,p.jsx)($r.Z,{primary:Vt.title})]},Vt.title)),(0,p.jsx)(ks.Z,{},"the divider is here!")];return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(ts.ZP,{title:"More",arrow:!0,children:(0,p.jsx)(ns.Z,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true","aria-expanded":!!w,role:"button",onClick:Re,"data-testid":"menu-button",className:F.button,id:"long-menu",children:(0,p.jsx)($s.Z,{})})}),(0,p.jsx)(Bs.ZP,{open:Boolean(w),onClose:ze,anchorEl:w,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},"aria-labelledby":"long-menu",children:(0,p.jsxs)(rs.Z,{autoFocusItem:Boolean(w),children:[jt,(0,p.jsx)(Zs,{unregisterEntityOptions:s,isUnregisterAllowed:xe,onUnregisterEntity:a,onClose:ze}),(0,p.jsxs)(Co.Z,{onClick:()=>{ze(),h()},children:[(0,p.jsx)(wo.Z,{children:(0,p.jsx)(vi.Z,{fontSize:"small"})}),(0,p.jsx)($r.Z,{primary:"Inspect entity"})]}),(0,p.jsxs)(Co.Z,{onClick:()=>{ze(),wt()},children:[(0,p.jsx)(wo.Z,{children:(0,p.jsx)(Ds.Z,{fontSize:"small"})}),(0,p.jsx)($r.Z,{primary:"Copy entity URL"})]})]})})]})}const Ms="plugin.catalog.entityLayoutRoute",Ao=()=>null;(0,g.R5)(Ao,Ms,!0),(0,g.R5)(Ao,"core.gatherMountPoints",!0);function zs(i){const{entity:t,title:s}=i;return(0,p.jsxs)(es.Z,{display:"inline-flex",alignItems:"center",height:"1em",maxWidth:"100%",children:[(0,p.jsx)(es.Z,{component:"span",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:s}),t&&(0,p.jsx)(Sn.LH,{entity:t})]})}function Jn(i,t,s,a){var h;const w=(h=i!=null?i:a==null?void 0:a.kind)!==null&&h!==void 0?h:"";var k;const F=(k=t!=null?t:a==null?void 0:a.metadata.namespace)!==null&&k!==void 0?k:"";var ie,xe,Re;return{headerTitle:`${(Re=(xe=(ie=a==null?void 0:a.metadata.title)!==null&&ie!==void 0?ie:s)!==null&&xe!==void 0?xe:a==null?void 0:a.metadata.name)!==null&&Re!==void 0?Re:""}${F&&F!==bo.zG?` in ${F}`:""}`,headerType:(()=>{let mt=w.toLocaleLowerCase("en-US");return a&&a.spec&&"type"in a.spec&&(mt+=" \u2014 ",mt+=a.spec.type.toLocaleLowerCase("en-US")),mt})()}}function Ei(i){var t;const{entity:s}=i,a=(0,Sn.hF)(s,bo.S4);return(0,p.jsxs)(p.Fragment,{children:[a.length>0&&(0,p.jsx)(ln.i9,{label:"Owner",value:(0,p.jsx)(Sn.rI,{entityRefs:a,defaultKind:"Group",color:"inherit"})}),((t=s.spec)===null||t===void 0?void 0:t.lifecycle)&&(0,p.jsx)(ln.i9,{label:"Lifecycle",value:s.spec.lifecycle})]})}const Ai=i=>{var t,s;const{UNSTABLE_extraContextMenuItems:a,UNSTABLE_contextMenuOptions:h,children:w,NotFoundComponent:k}=i,{kind:F,namespace:ie,name:xe}=(0,g.Oi)(Sn.wi),{entity:Re,loading:ze,error:mt}=(0,Sn.ce)(),wt=(0,z.TH)(),jt=(0,g.vJ)(w,qi=>qi.selectByComponentData({key:Ms,withStrictError:"Child of EntityLayout must be an EntityLayout.Route"}).getElements().flatMap(({props:Jr})=>{if(Re){if(Jr.if&&!Jr.if(Re))return[]}else return[];return[{path:Jr.path,title:Jr.title,children:Jr.children,tabProps:Jr.tabProps}]}),[Re]),{headerTitle:Vt,headerType:Wt}=Jn(F,ie,xe,Re),[Xn,fr]=(0,W.useState)(!1),[Ir,Ro]=(0,W.useState)(!1),Qi=(0,z.s0)(),Xi=async()=>{fr(!1),Ro(!1),Qi("/")};(0,W.useEffect)(()=>{fr(!1),Ro(!1)},[wt.pathname]);var us;return(0,p.jsxs)(ln.T3,{themeId:(us=Re==null||(t=Re.spec)===null||t===void 0||(s=t.type)===null||s===void 0?void 0:s.toString())!==null&&us!==void 0?us:"home",children:[(0,p.jsx)(ln.h4,{title:(0,p.jsx)(zs,{title:Vt,entity:Re}),pageTitleOverride:Vt,type:Wt,children:Re&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(Ei,{entity:Re}),(0,p.jsx)(Us,{UNSTABLE_extraContextMenuItems:a,UNSTABLE_contextMenuOptions:h,onUnregisterEntity:()=>fr(!0),onInspectEntity:()=>Ro(!0)})]})}),ze&&(0,p.jsx)(ln.Ex,{}),Re&&(0,p.jsx)(ln.tn,{routes:jt}),mt&&(0,p.jsx)(ln.VY,{children:(0,p.jsx)(mi.Z,{severity:"error",children:mt.toString()})}),!ze&&!mt&&!Re&&(0,p.jsx)(ln.VY,{children:k||(0,p.jsxs)(ln.GB,{title:"Entity not found",children:["There is no ",F," with the requested"," ",(0,p.jsx)(ln.rU,{to:"https://backstage.io/docs/features/software-catalog/references",children:"kind, namespace, and name"}),"."]})}),(0,p.jsx)(Sn.pp,{open:Xn,entity:Re,onConfirm:Xi,onClose:()=>fr(!1)}),(0,p.jsx)(Sn.U_,{open:Ir,entity:Re,onClose:()=>Ro(!1)})]})};Ai.Route=Ao;function va(i){const{open:t,onClose:s,onConfirm:a,entity:h}=i,[w,k]=useState(!1),F=useApi(catalogApiRef),ie=useApi(alertApiRef),xe=async()=>{k(!0);try{const Re=h.metadata.uid;await F.removeEntityByUid(Re),a()}catch(Re){assertError(Re),ie.post({message:Re.message})}finally{k(!1)}};return _jsxs(Dialog,{open:t,onClose:s,children:[_jsx(DialogTitle,{id:"responsive-dialog-title",children:"Are you sure you want to delete this entity?"}),_jsxs(DialogActions,{children:[_jsx(Button,{variant:"contained",color:"secondary",disabled:w,onClick:xe,children:"Delete"}),_jsx(Button,{onClick:s,color:"primary",children:"Cancel"})]})]})}var Yr=n(19625);function ya(i){var t,s;return(i==null||(t=i.metadata)===null||t===void 0||(s=t.annotations)===null||s===void 0?void 0:s["backstage.io/orphan"])==="true"}function za(){const i=useNavigate(),t=useRouteRef(rootRouteRef),[s,a]=useState(!1),{entity:h}=useEntity(),w=async()=>{a(!1),i(t())};return _jsxs(_Fragment,{children:[_jsx(Alert,{severity:"warning",onClick:()=>a(!0),children:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."}),_jsx(DeleteEntityDialog,{open:s,entity:h,onConfirm:w,onClose:()=>a(!1)})]})}var is=n(4791);const Ti=i=>i.error&&i.level==="error"&&i.type===ENTITY_STATUS_CATALOG_PROCESSING_TYPE;async function Ws(i,t){return{items:(await t.getEntityAncestors({entityRef:i})).items.map(h=>{var w,k;return{errors:((k=(w=h.entity.status)===null||w===void 0?void 0:w.items)!==null&&k!==void 0?k:[]).filter(Ti).map(xe=>xe.error).filter(xe=>Boolean(xe)),entity:h.entity}}).filter(h=>h.errors.length>0)}}async function xa(i,t){const s=t.apis.get(catalogApiRef);if(!s)throw new Error(`No implementation available for ${catalogApiRef}`);return(await Ws(stringifyEntityRef(i),s)).items.length>0}function as(){const{entity:i}=useEntity(),t=stringifyEntityRef(i),s=useApi(catalogApiRef),{loading:a,error:h,value:w}=useAsync(async()=>Ws(t,s),[t,s]);return h?_jsx(Box,{mb:1,children:_jsx(ResponseErrorPanel,{error:h})}):a||!w?null:_jsx(_Fragment,{children:w.items.map((k,F)=>_jsxs(Box,{mb:1,children:[stringifyEntityRef(i)!==stringifyEntityRef(k.entity)&&_jsxs(Box,{p:1,children:["The error below originates from"," ",_jsx(EntityRefLink,{entityRef:k.entity})]}),k.errors.map((ie,xe)=>_jsx(ResponseErrorPanel,{error:ie},xe))]},F))})}const Vs="core.backstage.entitySwitch",Hs=i=>null;(0,g.R5)(Hs,Vs,!0);const Gs=i=>{var t;const{entity:s,loading:a}=(0,Sn.ce)(),h=(0,g.I_)(),w=(0,g.vJ)(i.children,ie=>ie.selectByComponentData({key:Vs,withStrictError:"Child of EntitySwitch is not an EntitySwitch.Case"}).getElements().flatMap(xe=>{if(a)return[];const{if:Re,children:ze}=xe.props;return s?[{if:Re==null?void 0:Re(s,{apis:h}),children:ze}]:[{if:Re===void 0,children:ze}]}),[h,s,a]);if(w.some(ie=>typeof ie.if=="object"&&"then"in ie.if))return(0,p.jsx)(Ri,{results:w,renderMultipleMatches:i.renderMultipleMatches});if(i.renderMultipleMatches==="all"){const ie=w.filter(xe=>xe.if).map(xe=>xe.children);return ie.length===0?ls(w):(0,p.jsx)(p.Fragment,{children:ie})}var F;return(F=(t=w.find(ie=>ie.if))===null||t===void 0?void 0:t.children)!==null&&F!==void 0?F:ls(w)};function Ri({results:i,renderMultipleMatches:t}){const{loading:s,value:a}=(0,c.default)(async()=>{const h=i.map(async({if:k,children:F})=>{try{if(await k)return F}catch{}return null});if(t==="all"){const k=(await Promise.all(h)).filter(Boolean);return k.length===0?ls(i):(0,p.jsx)(p.Fragment,{children:k})}var w;return(w=(await Promise.all(h)).find(Boolean))!==null&&w!==void 0?w:ls(i)},[i]);return s||!a?null:a}function ls(i){var t,s;return(s=(t=i.filter(a=>a.if===void 0)[0])===null||t===void 0?void 0:t.children)!==null&&s!==void 0?s:null}Gs.Case=Hs;const Wa=null,ba=Sn._i.Filters,Va=Sn._i.Content;var Ha=n(85877),cs=n(15096);const Dn=(0,g.rx)({id:"catalog",apis:[(0,g.ni)({api:Sn.Ah,deps:{discoveryApi:g.NW,fetchApi:g.gP},factory:({discoveryApi:i,fetchApi:t})=>new is.MS({discoveryApi:i,fetchApi:t})}),(0,g.ni)({api:Sn.p3,deps:{storageApi:g.E6},factory:({storageApi:i})=>new qo({storageApi:i})})],routes:{catalogIndex:Yr._Z,catalogEntity:Sn.wi},externalRoutes:{createComponent:Yr.yw,viewTechDoc:Yr.jU,createFromTemplate:Yr.ql},__experimentalConfigure(i){return{...{createButtonTitle:"Create"},...i}}}),Sa=Dn.provide((0,g.P4)({name:"CatalogIndexPage",component:()=>n.e(9323).then(n.bind(n,89323)).then(i=>i.CatalogPage),mountPoint:Yr._Z})),To=Dn.provide((0,g.P4)({name:"CatalogEntityPage",component:()=>n.e(8951).then(n.bind(n,78951)).then(i=>i.CatalogEntityPage),mountPoint:Sn.wi})),Ca=Dn.provide((0,g.CO)({name:"EntityAboutCard",component:{lazy:()=>Promise.resolve().then(n.bind(n,8799)).then(i=>i.AboutCard)}})),Ks=Dn.provide((0,g.CO)({name:"EntityLinksCard",component:{lazy:()=>n.e(7750).then(n.bind(n,17750)).then(i=>i.EntityLinksCard)}})),wa=Dn.provide((0,g.CO)({name:"EntityLabelsCard",component:{lazy:()=>Promise.resolve().then(n.bind(n,85877)).then(i=>i.EntityLabelsCard)}})),ja=Dn.provide((0,g.CO)({name:"EntityHasSystemsCard",component:{lazy:()=>n.e(5458).then(n.bind(n,5458)).then(i=>i.HasSystemsCard)}})),Ii=Dn.provide((0,g.CO)({name:"EntityHasComponentsCard",component:{lazy:()=>n.e(1105).then(n.bind(n,1105)).then(i=>i.HasComponentsCard)}})),Ea=Dn.provide((0,g.CO)({name:"EntityHasSubcomponentsCard",component:{lazy:()=>n.e(2440).then(n.bind(n,82440)).then(i=>i.HasSubcomponentsCard)}})),Pi=Dn.provide((0,g.CO)({name:"EntityHasResourcesCard",component:{lazy:()=>n.e(9770).then(n.bind(n,79770)).then(i=>i.HasResourcesCard)}})),Ga=Dn.provide((0,g.CO)({name:"EntityDependsOnComponentsCard",component:{lazy:()=>n.e(9545).then(n.bind(n,19545)).then(i=>i.DependsOnComponentsCard)}})),Ka=Dn.provide((0,g.CO)({name:"EntityDependencyOfComponentsCard",component:{lazy:()=>n.e(184).then(n.bind(n,40184)).then(i=>i.DependencyOfComponentsCard)}})),Ya=Dn.provide((0,g.CO)({name:"EntityDependsOnResourcesCard",component:{lazy:()=>n.e(1032).then(n.bind(n,81032)).then(i=>i.DependsOnResourcesCard)}})),Aa=Dn.provide((0,g.CO)({name:"RelatedEntitiesCard",component:{lazy:()=>n.e(732).then(n.bind(n,732)).then(i=>i.RelatedEntitiesCard)}})),Ta=Dn.provide((0,cs.E5)({name:"CatalogSearchResultListItem",component:()=>n.e(7670).then(n.bind(n,27670)).then(i=>i.CatalogSearchResultListItem),predicate:i=>i.type==="software-catalog"}));var Li=n(32838);class Ra{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getStorageUrl(){return`${await this.discoveryApi.getBaseUrl("techdocs")}/static/docs`}async getBuilder(){return this.configApi.getString("techdocs.builder")}async getEntityDocs(t,s){const h=`${await this.getApiOrigin()}/${s}`,w=await fetch(`${h.endsWith("/")?h:`${h}/`}index.html`);if(w.status===404)throw new Error("Page not found");return w.text()}async syncEntityDocs(t){return"cached"}async getBaseUrl(t,s,a){const h=await this.getApiOrigin();return new URL(t,`${h}/${a}`).toString()}constructor({configApi:t,discoveryApi:s,identityApi:a}){(0,N._)(this,"configApi",void 0),(0,N._)(this,"discoveryApi",void 0),(0,N._)(this,"identityApi",void 0),this.configApi=t,this.discoveryApi=s,this.identityApi=a}}class Oi{async getApiOrigin(){return await this.discoveryApi.getBaseUrl("techdocs")}async getEntityMetadata(t){return{apiVersion:"backstage.io/v1alpha1",kind:"Component",metadata:{name:"local"},spec:{owner:"test",lifecycle:"experimental"}}}async getTechDocsMetadata(t){return{site_name:"Live preview environment",site_description:""}}constructor({configApi:t,discoveryApi:s,identityApi:a}){(0,N._)(this,"configApi",void 0),(0,N._)(this,"discoveryApi",void 0),(0,N._)(this,"identityApi",void 0),this.configApi=t,this.discoveryApi=s,this.identityApi=a}}const ki=[(0,g.ni)({api:G.Dl,deps:{configApi:g.Ds,discoveryApi:g.NW,identityApi:g.$4},factory:({configApi:i,discoveryApi:t,identityApi:s})=>new Ra({configApi:i,discoveryApi:t,identityApi:s})}),(0,g.ni)({api:G.gT,deps:{configApi:g.Ds,discoveryApi:g.NW,identityApi:g.$4},factory:({configApi:i,discoveryApi:t,identityApi:s})=>new Oi({configApi:i,discoveryApi:t,identityApi:s})}),(0,g.ni)({api:Li.q3,deps:{configApi:g.Ds},factory:({configApi:i})=>Li.ae.fromConfig(i)})],Ys={backend:{baseUrl:"http://localhost:3000"},techdocs:{builder:"external"}},Bi={backend:{baseUrl:"http://localhost:7007"},techdocs:{builder:"external"}};async function $i(){const i=await fetch("/.detect");return i.ok?(await i.text()).trim()==="techdocs-cli-server":!1}async function Ia(){const i=await Or(),t=await $i();return[...i,{context:"detected",data:t?Ys:Bi}]}var Di=n(58845);const Js=(0,Br.Z)({svg:{width:"auto",height:30},path:{fill:"#7df3e1"}});var Fi=()=>{const i=Js();return(0,p.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2079.95 456.05",children:(0,p.jsx)("path",{className:i.path,d:"M302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Zm241-88.84q7.94,0,17.09.17t18.12,1a139.3,139.3,0,0,1,16.74,2.57,42.78,42.78,0,0,1,13.3,5.14,64.27,64.27,0,0,1,20.54,19.89Q662,168,662,186.54q0,19.54-9.49,33.78t-27.1,21.09v.68q22.78,4.82,34.87,20.58t12.08,38.4a72.62,72.62,0,0,1-4.83,26.06,65.29,65.29,0,0,1-14.33,22.46,71.57,71.57,0,0,1-23.47,15.78q-14,6-32.28,6H478.38V126.54Zm9,105.27q28,0,40.21-9.78t12.26-29.31q0-13-4.14-20.58a29.47,29.47,0,0,0-11.4-11.66A45,45,0,0,0,597,155.17a161.2,161.2,0,0,0-20.19-1.2h-65.6v77.84Zm16.57,112.13q21.74,0,34-11.66T639.59,300q0-12-4.48-19.88a34.85,34.85,0,0,0-11.91-12.52,50.14,50.14,0,0,0-17.09-6.52,105,105,0,0,0-20-1.88H511.17v84.7Zm274.79,26.74q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58A41.19,41.19,0,0,1,705,348.56q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.08-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7T736.6,249.29H707.26q.69-16.46,6.9-27.77a52.21,52.21,0,0,1,16.57-18.35,70,70,0,0,1,23.65-10.11A125.51,125.51,0,0,1,782.86,190a168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7A41.23,41.23,0,0,1,844,213.59q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-18,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.5,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14ZM1002.07,225q-11.05-9.25-29.69-9.26-15.89,0-26.58,5.83A47.29,47.29,0,0,0,928.71,237a64.66,64.66,0,0,0-9.15,22.12A119.83,119.83,0,0,0,916.8,285a98.22,98.22,0,0,0,2.93,24,64.18,64.18,0,0,0,9.15,20.74,46.2,46.2,0,0,0,16.23,14.58q10,5.49,23.82,5.48,21.75,0,34-11.31t15-31.89h30q-4.83,32.91-24.68,50.75t-54,17.83q-20.37,0-36.07-6.52A69.86,69.86,0,0,1,907,350.11a79.92,79.92,0,0,1-15.88-28.63A118.64,118.64,0,0,1,885.73,285a129.41,129.41,0,0,1,5.18-37.21,85.63,85.63,0,0,1,15.71-30.17A73.46,73.46,0,0,1,933,197.35Q948.91,190,970,190a108.54,108.54,0,0,1,28.48,3.6,69.59,69.59,0,0,1,23.48,11.15,61,61,0,0,1,16.74,19q6.55,11.49,8.29,27.26h-30.38Q1013.11,234.21,1002.07,225Zm109.77-98.41v145l81.47-77.49h39.36l-70.77,64.46,75.95,112.82h-37.29l-61.1-92.59-27.62,25.38v67.21H1082.5V126.54Zm170.54,205.22a31.07,31.07,0,0,0,10.87,10.63,49,49,0,0,0,15.19,5.66,87.06,87.06,0,0,0,17.44,1.71,109.18,109.18,0,0,0,14.5-1,53.22,53.22,0,0,0,14-3.78,26.27,26.27,0,0,0,10.53-8q4.14-5.32,4.14-13.55,0-11.31-8.63-17.14a73.69,73.69,0,0,0-21.58-9.43q-12.94-3.6-28.13-6.52a146,146,0,0,1-28.14-8.23A58.16,58.16,0,0,1,1261,267.13q-8.64-9.6-8.63-26.75,0-13.38,6-23a49.26,49.26,0,0,1,15.53-15.61,71.76,71.76,0,0,1,21.4-8.91A99.41,99.41,0,0,1,1319,190a141.31,141.31,0,0,1,28,2.58,64.85,64.85,0,0,1,22.62,8.91,46.16,46.16,0,0,1,15.7,17.15q5.87,10.8,6.91,26.91h-29.35q-.69-8.57-4.48-14.23a29.36,29.36,0,0,0-9.67-9.08,44.16,44.16,0,0,0-12.94-5,67.68,67.68,0,0,0-14.33-1.54,87.29,87.29,0,0,0-13.29,1,45.28,45.28,0,0,0-12.26,3.6,24.49,24.49,0,0,0-9,6.86q-3.46,4.29-3.46,11.14a16.32,16.32,0,0,0,5.36,12.52,42.75,42.75,0,0,0,13.63,8.23,120,120,0,0,0,18.64,5.48q10.37,2.24,20.72,4.63,11,2.4,21.57,5.83A70.74,70.74,0,0,1,1382,284.1a44.55,44.55,0,0,1,13.12,14.23q5,8.58,5,21.26,0,16.13-6.73,26.75a52.5,52.5,0,0,1-17.61,17.14,73.89,73.89,0,0,1-24.51,9.09,146.3,146.3,0,0,1-27.1,2.57,126.24,126.24,0,0,1-28.31-3.09A69.56,69.56,0,0,1,1272,361.94a51.74,51.74,0,0,1-16.57-18.52q-6.21-11.49-6.9-27.95h29.34A32.65,32.65,0,0,0,1282.38,331.76Zm226.46-137.67v25.72h-35.56V329.88a31.37,31.37,0,0,0,.87,8.23,8.42,8.42,0,0,0,3.28,4.8,14.61,14.61,0,0,0,6.73,2.23,99.19,99.19,0,0,0,11.22.51h13.46v25.72H1486.4a105.8,105.8,0,0,1-19.5-1.55,28.65,28.65,0,0,1-13.12-5.65,24.09,24.09,0,0,1-7.42-11.66q-2.43-7.54-2.42-19.89V219.81h-30.38V194.09h30.38V140.94h29.34v53.15ZM1699.4,370.68q-7.61,4.45-21.06,4.46-11.4,0-18.12-6.34t-6.74-20.75a70.17,70.17,0,0,1-28.13,20.75,97.87,97.87,0,0,1-57.65,3.6,53.51,53.51,0,0,1-18.82-8.58,41.19,41.19,0,0,1-12.6-15.26q-4.65-9.42-4.66-22.8,0-15.09,5.18-24.69a44.92,44.92,0,0,1,13.64-15.6,62.63,62.63,0,0,1,19.33-9.09q10.88-3.08,22.27-5.14,12.07-2.4,23-3.6a128,128,0,0,0,19.16-3.43c5.53-1.48,9.89-3.65,13.12-6.51s4.83-7,4.83-12.52q0-9.6-3.62-15.43a24.94,24.94,0,0,0-9.32-8.92,38.38,38.38,0,0,0-12.78-4.11,96.54,96.54,0,0,0-14-1q-18.63,0-31.07,7t-13.46,26.57h-29.34q.67-16.46,6.9-27.77A52.21,52.21,0,0,1,1562,203.17a70,70,0,0,1,23.65-10.11,125.51,125.51,0,0,1,28.48-3.09,168.63,168.63,0,0,1,24,1.72,63.26,63.26,0,0,1,21.58,7,41.23,41.23,0,0,1,15.53,14.89q5.87,9.57,5.87,25v91q0,10.26,1.21,15.05t8.11,4.79a35.57,35.57,0,0,0,9-1.37Zm-47.64-90.87c-3.69,2.74-8.52,4.72-14.5,6s-12.26,2.27-18.82,3.07-13.17,1.71-19.85,2.73a73.7,73.7,0,0,0-17.95,4.94,32.62,32.62,0,0,0-12.94,9.73q-5,6.32-5,17.23a23.31,23.31,0,0,0,2.94,12.11,24.11,24.11,0,0,0,7.59,8,32,32,0,0,0,10.88,4.44,60.94,60.94,0,0,0,13.11,1.36q14.51,0,24.86-3.92a52.49,52.49,0,0,0,16.91-9.9,39.1,39.1,0,0,0,9.67-13,32.53,32.53,0,0,0,3.11-13.14Zm208.85,141.62q-20,21.6-62.83,21.6a122.11,122.11,0,0,1-25.37-2.74,78,78,0,0,1-23.48-8.92,54.41,54.41,0,0,1-17.43-16.11q-6.91-10-7.6-24.35h29.35a21.47,21.47,0,0,0,5,13.38,36.67,36.67,0,0,0,11.4,8.91,55.52,55.52,0,0,0,14.67,5,79.51,79.51,0,0,0,15.19,1.55q14.49,0,24.51-5A46,46,0,0,0,1840.59,401a56.53,56.53,0,0,0,9.49-21.09,117.46,117.46,0,0,0,2.94-27.09V341.19h-.7q-7.59,16.46-23,24.18a71.8,71.8,0,0,1-32.63,7.71q-20,0-34.86-7.2A72.88,72.88,0,0,1,1737,346.51a82.13,82.13,0,0,1-15-28.46,116.62,116.62,0,0,1-5-34.47,133.92,133.92,0,0,1,4.14-32.4A88.17,88.17,0,0,1,1735,221a75.49,75.49,0,0,1,25.55-22.29q15.87-8.75,39-8.75a66.21,66.21,0,0,1,31.07,7.38,52.13,52.13,0,0,1,22.09,22.11h.35V194.09h27.61V356.28Q1880.63,399.83,1860.61,421.43Zm-37.46-79.72a47.94,47.94,0,0,0,16.4-15.78,71.89,71.89,0,0,0,9.15-22.11,106.77,106.77,0,0,0,2.93-24.69,96.71,96.71,0,0,0-2.76-23,64,64,0,0,0-8.8-20.4,45.76,45.76,0,0,0-15.71-14.57q-9.66-5.49-23.47-5.49-14.16,0-24.17,5.32a46.77,46.77,0,0,0-16.4,14.23,60.14,60.14,0,0,0-9.32,20.57,99.69,99.69,0,0,0-2.93,24.35,120.63,120.63,0,0,0,2.42,24,67.5,67.5,0,0,0,8.28,21.77,46.37,46.37,0,0,0,15.54,15.78q9.66,6,24.16,6T1823.15,341.71Zm228,18.34q-20,15.09-50.41,15.09-21.4,0-37.11-6.86a73.16,73.16,0,0,1-26.41-19.2,81.52,81.52,0,0,1-16-29.49,141.12,141.12,0,0,1-6-37.38,106.1,106.1,0,0,1,6.21-37A88.56,88.56,0,0,1,1938.8,216a79.09,79.09,0,0,1,26.58-19.2A81.66,81.66,0,0,1,1999,190q23.82,0,39.53,9.78a78,78,0,0,1,25.2,24.86,98.18,98.18,0,0,1,13.12,32.91,140.6,140.6,0,0,1,2.93,34h-133.6a70,70,0,0,0,2.76,22.12,49.9,49.9,0,0,0,10,18.51A49.1,49.1,0,0,0,1976.6,345q10.7,4.82,25.2,4.8,18.65,0,30.55-8.57t15.71-26.06h29Q2071.18,345,2051.17,360.05Zm-7.08-113.84a50,50,0,0,0-10.7-16,53.1,53.1,0,0,0-56.62-10.63,47.48,47.48,0,0,0-15.71,10.81,51.69,51.69,0,0,0-10.35,15.94,60.18,60.18,0,0,0-4.49,19.37h102.53A59.47,59.47,0,0,0,2044.09,246.21ZM302.9,180a80.62,80.62,0,0,0,13.44-10.37c.8-.77,1.55-1.54,2.31-2.31a81.89,81.89,0,0,0,7.92-9.37,62.37,62.37,0,0,0,6.27-10.77,48.6,48.6,0,0,0,4.36-16.4c1.49-19.39-10-38.67-35.62-54.22L198.42,14,78.16,129.22l-78.29,75,108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.69,49.69,0,0,0-6.8-8.87,89.78,89.78,0,0,0,19.28,2.15H259a85.09,85.09,0,0,0,31-5.79A80.88,80.88,0,0,0,302.9,180Zm-100.59,59.8c-19.32,18.51-50.4,21.24-75.7,5.9l-75.13-45.6,67.44-64.65,76.42,46.39C222.88,198.57,221.36,221.6,202.31,239.84Zm8.94-82.21L140.6,114.74,205,53l69.37,42.11c25.94,15.73,29.31,37.05,10.55,55A60.71,60.71,0,0,1,211.25,157.63Zm29.86,190c-19.57,18.75-46.17,29.08-74.88,29.08a123.84,123.84,0,0,1-64.11-18.19L-.13,296.51v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.85,87.85,0,0,1,241.11,347.67Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,257.52V282.2l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.79A86.86,86.86,0,0,1,241.11,308.68Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.84,123.84,0,0,1-64.11-18.19L-.13,218.54v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.12,19.68-41.49v-1.82A87.14,87.14,0,0,1,241.11,269.7Zm83.69,25.74a94.16,94.16,0,0,1-60.19,25.86h0V348a81.6,81.6,0,0,0,51.73-22.37c14-13.38,21.15-28.11,21-42.64v-2.2A95.14,95.14,0,0,1,324.8,295.44Zm-83.69,91.21c-19.57,18.75-46.17,29.09-74.88,29.09a123.76,123.76,0,0,1-64.11-18.2L-.13,335.49v24.67l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.35,87.35,0,0,1,241.11,386.65Zm85.75-210.21c-.68.69-1.35,1.38-2.06,2.05a99.19,99.19,0,0,1-22.23,15.69,94.53,94.53,0,0,1-26.24,8.71,97.84,97.84,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a52.7,52.7,0,0,1,1.13,12V231h.05A84.48,84.48,0,0,0,290,225.47a80.83,80.83,0,0,0,26.38-16.82c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,62.85,62.85,0,0,0,6.29-10.78,48.5,48.5,0,0,0,4.32-16.44c.09-1.23.2-2.47.19-3.7v-2c-.72,1-1.48,2.06-2.26,3.09A98,98,0,0,1,326.86,176.44Zm0,77.92c-.68.7-1.3,1.41-2,2.1a94.09,94.09,0,0,1-60.19,25.85h0V309h0a81.65,81.65,0,0,0,51.73-22.37,73.51,73.51,0,0,0,16.48-22.49,48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A95.81,95.81,0,0,1,326.82,254.36Zm0-39c-.68.7-1.3,1.41-2,2.1a92.22,92.22,0,0,1-10.62,8.65,93.53,93.53,0,0,1-11.63,7,95.63,95.63,0,0,1-37.94,10.18h-.05l0,26.67h0a81.63,81.63,0,0,0,51.73-22.37c.81-.77,1.51-1.56,2.27-2.34a82,82,0,0,0,7.92-9.38,63.16,63.16,0,0,0,6.29-10.77,48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7v-2.2c-.74,1.08-1.47,2.16-2.27,3.22A98.19,98.19,0,0,1,326.82,215.38Z"})})};const Ni=(0,Br.Z)({svg:{width:"auto",height:28},path:{fill:"#7df3e1"}});var Ui=()=>{const i=Ni();return(0,p.jsx)("svg",{className:i.svg,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 337.46 428.5",children:(0,p.jsx)("path",{className:i.path,d:"M303,166.05a80.69,80.69,0,0,0,13.45-10.37c.79-.77,1.55-1.53,2.3-2.3a83.12,83.12,0,0,0,7.93-9.38A63.69,63.69,0,0,0,333,133.23a48.58,48.58,0,0,0,4.35-16.4c1.49-19.39-10-38.67-35.62-54.22L198.56,0,78.3,115.23,0,190.25l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.69,19.16-18.36,25.52-42.12,13.7-61.87a49.22,49.22,0,0,0-6.8-8.87A89.17,89.17,0,0,0,259,178.29h.15a85.08,85.08,0,0,0,31-5.79A80.88,80.88,0,0,0,303,166.05ZM202.45,225.86c-19.32,18.51-50.4,21.23-75.7,5.9L51.61,186.15l67.45-64.64,76.41,46.38C223,184.58,221.49,207.61,202.45,225.86Zm8.93-82.22-70.65-42.89L205.14,39,274.51,81.1c25.94,15.72,29.31,37,10.55,55A60.69,60.69,0,0,1,211.38,143.64Zm29.86,190c-19.57,18.75-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,282.52v24.67L108.6,373.1a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A87.27,87.27,0,0,1,241.24,333.68Zm0-39c-19.57,18.75-46.17,29.08-74.88,29.08a123.81,123.81,0,0,1-64.1-18.19L0,243.53v24.68l108.6,65.91a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.81,66.42-25.69,12.88-12.34,20-27.13,19.68-41.5v-1.78A87.27,87.27,0,0,1,241.24,294.7Zm0-39c-19.57,18.76-46.17,29.09-74.88,29.09a123.81,123.81,0,0,1-64.1-18.19L0,204.55v24.68l108.6,65.91a111.59,111.59,0,0,0,57.76,16.41c24.92,0,48.8-8.8,66.42-25.68,12.88-12.35,20-27.13,19.68-41.5v-1.82A86.09,86.09,0,0,1,241.24,255.71Zm83.7,25.74a94.15,94.15,0,0,1-60.2,25.86h0V334a81.6,81.6,0,0,0,51.74-22.37c14-13.38,21.14-28.11,21-42.64v-2.19A94.92,94.92,0,0,1,324.94,281.45Zm-83.7,91.21c-19.57,18.76-46.17,29.09-74.88,29.09a123.73,123.73,0,0,1-64.1-18.2L0,321.5v24.68l108.6,65.9a111.6,111.6,0,0,0,57.76,16.42c24.92,0,48.8-8.8,66.42-25.69,12.88-12.34,20-27.13,19.68-41.49v-1.79A86.29,86.29,0,0,1,241.24,372.66ZM327,162.45c-.68.69-1.35,1.38-2.05,2.06a94.37,94.37,0,0,1-10.64,8.65,91.35,91.35,0,0,1-11.6,7,94.53,94.53,0,0,1-26.24,8.71,97.69,97.69,0,0,1-14.16,1.57c.5,1.61.9,3.25,1.25,4.9a53.27,53.27,0,0,1,1.14,12V217h.05a84.41,84.41,0,0,0,25.35-5.55,81,81,0,0,0,26.39-16.82c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,172.17a48.55,48.55,0,0,0,4.32-16.45c.09-1.23.2-2.47.19-3.7V150q-1.08,1.54-2.25,3.09A96.73,96.73,0,0,1,327,162.45Zm0,77.92c-.69.7-1.31,1.41-2,2.1a94.2,94.2,0,0,1-60.2,25.86h0l0,26.67h0a81.6,81.6,0,0,0,51.74-22.37A73.51,73.51,0,0,0,333,250.13a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.47.19-3.71v-2.19c-.74,1.07-1.46,2.15-2.27,3.21A95.68,95.68,0,0,1,327,240.37Zm0-39c-.69.7-1.31,1.41-2,2.1a93.18,93.18,0,0,1-10.63,8.65,91.63,91.63,0,0,1-11.63,7,95.47,95.47,0,0,1-37.94,10.18h0V256h0a81.65,81.65,0,0,0,51.74-22.37c.8-.77,1.5-1.56,2.26-2.34a82.08,82.08,0,0,0,7.93-9.38A63.76,63.76,0,0,0,333,211.15a48.56,48.56,0,0,0,4.32-16.44c.09-1.24.2-2.48.19-3.71v-2.2c-.74,1.08-1.46,2.16-2.27,3.22A95.68,95.68,0,0,1,327,201.39Z"})})};const Qs=(0,Br.Z)({root:{width:ln.po.drawerWidthClosed,height:3*ln.po.logoHeight,display:"flex",flexFlow:"row nowrap",alignItems:"center",marginBottom:-14},link:{width:ln.po.drawerWidthClosed,marginLeft:24}}),ds=()=>{const i=Qs(),{isOpen:t}=(0,ln.mZ)();return(0,p.jsx)("div",{className:i.root,children:(0,p.jsx)(ln.rU,{to:"/docs/default/component/local/",underline:"none",className:i.link,children:t?(0,p.jsx)(Fi,{}):(0,p.jsx)(Ui,{})})})},Xs=({children:i})=>(0,p.jsxs)(ln.tR,{children:[(0,p.jsxs)(ln.YE,{children:[(0,p.jsx)(ds,{}),(0,p.jsx)(ln.v7,{}),(0,p.jsx)(ln.R6,{icon:Di.Z,to:"/docs/default/component/local",text:"Docs Preview"})]}),i]});var Mi=n(32388),zi=n(4142);const Wi=(0,Br.Z)(i=>({headerIcon:{color:i.palette.common.white,width:"32px",height:"32px"},content:{backgroundColor:i.palette.background.default},contentToolbar:{display:"flex",justifyContent:"flex-end",padding:0}}));var Qn;(function(i){i.LIGHT="light",i.DARK="dark"})(Qn||(Qn={}));const Vi=()=>{const i=(0,g.h_)(g.hg),t=Wi(),[s,a]=(0,W.useState)(i.getActiveThemeId()===Qn.DARK?Qn.DARK:Qn.LIGHT),h={[Qn.LIGHT]:{icon:zi.Z,title:"Dark theme"},[Qn.DARK]:{icon:Mi.Z,title:"Light theme"}},{title:w,icon:k}=h[s],F=()=>{a(ie=>{const xe=ie===Qn.LIGHT?Qn.DARK:Qn.LIGHT;return i.setActiveThemeId(xe),xe})};return(0,p.jsx)(es.Z,{display:"flex",alignItems:"center",mr:2,children:(0,p.jsx)(ts.ZP,{title:w,arrow:!0,children:(0,p.jsx)(ns.Z,{size:"small",onClick:F,children:(0,p.jsx)(k,{className:t.headerIcon})})})})},Hi=()=>(0,p.jsxs)(R.I6,{children:[(0,p.jsx)(te.S,{}),(0,p.jsx)(L.F,{withSearch:!1})]}),Gi=(0,p.jsx)(Hi,{}),_s=pi({apis:ki,configLoader:Ia,plugins:Object.values(r)}),ei=_s.getProvider(),ti=_s.getRouter(),Ki=R.s4.provide((0,G.KY)({name:"ThemeToggleAddon",component:Vi,location:G.oZ.Header})),Yi=(0,p.jsxs)(Zo,{children:[(0,p.jsx)(z.Fg,{to:"/docs/default/component/local/"},"/"),(0,p.jsx)(z.AW,{path:"/catalog/:namespace/:kind/:name",element:(0,p.jsx)(To,{})}),(0,p.jsx)(z.AW,{path:"/docs",element:(0,p.jsx)(R.Jl,{}),children:(0,p.jsx)(q.u,{})}),(0,p.jsxs)(z.AW,{path:"/docs/:namespace/:kind/:name/*",element:(0,p.jsx)(R.I6,{}),children:[Gi,(0,p.jsx)(G.DR,{children:(0,p.jsx)(Ki,{})})]})]});var Ji=()=>(0,p.jsx)(ei,{children:(0,p.jsx)(ti,{children:(0,p.jsx)(Xs,{children:Yi})})});f.render((0,p.jsx)(Ji,{}),document.getElementById("root"))},51837:function(St,ke,n){"use strict";n.d(ke,{CT:function(){return g},EI:function(){return ge},uW:function(){return f},Vt:function(){return u}});function r(){return typeof window!="undefined"&&window.Math===Math?window:typeof self!="undefined"&&self.Math===Math?self:Function("return this")()}const p=r(),W=de=>`__@backstage/${de}__`;function f(de,V){const te=W(de);let L=p[te];return L||(L=V(),p[te]=L,L)}var z=n(2784);function g(de){return f(de,()=>(0,z.createContext)(void 0))}function u(de){return(0,z.useContext)(g(de))}function D(de){return{set(V){globalThis[`__@backstage/${de}__`]=createContext(createVersionedValueMap(V))},reset(){delete globalThis[`__@backstage/${de}__`]}}}function ge(de){Object.freeze(de);const V={atVersion(te){return de[te]}};return Object.defineProperty(V,"$map",{configurable:!0,enumerable:!0,get(){return de}}),V}},96641:function(St,ke,n){"use strict";n.d(ke,{X2:function(){return ge},ce:function(){return de},h$:function(){return u}});var r=n(52322),p=n(25271),W=n(60871),f=n(51837),z=n(2784);const g=(0,f.CT)("entity-context"),u=V=>{const{children:te,entity:L,loading:A,error:ae,refresh:oe}=V,se={entity:L,loading:A,error:ae,refresh:oe};return(0,r.jsx)(g.Provider,{value:(0,f.EI)({1:se}),children:(0,r.jsx)(W.fC,{attributes:{...L?{entityRef:(0,p.eE)(L)}:void 0},children:te})})},D=V=>_jsx(u,{entity:V.entity,loading:!Boolean(V.entity),error:void 0,refresh:void 0,children:V.children});function ge(){const V=(0,f.Vt)("entity-context");if(!V)throw new Error("Entity context is not available");const te=V.atVersion(1);if(!te)throw new Error("EntityContext v1 not available");if(!te.entity)throw new Error("useEntity hook is being called outside of an EntityLayout where the entity has not been loaded. If this is intentional, please use useAsyncEntity instead.");return{entity:te.entity}}function de(){const V=(0,f.Vt)("entity-context");if(!V)throw new Error("Entity context is not available");const te=V.atVersion(1);if(!te)throw new Error("EntityContext v1 not available");const{entity:L,loading:A,error:ae,refresh:oe}=te;return{entity:L,loading:A,error:ae,refresh:oe}}},39709:function(St,ke,n){"use strict";n.d(ke,{h$:function(){return et.h$},n3:function(){return r.n3},_i:function(){return H},tW:function(){return nt},df:function(){return Ke},UO:function(){return Le},ph:function(){return Yo},dq:function(){return Et},nl:function(){return Ko},dx:function(){return bt},rI:function(){return gn},u3:function(){return Gn},xE:function(){return S},sL:function(){return c},LH:function(){return Fe},U_:function(){return Kn},pp:function(){return Wo},EW:function(){return mo},Ah:function(){return W},wi:function(){return Ne},hF:function(){return G.hF},CV:function(){return G.CV},$3:function(){return tn},p3:function(){return f},ce:function(){return et.ce},X2:function(){return et.X2},wp:function(){return ct},ZW:function(){return En},eK:function(){return hn},CR:function(){return qt}});var r=n(4791),p=n(60871);const W=(0,p.T0)({id:"plugin.catalog.service"}),f=(0,p.T0)({id:"catalog-react.starred-entities"});var z=n(82394);class g{async toggleStarred(C){this.starredEntities.delete(C)||this.starredEntities.add(C);for(const E of this.subscribers)E.next(new Set(this.starredEntities))}starredEntitie$(){return this.observable}constructor(){_define_property(this,"starredEntities",new Set),_define_property(this,"subscribers",new Set),_define_property(this,"observable",new ObservableImpl(C=>(C.next(new Set(this.starredEntities)),this.subscribers.add(C),()=>{this.subscribers.delete(C)})))}}var u=n(52322),D=n(2784),ge=n(41156),de=n(60364),V=n(77277),te=n(4190),L=n(95544),A=n(90436),ae=n(60905),oe=n(36444);const se=x=>{const C=(0,ge.Z)(ne=>ne.breakpoints.down("md")),E=(0,de.Z)(),[$,Q]=(0,D.useState)(!1);return C?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(V.Z,{style:{marginTop:E.spacing(1),marginLeft:E.spacing(1)},onClick:()=>Q(!0),startIcon:(0,u.jsx)(oe.Z,{}),children:"Filters"}),(0,u.jsx)(te.ZP,{open:$,onClose:()=>Q(!1),anchor:"left",disableAutoFocus:!0,keepMounted:!0,variant:"temporary",children:(0,u.jsxs)(L.Z,{m:2,children:[(0,u.jsx)(A.Z,{variant:"h6",component:"h2",style:{marginBottom:E.spacing(1)},children:"Filters"}),x.children]})})]}):(0,u.jsx)(ae.Z,{item:!0,lg:2,children:x.children})},q=x=>(0,u.jsx)(ae.Z,{item:!0,xs:12,lg:10,children:x.children}),H=x=>(0,u.jsx)(ae.Z,{container:!0,style:{position:"relative"},children:x.children});H.Filters=se,H.Content=q;var T=n(53974),R=n(87612),P=n(25271),G=n(49280);class je{getCatalogFilters(){return{kind:this.value}}toQueryValue(){return this.value}constructor(C){(0,R._)(this,"value",void 0),this.value=C}}class Pe{getTypes(){return Array.isArray(this.value)?this.value:[this.value]}getCatalogFilters(){return{"spec.type":this.getTypes()}}toQueryValue(){return this.getTypes()}constructor(C){(0,R._)(this,"value",void 0),this.value=C}}class N{filterEntity(C){var E;return this.values.every($=>((E=C.metadata.tags)!==null&&E!==void 0?E:[]).includes($))}toQueryValue(){return this.values}constructor(C){(0,R._)(this,"values",void 0),this.values=C}}class _e{filterEntity(C){const E=this.toUpperArray(this.value.split(/\s/)),$=this.toUpperArray([C.metadata.tags]),Q=this.toUpperArray([C.metadata.name,C.metadata.title]);for(const ne of E)if($.every(re=>re!==ne)&&Q.every(re=>!re.includes(ne)))return!1;return!0}toUpperArray(C){return C.flat().filter(E=>Boolean(E)).map(E=>E.toLocaleUpperCase("en-US"))}constructor(C){_define_property(this,"value",void 0),this.value=C}}class at{filterEntity(C){return this.values.some(E=>(0,G.hF)(C,P.S4).some($=>(0,P.eE)($)===E))}toQueryValue(){return this.values}constructor(C){(0,R._)(this,"values",void 0),this.values=C.reduce((E,$)=>{try{return E.push((0,P.eE)((0,P.of)($,{defaultKind:"Group"}))),E}catch{return E}},[])}}class It{filterEntity(C){return this.values.some(E=>{var $;return(($=C.spec)===null||$===void 0?void 0:$.lifecycle)===E})}toQueryValue(){return this.values}constructor(C){(0,R._)(this,"values",void 0),this.values=C}}class zt{filterEntity(C){return this.values.some(E=>C.metadata.namespace===E)}toQueryValue(){return this.values}constructor(C){(0,R._)(this,"values",void 0),this.values=C}}class xt{filterEntity(C){switch(this.value){case"owned":return this.isOwnedEntity(C);case"starred":return this.isStarredEntity(C);default:return!0}}toQueryValue(){return this.value}constructor(C,E,$){(0,R._)(this,"value",void 0),(0,R._)(this,"isOwnedEntity",void 0),(0,R._)(this,"isStarredEntity",void 0),this.value=C,this.isOwnedEntity=E,this.isStarredEntity=$}}class Nt{filterEntity(C){var E;const $=(E=C.metadata.annotations)===null||E===void 0?void 0:E["backstage.io/orphan"];return $!==void 0&&this.value.toString()===$}constructor(C){(0,R._)(this,"value",void 0),this.value=C}}class Dt{filterEntity(C){var E,$;const Q=(C==null||(E=C.status)===null||E===void 0||($=E.items)===null||$===void 0?void 0:$.length)>0;return Q!==void 0&&this.value===Q}constructor(C){(0,R._)(this,"value",void 0),this.value=C}}var et=n(96641),lt=n(76635),yt=n(19126),At=n.n(yt),$t=n(73557),Ht=n(69294),be=n(48760),Ce=n(90736);const Ye=(0,D.createContext)(void 0),Le=x=>{const C=(0,Ce.default)(),E=(0,p.h_)(W),[$,Q]=(0,D.useState)({}),ne=(0,$t.TH)();var re;const ve=(0,D.useMemo)(()=>(re=At().parse(ne.search,{ignoreQueryPrefix:!0}).filters)!==null&&re!==void 0?re:{},[ne]),[Ae,Oe]=(0,D.useState)(()=>({appliedFilters:{},entities:[],backendEntities:[]})),[{loading:De,error:Be},tt]=(0,Ht.default)(async()=>{const We=(0,lt.compact)(Object.values($)),gt=(0,G.Gz)(We),Ot=(0,G.wq)(We),bn=(0,G.wq)((0,lt.compact)(Object.values(Ae.appliedFilters))),Rt=Object.keys($).reduce((kt,dn)=>{const $n=$[dn];return $n!=null&&$n.toQueryValue&&(kt[dn]=$n.toQueryValue()),kt},{});if((0,lt.isEqual)(bn,Ot))Oe({appliedFilters:$,backendEntities:Ae.backendEntities,entities:Ae.backendEntities.filter(gt)});else{const kt=await E.getEntities({filter:Ot});Oe({appliedFilters:$,backendEntities:kt.items,entities:kt.items.filter(gt)})}if(C()){var Gt;const kt=At().parse(ne.search,{ignoreQueryPrefix:!0}),dn=At().stringify({...kt,filters:Rt},{addQueryPrefix:!0,arrayFormat:"repeat"}),$n=`${window.location.pathname}${dn}`;(Gt=window.history)===null||Gt===void 0||Gt.replaceState(null,document.title,$n)}},[E,ve,$,Ae],{loading:!0});(0,be.Z)(tt,10,[$]);const ft=(0,D.useCallback)(We=>{Q(gt=>{const Ot=typeof We=="function"?We(gt):We;return{...gt,...Ot}})},[]),qe=(0,D.useMemo)(()=>({filters:Ae.appliedFilters,entities:Ae.entities,backendEntities:Ae.backendEntities,updateFilters:ft,queryParameters:ve,loading:De,error:Be}),[Ae,ft,ve,De,Be]);return(0,u.jsx)(Ye.Provider,{value:qe,children:x.children})};function ct(){const x=(0,D.useContext)(Ye);if(!x)throw new Error("useEntityList must be used within EntityListProvider");return x}var Ct=n(64279),dt=n(18149),Qe=n.n(dt),Ge=n(829),ut=n.n(Ge);function pt(){const x=(0,p.h_)(W),{filters:{kind:C,type:E},queryParameters:{type:$},updateFilters:Q}=ct(),ne=(0,D.useMemo)(()=>[$].flat().filter(Boolean),[$]);var re;const[ve,Ae]=(0,D.useState)(ne.length?ne:(re=E==null?void 0:E.getTypes())!==null&&re!==void 0?re:[]);(0,D.useEffect)(()=>{ne.length&&Ae(ne)},[ne]);const[Oe,De]=(0,D.useState)([]),Be=(0,D.useMemo)(()=>C==null?void 0:C.value,[C]),{error:tt,loading:ft,value:qe}=(0,Ct.default)(async()=>Be?await x.getEntityFacets({filter:{kind:Be},facets:["spec.type"]}).then(Ot=>Ot.facets["spec.type"]||[]):[],[Be,x]),We=(0,D.useRef)(qe);return(0,D.useEffect)(()=>{const gt=We.current;if(We.current=qe,ft||!Be||gt===qe||!qe)return;const Ot=[...new Set(ut()(qe,Rt=>-Rt.count).map(Rt=>Rt.value.toLocaleLowerCase("en-US")))];De(Ot);const bn=ve.filter(Rt=>Ot.includes(Rt));Qe()(ve,bn)||Ae(bn)},[ft,Be,ve,Ae,qe]),(0,D.useEffect)(()=>{Q({type:ve.length?new Pe(ve):void 0})},[ve,Q]),{loading:ft,error:tt,availableTypes:Oe,selectedTypes:ve,setSelectedTypes:Ae}}function hn(x,C){var E,$;const Q=C==null||(E=C.type)===null||E===void 0?void 0:E.toLocaleLowerCase("en-US"),ne=C==null||($=C.kind)===null||$===void 0?void 0:$.toLocaleLowerCase("en-US"),re=(0,p.h_)(W),{loading:ve,value:Ae,error:Oe}=(0,Ct.default)(async()=>{var De;const Be=(De=x.relations)===null||De===void 0?void 0:De.filter(ft=>(!Q||ft.type.toLocaleLowerCase("en-US")===Q)&&(!ne||(0,P.of)(ft.targetRef).kind===ne));if(!(Be!=null&&Be.length))return[];const{items:tt}=await re.getEntitiesByRefs({entityRefs:Be.map(ft=>ft.targetRef)});return tt.filter(ft=>Boolean(ft))},[x,Q,ne]);return{entities:Ae,loading:ve,error:Oe}}var pn=n(72164);function fn(x){return typeof x=="string"?x:(0,P.eE)(x)}function qt(){const x=(0,p.h_)(f),C=(0,pn.Z)(x.starredEntitie$(),new Set),E=(0,D.useCallback)(Q=>C.has(fn(Q)),[C]),$=(0,D.useCallback)(Q=>x.toggleStarred(fn(Q)).then(),[x]);return{starredEntities:C,toggleStarredEntity:$,isStarredEntity:E}}function Cn(x){return typeof x=="string"?x:(0,P.eE)(x)}function Kt(x){const C=(0,p.h_)(f),[E,$]=(0,D.useState)(!1);return(0,D.useEffect)(()=>{const ne=C.starredEntitie$().subscribe({next(re){$(re.has(Cn(x)))}});return()=>{ne.unsubscribe()}},[x,C]),{toggleStarredEntity:(0,D.useCallback)(()=>C.toggleStarred(Cn(x)).then(),[x,C]),isStarredEntity:E}}var rn=n(75435);function En(){const x=(0,p.h_)(p.$4),{loading:C,value:E}=(0,Ct.default)(async()=>{const{ownershipEntityRefs:Q}=await x.getBackstageIdentity();return Q},[]),$=(0,D.useMemo)(()=>{const Q=new Set(E!=null?E:[]);return ne=>{const re=(0,rn.h)(ne,P.S4).map(P.eE);for(const ve of re)if(Q.has(ve))return!0;return!1}},[E]);return(0,D.useMemo)(()=>({loading:C,isOwnedEntity:$}),[C,$])}function on(){const x=(0,p.h_)(W),{error:C,loading:E,value:$}=(0,Ct.default)(async()=>await x.getEntityFacets({facets:["kind"]}).then(ne=>{var re;return((re=ne.facets.kind)===null||re===void 0?void 0:re.map(ve=>ve.value).sort())||[]}),[x]);return{loading:E,error:C,allKinds:$!=null?$:[]}}function An(x,C,E){let $=x;return C&&($=$.filter(ne=>C.some(re=>re.toLocaleLowerCase("en-US")===ne.toLocaleLowerCase("en-US")))),E&&!x.some(ne=>ne.toLocaleLowerCase("en-US")===E.toLocaleLowerCase("en-US"))&&($=$.concat([E])),$.sort().reduce((ne,re)=>(ne[re.toLocaleLowerCase("en-US")]=re,ne),{})}function Zn(x){var C;const{filters:E,queryParameters:{kind:$},updateFilters:Q}=ct(),ne=(0,D.useMemo)(()=>[$].flat()[0],[$]);var re;const[ve,Ae]=(0,D.useState)((re=ne!=null?ne:(C=E.kind)===null||C===void 0?void 0:C.value)!==null&&re!==void 0?re:x.initialFilter);(0,D.useEffect)(()=>{ne&&Ae(ne)},[ne]),(0,D.useEffect)(()=>{var tt;if(!((tt=E.kind)===null||tt===void 0)&&tt.value){var ft;Ae((ft=E.kind)===null||ft===void 0?void 0:ft.value)}},[E.kind]),(0,D.useEffect)(()=>{Q({kind:ve?new je(ve):void 0})},[ve,Q]);const{allKinds:Oe,loading:De,error:Be}=on();return{loading:De,error:Be,allKinds:Oe!=null?Oe:[],selectedKind:ve,setSelectedKind:Ae}}const nt=x=>{const{allowedKinds:C,hidden:E,initialFilter:$="component"}=x,Q=(0,p.h_)(p.$v),{error:ne,allKinds:re,selectedKind:ve,setSelectedKind:Ae}=Zn({initialFilter:$});if((0,D.useEffect)(()=>{ne&&Q.post({message:"Failed to load entity kinds",severity:"error"})},[ne,Q]),ne)return null;const Oe=An(re,C,ve),De=Object.keys(Oe).map(Be=>({value:Be,label:Oe[Be]}));return E?null:(0,u.jsx)(L.Z,{pb:1,pt:1,children:(0,u.jsx)(T.Ph,{label:"Kind",items:De,selected:ve.toLocaleLowerCase("en-US"),onChange:Be=>Ae(String(Be))})})};var sn=n(79692),Yt=n(38016),rt=n(88013),Pn=n(21324),Jt=n(5806),Ln=n(19996),Un=n(25505);const On=(0,u.jsx)(Un.Z,{fontSize:"small"}),Mn=(0,u.jsx)(Ln.Z,{fontSize:"small"});function Se({selected:x}){return(0,u.jsx)(Pn.Z,{icon:On,checkedIcon:Mn,checked:x})}const ce=(0,D.memo)(x=>{const{selected:C,value:E,availableOptions:$,showCounts:Q}=x,ne=Q?`${E} (${$==null?void 0:$[E]})`:E;return(0,u.jsx)(Jt.Z,{control:(0,u.jsx)(Se,{selected:C}),label:ne,onClick:re=>re.preventDefault()})});var Ie=n(86619),Ue=n(72779),Ve=n.n(Ue);const le=(0,sn.Z)({input:{}},{name:"CatalogReactEntityAutocompletePickerInput"});function U(x){const C=le();return(0,u.jsx)(Ie.Z,{variant:"outlined",...x,className:Ve()(C.input,x.className)})}function he(x){var C;const{label:E,name:$,path:Q,showCounts:ne,Filter:re,InputProps:ve,initialSelectedOptions:Ae=[]}=x,{updateFilters:Oe,filters:De,queryParameters:{[$]:Be}}=ct(),tt=(0,p.h_)(W),{value:ft}=(0,Ct.default)(async()=>{var kt;const dn=Q,{facets:$n}=await tt.getEntityFacets({facets:[dn],filter:(kt=De.kind)===null||kt===void 0?void 0:kt.getCatalogFilters()});return Object.fromEntries($n[dn].map(({value:Rr,count:cr})=>[Rr,cr]))},[De.kind]),qe=(0,D.useMemo)(()=>[Be].flat().filter(Boolean),[Be]);var We;const[gt,Ot]=(0,D.useState)(qe.length?qe:(We=(C=De[$])===null||C===void 0?void 0:C.values)!==null&&We!==void 0?We:Ae);(0,D.useEffect)(()=>{qe.length&&Ot(qe)},[qe]);const bn=Object.keys(ft!=null?ft:{}),Rt=gt.length&&bn.length;(0,D.useEffect)(()=>{Oe({[$]:Rt?new re(gt):void 0})},[$,Rt,gt,re,Oe]);const Gt=De[$];return Gt&&typeof Gt=="object"&&!("values"in Gt)||!bn.length||bn.length<=1?null:(0,u.jsx)(L.Z,{pb:1,pt:1,children:(0,u.jsxs)(A.Z,{variant:"button",component:"label",children:[E,(0,u.jsx)(rt.ZP,{multiple:!0,disableCloseOnSelect:!0,options:bn,value:gt,onChange:(kt,dn)=>Ot(dn),renderOption:(kt,{selected:dn})=>(0,u.jsx)(ce,{selected:dn,value:kt,availableOptions:ft,showCounts:!!ne}),size:"small",popupIcon:(0,u.jsx)(Yt.Z,{"data-testid":`${String($)}-picker-expand`}),renderInput:kt=>(0,u.jsx)(U,{...kt,...ve})})]})})}const $e=(0,sn.Z)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),Ke=x=>{const{initialFilter:C=[]}=x,E=$e();return(0,u.jsx)(he,{label:"Lifecycle",name:"lifecycles",path:"spec.lifecycle",Filter:It,InputProps:{className:E.input},initialSelectedOptions:C})};var Je=n(6232),Zt=n(98685),_t=n(62367),en=n(72579),Qt=n.n(en);function tn(x,C){const E=C==null?void 0:C.defaultKind;let $,Q,ne;return"metadata"in x?($=x.kind,Q=x.metadata.namespace,ne=x.metadata.name):($=x.kind,Q=x.namespace,ne=x.name),(Q===void 0||Q==="")&&(Q=P.zG),(C==null?void 0:C.defaultNamespace)!==void 0?(C==null?void 0:C.defaultNamespace)===Q&&(Q=void 0):Q===P.zG&&(Q=void 0),$=$.toLocaleLowerCase("en-US"),$=E&&E.toLocaleLowerCase("en-US")===$?void 0:$,`${$?`${$}:`:""}${Q?`${Q}/`:""}${ne}`}function _(x,C){for(const E of["spec.profile.displayName","metadata.title"]){const $=Qt()(x,E);if($&&typeof $=="string")return $}return C}function X({enabled:x}){const C=(0,p.h_)(W),[E]=(0,D.useState)(async()=>{if(!x)return[];const $="relations.ownedBy";return C.getEntityFacets({facets:[$]}).then(Q=>Q.facets[$].map(ne=>ne.value).map(ne=>{const{kind:re,name:ve,namespace:Ae}=(0,P.of)(ne);return{apiVersion:"backstage.io/v1beta1",kind:re,metadata:{name:ve,namespace:Ae}}}).sort((ne,re)=>(ne.metadata.namespace||"").localeCompare(re.metadata.namespace||"","en-US")||ne.metadata.name.localeCompare(re.metadata.name,"en-US")||ne.kind.localeCompare(re.kind,"en-US"))).catch(()=>[])});return(0,Ht.default)(async($,Q)=>{const ne=await E;if(!ne)return{items:[]};var re;const ve=(re=Q==null?void 0:Q.limit)!==null&&re!==void 0?re:20,{text:Ae,start:Oe}=ee($),De=ne.filter(tt=>J(Ae,tt)),Be=Oe+ve;return{items:De.slice(0,Be),...O({entities:De,limit:Be,payload:{text:Ae,start:Be}})}},[E],{loading:!0,value:{items:[]}})}function ee(x){return v(x)&&x.cursor?JSON.parse(atob(x.cursor)):{text:x.text||"",start:0}}function v(x){return!!x.cursor}function O({entities:x,limit:C,payload:E}){return x.length>C?{cursor:btoa(JSON.stringify(E))}:{}}function J(x,C){var E;const $=x.trim();return C.kind.includes($)||((E=C.metadata.namespace)===null||E===void 0?void 0:E.includes($))||C.metadata.name.includes($)}function M(){const x=(0,p.h_)(W);return(0,Ht.default)(async(C,E)=>{const $=C,Q=C;var ne;const re=(ne=E==null?void 0:E.limit)!==null&&ne!==void 0?ne:20;if(Q.cursor){const Ae=await x.queryEntities({cursor:Q.cursor,limit:re});return{cursor:Ae.pageInfo.nextCursor,items:[...Q.items,...Ae.items]}}const ve=await x.queryEntities({fullTextFilter:{term:$.text||"",fields:["metadata.name","kind","spec.profile.displayname","metadata.title"]},filter:{kind:["User","Group"]},orderFields:[{field:"metadata.name",order:"asc"}],limit:re});return{cursor:ve.pageInfo.nextCursor,items:ve.items}},[],{loading:!0})}var ue=n(21638);function ye({mode:x,initialSelectedOwnersRefs:C}){const E=x==="owners-only",$=M(),Q=X({enabled:E}),[ne,re]=E?Q:$;return[ne,re,Me({enabled:!E,initialSelectedOwnersRefs:C})]}function Me({enabled:x,initialSelectedOwnersRefs:C}){const E=(0,D.useRef)({}),$=(0,p.h_)(W),[,Q]=(0,Ht.default)(async()=>{(await $.getEntitiesByRefs({entityRefs:C})).items.forEach(re=>{re&&(E.current[(0,P.eE)(re)]=re)})},[]);return(0,ue.n)(()=>{x&&C.length>0&&Q()}),{getEntity:ne=>E.current[ne],setEntity:ne=>{E.current[(0,P.eE)(ne)]=ne}}}const ot=(0,sn.Z)({input:{}},{name:"CatalogReactEntityOwnerPicker"}),ht=(0,u.jsx)(Un.Z,{fontSize:"small"}),Tt=(0,u.jsx)(Ln.Z,{fontSize:"small"}),Et=x=>{var C,E;const $=ot(),{mode:Q="owners-only"}=x||{},{updateFilters:ne,filters:re,queryParameters:{owners:ve}}=ct(),[Ae,Oe]=(0,D.useState)(""),De=(0,D.useMemo)(()=>[ve].flat().filter(Boolean),[ve]);var Be;const[tt,ft]=(0,D.useState)(De.length?De:(Be=(C=re.owners)===null||C===void 0?void 0:C.values)!==null&&Be!==void 0?Be:[]),[{value:qe,loading:We},gt,Ot]=ye({mode:Q,initialSelectedOwnersRefs:tt});(0,Je.b)(()=>gt({text:Ae}),[Ae,gt],250);const bn=(qe==null?void 0:qe.items)||[];return(0,D.useEffect)(()=>{if(De.length){const Rt=new at(De);ft(Rt.values)}},[De]),(0,D.useEffect)(()=>{ne({owners:tt.length?new at(tt):void 0})},[tt,ne]),["user","group"].includes(((E=re.kind)===null||E===void 0?void 0:E.value.toLocaleLowerCase("en-US"))||"")?null:(0,u.jsx)(L.Z,{pb:1,pt:1,children:(0,u.jsxs)(A.Z,{variant:"button",component:"label",children:["Owner",(0,u.jsx)(rt.ZP,{multiple:!0,disableCloseOnSelect:!0,loading:We,options:bn,value:tt,getOptionSelected:(Rt,Gt)=>typeof Gt=="string"?(0,P.eE)(Rt)===Gt:Rt===Gt,getOptionLabel:Rt=>{const Gt=typeof Rt=="string"?Ot.getEntity(Rt)||(0,P.of)(Rt,{defaultKind:"group",defaultNamespace:"default"}):Rt;return _(Gt,tn(Gt))},onChange:(Rt,Gt)=>{Oe(""),ft(Gt.map(kt=>{const dn=typeof kt=="string"?kt:(0,P.eE)(kt);return typeof kt!="string"&&Ot.setEntity(kt),dn}))},filterOptions:Rt=>Rt,renderOption:(Rt,{selected:Gt})=>{const kt=Rt.kind.toLocaleLowerCase("en-US")==="group";return(0,u.jsx)(Jt.Z,{control:(0,u.jsx)(Pn.Z,{icon:ht,checkedIcon:Tt,checked:Gt}),onClick:dn=>dn.preventDefault(),label:(0,u.jsxs)(L.Z,{display:"flex",flexWrap:"wrap",alignItems:"center",children:[kt?(0,u.jsx)(_t.Z,{fontSize:"small"}):(0,u.jsx)(Zt.Z,{fontSize:"small"}),"\xA0",_(Rt,tn(Rt,{defaultKind:Rt.kind}))]})})},size:"small",popupIcon:(0,u.jsx)(Yt.Z,{"data-testid":"owner-picker-expand"}),renderInput:Rt=>(0,u.jsx)(Ie.Z,{...Rt,className:$.input,onChange:Gt=>{Oe(Gt.currentTarget.value)},variant:"outlined"}),ListboxProps:{onScroll:Rt=>{const Gt=Rt.currentTarget;Math.abs(Gt.scrollHeight-Gt.clientHeight-Gt.scrollTop)<1&&(qe!=null&&qe.cursor)&&gt({items:qe.items,cursor:qe.cursor})},"data-testid":"owner-picker-listbox"}})]})})};var st=n(51837);const Ne=(0,st.uW)("catalog:entity-route-ref",()=>(0,p.NT)({id:"catalog:entity",params:["namespace","kind","name"]}));function Ut(x){var C,E;return{kind:x.kind.toLocaleLowerCase("en-US"),namespace:(E=(C=x.metadata.namespace)===null||C===void 0?void 0:C.toLocaleLowerCase("en-US"))!==null&&E!==void 0?E:DEFAULT_NAMESPACE,name:x.metadata.name}}var Xt=n(80030);const bt=(0,D.forwardRef)((x,C)=>{const{entityRef:E,defaultKind:$,title:Q,children:ne,...re}=x,ve=(0,p.tg)(Ne);let Ae,Oe,De;if(typeof E=="string"){const We=(0,P.of)(E);Ae=We.kind,Oe=We.namespace,De=We.name}else"metadata"in E?(Ae=E.kind,Oe=E.metadata.namespace,De=E.metadata.name):(Ae=E.kind,Oe=E.namespace,De=E.name);Ae=Ae.toLocaleLowerCase("en-US");var Be;Oe=(Be=Oe==null?void 0:Oe.toLocaleLowerCase("en-US"))!==null&&Be!==void 0?Be:P.zG;const tt={kind:Ae,namespace:Oe,name:De},ft=tn({kind:Ae,namespace:Oe,name:De},{defaultKind:$}),qe=(0,u.jsxs)(T.rU,{...re,ref:C,to:ve(tt),children:[ne,!ne&&(Q!=null?Q:ft)]});return Q?(0,u.jsx)(Xt.ZP,{title:ft,children:qe}):qe});function Ft(x){const{entityRefs:C,defaultKind:E,getTitle:$,...Q}=x,ne=(0,p.h_)(W),{value:re=new Array,loading:ve,error:Ae}=(0,Ct.default)(async()=>{const Oe=C.reduce((Be,tt)=>typeof tt=="object"&&"metadata"in tt?Be:[...Be,(0,P.of)(tt)],new Array),De=C.filter(Be=>typeof Be=="object"&&"metadata"in Be);return Oe.length>0?[...(await ne.getEntities({filter:Oe.map(Be=>({kind:Be.kind,"metadata.namespace":Be.namespace,"metadata.name":Be.name}))})).items,...De]:De},[C]);return ve?(0,u.jsx)(T.Ex,{}):Ae?(0,u.jsx)(T.yu,{error:Ae}):(0,u.jsx)(u.Fragment,{children:re.map((Oe,De)=>(0,u.jsxs)(D.Fragment,{children:[De>0&&", ",(0,u.jsx)(bt,{...Q,defaultKind:E,entityRef:Oe,title:$(Oe)})]},De))})}function gn(x){const{entityRefs:C,defaultKind:E,fetchEntities:$,getTitle:Q,...ne}=x;return $?(0,u.jsx)(Ft,{...ne,defaultKind:E,entityRefs:C,getTitle:Q}):(0,u.jsx)(u.Fragment,{children:C.map((re,ve)=>(0,u.jsxs)(D.Fragment,{children:[ve>0&&", ",(0,u.jsx)(bt,{...ne,defaultKind:E,entityRef:re,title:Q?Q(re):void 0})]},ve))})}const wn=x=>{const C=useRouteRef(entityRouteRef);return _jsx(IconButton,{component:Link,"aria-label":"Show",title:"Show details",to:C(getCompoundEntityRef(x.entity)),children:_jsx(InfoIcon,{})})},vt=x=>_jsx(IconButton,{component:Link,"aria-label":"Email",title:`Email ${x.email}`,to:`mailto:${x.email}`,children:_jsx(EmailIcon,{})}),He=x=>{var C;const E=(C=x.entity.spec.profile)===null||C===void 0?void 0:C.email;return E?_jsx(EmailCardAction,{email:E}):null},Lt=x=>{var C;const E=(C=x.entity.spec.profile)===null||C===void 0?void 0:C.email;return E?_jsx(EmailCardAction,{email:E}):null},xn=(0,sn.Z)(()=>({popoverPaper:{width:"30em"},descriptionTypography:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}})),nn=4,sr=x=>{var C,E,$;const{entityRef:Q,children:ne,delayTime:re=500}=x,ve=xn(),Ae=useApiHolder(),Oe=usePopupState({variant:"popover",popupId:"entity-peek-ahead"}),[De,Be]=useState(!1),tt=useMemo(()=>debounce(()=>Be(!0),re),[re]),[{loading:ft,error:qe,value:We},gt]=useAsyncFn(async()=>{const bn=Ae.get(catalogApiRef);if(bn){const Rt=await bn.getEntityByRef(Q);if(!Rt)throw new Error(`${Q} not found`);return Rt}},[Ae,Q]),Ot=()=>{Be(!1),tt.cancel()};return useEffect(()=>{Oe.isOpen&&!We&&!qe&&!ft&&gt()},[Oe.isOpen,gt,We,qe,ft]),_jsxs(_Fragment,{children:[_jsx(Typography,{component:"span",onMouseEnter:tt,children:_jsx(Typography,{component:"span","data-testid":"trigger",...bindHover(Oe),children:ne})}),De&&_jsx(HoverPopover,{PaperProps:{className:ve.popoverPaper},...bindPopover(Oe),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},onMouseLeave:Ot,children:_jsxs(Card,{children:[_jsxs(CardContent,{children:[qe&&_jsx(ResponseErrorPanel,{error:qe}),ft&&_jsx(Progress,{}),We&&_jsxs(_Fragment,{children:[_jsx(Typography,{color:"textSecondary",children:We.metadata.namespace}),_jsx(Typography,{variant:"h5",component:"div",children:We.metadata.name}),_jsx(Typography,{color:"textSecondary",gutterBottom:!0,children:We.kind}),We.metadata.description&&_jsx(Typography,{className:ve.descriptionTypography,paragraph:!0,children:We.metadata.description}),_jsx(Typography,{children:(C=We.spec)===null||C===void 0?void 0:C.type}),_jsxs(Box,{marginTop:"0.5em",children:[(We.metadata.tags||[]).slice(0,nn).map(bn=>_jsx(Chip,{size:"small",label:bn},bn)),((E=We.metadata.tags)===null||E===void 0?void 0:E.length)&&(($=We.metadata.tags)===null||$===void 0?void 0:$.length)>nn&&_jsx(Tooltip,{title:"Drill into the entity to see all of the tags.",children:_jsx(Chip,{size:"small",label:"..."},"other-tags")})]})]})]}),!qe&&We&&_jsx(CardActions,{children:_jsxs(_Fragment,{children:[isUserEntity(We)&&_jsx(UserCardActions,{entity:We}),isGroupEntity(We)&&_jsx(GroupCardActions,{entity:We}),_jsx(EntityCardActions,{entity:We})]})})]})})]})},mr=(0,sn.Z)(x=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),Hn=()=>{var x;const C=mr(),{filters:E,updateFilters:$}=useEntityList();var Q;const[ne,re]=useState((Q=(x=E.text)===null||x===void 0?void 0:x.value)!==null&&Q!==void 0?Q:"");return useDebounce(()=>{$({text:ne.length?new EntityTextFilter(ne):void 0})},250,[ne,$]),_jsx(Toolbar,{className:C.searchToolbar,children:_jsx(FormControl,{children:_jsx(Input,{"aria-label":"search",id:"input-with-icon-adornment",className:C.input,placeholder:"Search",autoComplete:"off",onChange:ve=>re(ve.target.value),value:ne,startAdornment:_jsx(InputAdornment,{position:"start",children:_jsx(Search,{})}),endAdornment:_jsx(InputAdornment,{position:"end",children:_jsx(IconButton,{"aria-label":"clear search",onClick:()=>re(""),edge:"end",disabled:ne.length===0,children:_jsx(Clear,{})})})})})})},cn=Object.freeze({createEntityRefColumn(x){const{defaultKind:C}=x;function E($){var Q;return((Q=$.metadata)===null||Q===void 0?void 0:Q.title)||tn($,{defaultKind:C})}return{title:"Name",highlight:!0,customFilterAndSearch($,Q){return E(Q).includes($)},customSort($,Q){return E($).localeCompare(E(Q))},render:$=>{var Q;return(0,u.jsx)(bt,{entityRef:$,defaultKind:C,title:(Q=$.metadata)===null||Q===void 0?void 0:Q.title})}}},createEntityRelationColumn(x){const{title:C,relation:E,defaultKind:$,filter:Q}=x;function ne(ve){return(0,G.hF)(ve,E,Q)}function re(ve){return ne(ve).map(Ae=>tn(Ae,{defaultKind:$})).join(", ")}return{title:C,customFilterAndSearch(ve,Ae){return re(Ae).includes(ve)},customSort(ve,Ae){return re(ve).localeCompare(re(Ae))},render:ve=>(0,u.jsx)(gn,{entityRefs:ne(ve),defaultKind:$})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:P.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:P.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:P.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:x=>(0,u.jsx)(T.Or,{text:x.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),ir=[cn.createEntityRefColumn({defaultKind:"system"}),cn.createDomainColumn(),cn.createOwnerColumn(),cn.createMetadataDescriptionColumn()],Fr=[cn.createEntityRefColumn({defaultKind:"component"}),cn.createSystemColumn(),cn.createOwnerColumn(),cn.createSpecTypeColumn(),cn.createSpecLifecycleColumn(),cn.createMetadataDescriptionColumn()],Nr=(0,sn.Z)(x=>({empty:{padding:x.spacing(2),display:"flex",justifyContent:"center"}})),Gn=x=>{const{entities:C,title:E,emptyContent:$,variant:Q="gridItem",columns:ne}=x,re=Nr(),ve={minWidth:"0",width:"100%"};return Q==="gridItem"&&(ve.height="calc(100% - 10px)"),(0,u.jsx)(T.iA,{columns:ne,title:E,style:ve,emptyContent:$&&(0,u.jsx)("div",{className:re.empty,children:$}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1},data:C})};Gn.columns=cn,Gn.systemEntityColumns=ir,Gn.componentEntityColumns=Fr;const Ar=(0,sn.Z)({input:{}},{name:"CatalogReactEntityTagPicker"}),S=x=>{const C=Ar();return(0,u.jsx)(he,{label:"Tags",name:"tags",path:"metadata.tags",Filter:N,showCounts:x.showCounts,InputProps:{className:C.input}})},c=x=>{const{hidden:C,initialFilter:E}=x,$=(0,p.h_)(p.$v),{error:Q,availableTypes:ne,selectedTypes:re,setSelectedTypes:ve}=pt();if((0,D.useEffect)(()=>{Q&&$.post({message:"Failed to load entity types",severity:"error"}),E&&ve([E])},[Q,$,E,ve]),ne.length===0||Q)return null;const Ae=[{value:"all",label:"all"},...ne.map(De=>({value:De,label:De}))];var Oe;return C?null:(0,u.jsx)(L.Z,{pb:1,pt:1,children:(0,u.jsx)(T.Ph,{label:"Type",items:Ae,selected:(Oe=Ae.length>1?re[0]:void 0)!==null&&Oe!==void 0?Oe:"all",onChange:De=>ve(De==="all"?[]:[String(De)])})})};var b=n(15459),j=n(61837),K=n(11640),me=n(28347);const we=(0,b.Z)({root:{color:"#f3ba37"}})(K.Z),Fe=x=>{const{toggleStarredEntity:C,isStarredEntity:E}=Kt(x.entity);return(0,u.jsx)(j.Z,{"aria-label":"favorite",color:"inherit",...x,onClick:()=>C(),children:(0,u.jsx)(Xt.ZP,{title:E?"Remove from favorites":"Add to favorites",children:E?(0,u.jsx)(we,{}):(0,u.jsx)(me.Z,{})})})};var Xe=n(8629),Mt=n(79249),jn=n(38724),qn=n(99152),ar=n(6487),vr=n(49429),an=n(55999),ho=n(39412);const qr=ho.Z;function Oo(x,C){if(x)return x.toLocaleLowerCase("en-US");if(C)try{return(0,P.of)(C).kind.toLocaleLowerCase("en-US")}catch{return}}function _r(x,C){const E=(0,p.qD)(),$=Oo(x,C);return $&&E.getSystemIcon(`kind:${$}`)||qr}function po(x){const{kind:C,entityRef:E,...$}=x,Q=_r(C,E);return(0,u.jsx)(Q,{...$})}const ko=(0,sn.Z)(x=>({node:{fill:x.palette.grey[300],stroke:x.palette.grey[300],"&.primary":{fill:x.palette.primary.light,stroke:x.palette.primary.light},"&.secondary":{fill:x.palette.secondary.light,stroke:x.palette.secondary.light}},text:{fill:x.palette.getContrastText(x.palette.grey[300]),"&.primary":{fill:x.palette.primary.contrastText},"&.secondary":{fill:x.palette.secondary.contrastText},"&.focused":{fontWeight:"bold"}},clickable:{cursor:"pointer"}}));function vs(x){const C=(0,p.h_)(W),E=(0,P.eE)(x),{loading:$,error:Q,value:ne}=(0,Ct.default)(async()=>{const re=await C.getEntityAncestors({entityRef:E}),ve=new Array,Ae=new Array;for(const Oe of re.items){const De=(0,P.eE)(Oe.entity),Be=De===re.rootEntityRef;ve.push({id:De,root:Be,...Oe.entity});for(const tt of Oe.parentEntityRefs)Ae.push({from:De,to:tt})}return{nodes:ve,edges:Ae}},[E]);return{loading:$,error:Q,nodes:(ne==null?void 0:ne.nodes)||[],edges:(ne==null?void 0:ne.edges)||[]}}function Bo({node:x}){const C=ko(),E=(0,$t.s0)(),$=(0,p.tg)(Ne),[Q,ne]=(0,D.useState)(0),[re,ve]=(0,D.useState)(0),Ae=(0,D.useRef)(null);(0,D.useLayoutEffect)(()=>{if(Ae.current){let{height:gt,width:Ot}=Ae.current.getBBox();gt=Math.round(gt),Ot=Math.round(Ot),(gt!==re||Ot!==Q)&&(ne(Ot),ve(gt))}},[Q,re]);const Oe=10,De=re,Be=De+Oe,tt=Be+Q+Oe*2,ft=re+Oe*2,qe=x.metadata.title||(x.kind&&x.metadata.name&&x.metadata.namespace?tn({kind:x.kind,name:x.metadata.name,namespace:x.metadata.namespace||""}):x.id),We=()=>{E($({kind:x.kind,namespace:x.metadata.namespace||P.zG,name:x.metadata.name}))};return(0,u.jsxs)("g",{onClick:We,className:C.clickable,children:[(0,u.jsx)("rect",{className:Ve()(C.node,x.root?"secondary":"primary"),width:tt,height:ft,rx:10}),(0,u.jsx)(po,{kind:x.kind,y:Oe,x:Oe,width:De,height:De,className:Ve()(C.text,x.root?"secondary":"primary")}),(0,u.jsx)("text",{ref:Ae,className:Ve()(C.text,x.root?"secondary":"primary"),y:ft/2,x:Be+(Q+Oe*2)/2,textAnchor:"middle",alignmentBaseline:"middle",children:qe})]})}function $o(x){const{loading:C,error:E,nodes:$,edges:Q}=vs(x.entity);return C?(0,u.jsx)(T.Ex,{}):E?(0,u.jsx)(T.Gk,{error:E}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(an.Z,{variant:"h2",children:"Ancestry"}),(0,u.jsxs)(an.Z,{gutterBottom:!0,children:["This is the ancestry of entities above the current one - as in, the chain(s) of entities down to the current one, where"," ",(0,u.jsx)(T.rU,{to:"https://backstage.io/docs/features/software-catalog/life-of-an-entity",children:"processors emitted"})," ","child entities that ultimately led to the current one existing. Note that this is a completely different mechanism from relations."]}),(0,u.jsx)(L.Z,{mt:4,children:(0,u.jsx)(T.mn,{nodes:$,edges:Q,renderNode:Bo,direction:T.NX.Direction.BOTTOM_TOP,zoom:"enable-on-click"})})]})}var yr=n(11776),nr=n(38402),Lr=n(86136),Zr=n(99688),eo=n(49378),to=n(54506),Ur=n(94339),Do=n(24579),fo=n(27685);const kn=(0,sn.Z)(x=>({root:{display:"flex",flexDirection:"column"},marginTop:{marginTop:x.spacing(2)},helpIcon:{marginLeft:x.spacing(1),color:x.palette.text.disabled},monospace:{fontFamily:"monospace"}}));function _n(x){const C=kn();return(0,u.jsx)(eo.Z,{...x,primaryTypographyProps:{className:C.monospace},secondaryTypographyProps:{className:C.monospace}})}function Or(x){const C=kn();return(0,u.jsx)(to.Z,{className:C.monospace,children:x.children})}function Mr(x){return(0,u.jsx)(L.Z,{mt:2,children:(0,u.jsx)(Ur.Z,{variant:"outlined",children:(0,u.jsxs)(Do.Z,{children:[(0,u.jsxs)(A.Z,{variant:"h6",gutterBottom:!0,children:[x.title,x.helpLink&&(0,u.jsx)(ro,{to:x.helpLink})]}),x.children]})})})}function Tr(x){if(x.match(/^url:https?:\/\//))return x.slice(4);if(x.match(/^https?:\/\//))return x}function no(x){const[C,E]=x.entry,$=Tr(E);return(0,u.jsxs)(nr.Z,{children:[x.indent&&(0,u.jsx)(Lr.Z,{}),(0,u.jsx)(_n,{primary:C,secondary:$?(0,u.jsx)(T.rU,{to:$,children:E}):E})]})}function ro(x){const C=kn();return(0,u.jsx)(T.rU,{to:x.to,className:C.helpIcon,children:(0,u.jsx)(fo.Z,{fontSize:"inherit"})})}const Fo=(0,sn.Z)({root:{display:"flex",flexDirection:"column"}});function go(x){var C,E;const $=(0,p.h_)(W),Q=(0,P.eE)(x),ne=(C=x.metadata.annotations)===null||C===void 0?void 0:C[P.P1],re=(E=x.metadata.annotations)===null||E===void 0?void 0:E[P.q1],{loading:ve,error:Ae,value:Oe}=(0,Ct.default)(async()=>!ne&&!re?[]:(await $.getEntities({filter:[...ne?[{[`metadata.annotations.${P.P1}`]:ne}]:[],...re?[{[`metadata.annotations.${P.q1}`]:re}]:[]]})).items,[ne,re]);return{loading:ve,error:Ae,location:ne,originLocation:re,colocatedEntities:Oe==null?void 0:Oe.filter(De=>(0,P.eE)(De)!==Q)}}function lr(x){return(0,u.jsxs)(yr.Z,{dense:!0,children:[x.header&&(0,u.jsx)(no,{entry:x.header},"header"),x.entities.map(C=>(0,u.jsxs)(nr.Z,{children:[(0,u.jsx)(Lr.Z,{children:(0,u.jsx)(po,{kind:C.kind})}),(0,u.jsx)(_n,{primary:(0,u.jsx)(bt,{entityRef:C})})]},(0,P.eE)(C)))]})}function ys(x){const{entity:C}=x,{loading:E,error:$,location:Q,originLocation:ne,colocatedEntities:re}=go(C);if(E)return(0,u.jsx)(T.Ex,{});if($)return(0,u.jsx)(T.Gk,{error:$});if(!Q&&!ne)return(0,u.jsx)(Zr.Z,{severity:"warning",children:"Entity had no location information."});if(!(re!=null&&re.length))return(0,u.jsx)(Zr.Z,{severity:"info",children:"There were no other entities on this location."});if(Q===ne)return(0,u.jsx)(lr,{entities:re});const ve=re.filter(Oe=>{var De;return((De=Oe.metadata.annotations)===null||De===void 0?void 0:De[P.P1])===Q}),Ae=re.filter(Oe=>{var De;return((De=Oe.metadata.annotations)===null||De===void 0?void 0:De[P.q1])===ne});return(0,u.jsxs)(u.Fragment,{children:[ve.length>0&&(0,u.jsx)(lr,{entities:ve,header:["At the same location",Q]}),Ae.length>0&&(0,u.jsx)(lr,{entities:Ae,header:["At the same origin",ne]})]})}function No(x){const C=Fo();return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(an.Z,{variant:"h2",children:"Colocated"}),(0,u.jsx)(an.Z,{children:"These are the entities that are colocated with this entity - as in, they originated from the same data source (e.g. came from the same YAML file), or from the same origin (e.g. the originally registered URL)."}),(0,u.jsx)("div",{className:C.root,children:(0,u.jsx)(ys,{entity:x.entity})})]})}function zr(x){return Object.fromEntries([...Object.entries(x)].sort((C,E)=>C[0]<E[0]?-1:1))}function Zo(x){return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(an.Z,{variant:"h2",children:"Entity as JSON"}),(0,u.jsx)(an.Z,{children:"This is the raw entity data as received from the catalog, on JSON form."}),(0,u.jsx)(an.Z,{children:(0,u.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,u.jsx)(T.Oi,{text:JSON.stringify(zr(x.entity),void 0,2),language:"json",showCopyCodeButton:!0})})})]})}var Uo=n(3440),er=n.n(Uo);const si=(0,sn.Z)({root:{display:"flex",flexDirection:"column"}});function xs(x){var C,E;const $=si(),{apiVersion:Q,kind:ne,metadata:re,spec:ve,relations:Ae=[],status:Oe={}}=x.entity,De=er()(ut()(Ae,Be=>Be.targetRef),"type");return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(an.Z,{variant:"h2",children:"Overview"}),(0,u.jsxs)("div",{className:$.root,children:[(0,u.jsx)(Mr,{title:"Identity",children:(0,u.jsxs)(yr.Z,{dense:!0,children:[(0,u.jsx)(nr.Z,{children:(0,u.jsx)(_n,{primary:"apiVersion",secondary:Q})}),(0,u.jsx)(nr.Z,{children:(0,u.jsx)(_n,{primary:"kind",secondary:ne})}),(ve==null?void 0:ve.type)&&(0,u.jsx)(nr.Z,{children:(0,u.jsx)(_n,{primary:"spec.type",secondary:ve.type})}),re.uid&&(0,u.jsx)(nr.Z,{children:(0,u.jsx)(_n,{primary:"uid",secondary:re.uid})}),re.etag&&(0,u.jsx)(nr.Z,{children:(0,u.jsx)(_n,{primary:"etag",secondary:re.etag})})]})}),(0,u.jsxs)(Mr,{title:"Metadata",children:[!!Object.keys(re.annotations||{}).length&&(0,u.jsx)(yr.Z,{dense:!0,subheader:(0,u.jsxs)(Or,{children:["Annotations",(0,u.jsx)(ro,{to:"https://backstage.io/docs/features/software-catalog/well-known-annotations"})]}),children:Object.entries(re.annotations).map(Be=>(0,u.jsx)(no,{indent:!0,entry:Be},Be[0]))}),!!Object.keys(re.labels||{}).length&&(0,u.jsx)(yr.Z,{dense:!0,subheader:(0,u.jsx)(Or,{children:"Labels"}),children:Object.entries(re.labels).map(Be=>(0,u.jsx)(no,{indent:!0,entry:Be},Be[0]))}),!!(!((C=re.tags)===null||C===void 0)&&C.length)&&(0,u.jsx)(yr.Z,{dense:!0,subheader:(0,u.jsx)(Or,{children:"Tags"}),children:re.tags.map((Be,tt)=>(0,u.jsxs)(nr.Z,{children:[(0,u.jsx)(Lr.Z,{}),(0,u.jsx)(_n,{primary:Be})]},`${Be}-${tt}`))})]}),!!Ae.length&&(0,u.jsx)(Mr,{title:"Relations",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-relations",children:Object.entries(De).map(([Be,tt],ft)=>(0,u.jsx)("div",{children:(0,u.jsx)(yr.Z,{dense:!0,subheader:(0,u.jsx)(Or,{children:Be}),children:tt.map(qe=>(0,u.jsxs)(nr.Z,{children:[(0,u.jsx)(Lr.Z,{children:(0,u.jsx)(po,{entityRef:qe.targetRef})}),(0,u.jsx)(_n,{primary:(0,u.jsx)(bt,{entityRef:qe.targetRef})})]},qe.targetRef))})},ft))}),!!(!((E=Oe.items)===null||E===void 0)&&E.length)&&(0,u.jsx)(Mr,{title:"Status",helpLink:"https://backstage.io/docs/features/software-catalog/well-known-statuses",children:Oe.items.map((Be,tt)=>(0,u.jsxs)("div",{children:[(0,u.jsxs)(A.Z,{children:[Be.level,": ",Be.type]}),(0,u.jsx)(L.Z,{ml:2,children:Be.message})]},tt))})]})]})}var bs=n(72847);function Ss(x){return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(an.Z,{variant:"h2",children:"Entity as YAML"}),(0,u.jsx)(an.Z,{children:"This is the raw entity data as received from the catalog, on YAML form."}),(0,u.jsx)(an.Z,{children:(0,u.jsx)("div",{style:{fontSize:"75%"},"data-testid":"code-snippet",children:(0,u.jsx)(T.Oi,{text:bs.ZP.stringify(zr(x.entity)),language:"yaml",showCopyCodeButton:!0})})})]})}const oo=(0,sn.Z)(x=>({fullHeightDialog:{height:"calc(100% - 64px)"},root:{display:"flex",flexGrow:1,width:"100%",backgroundColor:x.palette.background.paper},tabs:{borderRight:`1px solid ${x.palette.divider}`,flexShrink:0},tabContents:{flexGrow:1,overflowX:"auto"}}));function Wr(x){const{children:C,value:E,index:$,...Q}=x,ne=oo();return(0,u.jsx)("div",{role:"tabpanel",hidden:E!==$,id:`vertical-tabpanel-${$}`,"aria-labelledby":`vertical-tab-${$}`,className:ne.tabContents,...Q,children:E===$&&(0,u.jsx)(L.Z,{pl:3,pr:3,children:C})})}function Vr(x){return{id:`vertical-tab-${x}`,"aria-controls":`vertical-tabpanel-${x}`}}function Kn(x){const C=oo(),[E,$]=D.useState(0);return(0,D.useEffect)(()=>{$(0)},[x.open]),x.entity?(0,u.jsxs)(Xe.Z,{fullWidth:!0,maxWidth:"xl",open:x.open,onClose:x.onClose,"aria-labelledby":"entity-inspector-dialog-title",PaperProps:{className:C.fullHeightDialog},children:[(0,u.jsx)(Mt.Z,{id:"entity-inspector-dialog-title",children:"Entity Inspector"}),(0,u.jsx)(jn.Z,{dividers:!0,children:(0,u.jsxs)("div",{className:C.root,children:[(0,u.jsxs)(qn.Z,{orientation:"vertical",variant:"scrollable",value:E,onChange:(Q,ne)=>$(ne),"aria-label":"Inspector options",className:C.tabs,children:[(0,u.jsx)(ar.Z,{label:"Overview",...Vr(0)}),(0,u.jsx)(ar.Z,{label:"Ancestry",...Vr(1)}),(0,u.jsx)(ar.Z,{label:"Colocated",...Vr(2)}),(0,u.jsx)(ar.Z,{label:"Raw JSON",...Vr(3)}),(0,u.jsx)(ar.Z,{label:"Raw YAML",...Vr(4)})]}),(0,u.jsx)(Wr,{value:E,index:0,children:(0,u.jsx)(xs,{entity:x.entity})}),(0,u.jsx)(Wr,{value:E,index:1,children:(0,u.jsx)($o,{entity:x.entity})}),(0,u.jsx)(Wr,{value:E,index:2,children:(0,u.jsx)(No,{entity:x.entity})}),(0,u.jsx)(Wr,{value:E,index:3,children:(0,u.jsx)(Zo,{entity:x.entity})}),(0,u.jsx)(Wr,{value:E,index:4,children:(0,u.jsx)(Ss,{entity:x.entity})})]})}),(0,u.jsx)(vr.Z,{children:(0,u.jsx)(V.Z,{onClick:x.onClose,color:"primary",children:"Close"})})]}):null}var Mo=n(85256);function Yn(x){var C;const E=(0,p.h_)(W),$=(C=x.metadata.annotations)===null||C===void 0?void 0:C[P.q1],Q=x.metadata.uid,ne=$==="bootstrap:bootstrap",re=(0,Ct.default)(async()=>{const qe=E.getLocationByRef($);let We;if(!$)We=Promise.resolve([]);else{const gt=`metadata.annotations.${P.q1}`;We=E.getEntities({filter:{[gt]:$},fields:["kind","metadata.uid","metadata.name","metadata.namespace"]}).then(Ot=>Ot.items)}return Promise.all([qe,We]).then(([gt,Ot])=>({location:gt,colocatedEntities:Ot}))},[E,x]),ve=(0,D.useCallback)(async function(){const{location:We}=re.value;await E.removeLocationById(We.id)},[E,re]),Ae=(0,D.useCallback)(async function(){await E.removeEntityByUid(Q)},[E,Q]);if(ne)return{type:"bootstrap",location:$,deleteEntity:Ae};const{loading:Oe,error:De,value:Be}=re;if(Oe)return{type:"loading"};if(De)return{type:"error",error:De};const{location:tt,colocatedEntities:ft}=Be;return tt?{type:"unregister",location:$,colocatedEntities:ft.map(P.iB),unregisterLocation:ve,deleteEntity:Ae}:{type:"only-delete",deleteEntity:Ae}}var so=n(23054);const zo=(0,sn.Z)({advancedButton:{fontSize:"0.7em"},dialogActions:{display:"inline-block"}}),io=({entity:x,onConfirm:C,onClose:E})=>{const $=(0,p.h_)(p.$v),Q=(0,p.h_)(p.Ds),ne=zo(),re=Yn(x),[ve,Ae]=(0,D.useState)(!1),[Oe,De]=(0,D.useState)(!1);var Be;const tt=(Be=Q.getOptionalString("app.title"))!==null&&Be!==void 0?Be:"Backstage",ft=(0,D.useCallback)(async function(){if("unregisterLocation"in re){De(!0);try{await re.unregisterLocation(),C()}catch(Ot){(0,so.BD)(Ot),$.post({message:Ot.message})}finally{De(!1)}}},[$,C,re]),qe=(0,D.useCallback)(async function(){if("deleteEntity"in re){De(!0);try{await re.deleteEntity(),C()}catch(Ot){(0,so.BD)(Ot),$.post({message:Ot.message})}finally{De(!1)}}},[$,C,re]),We=()=>(0,u.jsx)(vr.Z,{className:ne.dialogActions,children:(0,u.jsx)(V.Z,{onClick:E,color:"primary",children:"Cancel"})});return re.type==="loading"?(0,u.jsx)(T.Ex,{}):re.type==="error"?(0,u.jsx)(T.Gk,{error:re.error}):re.type==="bootstrap"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(Zr.Z,{severity:"info",children:['You cannot unregister this entity, since it originates from a protected Backstage configuration (location "',re.location,'"). If you believe this is in error, please contact the ',tt," ","integrator."]}),(0,u.jsxs)(L.Z,{marginTop:2,children:[!ve&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(V.Z,{variant:"text",size:"small",color:"primary",className:ne.advancedButton,onClick:()=>Ae(!0),children:"Advanced Options"}),(0,u.jsx)(We,{})]}),ve&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(an.Z,{children:"You have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,u.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Oe,onClick:qe,children:"Delete Entity"}),(0,u.jsx)(We,{})]})]})]}):re.type==="only-delete"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(an.Z,{children:"This entity does not seem to originate from a registered location. You therefore only have the option to delete it outright from the catalog."}),(0,u.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Oe,onClick:qe,children:"Delete Entity"}),(0,u.jsx)(We,{})]}):re.type==="unregister"?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(an.Z,{children:"This action will unregister the following entities:"}),(0,u.jsx)(an.Z,{component:"ul",children:re.colocatedEntities.map(gt=>(0,u.jsx)("li",{children:(0,u.jsx)(bt,{entityRef:gt})},`${gt.kind}:${gt.namespace}/${gt.name}`))}),(0,u.jsx)(an.Z,{children:"Located at the following location:"}),(0,u.jsx)(an.Z,{component:"ul",children:(0,u.jsx)("li",{children:re.location})}),(0,u.jsxs)(an.Z,{children:["To undo, just re-register the entity in ",tt,"."]}),(0,u.jsxs)(L.Z,{marginTop:2,children:[(0,u.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Oe,onClick:ft,children:"Unregister Location"}),!ve&&(0,u.jsx)(L.Z,{component:"span",marginLeft:2,children:(0,u.jsx)(V.Z,{variant:"text",size:"small",color:"primary",className:ne.advancedButton,onClick:()=>Ae(!0),children:"Advanced Options"})})]}),ve&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(L.Z,{paddingTop:4,paddingBottom:4,children:(0,u.jsx)(Mo.Z,{})}),(0,u.jsx)(an.Z,{children:"You also have the option to delete the entity itself from the catalog. Note that this should only be done if you know that the catalog file has been deleted at, or moved from, its origin location. If that is not the case, the entity will reappear shortly as the next refresh round is performed by the catalog."}),(0,u.jsx)(V.Z,{variant:"contained",color:"secondary",disabled:Oe,onClick:qe,children:"Delete Entity"})]})]}):(0,u.jsx)(Zr.Z,{severity:"error",children:"Internal error: Unknown state"})},Wo=x=>{const{open:C,onConfirm:E,onClose:$,entity:Q}=x;return(0,u.jsxs)(Xe.Z,{open:C,onClose:$,children:[(0,u.jsx)(Mt.Z,{id:"responsive-dialog-title",children:"Are you sure you want to unregister this entity?"}),(0,u.jsx)(jn.Z,{children:(0,u.jsx)(io,{entity:Q,onConfirm:E,onClose:$})})]})};var Vo=n(12231),Cs=n(9520),Ho=n(47603);const ao=(0,sn.Z)(x=>({root:{backgroundColor:"rgba(0, 0, 0, .11)",boxShadow:"none",margin:x.spacing(1,0,1,0)},title:{margin:x.spacing(1,0,0,1),textTransform:"uppercase",fontSize:12,fontWeight:"bold"},listIcon:{minWidth:30,color:x.palette.text.primary},menuItem:{minHeight:x.spacing(6)},groupWrapper:{margin:x.spacing(1,1,2,1)}}),{name:"CatalogReactUserListPicker"});function Go(x){return[{name:"Personal",items:[{id:"owned",label:"Owned",icon:Ho.Z},{id:"starred",label:"Starred",icon:K.Z}]},{name:x!=null?x:"Company",items:[{id:"all",label:"All"}]}]}const mo=x=>{const{initialFilter:C,availableFilters:E}=x,$=ao(),Q=(0,p.h_)(p.Ds);var ne;const re=(ne=Q.getOptionalString("organization.name"))!==null&&ne!==void 0?ne:"Company",{filters:ve,updateFilters:Ae,backendEntities:Oe,queryParameters:{kind:De,user:Be},loading:tt}=ct(),ft=["starred","all"],qe=Go(re).map(Nn=>({...Nn,items:Nn.items.filter(({id:zn})=>["group","user"].some(xr=>xr===De)?ft.includes(zn):!E||E.includes(zn))})).filter(({items:Nn})=>!!Nn.length),{isStarredEntity:We}=qt(),{isOwnedEntity:gt,loading:Ot}=En(),bn=tt||Ot,Rt=(0,D.useMemo)(()=>new xt("owned",gt,We),[gt,We]),Gt=(0,D.useMemo)(()=>new xt("starred",gt,We),[gt,We]),kt=(0,D.useMemo)(()=>[Be].flat()[0],[Be]),[dn,$n]=(0,D.useState)(kt!=null?kt:C),Rr=(0,D.useMemo)(()=>Oe.filter((0,G.Gz)((0,lt.compact)(Object.values({...ve,user:void 0})))),[ve,Oe]),cr=(0,D.useMemo)(()=>({all:Rr.length,starred:Rr.filter(Nn=>Gt.filterEntity(Nn)).length,owned:Rr.filter(Nn=>Rt.filterEntity(Nn)).length}),[Rr,Gt,Rt]);(0,D.useEffect)(()=>{kt&&$n(kt)},[kt]),(0,D.useEffect)(()=>{!bn&&dn&&dn!=="all"&&cr[dn]===0&&$n("all")},[bn,cr,dn,$n]),(0,D.useEffect)(()=>{Ae({user:dn?new xt(dn,gt,We):void 0})},[dn,gt,We,Ae]);var Hr;return(0,u.jsx)(Ur.Z,{className:$.root,children:qe.map(Nn=>(0,u.jsxs)(D.Fragment,{children:[(0,u.jsx)(A.Z,{variant:"subtitle2",component:"span",className:$.title,children:Nn.name}),(0,u.jsx)(Ur.Z,{className:$.groupWrapper,children:(0,u.jsx)(yr.Z,{disablePadding:!0,dense:!0,role:"menu","aria-label":Nn.name,children:Nn.items.map(zn=>{var xr;return(0,u.jsxs)(Vo.Z,{role:"none presentation",button:!0,divider:!0,onClick:()=>$n(zn.id),selected:zn.id===((xr=ve.user)===null||xr===void 0?void 0:xr.value),className:$.menuItem,disabled:cr[zn.id]===0,"data-testid":`user-picker-${zn.id}`,tabIndex:0,ContainerProps:{role:"menuitem"},children:[zn.icon&&(0,u.jsx)(Lr.Z,{className:$.listIcon,children:(0,u.jsx)(zn.icon,{fontSize:"small"})}),(0,u.jsx)(eo.Z,{children:(0,u.jsxs)(A.Z,{variant:"body1",children:[zn.label," "]})}),(0,u.jsx)(Cs.Z,{children:(Hr=cr[zn.id])!==null&&Hr!==void 0?Hr:"-"})]},zn.id)})})})]},Nn.name))})},vo=(0,sn.Z)({input:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),ws=(0,u.jsx)(Un.Z,{fontSize:"small"}),js=(0,u.jsx)(Ln.Z,{fontSize:"small"}),Ko=()=>{const x=vo(),{updateFilters:C}=ct(),[E,$]=(0,D.useState)([]);function Q(ve){C({orphan:ve?new Nt(ve):void 0})}function ne(ve){C({error:ve?new Dt(ve):void 0})}const re=["Is Orphan","Has Error"];return(0,u.jsx)(L.Z,{pb:1,pt:1,children:(0,u.jsxs)(A.Z,{variant:"button",component:"label",children:["Processing Status",(0,u.jsx)(rt.ZP,{multiple:!0,disableCloseOnSelect:!0,options:re,value:E,onChange:(ve,Ae)=>{$(Ae),Q(Ae.includes("Is Orphan")),ne(Ae.includes("Has Error"))},renderOption:(ve,{selected:Ae})=>(0,u.jsx)(Jt.Z,{control:(0,u.jsx)(Pn.Z,{icon:ws,checkedIcon:js,checked:Ae}),onClick:Oe=>Oe.preventDefault(),label:ve}),size:"small",popupIcon:(0,u.jsx)(Yt.Z,{"data-testid":"processing-status-picker-expand"}),renderInput:ve=>(0,u.jsx)(Ie.Z,{...ve,className:x.input,variant:"outlined"})})]})})},ln=(0,sn.Z)({input:{}},{name:"CatalogReactEntityNamespacePicker"}),Yo=()=>{const x=ln();return(0,u.jsx)(he,{label:"Namespace",name:"namespace",path:"metadata.namespace",Filter:zt,InputProps:{className:x.input}})};function Es(x){const{children:C,value:E}=x;var $;const[Q,ne]=useState(($=E==null?void 0:E.filters)!==null&&$!==void 0?$:{}),re=useCallback(qe=>{ne(We=>{const gt=typeof qe=="function"?qe(We):qe;return{...We,...gt}})},[]),ve=useMemo(()=>({entities:[],backendEntities:[],queryParameters:{}}),[]);var Ae,Oe,De,Be,tt;const ft=useMemo(()=>({entities:(Ae=E==null?void 0:E.entities)!==null&&Ae!==void 0?Ae:ve.entities,backendEntities:(Oe=E==null?void 0:E.backendEntities)!==null&&Oe!==void 0?Oe:ve.backendEntities,updateFilters:(De=E==null?void 0:E.updateFilters)!==null&&De!==void 0?De:re,filters:Q,loading:(Be=E==null?void 0:E.loading)!==null&&Be!==void 0?Be:!1,queryParameters:(tt=E==null?void 0:E.queryParameters)!==null&&tt!==void 0?tt:ve.queryParameters,error:E==null?void 0:E.error}),[E,ve,Q,re]);return _jsx(EntityListContext.Provider,{value:ft,children:C})}},75435:function(St,ke,n){"use strict";n.d(ke,{h:function(){return p}});var r=n(25271);function p(W,f,z){var g;let u=(W==null||(g=W.relations)===null||g===void 0?void 0:g.filter(D=>D.type===f).map(D=>(0,r.of)(D.targetRef)))||[];return z!=null&&z.kind&&(u=u.filter(D=>D.kind.toLocaleLowerCase("en-US")===z.kind.toLocaleLowerCase("en-US"))),u}},49280:function(St,ke,n){"use strict";n.d(ke,{hF:function(){return W.h},CV:function(){return z},wq:function(){return r},Gz:function(){return p}});function r(u){return u.reduce((D,ge)=>({...D,...ge.getCatalogFilters?ge.getCatalogFilters():{}}),{})}function p(u){return D=>u.every(ge=>!ge.filterEntity||ge.filterEntity(D))}var W=n(75435),f=n(25271);function z(u,D){var ge;const de=(ge=u.metadata.annotations)===null||ge===void 0?void 0:ge[f.M6];if(de)try{const V=(0,f.Ou)(de),te=D.byUrl(V.target);return{locationTargetUrl:V.target,integrationType:te==null?void 0:te.type}}catch{return}}function g(u,D){const ge=new Set([...getEntityRelations(u,RELATION_MEMBER_OF,{kind:"group"}),...u?[getCompoundEntityRef(u)]:[]].map(stringifyEntityRef)),de=getEntityRelations(D,RELATION_OWNED_BY).map(stringifyEntityRef);for(const V of de)if(ge.has(V))return!0;return!1}},8799:function(St,ke,n){"use strict";n.r(ke),n.d(ke,{AboutCard:function(){return Dt},AboutContent:function(){return xt},AboutField:function(){return _e}});var r=n(52322),p=n(25271),W=n(53974),f=n(60871),z=n(32838),g=n(39709),u=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"TemplateV1beta3","description":"A Template describes a scaffolding task for use with the Scaffolder. It describes the required parameters as well as a series of steps that will be taken to execute the scaffolding task.","examples":[{"apiVersion":"scaffolder.backstage.io/v1beta3","kind":"Template","metadata":{"name":"react-ssr-template","title":"React SSR Template","description":"Next.js application skeleton for creating isomorphic web applications.","tags":["recommended","react"]},"spec":{"owner":"artist-relations-team","parameters":{"required":["name","description","repoUrl"],"backstage:permissions":{"tags":["one","two"]},"properties":{"name":{"title":"Name","type":"string","description":"Unique name of the component"},"description":{"title":"Description","type":"string","description":"Description of the component"},"repoUrl":{"title":"Pick a repository","type":"string","ui:field":"RepoUrlPicker"}}},"steps":[{"id":"fetch","name":"Fetch","action":"fetch:plain","parameters":{"url":"./template"},"backstage:permissions":{"tags":["one","two"]}},{"id":"publish","name":"Publish to GitHub","action":"publish:github","parameters":{"repoUrl":"${{ parameters.repoUrl }}"},"if":"${{ parameters.repoUrl }}"}],"output":{"catalogInfoUrl":"${{ steps.publish.output.catalogInfoUrl }}"}}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["scaffolder.backstage.io/v1beta3"]},"kind":{"enum":["Template"]},"spec":{"type":"object","required":["type","steps"],"properties":{"type":{"type":"string","description":"The type of component created by the template. The software catalog accepts any type value, but an organization should take great care to establish a proper taxonomy for these. Tools including Backstage itself may read this field and behave differently depending on its value. For example, a website type component may present tooling in the Backstage interface that is specific to just websites.","examples":["service","website","library"],"minLength":1},"owner":{"type":"string","description":"The user (or group) owner of the template","minLength":1},"parameters":{"oneOf":[{"type":"object","description":"The JSONSchema describing the inputs for the template.","properties":{"backstage:permissions":{"type":"object","description":"Object used for authorizing the parameter","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}},{"type":"array","description":"A list of separate forms to collect parameters.","items":{"type":"object","description":"The JSONSchema describing the inputs for the template.","properties":{"backstage:permissions":{"type":"object","description":"Object used for authorizing the parameter","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}}}]},"steps":{"type":"array","description":"A list of steps to execute.","items":{"type":"object","description":"A description of the step to execute.","required":["action"],"properties":{"id":{"type":"string","description":"The ID of the step, which can be used to refer to its outputs."},"name":{"type":"string","description":"The name of the step, which will be displayed in the UI during the scaffolding process."},"action":{"type":"string","description":"The name of the action to execute."},"input":{"type":"object","description":"A templated object describing the inputs to the action."},"if":{"type":["string","boolean"],"description":"A templated condition that skips the step when evaluated to false. If the condition is true or not defined, the step is executed. The condition is true, if the input is not `false`, `undefined`, `null`, `\\"\\"`, `0`, or `[]`."},"backstage:permissions":{"type":"object","description":"Object used for authorizing the step","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}}},"output":{"type":"object","description":"A templated object describing the outputs of the scaffolding task.","properties":{"links":{"type":"array","description":"A list of external hyperlinks, typically pointing to resources created or updated by the template","items":{"type":"object","required":[],"properties":{"url":{"type":"string","description":"A url in a standard uri format.","examples":["https://github.com/my-org/my-new-repo"],"minLength":1},"entityRef":{"type":"string","description":"An entity reference to an entity in the catalog.","examples":["Component:default/my-app"],"minLength":1},"title":{"type":"string","description":"A user friendly display name for the link.","examples":["View new repo"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1}}}},"text":{"type":"array","description":"A list of Markdown text blobs, like output data from the template.","items":{"type":"object","required":[],"properties":{"title":{"type":"string","description":"A user friendly display name for the text.","examples":["Output Content"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1},"content":{"type":"string","description":"The text blob to display in the UI, rendered as Markdown.","examples":["**hey** _I\'m_ Markdown"]}}}}},"additionalProperties":{"type":"string"}}}}}}]}');const D=(0,p.wI)(u),ge={async check(et){return D(et)===et}},de=et=>et.apiVersion==="scaffolder.backstage.io/v1beta3"&&et.kind==="Template";var V=n(79692),te=n(94339),L=n(32552),A=n(61837),ae=n(85256),oe=n(24579),se=n(88188),q=n(52866),H=n(30254),T=n(27604),R=n(2784),P=n(19625),G=n(60905),je=n(7089),Pe=n(90436);const N=(0,V.Z)(et=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:et.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function _e(et){const{label:lt,value:yt,gridSizes:At,children:$t}=et,Ht=N(),be=(0,f.vJ)($t,Ye=>Ye.getElements()),Ce=be.length>0?be:(0,r.jsx)(Pe.Z,{variant:"body2",className:Ht.value,children:yt||"unknown"});return(0,r.jsxs)(G.Z,{item:!0,...At,children:[(0,r.jsx)(Pe.Z,{variant:"h2",className:Ht.label,children:lt}),Ce]})}var at=n(24851);const It=(0,V.Z)({description:{wordBreak:"break-word"}});function zt(et,lt,yt){if(lt==="url"||et.includes("://"))return et;const At=yt.type==="file"?`file://${yt.target}`:yt.target;return lt==="file"||yt.type==="file"?new URL(et,At).href:At}function xt(et){var lt,yt,At,$t,Ht,be,Ce,Ye;const{entity:Le}=et,ct=It(),Ct=Le.kind.toLocaleLowerCase("en-US")==="system",dt=Le.kind.toLocaleLowerCase("en-US")==="resource",Qe=Le.kind.toLocaleLowerCase("en-US")==="component",Ge=Le.kind.toLocaleLowerCase("en-US")==="api",ut=Le.kind.toLocaleLowerCase("en-US")==="template",pt=Le.kind.toLocaleLowerCase("en-US")==="location",hn=Le.kind.toLocaleLowerCase("en-US")==="group",pn=(0,g.hF)(Le,p.cz,{kind:"system"}),fn=(0,g.hF)(Le,p.cz,{kind:"component"}),qt=(0,g.hF)(Le,p.cz,{kind:"domain"}),Cn=(0,g.hF)(Le,p.S4);let Kt;try{Kt=(0,p.CV)(Le)}catch{Kt=void 0}return(0,r.jsxs)(G.Z,{container:!0,children:[(0,r.jsx)(_e,{label:"Description",gridSizes:{xs:12},children:(0,r.jsx)(W.SA,{className:ct.description,content:(Le==null||(lt=Le.metadata)===null||lt===void 0?void 0:lt.description)||"No description"})}),(0,r.jsx)(_e,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:Cn.length>0&&(0,r.jsx)(g.rI,{entityRefs:Cn,defaultKind:"group"})}),(Ct||qt.length>0)&&(0,r.jsx)(_e,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:qt.length>0&&(0,r.jsx)(g.rI,{entityRefs:qt,defaultKind:"domain"})}),(Ge||Qe||dt||pn.length>0)&&(0,r.jsx)(_e,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:pn.length>0&&(0,r.jsx)(g.rI,{entityRefs:pn,defaultKind:"system"})}),Qe&&fn.length>0&&(0,r.jsx)(_e,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,r.jsx)(g.rI,{entityRefs:fn,defaultKind:"component"})}),(Ge||Qe||dt||ut||hn||pt||typeof(Le==null||(yt=Le.spec)===null||yt===void 0?void 0:yt.type)=="string")&&(0,r.jsx)(_e,{label:"Type",value:Le==null||(At=Le.spec)===null||At===void 0?void 0:At.type,gridSizes:{xs:12,sm:6,lg:4}}),(Ge||Qe||typeof(Le==null||($t=Le.spec)===null||$t===void 0?void 0:$t.lifecycle)=="string")&&(0,r.jsx)(_e,{label:"Lifecycle",value:Le==null||(Ht=Le.spec)===null||Ht===void 0?void 0:Ht.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,r.jsx)(_e,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((Le==null||(be=Le.metadata)===null||be===void 0?void 0:be.tags)||[]).map(rn=>(0,r.jsx)(je.Z,{size:"small",label:rn},rn))}),pt&&((Le==null||(Ce=Le.spec)===null||Ce===void 0?void 0:Ce.targets)||(Le==null||(Ye=Le.spec)===null||Ye===void 0?void 0:Ye.target))&&(0,r.jsx)(_e,{label:"Targets",gridSizes:{xs:12},children:(0,r.jsx)(at.s,{cols:1,items:(Le.spec.targets||[Le.spec.target]).map(rn=>rn).map(rn=>{var En;return{text:rn,href:zt(rn,(Le==null||(En=Le.spec)===null||En===void 0?void 0:En.type)||"unknown",Kt)}})})})]})}const Nt=(0,V.Z)({gridItemCard:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px"},fullHeightCard:{display:"flex",flexDirection:"column",height:"100%"},gridItemCardContent:{flex:1},fullHeightCardContent:{flex:1}});function Dt(et){var lt,yt,At;const{variant:$t}=et,Ht=(0,f.qD)(),be=Nt(),{entity:Ce}=(0,g.X2)(),Ye=(0,f.h_)(z.q3),Le=(0,f.h_)(g.Ah),ct=(0,f.h_)(f.$v),Ct=(0,f.h_)(f.VE),dt=(0,f.tg)(P.jU),Qe=(0,f.tg)(P.ql),Ge=(0,g.CV)(Ce,Ye),ut=(lt=Ce.metadata.annotations)===null||lt===void 0?void 0:lt[p.Tf],pt={label:"View Source",disabled:!Ge,icon:(0,r.jsx)(z.nW,{type:Ge==null?void 0:Ge.integrationType}),href:Ge==null?void 0:Ge.locationTargetUrl},hn={label:"View TechDocs",disabled:!(!((yt=Ce.metadata.annotations)===null||yt===void 0)&&yt["backstage.io/techdocs-ref"])||!dt,icon:(0,r.jsx)(H.Z,{}),href:dt&&dt({namespace:Ce.metadata.namespace||p.zG,kind:Ce.kind,name:Ce.metadata.name})},pn=[pt,hn];if(de(Ce)){var fn;const on=(fn=Ht.getSystemIcon("scaffolder"))!==null&&fn!==void 0?fn:se.Z,An={label:"Launch Template",icon:(0,r.jsx)(on,{}),disabled:!Qe,href:Qe&&Qe({templateName:Ce.metadata.name,namespace:Ce.metadata.namespace||p.zG})};pn.push(An)}let qt="";$t==="gridItem"?qt=be.gridItemCard:$t==="fullHeight"&&(qt=be.fullHeightCard);let Cn="";$t==="gridItem"?Cn=be.gridItemCardContent:$t==="fullHeight"&&(Cn=be.fullHeightCardContent);const Kt=(At=Ce.metadata.annotations)===null||At===void 0?void 0:At[p.P1],rn=(Kt==null?void 0:Kt.startsWith("url:"))||(Kt==null?void 0:Kt.startsWith("file:")),En=(0,R.useCallback)(async()=>{try{await Le.refreshEntity((0,p.eE)(Ce)),ct.post({message:"Refresh scheduled",severity:"info"})}catch(on){Ct.post(on)}},[Le,ct,Ct,Ce]);return(0,r.jsxs)(te.Z,{className:qt,children:[(0,r.jsx)(L.Z,{title:"About",action:(0,r.jsxs)(r.Fragment,{children:[rn&&(0,r.jsx)(A.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:En,children:(0,r.jsx)(q.Z,{})}),(0,r.jsx)(A.Z,{component:W.rU,"aria-label":"Edit",disabled:!ut,title:"Edit Metadata",to:ut!=null?ut:"#",children:(0,r.jsx)(T.Z,{})})]}),subheader:(0,r.jsx)(W.M6,{links:pn})}),(0,r.jsx)(ae.Z,{}),(0,r.jsx)(oe.Z,{className:Cn,children:(0,r.jsx)(xt,{entity:Ce})})]})}},86359:function(St,ke,n){"use strict";n.d(ke,{E:function(){return H}});var r=n(52322),p=n(25271),W=n(53974),f=n(39709),z=n(90436),g=n(15459),u=n(27604),D=n(2997),ge=n(11640),de=n(28347),V=n(76635),te=n(2784),L=n(7089);const A=Object.freeze({createNameColumn(T){function R(P){var G;return((G=P.metadata)===null||G===void 0?void 0:G.title)||(0,f.$3)(P,{defaultKind:T==null?void 0:T.defaultKind})}return{title:"Name",field:"resolved.name",highlight:!0,customSort({entity:P},{entity:G}){return R(P).localeCompare(R(G))},render:({entity:P})=>{var G;return(0,r.jsx)(f.dx,{entityRef:P,defaultKind:(T==null?void 0:T.defaultKind)||"Component",title:(G=P.metadata)===null||G===void 0?void 0:G.title})}}},createSystemColumn(){return{title:"System",field:"resolved.partOfSystemRelationTitle",render:({resolved:T})=>(0,r.jsx)(f.rI,{entityRefs:T.partOfSystemRelations,defaultKind:"system"})}},createOwnerColumn(){return{title:"Owner",field:"resolved.ownedByRelationsTitle",render:({resolved:T})=>(0,r.jsx)(f.rI,{entityRefs:T.ownedByRelations,defaultKind:"group"})}},createSpecTargetsColumn(){return{title:"Targets",field:"entity.spec.targets",render:({entity:T})=>{var R,P;return(0,r.jsx)(r.Fragment,{children:((T==null||(R=T.spec)===null||R===void 0?void 0:R.targets)||(T==null||(P=T.spec)===null||P===void 0?void 0:P.target))&&(0,r.jsx)(W.Or,{text:(T.spec.targets||[T.spec.target]).join(", "),placement:"bottom-start"})})}}},createSpecTypeColumn(){return{title:"Type",field:"entity.spec.type",hidden:!0,width:"auto"}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"entity.spec.lifecycle"}},createMetadataDescriptionColumn(){return{title:"Description",field:"entity.metadata.description",render:({entity:T})=>(0,r.jsx)(W.Or,{text:T.metadata.description,placement:"bottom-start"}),width:"auto"}},createTagsColumn(){return{title:"Tags",field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:T})=>(0,r.jsx)(r.Fragment,{children:T.metadata.tags&&T.metadata.tags.map(R=>(0,r.jsx)(L.Z,{label:R,size:"small",variant:"outlined",style:{marginBottom:"0px"}},R))}),width:"auto"}},createTitleColumn(T){return{title:"Title",field:"entity.metadata.title",hidden:T==null?void 0:T.hidden,searchable:!0}},createLabelColumn(T,R){return{title:(R==null?void 0:R.title)||"Label",field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:P})=>{var G;const je=(G=P.metadata)===null||G===void 0?void 0:G.labels,Pe=je&&je[T]||(R==null?void 0:R.defaultValue);return(0,r.jsx)(r.Fragment,{children:Pe&&(0,r.jsx)(L.Z,{label:Pe,size:"small",variant:"outlined"},Pe)})},width:"auto"}},createNamespaceColumn(){return{title:"Namespace",field:"entity.metadata.namespace",width:"auto"}}});var ae=n(19928),oe=n.n(ae);const se=(0,g.Z)({root:{color:"#f3ba37"}})(ge.Z),q=(T,R)=>{const P=G=>G.metadata.title||(0,f.$3)(G,{defaultKind:"Component"});return P(T).localeCompare(P(R))},H=T=>{var R,P,G,je;const{columns:Pe,actions:N,tableOptions:_e,subtitle:at,emptyContent:It}=T,{isStarredEntity:zt,toggleStarredEntity:xt}=(0,f.CR)(),{loading:Nt,error:Dt,entities:et,filters:lt}=(0,f.wp)(),yt=(0,te.useMemo)(()=>{var Qe;return[A.createTitleColumn({hidden:!0}),A.createNameColumn({defaultKind:(Qe=lt.kind)===null||Qe===void 0?void 0:Qe.value}),...Ge(),A.createMetadataDescriptionColumn(),A.createTagsColumn()];function Ge(){var ut;const pt=[A.createSystemColumn(),A.createOwnerColumn(),A.createSpecTypeColumn(),A.createSpecLifecycleColumn()];switch((ut=lt.kind)===null||ut===void 0?void 0:ut.value){case"user":return[];case"domain":case"system":return[A.createOwnerColumn()];case"group":case"template":return[A.createSpecTypeColumn()];case"location":return[A.createSpecTypeColumn(),A.createSpecTargetsColumn()];default:return et.every(hn=>hn.metadata.namespace==="default")?pt:[...pt,A.createNamespaceColumn()]}}},[(R=lt.kind)===null||R===void 0?void 0:R.value,et]),At=lt.type===void 0;var $t;const Ht=(0,V.capitalize)(($t=(P=lt.user)===null||P===void 0?void 0:P.value)!==null&&$t!==void 0?$t:"all");if(Dt)return(0,r.jsx)("div",{children:(0,r.jsx)(W.GB,{severity:"error",title:"Could not fetch catalog entities.",children:(0,r.jsx)(W.Oi,{language:"text",text:Dt.toString()})})});const be=[({entity:Qe})=>{var Ge;const ut=(Ge=Qe.metadata.annotations)===null||Ge===void 0?void 0:Ge[p.l2],pt="View";return{icon:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(z.Z,{variant:"srOnly",children:pt}),(0,r.jsx)(D.Z,{fontSize:"small"})]}),tooltip:pt,disabled:!ut,onClick:()=>{ut&&window.open(ut,"_blank")}}},({entity:Qe})=>{var Ge;const ut=(Ge=Qe.metadata.annotations)===null||Ge===void 0?void 0:Ge[p.Tf],pt="Edit";return{icon:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(z.Z,{variant:"srOnly",children:pt}),(0,r.jsx)(u.Z,{fontSize:"small"})]}),tooltip:pt,disabled:!ut,onClick:()=>{ut&&window.open(ut,"_blank")}}},({entity:Qe})=>{const Ge=zt(Qe),ut=Ge?"Remove from favorites":"Add to favorites";return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(z.Z,{variant:"srOnly",children:ut}),Ge?(0,r.jsx)(se,{}):(0,r.jsx)(de.Z,{})]}),tooltip:ut,onClick:()=>xt(Qe)}}],Ce=et.sort(q).map(Qe=>{const Ge=(0,f.hF)(Qe,p.cz,{kind:"system"}),ut=(0,f.hF)(Qe,p.S4);return{entity:Qe,resolved:{name:(0,f.$3)(Qe,{defaultKind:"Component"}),ownedByRelationsTitle:ut.map(pt=>(0,f.$3)(pt,{defaultKind:"group"})).join(", "),ownedByRelations:ut,partOfSystemRelationTitle:Ge.map(pt=>(0,f.$3)(pt,{defaultKind:"system"})).join(", "),partOfSystemRelations:Ge}}}),Ye=(Pe||yt).find(Qe=>Qe.title==="Type");Ye&&(Ye.hidden=!At);const Le=Ce.length>20,ct=((G=lt.kind)===null||G===void 0?void 0:G.value)||"",Ct=((je=lt.type)===null||je===void 0?void 0:je.value)||"",dt=[Ht,Ct,oe()(ct)].filter(Qe=>Qe).join(" ");return(0,r.jsx)(W.iA,{isLoading:Nt,columns:Pe||yt,options:{paging:Le,pageSize:20,actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!Nt,padding:"dense",pageSizeOptions:[20,50,100],..._e},title:`${dt} (${et.length})`,data:Ce,actions:N||be,subtitle:at,emptyContent:It})};H.columns=A},85877:function(St,ke,n){"use strict";n.r(ke),n.d(ke,{EntityLabelsCard:function(){return te},hasLabels:function(){return L}});var r=n(52322),p=n(39709),W=n(2784),f=n(53974),z=n(79692),g=n(90436),u=n(77277);const D=`metadata:
34
34
  name: example
35
35
  labels:
@@ -519,4 +519,4 @@ ${M.href}
519
519
 
520
520
  Feedback:`),Tt=(ye==null?void 0:ye.type)==="github"?(0,Cn.BT)(ue.href,"blob"):ue.href,Et=on()(Tt),st=`/${Et.organization}/${Et.name}`,Ne=M.cloneNode();switch(ye==null?void 0:ye.type){case"gitlab":Ne.href=`${ue.origin}${st}/issues/new?issue[title]=${ot}&issue[description]=${ht}`;break;case"github":Ne.href=`${ue.origin}${st}/issues/new?title=${ot}&body=${ht}`;break;default:return O}return rn.render(p.createElement(Kt.Z),Ne),Ne.style.paddingLeft="5px",Ne.title="Leave feedback for this page",Ne.id="git-feedback-link",M==null||M.insertAdjacentElement("beforebegin",Ne),O};var Zn=n(44882);const nt=()=>v=>{const O=v.querySelector('.md-header label[for="__drawer"]'),J=v.querySelector("article");if(!O||!J)return v;const M=O.cloneNode();return rn.render(p.createElement(Zn.Z),M),M.id="toggle-sidebar",M.title="Toggle Sidebar",M.classList.add("md-content__button"),M.style.setProperty("padding","0 0 0 5px"),M.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),J==null||J.prepend(M),v},sn=()=>v=>(((J,M)=>{Array.from(J).filter(ue=>ue.hasAttribute(M)).forEach(ue=>{const ye=ue.getAttribute(M);if(ye){ye.match(/^https?:\/\//i)&&ue.setAttribute("target","_blank");try{const Me=Yt(window.location.href);ue.setAttribute(M,new URL(ye,Me).toString())}catch{ue.replaceWith(ue.textContent||ye)}}})})(Array.from(v.getElementsByTagName("a")),"href"),v);function Yt(v){const O=new URL(v);return!O.pathname.endsWith("/")&&!O.pathname.endsWith(".html")&&(O.pathname+="/"),O.toString()}const rt=({baseUrl:v,onClick:O})=>J=>(Array.from(J.getElementsByTagName("a")).forEach(M=>{M.addEventListener("click",ue=>{const Me=M.getAttribute("href");Me&&Me.startsWith(v)&&!M.hasAttribute("download")&&(ue.preventDefault(),O(ue,Me))})}),J);var Pn=n(15459),Jt=n(80030),Ln=n(72379),Un=n(41547),On=n(95074);const Mn=(0,Pn.Z)(v=>({tooltip:{fontSize:"inherit",color:v.palette.text.primary,margin:0,padding:v.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(Jt.ZP),Se=()=>(0,r.jsx)(Ln.Z,{children:(0,r.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})}),ce=({text:v})=>{const[O,J]=(0,p.useState)(!1),[,M]=(0,On.Z)(),ue=(0,p.useCallback)(()=>{M(v),J(!0)},[v,M]),ye=(0,p.useCallback)(()=>{J(!1)},[J]);return(0,r.jsx)(Mn,{title:"Copied to clipboard",placement:"left",open:O,onClose:ye,leaveDelay:1e3,children:(0,r.jsx)(L.Z,{style:{color:"inherit"},className:"md-clipboard md-icon",onClick:ue,children:(0,r.jsx)(Se,{})})})},Ie=v=>O=>{const J=O.querySelectorAll("pre > code");for(const ue of J){var M;const ye=ue.textContent||"",Me=document.createElement("div");ue==null||(M=ue.parentElement)===null||M===void 0||M.prepend(Me),rn.render((0,r.jsx)(Un.Z,{theme:v,children:(0,r.jsx)(ce,{text:ye})}),Me)}return O},Ue=()=>v=>{var O;return(O=v.querySelector(".md-header"))===null||O===void 0||O.remove(),v},Ve=()=>v=>{var O,J;return(O=v.querySelector(".md-footer .md-copyright"))===null||O===void 0||O.remove(),(J=v.querySelector(".md-footer-copyright"))===null||J===void 0||J.remove(),v},le=({onLoading:v,onLoaded:O})=>J=>(v(),J.addEventListener(z.Ox,function M(){O(),J.removeEventListener(z.Ox,M)}),J),U=()=>v=>(v.addEventListener(z.Ox,function O(){if(window.location.hash){var J;const M=window.location.hash.slice(1);(J=v==null?void 0:v.querySelector(`[id="${M}"]`))===null||J===void 0||J.scrollIntoView()}v.removeEventListener(z.Ox,O)}),v),he=()=>v=>(setTimeout(()=>{const O=v==null?void 0:v.querySelectorAll("li.md-nav__item--active");O.length!==0&&(O.forEach(M=>{const ue=M==null?void 0:M.querySelector("input");ue!=null&&ue.checked||ue==null||ue.click()}),O[O.length-1].scrollIntoView())},200),v),$e=async(v,O)=>{let J;if(typeof v=="string")J=new DOMParser().parseFromString(v,"text/html").documentElement;else if(v instanceof Element)J=v;else throw new Error("dom is not a recognized type");for(const M of O)J=await M(J);return J};var Ke=n(73557);function Je(v,O){const J=new URL(O),M=`${J.origin}${J.pathname.replace(/\/$/,"")}`,ue=v.replace(M,"").replace(/^\/+/,""),ye=new URL(`http://localhost/${ue}`);return`${ye.pathname}${ye.search}${ye.hash}`}function Zt(){const v=(0,Ke.s0)(),J=(0,H.h_)(H.Ds).getOptionalString("app.baseUrl");return(0,p.useCallback)(ue=>{let ye=ue;if(J)try{ye=Je(ue,J)}catch{}v(ye)},[v,J])}const _t="screen and (max-width: 76.1875em)",en=v=>{const O=Zt(),J=(0,je.Z)(),M=(0,Pe.Z)(_t),ue=Ht(),ye=pn(),Me=(0,H.z$)(),ot=(0,H.h_)(z.Dl),ht=(0,H.h_)(N.q3),{state:Tt,path:Et,content:st}=(0,R.DK)(),[Ne,Ut]=(0,p.useState)(null),Xt=(0,z.ux)(Ne),bt=(0,p.useCallback)(()=>{if(!Ne)return;Ne.querySelectorAll(".md-sidebar").forEach(He=>{if(M)He.style.top="0px";else{const sr=document==null?void 0:document.querySelector(".techdocs-reader-page");var Lt;const mr=(Lt=sr==null?void 0:sr.getBoundingClientRect().top)!==null&&Lt!==void 0?Lt:0;var xn;let Hn=(xn=Ne.getBoundingClientRect().top)!==null&&xn!==void 0?xn:0;const cn=Ne.querySelector(".md-container > .md-tabs");var nn;const ir=(nn=cn==null?void 0:cn.getBoundingClientRect().height)!==null&&nn!==void 0?nn:0;Hn<mr&&(Hn=mr),He.style.top=`${Math.max(Hn,0)+ir}px`}He.style.setProperty("opacity","1")})},[Ne,M]);(0,p.useEffect)(()=>(window.addEventListener("resize",bt),window.addEventListener("scroll",bt,!0),()=>{window.removeEventListener("resize",bt),window.removeEventListener("scroll",bt,!0)}),[Ne,bt]);const Ft=(0,p.useCallback)(()=>{if(!Ne)return;const vt=Ne.querySelector(".md-footer");vt&&(vt.style.width=`${Ne.getBoundingClientRect().width}px`)},[Ne]);(0,p.useEffect)(()=>(window.addEventListener("resize",Ft),()=>{window.removeEventListener("resize",Ft)}),[Ne,Ft]),(0,p.useEffect)(()=>{Xt||(Ft(),bt())},[Tt,Xt,Ft,bt]);const gn=(0,p.useCallback)((vt,He)=>$e(vt,[ue,qt({techdocsStorageApi:ot,entityId:v,path:He}),sn(),nt(),Ue(),Ve(),An(ht),ye]),[v,ht,ot,ue,ye]),wn=(0,p.useCallback)(async vt=>$e(vt,[U(),he(),Ie(J),rt({baseUrl:window.location.origin,onClick:(He,Lt)=>{var xn;const nn=He.ctrlKey||He.metaKey,sr=new URL(Lt),mr=((xn=He.target)===null||xn===void 0?void 0:xn.innerText)||Lt,Hn=Lt.replace(window.location.origin,"");if(Me.captureEvent("click",mr,{attributes:{to:Hn}}),sr.hash)if(nn)window.open(Lt,"_blank");else{var cn;O(Lt),(cn=vt==null?void 0:vt.querySelector(`[id="${sr.hash.slice(1)}"]`))===null||cn===void 0||cn.scrollIntoView()}else nn?window.open(Lt,"_blank"):O(Lt)}}),le({onLoading:()=>{},onLoaded:()=>{var He;(He=vt.querySelector(".md-nav__title"))===null||He===void 0||He.removeAttribute("for")}}),le({onLoading:()=>{Array.from(vt.querySelectorAll(".md-sidebar")).forEach(Lt=>{Lt.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[J,O,Me]);return(0,p.useEffect)(()=>{if(!st)return()=>{};let vt=!0;return gn(st,Et).then(async He=>{if(!(He!=null&&He.innerHTML)||!vt)return;window.scroll({top:0});const Lt=await wn(He);Ut(Lt)}),()=>{vt=!1}},[st,Et,gn,wn]),Ne};var Qt=n(8560);const tn=()=>{const v=(0,z.$L)(),{shadowRoot:O}=(0,z.x1)(),J=O==null?void 0:O.querySelector('[data-md-component="content"]'),M=O==null?void 0:O.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let ue=M==null?void 0:M.querySelector('[data-techdocs-addons-location="primary sidebar"]');ue||(ue=document.createElement("div"),ue.setAttribute("data-techdocs-addons-location","primary sidebar"),M==null||M.prepend(ue));const ye=O==null?void 0:O.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Me=ye==null?void 0:ye.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Me||(Me=document.createElement("div"),Me.setAttribute("data-techdocs-addons-location","secondary sidebar"),ye==null||ye.prepend(Me)),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Qt.Z,{container:ue,children:v.renderComponentsByLocation(z.oZ.PrimarySidebar)}),(0,r.jsx)(Qt.Z,{container:J,children:v.renderComponentsByLocation(z.oZ.Content)}),(0,r.jsx)(Qt.Z,{container:Me,children:v.renderComponentsByLocation(z.oZ.SecondarySidebar)})]})},_=(0,W.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"},"@media print":{display:"none"}}}),X=(0,R.m1)(v=>{var O;const{withSearch:J=!0,onReady:M}=v,ue=_(),{entityMetadata:{value:ye,loading:Me},entityRef:ot,setShadowRoot:ht}=(0,z.x1)(),Tt=en(ot),Et=(0,p.useCallback)(st=>{ht(st),M instanceof Function&&M()},[ht,M]);return Me===!1&&!ye?(0,r.jsx)(g.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):Tt?(0,r.jsx)(g.VY,{children:(0,r.jsxs)(f.Z,{container:!0,children:[(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(G,{})}),J&&(0,r.jsx)(f.Z,{className:ue.search,xs:"auto",item:!0,children:(0,r.jsx)(u.S,{entityId:ot,entityTitle:ye==null||(O=ye.metadata)===null||O===void 0?void 0:O.title})}),(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(z.VA,{element:Tt,onAppend:Et,children:(0,r.jsx)(tn,{})})})]})}):(0,r.jsx)(g.VY,{children:(0,r.jsx)(f.Z,{container:!0,children:(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(G,{})})})})}),ee=null},93225:function(St,ke,n){"use strict";n.d(ke,{S:function(){return oe}});var r=n(52322),p=n(2784),W=n(18671),f=n(60905),z=n(98069),g=n(60364),u=n(73250),D=n(61886),ge=n(39709),de=n(25271),V=n(53974),te=n(60871),L=n(76635),A=n(95573);const ae=(0,r.jsx)(z.Z,{animation:"wave",variant:"text",height:40}),oe=se=>{const{palette:{common:{white:q}}}=(0,g.Z)(),{children:H}=se,T=(0,D.$L)(),R=(0,te.h_)(te.Ds),{title:P,setTitle:G,subtitle:je,setSubtitle:Pe,entityRef:N,metadata:{value:_e,loading:at},entityMetadata:{value:It,loading:zt}}=(0,D.x1)();(0,p.useEffect)(()=>{_e&&(G(_e.site_name),Pe(()=>{let{site_description:Ce}=_e;return(!Ce||Ce==="None")&&(Ce=""),Ce}))},[_e,G,Pe]);const xt=R.getOptional("app.title")||"Backstage",Nt=[P,je,xt].filter(Boolean).join(" | "),{locationMetadata:Dt,spec:et}=It||{},lt=et==null?void 0:et.lifecycle,yt=It?(0,ge.hF)(It,de.S4):[],At=(0,te.tg)(A._Z)(),$t=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(V.i9,{label:(0,L.capitalize)((It==null?void 0:It.kind)||"entity"),value:(0,r.jsx)(ge.dx,{color:"inherit",entityRef:N,title:It==null?void 0:It.metadata.title,defaultKind:"Component"})}),yt.length>0&&(0,r.jsx)(V.i9,{label:"Owner",value:(0,r.jsx)(ge.rI,{color:"inherit",entityRefs:yt,defaultKind:"group"})}),lt?(0,r.jsx)(V.i9,{label:"Lifecycle",value:lt}):null,Dt&&Dt.type!=="dir"&&Dt.type!=="file"?(0,r.jsx)(V.i9,{label:"",value:(0,r.jsxs)(f.Z,{container:!0,direction:"column",alignItems:"center",style:{color:q},children:[(0,r.jsx)(f.Z,{style:{padding:0},item:!0,children:(0,r.jsx)(u.Z,{style:{marginTop:"-25px"}})}),(0,r.jsx)(f.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:Dt.target}):null]});return!zt&&It===void 0||!at&&_e===void 0?null:(0,r.jsxs)(V.h4,{type:"Documentation",typeLink:At,title:P||ae,subtitle:je===""?void 0:je||ae,children:[(0,r.jsx)(W.Z,{titleTemplate:"%s",children:(0,r.jsx)("title",{children:Nt})}),$t,H,T.renderComponentsByLocation(D.oZ.Header)]})}},65124:function(St,ke,n){"use strict";n.d(ke,{b:function(){return te}});var r=n(52322),p=n(2784),W=n(79692),f=n(15223),z=n(95544),g=n(80030),u=n(61837),D=n(48348),ge=n(47603),de=n(61886);const V=(0,W.Z)(L=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:L.spacing(3,3,0),"@media print":{display:"none"}}})),te=L=>{const A=V(),[ae,oe]=(0,p.useState)(null),se=(0,p.useCallback)(je=>{oe(je.currentTarget)},[]),q=(0,p.useCallback)(()=>{oe(null)},[]),{entityMetadata:{value:H,loading:T}}=(0,de.x1)(),R=(0,de.$L)(),P=R.renderComponentsByLocation(de.oZ.Subheader),G=R.renderComponentsByLocation(de.oZ.Settings);return!P&&!G||T===!1&&!H?null:(0,r.jsx)(f.Z,{classes:A,...L.toolbarProps,children:(0,r.jsxs)(z.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[P,G?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(g.ZP,{title:"Settings",children:(0,r.jsx)(u.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:se,children:(0,r.jsx)(ge.Z,{})})}),(0,r.jsx)(D.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:ae,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(ae),onClose:q,keepMounted:!0,children:(0,r.jsx)("div",{children:G})})]}):null]})})}},95481:function(St,ke,n){"use strict";n.d(ke,{DK:function(){return te},m1:function(){return A}});var r=n(52322),p=n(2784),W=n(73557),f=n(61886),z=n(60871),g=n(64279),u=n(77446);function D({contentLoading:ae,content:oe,activeSyncState:se}){return ae||se==="BUILD_READY_RELOAD"||!oe&&se==="CHECKING"?"CHECKING":!oe&&se==="BUILDING"?"INITIAL_BUILD":oe?se==="BUILDING"?"CONTENT_STALE_REFRESHING":se==="BUILD_READY"?"CONTENT_STALE_READY":se==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function ge(ae,oe){const se={...ae};switch(oe.type){case"sync":oe.state==="CHECKING"&&(se.buildLog=[]),se.activeSyncState=oe.state,se.syncError=oe.syncError;break;case"contentLoading":se.contentLoading=!0,se.contentError=void 0;break;case"content":typeof oe.path=="string"&&(se.path=oe.path),se.contentLoading=!1,se.content=oe.content,se.contentError=oe.contentError;break;case"buildLog":se.buildLog=se.buildLog.concat(oe.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(se.activeSyncState)&&["contentLoading","content"].includes(oe.type)&&(se.activeSyncState="UP_TO_DATE",se.buildLog=[]),se}function de(ae,oe,se,q){var H,T;const[R,P]=(0,p.useReducer)(ge,{activeSyncState:"CHECKING",path:q,contentLoading:!0,buildLog:[]}),G=(0,z.h_)(f.Dl),{retry:je}=(0,u.Z)(async()=>{P({type:"contentLoading"});try{const _e=await G.getEntityDocs({kind:ae,namespace:oe,name:se},q);return P({type:"content",content:_e,path:q}),_e}catch(_e){P({type:"content",contentError:_e,path:q})}},[G,ae,oe,se,q]),Pe=(0,p.useRef)({content:void 0,reload:()=>{}});return Pe.current={content:R.content,reload:je},(0,g.default)(async()=>{P({type:"sync",state:"CHECKING"});const _e=setTimeout(()=>{P({type:"sync",state:"BUILDING"})},1e3);try{switch(await G.syncEntityDocs({kind:ae,namespace:oe,name:se},It=>{P({type:"buildLog",log:It})})){case"updated":Pe.current.content?P({type:"sync",state:"BUILD_READY"}):(Pe.current.reload(),P({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":P({type:"sync",state:"UP_TO_DATE"});break;default:P({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(at){P({type:"sync",state:"ERROR",syncError:at})}finally{clearTimeout(_e)}},[ae,se,oe,G,P,Pe]),{state:(0,p.useMemo)(()=>D({activeSyncState:R.activeSyncState,contentLoading:R.contentLoading,content:R.content}),[R.activeSyncState,R.content,R.contentLoading]),contentReload:je,path:R.path,content:R.content,contentErrorMessage:(H=R.contentError)===null||H===void 0?void 0:H.toString(),syncErrorMessage:(T=R.syncError)===null||T===void 0?void 0:T.toString(),buildLog:R.buildLog}}const V=(0,p.createContext)({}),te=()=>(0,p.useContext)(V),L=ae=>{const{children:oe}=ae,{"*":se=""}=(0,W.UO)(),{entityRef:q}=(0,f.x1)(),{kind:H,namespace:T,name:R}=q,P=de(H,T,R,se);return(0,r.jsx)(V.Provider,{value:P,children:oe instanceof Function?oe(P):oe})},A=ae=>oe=>(0,r.jsx)(L,{children:(0,r.jsx)(ae,{...oe})})},95573:function(St,ke,n){"use strict";n.d(ke,{Fw:function(){return W},_Z:function(){return p},pd:function(){return f}});var r=n(60871);const p=(0,r.NT)({id:"techdocs:index-page"}),W=(0,r.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),f=(0,r.NT)({id:"techdocs:catalog-reader-view"})},55511:function(St,ke,n){"use strict";n.r(ke),n.d(ke,{TechDocsSearchResultListItem:function(){return de}});var r=n(52322),p=n(2784),W=n(79692),f=n(49378),z=n(86136),g=n(90436),u=n(53974),D=n(15096);const ge=(0,W.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),de=V=>{const{result:te,highlight:L,lineClamp:A=5,asListItem:ae=!0,asLink:oe=!0,title:se,icon:q}=V,H=ge(),T=({children:G})=>oe?(0,r.jsx)(u.rU,{noTrack:!0,to:te.location,children:G}):(0,r.jsx)(r.Fragment,{children:G}),R=()=>{const G=L!=null&&L.fields.title?(0,r.jsx)(D.FA,{text:L.fields.title,preTag:L.preTag,postTag:L.postTag}):te.title,je=L!=null&&L.fields.entityTitle?(0,r.jsx)(D.FA,{text:L.fields.entityTitle,preTag:L.preTag,postTag:L.postTag}):te.entityTitle,Pe=L!=null&&L.fields.name?(0,r.jsx)(D.FA,{text:L.fields.name,preTag:L.preTag,postTag:L.postTag}):te.name;return te?(0,r.jsx)(f.Z,{className:H.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,r.jsx)(T,{children:se||(0,r.jsxs)(r.Fragment,{children:[G," | ",je!=null?je:Pe," docs"]})}),secondary:(0,r.jsx)(g.Z,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:A,overflow:"hidden"},color:"textSecondary",variant:"body2",children:L!=null&&L.fields.text?(0,r.jsx)(D.FA,{text:L.fields.text,preTag:L.preTag,postTag:L.postTag}):te.text})}):null},P=({children:G})=>ae?(0,r.jsxs)(r.Fragment,{children:[q&&(0,r.jsx)(z.Z,{children:typeof q=="function"?q(te):q}),(0,r.jsx)("div",{className:H.flexContainer,children:G})]}):(0,r.jsx)(r.Fragment,{children:G});return(0,r.jsx)(P,{children:(0,r.jsx)(R,{})})}},22478:function(St,ke,n){"use strict";n.d(ke,{S:function(){return D}});var r=n(52322),p=n(15096),W=n(2784),f=n(73557),z=n(55511);const g=ge=>ge==null?void 0:ge.document,u=ge=>{const{entityId:de,entityTitle:V,debounceTime:te=150}=ge,[L,A]=(0,W.useState)(!1),ae=(0,f.s0)(),{setFilters:oe,result:{loading:se,value:q}}=(0,p.Rx)(),[H,T]=(0,W.useState)([]);(0,W.useEffect)(()=>{let Pe=!0;if(Pe&&q){const N=q.results.slice(0,10);T(N)}return()=>{Pe=!1}},[se,q]);const{kind:R,name:P,namespace:G}=de;(0,W.useEffect)(()=>{oe(Pe=>({...Pe,kind:R,namespace:G,name:P}))},[R,G,P,oe]);const je=(Pe,N)=>{if(g(N)){const{location:_e}=N.document;ae(_e)}};return(0,r.jsx)(p.qO,{"data-testid":"techdocs-search-bar",size:"small",open:L,getOptionLabel:()=>"",filterOptions:Pe=>Pe,onClose:()=>{A(!1)},onFocus:()=>{A(!0)},onChange:je,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:H,renderOption:({document:Pe,highlight:N})=>(0,r.jsx)(z.TechDocsSearchResultListItem,{result:Pe,lineClamp:3,asListItem:!1,asLink:!1,title:Pe.title,highlight:N}),loading:se,inputDebounceTime:te,inputPlaceholder:`Search ${V||de.name} docs`,freeSolo:!1})},D=ge=>{const de={term:"",types:["techdocs"],pageCursor:"",filters:ge.entityId};return(0,r.jsx)(p.Nd,{initialState:de,children:(0,r.jsx)(u,{...ge})})}},53260:function(){}},function(St){var ke=function(r){return St(St.s=r)};St.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,242,5109,6816,5218,4736],function(){return ke(30966)});var n=St.O()}]);})();
521
521
 
522
- //# sourceMappingURL=main.39b6f8fc.js.map
522
+ //# sourceMappingURL=main.d1859ff1.js.map